	.file	"extr_vmm.c_vm_malloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	vm_malloc
	.type	vm_malloc, @function
vm_malloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rax, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	or	rax, rdx
	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, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rcx
	test	QWORD PTR XHYVE_PAGE_MASK[rip], rax
	jne	.L27
	mov	rbx, rdx
	test	rdx, rdx
	jne	.L29
.L27:
	mov	eax, DWORD PTR EINVAL[rip]
.L1:
	add	rsp, 24
	.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
.L29:
	.cfi_restore_state
	lea	rax, [rsi+rdx]
	mov	r12, rdi
	mov	rbp, rsi
	mov	r14, rsi
	mov	QWORD PTR [rsp], rax
	xor	r15d, r15d
	xor	r13d, r13d
	cmp	rsi, rax
	jb	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L31:
	add	r15d, 1
	add	r14, QWORD PTR XHYVE_PAGE_SIZE[rip]
	cmp	r14, QWORD PTR [rsp]
	jnb	.L30
.L3:
	mov	rsi, r14
	mov	rdi, r12
	call	vm_mem_allocated@PLT
	test	rax, rax
	jne	.L31
	add	r13d, 1
	add	r14, QWORD PTR XHYVE_PAGE_SIZE[rip]
	cmp	r14, QWORD PTR [rsp]
	jb	.L3
.L30:
	test	r15d, r15d
	setne	dl
	test	r13d, r13d
	je	.L25
	test	dl, dl
	jne	.L27
	test	r13d, r13d
	je	.L25
.L4:
	mov	rax, QWORD PTR [r12]
	cmp	rax, QWORD PTR VM_MAX_MEMORY_SEGMENTS[rip]
	jb	.L10
	mov	eax, DWORD PTR E2BIG[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L25:
	xor	eax, eax
	test	dl, dl
	jne	.L1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L10:
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR 8[r12]
	mov	rsi, rbx
	mov	rdi, rbp
	lea	r13, [rax+rdx*8]
	mov	rdx, QWORD PTR 8[rsp]
	call	vmm_mem_alloc@PLT
	test	rax, rax
	je	.L32
	mov	QWORD PTR 16[r13], rax
	xor	eax, eax
	mov	QWORD PTR 0[r13], rbp
	mov	QWORD PTR 8[r13], rbx
	add	QWORD PTR [r12], 1
	jmp	.L1
.L32:
	mov	eax, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	vm_malloc, .-vm_malloc
	.comm	XHYVE_PAGE_SIZE,8,8
	.comm	XHYVE_PAGE_MASK,8,8
	.comm	VM_MAX_MEMORY_SEGMENTS,8,8
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	E2BIG,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_vmm.c_vm_malloc.c"
	.text
	.align	2
	.global	vm_malloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	vm_malloc, %function
vm_malloc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r2
	ldr	r2, .L18
	mov	r8, r1
	ldr	r2, [r2]
	orr	r1, r1, r7
	tst	r1, r2
	movne	r5, #1
	moveq	r5, #0
	cmp	r7, #0
	moveq	r5, #1
	sub	sp, sp, #12
	cmp	r5, #0
	str	r3, [sp, #4]
	beq	.L17
.L15:
	ldr	r3, .L18+4
	ldr	r0, [r3]
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L17:
	add	fp, r8, r7
	cmp	r8, fp
	mov	r6, r0
	bcs	.L4
	mov	r4, r8
	mov	r10, r5
	ldr	r9, .L18+8
.L3:
	mov	r1, r4
	mov	r0, r6
	bl	vm_mem_allocated
	ldr	r3, [r9]
	cmp	r0, #0
	add	r4, r4, r3
	addne	r5, r5, #1
	addeq	r10, r10, #1
	cmp	r4, fp
	bcc	.L3
	subs	r5, r5, #0
	movne	r5, #1
	cmp	r10, #0
	movne	r0, r5
	moveq	r0, #0
	cmp	r0, #0
	bne	.L15
	cmp	r10, #0
	movne	r5, #0
	cmp	r5, #0
	bne	.L1
.L4:
	ldr	r2, .L18+12
	ldr	r3, [r6]
	ldr	r2, [r2]
	cmp	r3, r2
	ldrcs	r3, .L18+16
	ldrcs	r0, [r3]
	bcs	.L1
.L9:
	ldr	r5, [r6, #4]
	add	r3, r3, r3, lsl #1
	mov	r1, r7
	mov	r0, r8
	ldr	r2, [sp, #4]
	add	r4, r5, r3, lsl #2
	lsl	r9, r3, #2
	bl	vmm_mem_alloc
	cmp	r0, #0
	ldrne	r3, [r6]
	ldreq	r3, .L18+20
	addne	r3, r3, #1
	strne	r8, [r5, r9]
	ldreq	r0, [r3]
	strne	r0, [r4, #8]
	strne	r7, [r4, #4]
	movne	r0, #0
	strne	r3, [r6]
	b	.L1
.L19:
	.align	2
.L18:
	.word	XHYVE_PAGE_MASK
	.word	EINVAL
	.word	XHYVE_PAGE_SIZE
	.word	VM_MAX_MEMORY_SEGMENTS
	.word	E2BIG
	.word	ENOMEM
	.size	vm_malloc, .-vm_malloc
	.comm	XHYVE_PAGE_SIZE,4,4
	.comm	XHYVE_PAGE_MASK,4,4
	.comm	VM_MAX_MEMORY_SEGMENTS,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	E2BIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
