	.file	"extr_vmci_kernel_if.c_vmci_alloc_queue.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	vmci_alloc_queue
	.type	vmci_alloc_queue, @function
vmci_alloc_queue:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	rsi, QWORD PTR PAGE_SIZE[rip]
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	CEILING@PLT
	cmp	QWORD PTR VMCI_MAX_GUEST_QP_MEMORY[rip], r12
	jl	.L16
	movsx	rbp, eax
	mov	edx, DWORD PTR M_NOWAIT[rip]
	mov	esi, DWORD PTR M_DEVBUF[rip]
	lea	ebx, 1[rbp]
	movsx	rbx, ebx
	lea	rdi, 40[0+rbx*8]
	call	malloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L1
	mov	QWORD PTR 8[rax], 0
	lea	rax, 24[rax]
	mov	QWORD PTR -8[rax], 0
	mov	QWORD PTR [r12], rax
	lea	rax, 40[r12]
	mov	QWORD PTR 24[r12], rbx
	mov	QWORD PTR 32[r12], rax
	test	rbx, rbx
	je	.L4
	xor	ebx, ebx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rdx, 1[rbx]
	cmp	rbx, rbp
	je	.L4
	mov	rbx, rdx
.L6:
	mov	rdi, QWORD PTR PAGE_SIZE[rip]
	lea	rdx, [rax+rbx*8]
	mov	esi, 1
	call	vmci_dma_malloc@PLT
	mov	rax, QWORD PTR [r12]
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR [rax+rbx*8], 0
	jne	.L5
	mov	rsi, QWORD PTR PAGE_SIZE[rip]
	mov	rdi, r12
	xor	r12d, r12d
	imul	rsi, rbx
	call	vmci_free_queue@PLT
.L1:
	mov	rax, r12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR 8[r12], rax
	mov	rax, r12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xor	r12d, r12d
	xor	edi, edi
	call	ASSERT@PLT
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	vmci_alloc_queue, .-vmci_alloc_queue
	.comm	VMCI_MAX_GUEST_QP_MEMORY,8,8
	.comm	PAGE_SIZE,8,8
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,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_vmci_kernel_if.c_vmci_alloc_queue.c"
	.text
	.align	2
	.global	vmci_alloc_queue
	.syntax unified
	.arm
	.fpu softvfp
	.type	vmci_alloc_queue, %function
vmci_alloc_queue:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r8, .L17
	ldr	r1, [r8]
	bl	CEILING
	ldr	r3, .L17+4
	ldr	r3, [r3]
	cmp	r3, r4
	blt	.L16
	ldr	r3, .L17+8
	ldr	r2, .L17+12
	add	r6, r0, #1
	mov	r7, r0
	lsl	r0, r6, #2
	ldr	r2, [r2]
	ldr	r1, [r3]
	add	r0, r0, #20
	bl	malloc
	subs	r5, r0, #0
	beq	.L1
	mov	r4, #0
	add	r3, r5, #12
	add	r2, r5, #20
	cmp	r6, r4
	str	r6, [r5, #12]
	str	r4, [r5, #4]
	str	r4, [r5, #8]
	str	r3, [r5]
	str	r2, [r5, #16]
	bne	.L6
	b	.L4
.L5:
	cmp	r4, r7
	beq	.L4
	mov	r4, r1
.L6:
	mov	r1, #1
	add	r2, r2, r4, lsl #2
	ldr	r0, [r8]
	bl	vmci_dma_malloc
	ldr	r3, [r5]
	add	r1, r4, #1
	ldr	r2, [r3, #4]
	ldr	r6, [r2, r4, lsl #2]
	cmp	r6, #0
	bne	.L5
	ldr	r1, [r8]
	mov	r0, r5
	mul	r1, r4, r1
	bl	vmci_free_queue
	mov	r5, r6
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	ldr	r3, [r2]
	mov	r0, r5
	str	r3, [r5, #4]
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r5, #0
	mov	r0, #0
	bl	ASSERT
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L18:
	.align	2
.L17:
	.word	PAGE_SIZE
	.word	VMCI_MAX_GUEST_QP_MEMORY
	.word	M_DEVBUF
	.word	M_NOWAIT
	.size	vmci_alloc_queue, .-vmci_alloc_queue
	.comm	VMCI_MAX_GUEST_QP_MEMORY,4,4
	.comm	PAGE_SIZE,4,4
	.comm	M_NOWAIT,4,4
	.comm	M_DEVBUF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
