	.file	"extr_nandsim.c_get_pages.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	get_pages, @function
get_pages:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rax, rcx
	mov	rcx, QWORD PTR PAGE_CACHE_SHIFT[rip]
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rax
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	shr	r13, cl
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	lea	rbp, -1[rax+rdx]
	shr	rbp, cl
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, rbp
	sub	rax, r13
	cmp	rax, QWORD PTR NS_MAX_HELD_PAGES[rip]
	jge	.L11
	mov	r12, QWORD PTR [rsi]
	mov	r14, rdi
	mov	QWORD PTR [rdi], 0
	cmp	r13, rbp
	jle	.L7
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR [r14]
	mov	rdx, QWORD PTR 8[r14]
	add	r13, 1
	lea	rcx, 1[rax]
	mov	QWORD PTR [r14], rcx
	mov	QWORD PTR [rdx+rax*8], rbx
	cmp	rbp, r13
	jl	.L4
.L7:
	mov	rsi, r13
	mov	rdi, r12
	call	find_get_page@PLT
	mov	rbx, rax
	test	rax, rax
	jne	.L5
	mov	edx, DWORD PTR GFP_NOFS[rip]
	mov	rsi, r13
	mov	rdi, r12
	call	find_or_create_page@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L12
.L6:
	mov	rdi, rbx
	call	unlock_page@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	edi, DWORD PTR [r12]
	mov	esi, 1
	call	write_inode_now@PLT
	mov	edx, DWORD PTR GFP_NOFS[rip]
	mov	rsi, r13
	mov	rdi, r12
	call	find_or_create_page@PLT
	mov	rbx, rax
	test	rax, rax
	jne	.L6
	mov	rdi, r14
	call	put_pages@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	get_pages, .-get_pages
	.comm	PAGE_CACHE_SHIFT,8,8
	.comm	NS_MAX_HELD_PAGES,8,8
	.comm	GFP_NOFS,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_nandsim.c_get_pages.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_pages, %function
get_pages:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	ip, .L13
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r5, [ip]
	sub	r6, r2, #1
	ldr	r2, .L13+4
	add	r6, r6, r3
	lsr	r6, r6, r5
	lsr	r5, r3, r5
	ldr	r3, [r2]
	sub	r2, r6, r5
	cmp	r2, r3
	bge	.L11
	mov	r3, #0
	cmp	r5, r6
	ldr	r7, [r1]
	mov	r9, r0
	str	r3, [r0]
	bgt	.L4
	ldr	r8, .L13+8
	b	.L7
.L5:
	ldr	r3, [r9]
	ldr	r2, [r9, #4]
	add	r5, r5, #1
	add	r1, r3, #1
	cmp	r6, r5
	str	r1, [r9]
	str	r4, [r2, r3, lsl #2]
	blt	.L4
.L7:
	mov	r1, r5
	mov	r0, r7
	bl	find_get_page
	subs	r4, r0, #0
	bne	.L5
	mov	r1, r5
	mov	r0, r7
	ldr	r2, [r8]
	bl	find_or_create_page
	subs	r4, r0, #0
	beq	.L12
.L6:
	mov	r0, r4
	bl	unlock_page
	b	.L5
.L4:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r3, .L13+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	mov	r1, #1
	ldr	r0, [r7]
	bl	write_inode_now
	mov	r1, r5
	mov	r0, r7
	ldr	r2, [r8]
	bl	find_or_create_page
	subs	r4, r0, #0
	bne	.L6
	mov	r0, r9
	bl	put_pages
	ldr	r3, .L13+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	.align	2
.L13:
	.word	PAGE_CACHE_SHIFT
	.word	NS_MAX_HELD_PAGES
	.word	GFP_NOFS
	.word	EINVAL
	.word	ENOMEM
	.size	get_pages, .-get_pages
	.comm	PAGE_CACHE_SHIFT,4,4
	.comm	NS_MAX_HELD_PAGES,4,4
	.comm	GFP_NOFS,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
