	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctrl_set_cfg_afe_gain
_ctrl_set_cfg_afe_gain:                 ## @ctrl_set_cfg_afe_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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movl	(%rsi), %eax
	movl	%eax, %ecx
	andl	$-4, %ecx
	cmpl	$128, %ecx
	jne	LBB0_1
## %bb.3:
	movq	(%rdi), %r12
	movl	4(%r15), %ecx
	movl	$15, %r14d
	cmpl	$328, %ecx                      ## imm = 0x148
	jg	LBB0_6
## %bb.4:
	xorl	%r14d, %r14d
	cmpl	$148, %ecx
	jl	LBB0_6
## %bb.5:
	addb	$122, %cl
	movzbl	%cl, %ecx
	imull	$79, %ecx, %r14d
	shrl	$10, %r14d
LBB0_6:
	cmpl	%eax, (%r12)
	jne	LBB0_9
## %bb.7:
	movq	8(%rdi), %rdi
	movq	_IQM_AF_PGA_GAIN__A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_drxj_dap_write_reg16
	testl	%eax, %eax
	je	LBB0_8
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_15
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r15), %eax
LBB0_9:
	leal	-128(%rax), %ecx
	cmpl	$3, %ecx
	jae	LBB0_10
## %bb.12:
	leal	(%r14,%r14,2), %eax
	leal	(%r14,%rax,4), %eax
	addl	$140, %eax
	movl	%eax, 4(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_10:
	cmpl	$131, %eax
	jne	LBB0_13
## %bb.11:
	leal	(%r14,%r14,2), %eax
	leal	(%r14,%rax,4), %eax
	addl	$140, %eax
	movl	%eax, 8(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IQM_AF_PGA_GAIN__A,4,2         ## @IQM_AF_PGA_GAIN__A
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ctrl_set_cfg_afe_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctrl_set_cfg_afe_gain
_ctrl_set_cfg_afe_gain:                 ; @ctrl_set_cfg_afe_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
	cbz	x1, LBB0_4
; %bb.1:
	mov	x19, x1
	ldr	w8, [x1]
	and	w9, w8, #0xfffffffc
	cmp	w9, #128
	b.ne	LBB0_4
; %bb.2:
	ldr	x22, [x0]
	ldr	w9, [x19, #4]
	cmp	w9, #328
	b.le	LBB0_7
; %bb.3:
	mov	w20, #15
	b	LBB0_8
LBB0_4:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w21, w8
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:
	add	w10, w9, #122
	and	w10, w10, #0xff
	mov	w11, #79
	mul	w10, w10, w11
	lsr	w10, w10, #10
	cmp	w9, #148
	csel	w20, wzr, w10, lt
LBB0_8:
	ldr	w9, [x22]
	cmp	w9, w8
	b.ne	LBB0_12
; %bb.9:
	ldr	x0, [x0, #8]
Lloh2:
	adrp	x8, _IQM_AF_PGA_GAIN__A@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IQM_AF_PGA_GAIN__A@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x2, x20
	mov	w3, #0
	bl	_drxj_dap_write_reg16
	cbz	w0, LBB0_11
; %bb.10:
	mov	x21, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_err
	b	LBB0_6
LBB0_11:
	ldr	w8, [x19]
LBB0_12:
	sub	w9, w8, #128
	cmp	w9, #3
	b.hs	LBB0_14
; %bb.13:
	mov	w21, #0
	mov	w8, #13
	mul	w8, w20, w8
	add	w8, w8, #140
	str	w8, [x22, #4]
	b	LBB0_6
LBB0_14:
	cmp	w8, #131
	b.ne	LBB0_16
; %bb.15:
	mov	w21, #0
	mov	w8, #13
	mul	w8, w20, w8
	add	w8, w8, #140
	str	w8, [x22, #8]
	b	LBB0_6
LBB0_16:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IQM_AF_PGA_GAIN__A,4,2         ; @IQM_AF_PGA_GAIN__A
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ctrl_set_cfg_afe_gain
.subsections_via_symbols
