	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rdcodec
_rdcodec:                               ## @rdcodec
	.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
	movl	%esi, %r14d
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_POLL_COUNT@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, %eax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	jle	LBB0_1
## %bb.2:
	movq	_PSC_AC97STAT@GOTPCREL(%rip), %r14
	movq	_PSC_AC97STAT_CP@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_au_readl
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_au_sync
	testl	%r13d, (%r15)
	je	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_8
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_err
LBB0_8:
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_PSC_AC97CDC_INDX
	movq	_PSC_AC97CDC_RD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_PSC_AC97CDC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_au_writel
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_au_sync
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_13
## %bb.9:
	movq	_PSC_AC97STAT@GOTPCREL(%rip), %r14
	movq	_PSC_AC97STAT_CP@GOTPCREL(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_au_readl
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_au_sync
	testl	%r13d, (%r15)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_10
LBB0_13:
	cmpl	%eax, %ebx
	jne	LBB0_14
LBB0_16:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_17
LBB0_4:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_7
	jmp	LBB0_8
LBB0_11:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_16
LBB0_14:
	testl	%eax, %eax
	jle	LBB0_15
## %bb.18:
	movq	_PSC_AC97EVNT@GOTPCREL(%rip), %r15
	movq	_PSC_AC97EVNT_CD@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_au_readl
	movl	%eax, %r13d
	xorl	%eax, %eax
	callq	_au_sync
	testl	%r13d, (%r14)
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	%ebx
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	jl	LBB0_19
	jmp	LBB0_22
LBB0_15:
	xorl	%ebx, %ebx
LBB0_22:
	cmpl	%eax, %ebx
	jne	LBB0_24
LBB0_23:
	leaq	L_.str.2(%rip), %rdi
LBB0_17:
	callq	_err
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_20:
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_23
LBB0_24:
	movq	_PSC_AC97CDC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_au_readl
	movzwl	%ax, %ebx
	xorl	%eax, %eax
	callq	_au_sync
	movq	_PSC_AC97EVNT_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PSC_AC97EVNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_au_writel
	xorl	%eax, %eax
	callq	_au_sync
LBB0_25:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POLL_COUNT,4,2                 ## @POLL_COUNT
	.comm	_PSC_AC97STAT,4,2               ## @PSC_AC97STAT
	.comm	_PSC_AC97STAT_CP,4,2            ## @PSC_AC97STAT_CP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rdcodec: codec cmd pending expired!"

	.comm	_PSC_AC97CDC_RD,4,2             ## @PSC_AC97CDC_RD
	.comm	_PSC_AC97CDC,4,2                ## @PSC_AC97CDC
L_.str.1:                               ## @.str.1
	.asciz	"rdcodec: read poll expired!"

	.comm	_PSC_AC97EVNT,4,2               ## @PSC_AC97EVNT
	.comm	_PSC_AC97EVNT_CD,4,2            ## @PSC_AC97EVNT_CD
L_.str.2:                               ## @.str.2
	.asciz	"rdcodec: read cmdwait expired!"

	.no_dead_strip	_rdcodec
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rdcodec
_rdcodec:                               ; @rdcodec
	.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
	mov	x20, x1
	ldr	x19, [x0]
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x22, _POLL_COUNT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _POLL_COUNT@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x23, _PSC_AC97STAT@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PSC_AC97STAT@GOTPAGEOFF]
Lloh4:
	adrp	x24, _PSC_AC97STAT_CP@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PSC_AC97STAT_CP@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w25, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_au_readl
	mov	x21, x0
	bl	_au_sync
	ldr	w8, [x24]
	tst	w8, w21
	b.eq	LBB0_14
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w25, w25, #1
	ldr	w8, [x22]
	cmp	w25, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w25, #0
LBB0_5:
	cmp	w25, w8
	b.ne	LBB0_7
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
LBB0_7:
	mov	x0, x20
	bl	_PSC_AC97CDC_INDX
Lloh8:
	adrp	x8, _PSC_AC97CDC_RD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PSC_AC97CDC_RD@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w0, w8, w0
Lloh11:
	adrp	x21, _PSC_AC97CDC@GOTPAGE
Lloh12:
	ldr	x21, [x21, _PSC_AC97CDC@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_au_writel
	bl	_au_sync
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w25, #0
LBB0_9:                                 ; =>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.eq	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w25, w25, #1
	ldr	w8, [x22]
	cmp	w25, w8
	b.lt	LBB0_9
	b	LBB0_12
LBB0_11:
	mov	w25, #0
LBB0_12:
	cmp	w25, w8
	b.ne	LBB0_16
LBB0_13:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_23
LBB0_14:
	ldr	w8, [x22]
	cmp	w25, w8
	b.eq	LBB0_6
	b	LBB0_7
LBB0_15:
	ldr	w8, [x22]
	cmp	w25, w8
	b.eq	LBB0_13
LBB0_16:
Lloh15:
	adrp	x23, _PSC_AC97EVNT@GOTPAGE
Lloh16:
	ldr	x23, [x23, _PSC_AC97EVNT@GOTPAGEOFF]
Lloh17:
	adrp	x24, _PSC_AC97EVNT_CD@GOTPAGE
Lloh18:
	ldr	x24, [x24, _PSC_AC97EVNT_CD@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.17:
	mov	w25, #0
LBB0_18:                                ; =>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_24
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	add	w25, w25, #1
	ldr	w8, [x22]
	cmp	w25, w8
	b.lt	LBB0_18
	b	LBB0_21
LBB0_20:
	mov	w25, #0
LBB0_21:
	cmp	w25, w8
	b.ne	LBB0_25
LBB0_22:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_23:
	bl	_err
	mov	w20, #0
	b	LBB0_26
LBB0_24:
	ldr	w8, [x22]
	cmp	w25, w8
	b.eq	LBB0_22
LBB0_25:
	ldr	w0, [x21]
	bl	_au_readl
	and	w20, w0, #0xffff
	bl	_au_sync
	ldr	w0, [x24]
	ldr	w1, [x23]
	bl	_au_writel
	bl	_au_sync
LBB0_26:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_POLL_COUNT,4,2                 ; @POLL_COUNT
	.comm	_PSC_AC97STAT,4,2               ; @PSC_AC97STAT
	.comm	_PSC_AC97STAT_CP,4,2            ; @PSC_AC97STAT_CP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rdcodec: codec cmd pending expired!"

	.comm	_PSC_AC97CDC_RD,4,2             ; @PSC_AC97CDC_RD
	.comm	_PSC_AC97CDC,4,2                ; @PSC_AC97CDC
l_.str.1:                               ; @.str.1
	.asciz	"rdcodec: read poll expired!"

	.comm	_PSC_AC97EVNT,4,2               ; @PSC_AC97EVNT
	.comm	_PSC_AC97EVNT_CD,4,2            ; @PSC_AC97EVNT_CD
l_.str.2:                               ; @.str.2
	.asciz	"rdcodec: read cmdwait expired!"

	.no_dead_strip	_rdcodec
.subsections_via_symbols
