	.file	"extr_tuplestore.c_tuplestore_trim.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	tuplestore_trim
	.type	tuplestore_trim, @function
tuplestore_trim:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR EXEC_FLAG_REWIND[rip], eax
	jne	.L20
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	rax, QWORD PTR TSS_INMEM[rip]
	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
	mov	rbx, rdi
	cmp	QWORD PTR 8[rdi], rax
	jne	.L1
	mov	r8d, DWORD PTR 20[rdi]
	mov	r12d, DWORD PTR 16[rdi]
	test	r8d, r8d
	jle	.L4
	xor	ebp, ebp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	add	rbp, 1
	cmp	DWORD PTR 20[rbx], ebp
	jle	.L4
.L6:
	mov	rax, QWORD PTR 32[rbx]
	lea	rax, [rax+rbp*8]
	mov	edi, DWORD PTR 4[rax]
	test	edi, edi
	jne	.L5
	mov	esi, DWORD PTR [rax]
	mov	edi, r12d
	add	rbp, 1
	call	Min@PLT
	mov	r12d, eax
	cmp	DWORD PTR 20[rbx], ebp
	jg	.L6
.L4:
	lea	r13d, -1[r12]
	test	r13d, r13d
	jle	.L1
	xor	edi, edi
	cmp	DWORD PTR 24[rbx], r13d
	setle	dil
	call	Assert@PLT
	xor	edi, edi
	cmp	DWORD PTR 16[rbx], r13d
	setge	dil
	call	Assert@PLT
	mov	edx, DWORD PTR 24[rbx]
	cmp	r13d, edx
	jle	.L10
	mov	esi, r12d
	movsx	rcx, edx
	mov	rax, QWORD PTR 40[rbx]
	sub	esi, edx
	lea	rbp, 0[0+rcx*8]
	mov	edx, esi
	sub	edx, 2
	lea	r14, 1[rcx+rdx]
	sal	r14, 3
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rdi, QWORD PTR [rax+rbp]
	call	GetMemoryChunkSpace@PLT
	mov	rdi, rbx
	mov	esi, eax
	call	FREEMEM@PLT
	mov	rax, QWORD PTR 40[rbx]
	mov	rdi, QWORD PTR [rax+rbp]
	call	pfree@PLT
	mov	rax, QWORD PTR 40[rbx]
	mov	QWORD PTR [rax+rbp], 0
	add	rbp, 8
	cmp	rbp, r14
	jne	.L9
.L10:
	mov	edx, DWORD PTR 16[rbx]
	mov	DWORD PTR 24[rbx], r13d
	mov	DWORD PTR 28[rbx], 1
	test	edx, edx
	lea	eax, 7[rdx]
	cmovns	eax, edx
	sar	eax, 3
	cmp	eax, r13d
	jg	.L1
	mov	rdi, QWORD PTR 40[rbx]
	mov	eax, edx
	movsx	rcx, r13d
	sub	eax, r13d
	lea	rsi, [rdi+rcx*8]
	cmp	edx, r12d
	jne	.L11
	mov	rdx, QWORD PTR [rsi]
	mov	QWORD PTR [rdi], rdx
.L12:
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR 20[rbx]
	mov	DWORD PTR 24[rbx], 0
	test	eax, eax
	jle	.L1
	mov	rdx, QWORD PTR 32[rbx]
	lea	ecx, -1[rax]
	lea	rax, 8[rdx]
	lea	rcx, [rax+rcx*8]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	add	rax, 8
.L14:
	mov	esi, DWORD PTR 4[rdx]
	test	esi, esi
	jne	.L13
	sub	DWORD PTR [rdx], r13d
.L13:
	mov	rdx, rax
	cmp	rcx, rax
	jne	.L24
.L1:
	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
.L20:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	lea	edx, 0[0+rax*8]
	call	memmove@PLT
	mov	eax, DWORD PTR 16[rbx]
	sub	eax, r13d
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	tuplestore_trim, .-tuplestore_trim
	.comm	TSS_INMEM,8,8
	.comm	EXEC_FLAG_REWIND,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_tuplestore.c_tuplestore_trim.c"
	.text
	.align	2
	.global	tuplestore_trim
	.syntax unified
	.arm
	.fpu softvfp
	.type	tuplestore_trim, %function
tuplestore_trim:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L22
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, [r3]
	ldr	r6, [r0]
	ands	r6, r6, r3
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r3, .L22+4
	ldr	r2, [r0, #4]
	ldr	r3, [r3]
	mov	r4, r0
	cmp	r2, r3
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r1, [r0, #12]
	ldr	r7, [r0, #8]
	cmp	r1, #0
	ble	.L4
	mov	r5, r6
	b	.L6
.L5:
	add	r5, r5, #1
	cmp	r1, r5
	ble	.L4
.L6:
	ldr	r3, [r4, #24]
	add	r2, r3, r5, lsl #3
	ldr	r2, [r2, #4]
	cmp	r2, #0
	bne	.L5
	ldr	r1, [r3, r5, lsl #3]
	mov	r0, r7
	bl	Min
	ldr	r1, [r4, #12]
	add	r5, r5, #1
	cmp	r1, r5
	mov	r7, r0
	bgt	.L6
.L4:
	sub	r8, r7, #1
	cmp	r8, #0
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r0, [r4, #16]
	cmp	r0, r8
	movgt	r0, #0
	movle	r0, #1
	bl	Assert
	ldr	r0, [r4, #8]
	cmp	r0, r8
	movlt	r0, #0
	movge	r0, #1
	bl	Assert
	ldr	r5, [r4, #16]
	cmp	r8, r5
	movgt	r9, #0
	ldrgt	r3, [r4, #28]
	ble	.L10
.L9:
	ldr	r0, [r3, r5, lsl #2]
	bl	GetMemoryChunkSpace
	mov	r1, r0
	mov	r0, r4
	bl	FREEMEM
	ldr	r3, [r4, #28]
	ldr	r0, [r3, r5, lsl #2]
	bl	pfree
	ldr	r3, [r4, #28]
	str	r9, [r3, r5, lsl #2]
	add	r5, r5, #1
	cmp	r5, r8
	bne	.L9
.L10:
	ldr	r2, [r4, #8]
	mov	r1, #1
	cmp	r2, #0
	add	r3, r2, #7
	movge	r3, r2
	cmp	r8, r3, asr #3
	str	r8, [r4, #16]
	str	r1, [r4, #20]
	poplt	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r0, [r4, #28]
	cmp	r2, r7
	add	r1, r0, r8, lsl #2
	sub	r2, r2, r8
	bne	.L11
	ldr	r3, [r0, r8, lsl #2]
	str	r3, [r0]
.L12:
	mov	r3, #0
	ldr	r1, [r4, #12]
	str	r2, [r4, #8]
	cmp	r1, r3
	str	r3, [r4, #16]
	pople	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r2, [r4, #24]
	add	r0, r2, #4
.L14:
	ldr	r3, [r0, r6, lsl #3]
	cmp	r3, #0
	ldreq	r3, [r2, r6, lsl #3]
	subeq	r3, r3, r8
	streq	r3, [r2, r6, lsl #3]
	add	r6, r6, #1
	cmp	r6, r1
	bne	.L14
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	lsl	r2, r2, #2
	bl	memmove
	ldr	r2, [r4, #8]
	sub	r2, r2, r8
	b	.L12
.L23:
	.align	2
.L22:
	.word	EXEC_FLAG_REWIND
	.word	TSS_INMEM
	.size	tuplestore_trim, .-tuplestore_trim
	.comm	TSS_INMEM,4,4
	.comm	EXEC_FLAG_REWIND,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
