	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_cam_init
_cafe_cam_init:                         ## @cafe_cam_init
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r15), %rdx
	movq	_S_NOTREADY@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_cam_warn
LBB0_2:
	movq	%r15, %rdi
	callq	___cafe_cam_reset
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	_V4L2_IDENT_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_V4L2_CHIP_MATCH_I2C_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movl	20(%r15), %eax
	movl	%eax, -32(%rbp)
	movq	_core@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_g_chip_ident@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	movq	%r15, %rdi
	callq	_sensor_call
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:
	movq	-40(%rbp), %rdx
	movq	%rdx, 8(%r15)
	movq	_V4L2_IDENT_OV7670@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_5
## %bb.6:
	movq	_S_IDLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_cam_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	%r15, %rdi
	callq	_cafe_ctlr_power_down
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S_NOTREADY,8,3                 ## @S_NOTREADY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cam init with device in funky state %d"

	.comm	_V4L2_IDENT_NONE,8,3            ## @V4L2_IDENT_NONE
	.comm	_V4L2_CHIP_MATCH_I2C_ADDR,4,2   ## @V4L2_CHIP_MATCH_I2C_ADDR
	.comm	_core,4,2                       ## @core
	.comm	_g_chip_ident,4,2               ## @g_chip_ident
	.comm	_V4L2_IDENT_OV7670,8,3          ## @V4L2_IDENT_OV7670
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported sensor type 0x%x"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_S_IDLE,8,3                     ## @S_IDLE
	.no_dead_strip	_cafe_cam_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_cam_init
_cafe_cam_init:                         ; @cafe_cam_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	x2, [x20]
Lloh0:
	adrp	x8, _S_NOTREADY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S_NOTREADY@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x2, x8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_cam_warn
LBB0_2:
	mov	x0, x20
	bl	___cafe_cam_reset
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.3:
Lloh5:
	adrp	x8, _V4L2_IDENT_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V4L2_IDENT_NONE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh8:
	adrp	x8, _V4L2_CHIP_MATCH_I2C_ADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _V4L2_CHIP_MATCH_I2C_ADDR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x20, #20]
	stp	w9, w8, [sp, #8]
Lloh11:
	adrp	x8, _core@GOTPAGE
Lloh12:
	ldr	x8, [x8, _core@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _g_chip_ident@GOTPAGE
Lloh15:
	ldr	x8, [x8, _g_chip_ident@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x3, sp
	mov	x0, x20
	bl	_sensor_call
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	x2, [sp]
	str	x2, [x20, #8]
Lloh17:
	adrp	x8, _V4L2_IDENT_OV7670@GOTPAGE
Lloh18:
	ldr	x8, [x8, _V4L2_IDENT_OV7670@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_6
; %bb.5:
	mov	w21, #0
Lloh20:
	adrp	x8, _S_IDLE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _S_IDLE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [x20]
	b	LBB0_7
LBB0_6:
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_cam_err
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x20
	bl	_cafe_ctlr_power_down
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_S_NOTREADY,8,3                 ; @S_NOTREADY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cam init with device in funky state %d"

	.comm	_V4L2_IDENT_NONE,8,3            ; @V4L2_IDENT_NONE
	.comm	_V4L2_CHIP_MATCH_I2C_ADDR,4,2   ; @V4L2_CHIP_MATCH_I2C_ADDR
	.comm	_core,4,2                       ; @core
	.comm	_g_chip_ident,4,2               ; @g_chip_ident
	.comm	_V4L2_IDENT_OV7670,8,3          ; @V4L2_IDENT_OV7670
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported sensor type 0x%x"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_S_IDLE,8,3                     ; @S_IDLE
	.no_dead_strip	_cafe_cam_init
.subsections_via_symbols
