	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad1843_set_gain
_ad1843_set_gain:                       ## @ad1843_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpl	$25855, %edx                    ## imm = 0x64FF
	ja	LBB0_2
## %bb.1:
	movl	%edx, %eax
	movq	%rsi, %rbx
	movzbl	%al, %esi
	cmpl	$101, %esi
	jae	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	shrl	$8, %eax
	movq	8(%rbx), %rdx
	movb	(%rdx), %cl
	movl	$-1, %edi
	shll	%cl, %edi
	notl	%edi
	movzwl	%di, %r9d
	imull	%r9d, %esi
	movl	%r9d, %ecx
	shrl	%ecx
	addl	%ecx, %esi
	imulq	$1374389535, %rsi, %rsi         ## imm = 0x51EB851F
	shrq	$37, %rsi
	imull	%r9d, %eax
	addl	%ecx, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	movl	%r9d, %ecx
	subl	%esi, %ecx
	subl	%eax, %r9d
	cmpq	$0, 16(%rbx)
	cmovel	%esi, %ecx
	cmovel	%eax, %r9d
	movl	(%rbx), %r8d
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ad1843_write_multi
	movq	%r14, %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_ad1843_get_gain                ## TAILCALL
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ad1843_set_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad1843_set_gain
_ad1843_set_gain:                       ; @ad1843_set_gain
	.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
	lsr	w8, w2, #8
	cmp	w8, #100
	b.hi	LBB0_3
; %bb.1:
	and	w9, w2, #0xff
	cmp	w9, #101
	b.hs	LBB0_3
; %bb.2:
	mov	x19, x1
	mov	x20, x0
	ldp	x2, x10, [x1, #8]
	ldr	w11, [x2]
	mov	w12, #-1
	lsl	w11, w12, w11
	mvn	w11, w11
	and	w12, w11, #0xffff
	ubfx	w11, w11, #1, #15
	madd	w9, w12, w9, w11
	madd	w8, w12, w8, w11
	mov	w11, #34079
	movk	w11, #20971, lsl #16
	umull	x9, w9, w11
	lsr	x9, x9, #37
	umull	x8, w8, w11
	lsr	x8, x8, #37
	sub	w11, w12, w9
	sub	w12, w12, w8
	cmp	x10, #0
	csel	w3, w9, w11, eq
	csel	w5, w8, w12, eq
	ldr	w4, [x1]
	mov	w1, #2
	bl	_ad1843_write_multi
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_ad1843_get_gain
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	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	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ad1843_set_gain
.subsections_via_symbols
