	.file	"extr_x86.c_kvm_arch_prepare_memory_region.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	kvm_arch_prepare_memory_region
	.type	kvm_arch_prepare_memory_region, @function
kvm_arch_prepare_memory_region:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	ebp, DWORD PTR [rsi]
	mov	eax, DWORD PTR MAP_PRIVATE[rip]
	mov	r8d, DWORD PTR MAP_ANONYMOUS[rip]
	mov	rdx, QWORD PTR KVM_MEMORY_SLOTS[rip]
	cmp	QWORD PTR 8[rsi], rdx
	jge	.L2
	or	r8d, eax
	test	ebp, ebp
	jne	.L12
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	or	r8d, DWORD PTR MAP_SHARED[rip]
	test	ebp, ebp
	je	.L1
.L12:
	or	ecx, DWORD PTR 72[rsp]
	jne	.L1
	mov	rax, QWORD PTR current[rip]
	mov	DWORD PTR 12[rsp], r8d
	mov	rdi, QWORD PTR [rax]
	call	down_write@PLT
	mov	edx, DWORD PTR PAGE_SIZE[rip]
	xor	r9d, r9d
	xor	esi, esi
	mov	r8d, DWORD PTR 12[rsp]
	xor	edi, edi
	mov	ecx, DWORD PTR PROT_READ[rip]
	imul	edx, ebp
	or	ecx, DWORD PTR PROT_WRITE[rip]
	call	do_mmap@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR current[rip]
	mov	rdi, QWORD PTR [rax]
	call	up_write@PLT
	mov	rdi, rbp
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L13
	mov	QWORD PTR 16[rbx], rbp
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	add	rsp, 24
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	PTR_ERR@PLT
	.cfi_endproc
.LFE0:
	.size	kvm_arch_prepare_memory_region, .-kvm_arch_prepare_memory_region
	.comm	current,8,8
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	PAGE_SIZE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_PRIVATE,4,4
	.comm	MAP_ANONYMOUS,4,4
	.comm	KVM_MEMORY_SLOTS,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_x86.c_kvm_arch_prepare_memory_region.c"
	.text
	.align	2
	.global	kvm_arch_prepare_memory_region
	.syntax unified
	.arm
	.fpu softvfp
	.type	kvm_arch_prepare_memory_region, %function
kvm_arch_prepare_memory_region:
	@ args = 24, pretend = 8, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	sub	sp, sp, #8
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r1
	ldr	r1, .L14
	ldr	ip, [r4, #4]
	ldr	r1, [r1]
	sub	sp, sp, #8
	cmp	ip, r1
	add	ip, sp, #28
	stmib	ip, {r2, r3}
	ldr	r1, .L14+4
	ldrge	r2, .L14+8
	ldr	r0, .L14+12
	ldr	r6, [r4]
	ldr	r5, [r0]
	ldr	r3, [r1]
	ldrge	r5, [r2]
	cmp	r6, #0
	ldr	r1, [sp, #52]
	orr	r5, r3, r5
	bne	.L13
.L1:
	mov	r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, lr}
	add	sp, sp, #8
	bx	lr
.L13:
	ldr	r7, [sp, #44]
	orrs	r7, r1, r7
	bne	.L1
	ldr	r8, .L14+16
	ldr	r3, [r8]
	ldr	r0, [r3]
	bl	down_write
	ldr	r1, .L14+20
	ldr	r3, .L14+24
	ldr	r2, .L14+28
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r1, r3
	mul	r2, r6, r2
	mov	r1, r7
	stm	sp, {r5, r7}
	mov	r0, r7
	bl	do_mmap
	mov	r5, r0
	ldr	r3, [r8]
	ldr	r0, [r3]
	bl	up_write
	mov	r0, r5
	bl	IS_ERR
	cmp	r0, #0
	streq	r5, [r4, #8]
	beq	.L1
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, lr}
	add	sp, sp, #8
	b	PTR_ERR
.L15:
	.align	2
.L14:
	.word	KVM_MEMORY_SLOTS
	.word	MAP_ANONYMOUS
	.word	MAP_SHARED
	.word	MAP_PRIVATE
	.word	current
	.word	PROT_READ
	.word	PROT_WRITE
	.word	PAGE_SIZE
	.size	kvm_arch_prepare_memory_region, .-kvm_arch_prepare_memory_region
	.comm	current,4,4
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	PAGE_SIZE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_PRIVATE,4,4
	.comm	MAP_ANONYMOUS,4,4
	.comm	KVM_MEMORY_SLOTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
