	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aaci_ac97_read
_aaci_ac97_read:                        ## @aaci_ac97_read
	.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
	movw	$-1, %r14w
	cmpl	$3, (%rdi)
	jg	LBB0_25
## %bb.1:
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_aaci_ac97_select_codec
	movzwl	%r12w, %r13d
	shll	$12, %r12d
	movq	_AACI_SL1TX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	movzwl	%r12w, %edi
	callq	_writel
	movl	$-5000, %ebx                    ## imm = 0xEC78
	movq	_AACI_SLFR@GOTPCREL(%rip), %r12
	movq	_SLFR_1TXB@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	movzwl	(%r14), %ecx
	testl	%ecx, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	jne	LBB0_2
	jmp	LBB0_8
LBB0_4:
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.5:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	$42, %edi
	callq	_udelay
	movl	$-5000, %ebx                    ## imm = 0xEC78
	movq	_SLFR_1RXV@GOTPCREL(%rip), %r13
	movq	_SLFR_2RXV@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_cond_resched
	movq	(%r12), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	movzwl	(%r14), %ecx
	orw	(%r13), %cx
	notl	%eax
	testw	%ax, %cx
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	jne	LBB0_6
	jmp	LBB0_21
LBB0_8:
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_22
LBB0_9:
	testl	%ebx, %ebx
	je	LBB0_21
## %bb.10:
	movq	_AACI_SL1RX@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.11:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.12:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.13:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.14:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.15:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.16:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.17:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.18:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %eax
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.19:
	movq	8(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	(%r14), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	shrl	$12, %eax
	movzwl	%ax, %edx
	cmpl	%ebx, %edx
	jne	LBB0_26
LBB0_20:
	movq	_AACI_SL2RX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r15), %rdi
	callq	_readl
	movl	%eax, %r14d
	shrl	$4, %r14d
	jmp	LBB0_24
LBB0_21:
	movq	8(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_22:
	callq	_dev_err
LBB0_23:
	movw	$-1, %r14w
LBB0_24:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_25:
	movzwl	%r14w, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	8(%r15), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_AACI_SL1TX,8,3                 ## @AACI_SL1TX
	.comm	_AACI_SLFR,8,3                  ## @AACI_SLFR
	.comm	_SLFR_1TXB,2,1                  ## @SLFR_1TXB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout on slot 1 TX busy\n"

	.comm	_SLFR_1RXV,2,1                  ## @SLFR_1RXV
	.comm	_SLFR_2RXV,2,1                  ## @SLFR_2RXV
L_.str.1:                               ## @.str.1
	.asciz	"timeout on RX valid\n"

	.comm	_AACI_SL1RX,8,3                 ## @AACI_SL1RX
	.comm	_AACI_SL2RX,8,3                 ## @AACI_SL2RX
L_.str.2:                               ## @.str.2
	.asciz	"ac97 read back fail.  retry\n"

L_.str.3:                               ## @.str.3
	.asciz	"wrong ac97 register read back (%x != %x)\n"

	.no_dead_strip	_aaci_ac97_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aaci_ac97_read
_aaci_ac97_read:                        ; @aaci_ac97_read
	.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
	ldr	w8, [x0]
	cmp	w8, #3
	b.le	LBB0_2
; %bb.1:
	mov	w20, #65535
	b	LBB0_26
LBB0_2:
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x21
	bl	_aaci_ac97_select_codec
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _AACI_SL1TX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AACI_SL1TX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	ubfiz	w0, w20, #12, #4
	bl	_writel
	mov	w22, #-5000
Lloh3:
	adrp	x21, _AACI_SLFR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _AACI_SLFR@GOTPAGEOFF]
Lloh5:
	adrp	x23, _SLFR_1TXB@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SLFR_1TXB@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldrh	w8, [x23]
	tst	w0, w8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	adds	w22, w22, #1
	b.lo	LBB0_3
	b	LBB0_9
LBB0_5:
	cbz	w22, LBB0_9
; %bb.6:
	mov	w0, #42
	bl	_udelay
	mov	w22, #-5000
Lloh7:
	adrp	x23, _SLFR_1RXV@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SLFR_1RXV@GOTPAGEOFF]
Lloh9:
	adrp	x24, _SLFR_2RXV@GOTPAGE
Lloh10:
	ldr	x24, [x24, _SLFR_2RXV@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	bl	_cond_resched
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldrh	w8, [x23]
	ldrh	w9, [x24]
	orr	w8, w9, w8
	bics	wzr, w8, w0
	b.eq	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	adds	w22, w22, #1
	b.lo	LBB0_7
	b	LBB0_22
LBB0_9:
	ldr	x0, [x19, #8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_23
LBB0_10:
	cbz	w22, LBB0_22
; %bb.11:
	ldr	x8, [x19, #16]
Lloh13:
	adrp	x21, _AACI_SL1RX@GOTPAGE
Lloh14:
	ldr	x21, [x21, _AACI_SL1RX@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.12:
	ldr	x0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.13:
	ldr	x0, [x19, #8]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.14:
	ldr	x0, [x19, #8]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.15:
	ldr	x0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.16:
	ldr	x0, [x19, #8]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.17:
	ldr	x0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.18:
	ldr	x0, [x19, #8]
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.19:
	ldr	x0, [x19, #8]
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	lsr	w8, w0, #12
	cmp	w20, w8, uxth
	b.eq	LBB0_21
; %bb.20:
	ldr	x0, [x19, #8]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ubfx	w8, w0, #12, #16
	cmp	w8, w20
	b.ne	LBB0_27
LBB0_21:
	ldr	x8, [x19, #16]
Lloh33:
	adrp	x9, _AACI_SL2RX@GOTPAGE
Lloh34:
	ldr	x9, [x9, _AACI_SL2RX@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	lsr	w20, w0, #4
	b	LBB0_25
LBB0_22:
	ldr	x0, [x19, #8]
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_23:
	bl	_dev_err
LBB0_24:
	mov	w20, #65535
LBB0_25:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_26:
	and	w0, w20, #0xffff
	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
LBB0_27:
	ldr	x0, [x19, #8]
	stp	x8, x20, [sp]
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
	b	LBB0_24
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_AACI_SL1TX,8,3                 ; @AACI_SL1TX
	.comm	_AACI_SLFR,8,3                  ; @AACI_SLFR
	.comm	_SLFR_1TXB,2,1                  ; @SLFR_1TXB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout on slot 1 TX busy\n"

	.comm	_SLFR_1RXV,2,1                  ; @SLFR_1RXV
	.comm	_SLFR_2RXV,2,1                  ; @SLFR_2RXV
l_.str.1:                               ; @.str.1
	.asciz	"timeout on RX valid\n"

	.comm	_AACI_SL1RX,8,3                 ; @AACI_SL1RX
	.comm	_AACI_SL2RX,8,3                 ; @AACI_SL2RX
l_.str.2:                               ; @.str.2
	.asciz	"ac97 read back fail.  retry\n"

l_.str.3:                               ; @.str.3
	.asciz	"wrong ac97 register read back (%x != %x)\n"

	.no_dead_strip	_aaci_ac97_read
.subsections_via_symbols
