	.file	"extr_cm.c_cm_dreq_handler.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cm_dreq_handler, @function
cm_dreq_handler:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR 16[rdi]
	mov	QWORD PTR [rsp], 0
	mov	rbx, QWORD PTR [rax]
	mov	esi, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR 12[rbx]
	call	cm_acquire_id@PLT
	test	rax, rax
	je	.L21
	mov	rbp, rax
	lea	rax, 4[rbx]
	mov	QWORD PTR 24[r14], rax
	lea	r13, 8[rbp]
	mov	rdi, r13
	call	spin_lock_irq@PLT
	mov	r12, QWORD PTR 0[rbp]
	mov	rdi, rbx
	call	cm_dreq_get_remote_qpn@PLT
	cmp	r12, rax
	je	.L22
.L5:
	mov	rdi, r13
	call	spin_unlock_irq@PLT
.L13:
	mov	rdi, rbp
	call	cm_deref_id@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	eax, DWORD PTR 24[rbp]
	add	eax, -128
	cmp	eax, 5
	ja	.L5
	lea	rdx, .L7[rip]
	movsx	rax, DWORD PTR [rdx+rax*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L7:
	.long	.L11-.L7
	.long	.L12-.L7
	.long	.L10-.L7
	.long	.L9-.L7
	.long	.L12-.L7
	.long	.L6-.L7
	.text
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR 28[rbp]
	cmp	eax, DWORD PTR IB_CM_LAP_SENT[rip]
	je	.L12
	cmp	eax, DWORD PTR IB_CM_MRA_LAP_RCVD[rip]
	jne	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rax, QWORD PTR 48[rbp]
	mov	esi, DWORD PTR 40[rbp]
	mov	edi, DWORD PTR [rax]
	call	ib_cancel_mad@PLT
.L10:
	mov	eax, DWORD PTR [rbx]
	mov	DWORD PTR 24[rbp], 133
	lea	rdi, 16[rbp]
	mov	DWORD PTR 20[rbp], eax
	call	atomic_inc_and_test@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L24
	mov	rdi, r13
	xor	r12d, r12d
	call	spin_unlock_irq@PLT
	mov	rsi, r14
	mov	rdi, rbp
	call	cm_process_work@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR 8[r14]
	mov	rdx, QWORD PTR CM_RECV_DUPLICATES[rip]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	rdx, QWORD PTR CM_DREQ_COUNTER[rip]
	lea	rdi, [rax+rdx*4]
	call	atomic_long_inc@PLT
	mov	rsi, QWORD PTR 16[r14]
	mov	rdi, QWORD PTR 8[r14]
	mov	rdx, rsp
	call	cm_alloc_response_msg@PLT
	test	eax, eax
	jne	.L5
	mov	rax, QWORD PTR [rsp]
	mov	ecx, DWORD PTR 32[rbp]
	mov	rsi, rbp
	mov	edx, DWORD PTR 36[rbp]
	mov	rdi, QWORD PTR [rax]
	call	cm_format_drep@PLT
	mov	rdi, r13
	call	spin_unlock_irq@PLT
	mov	rdi, QWORD PTR [rsp]
	xor	esi, esi
	call	ib_post_send_mad@PLT
	test	eax, eax
	je	.L13
	mov	rdi, QWORD PTR [rsp]
	call	cm_free_msg@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR 8[r14]
	mov	rdx, QWORD PTR CM_RECV_DUPLICATES[rip]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	rdx, QWORD PTR CM_DREQ_COUNTER[rip]
	lea	rdi, [rax+rdx*4]
	call	atomic_long_inc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L24:
	lea	rsi, 12[rbp]
	mov	rdi, r14
	call	list_add_tail@PLT
	mov	rdi, r13
	call	spin_unlock_irq@PLT
	mov	rdi, rbp
	call	cm_deref_id@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rax, QWORD PTR 8[r14]
	mov	rdx, QWORD PTR CM_RECV_DUPLICATES[rip]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax+rdx*8]
	mov	rdx, QWORD PTR CM_DREQ_COUNTER[rip]
	lea	rdi, [rax+rdx*4]
	call	atomic_long_inc@PLT
	mov	rsi, QWORD PTR 16[r14]
	mov	rdi, QWORD PTR 8[r14]
	call	cm_issue_drep@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	cm_dreq_handler, .-cm_dreq_handler
	.comm	IB_CM_MRA_LAP_RCVD,4,4
	.comm	IB_CM_LAP_SENT,4,4
	.comm	EINVAL,4,4
	.comm	CM_RECV_DUPLICATES,8,8
	.comm	CM_DREQ_COUNTER,8,8
	.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_cm.c_cm_dreq_handler.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cm_dreq_handler, %function
cm_dreq_handler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r2, [r0, #8]
	ldr	r1, .L25
	ldr	r5, [r2]
	sub	sp, sp, #8
	ldr	r1, [r1]
	str	r1, [sp, #4]
	mov	r1,#0
	mov	r6, r0
	ldr	r1, [r5, #8]
	ldr	r0, [r5, #12]
	str	r3, [sp]
	bl	cm_acquire_id
	subs	r4, r0, #0
	beq	.L21
	add	r3, r5, #4
	add	r7, r4, #4
	str	r3, [r6, #12]
	mov	r0, r7
	bl	spin_lock_irq
	mov	r0, r5
	ldr	r8, [r4]
	bl	cm_dreq_get_remote_qpn
	cmp	r8, r0
	beq	.L22
.L5:
	mov	r0, r7
	bl	spin_unlock_irq
.L13:
	mov	r0, r4
	bl	cm_deref_id
	ldr	r3, .L25+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	ldr	r3, .L25
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	ldr	r3, [r4, #20]
	sub	r3, r3, #128
	cmp	r3, #5
	ldrls	pc, [pc, r3, asl #2]
	b	.L5
.L7:
	.word	.L11
	.word	.L12
	.word	.L10
	.word	.L9
	.word	.L12
	.word	.L6
.L9:
	ldr	r2, .L25+8
	ldr	r3, [r4, #24]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L12
	ldr	r2, .L25+12
	ldr	r2, [r2]
	cmp	r3, r2
	bne	.L10
.L12:
	ldr	r3, [r4, #40]
	ldr	r1, [r4, #36]
	ldr	r0, [r3]
	bl	ib_cancel_mad
.L10:
	mov	r2, #133
	ldr	r3, [r5]
	add	r0, r4, #12
	str	r2, [r4, #20]
	str	r3, [r4, #16]
	bl	atomic_inc_and_test
	subs	r5, r0, #0
	beq	.L24
	mov	r0, r7
	bl	spin_unlock_irq
	mov	r1, r6
	mov	r0, r4
	bl	cm_process_work
	mov	r5, #0
	b	.L1
.L6:
	ldr	r3, [r6, #4]
	ldr	r2, .L25+16
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, .L25+20
	ldr	r3, [r3, r1, lsl #2]
	ldr	r0, [r2]
	add	r0, r3, r0, lsl #2
	bl	atomic_long_inc
	b	.L5
.L11:
	ldr	r3, [r6, #4]
	ldr	r2, .L25+16
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, .L25+20
	ldr	r3, [r3, r1, lsl #2]
	ldr	r0, [r2]
	add	r0, r3, r0, lsl #2
	bl	atomic_long_inc
	ldmib	r6, {r0, r1}
	mov	r2, sp
	bl	cm_alloc_response_msg
	subs	r5, r0, #0
	bne	.L5
	ldr	r2, [sp]
	mov	r1, r4
	ldr	r3, [r4, #28]
	ldr	r0, [r2]
	ldr	r2, [r4, #32]
	bl	cm_format_drep
	mov	r0, r7
	bl	spin_unlock_irq
	mov	r1, r5
	ldr	r0, [sp]
	bl	ib_post_send_mad
	cmp	r0, #0
	beq	.L13
	ldr	r0, [sp]
	bl	cm_free_msg
	b	.L13
.L24:
	add	r1, r4, #8
	mov	r0, r6
	bl	list_add_tail
	mov	r0, r7
	bl	spin_unlock_irq
	mov	r0, r4
	bl	cm_deref_id
	b	.L1
.L21:
	ldr	r3, [r6, #4]
	ldr	r2, .L25+16
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r2, .L25+20
	ldr	r3, [r3, r1, lsl #2]
	ldr	r0, [r2]
	add	r0, r3, r0, lsl #2
	bl	atomic_long_inc
	ldmib	r6, {r0, r1}
	bl	cm_issue_drep
	ldr	r3, .L25+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L23:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	.LC0
	.word	EINVAL
	.word	IB_CM_LAP_SENT
	.word	IB_CM_MRA_LAP_RCVD
	.word	CM_RECV_DUPLICATES
	.word	CM_DREQ_COUNTER
	.size	cm_dreq_handler, .-cm_dreq_handler
	.comm	IB_CM_MRA_LAP_RCVD,4,4
	.comm	IB_CM_LAP_SENT,4,4
	.comm	EINVAL,4,4
	.comm	CM_RECV_DUPLICATES,4,4
	.comm	CM_DREQ_COUNTER,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
