	.file	"extr_lsm_file.c_lsmFsPagePersist.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	lsmFsPagePersist
	.type	lsmFsPagePersist, @function
lsmFsPagePersist:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR LSM_OK[rip]
	mov	DWORD PTR [rsp], eax
	test	rdi, rdi
	je	.L1
	mov	edx, DWORD PTR [rdi]
	mov	rbx, rdi
	test	DWORD PTR PAGE_DIRTY[rip], edx
	jne	.L34
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L35
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.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
.L34:
	.cfi_restore_state
	mov	rbp, QWORD PTR 64[rdi]
	cmp	QWORD PTR 72[rbp], 0
	je	.L3
	xor	edi, edi
	cmp	QWORD PTR 56[rbx], 0
	je	.L4
	mov	r8d, DWORD PTR 4[rbx]
	test	r8d, r8d
	jne	.L4
	mov	esi, DWORD PTR 8[rbx]
	xor	edi, edi
	test	esi, esi
	sete	dil
.L4:
	call	assert@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	lea	r12, 12[rsp]
	call	fsCompressIntoBuffer@PLT
	mov	esi, DWORD PTR 8[rbx]
	xor	edx, edx
	mov	rdi, r12
	mov	r13, rsp
	mov	DWORD PTR [rsp], eax
	call	putRecordSize@PLT
	mov	rsi, QWORD PTR 56[rbx]
	mov	r8, r13
	mov	rdx, r12
	mov	ecx, 12
	mov	rdi, rbp
	call	fsAppendData@PLT
	mov	ecx, DWORD PTR 8[rbx]
	mov	rdx, QWORD PTR 64[rbp]
	mov	r8, r13
	mov	DWORD PTR 4[rbx], eax
	mov	rsi, QWORD PTR 56[rbx]
	mov	rdi, rbp
	call	fsAppendData@PLT
	mov	rsi, QWORD PTR 56[rbx]
	mov	rdx, r12
	mov	r8, r13
	mov	ecx, 12
	mov	rdi, rbp
	call	fsAppendData@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	edi, DWORD PTR 56[rbp]
	call	fsHashKey@PLT
	mov	rdx, QWORD PTR 48[rbp]
	cdqe
	lea	rax, [rdx+rax*8]
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 48[rbx], rdx
	mov	rdx, QWORD PTR 56[rbx]
	mov	QWORD PTR [rax], rbx
	mov	eax, DWORD PTR 8[rbx]
	add	eax, 24
	add	DWORD PTR 4[rdx], eax
.L32:
	mov	eax, DWORD PTR PAGE_DIRTY[rip]
	not	eax
	and	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR [rsp]
	add	DWORD PTR 4[rbp], 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR 4[rdi]
	test	esi, esi
	jne	.L5
	mov	rax, QWORD PTR 56[rdi]
	mov	DWORD PTR 4[rsp], 0
	mov	DWORD PTR 8[rsp], 0
	mov	edi, DWORD PTR [rax]
	call	assert@PLT
	mov	edi, DWORD PTR [rbx]
	and	edi, DWORD PTR PAGE_FREE[rip]
	call	assert@PLT
	mov	eax, DWORD PTR [rbx]
	xor	edi, edi
	test	DWORD PTR PAGE_HASPREV[rip], eax
	sete	dil
	call	assert@PLT
	mov	eax, DWORD PTR 0[rbp]
	xor	edi, edi
	sub	eax, 4
	cmp	eax, DWORD PTR 12[rbx]
	sete	dil
	call	assert@PLT
	mov	rsi, QWORD PTR 56[rbx]
	lea	rdx, 4[rbx]
	mov	rdi, rbp
	lea	rcx, 4[rsp]
	lea	r8, 8[rsp]
	call	fsAppendPage@PLT
	cmp	eax, DWORD PTR LSM_OK[rip]
	mov	DWORD PTR [rsp], eax
	jne	.L1
	mov	edi, DWORD PTR [rbx]
	and	edi, DWORD PTR PAGE_FREE[rip]
	call	assert@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	edi, DWORD PTR 56[rbp]
	call	fsHashKey@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	rdi, rbp
	movsx	r12, eax
	call	fsRemoveHashEntry@PLT
	mov	rax, QWORD PTR 48[rbp]
	mov	edi, 1
	lea	rax, [rax+r12*8]
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 48[rbx], rdx
	mov	QWORD PTR [rax], rbx
	mov	rax, QWORD PTR 48[rbx]
	test	rax, rax
	je	.L8
	xor	edi, edi
	mov	ecx, DWORD PTR 4[rbx]
	cmp	DWORD PTR 4[rax], ecx
	setne	dil
.L8:
	call	assert@PLT
	mov	ecx, DWORD PTR 4[rsp]
	test	ecx, ecx
	jne	.L36
	mov	eax, DWORD PTR 8[rsp]
	test	eax, eax
	je	.L11
	mov	edi, 1
	call	assert@PLT
	movsx	rdx, DWORD PTR 12[rbx]
	mov	rax, QWORD PTR 32[rbx]
	mov	esi, DWORD PTR 8[rsp]
	lea	rdi, [rax+rdx*4]
	call	lsmPutU32@PLT
.L10:
	mov	rax, QWORD PTR 40[rbp]
	add	DWORD PTR 40[rbx], 1
	test	rax, rax
	je	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rbp, rax
	mov	rax, QWORD PTR 16[rax]
	test	rax, rax
	jne	.L13
	add	rbp, 16
.L14:
	mov	QWORD PTR 0[rbp], rbx
	xor	edi, edi
	cmp	QWORD PTR 16[rbx], 0
	sete	dil
	call	assert@PLT
	mov	eax, DWORD PTR [rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	movsx	r12, DWORD PTR 0[rbp]
	lea	edx, -1[rsi]
	mov	rdi, rbp
	movsx	rax, edx
	imul	r12, rax
	call	fsMmapPage@PLT
	test	rax, rax
	mov	eax, DWORD PTR [rbx]
	je	.L37
	mov	r13, rsp
	test	DWORD PTR PAGE_FREE[rip], eax
	jne	.L17
.L16:
	mov	rsi, r13
	mov	rdi, rbp
	call	lsmFsFlushWaiting@PLT
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR 0[rbp]
	mov	rdx, r13
	mov	rdi, rbp
	add	esi, r12d
	call	fsGrowMapping@PLT
	mov	eax, DWORD PTR LSM_OK[rip]
	cmp	DWORD PTR [rsp], eax
	jne	.L16
	mov	rax, QWORD PTR 24[rbp]
	mov	edx, DWORD PTR 0[rbp]
	lea	r14, [rax+r12*4]
	mov	eax, DWORD PTR [rbx]
	and	eax, DWORD PTR PAGE_HASPREV[rip]
	mov	r12, QWORD PTR 32[rbx]
	cdqe
	mov	rdi, r14
	sal	rax, 2
	sub	r12, rax
	mov	rsi, r12
	call	memcpy@PLT
	mov	edi, DWORD PTR 20[rbp]
	mov	rsi, r12
	call	lsmFree@PLT
	mov	ecx, DWORD PTR [rbx]
	mov	edx, DWORD PTR PAGE_HASPREV[rip]
	mov	rsi, rbx
	sub	DWORD PTR 16[rbp], 1
	mov	rdi, rbp
	and	edx, ecx
	movsx	rdx, edx
	lea	rax, [r14+rdx*4]
	mov	QWORD PTR 32[rbx], rax
	mov	eax, DWORD PTR PAGE_FREE[rip]
	not	eax
	and	eax, ecx
	mov	DWORD PTR [rbx], eax
	call	fsPageRemoveFromHash@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	QWORD PTR 24[rbx], rax
	mov	QWORD PTR 8[rbp], rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L37:
	and	eax, DWORD PTR PAGE_HASPREV[rip]
	mov	rcx, QWORD PTR 32[rbx]
	mov	rdx, r12
	mov	r13, rsp
	cdqe
	mov	esi, DWORD PTR 32[rbp]
	mov	edi, DWORD PTR 20[rbp]
	sal	rax, 2
	mov	r8d, DWORD PTR 0[rbp]
	sub	rcx, rax
	call	lsmEnvWrite@PLT
	mov	DWORD PTR [rsp], eax
	jmp	.L16
.L11:
	mov	esi, DWORD PTR 12[rbx]
	mov	rdi, rbx
	lea	eax, 4[rsi]
	mov	DWORD PTR 12[rbx], eax
	call	lsmSortedExpandBtreePage@PLT
	jmp	.L10
.L36:
	mov	edx, DWORD PTR 8[rsp]
	xor	edi, edi
	test	edx, edx
	sete	dil
	call	assert@PLT
	mov	rsi, QWORD PTR 32[rbx]
	mov	edx, DWORD PTR 12[rbx]
	lea	rdi, 16[rsi]
	call	memmove@PLT
	mov	rdi, QWORD PTR 32[rbx]
	mov	esi, DWORD PTR 4[rsp]
	call	lsmPutU32@PLT
	mov	eax, DWORD PTR PAGE_HASPREV[rip]
	add	QWORD PTR 32[rbx], 16
	or	DWORD PTR [rbx], eax
	jmp	.L10
.L12:
	add	rbp, 40
	jmp	.L14
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	lsmFsPagePersist, .-lsmFsPagePersist
	.comm	PAGE_HASPREV,4,4
	.comm	PAGE_FREE,4,4
	.comm	PAGE_DIRTY,4,4
	.comm	LSM_OK,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_lsm_file.c_lsmFsPagePersist.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	lsmFsPagePersist
	.syntax unified
	.arm
	.fpu softvfp
	.type	lsmFsPagePersist, %function
lsmFsPagePersist:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r6, .L37
	ldr	r3, .L37+4
	subs	r4, r0, #0
	ldr	r0, [r6]
	sub	sp, sp, #44
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	str	r0, [sp, #12]
	beq	.L1
	ldr	r7, .L37+8
	ldr	r2, [r4]
	ldr	r3, [r7]
	tst	r2, r3
	bne	.L32
.L1:
	ldr	r3, .L37+4
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L32:
	ldr	r5, [r4, #40]
	ldr	r3, [r5, #44]
	cmp	r3, #0
	beq	.L3
	ldr	r0, [r4, #36]
	cmp	r0, #0
	beq	.L4
	ldr	r3, [r4, #4]
	cmp	r3, #0
	ldreq	r0, [r4, #8]
	movne	r0, #0
	clzeq	r0, r0
	lsreq	r0, r0, #5
.L4:
	bl	assert
	mov	r1, r4
	mov	r0, r5
	bl	fsCompressIntoBuffer
	mov	r3, r0
	add	r6, sp, #12
	mov	r2, #0
	ldr	r1, [r4, #8]
	add	r0, sp, #24
	str	r3, [sp, #12]
	bl	putRecordSize
	str	r6, [sp]
	mov	r3, #12
	ldr	r1, [r4, #36]
	add	r2, sp, #24
	mov	r0, r5
	bl	fsAppendData
	ldr	r2, [r5, #40]
	str	r0, [r4, #4]
	str	r6, [sp]
	ldr	r3, [r4, #8]
	ldr	r1, [r4, #36]
	mov	r0, r5
	bl	fsAppendData
	str	r6, [sp]
	mov	r3, #12
	add	r2, sp, #24
	ldr	r1, [r4, #36]
	mov	r0, r5
	bl	fsAppendData
	ldr	r1, [r4, #4]
	ldr	r0, [r5, #36]
	bl	fsHashKey
	mov	r3, r0
	ldr	lr, [r4, #36]
	ldr	r6, [r5, #32]
	ldr	r1, [r4]
	ldr	r0, [r4, #8]
	ldr	r7, [r7]
	ldr	ip, [lr, #4]
	ldr	r2, [r5, #4]
	add	r0, r0, #24
	bic	r1, r1, r7
	ldr	r7, [r6, r3, lsl #2]
	add	ip, ip, r0
	add	r2, r2, #1
	str	r7, [r4, #32]
	ldr	r0, [sp, #12]
	str	r4, [r6, r3, lsl #2]
	str	ip, [lr, #4]
	str	r1, [r4]
	str	r2, [r5, #4]
	b	.L1
.L3:
	ldr	r1, [r4, #4]
	cmp	r1, #0
	bne	.L5
	ldr	r3, [r4, #36]
	ldr	r7, .L37+12
	ldr	r0, [r3]
	str	r1, [sp, #16]
	str	r1, [sp, #20]
	bl	assert
	ldr	r3, [r7]
	ldr	r0, [r4]
	ldr	r8, .L37+16
	and	r0, r0, r3
	bl	assert
	ldr	r2, [r4]
	ldr	r3, [r8]
	tst	r2, r3
	moveq	r0, #1
	movne	r0, #0
	bl	assert
	ldr	r3, [r5]
	ldr	r0, [r4, #12]
	sub	r3, r3, #4
	sub	r0, r3, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	add	r3, sp, #20
	str	r3, [sp]
	mov	r0, r5
	add	r3, sp, #16
	ldr	r1, [r4, #36]
	add	r2, r4, #4
	bl	fsAppendPage
	ldr	r3, [r6]
	str	r0, [sp, #12]
	cmp	r0, r3
	bne	.L1
	ldr	r3, [r7]
	ldr	r0, [r4]
	and	r0, r0, r3
	bl	assert
	ldr	r1, [r4, #4]
	ldr	r0, [r5, #36]
	bl	fsHashKey
	mov	r6, r0
	ldr	r1, [r4, #4]
	mov	r0, r5
	bl	fsRemoveHashEntry
	ldr	r3, [r5, #32]
	ldr	r2, [r3, r6, lsl #2]
	str	r2, [r4, #32]
	str	r4, [r3, r6, lsl #2]
	ldr	r3, [r4, #32]
	cmp	r3, #0
	moveq	r0, #1
	beq	.L8
	ldr	r0, [r3, #4]
	ldr	r3, [r4, #4]
	subs	r0, r0, r3
	movne	r0, #1
.L8:
	bl	assert
	ldr	r3, [sp, #16]
	cmp	r3, #0
	bne	.L34
	ldr	r3, [sp, #20]
	cmp	r3, #0
	beq	.L11
	mov	r0, #1
	bl	assert
	ldr	r0, [r4, #12]
	ldr	r3, [r4, #24]
	ldr	r1, [sp, #20]
	add	r0, r3, r0, lsl #2
	bl	lsmPutU32
.L10:
	ldr	r2, [r4, #28]
	ldr	r3, [r5, #28]
	add	r2, r2, #1
	cmp	r3, #0
	str	r2, [r4, #28]
	beq	.L12
.L13:
	mov	r5, r3
	ldr	r3, [r3, #16]
	cmp	r3, #0
	bne	.L13
	add	r5, r5, #16
.L14:
	ldr	r0, [r4, #16]
	str	r4, [r5]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r0, [sp, #12]
	b	.L1
.L5:
	ldr	r9, [r5]
	sub	r3, r1, #1
	mov	r0, r5
	mul	r9, r3, r9
	bl	fsMmapPage
	cmp	r0, #0
	beq	.L35
	ldr	r10, .L37+12
	ldr	r2, [r4]
	ldr	r3, [r10]
	tst	r2, r3
	addeq	r8, sp, #12
	bne	.L36
.L16:
	mov	r1, r8
	mov	r0, r5
	bl	lsmFsFlushWaiting
	ldr	r2, [r4]
	ldr	r3, [r5, #4]
	ldr	r1, [r7]
	add	r3, r3, #1
	bic	r2, r2, r1
	str	r2, [r4]
	ldr	r0, [sp, #12]
	str	r3, [r5, #4]
	b	.L1
.L36:
	ldr	r1, [r5]
	add	r8, sp, #12
	mov	r2, r8
	mov	r0, r5
	add	r1, r9, r1
	bl	fsGrowMapping
	ldr	r3, [r6]
	ldr	r2, [sp, #12]
	cmp	r2, r3
	bne	.L16
	ldr	fp, .L37+16
	ldr	r3, [r4]
	ldr	r1, [fp]
	ldr	r2, [r5, #20]
	ldr	r6, [r4, #24]
	and	r3, r3, r1
	sub	r6, r6, r3, lsl #2
	add	r9, r2, r9, lsl #2
	mov	r1, r6
	ldr	r2, [r5]
	mov	r0, r9
	bl	memcpy
	mov	r1, r6
	ldr	r0, [r5, #16]
	bl	lsmFree
	ldr	r3, [r4]
	ldr	r1, [fp]
	ldr	r2, [r5, #12]
	ldr	r0, [r10]
	and	r1, r1, r3
	add	r9, r9, r1, lsl #2
	bic	r3, r3, r0
	sub	r2, r2, #1
	str	r2, [r5, #12]
	mov	r1, r4
	str	r3, [r4]
	mov	r0, r5
	str	r9, [r4, #24]
	bl	fsPageRemoveFromHash
	ldr	r3, [r5, #8]
	str	r3, [r4, #20]
	str	r4, [r5, #8]
	b	.L16
.L35:
	ldr	r2, .L37+16
	ldr	r3, [r4]
	ldr	r2, [r2]
	ldr	lr, [r4, #24]
	ldr	ip, [r5]
	and	r3, r3, r2
	ldr	r1, [r5, #24]
	ldr	r0, [r5, #16]
	mov	r2, r9
	sub	r3, lr, r3, lsl #2
	str	ip, [sp]
	bl	lsmEnvWrite
	add	r8, sp, #12
	str	r0, [sp, #12]
	b	.L16
.L11:
	ldr	r1, [r4, #12]
	mov	r0, r4
	add	r3, r1, #4
	str	r3, [r4, #12]
	bl	lsmSortedExpandBtreePage
	b	.L10
.L34:
	ldr	r0, [sp, #20]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	assert
	ldr	r1, [r4, #24]
	ldr	r2, [r4, #12]
	add	r0, r1, #16
	bl	memmove
	ldr	r1, [sp, #16]
	ldr	r0, [r4, #24]
	bl	lsmPutU32
	ldr	r1, [r8]
	ldr	r2, [r4]
	ldr	r3, [r4, #24]
	orr	r2, r2, r1
	add	r3, r3, #16
	str	r2, [r4]
	str	r3, [r4, #24]
	b	.L10
.L12:
	add	r5, r5, #28
	b	.L14
.L33:
	bl	__stack_chk_fail
.L38:
	.align	2
.L37:
	.word	LSM_OK
	.word	.LC0
	.word	PAGE_DIRTY
	.word	PAGE_FREE
	.word	PAGE_HASPREV
	.size	lsmFsPagePersist, .-lsmFsPagePersist
	.comm	PAGE_HASPREV,4,4
	.comm	PAGE_FREE,4,4
	.comm	PAGE_DIRTY,4,4
	.comm	LSM_OK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
