	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_process_eeprom
_cx18_process_eeprom:                   ## @cx18_process_eeprom
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	leaq	-40(%rbp), %rsi
	callq	_cx18_read_eeprom
	movl	-40(%rbp), %esi
	cmpl	$74300, %esi                    ## imm = 0x1223C
	jle	LBB0_1
## %bb.8:
	cmpl	$74650, %esi                    ## imm = 0x1239A
	jg	LBB0_25
## %bb.9:
	leal	-74301(%rsi), %eax
	cmpl	$60, %eax
	ja	LBB0_10
## %bb.14:
	movabsq	$1154047404514738177, %rcx      ## imm = 0x1004000000100001
	btq	%rax, %rcx
	jae	LBB0_10
## %bb.15:
	movq	_CX18_CARD_HVR_1600_S5H1411@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_1:
	cmpl	$74020, %esi                    ## imm = 0x12124
	jle	LBB0_2
## %bb.5:
	leal	-74021(%rsi), %eax
	cmpl	$20, %eax
	ja	LBB0_6
## %bb.7:
	movl	$1049601, %ecx                  ## imm = 0x100401
	btl	%eax, %ecx
	jb	LBB0_13
LBB0_6:
	cmpl	$74141, %esi                    ## imm = 0x1219D
	je	LBB0_13
	jmp	LBB0_12
LBB0_25:
	cmpl	$74750, %esi                    ## imm = 0x123FE
	jg	LBB0_28
## %bb.26:
	cmpl	$74651, %esi                    ## imm = 0x1239B
	je	LBB0_13
## %bb.27:
	cmpl	$74691, %esi                    ## imm = 0x123C3
	je	LBB0_13
	jmp	LBB0_12
LBB0_10:
	leal	-74541(%rsi), %eax
	cmpl	$50, %eax
	ja	LBB0_12
## %bb.11:
	movabsq	$1125899906843649, %rcx         ## imm = 0x4000000000401
	btq	%rax, %rcx
	jb	LBB0_13
	jmp	LBB0_12
LBB0_2:
	cmpl	$-1, %esi
	je	LBB0_30
## %bb.3:
	testl	%esi, %esi
	je	LBB0_31
## %bb.4:
	cmpl	$1816, %esi                     ## imm = 0x718
	je	LBB0_39
	jmp	LBB0_12
LBB0_28:
	cmpl	$74891, %esi                    ## imm = 0x1248B
	je	LBB0_13
## %bb.29:
	cmpl	$74751, %esi                    ## imm = 0x123FF
	je	LBB0_13
LBB0_12:
	leaq	L_.str.2(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_CX18_ERR
LBB0_13:
	movq	_CX18_CARD_HVR_1600_ESMT@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %edi
	callq	_cx18_get_card
	movq	%rax, 16(%rbx)
	movl	8(%rax), %ecx
	movl	%ecx, 28(%rbx)
	movl	4(%rax), %esi
	movl	%esi, 12(%rbx)
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_INFO
	movq	-32(%rbp), %rax
	movq	_TUNER_ABSENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.18:
	cmpl	$-1, 4(%rbx)
	je	LBB0_19
LBB0_20:
	cmpl	$-1, 8(%rbx)
	je	LBB0_21
LBB0_22:
	cmpl	$0, (%rbx)
	jne	LBB0_39
	jmp	LBB0_23
LBB0_17:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_ERR
	cmpl	$-1, 4(%rbx)
	jne	LBB0_20
LBB0_19:
	movl	-32(%rbp), %eax
	movl	%eax, 4(%rbx)
	cmpl	$-1, 8(%rbx)
	jne	LBB0_22
LBB0_21:
	xorl	%eax, %eax
	cmpq	$0, -24(%rbp)
	setne	%al
	movl	%eax, 8(%rbx)
	cmpl	$0, (%rbx)
	jne	LBB0_39
LBB0_23:
	movl	-16(%rbp), %eax
	movq	_V4L2_STD_PAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_32
## %bb.24:
	leaq	L_.str.5(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	_V4L2_STD_PAL_BG@GOTPCREL(%rip), %rax
	movq	_V4L2_STD_PAL_H@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, (%rbx)
	jmp	LBB0_39
LBB0_32:
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_34
## %bb.33:
	leaq	L_.str.6(%rip), %rdi
	callq	_CX18_DEBUG_INFO
LBB0_37:
	movq	_V4L2_STD_NTSC_M@GOTPCREL(%rip), %rax
	jmp	LBB0_38
LBB0_30:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_INFO
	jmp	LBB0_39
LBB0_31:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_ERR
	jmp	LBB0_39
LBB0_34:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_36
## %bb.35:
	leaq	L_.str.7(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	_V4L2_STD_SECAM_L@GOTPCREL(%rip), %rax
LBB0_38:
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_39:
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_36:
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_CX18_INFO
	jmp	LBB0_37
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_CARD_HVR_1600_S5H1411,4,2 ## @CX18_CARD_HVR_1600_S5H1411
	.comm	_CX18_CARD_HVR_1600_ESMT,4,2    ## @CX18_CARD_HVR_1600_ESMT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown EEPROM encoding\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid EEPROM\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unknown model %d, defaulting to original HVR-1600 (cardtype=1)\n"

L_.str.3:                               ## @.str.3
	.asciz	"Autodetected %s\n"

	.comm	_TUNER_ABSENT,8,3               ## @TUNER_ABSENT
L_.str.4:                               ## @.str.4
	.asciz	"tveeprom cannot autodetect tuner!\n"

	.comm	_V4L2_STD_PAL,4,2               ## @V4L2_STD_PAL
L_.str.5:                               ## @.str.5
	.asciz	"PAL tuner detected\n"

	.comm	_V4L2_STD_PAL_BG,4,2            ## @V4L2_STD_PAL_BG
	.comm	_V4L2_STD_PAL_H,4,2             ## @V4L2_STD_PAL_H
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
L_.str.6:                               ## @.str.6
	.asciz	"NTSC tuner detected\n"

	.comm	_V4L2_STD_NTSC_M,4,2            ## @V4L2_STD_NTSC_M
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
L_.str.7:                               ## @.str.7
	.asciz	"SECAM tuner detected\n"

	.comm	_V4L2_STD_SECAM_L,4,2           ## @V4L2_STD_SECAM_L
L_.str.8:                               ## @.str.8
	.asciz	"No tuner detected, default to NTSC-M\n"

	.no_dead_strip	_cx18_process_eeprom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_process_eeprom
_cx18_process_eeprom:                   ; @cx18_process_eeprom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x1, sp, #16
	bl	_cx18_read_eeprom
	ldr	w8, [sp, #16]
	mov	w9, #8764
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.le	LBB0_4
; %bb.1:
	mov	w9, #9114
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.gt	LBB0_6
; %bb.2:
	sub	w9, w8, #18, lsl #12            ; =73728
	sub	w9, w9, #573
	cmp	w9, #60
	mov	w10, #1
	lsl	x9, x10, x9
	mov	x10, #1
	movk	x10, #16, lsl #16
	movk	x10, #4100, lsl #48
	and	x9, x9, x10
	ccmp	x9, #0, #4, ls
	b.eq	LBB0_9
; %bb.3:
Lloh0:
	adrp	x8, _CX18_CARD_HVR_1600_S5H1411@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX18_CARD_HVR_1600_S5H1411@GOTPAGEOFF]
	b	LBB0_19
LBB0_4:
	mov	w9, #8484
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.le	LBB0_11
; %bb.5:
	sub	w9, w8, #18, lsl #12            ; =73728
	sub	w9, w9, #293
	cmp	w9, #20
	mov	w10, #1
	lsl	w9, w10, w9
	mov	w10, #1025
	movk	w10, #16, lsl #16
	and	w9, w9, w10
	ccmp	w9, #0, #4, ls
	mov	w9, #8605
	movk	w9, #1, lsl #16
	ccmp	w8, w9, #4, eq
	b.eq	LBB0_18
	b	LBB0_17
LBB0_6:
	mov	w9, #9214
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.gt	LBB0_14
; %bb.7:
	mov	w9, #9115
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.eq	LBB0_18
; %bb.8:
	mov	w9, #9155
	b	LBB0_16
LBB0_9:
	sub	w9, w8, #18, lsl #12            ; =73728
	sub	w9, w9, #813
	cmp	w9, #50
	b.hi	LBB0_17
; %bb.10:
	mov	w10, #1
	lsl	x9, x10, x9
	mov	x10, #1025
	movk	x10, #4, lsl #48
	tst	x9, x10
	b.ne	LBB0_18
	b	LBB0_17
LBB0_11:
	cmn	w8, #1
	b.eq	LBB0_31
; %bb.12:
	cbz	w8, LBB0_32
; %bb.13:
	cmp	w8, #1816
	b.eq	LBB0_37
	b	LBB0_17
LBB0_14:
	mov	w9, #9355
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.eq	LBB0_18
; %bb.15:
	mov	w9, #9215
LBB0_16:
	movk	w9, #1, lsl #16
	cmp	w8, w9
	b.eq	LBB0_18
LBB0_17:
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_ERR
LBB0_18:
Lloh4:
	adrp	x8, _CX18_CARD_HVR_1600_ESMT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CX18_CARD_HVR_1600_ESMT@GOTPAGEOFF]
LBB0_19:
	ldr	w0, [x8]
	bl	_cx18_get_card
	str	x0, [x19, #16]
	ldr	w8, [x0, #8]
	str	w8, [x19, #28]
	ldr	w8, [x0, #4]
	str	w8, [x19, #12]
	ldr	w9, [x0]
	str	w9, [x19, #24]
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_CX18_INFO
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, _TUNER_ABSENT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TUNER_ABSENT@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.20:
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_CX18_ERR
LBB0_21:
	ldr	w8, [x19, #4]
	cmn	w8, #1
	b.ne	LBB0_23
; %bb.22:
	ldr	x8, [sp, #24]
	str	w8, [x19, #4]
LBB0_23:
	ldr	w8, [x19, #8]
	cmn	w8, #1
	b.eq	LBB0_25
; %bb.24:
	ldr	w8, [x19]
	cbnz	w8, LBB0_37
	b	LBB0_26
LBB0_25:
	ldr	x8, [sp, #32]
	cmp	x8, #0
	cset	w8, ne
	str	w8, [x19, #8]
	ldr	w8, [x19]
	cbnz	w8, LBB0_37
LBB0_26:
	ldr	w8, [sp, #40]
Lloh13:
	adrp	x9, _V4L2_STD_PAL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _V4L2_STD_PAL@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_28
; %bb.27:
Lloh16:
	adrp	x0, l_.str.5@PAGE
Lloh17:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_CX18_DEBUG_INFO
Lloh18:
	adrp	x8, _V4L2_STD_PAL_BG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _V4L2_STD_PAL_BG@GOTPAGEOFF]
Lloh20:
	adrp	x9, _V4L2_STD_PAL_H@GOTPAGE
Lloh21:
	ldr	x9, [x9, _V4L2_STD_PAL_H@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	orr	w8, w8, w9
	b	LBB0_36
LBB0_28:
Lloh24:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh25:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_33
; %bb.29:
Lloh27:
	adrp	x0, l_.str.6@PAGE
Lloh28:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_CX18_DEBUG_INFO
LBB0_30:
Lloh29:
	adrp	x8, _V4L2_STD_NTSC_M@GOTPAGE
Lloh30:
	ldr	x8, [x8, _V4L2_STD_NTSC_M@GOTPAGEOFF]
	b	LBB0_35
LBB0_31:
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_INFO
	b	LBB0_37
LBB0_32:
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_ERR
	b	LBB0_37
LBB0_33:
Lloh35:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh36:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_38
; %bb.34:
Lloh38:
	adrp	x0, l_.str.7@PAGE
Lloh39:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_CX18_DEBUG_INFO
Lloh40:
	adrp	x8, _V4L2_STD_SECAM_L@GOTPAGE
Lloh41:
	ldr	x8, [x8, _V4L2_STD_SECAM_L@GOTPAGEOFF]
LBB0_35:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
LBB0_36:
	str	w8, [x19]
LBB0_37:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_38:
Lloh42:
	adrp	x0, l_.str.8@PAGE
Lloh43:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_CX18_INFO
	b	LBB0_30
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_CARD_HVR_1600_S5H1411,4,2 ; @CX18_CARD_HVR_1600_S5H1411
	.comm	_CX18_CARD_HVR_1600_ESMT,4,2    ; @CX18_CARD_HVR_1600_ESMT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown EEPROM encoding\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid EEPROM\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unknown model %d, defaulting to original HVR-1600 (cardtype=1)\n"

l_.str.3:                               ; @.str.3
	.asciz	"Autodetected %s\n"

	.comm	_TUNER_ABSENT,8,3               ; @TUNER_ABSENT
l_.str.4:                               ; @.str.4
	.asciz	"tveeprom cannot autodetect tuner!\n"

	.comm	_V4L2_STD_PAL,4,2               ; @V4L2_STD_PAL
l_.str.5:                               ; @.str.5
	.asciz	"PAL tuner detected\n"

	.comm	_V4L2_STD_PAL_BG,4,2            ; @V4L2_STD_PAL_BG
	.comm	_V4L2_STD_PAL_H,4,2             ; @V4L2_STD_PAL_H
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
l_.str.6:                               ; @.str.6
	.asciz	"NTSC tuner detected\n"

	.comm	_V4L2_STD_NTSC_M,4,2            ; @V4L2_STD_NTSC_M
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
l_.str.7:                               ; @.str.7
	.asciz	"SECAM tuner detected\n"

	.comm	_V4L2_STD_SECAM_L,4,2           ; @V4L2_STD_SECAM_L
l_.str.8:                               ; @.str.8
	.asciz	"No tuner detected, default to NTSC-M\n"

	.no_dead_strip	_cx18_process_eeprom
.subsections_via_symbols
