	.file	"extr_pgtable.c_pgd_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pgd_alloc
	.type	pgd_alloc, @function
pgd_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	mov	r12, rdi
	sub	rsp, 16
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_PREALLOCATED_USER_PMDS[rip]
	mov	rcx, rsp
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L24:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L24
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L25
.L4:
	movsx	rax, DWORD PTR MAX_PREALLOCATED_PMDS[rip]
	mov	rsi, rsp
	mov	r15, rsp
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rsi, rax
	and	rdx, -16
	mov	rax, rsi
	cmp	rsp, rax
	je	.L6
.L26:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L26
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L27
.L7:
	xor	eax, eax
	mov	r14, rsp
	call	_pgd_alloc@PLT
	mov	r13, rax
	test	rax, rax
	je	.L1
	mov	QWORD PTR [r12], rax
	mov	edx, DWORD PTR PREALLOCATED_PMDS[rip]
	mov	rsi, r14
	mov	rdi, r12
	call	preallocate_pmds@PLT
	test	rax, rax
	jne	.L9
	mov	edx, DWORD PTR PREALLOCATED_USER_PMDS[rip]
	mov	rsi, r15
	mov	rdi, r12
	call	preallocate_pmds@PLT
	test	rax, rax
	jne	.L10
	mov	rdi, r12
	call	paravirt_pgd_alloc@PLT
	test	rax, rax
	jne	.L28
	lea	rdi, pgd_lock[rip]
	call	spin_lock@PLT
	mov	rsi, r13
	mov	rdi, r12
	call	pgd_ctor@PLT
	mov	rdx, r14
	mov	rsi, r13
	mov	rdi, r12
	call	pgd_prepopulate_pmd@PLT
	mov	rdi, r12
	mov	rdx, r15
	mov	rsi, r13
	call	pgd_prepopulate_user_pmd@PLT
	lea	rdi, pgd_lock[rip]
	call	spin_unlock@PLT
.L1:
	mov	rax, QWORD PTR -40[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L29
	lea	rsp, -32[rbp]
	mov	rax, r13
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edx, DWORD PTR PREALLOCATED_USER_PMDS[rip]
	mov	rsi, r15
	mov	rdi, r12
	call	free_pmds@PLT
.L10:
	mov	edx, DWORD PTR PREALLOCATED_PMDS[rip]
	mov	rsi, r14
	mov	rdi, r12
	call	free_pmds@PLT
.L9:
	mov	rdi, r13
	xor	r13d, r13d
	call	_pgd_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pgd_alloc, .-pgd_alloc
	.comm	pgd_lock,4,4
	.comm	PREALLOCATED_USER_PMDS,4,4
	.comm	PREALLOCATED_PMDS,4,4
	.comm	MAX_PREALLOCATED_USER_PMDS,4,4
	.comm	MAX_PREALLOCATED_PMDS,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_pgtable.c_pgd_alloc.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	pgd_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	pgd_alloc, %function
pgd_alloc:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, fp, lr}
	add	fp, sp, #28
	sub	sp, sp, #8
	ldr	r2, .L14
	ldr	r3, .L14+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	lsl	r2, r2, #2
	add	r2, r2, #7
	lsl	r3, r3, #2
	bic	r2, r2, #7
	add	r3, r3, #7
	sub	sp, sp, r2
	bic	r3, r3, #7
	mov	r7, sp
	sub	sp, sp, r3
	ldr	r3, .L14+8
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	bl	_pgd_alloc
	subs	r4, r0, #0
	beq	.L1
	mov	r6, sp
	ldr	r8, .L14+12
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [r8]
	str	r4, [r5]
	bl	preallocate_pmds
	cmp	r0, #0
	bne	.L3
	ldr	r9, .L14+16
	mov	r1, r7
	mov	r0, r5
	ldr	r2, [r9]
	bl	preallocate_pmds
	cmp	r0, #0
	bne	.L4
	mov	r0, r5
	bl	paravirt_pgd_alloc
	cmp	r0, #0
	bne	.L12
	ldr	r0, .L14+20
	bl	spin_lock
	mov	r1, r4
	mov	r0, r5
	bl	pgd_ctor
	mov	r2, r6
	mov	r1, r4
	mov	r0, r5
	bl	pgd_prepopulate_pmd
	mov	r2, r7
	mov	r1, r4
	mov	r0, r5
	bl	pgd_prepopulate_user_pmd
	ldr	r0, .L14+20
	bl	spin_unlock
.L1:
	ldr	r3, .L14+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L13
	mov	r0, r4
	sub	sp, fp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, fp, pc}
.L12:
	mov	r1, r7
	mov	r0, r5
	ldr	r2, [r9]
	bl	free_pmds
.L4:
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [r8]
	bl	free_pmds
.L3:
	mov	r0, r4
	bl	_pgd_free
	mov	r4, #0
	b	.L1
.L13:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	MAX_PREALLOCATED_USER_PMDS
	.word	MAX_PREALLOCATED_PMDS
	.word	.LC0
	.word	PREALLOCATED_PMDS
	.word	PREALLOCATED_USER_PMDS
	.word	pgd_lock
	.size	pgd_alloc, .-pgd_alloc
	.comm	pgd_lock,4,4
	.comm	PREALLOCATED_USER_PMDS,4,4
	.comm	PREALLOCATED_PMDS,4,4
	.comm	MAX_PREALLOCATED_USER_PMDS,4,4
	.comm	MAX_PREALLOCATED_PMDS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
