	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt9v111_chip_probe
_mt9v111_chip_probe:                    ## @mt9v111_chip_probe
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	___mt9v111_power_on
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movl	8(%r14), %edi
	movq	_MT9V111_R01_CORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT9V111_CORE_RFF_CHIP_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-20(%rbp), %rcx
	callq	_mt9v111_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movl	-20(%rbp), %edx
	movzbl	%dl, %ecx
	sarl	$8, %edx
	movq	_MT9V111_CHIP_ID_HIGH@GOTPCREL(%rip), %rax
	movl	4(%r14), %edi
	cmpl	(%rax), %edx
	je	LBB0_5
## %bb.3:
	movq	_MT9V111_CHIP_ID_LOW@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	xorl	%ebx, %ebx
LBB0_6:
	movq	%r14, %rdi
	callq	___mt9v111_power_off
LBB0_7:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT9V111_R01_CORE,4,2           ## @MT9V111_R01_CORE
	.comm	_MT9V111_CORE_RFF_CHIP_VER,4,2  ## @MT9V111_CORE_RFF_CHIP_VER
	.comm	_MT9V111_CHIP_ID_HIGH,4,2       ## @MT9V111_CHIP_ID_HIGH
	.comm	_MT9V111_CHIP_ID_LOW,4,2        ## @MT9V111_CHIP_ID_LOW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to identify MT9V111 chip: 0x%2x%2x\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Chip identified: 0x%2x%2x\n"

	.no_dead_strip	_mt9v111_chip_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt9v111_chip_probe
_mt9v111_chip_probe:                    ; @mt9v111_chip_probe
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	___mt9v111_power_on
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x8, _MT9V111_R01_CORE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT9V111_R01_CORE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MT9V111_CORE_RFF_CHIP_VER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT9V111_CORE_RFF_CHIP_VER@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, sp, #12
	bl	_mt9v111_read
	mov	x20, x0
	cbnz	w0, LBB0_5
; %bb.2:
	ldr	w8, [sp, #12]
	asr	w2, w8, #8
Lloh6:
	adrp	x9, _MT9V111_CHIP_ID_HIGH@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MT9V111_CHIP_ID_HIGH@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w3, w8, #0xff
Lloh9:
	adrp	x8, _MT9V111_CHIP_ID_LOW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT9V111_CHIP_ID_LOW@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w0, [x19, #4]
	cmp	w2, w9
	ccmp	w3, w8, #4, ne
	b.ne	LBB0_4
; %bb.3:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w20, #0
	b	LBB0_5
LBB0_4:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x19
	bl	___mt9v111_power_off
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MT9V111_R01_CORE,4,2           ; @MT9V111_R01_CORE
	.comm	_MT9V111_CORE_RFF_CHIP_VER,4,2  ; @MT9V111_CORE_RFF_CHIP_VER
	.comm	_MT9V111_CHIP_ID_HIGH,4,2       ; @MT9V111_CHIP_ID_HIGH
	.comm	_MT9V111_CHIP_ID_LOW,4,2        ; @MT9V111_CHIP_ID_LOW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to identify MT9V111 chip: 0x%2x%2x\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Chip identified: 0x%2x%2x\n"

	.no_dead_strip	_mt9v111_chip_probe
.subsections_via_symbols
