	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psc_ac97_read
_psc_ac97_read:                         ## @psc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %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.4:
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	callq	_in_be32
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	addq	$8, %rdi
	movzwl	%bx, %r15d
	movl	%r15d, %esi
	orl	$-128, %esi
	shll	$24, %esi
	callq	_out_be32
	movq	(%r14), %rax
	movq	8(%rax), %rdi
	addq	$4, %rdi
	callq	_in_be16
	movq	_MPC52xx_PSC_SR_DATA_VAL@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, %edi
	movl	$100, %esi
	xorl	%edx, %edx
	callq	_spin_event_timeout
	movq	(%r14), %rcx
	movq	8(%rcx), %rdi
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	callq	_in_be32
	movl	%eax, %ebx
	shrl	$24, %eax
	andl	$127, %eax
	cmpl	%r15d, %eax
	jne	LBB0_7
## %bb.8:
	shrl	$8, %ebx
	movq	(%r14), %rdi
	callq	_mutex_unlock
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_5:
	addq	$4, %rdi
	callq	_in_be16
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_3
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_pr_err
LBB0_3:
	movq	(%r14), %rdi
	callq	_mutex_unlock
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movzwl	(%rax), %ebx
	negl	%ebx
LBB0_9:
	movzwl	%bx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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 (rdy)\n"

	.comm	_ENODEV,2,1                     ## @ENODEV
	.comm	_MPC52xx_PSC_SR_DATA_VAL,4,2    ## @MPC52xx_PSC_SR_DATA_VAL
L_.str.1:                               ## @.str.1
	.asciz	"timeout on ac97 read (val) %x\n"

L_.str.2:                               ## @.str.2
	.asciz	"reg echo error on ac97 read\n"

	.no_dead_strip	_psc_ac97_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psc_ac97_read
_psc_ac97_read:                         ; @psc_ac97_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
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_4
; %bb.1:
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_in_be32
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	add	x0, x8, #8
	lsl	w8, w19, #24
	orr	w1, w8, #0x80000000
	bl	_out_be32
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	add	x0, x8, #4
	bl	_in_be16
Lloh5:
	adrp	x8, _MPC52xx_PSC_SR_DATA_VAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MPC52xx_PSC_SR_DATA_VAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w0, w8, w0
	mov	w1, #100
	mov	w2, #0
	bl	_spin_event_timeout
	mov	x8, x0
	ldr	x9, [x20]
	ldr	x0, [x9, #8]
	cbz	w8, LBB0_5
; %bb.2:
	bl	_in_be32
	ubfx	w8, w0, #24, #7
	cmp	w8, w19
	b.ne	LBB0_6
; %bb.3:
	lsr	w19, w0, #8
	ldr	x0, [x20]
	bl	_mutex_unlock
	b	LBB0_8
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	add	x0, x0, #4
	bl	_in_be16
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_pr_err
	ldr	x0, [x20]
	bl	_mutex_unlock
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	ldrh	w8, [x8]
	neg	w19, w8
LBB0_8:
	and	w0, w19, #0xffff
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.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 (rdy)\n"

	.comm	_ENODEV,2,1                     ; @ENODEV
	.comm	_MPC52xx_PSC_SR_DATA_VAL,4,2    ; @MPC52xx_PSC_SR_DATA_VAL
l_.str.1:                               ; @.str.1
	.asciz	"timeout on ac97 read (val) %x\n"

l_.str.2:                               ; @.str.2
	.asciz	"reg echo error on ac97 read\n"

	.no_dead_strip	_psc_ac97_read
.subsections_via_symbols
