	.file	"extr_mtip32xx.c_mtip_hw_submit_io.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mtip_hw_submit_io, @function
mtip_hw_submit_io:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rcx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r14, QWORD PTR [rdi]
	movsx	rax, DWORD PTR [rsi]
	mov	rdi, rsi
	sal	rax, 10
	add	rax, QWORD PTR 16[r14]
	mov	QWORD PTR 8[rsp], rax
	call	rq_data_dir@PLT
	cmp	rax, QWORD PTR READ[rip]
	mov	r15d, DWORD PTR DMA_TO_DEVICE[rip]
	jne	.L3
	mov	r15d, DWORD PTR DMA_FROM_DEVICE[rip]
.L3:
	mov	rdi, r12
	call	blk_rq_pos@PLT
	mov	rdi, r12
	mov	DWORD PTR 28[rsp], eax
	call	blk_rq_sectors@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, DWORD PTR 28[rbx]
	mov	rsi, r12
	mov	DWORD PTR 16[rsp], eax
	call	blk_rq_map_sg@PLT
	mov	esi, DWORD PTR 28[rbx]
	mov	rdi, QWORD PTR 8[r13]
	mov	ecx, r15d
	mov	edx, eax
	call	dma_map_sg@PLT
	mov	rdi, r14
	mov	ebp, eax
	call	prefetch@PLT
	mov	rsi, QWORD PTR 16[rbx]
	mov	r9d, DWORD PTR 16[rsp]
	mov	DWORD PTR [rbx], ebp
	mov	eax, DWORD PTR MTIP_MAX_RETRIES[rip]
	mov	r8d, DWORD PTR 28[rsp]
	mov	DWORD PTR 24[rbx], eax
	movabs	rax, 549755813927
	mov	QWORD PTR [rsi], rax
	cmp	DWORD PTR DMA_FROM_DEVICE[rip], r15d
	mov	eax, DWORD PTR ATA_CMD_FPDMA_WRITE[rip]
	jne	.L5
	mov	eax, DWORD PTR ATA_CMD_FPDMA_READ[rip]
.L5:
	mov	DWORD PTR 80[rsi], eax
	movzx	eax, r8b
	mov	ecx, 32
	mov	rdi, r13
	mov	DWORD PTR 8[rsi], eax
	mov	eax, r8d
	movzx	eax, ah
	mov	DWORD PTR 32[rsi], 64
	mov	DWORD PTR 12[rsi], eax
	mov	eax, r8d
	sar	eax, 16
	mov	QWORD PTR 16[rsp], rsi
	and	eax, 255
	mov	DWORD PTR 16[rsi], eax
	mov	eax, r8d
	shr	eax, 24
	mov	DWORD PTR 20[rsi], eax
	mov	eax, r8d
	sar	eax, cl
	mov	ecx, 40
	and	eax, 255
	sar	r8d, cl
	mov	DWORD PTR 24[rsi], eax
	movzx	eax, r9b
	and	r8d, 255
	mov	DWORD PTR 36[rsi], eax
	mov	eax, r9d
	movzx	eax, ah
	mov	DWORD PTR 28[rsi], r8d
	mov	DWORD PTR 40[rsi], eax
	mov	eax, DWORD PTR [r12]
	mov	QWORD PTR 72[rsi], 0
	lea	edx, 0[0+rax*8]
	sar	eax, 5
	mov	QWORD PTR 64[rsi], 0
	or	eax, edx
	mov	QWORD PTR 56[rsi], 0
	mov	edx, ebp
	mov	DWORD PTR 44[rsi], eax
	mov	QWORD PTR 48[rsi], 0
	mov	rsi, rbx
	call	fill_command_sg@PLT
	mov	edi, DWORD PTR 4[rbx]
	call	unlikely@PLT
	test	rax, rax
	je	.L6
	mov	rsi, QWORD PTR 16[rsp]
	or	DWORD PTR 32[rsi], 128
.L6:
	mov	edi, DWORD PTR 8[rbx]
	call	cpu_to_le32@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR MTIP_PF_HOST_CAP_64[rip]
	mov	QWORD PTR 24[rsi], rax
	mov	rsi, QWORD PTR 0[r13]
	call	test_bit@PLT
	test	rax, rax
	jne	.L17
.L7:
	mov	edi, ebp
	sal	edi, 16
	or	edi, DWORD PTR AHCI_CMD_PREFETCH[rip]
	or	edi, 5
	call	cpu_to_le32@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	edi, DWORD PTR [r14]
	and	edi, DWORD PTR MTIP_PF_PAUSE_IO[rip]
	mov	QWORD PTR 8[rcx], rax
	mov	QWORD PTR [rcx], 0
	mov	DWORD PTR 12[rbx], r15d
	call	unlikely@PLT
	test	rax, rax
	jne	.L18
	mov	esi, DWORD PTR [r12]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r14
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	mtip_issue_ncq_command@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	rsi, QWORD PTR 8[r14]
	mov	edi, DWORD PTR [r12]
	call	set_bit@PLT
	mov	edi, DWORD PTR MTIP_PF_ISSUE_CMDS_BIT[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rsi, r14
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	set_bit@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	edi, DWORD PTR 8[rbx]
	sar	edi, 31
	call	cpu_to_le32@PLT
	mov	rdx, QWORD PTR 8[rsp]
	mov	QWORD PTR 16[rdx], rax
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	mtip_hw_submit_io, .-mtip_hw_submit_io
	.comm	READ,8,8
	.comm	MTIP_PF_PAUSE_IO,4,4
	.comm	MTIP_PF_ISSUE_CMDS_BIT,4,4
	.comm	MTIP_PF_HOST_CAP_64,4,4
	.comm	MTIP_MAX_RETRIES,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.comm	ATA_CMD_FPDMA_WRITE,4,4
	.comm	ATA_CMD_FPDMA_READ,4,4
	.comm	AHCI_CMD_PREFETCH,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_mtip32xx.c_mtip_hw_submit_io.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtip_hw_submit_io, %function
mtip_hw_submit_io:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r9, [r0]
	ldr	r10, [r1]
	ldr	r5, [r9, #8]
	sub	sp, sp, #20
	mov	r7, r0
	mov	r0, r1
	mov	r4, r2
	mov	r6, r1
	mov	r8, r3
	str	r10, [sp, #8]
	str	r5, [sp, #12]
	bl	rq_data_dir
	ldr	r3, .L19
	add	r2, r5, r10, lsl #8
	ldr	r3, [r3]
	str	r2, [sp]
	cmp	r0, r3
	ldreq	fp, .L19+4
	ldrne	r3, .L19+8
	mov	r0, r6
	ldreq	r10, [fp]
	ldrne	fp, .L19+4
	ldrne	r10, [r3]
	bl	blk_rq_pos
	mov	r5, r0
	mov	r0, r6
	bl	blk_rq_sectors
	mov	r3, r0
	mov	r1, r6
	ldr	r2, [r4, #24]
	ldr	r0, [r8]
	str	r3, [sp, #4]
	bl	blk_rq_map_sg
	mov	r3, r10
	mov	r2, r0
	ldr	r1, [r4, #24]
	ldr	r0, [r7, #4]
	bl	dma_map_sg
	mov	r8, r0
	mov	r0, r9
	bl	prefetch
	mov	r3, #128
	mov	r2, #39
	ldr	r1, .L19+12
	ldr	r0, [fp]
	ldr	r1, [r1]
	ldr	fp, [r4, #16]
	str	r1, [r4, #20]
	str	r8, [r4]
	cmp	r0, r10
	stm	fp, {r2, r3}
	ldreq	r3, .L19+16
	ldrne	r3, .L19+20
	mov	r2, #32
	ldr	ip, [r3]
	mov	r3, #40
	mov	r1, #0
	mov	r0, #64
	asr	r3, r5, r3
	str	ip, [fp, #64]
	ldr	ip, [r6]
	and	r3, r3, #255
	str	r3, [fp, #28]
	asr	r3, ip, #5
	orr	r3, r3, ip, lsl #3
	asr	r2, r5, r2
	str	r3, [fp, #44]
	asr	r3, r5, #8
	and	r2, r2, #255
	and	r3, r3, #255
	str	r2, [fp, #24]
	str	r3, [fp, #12]
	ldr	r2, [sp, #4]
	asr	r3, r5, #16
	and	r3, r3, #255
	str	r3, [fp, #16]
	lsr	r3, r2, #8
	and	r3, r3, #255
	and	r2, r2, #255
	str	r3, [fp, #40]
	and	r3, r5, #255
	lsr	r5, r5, #24
	str	r3, [fp, #8]
	str	r2, [fp, #36]
	str	r0, [fp, #32]
	mov	r2, r8
	str	r1, [fp, #60]
	str	r1, [fp, #56]
	str	r1, [fp, #52]
	str	r1, [fp, #48]
	mov	r0, r7
	mov	r1, r4
	str	r5, [fp, #20]
	bl	fill_command_sg
	ldr	r0, [r4, #4]
	bl	unlikely
	cmp	r0, #0
	ldrne	r3, [fp, #32]
	ldr	r0, [r4, #8]
	orrne	r3, r3, #128
	strne	r3, [fp, #32]
	bl	cpu_to_le32
	ldr	r3, .L19+24
	ldr	r2, [sp]
	ldr	r1, [r7]
	str	r0, [r2, #12]
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	bne	.L17
.L7:
	ldr	r3, .L19+28
	ldr	r0, [r3]
	orr	r0, r0, r8, lsl #16
	orr	r0, r0, #5
	bl	cpu_to_le32
	mov	r2, #0
	ldr	r1, [sp]
	ldr	r3, .L19+32
	str	r0, [r1, #4]
	ldr	r3, [r3]
	ldr	r0, [r9]
	ldr	r1, [sp, #12]
	ldr	ip, [sp, #8]
	and	r0, r0, r3
	str	r2, [r1, ip, lsl #8]
	str	r10, [r4, #12]
	bl	unlikely
	cmp	r0, #0
	bne	.L18
	mov	r0, r9
	ldr	r1, [r6]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mtip_issue_ncq_command
.L18:
	ldr	r1, [r9, #4]
	ldr	r0, [r6]
	bl	set_bit
	mov	r1, r9
	ldr	r3, .L19+36
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	set_bit
.L17:
	ldr	r0, [r4, #8]
	asr	r0, r0, #31
	bl	cpu_to_le32
	ldr	r3, [sp]
	str	r0, [r3, #8]
	b	.L7
.L20:
	.align	2
.L19:
	.word	READ
	.word	DMA_FROM_DEVICE
	.word	DMA_TO_DEVICE
	.word	MTIP_MAX_RETRIES
	.word	ATA_CMD_FPDMA_READ
	.word	ATA_CMD_FPDMA_WRITE
	.word	MTIP_PF_HOST_CAP_64
	.word	AHCI_CMD_PREFETCH
	.word	MTIP_PF_PAUSE_IO
	.word	MTIP_PF_ISSUE_CMDS_BIT
	.size	mtip_hw_submit_io, .-mtip_hw_submit_io
	.comm	READ,4,4
	.comm	MTIP_PF_PAUSE_IO,4,4
	.comm	MTIP_PF_ISSUE_CMDS_BIT,4,4
	.comm	MTIP_PF_HOST_CAP_64,4,4
	.comm	MTIP_MAX_RETRIES,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.comm	ATA_CMD_FPDMA_WRITE,4,4
	.comm	ATA_CMD_FPDMA_READ,4,4
	.comm	AHCI_CMD_PREFETCH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
