	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt9m111_set_auto_white_balance
_mt9m111_set_auto_white_balance:        ## @mt9m111_set_auto_white_balance
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_MT9M111_CP_OPERATING_MODE_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-48(%rbp), %rdx
	movl	$2, %ecx
	callq	_m5602_read_sensor
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	$253, %eax
	andl	-44(%rbp), %eax
	movl	%r14d, %ecx
	andl	$1, %ecx
	leal	(%rax,%rcx,2), %eax
	movl	%eax, -44(%rbp)
	movl	(%r12), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	$2, %ecx
	callq	_m5602_write_sensor
	movl	%eax, %ebx
	movq	_D_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%r14d, %ecx
	callq	_gspca_dbg
	jmp	LBB0_3
LBB0_1:
	movl	%eax, %ebx
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MT9M111_CP_OPERATING_MODE_CTL,4,2 ## @MT9M111_CP_OPERATING_MODE_CTL
	.comm	_D_CONF,4,2                     ## @D_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set auto white balance %d\n"

	.no_dead_strip	_mt9m111_set_auto_white_balance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt9m111_set_auto_white_balance
_mt9m111_set_auto_white_balance:        ; @mt9m111_set_auto_white_balance
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
Lloh3:
	adrp	x22, _MT9M111_CP_OPERATING_MODE_CTL@GOTPAGE
Lloh4:
	ldr	x22, [x22, _MT9M111_CP_OPERATING_MODE_CTL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, sp
	mov	w3, #2
	bl	_m5602_read_sensor
	tbnz	w0, #31, LBB0_2
; %bb.1:
	ldr	w8, [sp, #4]
	mov	w9, #253
	and	w8, w8, w9
	bfi	w8, w19, #1, #1
	str	w8, [sp, #4]
	ldr	w1, [x22]
	mov	x2, sp
	mov	x0, x20
	mov	w3, #2
	bl	_m5602_write_sensor
	mov	x21, x0
Lloh5:
	adrp	x8, _D_CONF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _D_CONF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_gspca_dbg
	b	LBB0_3
LBB0_2:
	mov	x21, x0
LBB0_3:
	ldr	x8, [sp, #8]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MT9M111_CP_OPERATING_MODE_CTL,4,2 ; @MT9M111_CP_OPERATING_MODE_CTL
	.comm	_D_CONF,4,2                     ; @D_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set auto white balance %d\n"

	.no_dead_strip	_mt9m111_set_auto_white_balance
.subsections_via_symbols
