	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_set_ctrl_white_balance
_ov5640_set_ctrl_white_balance:         ## @ov5640_set_ctrl_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_OV5640_REG_AWB_MANUAL_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%edi, %edi
	callq	_BIT
	xorl	%ecx, %ecx
	testl	%ebx, %ebx
	sete	%cl
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_ov5640_mod_reg
	movl	%eax, %ecx
	orl	%ebx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movl	(%rcx), %edx
	movl	(%rax), %r14d
	movq	_OV5640_REG_AWB_R_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ov5640_write_reg16
	testl	%eax, %eax
	je	LBB0_3
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_OV5640_REG_AWB_B_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov5640_write_reg16             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_OV5640_REG_AWB_MANUAL_CTRL,4,2 ## @OV5640_REG_AWB_MANUAL_CTRL
	.comm	_OV5640_REG_AWB_R_GAIN,4,2      ## @OV5640_REG_AWB_R_GAIN
	.comm	_OV5640_REG_AWB_B_GAIN,4,2      ## @OV5640_REG_AWB_B_GAIN
	.no_dead_strip	_ov5640_set_ctrl_white_balance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_set_ctrl_white_balance
_ov5640_set_ctrl_white_balance:         ; @ov5640_set_ctrl_white_balance
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _OV5640_REG_AWB_MANUAL_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OV5640_REG_AWB_MANUAL_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	mov	w0, #0
	bl	_BIT
	mov	x2, x0
	cmp	w20, #0
	cset	w3, eq
	mov	x0, x19
	mov	x1, x21
	bl	_ov5640_mod_reg
	orr	w8, w0, w20
	cbnz	w8, LBB0_2
; %bb.1:
	ldp	x9, x8, [x19]
	ldr	w2, [x8]
	ldr	w20, [x9]
Lloh3:
	adrp	x8, _OV5640_REG_AWB_R_GAIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OV5640_REG_AWB_R_GAIN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ov5640_write_reg16
	cbz	w0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh6:
	adrp	x8, _OV5640_REG_AWB_B_GAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OV5640_REG_AWB_B_GAIN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ov5640_write_reg16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_OV5640_REG_AWB_MANUAL_CTRL,4,2 ; @OV5640_REG_AWB_MANUAL_CTRL
	.comm	_OV5640_REG_AWB_R_GAIN,4,2      ; @OV5640_REG_AWB_R_GAIN
	.comm	_OV5640_REG_AWB_B_GAIN,4,2      ; @OV5640_REG_AWB_B_GAIN
	.no_dead_strip	_ov5640_set_ctrl_white_balance
.subsections_via_symbols
