	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_balance
_set_balance:                           ## @set_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_to_mt9v011
	movq	%rax, %rbx
	movl	(%rax), %edi
	movl	12(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	callq	_calc_mt9v011_gain
	movl	%eax, %r15d
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	imull	%eax, %ecx
	leal	127(%rcx), %edi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edi
	sarl	$7, %edi
	addl	%eax, %edi
	callq	_calc_mt9v011_gain
	movl	%eax, %r12d
	movl	(%rbx), %eax
	movl	8(%rbx), %ecx
	imull	%eax, %ecx
	leal	127(%rcx), %edi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edi
	sarl	$7, %edi
	addl	%eax, %edi
	callq	_calc_mt9v011_gain
	movl	%eax, %r13d
	movq	_R2B_MT9V011_GREEN_1_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_mt9v011_write
	movq	_R2E_MT9V011_GREEN_2_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_mt9v011_write
	movq	_R2C_MT9V011_BLUE_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	_mt9v011_write
	movq	_R2D_MT9V011_RED_GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_mt9v011_write
	movq	_R09_MT9V011_SHUTTER_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mt9v011_write                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_R2B_MT9V011_GREEN_1_GAIN,4,2   ## @R2B_MT9V011_GREEN_1_GAIN
	.comm	_R2E_MT9V011_GREEN_2_GAIN,4,2   ## @R2E_MT9V011_GREEN_2_GAIN
	.comm	_R2C_MT9V011_BLUE_GAIN,4,2      ## @R2C_MT9V011_BLUE_GAIN
	.comm	_R2D_MT9V011_RED_GAIN,4,2       ## @R2D_MT9V011_RED_GAIN
	.comm	_R09_MT9V011_SHUTTER_WIDTH,4,2  ## @R09_MT9V011_SHUTTER_WIDTH
	.no_dead_strip	_set_balance
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_balance
_set_balance:                           ; @set_balance
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_to_mt9v011
	mov	x21, x0
	ldr	w20, [x0, #12]
	ldr	w0, [x0]
	bl	_calc_mt9v011_gain
	mov	x22, x0
	ldp	w8, w9, [x21]
	mul	w9, w9, w8
	add	w10, w9, #127
	cmp	w9, #0
	csel	w9, w10, w9, lt
	add	w0, w8, w9, asr #7
	bl	_calc_mt9v011_gain
	mov	x23, x0
	ldr	w8, [x21]
	ldr	w9, [x21, #8]
	mul	w9, w9, w8
	add	w10, w9, #127
	cmp	w9, #0
	csel	w9, w10, w9, lt
	add	w0, w8, w9, asr #7
	bl	_calc_mt9v011_gain
	mov	x21, x0
Lloh0:
	adrp	x8, _R2B_MT9V011_GREEN_1_GAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R2B_MT9V011_GREEN_1_GAIN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_mt9v011_write
Lloh3:
	adrp	x8, _R2E_MT9V011_GREEN_2_GAIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _R2E_MT9V011_GREEN_2_GAIN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	bl	_mt9v011_write
Lloh6:
	adrp	x8, _R2C_MT9V011_BLUE_GAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _R2C_MT9V011_BLUE_GAIN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_mt9v011_write
Lloh9:
	adrp	x8, _R2D_MT9V011_RED_GAIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _R2D_MT9V011_RED_GAIN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_mt9v011_write
Lloh12:
	adrp	x8, _R09_MT9V011_SHUTTER_WIDTH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _R09_MT9V011_SHUTTER_WIDTH@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mt9v011_write
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_R2B_MT9V011_GREEN_1_GAIN,4,2   ; @R2B_MT9V011_GREEN_1_GAIN
	.comm	_R2E_MT9V011_GREEN_2_GAIN,4,2   ; @R2E_MT9V011_GREEN_2_GAIN
	.comm	_R2C_MT9V011_BLUE_GAIN,4,2      ; @R2C_MT9V011_BLUE_GAIN
	.comm	_R2D_MT9V011_RED_GAIN,4,2       ; @R2D_MT9V011_RED_GAIN
	.comm	_R09_MT9V011_SHUTTER_WIDTH,4,2  ; @R09_MT9V011_SHUTTER_WIDTH
	.no_dead_strip	_set_balance
.subsections_via_symbols
