	.file	"extr_ruc.c_hfi1_do_send.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	hfi1_do_send
	.type	hfi1_do_send, @function
hfi1_do_send:
.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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	mov	r14, QWORD PTR 32[rdi]
	mov	edi, DWORD PTR 20[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	call	to_idev@PLT
	mov	esi, DWORD PTR 24[rbp]
	mov	edi, DWORD PTR 20[rbp]
	lea	r15, 4[r14]
	mov	DWORD PTR 60[rsp], eax
	call	to_iport@PLT
	mov	edi, eax
	mov	DWORD PTR 56[rsp], eax
	call	ppd_from_ibp@PLT
	mov	rdi, r15
	mov	DWORD PTR [rsp], r12d
	mov	QWORD PTR 32[rsp], rax
	call	iowait_get_ib_work@PLT
	mov	esi, r12d
	mov	rdi, rbp
	mov	DWORD PTR 24[rsp], eax
	call	trace_hfi1_rc_do_send@PLT
	mov	eax, DWORD PTR 16[rbp]
	cmp	eax, 128
	je	.L2
	cmp	eax, 129
	jne	.L3
	mov	edx, DWORD PTR loopback[rip]
	test	edx, edx
	je	.L32
.L4:
	mov	eax, DWORD PTR 0[rbp]
	mov	r13, QWORD PTR hfi1_make_rc_req@GOTPCREL[rip]
	mov	DWORD PTR 4[rsp], eax
.L6:
	mov	esi, DWORD PTR 12[rsp]
	lea	r12, 8[rbp]
	mov	rdi, r12
	call	spin_lock_irqsave@PLT
	mov	rdi, rbp
	call	hfi1_send_ok@PLT
	test	eax, eax
	je	.L33
	mov	edx, DWORD PTR 4[rsp]
	mov	eax, DWORD PTR RVT_S_BUSY[rip]
	or	DWORD PTR 4[rbp], eax
	test	edx, edx
	lea	eax, 7[rdx]
	cmovns	eax, edx
	sar	eax, 3
	mov	DWORD PTR 4[rsp], eax
	cdqe
	add	rax, QWORD PTR jiffies[rip]
	mov	QWORD PTR 48[rsp], rax
	mov	rax, QWORD PTR 8[r14]
	test	rax, rax
	je	.L11
	mov	eax, DWORD PTR [rax]
.L12:
	mov	edi, DWORD PTR 24[rsp]
	mov	DWORD PTR 40[rsp], eax
	mov	rbx, rsp
	mov	DWORD PTR 8[rsp], 0
	call	get_waiting_verbs_txreq@PLT
	mov	QWORD PTR 16[rsp], rax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rax, QWORD PTR 16[rsp]
.L17:
	test	rax, rax
	je	.L13
	mov	eax, DWORD PTR [r14]
	test	DWORD PTR HFI1_S_TID_BUSY_SET[rip], eax
	je	.L14
	mov	eax, DWORD PTR RVT_S_BUSY[rip]
	or	DWORD PTR 4[rbp], eax
.L14:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, r12
	call	spin_unlock_irqrestore@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	hfi1_verbs_send@PLT
	test	rax, rax
	jne	.L1
	xor	edx, edx
	mov	rsi, rbx
	mov	rdi, rbp
	call	hfi1_schedule_send_yield@PLT
	test	rax, rax
	jne	.L1
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, r12
	call	spin_lock_irqsave@PLT
.L13:
	mov	rsi, rbx
	mov	rdi, rbp
	call	r13
	test	eax, eax
	jne	.L34
	mov	edi, DWORD PTR 8[rsp]
	mov	rsi, r15
	call	iowait_starve_clear@PLT
.L30:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, r12
	call	spin_unlock_irqrestore@PLT
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L35
	add	rsp, 88
	.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
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR loopback[rip]
	test	eax, eax
	je	.L36
.L7:
	mov	rax, QWORD PTR SEND_RESCHED_TIMEOUT[rip]
	mov	r13, QWORD PTR hfi1_make_uc_req@GOTPCREL[rip]
	mov	DWORD PTR 4[rsp], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR SEND_RESCHED_TIMEOUT[rip]
	mov	r13, QWORD PTR hfi1_make_ud_req@GOTPCREL[rip]
	mov	DWORD PTR 4[rsp], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L33:
	mov	eax, DWORD PTR 4[rbp]
	test	DWORD PTR HFI1_S_ANY_WAIT_IO[rip], eax
	je	.L30
	mov	esi, DWORD PTR IOWAIT_PENDING_IB[rip]
	mov	rdi, r15
	call	iowait_set_flag@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L32:
	lea	rdi, 12[rbp]
	call	rdma_ah_get_dlid@PLT
	mov	rdx, QWORD PTR 32[rsp]
	mov	r8d, eax
	mov	eax, -1
	mov	ecx, DWORD PTR [rdx]
	sal	eax, cl
	and	eax, r8d
	cmp	eax, DWORD PTR 4[rdx]
	jne	.L4
.L8:
	mov	rdi, rbp
	call	rvt_ruc_loopback@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR 32[rsp]
	mov	rax, QWORD PTR 8[rax]
	mov	edi, DWORD PTR [rax]
	call	cpumask_of_node@PLT
	mov	edi, eax
	call	cpumask_first@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L36:
	lea	rdi, 12[rbp]
	call	rdma_ah_get_dlid@PLT
	mov	rdx, QWORD PTR 32[rsp]
	mov	r8d, eax
	mov	eax, -1
	mov	ecx, DWORD PTR [rdx]
	sal	eax, cl
	and	eax, r8d
	cmp	eax, DWORD PTR 4[rdx]
	jne	.L7
	jmp	.L8
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hfi1_do_send, .-hfi1_do_send
	.comm	loopback,4,4
	.comm	jiffies,8,8
	.comm	SEND_RESCHED_TIMEOUT,8,8
	.comm	RVT_S_BUSY,4,4
	.comm	IOWAIT_PENDING_IB,4,4
	.comm	HFI1_S_TID_BUSY_SET,4,4
	.comm	HFI1_S_ANY_WAIT_IO,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_ruc.c_hfi1_do_send.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hfi1_do_send
	.syntax unified
	.arm
	.fpu softvfp
	.type	hfi1_do_send, %function
hfi1_do_send:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r3, .L37
	sub	sp, sp, #48
	ldr	r0, [r0, #20]
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	ldr	r7, [r4, #28]
	bl	to_idev
	mov	r3, r0
	ldr	r1, [r4, #24]
	ldr	r0, [r4, #20]
	str	r3, [sp, #40]
	bl	to_iport
	str	r0, [sp, #36]
	bl	ppd_from_ibp
	mov	r3, r0
	add	r10, r7, #4
	mov	r0, r10
	str	r3, [sp, #24]
	str	r5, [sp]
	bl	iowait_get_ib_work
	mov	r3, r0
	mov	r1, r5
	mov	r0, r4
	str	r3, [sp, #20]
	bl	trace_hfi1_rc_do_send
	ldr	r3, [r4, #16]
	cmp	r3, #128
	beq	.L2
	cmp	r3, #129
	bne	.L3
	ldr	r3, .L37+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L32
.L4:
	ldr	r3, [r4]
	ldr	r6, .L37+8
	str	r3, [sp, #4]
.L6:
	add	r5, r4, #8
	ldr	r1, [sp, #12]
	mov	r0, r5
	bl	spin_lock_irqsave
	mov	r0, r4
	bl	hfi1_send_ok
	cmp	r0, #0
	beq	.L33
	ldr	r3, [sp, #4]
	ldr	r2, .L37+12
	add	r1, r3, #7
	cmp	r3, #0
	movlt	r3, r1
	ldr	r9, .L37+16
	ldr	r1, [r2]
	ldr	r0, [r9]
	ldr	r2, [r4, #4]
	asr	r3, r3, #3
	orr	r2, r2, r0
	ldr	r0, [r7, #8]
	add	r1, r1, r3
	cmp	r0, #0
	str	r3, [sp, #4]
	str	r1, [sp, #32]
	str	r2, [r4, #4]
	beq	.L11
	ldr	r3, [r0]
.L12:
	mov	r2, #0
	ldr	r0, [sp, #20]
	str	r3, [sp, #28]
	str	r2, [sp, #8]
	bl	get_waiting_verbs_txreq
	ldr	r8, .L37+20
	str	r0, [sp, #16]
	b	.L17
.L34:
	ldr	r0, [sp, #16]
.L17:
	cmp	r0, #0
	beq	.L13
	ldr	r2, [r7]
	ldr	r3, [r8]
	ldr	r1, [sp, #12]
	tst	r2, r3
	ldrne	r3, [r4, #4]
	ldrne	r2, [r9]
	mov	r0, r5
	orrne	r3, r3, r2
	strne	r3, [r4, #4]
	bl	spin_unlock_irqrestore
	mov	r1, sp
	mov	r0, r4
	bl	hfi1_verbs_send
	subs	r2, r0, #0
	bne	.L1
	mov	r1, sp
	mov	r0, r4
	bl	hfi1_schedule_send_yield
	cmp	r0, #0
	bne	.L1
	mov	r0, r5
	ldr	r1, [sp, #12]
	bl	spin_lock_irqsave
.L13:
	mov	r1, sp
	mov	r0, r4
	blx	r6
	cmp	r0, #0
	bne	.L34
	mov	r1, r10
	ldr	r0, [sp, #8]
	bl	iowait_starve_clear
.L30:
	mov	r0, r5
	ldr	r1, [sp, #12]
	bl	spin_unlock_irqrestore
.L1:
	ldr	r3, .L37
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L35
	add	sp, sp, #48
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r3, .L37+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L36
.L7:
	ldr	r3, .L37+24
	ldr	r6, .L37+28
	ldr	r3, [r3]
	str	r3, [sp, #4]
	b	.L6
.L3:
	ldr	r3, .L37+24
	ldr	r6, .L37+32
	ldr	r3, [r3]
	str	r3, [sp, #4]
	b	.L6
.L33:
	ldr	r3, .L37+36
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L30
	ldr	r3, .L37+40
	mov	r0, r10
	ldr	r1, [r3]
	bl	iowait_set_flag
	b	.L30
.L32:
	add	r0, r4, #12
	bl	rdma_ah_get_dlid
	mvn	ip, #0
	ldr	r3, [sp, #24]
	ldm	r3, {r1, r2}
	and	r3, r0, ip, lsl r1
	cmp	r3, r2
	bne	.L4
.L8:
	mov	r0, r4
	bl	rvt_ruc_loopback
	b	.L1
.L11:
	ldr	r3, [sp, #24]
	ldr	r3, [r3, #8]
	ldr	r0, [r3]
	bl	cpumask_of_node
	bl	cpumask_first
	mov	r3, r0
	b	.L12
.L36:
	add	r0, r4, #12
	bl	rdma_ah_get_dlid
	mvn	ip, #0
	ldr	r3, [sp, #24]
	ldm	r3, {r1, r2}
	and	r3, r0, ip, lsl r1
	cmp	r3, r2
	bne	.L7
	b	.L8
.L35:
	bl	__stack_chk_fail
.L38:
	.align	2
.L37:
	.word	.LC0
	.word	loopback
	.word	hfi1_make_rc_req
	.word	jiffies
	.word	RVT_S_BUSY
	.word	HFI1_S_TID_BUSY_SET
	.word	SEND_RESCHED_TIMEOUT
	.word	hfi1_make_uc_req
	.word	hfi1_make_ud_req
	.word	HFI1_S_ANY_WAIT_IO
	.word	IOWAIT_PENDING_IB
	.size	hfi1_do_send, .-hfi1_do_send
	.comm	loopback,4,4
	.comm	jiffies,4,4
	.comm	SEND_RESCHED_TIMEOUT,4,4
	.comm	RVT_S_BUSY,4,4
	.comm	IOWAIT_PENDING_IB,4,4
	.comm	HFI1_S_TID_BUSY_SET,4,4
	.comm	HFI1_S_ANY_WAIT_IO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
