	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ad1843_get_gain                ## -- Begin function ad1843_get_gain
	.p2align	4, 0x90
_ad1843_get_gain:                       ## @ad1843_get_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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_ad1843_gain@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%esi, %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	32(%rbx), %rdx
	movl	(%rdx), %r15d
	movl	24(%rbx), %r8d
	leaq	-32(%rbp), %rcx
	leaq	-28(%rbp), %r9
	movl	$2, %esi
	callq	_ad1843_read_multi
	cmpq	$0, 16(%rbx)
	je	LBB0_2
## %bb.1:
	movl	$-1, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	notl	%eax
	movzwl	%ax, %eax
	movl	%eax, %ecx
	subl	-32(%rbp), %ecx
	movl	%ecx, -32(%rbp)
	subl	-28(%rbp), %eax
	movl	%eax, -28(%rbp)
LBB0_2:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.3:
	movl	(%rbx), %r8d
	leaq	-40(%rbp), %rcx
	leaq	-36(%rbp), %r9
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_ad1843_read_multi
	cmpl	$0, -40(%rbp)
	je	LBB0_5
## %bb.4:
	movl	$0, -32(%rbp)
LBB0_5:
	cmpl	$0, -36(%rbp)
	je	LBB0_7
## %bb.6:
	movl	$0, -28(%rbp)
LBB0_7:
	movl	-28(%rbp), %eax
	shll	$8, %eax
	orl	-32(%rbp), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ad1843_gain,8,3                ## @ad1843_gain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ad1843_get_gain                ; -- Begin function ad1843_get_gain
	.p2align	2
_ad1843_get_gain:                       ; @ad1843_get_gain
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _ad1843_gain@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ad1843_gain@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x20, [x8, w1, sxtw #3]
	ldr	x2, [x20, #32]
	ldr	w21, [x2]
	ldr	w4, [x20, #24]
	add	x3, sp, #12
	add	x5, sp, #8
	mov	w1, #2
	bl	_ad1843_read_multi
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w8, #-1
	lsl	w8, w8, w21
	mvn	w8, w8
	and	w8, w8, #0xffff
	ldr	w9, [sp, #12]
	sub	w9, w8, w9
	str	w9, [sp, #12]
	ldr	w9, [sp, #8]
	sub	w8, w8, w9
	str	w8, [sp, #8]
LBB0_2:
	ldr	x2, [x20, #8]
	cbz	x2, LBB0_7
; %bb.3:
	ldr	w4, [x20]
	add	x3, sp, #4
	mov	x5, sp
	mov	x0, x19
	mov	w1, #2
	bl	_ad1843_read_multi
	ldr	w8, [sp, #4]
	cbz	w8, LBB0_5
; %bb.4:
	str	wzr, [sp, #12]
LBB0_5:
	ldr	w8, [sp]
	cbz	w8, LBB0_7
; %bb.6:
	str	wzr, [sp, #8]
LBB0_7:
	ldp	w9, w8, [sp, #8]
	orr	w0, w8, w9, lsl #8
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ad1843_gain,8,3                ; @ad1843_gain
.subsections_via_symbols
