	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pb0100_set_autogain_target
_pb0100_set_autogain_target:            ## @pb0100_set_autogain_target
	.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, %r15
	movl	4(%rdi), %eax
	imull	(%rdi), %eax
	leal	63(%rax), %ecx
	leal	4095(%rax), %ebx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	cmovnsl	%eax, %ebx
	movl	%esi, %r14d
	sarl	$6, %ecx
	sarl	$12, %ebx
	addl	%ecx, %ebx
	movl	%ebx, %r13d
	imull	%esi, %r13d
	sarl	$8, %r13d
	movq	_PB_R21@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edx
	callq	_stv06xx_write_sensor
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	subl	%r13d, %ebx
	movq	_PB_R22@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_stv06xx_write_sensor
	movl	%eax, %r12d
LBB0_2:
	movq	_D_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	callq	_gspca_dbg
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PB_R21,4,2                     ## @PB_R21
	.comm	_PB_R22,4,2                     ## @PB_R22
	.comm	_D_CONF,4,2                     ## @D_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set autogain target to %d, status: %d\n"

	.no_dead_strip	_pb0100_set_autogain_target
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pb0100_set_autogain_target
_pb0100_set_autogain_target:            ; @pb0100_set_autogain_target
	.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, x1
	mov	x20, x0
	ldp	w8, w9, [x0]
	mul	w8, w9, w8
	add	w9, w8, #63
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #6
	add	w10, w8, #4095
	csel	w8, w10, w8, lt
	add	w23, w9, w8, asr #12
	mul	w8, w23, w1
	asr	w22, w8, #8
Lloh0:
	adrp	x8, _PB_R21@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PB_R21@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_stv06xx_write_sensor
	mov	x21, x0
	cbnz	w0, LBB0_2
; %bb.1:
	sub	w2, w23, w22
Lloh3:
	adrp	x8, _PB_R22@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PB_R22@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_stv06xx_write_sensor
	mov	x21, x0
LBB0_2:
Lloh6:
	adrp	x8, _D_CONF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _D_CONF@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	mov	x4, x21
	bl	_gspca_dbg
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PB_R21,4,2                     ; @PB_R21
	.comm	_PB_R22,4,2                     ; @PB_R22
	.comm	_D_CONF,4,2                     ; @D_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set autogain target to %d, status: %d\n"

	.no_dead_strip	_pb0100_set_autogain_target
.subsections_via_symbols
