	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tree_merge_array               ## -- Begin function tree_merge_array
	.p2align	4, 0x90
_tree_merge_array:                      ## @tree_merge_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	16(%rbp), %r15d
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.1:
	movq	%rcx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	%r9d, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movslq	%edx, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %eax
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	setg	%dil
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%r15d
	callq	_assert
	movq	8(%r14), %r14
	testq	%r14, %r14
	je	LBB0_16
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %eax
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	setl	%dil
	callq	_assert
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %eax
	xorl	%edi, %edi
	cmpl	(%r14), %eax
	setg	%dil
	callq	_assert
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	(%r12), %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	16(%r14), %rdi
	movl	%r15d, (%rsp)
	movq	%rbx, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r13, %rcx
	movq	%r12, %r8
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %r9d
	callq	_tree_merge_array
	movl	%eax, %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r15d, %rcx
	movq	(%r13), %rax
	addl	%r15d, %r15d
	movl	%r15d, %r12d
	movq	%rcx, %r15
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rax), %eax
	cmpl	(%r14), %eax
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	xorl	%edi, %edi
	cmpq	-72(%rbp), %r15                 ## 8-byte Folded Reload
	setl	%dil
	callq	_assert
	movq	(%r13), %rax
	movl	(%rax), %ecx
	movslq	%r12d, %r12
	movl	%ecx, (%rbx,%r12,4)
	movl	4(%rax), %ecx
	leal	1(%r12), %edx
	movslq	%edx, %rdx
	movl	%ecx, (%rbx,%rdx,4)
	addq	$8, %rax
	incq	%r15
	addl	$2, %r12d
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	decl	(%rcx)
	movq	%rax, (%r13)
	jne	LBB0_8
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-60(%rbp), %r12d                ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	xorl	%edi, %edi
	cmpl	%eax, %r15d
	setl	%dil
	callq	_assert
	movl	(%r14), %eax
	leal	(%r15,%r15), %ecx
	movslq	%ecx, %rcx
	movl	%eax, (%rbx,%rcx,4)
	leal	1(%r15,%r15), %eax
	cltq
	movl	%r12d, (%rbx,%rax,4)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ecx
	movl	$1, %edi
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rax
	movl	(%rax), %edx
	cmpl	(%r14), %edx
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	addq	$8, %rax
	decl	%ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx)
	movq	%rax, (%r13)
	jne	LBB0_14
	jmp	LBB0_15
LBB0_16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tree_merge_array               ; -- Begin function tree_merge_array
	.p2align	2
_tree_merge_array:                      ; @tree_merge_array
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x6
	cbz	x0, LBB0_16
; %bb.1:
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	sxtw	x26, w22
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	ldr	w9, [x24]
	cmp	w8, w9
	cset	w0, gt
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
	bl	_assert
	ldr	x24, [x24, #8]
	cbz	x24, LBB0_16
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x8, [x24, #16]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	ldr	w9, [x24]
	cmp	w8, w9
	cset	w0, lt
	bl	_assert
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	ldr	w9, [x24]
	cmp	w8, w9
	cset	w0, gt
	bl	_assert
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20]
	mvn	w8, w8
	lsr	w0, w8, #31
	bl	_assert
	ldr	x0, [x24, #16]
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	mov	x6, x25
	bl	_tree_merge_array
	mov	x25, x0
	ldr	w8, [x20]
	cbz	w8, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w27, w25, #1
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	sxtw	x25, w25
	ldr	x8, [x21]
LBB0_10:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x8]
	ldr	w9, [x24]
	cmp	w8, w9
	b.ge	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	cmp	x25, x26
	cset	w0, lt
	bl	_assert
	ldr	x8, [x21]
	ldr	w9, [x8]
	str	w9, [x23, w27, sxtw #2]
	ldr	w9, [x8, #4]
	add	w10, w27, #1
	str	w9, [x23, w10, sxtw #2]
	ldr	w9, [x20]
	add	x8, x8, #8
	str	x8, [x21]
	add	x25, x25, #1
	add	w27, w27, #2
	subs	w9, w9, #1
	str	w9, [x20]
	b.ne	LBB0_10
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w25, w22
	cset	w0, lt
	bl	_assert
	ldr	w8, [x24]
	lsl	w9, w25, #1
	str	w8, [x23, w9, sxtw #2]
	add	x8, x23, w25, sxtw #3
	str	w19, [x8, #4]
	ldr	w9, [x20]
	cbz	w9, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x21]
	ldr	w10, [x8]
	ldr	w11, [x24]
	cmp	w10, w11
	b.ne	LBB0_2
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #8
	str	x8, [x21]
	subs	w9, w9, #1
	str	w9, [x20]
	b.ne	LBB0_2
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #1
	b	LBB0_3
LBB0_16:
	mov	x0, x25
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
