	.file	"extr_qib_verbs.c_qib_verbs_send_dma.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	qib_verbs_send_dma, @function
qib_verbs_send_dma:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	edi, DWORD PTR 36[rdi]
	mov	rax, QWORD PTR 128[rsp]
	mov	QWORD PTR 32[rsp], rdx
	mov	QWORD PTR 16[rsp], rcx
	mov	QWORD PTR 24[rsp], r8
	mov	QWORD PTR [rsp], r9
	mov	QWORD PTR 8[rsp], rsi
	mov	QWORD PTR 40[rsp], rax
	call	to_idev@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	dd_from_dev@PLT
	mov	esi, DWORD PTR 32[r15]
	mov	edi, DWORD PTR 36[r15]
	mov	r13, rax
	call	to_iport@PLT
	mov	rdi, rax
	mov	rbx, rax
	call	ppd_from_ibp@PLT
	mov	r12, rax
	mov	rax, QWORD PTR 24[r15]
	test	rax, rax
	je	.L2
	mov	QWORD PTR 24[r15], 0
	mov	rsi, QWORD PTR 80[rax]
	mov	rcx, rax
	mov	rdx, QWORD PTR [rax]
.L28:
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r12
	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	qib_sdma_verbs_send@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	mov	rsi, r15
	call	get_txreq@PLT
	mov	rdi, rax
	mov	r14, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L30
	mov	rax, QWORD PTR 8[rsp]
	mov	r8, QWORD PTR 0[r13]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR 48[rsp], r8
	mov	edi, DWORD PTR [rax]
	call	be16_to_cpu@PLT
	mov	edx, DWORD PTR 16[r15]
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r12
	sar	eax, 12
	mov	r8, QWORD PTR 48[rsp]
	mov	ecx, eax
	call	r8
	mov	QWORD PTR 72[r14], r15
	lea	rdi, 12[r15]
	mov	QWORD PTR 48[rsp], rax
	call	atomic_inc@PLT
	mov	eax, DWORD PTR 8[r15]
	mov	DWORD PTR 64[r14], eax
	mov	rax, QWORD PTR [r15]
	mov	QWORD PTR 56[r14], rax
	test	rax, rax
	je	.L4
	mov	QWORD PTR [r15], 0
.L4:
	mov	eax, DWORD PTR sdma_complete[rip]
	mov	rcx, QWORD PTR [rsp]
	mov	DWORD PTR 40[r14], eax
	mov	eax, DWORD PTR 8[r13]
	test	DWORD PTR QIB_HAS_SDMA_TIMEOUT[rip], eax
	mov	eax, DWORD PTR QIB_SDMA_TXREQ_F_HEADTOHOST[rip]
	cmove	eax, DWORD PTR QIB_SDMA_TXREQ_F_INTREQ[rip]
	mov	DWORD PTR 28[r14], eax
	cmp	QWORD PTR 16[r13], rcx
	jg	.L7
	or	eax, DWORD PTR QIB_SDMA_TXREQ_F_USELARGEBUF[rip]
	mov	DWORD PTR 28[r14], eax
.L7:
	mov	rsi, QWORD PTR 24[rsp]
	test	rsi, rsi
	je	.L14
	mov	rdi, QWORD PTR 16[rsp]
	call	qib_count_sge@PLT
	cmp	QWORD PTR [r12], rax
	jle	.L9
	test	rax, rax
	jne	.L31
.L9:
	mov	eax, DWORD PTR [rsp]
	mov	esi, DWORD PTR GFP_ATOMIC[rip]
	lea	edi, 1[rax]
	mov	DWORD PTR 16[r14], edi
	sal	edi, 2
	call	kmalloc@PLT
	test	rax, rax
	je	.L10
	mov	rdx, QWORD PTR 8[rax]
	mov	rdi, QWORD PTR [rsp]
	mov	QWORD PTR 56[rsp], rax
	mov	QWORD PTR 40[rsp], rdx
	call	cpu_to_le32@PLT
	mov	rdx, QWORD PTR 40[rsp]
	mov	r9, QWORD PTR 56[rsp]
	mov	rdi, QWORD PTR 48[rsp]
	mov	QWORD PTR [rdx], rax
	mov	rdx, QWORD PTR 8[r9]
	mov	QWORD PTR 40[rsp], r9
	mov	QWORD PTR [rsp], rdx
	call	cpu_to_le32@PLT
	mov	rdx, QWORD PTR [rsp]
	mov	r9, QWORD PTR 40[rsp]
	mov	rsi, QWORD PTR 8[rsp]
	mov	QWORD PTR 8[rdx], rax
	mov	rax, QWORD PTR 32[rsp]
	mov	rdi, r9
	mov	QWORD PTR [rsp], r9
	lea	rdx, 0[0+rax*4]
	call	memcpy@PLT
	mov	r9, QWORD PTR [rsp]
	mov	rax, QWORD PTR 32[rsp]
	mov	rdx, QWORD PTR 24[rsp]
	mov	rsi, QWORD PTR 16[rsp]
	lea	rdi, [r9+rax*8]
	call	qib_copy_from_sge@PLT
	mov	r9, QWORD PTR [rsp]
	mov	eax, DWORD PTR 16[r14]
	mov	rdi, QWORD PTR 24[r13]
	mov	ecx, DWORD PTR DMA_TO_DEVICE[rip]
	mov	rsi, r9
	lea	edx, 0[0+rax*4]
	call	dma_map_single@PLT
	mov	rdi, QWORD PTR 24[r13]
	mov	QWORD PTR 32[r14], rax
	mov	rsi, rax
	call	dma_mapping_error@PLT
	mov	r9, QWORD PTR [rsp]
	test	rax, rax
	je	.L11
	mov	rdi, r9
	call	kfree@PLT
.L10:
	mov	rdi, r14
	call	qib_put_txreq@PLT
	mov	rsi, r15
	mov	rdi, rbp
	call	wait_kmem@PLT
.L12:
.L13:
	endbr64
	add	DWORD PTR [rbx], 1
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	ebx, 1
.L8:
	mov	r13, QWORD PTR 8[r14]
	mov	rdi, QWORD PTR [rsp]
	sal	r13, 4
	add	r13, QWORD PTR 8[rbp]
	mov	r15, QWORD PTR 8[r13]
	call	cpu_to_le32@PLT
	mov	rdi, QWORD PTR 48[rsp]
	mov	QWORD PTR [r15], rax
	mov	r15, QWORD PTR 8[r13]
	call	cpu_to_le32@PLT
	mov	rsi, QWORD PTR 8[rsp]
	mov	rdi, r13
	mov	QWORD PTR 8[r15], rax
	mov	r15, QWORD PTR 32[rsp]
	lea	rdx, 0[0+r15*4]
	call	memcpy@PLT
	lea	edx, 2[r15]
	mov	DWORD PTR 24[r14], ebx
	mov	rcx, r14
	mov	eax, DWORD PTR QIB_SDMA_TXREQ_F_FREEDESC[rip]
	or	DWORD PTR 28[r14], eax
	mov	rax, QWORD PTR 8[r14]
	mov	rsi, QWORD PTR 16[rsp]
	sal	rax, 4
	add	rax, QWORD PTR 0[rbp]
	mov	DWORD PTR 16[r14], edx
	mov	QWORD PTR 32[r14], rax
	mov	rdx, QWORD PTR 40[rsp]
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L30:
	add	rsp, 72
	.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	PTR_ERR@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	eax, DWORD PTR QIB_SDMA_TXREQ_F_FREEBUF[rip]
	or	DWORD PTR 28[r14], eax
	mov	rcx, r14
	xor	edx, edx
	mov	QWORD PTR 48[r14], r9
	xor	esi, esi
	mov	rdi, r12
	mov	DWORD PTR 24[r14], 1
	call	qib_sdma_verbs_send@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	mov	ebx, eax
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	qib_verbs_send_dma, .-qib_verbs_send_dma
	.comm	sdma_complete,4,4
	.comm	QIB_SDMA_TXREQ_F_USELARGEBUF,4,4
	.comm	QIB_SDMA_TXREQ_F_INTREQ,4,4
	.comm	QIB_SDMA_TXREQ_F_HEADTOHOST,4,4
	.comm	QIB_SDMA_TXREQ_F_FREEDESC,4,4
	.comm	QIB_SDMA_TXREQ_F_FREEBUF,4,4
	.comm	QIB_HAS_SDMA_TIMEOUT,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	DMA_TO_DEVICE,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_qib_verbs.c_qib_verbs_send_dma.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qib_verbs_send_dma, %function
qib_verbs_send_dma:
	@ args = 12, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #36
	str	r3, [sp, #4]
	ldr	r3, [sp, #72]
	mov	r4, r0
	str	r3, [sp, #8]
	ldr	r3, [sp, #80]
	ldr	r0, [r0, #24]
	str	r3, [sp, #20]
	str	r2, [sp, #12]
	mov	r9, r1
	ldr	r10, [sp, #76]
	bl	to_idev
	mov	r7, r0
	bl	dd_from_dev
	ldr	r1, [r4, #20]
	mov	r6, r0
	ldr	r0, [r4, #24]
	bl	to_iport
	str	r0, [sp, #16]
	bl	ppd_from_ibp
	ldr	r3, [r4, #16]
	cmp	r3, #0
	beq	.L2
	mov	r2, #0
	ldr	r1, [r3, #44]
	str	r2, [r4, #16]
	ldr	r2, [r3]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	qib_sdma_verbs_send
.L2:
	mov	r1, r4
	mov	r8, r0
	mov	r0, r7
	bl	get_txreq
	mov	r5, r0
	bl	IS_ERR
	subs	fp, r0, #0
	bne	.L24
	ldr	r2, [r6]
	ldr	r3, [r9]
	str	r2, [sp, #24]
	ldr	r2, [r4, #12]
	ldr	r0, [r3]
	str	r2, [sp, #28]
	bl	be16_to_cpu
	mov	r1, r10
	ldr	r2, [sp, #28]
	asr	r3, r0, #12
	ldr	ip, [sp, #24]
	mov	r0, r8
	blx	ip
	mov	r3, r0
	str	r4, [r5, #40]
	add	r0, r4, #8
	str	r3, [sp, #24]
	bl	atomic_inc
	ldr	r2, [r4, #4]
	ldr	r3, [r4]
	str	r2, [r5, #36]
	ldr	r2, .L25
	ldr	r1, [r6, #4]
	cmp	r3, #0
	ldr	r2, [r2]
	str	r3, [r5, #32]
	ldr	r3, .L25+4
	strne	fp, [r4]
	ldr	r3, [r3]
	tst	r1, r2
	ldr	r2, [r6, #8]
	str	r3, [r5, #24]
	ldrne	r3, .L25+8
	ldreq	r3, .L25+12
	cmp	r2, r10
	ldrle	r2, .L25+16
	ldr	r3, [r3]
	ldrle	r2, [r2]
	ldr	r1, [sp, #8]
	str	r3, [r5, #16]
	orrle	r3, r2, r3
	strle	r3, [r5, #16]
	cmp	r1, #0
	beq	.L14
	ldr	r0, [sp, #4]
	bl	qib_count_sge
	ldr	r3, [r8]
	mov	fp, r0
	cmp	r0, #0
	cmpne	r3, r0
	bgt	.L8
	ldr	r3, .L25+20
	add	r0, r10, #1
	str	r0, [r5, #8]
	ldr	r1, [r3]
	lsl	r0, r0, #2
	bl	kmalloc
	subs	fp, r0, #0
	beq	.L10
	mov	r0, r10
	ldr	r10, [fp, #4]
	bl	cpu_to_le32
	mov	r3, r0
	str	r3, [r10]
	ldr	r3, [fp, #4]
	ldr	r0, [sp, #24]
	str	r3, [sp, #20]
	bl	cpu_to_le32
	ldr	r3, [sp, #12]
	mov	r1, r9
	lsl	r10, r3, #2
	ldr	r3, [sp, #20]
	mov	r2, r10
	str	r0, [r3, #4]
	mov	r0, fp
	bl	memcpy
	ldmib	sp, {r1, r2}
	add	r0, fp, r10
	bl	qib_copy_from_sge
	ldr	r2, [r5, #8]
	ldr	r3, .L25+24
	lsl	r2, r2, #2
	mov	r1, fp
	ldr	r3, [r3]
	ldr	r0, [r6, #12]
	bl	dma_map_single
	mov	r1, r0
	ldr	r0, [r6, #12]
	str	r1, [r5, #20]
	bl	dma_mapping_error
	subs	r2, r0, #0
	beq	.L11
	mov	r0, fp
	bl	kfree
.L10:
	mov	r0, r5
	bl	qib_put_txreq
	mov	r1, r4
	mov	r0, r7
	bl	wait_kmem
.L12:
.L13:
	ldr	r2, [sp, #16]
	ldr	r3, [r2]
	add	r3, r3, #1
	str	r3, [r2]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	mov	fp, #1
.L8:
	ldr	r3, [r5, #4]
	ldr	r4, [r7, #4]
	mov	r0, r10
	add	r4, r4, r3, lsl #3
	ldr	r6, [r4, #4]
	bl	cpu_to_le32
	mov	r3, r0
	ldr	r0, [sp, #24]
	str	r3, [r6]
	ldr	r6, [r4, #4]
	bl	cpu_to_le32
	str	r0, [r6, #4]
	mov	r0, r4
	ldr	r4, [sp, #12]
	mov	r1, r9
	lsl	r2, r4, #2
	bl	memcpy
	ldr	r3, .L25+28
	ldr	ip, [r7]
	ldr	r1, [r3]
	ldr	r3, [r5, #16]
	ldr	r0, [r5, #4]
	orr	r3, r3, r1
	add	ip, ip, r0, lsl #3
	str	r3, [r5, #16]
	mov	r0, r8
	mov	r3, r5
	add	r2, r4, #2
	str	r2, [r5, #8]
	ldr	r1, [sp, #4]
	ldr	r2, [sp, #20]
	str	fp, [r5, #12]
	str	ip, [r5, #20]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	qib_sdma_verbs_send
.L24:
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	PTR_ERR
.L11:
	mov	r1, #1
	ldr	r3, .L25+32
	str	r1, [r5, #12]
	ldr	ip, [r3]
	ldr	r3, [r5, #16]
	mov	r0, r8
	orr	r3, r3, ip
	str	r3, [r5, #16]
	mov	r1, r2
	mov	r3, r5
	str	fp, [r5, #28]
	bl	qib_sdma_verbs_send
	b	.L12
.L26:
	.align	2
.L25:
	.word	QIB_HAS_SDMA_TIMEOUT
	.word	sdma_complete
	.word	QIB_SDMA_TXREQ_F_HEADTOHOST
	.word	QIB_SDMA_TXREQ_F_INTREQ
	.word	QIB_SDMA_TXREQ_F_USELARGEBUF
	.word	GFP_ATOMIC
	.word	DMA_TO_DEVICE
	.word	QIB_SDMA_TXREQ_F_FREEDESC
	.word	QIB_SDMA_TXREQ_F_FREEBUF
	.size	qib_verbs_send_dma, .-qib_verbs_send_dma
	.comm	sdma_complete,4,4
	.comm	QIB_SDMA_TXREQ_F_USELARGEBUF,4,4
	.comm	QIB_SDMA_TXREQ_F_INTREQ,4,4
	.comm	QIB_SDMA_TXREQ_F_HEADTOHOST,4,4
	.comm	QIB_SDMA_TXREQ_F_FREEDESC,4,4
	.comm	QIB_SDMA_TXREQ_F_FREEBUF,4,4
	.comm	QIB_HAS_SDMA_TIMEOUT,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	DMA_TO_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
