	.file	"extr_generic.c_agp_allocate_memory.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	agp_allocate_memory
	.type	agp_allocate_memory, @function
agp_allocate_memory:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	test	rdi, rdi
	je	.L26
	mov	rbx, rdi
	lea	rdi, 16[rdi]
	mov	rbp, rsi
	mov	r12, rdx
	call	atomic_read@PLT
	movsx	rdx, DWORD PTR [rbx]
	xor	ecx, ecx
	cdqe
	add	rax, rbp
	setc	cl
	cmp	rax, rdx
	ja	.L26
	test	rcx, rcx
	jne	.L26
	cmp	QWORD PTR AGP_USER_TYPES[rip], r12
	jle	.L29
	test	r12, r12
	je	.L8
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, r12
	mov	rdi, rbp
	call	[QWORD PTR 16[rax]]
	mov	r12, rax
	test	rax, rax
	je	.L1
.L11:
	mov	QWORD PTR [r12], rbx
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	rcx, QWORD PTR ENTRIES_PER_PAGE[rip]
	xor	edx, edx
	lea	rax, -1[rcx+rbp]
	div	rcx
	mov	edi, eax
	call	agp_create_memory@PLT
	mov	r12, rax
	test	rax, rax
	je	.L26
	mov	rax, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR 8[rax]
	test	rcx, rcx
	je	.L30
	mov	rdx, rbp
	mov	rsi, r12
	mov	rdi, rbx
	call	rcx
	test	rax, rax
	je	.L11
.L27:
	mov	rdi, r12
	call	agp_free_memory@PLT
.L26:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	r12d, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	mov	rsi, r12
	mov	rdi, rbp
	call	agp_generic_alloc_user@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L11
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	xor	r13d, r13d
	test	rbp, rbp
	jne	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdx, QWORD PTR 16[r12]
	mov	QWORD PTR [rdx+r13*8], rax
	add	r13, 1
	add	DWORD PTR 8[r12], 1
	cmp	rbp, r13
	je	.L11
	mov	rax, QWORD PTR 8[rbx]
.L10:
	mov	rdi, rbx
	call	[QWORD PTR [rax]]
	test	rax, rax
	jne	.L13
	jmp	.L27
	.cfi_endproc
.LFE0:
	.size	agp_allocate_memory, .-agp_allocate_memory
	.comm	ENTRIES_PER_PAGE,8,8
	.comm	AGP_USER_TYPES,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_generic.c_agp_allocate_memory.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.global	agp_allocate_memory
	.syntax unified
	.arm
	.fpu softvfp
	.type	agp_allocate_memory, %function
agp_allocate_memory:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r4, r0, #0
	beq	.L6
	add	r0, r4, #8
	mov	r5, r1
	mov	r7, r2
	bl	atomic_read
	adds	r0, r0, r5
	movcs	r3, #1
	movcc	r3, #0
	ldr	r2, [r4]
	cmp	r0, r2
	movls	r0, r3
	orrhi	r0, r3, #1
	cmp	r0, #0
	bne	.L6
	ldr	r3, .L28
	ldr	r3, [r3]
	cmp	r3, r7
	ble	.L26
	cmp	r7, #0
	beq	.L8
	ldr	r3, [r4, #4]
	mov	r1, r7
	mov	r0, r5
	ldr	r3, [r3, #8]
	blx	r3
	subs	r6, r0, #0
	beq	.L1
.L11:
	str	r4, [r6]
.L1:
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	mov	r6, #0
	mov	r0, r6
	pop	{r4, r5, r6, r7, r8, pc}
.L8:
	ldr	r3, .L28+4
	ldr	r1, [r3]
	sub	r0, r1, #1
	add	r0, r0, r5
	bl	__aeabi_uidiv
	bl	agp_create_memory
	subs	r6, r0, #0
	beq	.L6
	ldr	r2, [r4, #4]
	ldr	r3, [r2, #4]
	cmp	r3, #0
	beq	.L27
	mov	r2, r5
	mov	r1, r6
	mov	r0, r4
	blx	r3
	cmp	r0, #0
	beq	.L11
	mov	r0, r6
	bl	agp_free_memory
	mov	r6, r7
	b	.L1
.L26:
	mov	r1, r7
	mov	r0, r5
	bl	agp_generic_alloc_user
	subs	r6, r0, #0
	bne	.L11
	b	.L1
.L27:
	cmp	r5, #0
	movne	r7, r3
	bne	.L10
	b	.L11
.L13:
	ldr	r2, [r6, #8]
	ldr	r3, [r6, #4]
	str	r8, [r2, r7, lsl #2]
	add	r7, r7, #1
	add	r3, r3, #1
	cmp	r5, r7
	str	r3, [r6, #4]
	beq	.L11
	ldr	r2, [r4, #4]
.L10:
	mov	r0, r4
	ldr	r3, [r2]
	blx	r3
	subs	r8, r0, #0
	bne	.L13
	mov	r0, r6
	bl	agp_free_memory
	mov	r6, r8
	b	.L1
.L29:
	.align	2
.L28:
	.word	AGP_USER_TYPES
	.word	ENTRIES_PER_PAGE
	.size	agp_allocate_memory, .-agp_allocate_memory
	.comm	ENTRIES_PER_PAGE,4,4
	.comm	AGP_USER_TYPES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
