	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_autogain
_do_autogain:                           ## @do_autogain
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	(%rdi), %rax
	testq	%rax, %rax
	js	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	subq	$1, %rax
	movq	%rax, (%rdi)
	jae	LBB0_4
## %bb.2:
	movq	_AG_CNT_START@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	8(%rbx), %rax
	movq	_BRIDGE_NW801@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	sete	%sil
	orl	$2060, %esi                     ## imm = 0x80C
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_reg_r
	movq	(%rbx), %rcx
	movl	12(%rcx), %edx
	shll	$24, %edx
	movl	4(%rcx), %eax
	movl	8(%rcx), %esi
	shll	$16, %esi
	addl	%edx, %esi
	shll	$8, %eax
	addl	%esi, %eax
	addl	(%rcx), %eax
	cltd
	idivl	16(%rbx)
	cmpl	$128, 20(%rbx)
	jne	LBB0_3
## %bb.5:
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$100, %edx
	movl	$5, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_gspca_coarse_grained_expo_autogain ## TAILCALL
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$100, %edx
	movl	$5, %ecx
	movl	$230, %r8d
	xorl	%r9d, %r9d
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_gspca_expo_autogain            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AG_CNT_START,8,3               ## @AG_CNT_START
	.comm	_BRIDGE_NW801,8,3               ## @BRIDGE_NW801
	.no_dead_strip	_do_autogain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_autogain
_do_autogain:                           ; @do_autogain
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
	tbnz	x8, #63, LBB0_2
; %bb.1:
	mov	x19, x0
	sub	x9, x8, #1
	str	x9, [x0]
	cbz	x8, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh0:
	adrp	x8, _AG_CNT_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AG_CNT_START@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x19]
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _BRIDGE_NW801@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BRIDGE_NW801@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #2060
	cinc	w1, w8, eq
	mov	x0, x19
	mov	w2, #4
	bl	_reg_r
	ldr	x8, [x19]
	ldp	w10, w9, [x8, #8]
	lsl	w10, w10, #16
	add	w9, w10, w9, lsl #24
	ldp	w8, w10, [x8]
	add	w9, w9, w10, lsl #8
	add	w8, w9, w8
	ldp	w9, w10, [x19, #16]
	sdiv	w1, w8, w9
	mov	x0, x19
	mov	w2, #100
	mov	w3, #5
	cmp	w10, #128
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_gspca_coarse_grained_expo_autogain
LBB0_5:
	mov	w4, #230
	mov	w5, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_gspca_expo_autogain
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AG_CNT_START,8,3               ; @AG_CNT_START
	.comm	_BRIDGE_NW801,8,3               ; @BRIDGE_NW801
	.no_dead_strip	_do_autogain
.subsections_via_symbols
