	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm9713_poll_sample
_wm9713_poll_sample:                    ## @wm9713_poll_sample
	.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
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	cmpl	$0, (%rdi)
	jne	LBB0_3
## %bb.1:
	movq	_AC97_WM97XX_DIGITISER_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm97xx_reg_read
	movq	_WM97XX_PEN_DOWN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_25
## %bb.2:
	movl	$1, (%r13)
LBB0_3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	$8, %r14d
	movl	%r12d, %ecx
	shll	%cl, %r14d
	testl	$32768, %r12d                   ## imm = 0x8000
	cmovel	%r12d, %r14d
	movq	_AC97_WM9713_DIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm97xx_reg_read
	movq	_WM9713_ADCSEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	8(%r13), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	%r14d, %edi
	callq	*%rax
LBB0_6:
	movq	%r15, %r12
	leal	(%r15,%r15,4), %r15d
	movq	_AC97_WM9713_DIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	orl	%r14d, %ebx
	movq	_WM9713_POLL@GOTPCREL(%rip), %r14
	orl	(%r14), %ebx
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_wm97xx_reg_write
	movq	_delay@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_poll_delay
	movq	_AC97_WM9713_DIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm97xx_reg_read
	testl	%eax, (%r14)
	je	LBB0_7
## %bb.8:
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.10:
	movq	_AC97_LINK_FRAME@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	callq	_udelay
	leal	-1(%r15), %r12d
	movq	_AC97_WM9713_DIG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm97xx_reg_read
	testl	%eax, (%r14)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpl	$1, %r15d
	movl	%r12d, %r15d
	jne	LBB0_11
	jmp	LBB0_13
LBB0_7:
	movl	%r15d, %r12d
LBB0_13:
	testl	%r12d, %r12d
	jle	LBB0_14
LBB0_16:
	movq	_AC97_WM97XX_DIGITISER_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_wm97xx_reg_read
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, (%r14)
	movq	8(%r13), %rcx
	testq	%rcx, %rcx
	je	LBB0_17
## %bb.18:
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_20
## %bb.19:
	movl	%ebx, %edi
	callq	*%rcx
	movl	(%r14), %eax
	jmp	LBB0_20
LBB0_9:
	movl	%r15d, %r12d
	testl	%r12d, %r12d
	jg	LBB0_16
LBB0_14:
	movq	%r13, %rdi
	callq	_is_pden
	testq	%rax, %rax
	jne	LBB0_24
## %bb.15:
	movl	4(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_25
LBB0_17:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_20:
	movq	_WM97XX_ADCSRC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movl	%ebx, %edx
	sarl	%edx
	bsfl	%edx, %edx
	shll	$12, %edx
	addl	$4096, %edx                     ## imm = 0x1000
	xorl	%esi, %esi
	cmpl	$2, %ebx
	cmovael	%edx, %esi
	cmpl	%esi, %ecx
	jne	LBB0_21
## %bb.22:
	movq	_WM97XX_PEN_DOWN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
## %bb.23:
	movq	_RC_VALID@GOTPCREL(%rip), %rax
	jmp	LBB0_26
LBB0_24:
	movl	$0, (%r13)
	jmp	LBB0_25
LBB0_21:
	movl	4(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_25:
	movq	_RC_PENUP@GOTPCREL(%rip), %rax
LBB0_26:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_delay,4,2                      ## @delay
	.comm	_AC97_WM97XX_DIGITISER_RD,4,2   ## @AC97_WM97XX_DIGITISER_RD
	.comm	_WM97XX_PEN_DOWN,4,2            ## @WM97XX_PEN_DOWN
	.comm	_RC_PENUP,4,2                   ## @RC_PENUP
	.comm	_AC97_WM9713_DIG1,4,2           ## @AC97_WM9713_DIG1
	.comm	_WM9713_ADCSEL_MASK,4,2         ## @WM9713_ADCSEL_MASK
	.comm	_WM9713_POLL,4,2                ## @WM9713_POLL
	.comm	_AC97_LINK_FRAME,4,2            ## @AC97_LINK_FRAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"adc sample timeout"

	.comm	_WM97XX_ADCSRC_MASK,4,2         ## @WM97XX_ADCSRC_MASK
L_.str.1:                               ## @.str.1
	.asciz	"adc wrong sample, read %x got %x"

	.comm	_RC_VALID,4,2                   ## @RC_VALID
	.no_dead_strip	_wm9713_poll_sample
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm9713_poll_sample
_wm9713_poll_sample:                    ; @wm9713_poll_sample
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x25, _delay@GOTPAGE
Lloh1:
	ldr	x25, [x25, _delay@GOTPAGEOFF]
	ldr	w24, [x25]
	ldr	w8, [x0]
	cbnz	w8, LBB0_3
; %bb.1:
Lloh2:
	adrp	x8, _AC97_WM97XX_DIGITISER_RD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AC97_WM97XX_DIGITISER_RD@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wm97xx_reg_read
Lloh5:
	adrp	x8, _WM97XX_PEN_DOWN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WM97XX_PEN_DOWN@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_22
; %bb.2:
	mov	w8, #1
	str	w8, [x19]
LBB0_3:
	add	w22, w24, w24, lsl #2
	mov	w8, #8
	lsl	w8, w8, w21
	tst	w21, #0x8000
	csel	w21, w21, w8, eq
Lloh8:
	adrp	x23, _AC97_WM9713_DIG1@GOTPAGE
Lloh9:
	ldr	x23, [x23, _AC97_WM9713_DIG1@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_wm97xx_reg_read
Lloh10:
	adrp	x8, _WM9713_ADCSEL_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _WM9713_ADCSEL_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	bic	w26, w0, w8
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_6
; %bb.4:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x21
	blr	x8
LBB0_6:
	ldr	w1, [x23]
	orr	w8, w26, w21
Lloh13:
	adrp	x26, _WM9713_POLL@GOTPAGE
Lloh14:
	ldr	x26, [x26, _WM9713_POLL@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_wm97xx_reg_write
	ldr	w0, [x25]
	bl	_poll_delay
	ldr	w1, [x23]
	mov	x0, x19
	bl	_wm97xx_reg_read
	ldr	w8, [x26]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w24, #0, #4, ne
	b.ne	LBB0_8
; %bb.7:
	mov	x25, x22
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x24, _AC97_LINK_FRAME@GOTPAGE
Lloh16:
	ldr	x24, [x24, _AC97_LINK_FRAME@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	bl	_udelay
	sub	w25, w22, #1
	ldr	w1, [x23]
	mov	x0, x19
	bl	_wm97xx_reg_read
	ldr	w8, [x26]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w22, #1, #4, ne
	mov	x22, x25
	b.ne	LBB0_9
LBB0_10:
	cmp	w25, #0
	b.le	LBB0_17
; %bb.11:
Lloh17:
	adrp	x8, _AC97_WM97XX_DIGITISER_RD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AC97_WM97XX_DIGITISER_RD@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_wm97xx_reg_read
	str	w0, [x20]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_14
; %bb.12:
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.13:
	mov	x0, x21
	blr	x8
	ldr	w0, [x20]
LBB0_14:
Lloh20:
	adrp	x8, _WM97XX_ADCSRC_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _WM97XX_ADCSRC_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w0
	asr	w9, w21, #1
	rbit	w9, w9
	clz	w9, w9
	lsl	w9, w9, #12
	add	w9, w9, #1, lsl #12             ; =4096
	cmp	w21, #2
	csel	w9, wzr, w9, lo
	cmp	w8, w9
	b.ne	LBB0_19
; %bb.15:
Lloh23:
	adrp	x8, _WM97XX_PEN_DOWN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _WM97XX_PEN_DOWN@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_18
; %bb.16:
Lloh26:
	adrp	x8, _RC_VALID@GOTPAGE
Lloh27:
	ldr	x8, [x8, _RC_VALID@GOTPAGEOFF]
	b	LBB0_23
LBB0_17:
	mov	x0, x19
	bl	_is_pden
	cbz	x0, LBB0_20
LBB0_18:
	str	wzr, [x19]
	b	LBB0_22
LBB0_19:
	ldr	w0, [x19, #4]
	stp	x21, x8, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_20:
	ldr	w0, [x19, #4]
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
LBB0_21:
	bl	_dev_dbg
LBB0_22:
Lloh32:
	adrp	x8, _RC_PENUP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _RC_PENUP@GOTPAGEOFF]
LBB0_23:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_delay,4,2                      ; @delay
	.comm	_AC97_WM97XX_DIGITISER_RD,4,2   ; @AC97_WM97XX_DIGITISER_RD
	.comm	_WM97XX_PEN_DOWN,4,2            ; @WM97XX_PEN_DOWN
	.comm	_RC_PENUP,4,2                   ; @RC_PENUP
	.comm	_AC97_WM9713_DIG1,4,2           ; @AC97_WM9713_DIG1
	.comm	_WM9713_ADCSEL_MASK,4,2         ; @WM9713_ADCSEL_MASK
	.comm	_WM9713_POLL,4,2                ; @WM9713_POLL
	.comm	_AC97_LINK_FRAME,4,2            ; @AC97_LINK_FRAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"adc sample timeout"

	.comm	_WM97XX_ADCSRC_MASK,4,2         ; @WM97XX_ADCSRC_MASK
l_.str.1:                               ; @.str.1
	.asciz	"adc wrong sample, read %x got %x"

	.comm	_RC_VALID,4,2                   ; @RC_VALID
	.no_dead_strip	_wm9713_poll_sample
.subsections_via_symbols
