	.file	"extr_vm_compressor.c_c_seg_major_compact.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	c_seg_major_compact
	.type	c_seg_major_compact, @function
c_seg_major_compact:
.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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR TRUE[rip]
	add	DWORD PTR c_seg_major_compact_stats[rip+8], 1
	mov	DWORD PTR 12[rsp], eax
	mov	eax, DWORD PTR [rdi]
	mov	DWORD PTR 8[rsp], eax
	mov	eax, DWORD PTR [rsi]
	test	eax, eax
	jle	.L1
	mov	rbx, rdi
	mov	r15, rsi
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L10:
	mov	esi, r12d
	mov	rdi, r15
	call	C_SEG_SLOT_FROM_INDEX@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	UNPACK_C_SIZE@PLT
	mov	r14d, eax
	test	eax, eax
	je	.L3
	mov	rdi, QWORD PTR 8[rbx]
	sub	rdi, QWORD PTR 16[rbx]
	call	C_SEG_OFFSET_TO_BYTES@PLT
	mov	r8, rax
	mov	eax, r14d
	cmp	r8, rax
	jge	.L4
	mov	rdi, QWORD PTR 8[rbx]
	mov	r13, QWORD PTR C_SEG_BUFSIZE[rip]
	call	C_SEG_OFFSET_TO_BYTES@PLT
	sub	r13d, eax
	je	.L22
	cmp	DWORD PTR C_SEG_MAX_POPULATE_SIZE[rip], r13d
	mov	rdx, QWORD PTR 8[rbx]
	cmovle	r13d, DWORD PTR C_SEG_MAX_POPULATE_SIZE[rip]
	mov	rax, QWORD PTR 48[rbx]
	mov	r8d, DWORD PTR VM_KERN_MEMORY_COMPRESSOR[rip]
	mov	ecx, DWORD PTR KMA_COMPRESSOR[rip]
	mov	edi, DWORD PTR compressor_map[rip]
	lea	rsi, [rax+rdx*4]
	mov	edx, r13d
	call	kernel_memory_populate@PLT
	mov	edi, r13d
	call	C_SEG_BYTES_TO_OFFSET@PLT
	add	rax, QWORD PTR 8[rbx]
	mov	QWORD PTR 8[rbx], rax
	mov	rdi, rax
	call	C_SEG_OFFSET_TO_BYTES@PLT
	xor	edi, edi
	cmp	rax, QWORD PTR C_SEG_BUFSIZE[rip]
	setle	dil
	call	assert@PLT
.L4:
	mov	rdi, rbx
	call	c_seg_alloc_nextslot@PLT
	mov	esi, DWORD PTR [rbx]
	mov	rdi, rbx
	call	C_SEG_SLOT_FROM_INDEX@PLT
	mov	rdx, QWORD PTR 0[rbp]
	mov	r13, rax
	mov	rax, QWORD PTR 48[r15]
	lea	rsi, [rax+rdx*4]
	mov	rdx, QWORD PTR 16[rbx]
	mov	rax, QWORD PTR 48[rbx]
	lea	rdi, [rax+rdx*4]
	mov	edx, r14d
	call	memcpy@PLT
	mov	eax, DWORD PTR C_SEG_OFFSET_ALIGNMENT_MASK[rip]
	mov	rsi, rbp
	mov	rdi, r13
	add	DWORD PTR c_seg_major_compact_stats[rip+4], 1
	lea	edx, [rax+r14]
	not	eax
	add	DWORD PTR c_seg_major_compact_stats[rip], r14d
	and	edx, eax
	mov	DWORD PTR 4[rsp], edx
	call	cslot_copy@PLT
	mov	rax, QWORD PTR 16[rbx]
	mov	edx, DWORD PTR 4[rsp]
	mov	QWORD PTR 0[r13], rax
	mov	eax, DWORD PTR [rbx]
	cmp	DWORD PTR 24[rbx], eax
	lea	ecx, 1[rax]
	jne	.L7
	mov	DWORD PTR 24[rbx], ecx
.L7:
	add	DWORD PTR 32[rbx], edx
	mov	edi, edx
	add	DWORD PTR 28[rbx], 1
	mov	DWORD PTR [rbx], ecx
	mov	DWORD PTR 4[rsp], edx
	call	C_SEG_BYTES_TO_OFFSET@PLT
	add	QWORD PTR 16[rbx], rax
	xor	esi, esi
	mov	rdi, rbp
	call	PACK_C_SIZE@PLT
	mov	edx, DWORD PTR 4[rsp]
	sub	DWORD PTR 32[r15], edx
	add	DWORD PTR 36[r15], edx
	mov	edi, DWORD PTR 28[r15]
	mov	DWORD PTR 24[r15], 0
	call	assert@PLT
	mov	rax, QWORD PTR C_SEG_OFF_LIMIT[rip]
	sub	DWORD PTR 28[r15], 1
	cmp	QWORD PTR 16[rbx], rax
	mov	eax, DWORD PTR [rbx]
	jnb	.L9
	cmp	eax, DWORD PTR C_SLOT_MAX_INDEX[rip]
	jge	.L9
.L3:
	add	r12d, 1
	cmp	DWORD PTR [r15], r12d
	jg	.L10
	mov	eax, DWORD PTR [rbx]
.L6:
	cmp	eax, DWORD PTR 8[rsp]
	jle	.L1
	mov	edi, DWORD PTR TRUE[rip]
	call	PAGE_REPLACEMENT_ALLOWED@PLT
	mov	eax, DWORD PTR 8[rsp]
	cmp	eax, DWORD PTR [rbx]
	jge	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r14d, DWORD PTR 8[rsp]
	mov	rdi, rbx
	mov	esi, r14d
	call	C_SEG_SLOT_FROM_INDEX@PLT
	mov	rdi, rax
	call	C_SLOT_UNPACK_PTR@PLT
	mov	rcx, QWORD PTR 40[rbx]
	lea	rdx, 1[rcx]
	mov	QWORD PTR 8[rax], rdx
	mov	edx, r14d
	add	r14d, 1
	mov	DWORD PTR 8[rsp], r14d
	mov	DWORD PTR [rax], edx
	cmp	DWORD PTR [rbx], r14d
	jg	.L11
.L12:
	mov	edi, DWORD PTR FALSE[rip]
	call	PAGE_REPLACEMENT_ALLOWED@PLT
.L1:
	mov	eax, DWORD PTR 12[rsp]
	add	rsp, 24
	.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
.L9:
	.cfi_restore_state
	mov	ecx, DWORD PTR FALSE[rip]
	mov	DWORD PTR 12[rsp], ecx
	jmp	.L6
.L22:
	mov	eax, DWORD PTR FALSE[rip]
	mov	DWORD PTR 12[rsp], eax
	mov	eax, DWORD PTR [rbx]
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	c_seg_major_compact, .-c_seg_major_compact
	.comm	compressor_map,4,4
	.comm	c_seg_major_compact_stats,12,8
	.comm	VM_KERN_MEMORY_COMPRESSOR,4,4
	.comm	TRUE,4,4
	.comm	KMA_COMPRESSOR,4,4
	.comm	FALSE,4,4
	.comm	C_SLOT_MAX_INDEX,4,4
	.comm	C_SEG_OFF_LIMIT,8,8
	.comm	C_SEG_OFFSET_ALIGNMENT_MASK,4,4
	.comm	C_SEG_MAX_POPULATE_SIZE,4,4
	.comm	C_SEG_BUFSIZE,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_vm_compressor.c_c_seg_major_compact.c"
	.text
	.align	2
	.global	c_seg_major_compact
	.syntax unified
	.arm
	.fpu softvfp
	.type	c_seg_major_compact, %function
c_seg_major_compact:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, .L25
	ldr	r2, [r1]
	ldr	r3, [r10, #8]
	sub	sp, sp, #20
	add	r3, r3, #1
	str	r3, [r10, #8]
	ldr	r3, .L25+4
	cmp	r2, #0
	ldr	r3, [r3]
	ldr	fp, [r0]
	str	r3, [sp, #12]
	ble	.L1
	mov	r5, r1
	mov	r4, r0
	mov	r8, #0
.L10:
	mov	r1, r8
	mov	r0, r5
	bl	C_SEG_SLOT_FROM_INDEX
	mov	r7, r0
	bl	UNPACK_C_SIZE
	subs	r6, r0, #0
	beq	.L3
	ldmib	r4, {r0, r3}
	sub	r0, r0, r3
	bl	C_SEG_OFFSET_TO_BYTES
	cmp	r0, r6
	bcs	.L4
	ldr	r3, .L25+8
	ldr	r0, [r4, #4]
	ldr	r9, [r3]
	bl	C_SEG_OFFSET_TO_BYTES
	subs	r9, r9, r0
	beq	.L24
	ldr	r3, .L25+12
	ldr	r0, [r4, #4]
	ldr	r2, [r3]
	ldr	r3, .L25+16
	cmp	r9, r2
	movge	r9, r2
	ldr	ip, [r3]
	ldr	r1, [r4, #32]
	ldr	r3, .L25+20
	str	ip, [sp]
	add	r1, r1, r0, lsl #2
	ldr	r0, [r3]
	ldr	r3, .L25+24
	mov	r2, r9
	ldr	r3, [r3]
	bl	kernel_memory_populate
	mov	r0, r9
	bl	C_SEG_BYTES_TO_OFFSET
	ldr	r3, [r4, #4]
	add	r0, r0, r3
	str	r0, [r4, #4]
	bl	C_SEG_OFFSET_TO_BYTES
	ldr	r3, .L25+8
	ldr	r3, [r3]
	cmp	r0, r3
	movgt	r0, #0
	movle	r0, #1
	bl	assert
.L4:
	mov	r0, r4
	bl	c_seg_alloc_nextslot
	ldr	r1, [r4]
	mov	r0, r4
	bl	C_SEG_SLOT_FROM_INDEX
	mov	r9, r0
	ldr	r2, [r4, #32]
	ldr	r3, [r5, #32]
	ldr	r0, [r4, #8]
	ldr	r1, [r7]
	add	r0, r2, r0, lsl #2
	add	r1, r3, r1, lsl #2
	mov	r2, r6
	bl	memcpy
	ldr	r3, .L25+28
	ldr	r2, [r10, #4]
	ldr	r1, [r3]
	ldr	r3, [r10]
	add	ip, r1, r6
	add	r3, r3, r6
	add	r2, r2, #1
	bic	r6, ip, r1
	mov	r0, r9
	mov	r1, r7
	str	r2, [r10, #4]
	str	r3, [r10]
	bl	cslot_copy
	ldr	r3, [r4]
	ldr	r2, [r4, #12]
	ldr	r1, [r4, #8]
	cmp	r2, r3
	addeq	r3, r2, #1
	str	r1, [r9]
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #16]
	addne	r3, r3, #1
	add	r2, r2, r6
	add	r1, r1, #1
	streq	r3, [r4, #12]
	mov	r0, r6
	str	r3, [r4]
	str	r1, [r4, #16]
	str	r2, [r4, #20]
	bl	C_SEG_BYTES_TO_OFFSET
	mov	r2, r0
	ldr	r3, [r4, #8]
	mov	r1, #0
	add	r3, r3, r2
	str	r3, [r4, #8]
	mov	r0, r7
	bl	PACK_C_SIZE
	mov	r1, #0
	ldr	r3, [r5, #24]
	ldr	r2, [r5, #20]
	str	r1, [r5, #12]
	sub	r2, r2, r6
	add	r6, r3, r6
	str	r2, [r5, #20]
	ldr	r0, [r5, #16]
	str	r6, [r5, #24]
	bl	assert
	ldr	r2, .L25+32
	ldr	r3, [r5, #16]
	ldr	r1, [r4, #8]
	ldr	r2, [r2]
	sub	r3, r3, #1
	cmp	r1, r2
	str	r3, [r5, #16]
	ldr	r3, [r4]
	bcs	.L9
	ldr	r2, .L25+36
	ldr	r2, [r2]
	cmp	r3, r2
	bge	.L9
.L3:
	ldr	r3, [r5]
	add	r8, r8, #1
	cmp	r3, r8
	bgt	.L10
	ldr	r3, [r4]
.L6:
	cmp	r3, fp
	ble	.L1
	ldr	r3, .L25+4
	ldr	r0, [r3]
	bl	PAGE_REPLACEMENT_ALLOWED
	ldr	r3, [r4]
	cmp	fp, r3
	bge	.L12
.L11:
	mov	r1, fp
	mov	r0, r4
	bl	C_SEG_SLOT_FROM_INDEX
	bl	C_SLOT_UNPACK_PTR
	mov	r2, fp
	ldr	r3, [r4, #28]
	ldr	r1, [r4]
	add	fp, fp, #1
	add	r3, r3, #1
	cmp	r1, fp
	stm	r0, {r2, r3}
	bgt	.L11
.L12:
	ldr	r3, .L25+40
	ldr	r0, [r3]
	bl	PAGE_REPLACEMENT_ALLOWED
.L1:
	ldr	r0, [sp, #12]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	ldr	r2, .L25+40
	ldr	r2, [r2]
	str	r2, [sp, #12]
	b	.L6
.L24:
	ldr	r2, .L25+40
	ldr	r3, [r4]
	ldr	r2, [r2]
	str	r2, [sp, #12]
	b	.L6
.L26:
	.align	2
.L25:
	.word	c_seg_major_compact_stats
	.word	TRUE
	.word	C_SEG_BUFSIZE
	.word	C_SEG_MAX_POPULATE_SIZE
	.word	VM_KERN_MEMORY_COMPRESSOR
	.word	compressor_map
	.word	KMA_COMPRESSOR
	.word	C_SEG_OFFSET_ALIGNMENT_MASK
	.word	C_SEG_OFF_LIMIT
	.word	C_SLOT_MAX_INDEX
	.word	FALSE
	.size	c_seg_major_compact, .-c_seg_major_compact
	.comm	compressor_map,4,4
	.comm	c_seg_major_compact_stats,12,4
	.comm	VM_KERN_MEMORY_COMPRESSOR,4,4
	.comm	TRUE,4,4
	.comm	KMA_COMPRESSOR,4,4
	.comm	FALSE,4,4
	.comm	C_SLOT_MAX_INDEX,4,4
	.comm	C_SEG_OFF_LIMIT,4,4
	.comm	C_SEG_OFFSET_ALIGNMENT_MASK,4,4
	.comm	C_SEG_MAX_POPULATE_SIZE,4,4
	.comm	C_SEG_BUFSIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
