	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tuplestore_trim                ## -- Begin function tuplestore_trim
	.p2align	4, 0x90
_tuplestore_trim:                       ## @tuplestore_trim
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EXEC_FLAG_REWIND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	jne	LBB0_27
## %bb.1:
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	_TSS_INMEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_27
## %bb.2:
	movl	16(%r12), %r14d
	movl	20(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rcx
	cmpl	$0, 4(%rcx,%rbx,8)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rcx,%rbx,8), %esi
	movl	%r14d, %edi
	callq	_Min
	movl	%eax, %r14d
	movl	20(%r12), %eax
	jmp	LBB0_6
LBB0_7:
	cmpl	$2, %r14d
	jl	LBB0_27
## %bb.8:
	leal	-1(%r14), %r15d
	xorl	%edi, %edi
	cmpl	24(%r12), %r14d
	setg	%dil
	callq	_Assert
	xorl	%edi, %edi
	cmpl	16(%r12), %r15d
	setle	%dil
	callq	_Assert
	movslq	24(%r12), %rbx
	cmpl	%r15d, %ebx
	jge	LBB0_11
## %bb.9:
	movl	%ebx, %r13d
	notl	%r13d
	addl	%r14d, %r13d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	40(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_GetMemoryChunkSpace
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_FREEMEM
	movq	40(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_pfree
	movq	40(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	incq	%rbx
	decl	%r13d
	jne	LBB0_10
LBB0_11:
	movl	%r15d, 24(%r12)
	movl	$1, 28(%r12)
	movl	16(%r12), %edx
	leal	7(%rdx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$3, %eax
	cmpl	%eax, %r14d
	jle	LBB0_27
## %bb.12:
	movq	40(%r12), %rdi
	movslq	%r15d, %rax
	leaq	(%rdi,%rax,8), %rsi
	cmpl	%edx, %r14d
	jne	LBB0_14
## %bb.13:
	movq	(%rsi), %rax
	movq	%rax, (%rdi)
	jmp	LBB0_15
LBB0_14:
	subl	%r15d, %edx
	shll	$3, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memmove
	movl	16(%r12), %r14d
LBB0_15:
	movl	$0, 24(%r12)
	subl	%r15d, %r14d
	movl	%r14d, 16(%r12)
	movl	20(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_27
## %bb.16:
	movq	32(%r12), %rcx
	cmpl	$1, %eax
	jne	LBB0_18
## %bb.17:
	xorl	%edx, %edx
LBB0_24:
	testb	$1, %al
	je	LBB0_27
## %bb.25:
	cmpl	$0, 4(%rcx,%rdx,8)
	jne	LBB0_27
## %bb.26:
	subl	%r15d, (%rcx,%rdx,8)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	%eax, %esi
	andl	$-2, %esi
	xorl	%edx, %edx
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_24
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 4(%rcx,%rdx,8)
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$0, 12(%rcx,%rdx,8)
	jne	LBB0_23
	jmp	LBB0_22
LBB0_20:                                ##   in Loop: Header=BB0_19 Depth=1
	subl	%r15d, (%rcx,%rdx,8)
	cmpl	$0, 12(%rcx,%rdx,8)
	jne	LBB0_23
LBB0_22:                                ##   in Loop: Header=BB0_19 Depth=1
	subl	%r15d, 8(%rcx,%rdx,8)
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_EXEC_FLAG_REWIND,4,2           ## @EXEC_FLAG_REWIND
	.comm	_TSS_INMEM,8,3                  ## @TSS_INMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tuplestore_trim                ; -- Begin function tuplestore_trim
	.p2align	2
_tuplestore_trim:                       ; @tuplestore_trim
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _EXEC_FLAG_REWIND@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EXEC_FLAG_REWIND@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_20
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh3:
	adrp	x9, _TSS_INMEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TSS_INMEM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.2:
	ldp	w20, w8, [x19, #16]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x21, #0
	mov	x22, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	add	x21, x21, #8
	cmp	x22, w8, sxtw
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #32]
	add	x10, x9, x21
	ldr	w10, [x10, #4]
	cbnz	w10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x9, x21]
	mov	x0, x20
	bl	_Min
	mov	x20, x0
	ldr	w8, [x19, #20]
	b	LBB0_4
LBB0_7:
	subs	w21, w20, #1
	b.le	LBB0_20
; %bb.8:
	ldr	w8, [x19, #24]
	cmp	w20, w8
	cset	w0, gt
	bl	_Assert
	ldr	w8, [x19, #16]
	cmp	w21, w8
	cset	w0, le
	bl	_Assert
	ldrsw	x8, [x19, #24]
	cmp	w8, w21
	b.ge	LBB0_11
; %bb.9:
	lsl	x22, x8, #3
	mvn	w8, w8
	add	w23, w8, w20
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x22]
	bl	_GetMemoryChunkSpace
	mov	x1, x0
	mov	x0, x19
	bl	_FREEMEM
	ldr	x8, [x19, #40]
	ldr	x0, [x8, x22]
	bl	_pfree
	ldr	x8, [x19, #40]
	str	xzr, [x8, x22]
	add	x22, x22, #8
	subs	w23, w23, #1
	b.ne	LBB0_10
LBB0_11:
	mov	w8, #1
	stp	w21, w8, [x19, #24]
	ldr	w8, [x19, #16]
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	cmp	w20, w9, asr #3
	b.le	LBB0_20
; %bb.12:
	ldr	x0, [x19, #40]
	add	x1, x0, w21, sxtw #3
	cmp	w20, w8
	b.ne	LBB0_14
; %bb.13:
	ldr	x8, [x1]
	str	x8, [x0]
	b	LBB0_15
LBB0_14:
	sub	w8, w8, w21
	lsl	w2, w8, #3
	bl	_memmove
	ldr	w20, [x19, #16]
LBB0_15:
	str	wzr, [x19, #24]
	sub	w8, w20, w21
	str	w8, [x19, #16]
	ldr	w8, [x19, #20]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.16:
	ldr	x9, [x19, #32]
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9, #4]
	cbnz	w10, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	w10, [x9]
	sub	w10, w10, w21
	str	w10, [x9]
	b	LBB0_17
LBB0_20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EXEC_FLAG_REWIND,4,2           ; @EXEC_FLAG_REWIND
	.comm	_TSS_INMEM,8,3                  ; @TSS_INMEM
.subsections_via_symbols
