	.file	"extr_shm_mq.c_shm_mq_send_bytes.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	shm_mq_send_bytes, @function
shm_mq_send_bytes:
.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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r13, QWORD PTR 8[rdi]
	mov	QWORD PTR 16[rsp], rdi
	mov	QWORD PTR 32[rsp], rdx
	mov	r14, QWORD PTR 0[r13]
	mov	DWORD PTR 28[rsp], ecx
	mov	QWORD PTR 40[rsp], r8
	test	rsi, rsi
	jle	.L14
	lea	rax, 44[r13]
	mov	r15, rsi
	xor	r12d, r12d
	mov	QWORD PTR [rsp], rax
	lea	rax, 40[r13]
	mov	QWORD PTR 8[rsp], rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, rbx
	mov	rsi, r14
	mov	rdi, rbp
	cqo
	idiv	r14
	sub	rsi, rdx
	mov	rbx, rdx
	call	Min@PLT
	mov	rbp, rax
	xor	eax, eax
	call	pg_memory_barrier@PLT
	mov	rax, QWORD PTR 32[rsp]
	add	rbx, QWORD PTR 16[r13]
	mov	rdx, rbp
	lea	rsi, [rax+r12]
	mov	rax, QWORD PTR 24[r13]
	add	r12, rbp
	lea	rdi, [rax+rbx*4]
	call	memcpy@PLT
	mov	edi, 1
	cmp	r15, r12
	je	.L12
	mov	rdi, rbp
	call	MAXALIGN@PLT
	xor	edi, edi
	cmp	rax, rbp
	sete	dil
.L12:
	call	Assert@PLT
	mov	rdi, rbp
	call	MAXALIGN@PLT
	mov	rdi, r13
	mov	rsi, rax
	call	shm_mq_inc_bytes_written@PLT
.L10:
	cmp	r15, r12
	jle	.L2
.L13:
	mov	rdi, QWORD PTR [rsp]
	call	pg_atomic_read_u64@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	rbp, rax
	call	pg_atomic_read_u64@PLT
	xor	edi, edi
	cmp	rbp, rax
	mov	rbx, rax
	setle	dil
	call	Assert@PLT
	mov	rax, rbx
	xor	edi, edi
	sub	rax, rbp
	cmp	r14, rax
	mov	rbp, rax
	setge	dil
	call	Assert@PLT
	mov	rsi, r15
	mov	rdi, r14
	sub	rsi, r12
	sub	rdi, rbp
	call	Min@PLT
	mov	rbp, rax
	xor	eax, eax
	call	pg_compiler_barrier@PLT
	mov	esi, DWORD PTR 8[r13]
	test	esi, esi
	jne	.L18
	test	rbp, rbp
	jne	.L5
	mov	rax, QWORD PTR 16[rsp]
	mov	edi, DWORD PTR [rax]
	test	edi, edi
	jne	.L6
	mov	ecx, DWORD PTR 28[rsp]
	mov	edx, DWORD PTR 4[rax]
	test	ecx, ecx
	je	.L7
	mov	esi, edx
	mov	rdi, r13
	call	shm_mq_counterparty_gone@PLT
	test	rax, rax
	jne	.L18
	mov	rdi, r13
	call	shm_mq_get_receiver@PLT
	test	rax, rax
	je	.L19
.L9:
	mov	rax, QWORD PTR 16[rsp]
	mov	DWORD PTR [rax], 1
	cmp	r15, r12
	jg	.L13
.L2:
	mov	rax, QWORD PTR 40[rsp]
	mov	QWORD PTR [rax], r12
	mov	eax, DWORD PTR SHM_MQ_SUCCESS[rip]
	add	rsp, 56
	.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
.L6:
	.cfi_restore_state
	call	Assert@PLT
	mov	rdi, QWORD PTR 32[r13]
	call	SetLatch@PLT
	mov	eax, DWORD PTR 28[rsp]
	test	eax, eax
	jne	.L19
	mov	ecx, DWORD PTR WAIT_EVENT_MQ_SEND[rip]
	mov	edi, DWORD PTR MyLatch[rip]
	xor	edx, edx
	mov	esi, DWORD PTR WL_LATCH_SET[rip]
	or	esi, DWORD PTR WL_EXIT_ON_PM_DEATH[rip]
	call	WaitLatch@PLT
	mov	edi, DWORD PTR MyLatch[rip]
	call	ResetLatch@PLT
	xor	eax, eax
	call	CHECK_FOR_INTERRUPTS@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L7:
	lea	rsi, 32[r13]
	mov	rdi, r13
	call	shm_mq_wait_internal@PLT
	test	eax, eax
	jne	.L9
	mov	DWORD PTR 8[r13], 1
.L18:
	mov	rax, QWORD PTR 40[rsp]
	mov	QWORD PTR [rax], r12
	mov	eax, DWORD PTR SHM_MQ_DETACHED[rip]
	add	rsp, 56
	.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
.L19:
	.cfi_restore_state
	mov	rax, QWORD PTR 40[rsp]
	mov	QWORD PTR [rax], r12
	mov	eax, DWORD PTR SHM_MQ_WOULD_BLOCK[rip]
	add	rsp, 56
	.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
.L14:
	.cfi_restore_state
	xor	r12d, r12d
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	shm_mq_send_bytes, .-shm_mq_send_bytes
	.comm	WL_LATCH_SET,4,4
	.comm	WL_EXIT_ON_PM_DEATH,4,4
	.comm	WAIT_EVENT_MQ_SEND,4,4
	.comm	SHM_MQ_WOULD_BLOCK,4,4
	.comm	SHM_MQ_SUCCESS,4,4
	.comm	SHM_MQ_DETACHED,4,4
	.comm	MyLatch,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_shm_mq.c_shm_mq_send_bytes.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	shm_mq_send_bytes, %function
shm_mq_send_bytes:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, [r0, #8]
	sub	sp, sp, #20
	subs	r8, r1, #0
	mov	r5, #0
	ldr	r7, [r6]
	str	r0, [sp, #4]
	str	r2, [sp, #12]
	str	r3, [sp]
	ble	.L2
	add	fp, r6, #24
	add	r10, r6, #20
	b	.L13
.L5:
	mov	r0, r9
	mov	r1, r7
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r0, r4
	sub	r1, r7, r1
	str	r3, [sp, #8]
	bl	Min
	mov	r4, r0
	bl	pg_memory_barrier
	ldr	r1, [r6, #8]
	ldr	r3, [sp, #8]
	ldr	r0, [r6, #12]
	add	r3, r3, r1
	add	r0, r0, r3, lsl #2
	ldr	r3, [sp, #12]
	mov	r2, r4
	add	r1, r3, r5
	add	r5, r5, r4
	bl	memcpy
	cmp	r8, r5
	moveq	r0, #1
	beq	.L12
	mov	r0, r4
	bl	MAXALIGN
	sub	r0, r0, r4
	clz	r0, r0
	lsr	r0, r0, #5
.L12:
	bl	Assert
	mov	r0, r4
	bl	MAXALIGN
	mov	r1, r0
	mov	r0, r6
	bl	shm_mq_inc_bytes_written
.L10:
	cmp	r8, r5
	ble	.L2
.L13:
	mov	r0, fp
	bl	pg_atomic_read_u64
	mov	r4, r0
	mov	r0, r10
	bl	pg_atomic_read_u64
	mov	r9, r0
	cmp	r4, r0
	movgt	r0, #0
	sub	r4, r9, r4
	movle	r0, #1
	bl	Assert
	cmp	r7, r4
	movlt	r0, #0
	movge	r0, #1
	bl	Assert
	sub	r0, r7, r4
	sub	r1, r8, r5
	bl	Min
	mov	r4, r0
	bl	pg_compiler_barrier
	ldr	r2, [r6, #4]
	cmp	r2, #0
	bne	.L18
	cmp	r4, #0
	bne	.L5
	ldr	r3, [sp, #4]
	ldr	r0, [r3]
	cmp	r0, #0
	bne	.L6
	ldr	r2, [sp]
	cmp	r2, #0
	ldr	r2, [r3, #4]
	beq	.L7
	mov	r1, r2
	mov	r0, r6
	bl	shm_mq_counterparty_gone
	cmp	r0, #0
	bne	.L18
	mov	r0, r6
	bl	shm_mq_get_receiver
	cmp	r0, #0
	beq	.L19
.L9:
	mov	r2, #1
	ldr	r3, [sp, #4]
	cmp	r8, r5
	str	r2, [r3]
	bgt	.L13
.L2:
	ldr	r3, .L21
	ldr	r2, [sp, #56]
	ldr	r0, [r3]
	str	r5, [r2]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	bl	Assert
	ldr	r0, [r6, #16]
	bl	SetLatch
	ldr	r3, [sp]
	cmp	r3, #0
	bne	.L19
	ldr	r0, .L21+4
	ldr	r3, .L21+8
	mov	r4, r0
	ldr	r1, [r3]
	ldr	r3, .L21+12
	ldr	r0, [r0]
	ldr	r2, [r3]
	ldr	r3, .L21+16
	orr	r1, r1, r2
	ldr	r3, [r3]
	ldr	r2, [sp]
	bl	WaitLatch
	ldr	r0, [r4]
	bl	ResetLatch
	bl	CHECK_FOR_INTERRUPTS
	b	.L10
.L7:
	mov	r0, r6
	add	r1, r6, #16
	bl	shm_mq_wait_internal
	cmp	r0, #0
	bne	.L9
	mov	r2, #1
	ldr	r3, .L21+20
	str	r2, [r6, #4]
	ldr	r0, [r3]
	ldr	r3, [sp, #56]
	str	r5, [r3]
	b	.L1
.L18:
	ldr	r3, .L21+20
	ldr	r2, [sp, #56]
	ldr	r0, [r3]
	str	r5, [r2]
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	ldr	r3, .L21+24
	ldr	r2, [sp, #56]
	ldr	r0, [r3]
	str	r5, [r2]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L22:
	.align	2
.L21:
	.word	SHM_MQ_SUCCESS
	.word	MyLatch
	.word	WL_LATCH_SET
	.word	WL_EXIT_ON_PM_DEATH
	.word	WAIT_EVENT_MQ_SEND
	.word	SHM_MQ_DETACHED
	.word	SHM_MQ_WOULD_BLOCK
	.size	shm_mq_send_bytes, .-shm_mq_send_bytes
	.comm	WL_LATCH_SET,4,4
	.comm	WL_EXIT_ON_PM_DEATH,4,4
	.comm	WAIT_EVENT_MQ_SEND,4,4
	.comm	SHM_MQ_WOULD_BLOCK,4,4
	.comm	SHM_MQ_SUCCESS,4,4
	.comm	SHM_MQ_DETACHED,4,4
	.comm	MyLatch,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
