	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shrink_file_list
_shrink_file_list:                      ## @shrink_file_list
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	_max_open_files@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rcx
	jb	LBB0_10
## %bb.2:
	leaq	-72(%rbp), %rdi
	movl	$1, %esi
	callq	_file_list_init
	movq	(%rbx), %r13
	testq	%r13, %r13
	je	LBB0_9
## %bb.3:
	xorl	%r15d, %r15d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	leaq	-72(%rbp), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_file_list_add
	addq	%r13, %r15
	movq	(%rbx), %r13
	cmpq	%r15, %r13
	movq	_max_open_files@GOTPCREL(%rip), %r14
	jbe	LBB0_9
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	subq	%r15, %r13
	xorl	%eax, %eax
	callq	_new_tmp_file_name
	movq	(%r14), %rcx
	leaq	-1(%rcx), %rdi
	cmpq	%rcx, %r13
	cmovbq	%r13, %rdi
	leaq	(,%r15,4), %rsi
	addq	16(%rbx), %rsi
	movq	%rdi, %r13
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdx
	callq	_merge_files_array
	cmpl	$0, 8(%rbx)
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testq	%r13, %r13
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %r14
	movq	%r13, %r12
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	16(%rbx), %rax
	movl	(%rax,%r14,4), %edi
	callq	_unlink
	incq	%r14
	decq	%r12
	jne	LBB0_7
	jmp	LBB0_8
LBB0_9:
	movl	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_file_list_clean
	movq	-72(%rbp), %rax
	movq	%rax, (%rbx)
	movq	-56(%rbp), %rax
	movq	%rax, 16(%rbx)
	movl	-60(%rbp), %eax
	movl	%eax, 12(%rbx)
	movl	-64(%rbp), %eax
	movl	%eax, 8(%rbx)
	movl	$1, %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_max_open_files,8,3             ## @max_open_files
	.no_dead_strip	_shrink_file_list
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shrink_file_list
_shrink_file_list:                      ; @shrink_file_list
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	x0, LBB0_10
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x22, _max_open_files@GOTPAGE
Lloh1:
	ldr	x22, [x22, _max_open_files@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_10
LBB0_3:
	add	x0, sp, #8
	mov	w1, #1
	bl	_file_list_init
	ldr	x8, [x19]
	cbz	x8, LBB0_9
; %bb.4:
	mov	x23, #0
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x0, sp, #8
	mov	x1, x21
	mov	w2, #0
	bl	_file_list_add
	ldr	x8, [x19]
	add	x23, x20, x23
	cmp	x8, x23
	b.ls	LBB0_9
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	sub	x20, x8, x23
	bl	_new_tmp_file_name
	mov	x21, x0
	ldr	x8, [x22]
	sub	x9, x8, #1
	cmp	x20, x8
	csel	x20, x20, x9, lo
	ldr	x8, [x19, #16]
	add	x1, x8, x23, lsl #2
	mov	x0, x20
	mov	x2, x21
	bl	_merge_files_array
	ldr	w8, [x19, #8]
	cmp	w8, #0
	ccmp	x20, #0, #4, ne
	b.eq	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	lsl	x24, x23, #2
	mov	x25, x20
LBB0_8:                                 ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x24]
	bl	_unlink
	add	x24, x24, #4
	subs	x25, x25, #1
	b.ne	LBB0_8
	b	LBB0_5
LBB0_9:
	str	wzr, [x19, #8]
	mov	x0, x19
	bl	_file_list_clean
	ldr	x8, [sp, #8]
	str	x8, [x19]
	ldr	x8, [sp, #24]
	str	x8, [x19, #16]
	ldr	d0, [sp, #16]
	str	d0, [x19, #8]
	mov	w0, #1
LBB0_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_max_open_files,8,3             ; @max_open_files
	.no_dead_strip	_shrink_file_list
.subsections_via_symbols
