	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unixRemapfile
_unixRemapfile:                         ## @unixRemapfile
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	(%rdi), %r14d
	movq	48(%rdi), %rbx
	movq	8(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	xorl	%edi, %edi
	cmpq	$0, 16(%r13)
	sete	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	%r15, 24(%r13)
	setl	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	%r15, 32(%r13)
	setge	%dil
	callq	_assert
	xorl	%edi, %edi
	testq	%r15, %r15
	setg	%dil
	callq	_assert
	movq	8(%r13), %rax
	xorl	%edi, %edi
	cmpq	24(%r13), %rax
	setge	%dil
	callq	_assert
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	setne	%dil
	callq	_assert
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.1:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	xorl	%eax, %eax
	callq	_osGetpagesize
	negl	%eax
	movslq	%eax, %r12
	andq	24(%r13), %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r12,4), %rbx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	subq	%r12, %rsi
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_osMunmap
LBB0_3:
	movq	%r15, %r14
	subq	%r12, %r14
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movq	%r12, %r9
	callq	_osMmap
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_4
## %bb.8:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%rdi, %rbx
	cmpq	%rdx, %rax
	je	LBB0_5
## %bb.9:
	movq	%rdi, %rbx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_osMunmap
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_osMunmap
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_10
LBB0_4:
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_5:
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.6:
	cmpq	%rcx, %rbx
	jne	LBB0_11
LBB0_7:
	movq	%r12, %rsi
	callq	_osMunmap
	testq	%rbx, %rbx
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_11
LBB0_10:
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	callq	_osMmap
	movq	%rax, %rbx
LBB0_11:
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_13
## %bb.12:
	movq	_SQLITE_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	56(%r13), %edx
	leaq	L_.str(%rip), %rsi
	callq	_unixLogError
	movq	$0, 32(%r13)
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
LBB0_13:
	movq	%rbx, 48(%r13)
	movq	%r15, 8(%r13)
	movq	%r15, 24(%r13)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_SQLITE_OK,4,2                  ## @SQLITE_OK
	.comm	_MREMAP_MAYMOVE,4,2             ## @MREMAP_MAYMOVE
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_UNIXFILE_RDONLY,4,2            ## @UNIXFILE_RDONLY
	.no_dead_strip	_unixRemapfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unixRemapfile
_unixRemapfile:                         ; @unixRemapfile
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	w21, [x0]
Lloh0:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
	ldr	x23, [x0, #48]
Lloh2:
	ldr	w22, [x8]
	ldp	x25, x8, [x0, #8]
	cmp	x8, #0
	cset	w0, eq
	bl	_assert
	ldr	x8, [x19, #24]
	cmp	x8, x20
	cset	w0, lt
	bl	_assert
	ldr	x8, [x19, #32]
	cmp	x8, x20
	cset	w0, ge
	bl	_assert
	cmp	x20, #0
	cset	w0, gt
	bl	_assert
	ldr	x8, [x19, #8]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	cset	w0, ge
	bl	_assert
Lloh3:
	adrp	x28, _MAP_FAILED@GOTPAGE
Lloh4:
	ldr	x28, [x28, _MAP_FAILED@GOTPAGEOFF]
	ldr	x8, [x28]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
Lloh5:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
	cbz	x23, LBB0_10
; %bb.1:
	bl	_osGetpagesize
	ldr	x8, [x19, #24]
	neg	w9, w0
	sxtw	x9, w9
	and	x24, x8, x9
	add	x26, x23, x24, lsl #2
	subs	x1, x25, x24
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x26
	bl	_osMunmap
LBB0_3:
	sub	x27, x20, x24
Lloh7:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x26
	mov	x1, x27
	mov	x2, x22
	mov	x4, x21
	mov	x5, x24
	bl	_osMmap
	ldr	x8, [x28]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.4:
	mov	x25, x23
	cmp	x0, x26
	b.eq	LBB0_7
; %bb.5:
	mov	x1, x27
	bl	_osMunmap
	mov	x0, x23
	mov	x1, x24
	bl	_osMunmap
Lloh10:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	mov	x25, x0
LBB0_7:
	cbz	x25, LBB0_9
; %bb.8:
	cmp	x25, x8
	b.ne	LBB0_11
LBB0_9:
	mov	x0, x23
	mov	x1, x24
	bl	_osMunmap
Lloh12:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
	cbnz	x25, LBB0_11
LBB0_10:
	ldr	w3, [x8]
	mov	x0, #0
	mov	x1, x20
	mov	x2, x22
	mov	x4, x21
	mov	x5, #0
	bl	_osMmap
	mov	x25, x0
LBB0_11:
	ldr	x8, [x28]
	cmp	x25, x8
	b.ne	LBB0_13
; %bb.12:
Lloh14:
	adrp	x8, _SQLITE_OK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SQLITE_OK@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	w2, [x19, #56]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_unixLogError
	mov	x25, #0
	mov	x20, #0
	str	xzr, [x19, #32]
LBB0_13:
	str	x25, [x19, #48]
	str	x20, [x19, #8]
	str	x20, [x19, #24]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_SQLITE_OK,4,2                  ; @SQLITE_OK
	.comm	_MREMAP_MAYMOVE,4,2             ; @MREMAP_MAYMOVE
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_UNIXFILE_RDONLY,4,2            ; @UNIXFILE_RDONLY
	.no_dead_strip	_unixRemapfile
.subsections_via_symbols
