	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvp514x_detect
_tvp514x_detect:                        ## @tvp514x_detect
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_v4l2_get_subdevdata
	movq	%rax, %r15
	movq	_REG_CHIP_ID_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tvp514x_read_reg
	movq	%rax, %r12
	movq	_REG_CHIP_ID_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tvp514x_read_reg
	movq	%rax, %r13
	movq	_REG_ROM_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_tvp514x_read_reg
	movq	%rax, %r14
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, (%rsp)
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	movq	%r12, %r8
	movq	%r13, %r9
	callq	_v4l2_dbg
	movq	_TVP514X_CHIP_ID_MSB@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_3
## %bb.1:
	movq	_TVP5146_CHIP_ID_LSB@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	je	LBB0_4
## %bb.2:
	movq	_TVP5147_CHIP_ID_LSB@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	je	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	%r13, %rcx
	callq	_v4l2_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax)
	movl	16(%r15), %edx
	movl	(%r15), %r8d
	addl	%r8d, %r8d
	movq	8(%r15), %rax
	movl	(%rax), %r9d
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_v4l2_info
	xorl	%eax, %eax
LBB0_5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_CHIP_ID_MSB,4,2            ## @REG_CHIP_ID_MSB
	.comm	_REG_CHIP_ID_LSB,4,2            ## @REG_CHIP_ID_LSB
	.comm	_REG_ROM_VERSION,4,2            ## @REG_ROM_VERSION
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chip id detected msb:0x%x lsb:0x%x rom version:0x%x\n"

	.comm	_TVP514X_CHIP_ID_MSB,8,3        ## @TVP514X_CHIP_ID_MSB
	.comm	_TVP5146_CHIP_ID_LSB,8,3        ## @TVP5146_CHIP_ID_LSB
	.comm	_TVP5147_CHIP_ID_LSB,8,3        ## @TVP5147_CHIP_ID_LSB
L_.str.1:                               ## @.str.1
	.asciz	"chip id mismatch msb:0x%x lsb:0x%x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.2:                               ## @.str.2
	.asciz	"%s (Version - 0x%.2x) found at 0x%x (%s)\n"

	.no_dead_strip	_tvp514x_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvp514x_detect
_tvp514x_detect:                        ; @tvp514x_detect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
	bl	_v4l2_get_subdevdata
	mov	x21, x0
Lloh0:
	adrp	x8, _REG_CHIP_ID_MSB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_CHIP_ID_MSB@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tvp514x_read_reg
	mov	x22, x0
Lloh3:
	adrp	x8, _REG_CHIP_ID_LSB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_CHIP_ID_LSB@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tvp514x_read_reg
	mov	x23, x0
Lloh6:
	adrp	x8, _REG_ROM_VERSION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_ROM_VERSION@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_tvp514x_read_reg
	mov	x24, x0
Lloh9:
	adrp	x8, _debug@GOTPAGE
Lloh10:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x3, l_.str@PAGE
Lloh13:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x22
	mov	x5, x23
	mov	x6, x24
	bl	_v4l2_dbg
Lloh14:
	adrp	x8, _TVP514X_CHIP_ID_MSB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TVP514X_CHIP_ID_MSB@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_3
; %bb.1:
Lloh17:
	adrp	x8, _TVP5146_CHIP_ID_LSB@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TVP5146_CHIP_ID_LSB@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
Lloh20:
	adrp	x9, _TVP5147_CHIP_ID_LSB@GOTPAGE
Lloh21:
	ldr	x9, [x9, _TVP5147_CHIP_ID_LSB@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x23, x8
	ccmp	x23, x9, #4, ne
	b.ne	LBB0_3
; %bb.2:
	str	x24, [x20]
	ldr	w2, [x21, #16]
	ldr	w8, [x21]
	lsl	w4, w8, #1
	ldr	x8, [x21, #8]
	ldr	w5, [x8]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x3, x24
	bl	_v4l2_info
	mov	w0, #0
	b	LBB0_4
LBB0_3:
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
	bl	_v4l2_err
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_CHIP_ID_MSB,4,2            ; @REG_CHIP_ID_MSB
	.comm	_REG_CHIP_ID_LSB,4,2            ; @REG_CHIP_ID_LSB
	.comm	_REG_ROM_VERSION,4,2            ; @REG_ROM_VERSION
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chip id detected msb:0x%x lsb:0x%x rom version:0x%x\n"

	.comm	_TVP514X_CHIP_ID_MSB,8,3        ; @TVP514X_CHIP_ID_MSB
	.comm	_TVP5146_CHIP_ID_LSB,8,3        ; @TVP5146_CHIP_ID_LSB
	.comm	_TVP5147_CHIP_ID_LSB,8,3        ; @TVP5147_CHIP_ID_LSB
l_.str.1:                               ; @.str.1
	.asciz	"chip id mismatch msb:0x%x lsb:0x%x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.2:                               ; @.str.2
	.asciz	"%s (Version - 0x%.2x) found at 0x%x (%s)\n"

	.no_dead_strip	_tvp514x_detect
.subsections_via_symbols
