	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setautogain
_setautogain:                           ## @setautogain
	.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, %rbx
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movq	_AG_CNT_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	%rbx, %rdi
	movl	$4100, %esi                     ## imm = 0x1004
	movl	$1, %edx
	callq	_reg_r
	movq	(%rbx), %rax
	testb	$4, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movl	$4113, %esi                     ## imm = 0x1011
	movl	$8, %edx
	callq	_reg_r
	movq	(%rbx), %rax
	movq	(%rax), %xmm0                   ## xmm0 = mem[0],zero
	movq	8(%rax), %xmm1                  ## xmm1 = mem[0],zero
	psubd	%xmm1, %xmm0
	pextrd	$1, %xmm0, %ecx
	shll	$8, %ecx
	movd	%xmm0, %edx
	addl	%ecx, %edx
	movq	16(%rax), %xmm0                 ## xmm0 = mem[0],zero
	movq	24(%rax), %xmm1                 ## xmm1 = mem[0],zero
	psubd	%xmm1, %xmm0
	pextrd	$1, %xmm0, %eax
	shll	$8, %eax
	movd	%xmm0, %ecx
	addl	%eax, %ecx
	imull	%edx, %ecx
	movl	%ecx, 4(%rbx)
	testl	%ecx, %ecx
	jne	LBB0_5
LBB0_4:
	movl	12(%rbx), %eax
	imull	8(%rbx), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_5
LBB0_1:
	movl	$-1, (%rbx)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG_CNT_START,4,2               ## @AG_CNT_START
	.no_dead_strip	_setautogain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setautogain
_setautogain:                           ; @setautogain
	.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
	mov	x19, x0
	cbz	w1, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _AG_CNT_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AG_CNT_START@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19]
	mov	x0, x19
	mov	w1, #4100
	mov	w2, #1
	bl	_reg_r
	ldr	x8, [x19]
	ldrb	w8, [x8]
	tbnz	w8, #2, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	w1, #4113
	mov	w2, #8
	bl	_reg_r
	ldr	x8, [x19]
	ldp	w10, w9, [x8]
	ldp	w12, w11, [x8, #8]
	sub	w9, w9, w11
	sub	w10, w10, w12
	add	w9, w10, w9, lsl #8
	ldp	w11, w10, [x8, #16]
	ldp	w8, w12, [x8, #24]
	sub	w10, w10, w12
	sub	w8, w11, w8
	add	w8, w8, w10, lsl #8
	mul	w8, w8, w9
	str	w8, [x19, #4]
	cbnz	w8, LBB0_5
LBB0_3:
	ldp	w8, w9, [x19, #8]
	mul	w8, w9, w8
	str	w8, [x19, #4]
	b	LBB0_5
LBB0_4:
	mov	w8, #-1
	str	w8, [x19]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AG_CNT_START,4,2               ; @AG_CNT_START
	.no_dead_strip	_setautogain
.subsections_via_symbols
