	.file	"extr_suspend.c_page_key_alloc.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	page_key_alloc
	.type	page_key_alloc, @function
page_key_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	esi, DWORD PTR PAGE_KEY_DATA_SIZE[rip]
	call	DIV_ROUND_UP@PLT
	test	rax, rax
	je	.L2
	lea	rbx, -1[rax]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdx, QWORD PTR page_key_data[rip]
	sub	rbx, 1
	mov	QWORD PTR [rax], rdx
	mov	QWORD PTR page_key_data[rip], rax
	cmp	rbx, -1
	je	.L6
.L5:
	mov	edi, DWORD PTR GFP_KERNEL[rip]
	call	get_zeroed_page@PLT
	test	rax, rax
	jne	.L3
	call	page_key_free@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	neg	eax
	ret
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR page_key_data[rip]
.L6:
	mov	QWORD PTR page_key_wp[rip], rax
	pop	rbx
	.cfi_def_cfa_offset 8
	mov	QWORD PTR page_key_rp[rip], rax
	xor	eax, eax
	mov	QWORD PTR page_key_wx[rip], 0
	mov	QWORD PTR page_key_rx[rip], 0
	ret
	.cfi_endproc
.LFE0:
	.size	page_key_alloc, .-page_key_alloc
	.comm	page_key_wx,8,8
	.comm	page_key_wp,8,8
	.comm	page_key_rx,8,8
	.comm	page_key_rp,8,8
	.comm	page_key_data,8,8
	.comm	PAGE_KEY_DATA_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,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_suspend.c_page_key_alloc.c"
	.text
	.align	2
	.global	page_key_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	page_key_alloc, %function
page_key_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L10
	push	{r4, r5, r6, lr}
	ldr	r1, [r3]
	bl	DIV_ROUND_UP
	cmp	r0, #0
	beq	.L2
	ldr	r6, .L10+4
	ldr	r5, .L10+8
	sub	r4, r0, #1
	b	.L5
.L3:
	ldr	r2, [r5]
	cmn	r4, #1
	str	r2, [r3]
	str	r3, [r5]
	beq	.L6
.L5:
	ldr	r0, [r6]
	bl	get_zeroed_page
	subs	r3, r0, #0
	sub	r4, r4, #1
	bne	.L3
	bl	page_key_free
	ldr	r3, .L10+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r3, .L10+8
	ldr	r3, [r3]
.L6:
	mov	r2, #0
	ldr	r1, .L10+16
	ldr	lr, .L10+20
	str	r2, [r1]
	ldr	ip, .L10+24
	ldr	r1, .L10+28
	mov	r0, r2
	str	r2, [lr]
	str	r3, [ip]
	str	r3, [r1]
	pop	{r4, r5, r6, pc}
.L11:
	.align	2
.L10:
	.word	PAGE_KEY_DATA_SIZE
	.word	GFP_KERNEL
	.word	page_key_data
	.word	ENOMEM
	.word	page_key_wx
	.word	page_key_rx
	.word	page_key_wp
	.word	page_key_rp
	.size	page_key_alloc, .-page_key_alloc
	.comm	page_key_wx,4,4
	.comm	page_key_wp,4,4
	.comm	page_key_rx,4,4
	.comm	page_key_rp,4,4
	.comm	page_key_data,4,4
	.comm	PAGE_KEY_DATA_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
