	.file	"extr_subr_vmem.c_vmem_clip.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vmem_clip, @function
vmem_clip:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rcx
	call	VMEM_ASSERT_LOCKED@PLT
	mov	rax, QWORD PTR BT_TYPE_FREE[rip]
	xor	edi, edi
	cmp	QWORD PTR 0[rbp], rax
	sete	dil
	call	MPASS@PLT
	xor	edi, edi
	cmp	QWORD PTR 8[rbp], rbx
	setge	dil
	call	MPASS@PLT
	mov	rsi, rbp
	mov	rdi, r12
	call	bt_remfree@PLT
	mov	rax, r13
	cmp	QWORD PTR 16[rbp], r13
	je	.L2
	mov	rdi, r12
	call	bt_alloc@PLT
	mov	rdi, r12
	mov	r14, rax
	mov	rax, QWORD PTR BT_TYPE_FREE[rip]
	mov	rsi, r14
	mov	QWORD PTR [r14], rax
	mov	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR 16[r14], rax
	mov	rax, r13
	sub	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR 8[r14], rax
	sub	QWORD PTR 8[rbp], rax
	mov	QWORD PTR 16[rbp], r13
	call	bt_insfree@PLT
	mov	edx, DWORD PTR bt_seglist[rip]
	mov	esi, DWORD PTR vmem_seglist[rip]
	mov	rdi, rbp
	call	TAILQ_PREV@PLT
	mov	rsi, r14
	mov	rdi, r12
	mov	edx, eax
	call	bt_insseg@PLT
	mov	rax, QWORD PTR 16[rbp]
.L2:
	xor	edi, edi
	cmp	r13, rax
	sete	dil
	call	MPASS@PLT
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, rbx
	je	.L3
	sub	rax, rbx
	cmp	rax, QWORD PTR [r12]
	jg	.L9
.L3:
	mov	rax, QWORD PTR BT_TYPE_BUSY[rip]
	mov	rsi, rbp
	mov	rdi, r12
	mov	QWORD PTR 0[rbp], rax
	call	bt_insbusy@PLT
.L4:
	xor	edi, edi
	cmp	QWORD PTR 8[rbp], rbx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	setge	dil
	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
	jmp	MPASS@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	rdi, r12
	call	bt_alloc@PLT
	mov	rsi, rbp
	mov	rdi, r12
	mov	r13, rax
	mov	rax, QWORD PTR BT_TYPE_BUSY[rip]
	mov	QWORD PTR 0[r13], rax
	mov	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR 8[r13], rbx
	mov	QWORD PTR 16[r13], rax
	sub	QWORD PTR 8[rbp], rbx
	add	QWORD PTR 16[rbp], rbx
	call	bt_insfree@PLT
	mov	edx, DWORD PTR bt_seglist[rip]
	mov	esi, DWORD PTR vmem_seglist[rip]
	mov	rdi, rbp
	mov	rbp, r13
	call	TAILQ_PREV@PLT
	mov	rsi, r13
	mov	rdi, r12
	mov	edx, eax
	call	bt_insseg@PLT
	mov	rsi, r13
	mov	rdi, r12
	call	bt_insbusy@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	vmem_clip, .-vmem_clip
	.comm	vmem_seglist,4,4
	.comm	bt_seglist,4,4
	.comm	BT_TYPE_FREE,8,8
	.comm	BT_TYPE_BUSY,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_subr_vmem.c_vmem_clip.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vmem_clip, %function
vmem_clip:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	ldr	r9, .L9
	mov	r7, r2
	mov	r6, r3
	mov	r5, r0
	bl	VMEM_ASSERT_LOCKED
	ldr	r3, [r9]
	ldr	r0, [r4]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	MPASS
	ldr	r0, [r4, #4]
	cmp	r0, r6
	movlt	r0, #0
	movge	r0, #1
	bl	MPASS
	mov	r1, r4
	mov	r0, r5
	bl	bt_remfree
	ldr	r3, [r4, #8]
	cmp	r3, r7
	moveq	r0, r7
	beq	.L2
	mov	r0, r5
	bl	bt_alloc
	ldr	r3, [r4, #8]
	ldr	r2, [r9]
	str	r3, [r0, #8]
	ldr	r3, [r4, #8]
	str	r2, [r0]
	sub	r3, r7, r3
	str	r3, [r0, #4]
	ldr	r2, [r4, #4]
	mov	r1, r0
	sub	r3, r2, r3
	mov	r8, r0
	str	r3, [r4, #4]
	mov	r0, r5
	str	r7, [r4, #8]
	bl	bt_insfree
	ldr	r3, .L9+4
	ldr	r2, .L9+8
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r0, r4
	bl	TAILQ_PREV
	mov	r1, r8
	mov	r2, r0
	mov	r0, r5
	bl	bt_insseg
	ldr	r0, [r4, #8]
.L2:
	sub	r0, r7, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	MPASS
	ldr	r3, [r4, #4]
	cmp	r3, r6
	beq	.L3
	ldr	r2, [r5]
	sub	r3, r3, r6
	cmp	r3, r2
	bgt	.L8
.L3:
	ldr	r3, .L9+12
	mov	r0, r5
	ldr	r3, [r3]
	mov	r1, r4
	str	r3, [r4]
	bl	bt_insbusy
.L4:
	ldr	r0, [r4, #4]
	cmp	r0, r6
	movlt	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	movge	r0, #1
	b	MPASS
.L8:
	mov	r0, r5
	bl	bt_alloc
	ldr	r3, [r4, #8]
	ldr	r1, .L9+12
	str	r3, [r0, #8]
	str	r6, [r0, #4]
	ldr	r2, [r4, #8]
	ldr	r3, [r4, #4]
	ldr	r1, [r1]
	add	r2, r2, r6
	sub	r3, r3, r6
	mov	r7, r0
	str	r1, [r0]
	mov	r1, r4
	str	r2, [r4, #8]
	str	r3, [r4, #4]
	mov	r0, r5
	bl	bt_insfree
	ldr	r3, .L9+4
	ldr	r2, .L9+8
	ldr	r1, [r3]
	mov	r0, r4
	ldr	r2, [r2]
	bl	TAILQ_PREV
	mov	r1, r7
	mov	r2, r0
	mov	r0, r5
	bl	bt_insseg
	mov	r1, r7
	mov	r0, r5
	mov	r4, r7
	bl	bt_insbusy
	b	.L4
.L10:
	.align	2
.L9:
	.word	BT_TYPE_FREE
	.word	vmem_seglist
	.word	bt_seglist
	.word	BT_TYPE_BUSY
	.size	vmem_clip, .-vmem_clip
	.comm	vmem_seglist,4,4
	.comm	bt_seglist,4,4
	.comm	BT_TYPE_FREE,4,4
	.comm	BT_TYPE_BUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
