	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aaci_ac97_write
_aaci_ac97_write:                       ## @aaci_ac97_write
	.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
	cmpl	$3, (%rdi)
	jle	LBB0_1
## %bb.7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	8(%rdi), %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_aaci_ac97_select_codec
	shll	$4, %r15d
	movq	_AACI_SL2TX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	movzwl	%r15w, %edi
	callq	_writel
	shll	$12, %r14d
	movq	_AACI_SL1TX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r13), %rsi
	movzwl	%r14w, %edi
	callq	_writel
	movl	$-5000, %ebx                    ## imm = 0xEC78
	movq	_AACI_SLFR@GOTPCREL(%rip), %r14
	movq	_SLFR_1TXB@GOTPCREL(%rip), %r15
	movq	_SLFR_2TXB@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	16(%r13), %rdi
	callq	_readl
	movl	(%r12), %ecx
	orl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	jne	LBB0_2
	jmp	LBB0_5
LBB0_4:
	testl	%ebx, %ebx
	jne	LBB0_6
LBB0_5:
	movq	8(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_6:
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AACI_SL2TX,8,3                 ## @AACI_SL2TX
	.comm	_AACI_SL1TX,8,3                 ## @AACI_SL1TX
	.comm	_AACI_SLFR,8,3                  ## @AACI_SLFR
	.comm	_SLFR_1TXB,4,2                  ## @SLFR_1TXB
	.comm	_SLFR_2TXB,4,2                  ## @SLFR_2TXB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for write to complete\n"

	.no_dead_strip	_aaci_ac97_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aaci_ac97_write
_aaci_ac97_write:                       ; @aaci_ac97_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x22
	bl	_aaci_ac97_select_codec
	ldr	x8, [x19, #16]
Lloh0:
	adrp	x9, _AACI_SL2TX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AACI_SL2TX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	ubfiz	w0, w21, #4, #12
	bl	_writel
	ldr	x8, [x19, #16]
Lloh3:
	adrp	x9, _AACI_SL1TX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AACI_SL1TX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	ubfiz	w0, w20, #12, #4
	bl	_writel
	mov	w20, #-5000
Lloh6:
	adrp	x21, _AACI_SLFR@GOTPAGE
Lloh7:
	ldr	x21, [x21, _AACI_SLFR@GOTPAGEOFF]
Lloh8:
	adrp	x22, _SLFR_1TXB@GOTPAGE
Lloh9:
	ldr	x22, [x22, _SLFR_1TXB@GOTPAGEOFF]
Lloh10:
	adrp	x23, _SLFR_2TXB@GOTPAGE
Lloh11:
	ldr	x23, [x23, _SLFR_2TXB@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x22]
	ldr	w9, [x23]
	orr	w8, w9, w8
	tst	w8, w0
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	adds	w20, w20, #1
	b.lo	LBB0_3
	b	LBB0_6
LBB0_5:
	cbnz	w20, LBB0_7
LBB0_6:
	ldr	x0, [x19, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AACI_SL2TX,8,3                 ; @AACI_SL2TX
	.comm	_AACI_SL1TX,8,3                 ; @AACI_SL1TX
	.comm	_AACI_SLFR,8,3                  ; @AACI_SLFR
	.comm	_SLFR_1TXB,4,2                  ; @SLFR_1TXB
	.comm	_SLFR_2TXB,4,2                  ; @SLFR_2TXB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for write to complete\n"

	.no_dead_strip	_aaci_ac97_write
.subsections_via_symbols
