	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tree_insert
_tree_insert:                           ## @tree_insert
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r12d
	movq	%rsi, %r15
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	xorl	%edi, %edi
	cmpq	%r15, 16(%rbx)
	setne	%dil
	callq	_assert
	cmpl	%r12d, 24(%rbx)
	jge	LBB0_3
## %bb.13:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_new_tree_node
	movq	%rax, %r12
	movq	%r14, (%rax)
	leaq	40(%rax), %rdi
	leaq	32(%rax), %r14
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_tree_split
	movq	40(%r12), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movl	8(%rax), %ecx
	incl	%ecx
	jmp	LBB0_16
LBB0_1:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_new_tree_node
	movq	%rax, %rbx
	movq	%r14, (%rax)
	movl	$1, %eax
	jmp	LBB0_20
LBB0_3:
	cmpq	%r15, 16(%rbx)
	jle	LBB0_5
## %bb.4:
	movq	40(%rbx), %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movq	%r14, %rcx
	callq	_tree_insert
	movq	%rax, 40(%rbx)
	testq	%rax, %rax
	je	LBB0_7
LBB0_8:
	movl	8(%rax), %ecx
	incl	%ecx
	jmp	LBB0_9
LBB0_5:
	movq	32(%rbx), %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movq	%r14, %rcx
	callq	_tree_insert
	movq	%rax, 32(%rbx)
	movq	40(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_8
LBB0_7:
	movl	$1, %ecx
LBB0_9:
	movq	32(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	8(%rax), %eax
	addl	%ecx, %eax
	jmp	LBB0_20
LBB0_14:
	movl	$1, %ecx
LBB0_16:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movl	8(%rax), %eax
	jmp	LBB0_19
LBB0_10:
	xorl	%eax, %eax
	addl	%ecx, %eax
	jmp	LBB0_20
LBB0_17:
	xorl	%eax, %eax
LBB0_19:
	addl	%ecx, %eax
	movq	%r12, %rbx
LBB0_20:
	movl	%eax, 8(%rbx)
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_tree_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tree_insert
_tree_insert:                           ; @tree_insert
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cmp	x8, x21
	cset	w0, ne
	bl	_assert
	ldr	w8, [x19, #24]
	cmp	w8, w22
	b.ge	LBB0_7
; %bb.2:
	mov	x0, x21
	mov	x1, x22
	bl	_new_tree_node
	mov	x22, x0
	str	x20, [x0], #40
	add	x20, x22, #32
	mov	x1, x20
	mov	x2, x19
	mov	x3, x21
	bl	_tree_split
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_15
; %bb.3:
	ldr	w8, [x8, #8]
	add	w8, w8, #1
	ldr	x9, [x20]
	cbz	x9, LBB0_5
LBB0_4:
	ldr	w9, [x9, #8]
LBB0_5:
	add	w8, w9, w8
	mov	x19, x22
	b	LBB0_12
LBB0_6:
	mov	x0, x21
	mov	x1, x22
	bl	_new_tree_node
	mov	x19, x0
	str	x20, [x0]
	mov	w8, #1
	b	LBB0_12
LBB0_7:
	ldr	x8, [x19, #16]
	cmp	x8, x21
	b.le	LBB0_13
; %bb.8:
	ldr	x0, [x19, #40]
	mov	x1, x21
	mov	x2, x22
	mov	x3, x20
	bl	_tree_insert
	str	x0, [x19, #40]
	cbz	x0, LBB0_14
LBB0_9:
	ldr	w8, [x0, #8]
	add	w8, w8, #1
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_11
LBB0_10:
	ldr	w9, [x9, #8]
LBB0_11:
	add	w8, w9, w8
LBB0_12:
	str	w8, [x19, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_13:
	ldr	x0, [x19, #32]
	mov	x1, x21
	mov	x2, x22
	mov	x3, x20
	bl	_tree_insert
	str	x0, [x19, #32]
	ldr	x0, [x19, #40]
	cbnz	x0, LBB0_9
LBB0_14:
	mov	w8, #1
	ldr	x9, [x19, #32]
	cbnz	x9, LBB0_10
	b	LBB0_11
LBB0_15:
	mov	w8, #1
	ldr	x9, [x20]
	cbnz	x9, LBB0_4
	b	LBB0_5
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_tree_insert
.subsections_via_symbols
