	.file	"extr_os_unix.c_unixRemapfile.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"mmap"
	.text
	.p2align 4
	.type	unixRemapfile, @function
unixRemapfile:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	mov	rbx, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	cmp	QWORD PTR 16[rdi], 0
	mov	r14, QWORD PTR 48[rdi]
	mov	r15d, DWORD PTR [rdi]
	mov	r13, QWORD PTR 8[rdi]
	sete	dil
	mov	eax, DWORD PTR PROT_READ[rip]
	movzx	edi, dil
	mov	DWORD PTR 12[rsp], eax
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 24[rbx], rbp
	setl	dil
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR 32[rbx], rbp
	setge	dil
	call	assert@PLT
	xor	edi, edi
	test	rbp, rbp
	setg	dil
	call	assert@PLT
	mov	rax, QWORD PTR 24[rbx]
	xor	edi, edi
	cmp	QWORD PTR 8[rbx], rax
	setge	dil
	call	assert@PLT
	xor	edi, edi
	cmp	QWORD PTR MAP_FAILED[rip], 0
	setne	dil
	call	assert@PLT
	test	r14, r14
	je	.L6
	xor	eax, eax
	call	osGetpagesize@PLT
	neg	eax
	movsx	r12, eax
	and	r12, QWORD PTR 24[rbx]
	lea	rdi, [r14+r12*4]
	cmp	r13, r12
	jne	.L19
.L3:
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	mov	edx, DWORD PTR 12[rsp]
	mov	rsi, rbp
	mov	r9, r12
	sub	rsi, r12
	mov	r8d, r15d
	mov	QWORD PTR 16[rsp], rdi
	mov	QWORD PTR 24[rsp], rsi
	call	osMmap@PLT
	mov	r13, rax
	mov	rax, QWORD PTR MAP_FAILED[rip]
	cmp	rax, r13
	je	.L4
	mov	rdi, QWORD PTR 16[rsp]
	cmp	rdi, r13
	je	.L5
	mov	rsi, QWORD PTR 24[rsp]
	mov	rdi, r13
	call	osMunmap@PLT
	mov	rsi, r12
	mov	rdi, r14
	call	osMunmap@PLT
.L6:
	mov	ecx, DWORD PTR MAP_SHARED[rip]
	mov	edx, DWORD PTR 12[rsp]
	xor	r9d, r9d
	mov	r8d, r15d
	mov	rsi, rbp
	xor	edi, edi
	call	osMmap@PLT
	mov	r14, rax
	mov	rax, QWORD PTR MAP_FAILED[rip]
	cmp	r14, rax
	je	.L20
.L8:
	mov	QWORD PTR 48[rbx], r14
	mov	QWORD PTR 8[rbx], rbp
	mov	QWORD PTR 24[rbx], rbp
	add	rsp, 40
	.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
.L19:
	.cfi_restore_state
	mov	rsi, r13
	mov	QWORD PTR 16[rsp], rdi
	sub	rsi, r12
	call	osMunmap@PLT
	mov	rdi, QWORD PTR 16[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	rax, r14
	jne	.L8
	mov	rsi, r12
	mov	rdi, r14
	mov	r13, r14
	call	osMunmap@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rsi, r12
	mov	rdi, r14
	call	osMunmap@PLT
	test	r13, r13
	je	.L6
.L9:
	mov	rax, QWORD PTR MAP_FAILED[rip]
	mov	r14, r13
	cmp	r14, rax
	jne	.L8
.L20:
	mov	edx, DWORD PTR 56[rbx]
	mov	edi, DWORD PTR SQLITE_OK[rip]
	xor	r14d, r14d
	xor	ebp, ebp
	lea	rsi, .LC0[rip]
	call	unixLogError@PLT
	mov	QWORD PTR 32[rbx], 0
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	unixRemapfile, .-unixRemapfile
	.comm	UNIXFILE_RDONLY,4,4
	.comm	SQLITE_OK,4,4
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	MREMAP_MAYMOVE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,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_os_unix.c_unixRemapfile.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"mmap\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	unixRemapfile, %function
unixRemapfile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r0, [r0, #8]
	mov	r5, r1
	clz	r0, r0
	ldr	r2, [r4]
	ldr	r3, .L21
	sub	sp, sp, #20
	lsr	r0, r0, #5
	str	r2, [sp, #8]
	ldr	r10, [r3]
	ldr	r6, [r4, #24]
	ldr	fp, [r4, #4]
	bl	assert
	ldr	r0, [r4, #12]
	ldr	r8, .L21+4
	cmp	r0, r5
	movge	r0, #0
	movlt	r0, #1
	bl	assert
	ldr	r0, [r4, #16]
	cmp	r0, r5
	movlt	r0, #0
	movge	r0, #1
	bl	assert
	cmp	r5, #0
	movle	r0, #0
	movgt	r0, #1
	bl	assert
	ldr	r0, [r4, #4]
	ldr	r3, [r4, #12]
	cmp	r0, r3
	movlt	r0, #0
	movge	r0, #1
	bl	assert
	ldr	r0, [r8]
	subs	r0, r0, #0
	movne	r0, #1
	bl	assert
	cmp	r6, #0
	ldreq	fp, .L21+8
	beq	.L6
	bl	osGetpagesize
	ldr	r3, [r4, #12]
	rsb	r7, r0, #0
	and	r7, r7, r3
	cmp	fp, r7
	add	r9, r6, r7, lsl #2
	bne	.L19
.L3:
	ldr	r3, [sp, #8]
	ldr	fp, .L21+8
	str	r7, [sp, #4]
	str	r3, [sp]
	mov	r2, r10
	sub	r1, r5, r7
	mov	r0, r9
	ldr	r3, [fp]
	str	r1, [sp, #12]
	bl	osMmap
	ldr	r2, [r8]
	cmp	r2, r0
	beq	.L4
	cmp	r9, r0
	beq	.L5
	ldr	r1, [sp, #12]
	bl	osMunmap
	mov	r1, r7
	mov	r0, r6
	bl	osMunmap
.L6:
	mov	r0, #0
	ldr	r3, [sp, #8]
	mov	r2, r10
	str	r3, [sp]
	ldr	r3, [fp]
	mov	r1, r5
	str	r0, [sp, #4]
	bl	osMmap
	mov	r6, r0
	ldr	r2, [r8]
	cmp	r6, r2
	beq	.L20
.L8:
	str	r6, [r4, #24]
	str	r5, [r4, #4]
	str	r5, [r4, #12]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	mov	r0, r9
	sub	r1, fp, r7
	bl	osMunmap
	b	.L3
.L5:
	cmp	r2, r6
	bne	.L8
	mov	r1, r7
	mov	r0, r6
	bl	osMunmap
	mov	r3, r6
	b	.L9
.L4:
	str	r0, [sp, #12]
	mov	r1, r7
	mov	r0, r6
	bl	osMunmap
	ldr	r3, [sp, #12]
	cmp	r3, #0
	beq	.L6
.L9:
	mov	r6, r3
	ldr	r2, [r8]
	cmp	r6, r2
	bne	.L8
.L20:
	ldr	r3, .L21+12
	ldr	r2, [r4, #28]
	ldr	r0, [r3]
	ldr	r1, .L21+16
	bl	unixLogError
	mov	r3, #0
	mov	r6, r3
	mov	r5, r3
	str	r3, [r4, #16]
	b	.L8
.L22:
	.align	2
.L21:
	.word	PROT_READ
	.word	MAP_FAILED
	.word	MAP_SHARED
	.word	SQLITE_OK
	.word	.LC0
	.size	unixRemapfile, .-unixRemapfile
	.comm	UNIXFILE_RDONLY,4,4
	.comm	SQLITE_OK,4,4
	.comm	PROT_WRITE,4,4
	.comm	PROT_READ,4,4
	.comm	MREMAP_MAYMOVE,4,4
	.comm	MAP_SHARED,4,4
	.comm	MAP_FAILED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
