	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function waitcodec
_waitcodec:                             ## @waitcodec
	.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, %rbx
	movl	$10, %edi
	callq	_au1550_delay
	movq	_POLL_COUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	movq	_PSC_AC97STAT@GOTPCREL(%rip), %r13
	movq	_PSC_AC97STAT_CR@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_au_readl
	movl	%eax, %r15d
	xorl	%eax, %eax
	callq	_au_sync
	testl	%r15d, (%r14)
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_3
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	cmpl	%eax, %ebx
	jne	LBB0_7
LBB0_11:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_err                            ## TAILCALL
LBB0_4:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_11
LBB0_7:
	movq	_AC97_POWER_CONTROL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_rdcodec
	testl	$32512, %eax                    ## imm = 0x7F00
	je	LBB0_9
## %bb.8:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_wrcodec
	movl	$100, %edi
	callq	_au1550_delay
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_rdcodec
LBB0_9:
	movl	%eax, %ecx
	andl	$32527, %ecx                    ## imm = 0x7F0F
	cmpl	$15, %ecx
	jne	LBB0_12
## %bb.10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_err                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_POLL_COUNT,4,2                 ## @POLL_COUNT
	.comm	_PSC_AC97STAT,4,2               ## @PSC_AC97STAT
	.comm	_PSC_AC97STAT_CR,4,2            ## @PSC_AC97STAT_CR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waitcodec: CODEC_READY poll expired!"

	.comm	_AC97_POWER_CONTROL,4,2         ## @AC97_POWER_CONTROL
L_.str.1:                               ## @.str.1
	.asciz	"codec reg 26 status (0x%x) not ready!!"

	.no_dead_strip	_waitcodec
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function waitcodec
_waitcodec:                             ; @waitcodec
	.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
	mov	w0, #10
	bl	_au1550_delay
Lloh0:
	adrp	x22, _POLL_COUNT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _POLL_COUNT@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w21, #0
Lloh2:
	adrp	x23, _PSC_AC97STAT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PSC_AC97STAT@GOTPAGEOFF]
Lloh4:
	adrp	x24, _PSC_AC97STAT_CR@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PSC_AC97STAT_CR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_au_readl
	mov	x20, x0
	bl	_au_sync
	ldr	w8, [x24]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w21, #0
LBB0_5:
	cmp	w21, w8
	b.ne	LBB0_8
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_err
LBB0_7:
	ldr	w8, [x22]
	cmp	w21, w8
	b.eq	LBB0_6
LBB0_8:
Lloh8:
	adrp	x20, _AC97_POWER_CONTROL@GOTPAGE
Lloh9:
	ldr	x20, [x20, _AC97_POWER_CONTROL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rdcodec
                                        ; kill: def $w0 killed $w0 def $x0
	tst	w0, #0x7f00
	b.eq	LBB0_10
; %bb.9:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_wrcodec
	mov	w0, #100
	bl	_au1550_delay
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rdcodec
                                        ; kill: def $w0 killed $w0 def $x0
LBB0_10:
	mov	w8, #32527
	and	w8, w0, w8
	cmp	w8, #15
	b.eq	LBB0_12
; %bb.11:
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err
LBB0_12:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_POLL_COUNT,4,2                 ; @POLL_COUNT
	.comm	_PSC_AC97STAT,4,2               ; @PSC_AC97STAT
	.comm	_PSC_AC97STAT_CR,4,2            ; @PSC_AC97STAT_CR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waitcodec: CODEC_READY poll expired!"

	.comm	_AC97_POWER_CONTROL,4,2         ; @AC97_POWER_CONTROL
l_.str.1:                               ; @.str.1
	.asciz	"codec reg 26 status (0x%x) not ready!!"

	.no_dead_strip	_waitcodec
.subsections_via_symbols
