	.file	"extr_virtio_balloon.c_leak_balloon.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	leak_balloon, @function
leak_balloon:
.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
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	lea	r12, 32[rdi]
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	lea	r14, 8[rbp]
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR pages[rip]
	call	LIST_HEAD@PLT
	mov	rdi, QWORD PTR 24[rbp]
	call	ARRAY_SIZE@PLT
	mov	rdi, r13
	mov	rsi, rax
	call	min@PLT
	mov	rdi, r14
	mov	r13, rax
	call	mutex_lock@PLT
	mov	rsi, QWORD PTR 16[rbp]
	mov	rdi, r13
	call	min@PLT
	mov	QWORD PTR 0[rbp], 0
	test	rax, rax
	je	.L7
	mov	rbx, rax
	lea	r13, pages[rip]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rsi, QWORD PTR 0[rbp]
	mov	rdx, rax
	add	rsi, QWORD PTR 24[rbp]
	mov	rdi, rbp
	call	set_page_pfns@PLT
	mov	rsi, r13
	mov	rdi, r15
	call	list_add@PLT
	mov	rax, QWORD PTR VIRTIO_BALLOON_PAGES_PER_PAGE[rip]
	sub	QWORD PTR 16[rbp], rax
	add	rax, QWORD PTR 0[rbp]
	mov	QWORD PTR 0[rbp], rax
	cmp	rax, rbx
	jnb	.L5
.L4:
	mov	rdi, r12
	call	balloon_page_dequeue@PLT
	mov	r15, rax
	test	rax, rax
	jne	.L11
	mov	rax, QWORD PTR 0[rbp]
.L5:
	mov	r12d, eax
	test	rax, rax
	jne	.L12
.L7:
	xor	r12d, r12d
.L2:
	mov	rdi, rbp
	lea	rsi, pages[rip]
	call	release_pages_balloon@PLT
	mov	rdi, r14
	call	mutex_unlock@PLT
	add	rsp, 8
	.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
.L12:
	.cfi_restore_state
	mov	esi, DWORD PTR 12[rbp]
	mov	rdi, rbp
	call	tell_host@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	leak_balloon, .-leak_balloon
	.comm	pages,4,4
	.comm	VIRTIO_BALLOON_PAGES_PER_PAGE,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_virtio_balloon.c_leak_balloon.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	leak_balloon, %function
leak_balloon:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	ldr	r7, .L14
	mov	r5, r1
	ldr	r0, [r7]
	bl	LIST_HEAD
	ldr	r0, [r4, #16]
	bl	ARRAY_SIZE
	mov	r1, r0
	mov	r0, r5
	bl	min
	mov	r5, r0
	add	r10, r4, #4
	mov	r0, r10
	bl	mutex_lock
	mov	r0, r5
	ldr	r1, [r4, #12]
	bl	min
	mov	r3, #0
	subs	r6, r0, #0
	str	r3, [r4]
	beq	.L6
	ldr	r9, .L14+4
	add	r8, r4, #20
	b	.L4
.L13:
	ldr	r3, [r4]
	ldr	r1, [r4, #16]
	mov	r2, r5
	add	r1, r1, r3
	mov	r0, r4
	bl	set_page_pfns
	mov	r0, r5
	mov	r1, r7
	bl	list_add
	ldr	r2, [r9]
	ldr	r5, [r4]
	ldr	r3, [r4, #12]
	add	r5, r2, r5
	sub	r3, r3, r2
	cmp	r5, r6
	str	r5, [r4]
	str	r3, [r4, #12]
	bcs	.L5
.L4:
	mov	r0, r8
	bl	balloon_page_dequeue
	subs	r5, r0, #0
	bne	.L13
	ldr	r5, [r4]
.L5:
	cmp	r5, #0
	beq	.L2
	mov	r0, r4
	ldr	r1, [r4, #8]
	bl	tell_host
.L2:
	ldr	r1, .L14
	mov	r0, r4
	bl	release_pages_balloon
	mov	r0, r10
	bl	mutex_unlock
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	mov	r5, r6
	b	.L2
.L15:
	.align	2
.L14:
	.word	pages
	.word	VIRTIO_BALLOON_PAGES_PER_PAGE
	.size	leak_balloon, .-leak_balloon
	.comm	pages,4,4
	.comm	VIRTIO_BALLOON_PAGES_PER_PAGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
