	.file	"extr_mpc5200_psc_ac97.c_psc_ac97_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"timeout on ac97 bus (rdy)\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"timeout on ac97 read (val) %x\n"
	.section	.rodata.str1.1
.LC2:
	.string	"reg echo error on ac97 read\n"
	.text
	.p2align 4
	.type	psc_ac97_read, @function
psc_ac97_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	ebx, esi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rdi, QWORD PTR psc_dma[rip]
	call	mutex_lock@PLT
	mov	rax, QWORD PTR psc_dma[rip]
	mov	rdi, QWORD PTR 8[rax]
	add	rdi, 4
	call	in_be16@PLT
	xor	edi, edi
	test	DWORD PTR MPC52xx_PSC_SR_CMDSEND[rip], eax
	mov	esi, 100
	sete	dil
	xor	edx, edx
	call	spin_event_timeout@PLT
	lea	rdi, .LC0[rip]
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR psc_dma[rip]
	movzx	ebp, bx
	sal	ebx, 24
	mov	rdi, QWORD PTR 8[rax]
	call	in_be32@PLT
	mov	rax, QWORD PTR psc_dma[rip]
	mov	esi, ebx
	and	esi, 2130706432
	mov	rdi, QWORD PTR 8[rax]
	or	esi, -2147483648
	add	rdi, 8
	call	out_be32@PLT
	mov	rax, QWORD PTR psc_dma[rip]
	mov	rdi, QWORD PTR 8[rax]
	add	rdi, 4
	call	in_be16@PLT
	and	eax, DWORD PTR MPC52xx_PSC_SR_DATA_VAL[rip]
	xor	edx, edx
	mov	esi, 100
	mov	edi, eax
	call	spin_event_timeout@PLT
	test	eax, eax
	mov	rax, QWORD PTR psc_dma[rip]
	mov	rdi, QWORD PTR 8[rax]
	je	.L9
	call	in_be32@PLT
	mov	ebx, eax
	shr	eax, 24
	and	eax, 127
	cmp	eax, ebp
	je	.L5
	lea	rdi, .LC2[rip]
	xor	eax, eax
.L7:
	call	pr_err@PLT
	mov	rdi, QWORD PTR psc_dma[rip]
	call	mutex_unlock@PLT
	movzx	eax, WORD PTR ENODEV[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	add	rdi, 4
	call	in_be16@PLT
	lea	rdi, .LC1[rip]
	mov	esi, eax
	xor	eax, eax
	call	pr_err@PLT
	mov	rdi, QWORD PTR psc_dma[rip]
	call	mutex_unlock@PLT
	movzx	eax, WORD PTR ENODEV[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdi, QWORD PTR psc_dma[rip]
	call	mutex_unlock@PLT
	mov	eax, ebx
	add	rsp, 8
	.cfi_def_cfa_offset 24
	shr	eax, 8
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	psc_ac97_read, .-psc_ac97_read
	.comm	psc_dma,8,8
	.comm	MPC52xx_PSC_SR_DATA_VAL,4,4
	.comm	MPC52xx_PSC_SR_CMDSEND,4,4
	.comm	ENODEV,2,2
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mpc5200_psc_ac97.c_psc_ac97_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"timeout on ac97 bus (rdy)\012\000"
	.align	2
.LC1:
	.ascii	"timeout on ac97 read (val) %x\012\000"
	.align	2
.LC2:
	.ascii	"reg echo error on ac97 read\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	psc_ac97_read, %function
psc_ac97_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r5, .L11
	mov	r6, r1
	ldr	r0, [r5]
	bl	mutex_lock
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	add	r0, r0, #4
	bl	in_be16
	mov	r2, #0
	ldr	r3, .L11+4
	mov	r1, #100
	ldr	r3, [r3]
	tst	r0, r3
	moveq	r0, #1
	movne	r0, r2
	bl	spin_event_timeout
	cmp	r0, #0
	beq	.L9
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	bl	in_be32
	ldr	r3, [r5]
	lsl	r1, r6, #24
	ldr	r0, [r3, #4]
	and	r1, r1, #2130706432
	orr	r1, r1, #-2147483648
	add	r0, r0, #8
	bl	out_be32
	ldr	r3, [r5]
	ldr	r0, [r3, #4]
	add	r0, r0, #4
	bl	in_be16
	ldr	r3, .L11+8
	mov	r2, #0
	ldr	r3, [r3]
	mov	r1, #100
	and	r0, r0, r3
	bl	spin_event_timeout
	ldr	r3, [r5]
	cmp	r0, #0
	ldr	r0, [r3, #4]
	beq	.L10
	bl	in_be32
	lsr	r3, r0, #24
	and	r3, r3, #127
	cmp	r3, r6
	mov	r4, r0
	beq	.L5
	ldr	r0, .L11+12
	bl	pr_err
.L7:
	ldr	r0, [r5]
	bl	mutex_unlock
	ldr	r3, .L11+16
	ldrh	r0, [r3]
	rsb	r0, r0, #0
	lsl	r0, r0, #16
	lsr	r0, r0, #16
	pop	{r4, r5, r6, pc}
.L10:
	add	r0, r0, #4
	bl	in_be16
	mov	r1, r0
	ldr	r0, .L11+20
	bl	pr_err
	b	.L7
.L9:
	ldr	r0, .L11+24
	bl	pr_err
	b	.L7
.L5:
	ldr	r0, [r5]
	bl	mutex_unlock
	lsr	r0, r4, #8
	lsl	r0, r0, #16
	lsr	r0, r0, #16
	pop	{r4, r5, r6, pc}
.L12:
	.align	2
.L11:
	.word	psc_dma
	.word	MPC52xx_PSC_SR_CMDSEND
	.word	MPC52xx_PSC_SR_DATA_VAL
	.word	.LC2
	.word	ENODEV
	.word	.LC1
	.word	.LC0
	.size	psc_ac97_read, .-psc_ac97_read
	.comm	psc_dma,4,4
	.comm	MPC52xx_PSC_SR_DATA_VAL,4,4
	.comm	MPC52xx_PSC_SR_CMDSEND,4,4
	.comm	ENODEV,2,2
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
