	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk1160_ac97_wait_transfer_complete
_stk1160_ac97_wait_transfer_complete:   ## @stk1160_ac97_wait_transfer_complete
	.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	%rdi, %r14
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_STK1160_AC97_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r15, %rbx
	movq	%rbx, %rdi
	callq	_time_is_after_jiffies
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	leaq	-44(%rbp), %r15
	movq	_STK1160_AC97CTL_0_CR@GOTPCREL(%rip), %r13
	movq	_STK1160_AC97CTL_0_CW@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_STK1160_AC97CTL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_stk1160_read_reg
	movl	(%r12), %eax
	orl	(%r13), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$50, %edi
	movl	$100, %esi
	callq	_usleep_range
	movq	%rbx, %rdi
	callq	_time_is_after_jiffies
	testq	%rax, %rax
	jne	LBB0_2
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_stk1160_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_STK1160_AC97_TIMEOUT,4,2       ## @STK1160_AC97_TIMEOUT
	.comm	_STK1160_AC97CTL_0,4,2          ## @STK1160_AC97CTL_0
	.comm	_STK1160_AC97CTL_0_CR,4,2       ## @STK1160_AC97CTL_0_CR
	.comm	_STK1160_AC97CTL_0_CW,4,2       ## @STK1160_AC97CTL_0_CW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AC97 transfer took too long, this should never happen!"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk1160_ac97_wait_transfer_complete
_stk1160_ac97_wait_transfer_complete:   ; @stk1160_ac97_wait_transfer_complete
	.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	x19, x0
Lloh0:
	adrp	x8, _jiffies@GOTPAGE
Lloh1:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _STK1160_AC97_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STK1160_AC97_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	add	x20, x0, x20
	mov	x0, x20
	bl	_time_is_after_jiffies
	cbz	x0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x21, _STK1160_AC97CTL_0@GOTPAGE
Lloh7:
	ldr	x21, [x21, _STK1160_AC97CTL_0@GOTPAGEOFF]
Lloh8:
	adrp	x22, _STK1160_AC97CTL_0_CR@GOTPAGE
Lloh9:
	ldr	x22, [x22, _STK1160_AC97CTL_0_CR@GOTPAGEOFF]
Lloh10:
	adrp	x23, _STK1160_AC97CTL_0_CW@GOTPAGE
Lloh11:
	ldr	x23, [x23, _STK1160_AC97CTL_0_CW@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_stk1160_read_reg
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	ldr	w10, [x23]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #50
	mov	w1, #100
	bl	_usleep_range
	mov	x0, x20
	bl	_time_is_after_jiffies
	cbnz	x0, LBB0_2
LBB0_4:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_stk1160_err
Lloh14:
	adrp	x8, _EBUSY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_STK1160_AC97_TIMEOUT,4,2       ; @STK1160_AC97_TIMEOUT
	.comm	_STK1160_AC97CTL_0,4,2          ; @STK1160_AC97CTL_0
	.comm	_STK1160_AC97CTL_0_CR,4,2       ; @STK1160_AC97CTL_0_CR
	.comm	_STK1160_AC97CTL_0_CW,4,2       ; @STK1160_AC97CTL_0_CW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AC97 transfer took too long, this should never happen!"

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