	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pb0100_set_gain
_pb0100_set_gain:                       ## @pb0100_set_gain
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movq	_AUTOGAIN_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, (%r12,%rax,8)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_GAIN_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rsi, (%r12,%rax,8)
	movq	_PB_G1GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdx
	callq	_stv06xx_write_sensor
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	_D_V4L2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	callq	_PDEBUG
	jmp	LBB0_6
LBB0_4:
	movq	_PB_G2GAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_stv06xx_write_sensor
	movl	%eax, %ebx
	movq	_D_V4L2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	callq	_PDEBUG
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.5:
	movq	_RED_BALANCE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r12,%rax,8), %rsi
	movq	%r14, %rdi
	callq	_pb0100_set_red_balance
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_BLUE_BALANCE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r12,%rax,8), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pb0100_set_blue_balance        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AUTOGAIN_IDX,8,3               ## @AUTOGAIN_IDX
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GAIN_IDX,8,3                   ## @GAIN_IDX
	.comm	_PB_G1GAIN,4,2                  ## @PB_G1GAIN
	.comm	_PB_G2GAIN,4,2                  ## @PB_G2GAIN
	.comm	_D_V4L2,4,2                     ## @D_V4L2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set green gain to %d, status: %d"

	.comm	_RED_BALANCE_IDX,8,3            ## @RED_BALANCE_IDX
	.comm	_BLUE_BALANCE_IDX,8,3           ## @BLUE_BALANCE_IDX
	.no_dead_strip	_pb0100_set_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pb0100_set_gain
_pb0100_set_gain:                       ; @pb0100_set_gain
	.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
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _AUTOGAIN_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AUTOGAIN_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x22, x8, lsl #3]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_2:
	mov	x20, x1
	mov	x19, x0
Lloh6:
	adrp	x8, _GAIN_IDX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GAIN_IDX@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x1, [x22, x8, lsl #3]
Lloh9:
	adrp	x8, _PB_G1GAIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PB_G1GAIN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_stv06xx_write_sensor
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh12:
	adrp	x8, _D_V4L2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _D_V4L2@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_PDEBUG
	b	LBB0_6
LBB0_4:
Lloh17:
	adrp	x8, _PB_G2GAIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PB_G2GAIN@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_stv06xx_write_sensor
	mov	x21, x0
Lloh20:
	adrp	x8, _D_V4L2@GOTPAGE
Lloh21:
	ldr	x8, [x8, _D_V4L2@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	bl	_PDEBUG
	cbnz	w21, LBB0_6
; %bb.5:
Lloh25:
	adrp	x8, _RED_BALANCE_IDX@GOTPAGE
Lloh26:
	ldr	x8, [x8, _RED_BALANCE_IDX@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x1, [x22, x8, lsl #3]
	mov	x0, x19
	bl	_pb0100_set_red_balance
	mov	x21, x0
	cbz	w0, LBB0_7
LBB0_6:
	mov	x0, x21
	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_7:
Lloh28:
	adrp	x8, _BLUE_BALANCE_IDX@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BLUE_BALANCE_IDX@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	ldr	x1, [x22, x8, lsl #3]
	mov	x0, x19
	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	_pb0100_set_blue_balance
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_AUTOGAIN_IDX,8,3               ; @AUTOGAIN_IDX
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GAIN_IDX,8,3                   ; @GAIN_IDX
	.comm	_PB_G1GAIN,4,2                  ; @PB_G1GAIN
	.comm	_PB_G2GAIN,4,2                  ; @PB_G2GAIN
	.comm	_D_V4L2,4,2                     ; @D_V4L2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set green gain to %d, status: %d"

	.comm	_RED_BALANCE_IDX,8,3            ; @RED_BALANCE_IDX
	.comm	_BLUE_BALANCE_IDX,8,3           ; @BLUE_BALANCE_IDX
	.no_dead_strip	_pb0100_set_gain
.subsections_via_symbols
