	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm831x_auxadc_read_polled
_wm831x_auxadc_read_polled:             ## @wm831x_auxadc_read_polled
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	_WM831X_AUXADC_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_WM831X_AUX_ENA@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_wm831x_set_bits
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movq	_WM831X_AUXADC_SOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	movl	%r15d, %ecx
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_wm831x_reg_write
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movl	(%r12), %esi
	movq	_WM831X_AUX_CVT_ENA@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	%ecx, %edx
	callq	_wm831x_set_bits
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	$1, %edi
	callq	_msleep
	movq	_WM831X_INTERRUPT_STATUS_1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_wm831x_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movq	_WM831X_AUXADC_DATA_EINT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%ebx, %edx
	je	LBB0_20
## %bb.11:
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_wm831x_reg_write
	movq	_WM831X_AUXADC_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wm831x_reg_read
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	movq	_WM831X_AUX_DATA_SRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%ebx, %edx
	movq	_WM831X_AUX_DATA_SRC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrl	%cl, %edx
	decl	%edx
	cmpl	$14, %edx
	movq	_WM831X_AUX_ENA@GOTPCREL(%rip), %r13
	jne	LBB0_15
## %bb.14:
	movq	_WM831X_AUX_CAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_15:
	cmpl	%r15d, %edx
	jne	LBB0_16
## %bb.17:
	movq	_WM831X_AUX_DATA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, %ebx
	jmp	LBB0_18
LBB0_1:
	movl	%eax, %ebx
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	%eax, %ebx
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_6:
	movl	%eax, %ebx
	movl	4(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_18
LBB0_8:
	movl	4(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_20:
	movl	4(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	_WM831X_AUX_ENA@GOTPCREL(%rip), %r13
	jmp	LBB0_18
LBB0_12:
	movl	4(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_9:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_WM831X_AUX_ENA@GOTPCREL(%rip), %r13
	jmp	LBB0_18
LBB0_16:
	movl	4(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_18:
	movl	(%r12), %esi
	movl	(%r13), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_wm831x_set_bits
LBB0_19:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM831X_AUXADC_CONTROL,4,2      ## @WM831X_AUXADC_CONTROL
	.comm	_WM831X_AUX_ENA,4,2             ## @WM831X_AUX_ENA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to enable AUXADC: %d\n"

	.comm	_WM831X_AUXADC_SOURCE,4,2       ## @WM831X_AUXADC_SOURCE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set AUXADC source: %d\n"

	.comm	_WM831X_AUX_CVT_ENA,4,2         ## @WM831X_AUX_CVT_ENA
L_.str.2:                               ## @.str.2
	.asciz	"Failed to start AUXADC: %d\n"

	.comm	_WM831X_INTERRUPT_STATUS_1,4,2  ## @WM831X_INTERRUPT_STATUS_1
L_.str.3:                               ## @.str.3
	.asciz	"ISR 1 read failed: %d\n"

	.comm	_WM831X_AUXADC_DATA_EINT,4,2    ## @WM831X_AUXADC_DATA_EINT
L_.str.4:                               ## @.str.4
	.asciz	"AUXADC conversion timeout\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_WM831X_AUXADC_DATA,4,2         ## @WM831X_AUXADC_DATA
L_.str.5:                               ## @.str.5
	.asciz	"Failed to read AUXADC data: %d\n"

	.comm	_WM831X_AUX_DATA_SRC_MASK,4,2   ## @WM831X_AUX_DATA_SRC_MASK
	.comm	_WM831X_AUX_DATA_SRC_SHIFT,4,2  ## @WM831X_AUX_DATA_SRC_SHIFT
	.comm	_WM831X_AUX_CAL,4,2             ## @WM831X_AUX_CAL
L_.str.6:                               ## @.str.6
	.asciz	"Data from source %d not %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WM831X_AUX_DATA_MASK,4,2       ## @WM831X_AUX_DATA_MASK
	.no_dead_strip	_wm831x_auxadc_read_polled
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm831x_auxadc_read_polled
_wm831x_auxadc_read_polled:             ; @wm831x_auxadc_read_polled
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x22, _WM831X_AUXADC_CONTROL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _WM831X_AUXADC_CONTROL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x23, _WM831X_AUX_ENA@GOTPAGE
Lloh3:
	ldr	x23, [x23, _WM831X_AUX_ENA@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	mov	x3, x2
	bl	_wm831x_set_bits
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh4:
	adrp	x8, _WM831X_AUXADC_SOURCE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _WM831X_AUXADC_SOURCE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	w8, #1
	lsl	w2, w8, w20
	mov	x0, x19
	bl	_wm831x_reg_write
	tbnz	w0, #31, LBB0_9
; %bb.2:
	ldr	w1, [x22]
Lloh7:
	adrp	x8, _WM831X_AUX_CVT_ENA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WM831X_AUX_CVT_ENA@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x2
	bl	_wm831x_set_bits
	tbnz	w0, #31, LBB0_10
; %bb.3:
	mov	w0, #1
	bl	_msleep
Lloh10:
	adrp	x24, _WM831X_INTERRUPT_STATUS_1@GOTPAGE
Lloh11:
	ldr	x24, [x24, _WM831X_INTERRUPT_STATUS_1@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_wm831x_reg_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.4:
Lloh12:
	adrp	x8, _WM831X_AUXADC_DATA_EINT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WM831X_AUXADC_DATA_EINT@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	tst	w2, w21
	b.eq	LBB0_12
; %bb.5:
	ldr	w1, [x24]
	mov	x0, x19
	bl	_wm831x_reg_write
Lloh15:
	adrp	x8, _WM831X_AUXADC_DATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WM831X_AUXADC_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wm831x_reg_read
	mov	x21, x0
	tbnz	w0, #31, LBB0_13
; %bb.6:
Lloh18:
	adrp	x8, _WM831X_AUX_DATA_SRC_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WM831X_AUX_DATA_SRC_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh21:
	adrp	x9, _WM831X_AUX_DATA_SRC_SHIFT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _WM831X_AUX_DATA_SRC_SHIFT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	sub	w8, w8, #1
Lloh24:
	adrp	x9, _WM831X_AUX_CAL@GOTPAGE
Lloh25:
	ldr	x9, [x9, _WM831X_AUX_CAL@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	cmp	w8, #14
	csel	w8, w9, w8, eq
	cmp	w8, w20
	b.ne	LBB0_15
; %bb.7:
Lloh27:
	adrp	x8, _WM831X_AUX_DATA_MASK@GOTPAGE
Lloh28:
	ldr	x8, [x8, _WM831X_AUX_DATA_MASK@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	and	w21, w8, w21
	b	LBB0_17
LBB0_8:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_18
LBB0_9:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_18
LBB0_10:
	mov	x21, x0
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_11:
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh36:
	adrp	x1, l_.str.3@PAGE
Lloh37:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_12:
	ldr	w0, [x19, #4]
Lloh38:
	adrp	x1, l_.str.4@PAGE
Lloh39:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
Lloh40:
	adrp	x8, _EBUSY@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_16
LBB0_13:
	ldr	w0, [x19, #4]
	str	x21, [sp]
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_14:
	bl	_dev_err
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_17
LBB0_15:
	ldr	w0, [x19, #4]
	stp	x8, x20, [sp]
Lloh44:
	adrp	x1, l_.str.6@PAGE
Lloh45:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_err
Lloh46:
	adrp	x8, _EINVAL@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_17:
	ldr	w1, [x22]
	ldr	w2, [x23]
	mov	x0, x19
	mov	w3, #0
	bl	_wm831x_set_bits
LBB0_18:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_WM831X_AUXADC_CONTROL,4,2      ; @WM831X_AUXADC_CONTROL
	.comm	_WM831X_AUX_ENA,4,2             ; @WM831X_AUX_ENA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to enable AUXADC: %d\n"

	.comm	_WM831X_AUXADC_SOURCE,4,2       ; @WM831X_AUXADC_SOURCE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set AUXADC source: %d\n"

	.comm	_WM831X_AUX_CVT_ENA,4,2         ; @WM831X_AUX_CVT_ENA
l_.str.2:                               ; @.str.2
	.asciz	"Failed to start AUXADC: %d\n"

	.comm	_WM831X_INTERRUPT_STATUS_1,4,2  ; @WM831X_INTERRUPT_STATUS_1
l_.str.3:                               ; @.str.3
	.asciz	"ISR 1 read failed: %d\n"

	.comm	_WM831X_AUXADC_DATA_EINT,4,2    ; @WM831X_AUXADC_DATA_EINT
l_.str.4:                               ; @.str.4
	.asciz	"AUXADC conversion timeout\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_WM831X_AUXADC_DATA,4,2         ; @WM831X_AUXADC_DATA
l_.str.5:                               ; @.str.5
	.asciz	"Failed to read AUXADC data: %d\n"

	.comm	_WM831X_AUX_DATA_SRC_MASK,4,2   ; @WM831X_AUX_DATA_SRC_MASK
	.comm	_WM831X_AUX_DATA_SRC_SHIFT,4,2  ; @WM831X_AUX_DATA_SRC_SHIFT
	.comm	_WM831X_AUX_CAL,4,2             ; @WM831X_AUX_CAL
l_.str.6:                               ; @.str.6
	.asciz	"Data from source %d not %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WM831X_AUX_DATA_MASK,4,2       ; @WM831X_AUX_DATA_MASK
	.no_dead_strip	_wm831x_auxadc_read_polled
.subsections_via_symbols
