	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psc_ac97_write
_psc_ac97_write:                        ## @psc_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %ebx
	movq	_psc_dma@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_mutex_lock
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	addq	$4, %rdi
	callq	_in_be16
	movq	_MPC52xx_PSC_SR_CMDSEND@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	movl	$100, %esi
	xorl	%edx, %edx
	callq	_spin_event_timeout
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	shll	$8, %ebx
	movzwl	%bx, %esi
	callq	_out_be32
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_3:
	movq	(%r14), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_psc_dma,8,3                    ## @psc_dma
	.comm	_MPC52xx_PSC_SR_CMDSEND,4,2     ## @MPC52xx_PSC_SR_CMDSEND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout on ac97 bus (write)\n"

	.no_dead_strip	_psc_ac97_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psc_ac97_write
_psc_ac97_write:                        ; @psc_ac97_write
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
Lloh0:
	adrp	x20, _psc_dma@GOTPAGE
Lloh1:
	ldr	x20, [x20, _psc_dma@GOTPAGEOFF]
	ldr	x0, [x20]
	bl	_mutex_lock
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	add	x0, x8, #4
	bl	_in_be16
Lloh2:
	adrp	x8, _MPC52xx_PSC_SR_CMDSEND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MPC52xx_PSC_SR_CMDSEND@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w0, eq
	mov	w1, #100
	mov	w2, #0
	bl	_spin_event_timeout
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	ubfiz	w1, w19, #8, #8
	bl	_out_be32
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_3:
	ldr	x0, [x20]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_psc_dma,8,3                    ; @psc_dma
	.comm	_MPC52xx_PSC_SR_CMDSEND,4,2     ; @MPC52xx_PSC_SR_CMDSEND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout on ac97 bus (write)\n"

	.no_dead_strip	_psc_ac97_write
.subsections_via_symbols
