	.file	"extr_scif_api.c__scif_send.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	_scif_send, @function
_scif_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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r14, QWORD PTR 32[rdi]
	mov	QWORD PTR [rsp], rsi
	mov	DWORD PTR 12[rsp], ecx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	test	DWORD PTR SCIF_SEND_BLOCK[rip], ecx
	jne	.L26
.L2:
	lea	r15, 8[rbx]
	mov	rdi, r15
	call	spin_lock@PLT
	test	ebp, ebp
	je	.L4
	xor	r12d, r12d
.L3:
	mov	rax, QWORD PTR [rbx]
	cmp	rax, QWORD PTR SCIFEP_CONNECTED[rip]
	jne	.L27
	mov	rdi, r14
	call	scif_rb_space@PLT
	mov	edi, ebp
	mov	esi, eax
	sub	edi, r12d
	test	eax, eax
	je	.L5
	call	min@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	rdi, r14
	movsx	r13, eax
	mov	edx, r13d
	call	scif_rb_write@PLT
	mov	edx, eax
	test	eax, eax
	js	.L6
	mov	rdi, r14
	call	scif_rb_commit@PLT
	mov	eax, DWORD PTR 24[rbx]
	mov	edx, DWORD PTR 20[rbx]
	lea	rsi, 16[rsp]
	mov	DWORD PTR 28[rsp], eax
	mov	eax, DWORD PTR SCIF_CLIENT_SENT[rip]
	mov	DWORD PTR 24[rsp], eax
	mov	rax, QWORD PTR 16[rsp]
	mov	DWORD PTR [rax], edx
	mov	edi, DWORD PTR 16[rbx]
	call	_scif_nodeqp_send@PLT
	mov	edx, eax
	test	eax, eax
	je	.L28
.L6:
	test	r12d, r12d
	cmove	r12d, edx
.L10:
	mov	rdi, r15
	call	spin_unlock@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L29
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L5:
	.cfi_restore_state
	mov	eax, DWORD PTR SCIF_ENDPT_QP_SIZE[rip]
	lea	esi, -1[rax]
	call	min@PLT
	mov	r13d, eax
	mov	eax, DWORD PTR 12[rsp]
	test	DWORD PTR SCIF_SEND_BLOCK[rip], eax
	je	.L8
	mov	rdi, r15
	call	spin_unlock@PLT
	mov	rax, QWORD PTR SCIFEP_CONNECTED[rip]
	mov	esi, 1
	cmp	QWORD PTR [rbx], rax
	je	.L30
.L9:
	mov	edi, DWORD PTR 12[rbx]
	call	wait_event_interruptible@PLT
	mov	rdi, r15
	mov	DWORD PTR 8[rsp], eax
	call	spin_lock@PLT
	mov	edx, DWORD PTR 8[rsp]
	test	edx, edx
	jne	.L6
.L7:
	cmp	ebp, r12d
	jne	.L3
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L28:
	add	QWORD PTR [rsp], r13
	add	r12d, r13d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	call	might_sleep@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L30:
	mov	rdi, r14
	call	scif_rb_space@PLT
	xor	esi, esi
	cmp	eax, r13d
	setge	sil
	jmp	.L9
.L8:
	test	r12d, r12d
	jne	.L10
.L4:
	mov	rax, QWORD PTR [rbx]
	xor	r12d, r12d
	cmp	rax, QWORD PTR SCIFEP_CONNECTED[rip]
	je	.L10
.L14:
	mov	r12d, DWORD PTR ENOTCONN[rip]
	neg	r12d
	cmp	QWORD PTR SCIFEP_DISCONNECTED[rip], rax
	jne	.L10
	mov	r12d, DWORD PTR ECONNRESET[rip]
	neg	r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L27:
	test	r12d, r12d
	je	.L14
	jmp	.L10
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	_scif_send, .-_scif_send
	.comm	SCIF_SEND_BLOCK,4,4
	.comm	SCIF_ENDPT_QP_SIZE,4,4
	.comm	SCIF_CLIENT_SENT,4,4
	.comm	SCIFEP_DISCONNECTED,8,8
	.comm	SCIFEP_CONNECTED,8,8
	.comm	ENOTCONN,4,4
	.comm	ECONNRESET,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_scif_api.c__scif_send.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_scif_send, %function
_scif_send:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r3
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	fp, .L31
	sub	sp, sp, #36
	str	r3, [sp, #12]
	ldr	r3, [fp]
	str	r1, [sp, #4]
	tst	ip, r3
	ldr	r3, .L31+4
	mov	r4, r0
	mov	r6, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	ldr	r7, [r0, #24]
	bne	.L26
.L2:
	add	r9, r4, #4
	mov	r0, r9
	bl	spin_lock
	cmp	r6, #0
	ldreq	r10, .L31+8
	beq	.L4
	mov	r5, #0
	ldr	r10, .L31+8
.L3:
	ldr	r3, [r4]
	ldr	r2, [r10]
	cmp	r3, r2
	bne	.L27
	mov	r0, r7
	bl	scif_rb_space
	subs	r1, r0, #0
	sub	r0, r6, r5
	beq	.L5
	bl	min
	ldr	r1, [sp, #4]
	mov	r2, r0
	mov	r8, r0
	mov	r0, r7
	bl	scif_rb_write
	subs	r3, r0, #0
	blt	.L6
	mov	r0, r7
	bl	scif_rb_commit
	ldr	r3, [r4, #20]
	ldr	r2, .L31+12
	str	r3, [sp, #24]
	ldr	r1, [r2]
	ldr	r3, [sp, #16]
	ldr	r2, [r4, #16]
	str	r1, [sp, #20]
	str	r2, [r3]
	ldr	r0, [r4, #12]
	add	r1, sp, #16
	bl	_scif_nodeqp_send
	subs	r3, r0, #0
	beq	.L28
.L6:
	cmp	r5, #0
	moveq	r5, r3
.L10:
	mov	r0, r9
	bl	spin_unlock
	ldr	r3, .L31+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r3, .L31+16
	ldr	r1, [r3]
	sub	r1, r1, #1
	bl	min
	ldr	r3, [fp]
	ldr	r2, [sp, #12]
	mov	r8, r0
	tst	r2, r3
	beq	.L8
	mov	r0, r9
	bl	spin_unlock
	ldr	r1, [r4]
	ldr	r2, [r10]
	ldr	r3, [r4, #8]
	cmp	r1, r2
	movne	r1, #1
	beq	.L30
.L9:
	mov	r0, r3
	bl	wait_event_interruptible
	str	r0, [sp, #8]
	mov	r0, r9
	bl	spin_lock
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L6
.L7:
	cmp	r6, r5
	bne	.L3
	b	.L10
.L28:
	ldr	r3, [sp, #4]
	add	r5, r5, r8
	add	r3, r3, r8
	str	r3, [sp, #4]
	b	.L7
.L26:
	bl	might_sleep
	b	.L2
.L30:
	mov	r0, r7
	str	r3, [sp, #8]
	bl	scif_rb_space
	cmp	r0, r8
	movlt	r1, #0
	movge	r1, #1
	ldr	r3, [sp, #8]
	b	.L9
.L8:
	cmp	r5, #0
	bne	.L10
.L4:
	ldr	r3, [r4]
	ldr	r2, [r10]
	cmp	r3, r2
	moveq	r5, #0
	beq	.L10
.L14:
	ldr	r2, .L31+20
	ldr	r2, [r2]
	cmp	r2, r3
	ldreq	r3, .L31+24
	ldrne	r3, .L31+28
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L10
.L27:
	cmp	r5, #0
	beq	.L14
	b	.L10
.L29:
	bl	__stack_chk_fail
.L32:
	.align	2
.L31:
	.word	SCIF_SEND_BLOCK
	.word	.LC0
	.word	SCIFEP_CONNECTED
	.word	SCIF_CLIENT_SENT
	.word	SCIF_ENDPT_QP_SIZE
	.word	SCIFEP_DISCONNECTED
	.word	ECONNRESET
	.word	ENOTCONN
	.size	_scif_send, .-_scif_send
	.comm	SCIF_SEND_BLOCK,4,4
	.comm	SCIF_ENDPT_QP_SIZE,4,4
	.comm	SCIF_CLIENT_SENT,4,4
	.comm	SCIFEP_DISCONNECTED,4,4
	.comm	SCIFEP_CONNECTED,4,4
	.comm	ENOTCONN,4,4
	.comm	ECONNRESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
