	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm8350_read_auxadc             ## -- Begin function wm8350_read_auxadc
	.p2align	4, 0x90
_wm8350_read_auxadc:                    ## @wm8350_read_auxadc
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_WM8350_AUXADC_AUX1@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jg	LBB0_2
## %bb.1:
	movl	%esi, %ebx
	movq	_WM8350_AUXADC_TEMP@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jl	LBB0_2
## %bb.3:
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movq	%rdi, %r14
	movl	%ecx, %r12d
	orl	%edx, %r12d
	je	LBB0_5
## %bb.4:
	movq	_WM8350_AUXADC_USB@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jg	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_WM8350_POWER_MGMT_5@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_wm8350_reg_read
	movq	_WM8350_POWER_MGMT_5@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	_WM8350_AUXADC_ENA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_wm8350_reg_write
	movslq	%ebx, %rcx
	testl	%r12d, %r12d
	je	LBB0_7
## %bb.6:
	shll	$13, %r13d
	shll	$12, %r15d
	orl	%r13d, %r15d
	movq	_WM8350_AUX1_READBACK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%rcx, %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	movq	%rcx, %r15
	callq	_wm8350_reg_write
	movq	%r15, %rcx
LBB0_7:
	movq	%rcx, %r15
	movq	_WM8350_DIGITISER_CONTROL_1@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_wm8350_reg_read
	movq	_WM8350_AUXADC_POLL@GOTPCREL(%rip), %rcx
	btsl	%ebx, %eax
	orl	(%rcx), %eax
	movq	(%r13), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_wm8350_reg_write
	leaq	8(%r14), %r12
	movq	%r12, %rdi
	callq	_try_wait_for_completion
	movl	$5, %edi
	callq	_msecs_to_jiffies
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_wm8350_reg_read
	movq	_WM8350_AUXADC_POLL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_9:
	movq	_WM8350_AUX1_READBACK@GOTPCREL(%rip), %rax
	movq	%r15, %rsi
	addq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_wm8350_reg_read
	movl	%eax, %ebx
LBB0_10:
	movq	_WM8350_POWER_MGMT_5@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movq	%r14, %rdi
	callq	_wm8350_reg_read
	movq	(%r15), %rsi
	movq	_WM8350_AUXADC_ENA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%r14, %rdi
	callq	_wm8350_reg_write
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_WM8350_AUXADC_DATA1_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM8350_AUXADC_AUX1,4,2         ## @WM8350_AUXADC_AUX1
	.comm	_WM8350_AUXADC_TEMP,4,2         ## @WM8350_AUXADC_TEMP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WM8350_AUXADC_USB,4,2          ## @WM8350_AUXADC_USB
	.comm	_WM8350_POWER_MGMT_5,8,3        ## @WM8350_POWER_MGMT_5
	.comm	_WM8350_AUXADC_ENA,4,2          ## @WM8350_AUXADC_ENA
	.comm	_WM8350_AUX1_READBACK,8,3       ## @WM8350_AUX1_READBACK
	.comm	_WM8350_DIGITISER_CONTROL_1,8,3 ## @WM8350_DIGITISER_CONTROL_1
	.comm	_WM8350_AUXADC_POLL,4,2         ## @WM8350_AUXADC_POLL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"adc chn %d read timeout\n"

	.comm	_WM8350_AUXADC_DATA1_MASK,4,2   ## @WM8350_AUXADC_DATA1_MASK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wm8350_read_auxadc             ; -- Begin function wm8350_read_auxadc
	.p2align	2
_wm8350_read_auxadc:                    ; @wm8350_read_auxadc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _WM8350_AUXADC_AUX1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM8350_AUXADC_AUX1@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _WM8350_AUXADC_TEMP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WM8350_AUXADC_TEMP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w1
	ccmp	w9, w1, #8, le
	b.lt	LBB0_3
; %bb.1:
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	orr	w26, w3, w2
	cbz	w26, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _WM8350_AUXADC_USB@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WM8350_AUXADC_USB@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w20
	b.gt	LBB0_4
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
	mov	x0, x19
	bl	_mutex_lock
Lloh12:
	adrp	x23, _WM8350_POWER_MGMT_5@GOTPAGE
Lloh13:
	ldr	x23, [x23, _WM8350_POWER_MGMT_5@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x0, x19
	bl	_wm8350_reg_read
	ldr	x1, [x23]
Lloh14:
	adrp	x24, _WM8350_AUXADC_ENA@GOTPAGE
Lloh15:
	ldr	x24, [x24, _WM8350_AUXADC_ENA@GOTPAGEOFF]
	ldr	w8, [x24]
	orr	w2, w8, w0
	mov	x0, x19
	bl	_wm8350_reg_write
Lloh16:
	adrp	x25, _WM8350_AUX1_READBACK@GOTPAGE
Lloh17:
	ldr	x25, [x25, _WM8350_AUX1_READBACK@GOTPAGEOFF]
	cbz	w26, LBB0_6
; %bb.5:
	lsl	w8, w22, #12
	orr	w2, w8, w21, lsl #13
	ldr	x8, [x25]
	add	x1, x8, w20, sxtw
	mov	x0, x19
	bl	_wm8350_reg_write
LBB0_6:
Lloh18:
	adrp	x22, _WM8350_DIGITISER_CONTROL_1@GOTPAGE
Lloh19:
	ldr	x22, [x22, _WM8350_DIGITISER_CONTROL_1@GOTPAGEOFF]
	ldr	x1, [x22]
	mov	x0, x19
	bl	_wm8350_reg_read
	mov	w8, #1
	lsl	w8, w8, w20
Lloh20:
	adrp	x26, _WM8350_AUXADC_POLL@GOTPAGE
Lloh21:
	ldr	x26, [x26, _WM8350_AUXADC_POLL@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w8, w0, w8
	orr	w2, w8, w9
	ldr	x1, [x22]
	mov	x0, x19
	bl	_wm8350_reg_write
	add	x21, x19, #8
	mov	x0, x21
	bl	_try_wait_for_completion
	mov	w0, #5
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	ldr	x1, [x22]
	mov	x0, x19
	bl	_wm8350_reg_read
	ldr	w8, [x26]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.7:
	ldr	w0, [x19, #4]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	mov	w20, #0
	b	LBB0_9
LBB0_8:
	ldr	x8, [x25]
	add	x1, x8, w20, sxtw
	mov	x0, x19
	bl	_wm8350_reg_read
	mov	x20, x0
LBB0_9:
	ldr	x1, [x23]
	mov	x0, x19
	bl	_wm8350_reg_read
	ldr	x1, [x23]
	ldr	w8, [x24]
	bic	w2, w0, w8
	mov	x0, x19
	bl	_wm8350_reg_write
	mov	x0, x19
	bl	_mutex_unlock
Lloh24:
	adrp	x8, _WM8350_AUXADC_DATA1_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _WM8350_AUXADC_DATA1_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	and	w0, w8, w20
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_WM8350_AUXADC_AUX1,4,2         ; @WM8350_AUXADC_AUX1
	.comm	_WM8350_AUXADC_TEMP,4,2         ; @WM8350_AUXADC_TEMP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WM8350_AUXADC_USB,4,2          ; @WM8350_AUXADC_USB
	.comm	_WM8350_POWER_MGMT_5,8,3        ; @WM8350_POWER_MGMT_5
	.comm	_WM8350_AUXADC_ENA,4,2          ; @WM8350_AUXADC_ENA
	.comm	_WM8350_AUX1_READBACK,8,3       ; @WM8350_AUX1_READBACK
	.comm	_WM8350_DIGITISER_CONTROL_1,8,3 ; @WM8350_DIGITISER_CONTROL_1
	.comm	_WM8350_AUXADC_POLL,4,2         ; @WM8350_AUXADC_POLL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adc chn %d read timeout\n"

	.comm	_WM8350_AUXADC_DATA1_MASK,4,2   ; @WM8350_AUXADC_DATA1_MASK
.subsections_via_symbols
