	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm97xx_read_aux_adc            ## -- Begin function wm97xx_read_aux_adc
	.p2align	4, 0x90
_wm97xx_read_aux_adc:                   ## @wm97xx_read_aux_adc
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	addq	$12, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	(%rbx), %rax
	movq	_WM9713_ID2@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	movb	$1, %r15b
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	_AC97_EXTENDED_MID@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_wm97xx_reg_read
	movl	%eax, %r13d
	testl	$32768, %eax                    ## imm = 0x8000
	je	LBB0_4
## %bb.3:
	movl	(%r14), %esi
	movl	%r13d, %edx
	andl	$32767, %edx                    ## imm = 0x7FFF
	movq	%rbx, %rdi
	callq	_wm97xx_reg_write
	xorl	%r15d, %r15d
	jmp	LBB0_4
LBB0_1:
	xorl	%r13d, %r13d
LBB0_4:
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	callq	*24(%rax)
	movl	$1, 8(%rbx)
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	$0, %r14d
	je	LBB0_14
## %bb.5:
	movq	16(%rbx), %rax
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_7
## %bb.6:
	movl	$1, %r14d
	jmp	LBB0_14
LBB0_7:
	movq	16(%rbx), %rax
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_9
## %bb.8:
	movl	$2, %r14d
	jmp	LBB0_14
LBB0_9:
	movq	16(%rbx), %rax
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_11
## %bb.10:
	movl	$3, %r14d
	jmp	LBB0_14
LBB0_11:
	movq	16(%rbx), %rax
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movq	_RC_VALID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.12:
	movl	%eax, %r12d
	movl	$4, %r14d
	jmp	LBB0_14
LBB0_13:
	movq	16(%rbx), %rax
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movq	%rcx, %r14
	callq	*(%rax)
	movl	%eax, %r12d
	xorl	%eax, %eax
	cmpl	(%r14), %r12d
	sete	%al
	movl	$6, %r14d
	subl	%eax, %r14d
LBB0_14:
	testb	%r15b, %r15b
	jne	LBB0_16
## %bb.15:
	movq	_AC97_EXTENDED_MID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	$32768, %r13d                   ## imm = 0x8000
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_wm97xx_reg_write
LBB0_16:
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	callq	*16(%rax)
	movl	$0, 8(%rbx)
	cmpl	$5, %r14d
	jb	LBB0_18
## %bb.17:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_dev_err
	movq	16(%rbx), %rax
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	*8(%rax)
LBB0_18:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	$4095, %ecx                     ## imm = 0xFFF
	andl	-44(%rbp), %ecx
	movq	_EBUSY@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	movq	_RC_VALID@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r12d
	cmovel	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM9713_ID2,8,3                 ## @WM9713_ID2
	.comm	_AC97_EXTENDED_MID,4,2          ## @AC97_EXTENDED_MID
	.comm	_RC_VALID,4,2                   ## @RC_VALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout reading auxadc %d, disabling digitiser\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm97xx_read_aux_adc            ; -- Begin function wm97xx_read_aux_adc
	.p2align	2
_wm97xx_read_aux_adc:                   ; @wm97xx_read_aux_adc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _WM9713_ID2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM9713_ID2@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh2:
	ldr	x8, [x8]
	mov	w23, #1
Lloh3:
	adrp	x24, _AC97_EXTENDED_MID@GOTPAGE
Lloh4:
	ldr	x24, [x24, _AC97_EXTENDED_MID@GOTPAGEOFF]
	cmp	x9, x8
	b.ne	LBB0_3
; %bb.1:
	ldr	w1, [x24]
	mov	x0, x20
	bl	_wm97xx_reg_read
	mov	x22, x0
	tbnz	w0, #15, LBB0_4
; %bb.2:
	mov	w26, #1
	b	LBB0_5
LBB0_3:
	mov	w22, #0
	mov	w26, #1
	b	LBB0_5
LBB0_4:
	ldr	w1, [x24]
	and	w2, w22, #0x7fff
	mov	x0, x20
	bl	_wm97xx_reg_write
	mov	w26, #0
LBB0_5:
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #24]
	mov	x0, x20
	blr	x8
	str	w23, [x20, #8]
Lloh5:
	adrp	x25, _RC_VALID@GOTPAGE
Lloh6:
	ldr	x25, [x25, _RC_VALID@GOTPAGEOFF]
	ldr	w8, [x25]
	cbz	w8, LBB0_8
; %bb.6:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_9
; %bb.7:
	mov	x23, x0
	mov	w27, #1
	b	LBB0_16
LBB0_8:
	mov	w23, #0
	mov	w27, #0
	b	LBB0_16
LBB0_9:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_11
; %bb.10:
	mov	x23, x0
	mov	w27, #2
	b	LBB0_16
LBB0_11:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_13
; %bb.12:
	mov	x23, x0
	mov	w27, #3
	b	LBB0_16
LBB0_13:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	blr	x8
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_15
; %bb.14:
	mov	x23, x0
	mov	w27, #4
	b	LBB0_16
LBB0_15:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	blr	x8
	mov	x23, x0
	ldr	w8, [x25]
	cmp	w0, w8
	mov	w8, #5
	cinc	w27, w8, ne
LBB0_16:
	tbnz	w26, #0, LBB0_18
; %bb.17:
	ldr	w1, [x24]
	orr	w2, w22, #0x8000
	mov	x0, x20
	bl	_wm97xx_reg_write
LBB0_18:
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #16]
	mov	x0, x20
	blr	x8
	str	wzr, [x20, #8]
	cmp	w27, #5
	b.lo	LBB0_20
; %bb.19:
	ldr	w0, [x20, #24]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	ldr	x8, [x20, #16]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	w1, #0
	blr	x8
LBB0_20:
	mov	x0, x19
	bl	_mutex_unlock
	ldr	w8, [x25]
	ldr	w9, [sp, #12]
	and	w9, w9, #0xfff
Lloh9:
	adrp	x10, _EBUSY@GOTPAGE
Lloh10:
	ldr	x10, [x10, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w23, w8
	csneg	w0, w9, w10, eq
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WM9713_ID2,8,3                 ; @WM9713_ID2
	.comm	_AC97_EXTENDED_MID,4,2          ; @AC97_EXTENDED_MID
	.comm	_RC_VALID,4,2                   ; @RC_VALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout reading auxadc %d, disabling digitiser\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
