	.file	"extr_gbefb.c_gbefb_mmap.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	gbefb_mmap, @function
gbefb_mmap:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rdx, -1
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR 16[rsi]
	mov	rsi, QWORD PTR PAGE_SHIFT[rip]
	mov	ecx, esi
	shr	rdx, cl
	cmp	rax, rdx
	ja	.L4
	mov	rdi, QWORD PTR 0[rbp]
	mov	r12, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR gbe_mem_size[rip]
	mov	r9, rdi
	sub	r9, r12
	cmp	rdx, r9
	jb	.L4
	add	rdx, r12
	sal	rax, cl
	sub	rdx, rdi
	cmp	rdx, rax
	jb	.L4
	mov	rcx, QWORD PTR TILE_SHIFT[rip]
	mov	rdi, rax
	mov	rdx, QWORD PTR gbe_tiles[rip]
	and	rax, QWORD PTR TILE_MASK[rip]
	shr	rdi, cl
	lea	r13, [rdx+rdi*8]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r15, rbx
	mov	rsi, r12
	mov	rdi, rbp
	sub	r15, rax
	mov	rcx, r15
	call	remap_pfn_range@PLT
	test	rax, rax
	jne	.L9
	mov	r9, r14
	add	r12, r15
	add	r13, 8
	sub	r9, rbx
	je	.L7
	mov	rcx, QWORD PTR TILE_SHIFT[rip]
	mov	rsi, QWORD PTR PAGE_SHIFT[rip]
	xor	eax, eax
.L8:
	mov	rdx, QWORD PTR 0[r13]
	mov	rbx, QWORD PTR TILE_SIZE[rip]
	lea	r14, [r9+rax]
	mov	r8d, DWORD PTR 24[rbp]
	sal	rdx, cl
	mov	ecx, esi
	add	rdx, rax
	shr	rdx, cl
	cmp	r14, rbx
	jnb	.L15
	mov	rcx, r9
	mov	rsi, r12
	mov	rdi, rbp
	call	remap_pfn_range@PLT
	test	rax, rax
	je	.L7
.L9:
	mov	eax, DWORD PTR EAGAIN[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	gbefb_mmap, .-gbefb_mmap
	.comm	gbe_tiles,8,8
	.comm	gbe_mem_size,8,8
	.comm	TILE_SIZE,8,8
	.comm	TILE_SHIFT,8,8
	.comm	TILE_MASK,8,8
	.comm	PAGE_SHIFT,8,8
	.comm	EINVAL,4,4
	.comm	EAGAIN,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_gbefb.c_gbefb_mmap.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gbefb_mmap, %function
gbefb_mmap:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mvn	r3, #0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r9, .L16
	ldr	r0, [r1, #8]
	ldr	ip, [r9]
	sub	sp, sp, #20
	cmp	r0, r3, lsr ip
	bhi	.L4
	ldm	r1, {r2, r7}
	ldr	r3, .L16+4
	mov	r5, r1
	ldr	r3, [r3]
	sub	r1, r2, r7
	cmp	r3, r1
	bcc	.L4
	add	r3, r7, r3
	sub	r3, r3, r2
	cmp	r3, r0, lsl ip
	lsl	r0, r0, ip
	bcc	.L4
	ldr	fp, .L16+8
	ldr	r4, .L16+12
	ldr	lr, [fp]
	ldr	r2, .L16+16
	lsr	r3, r0, lr
	ldr	r8, [r4]
	lsl	r3, r3, #2
	sub	r3, r3, #4
	ldr	r2, [r2]
	add	r8, r8, r3
	ldr	r10, .L16+20
	mov	r3, r1
	and	r0, r0, r2
	mov	r1, r7
	mov	r7, r5
	mov	r5, r8
	b	.L8
.L15:
	str	r0, [sp]
	mov	r3, r8
	mov	r0, r7
	str	r1, [sp, #12]
	bl	remap_pfn_range
	cmp	r0, #0
	ldr	r1, [sp, #12]
	bne	.L9
	subs	r3, r6, r4
	add	r1, r1, r8
	beq	.L7
	ldr	lr, [fp]
	ldr	ip, [r9]
.L8:
	ldr	r2, [r5, #4]!
	ldr	r4, [r10]
	add	r6, r3, r0
	sub	r8, r4, r0
	cmp	r6, r4
	add	r0, r0, r2, lsl lr
	lsr	r2, r0, ip
	ldr	r0, [r7, #12]
	bcs	.L15
	mov	r5, r7
	mov	r7, r1
	str	r0, [sp]
	mov	r1, r7
	mov	r0, r5
	bl	remap_pfn_range
	cmp	r0, #0
	beq	.L7
.L9:
	ldr	r3, .L16+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r3, .L16+28
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r0, #0
	b	.L1
.L17:
	.align	2
.L16:
	.word	PAGE_SHIFT
	.word	gbe_mem_size
	.word	TILE_SHIFT
	.word	gbe_tiles
	.word	TILE_MASK
	.word	TILE_SIZE
	.word	EAGAIN
	.word	EINVAL
	.size	gbefb_mmap, .-gbefb_mmap
	.comm	gbe_tiles,4,4
	.comm	gbe_mem_size,4,4
	.comm	TILE_SIZE,4,4
	.comm	TILE_SHIFT,4,4
	.comm	TILE_MASK,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	EINVAL,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
