	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function merge_files_array
_merge_files_array:                     ## @merge_files_array
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.2:
	movq	%rsi, %r13
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_openfile
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movl	$2, %edi
	xorl	%esi, %esi
	callq	_err
LBB0_4:
	leaq	8(,%r14,8), %rdi
	callq	_sort_malloc
	movq	%rax, %r12
	testq	%r14, %r14
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.5:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r12, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%r15,8), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_file_header_init
	incq	%r15
	addq	$8, %r12
	cmpq	%r15, %r14
	jne	LBB0_6
## %bb.7:
	movq	%r14, %rdi
	movq	%rbx, %r12
	movq	%rbx, %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_file_headers_merge
	testq	%r14, %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_10
## %bb.8:
	movq	%r12, %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_file_header_close
	addq	$8, %rbx
	decq	%r14
	jne	LBB0_9
	jmp	LBB0_10
LBB0_11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_file_headers_merge
LBB0_10:
	movq	%r12, %rdi
	callq	_sort_free
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_closefile                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w"

	.no_dead_strip	_merge_files_array
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function merge_files_array
_merge_files_array:                     ; @merge_files_array
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x1, LBB0_10
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_10
; %bb.2:
	mov	x23, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_openfile
	mov	x21, x0
	cbnz	x0, LBB0_4
; %bb.3:
	mov	w0, #2
	mov	x1, #0
	bl	_err
LBB0_4:
	lsl	x8, x20, #3
	add	x0, x8, #8
	bl	_sort_malloc
	mov	x22, x0
	cbz	x20, LBB0_11
; %bb.5:
	mov	x24, #0
	mov	x25, x22
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x23, x24, lsl #3]
	mov	x0, x25
	mov	x2, x24
	bl	_file_header_init
	add	x24, x24, #1
	add	x25, x25, #8
	cmp	x20, x24
	b.ne	LBB0_6
; %bb.7:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_file_headers_merge
	cbz	x20, LBB0_12
; %bb.8:
	mov	x23, x22
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_file_header_close
	add	x23, x23, #8
	subs	x20, x20, #1
	b.ne	LBB0_9
	b	LBB0_12
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_file_headers_merge
LBB0_12:
	mov	x0, x22
	bl	_sort_free
	mov	x0, x21
	mov	x1, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_closefile
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w"

	.no_dead_strip	_merge_files_array
.subsections_via_symbols
