	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvp5150_detect_version
_tvp5150_detect_version:                ## @tvp5150_detect_version
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	leaq	12(%rdi), %r14
	movq	%r14, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, %r12
	movl	8(%rbx), %edi
	movq	_TVP5150_MSB_DEV_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movl	$4, %ecx
	callq	_regmap_bulk_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	-64(%rbp), %edx
	shll	$8, %edx
	orl	-60(%rbp), %edx
	movl	%edx, (%rbx)
	movl	-56(%rbp), %ecx
	movl	-52(%rbp), %r8d
	movl	%ecx, %eax
	shll	$8, %eax
	orl	%r8d, %eax
	movl	%eax, 4(%rbx)
	movl	12(%rbx), %edi
	movl	(%r12), %r9d
	addl	%r9d, %r9d
	movq	8(%r12), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%rbx), %edx
	cmpl	$20817, %edx                    ## imm = 0x5151
	je	LBB0_9
## %bb.3:
	cmpl	$20816, %edx                    ## imm = 0x5150
	jne	LBB0_11
## %bb.4:
	movl	4(%rbx), %eax
	cmpl	$1024, %eax                     ## imm = 0x400
	je	LBB0_8
## %bb.5:
	cmpl	$801, %eax                      ## imm = 0x321
	jne	LBB0_11
## %bb.6:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %r15d
	addq	$16, %r12
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_12
LBB0_9:
	cmpl	$256, 4(%rbx)                   ## imm = 0x100
	jne	LBB0_11
## %bb.10:
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_7:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_12
LBB0_11:
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_info
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%r15d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	12(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_info
	movl	8(%rbx), %edi
	movq	_TVP5150_REV_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_regmap_write
	jmp	LBB0_12
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TVP5150_MSB_DEV_ID,4,2         ## @TVP5150_MSB_DEV_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reading ID registers failed: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"tvp%04x (%u.%u) chip found @ 0x%02x (%s)\n"

L_.str.2:                               ## @.str.2
	.asciz	"tvp5150a detected.\n"

L_.str.3:                               ## @.str.3
	.asciz	"tvp5150am1 detected.\n"

	.comm	_TVP5150_REV_SELECT,4,2         ## @TVP5150_REV_SELECT
L_.str.4:                               ## @.str.4
	.asciz	"tvp5151 detected.\n"

L_.str.5:                               ## @.str.5
	.asciz	"*** unknown tvp%04x chip detected.\n"

	.no_dead_strip	_tvp5150_detect_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvp5150_detect_version
_tvp5150_detect_version:                ; @tvp5150_detect_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	add	x19, x0, #12
	mov	x0, x19
	bl	_v4l2_get_subdevdata
	mov	x21, x0
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x8, _TVP5150_MSB_DEV_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TVP5150_MSB_DEV_ID@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #40
	mov	w3, #4
	bl	_regmap_bulk_read
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldp	w8, w9, [sp, #40]
	orr	w8, w9, w8, lsl #8
	ldp	w9, w10, [sp, #48]
	orr	w11, w10, w9, lsl #8
	stp	w8, w11, [x20]
	ldr	w0, [x20, #12]
	ldr	w11, [x21]
	lsl	w11, w11, #1
	ldr	x12, [x21, #8]
	ldr	w12, [x12]
	stp	x11, x12, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	w8, [x20]
	mov	w9, #20817
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.2:
	mov	w9, #20816
	cmp	w8, w9
	b.ne	LBB0_9
; %bb.3:
	ldr	w9, [x20, #4]
	cmp	w9, #1024
	b.eq	LBB0_14
; %bb.4:
	cmp	w9, #801
	b.ne	LBB0_9
; %bb.5:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_6:
	mov	x22, x0
	add	x0, x21, #16
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_12
LBB0_7:
	ldr	w9, [x20, #4]
	cmp	w9, #256
	b.ne	LBB0_9
; %bb.8:
	ldr	w0, [x19]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_9:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str.5@PAGE
Lloh15:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_10:
	bl	_dev_info
LBB0_11:
	mov	w22, #0
LBB0_12:
	ldur	x8, [x29, #-40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_14:
	ldr	w0, [x20, #12]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	ldr	w0, [x20, #8]
Lloh21:
	adrp	x8, _TVP5150_REV_SELECT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TVP5150_REV_SELECT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_regmap_write
	b	LBB0_11
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_TVP5150_MSB_DEV_ID,4,2         ; @TVP5150_MSB_DEV_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reading ID registers failed: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"tvp%04x (%u.%u) chip found @ 0x%02x (%s)\n"

l_.str.2:                               ; @.str.2
	.asciz	"tvp5150a detected.\n"

l_.str.3:                               ; @.str.3
	.asciz	"tvp5150am1 detected.\n"

	.comm	_TVP5150_REV_SELECT,4,2         ; @TVP5150_REV_SELECT
l_.str.4:                               ; @.str.4
	.asciz	"tvp5151 detected.\n"

l_.str.5:                               ; @.str.5
	.asciz	"*** unknown tvp%04x chip detected.\n"

	.no_dead_strip	_tvp5150_detect_version
.subsections_via_symbols
