	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zones_merge
_zones_merge:                           ## @zones_merge
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	_last_deleted_record@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	callq	_zones_count
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_zones_count
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	leal	(,%r15,8), %edi
	callq	_alloca
	xorl	%r15d, %r15d
	movl	$0, %r12d
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, (%rax,%r12,8)
	incq	%r12
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_2
LBB0_3:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,8), %edi
	callq	_alloca
	movq	%rax, %rcx
	testq	%r14, %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_6
## %bb.4:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, (%rcx,%r15,8)
	incq	%r15
	movq	8(%r14), %r14
	testq	%r14, %r14
	jne	LBB0_5
LBB0_6:
	xorl	%eax, %r12d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	xorl	%ebx, %r15d
	movq	%rcx, %r14
	xorl	%edi, %edi
	orl	%r12d, %r15d
	sete	%dil
	callq	_assert
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_zones_sort
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_zones_sort
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	xorl	%r14d, %r14d
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.15:
	movl	$0, %r15d
	testl	%ebx, %ebx
	jle	LBB0_8
## %bb.16:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r15d, %r12
	movq	(%r13,%r12,8), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edi
	movslq	%r14d, %rbx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,8), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	callq	_cmp_str
	testl	%eax, %eax
	js	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	je	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_17 Depth=1
	leal	1(%rbx), %r14d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,8), %rdi
	callq	_zone_delete
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_17 Depth=1
	leal	1(%r12), %r15d
	movq	(%r13,%r12,8), %rdi
	callq	_zone_add
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r12,8), %rdi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,8), %rsi
	callq	_zone_diff
	incl	%r12d
	incl	%ebx
	movl	%ebx, %r14d
	movl	%r12d, %r15d
LBB0_22:                                ##   in Loop: Header=BB0_17 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	%ecx, %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	jge	LBB0_8
## %bb.23:                              ##   in Loop: Header=BB0_17 Depth=1
	cmpl	%eax, %r14d
	jl	LBB0_17
LBB0_8:
	cmpl	%ecx, %r15d
	jl	LBB0_9
	jmp	LBB0_11
LBB0_7:
	xorl	%r15d, %r15d
	cmpl	%ecx, %r15d
	jge	LBB0_11
LBB0_9:
	movslq	%r15d, %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rax,8), %r12
	subl	%r15d, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	movq	%rcx, %r15
	callq	_zone_add
	movq	%r15, %rcx
	incq	%rbx
	cmpl	%ebx, %ecx
	jne	LBB0_10
LBB0_11:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpl	%r12d, %r14d
	jge	LBB0_14
## %bb.12:
	movslq	%r14d, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,8), %r15
	subl	%r14d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15,%rbx,8), %rdi
	callq	_zone_delete
	incq	%rbx
	cmpl	%ebx, %r12d
	jne	LBB0_13
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_last_deleted_record,8,3        ## @last_deleted_record
	.no_dead_strip	_zones_merge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zones_merge
_zones_merge:                           ; @zones_merge
	.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
	mov	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _last_deleted_record@GOTPAGE
Lloh1:
	ldr	x8, [x8, _last_deleted_record@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
	bl	_zones_count
	mov	x20, x0
	mov	x0, x23
	bl	_zones_count
	mov	x19, x0
	lsl	w0, w20, #3
	bl	_alloca
	mov	x21, x0
	cbz	x22, LBB0_3
; %bb.1:
	mov	x24, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	x22, [x21, x24, lsl #3]
	add	x24, x24, #1
	ldr	x22, [x22, #8]
	cbnz	x22, LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w24, #0
LBB0_4:
	lsl	w0, w19, #3
	bl	_alloca
	mov	x22, x0
	cbz	x23, LBB0_7
; %bb.5:
	mov	x8, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	x23, [x22, x8, lsl #3]
	add	x8, x8, #1
	ldr	x23, [x23, #8]
	cbnz	x23, LBB0_6
	b	LBB0_8
LBB0_7:
	mov	w8, #0
LBB0_8:
	cmp	w24, w20
	ccmp	w8, w19, #0, eq
	cset	w0, eq
	bl	_assert
	mov	x0, x21
	mov	x1, x20
	bl	_zones_sort
	mov	x0, x22
	mov	x1, x19
	bl	_zones_sort
	mov	w23, #0
	mov	w24, #0
	cmp	w20, #1
	b.lt	LBB0_17
; %bb.9:
	cmp	w19, #1
	b.lt	LBB0_17
; %bb.10:
	mov	w24, #0
	mov	w23, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	sxtw	x25, w24
	ldr	x8, [x21, w24, sxtw #3]
	ldp	w1, w0, [x8]
	ldr	x8, [x22, w23, sxtw #3]
	ldp	w3, w2, [x8]
	bl	_cmp_str
	tbnz	w0, #31, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	sxtw	x8, w23
	cbz	w0, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	add	w23, w23, #1
	ldr	x0, [x22, x8, lsl #3]
	bl	_zone_delete
	cmp	w24, w20
	b.lt	LBB0_16
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w24, w24, #1
	ldr	x0, [x21, x25, lsl #3]
	bl	_zone_add
	cmp	w24, w20
	b.lt	LBB0_16
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x0, [x21, x25, lsl #3]
	ldr	x1, [x22, x8, lsl #3]
	bl	_zone_diff
	add	w24, w24, #1
	add	w23, w23, #1
	cmp	w24, w20
	b.ge	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=1
	cmp	w23, w19
	b.lt	LBB0_11
LBB0_17:
	cmp	w24, w20
	b.ge	LBB0_20
; %bb.18:
	add	x21, x21, w24, sxtw #3
	sub	w20, w20, w24
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21], #8
	bl	_zone_add
	subs	w20, w20, #1
	b.ne	LBB0_19
LBB0_20:
	cmp	w23, w19
	b.ge	LBB0_23
; %bb.21:
	add	x20, x22, w23, sxtw #3
	sub	w19, w19, w23
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20], #8
	bl	_zone_delete
	subs	w19, w19, #1
	b.ne	LBB0_22
LBB0_23:
	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
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_last_deleted_record,8,3        ; @last_deleted_record
	.no_dead_strip	_zones_merge
.subsections_via_symbols
