	.file	"extr_aic7xxx.c_ahc_run_tqinfifo.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ahc_run_tqinfifo
	.type	ahc_run_tqinfifo, @function
ahc_run_tqinfifo:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	eax, DWORD PTR [rdi]
	mov	rbx, rdi
	test	DWORD PTR AHC_AUTOPAUSE[rip], eax
	cmovne	esi, DWORD PTR TRUE[rip]
	mov	ebp, esi
	mov	esi, DWORD PTR BUS_DMASYNC_POSTREAD[rip]
	call	ahc_sync_tqinfifo@PLT
.L3:
	mov	rdx, QWORD PTR 8[rbx]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rsi, r12
	mov	rdi, rbx
	call	ahc_handle_target_cmd@PLT
	test	rax, rax
	jne	.L1
	mov	QWORD PTR [r12], 0
	mov	rsi, QWORD PTR 8[rbx]
	mov	rdi, rbx
	mov	r12d, DWORD PTR BUS_DMASYNC_PREREAD[rip]
	call	ahc_targetcmd_offset@PLT
	mov	edx, DWORD PTR 16[rbx]
	mov	esi, DWORD PTR 20[rbx]
	mov	r9d, r12d
	mov	ecx, eax
	mov	r8d, 8
	mov	rdi, rbx
	call	aic_dmamap_sync@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR HOST_TQINPOS[rip]
	lea	rdx, 1[rax]
	lea	eax, -1[rcx]
	cdqe
	mov	QWORD PTR 8[rbx], rdx
	and	rax, rdx
	cmp	rax, 1
	je	.L16
.L5:
	mov	rax, QWORD PTR 24[rbx]
	lea	r12, [rax+rdx*8]
	cmp	QWORD PTR [r12], 0
	jne	.L9
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR AHC_HS_MAILBOX[rip], eax
	jne	.L17
	test	ebp, ebp
	je	.L18
	mov	esi, DWORD PTR KERNEL_TQINPOS[rip]
	and	edx, ecx
	mov	rdi, rbx
	call	ahc_outb@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR HS_MAILBOX[rip]
	mov	rdi, rbx
	call	ahc_inb@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	esi, DWORD PTR HS_MAILBOX[rip]
	mov	rdi, rbx
	mov	r8d, eax
	mov	eax, DWORD PTR HOST_TQINPOS[rip]
	and	edx, eax
	not	eax
	and	eax, r8d
	or	edx, eax
	call	ahc_outb@PLT
	jmp	.L3
.L18:
	mov	rdi, rbx
	call	ahc_pause@PLT
	mov	esi, DWORD PTR KERNEL_TQINPOS[rip]
	mov	rdx, QWORD PTR 8[rbx]
	mov	rdi, rbx
	and	edx, DWORD PTR HOST_TQINPOS[rip]
	call	ahc_outb@PLT
	mov	rdi, rbx
	call	ahc_unpause@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	ahc_run_tqinfifo, .-ahc_run_tqinfifo
	.comm	TRUE,4,4
	.comm	KERNEL_TQINPOS,4,4
	.comm	HS_MAILBOX,4,4
	.comm	HOST_TQINPOS,4,4
	.comm	BUS_DMASYNC_PREREAD,4,4
	.comm	BUS_DMASYNC_POSTREAD,4,4
	.comm	AHC_HS_MAILBOX,4,4
	.comm	AHC_AUTOPAUSE,4,4
	.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_aic7xxx.c_ahc_run_tqinfifo.c"
	.text
	.align	2
	.global	ahc_run_tqinfifo
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahc_run_tqinfifo, %function
ahc_run_tqinfifo:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L21
	ldr	r2, [r0]
	ldr	r3, [r3]
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	tst	r2, r3
	ldrne	r3, .L21+4
	moveq	r8, r1
	ldrne	r8, [r3]
	ldr	r3, .L21+8
	sub	sp, sp, #12
	ldr	r1, [r3]
	mov	r4, r0
	bl	ahc_sync_tqinfifo
	ldr	r7, .L21+12
	ldr	r6, .L21+16
	ldr	r9, .L21+20
.L3:
	mov	r5, #4
	ldr	r1, [r4, #4]
	b	.L5
.L9:
	mov	r0, r4
	bl	ahc_handle_target_cmd
	cmp	r0, #0
	bne	.L1
	str	r0, [r10, fp]
	ldr	r1, [r4, #4]
	mov	r0, r4
	ldr	r10, [r4, #12]
	ldr	fp, [r4, #8]
	bl	ahc_targetcmd_offset
	ldr	ip, [r7]
	mov	r3, r0
	mov	r2, fp
	mov	r1, r10
	mov	r0, r4
	stm	sp, {r5, ip}
	bl	aic_dmamap_sync
	ldr	r1, [r4, #4]
	ldr	r2, [r6]
	add	r1, r1, #1
	sub	r3, r2, #1
	and	r3, r3, r1
	cmp	r3, #1
	str	r1, [r4, #4]
	beq	.L18
.L5:
	ldr	r10, [r4, #16]
	lsl	fp, r1, #2
	ldr	r0, [r10, r1, lsl #2]
	add	r1, r10, r1, lsl #2
	cmp	r0, #0
	bne	.L9
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	ldr	r0, [r4]
	ldr	r3, [r9]
	tst	r0, r3
	bne	.L19
	cmp	r8, #0
	beq	.L20
	ldr	r3, .L21+24
	and	r2, r2, r1
	mov	r0, r4
	ldr	r1, [r3]
	bl	ahc_outb
	b	.L3
.L19:
	ldr	r5, .L21+28
	mov	r0, r4
	ldr	r1, [r5]
	bl	ahc_inb
	ldr	r3, [r6]
	ldr	r1, [r4, #4]
	bic	r2, r0, r3
	and	r3, r3, r1
	mov	r0, r4
	ldr	r1, [r5]
	orr	r2, r3, r2
	bl	ahc_outb
	b	.L3
.L20:
	mov	r0, r4
	bl	ahc_pause
	ldr	r2, [r4, #4]
	ldr	r3, [r6]
	ldr	r1, .L21+24
	mov	r0, r4
	ldr	r1, [r1]
	and	r2, r2, r3
	bl	ahc_outb
	mov	r0, r4
	bl	ahc_unpause
	b	.L3
.L22:
	.align	2
.L21:
	.word	AHC_AUTOPAUSE
	.word	TRUE
	.word	BUS_DMASYNC_POSTREAD
	.word	BUS_DMASYNC_PREREAD
	.word	HOST_TQINPOS
	.word	AHC_HS_MAILBOX
	.word	KERNEL_TQINPOS
	.word	HS_MAILBOX
	.size	ahc_run_tqinfifo, .-ahc_run_tqinfifo
	.comm	TRUE,4,4
	.comm	KERNEL_TQINPOS,4,4
	.comm	HS_MAILBOX,4,4
	.comm	HOST_TQINPOS,4,4
	.comm	BUS_DMASYNC_PREREAD,4,4
	.comm	BUS_DMASYNC_POSTREAD,4,4
	.comm	AHC_HS_MAILBOX,4,4
	.comm	AHC_AUTOPAUSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
