	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_heap_insert                    ## -- Begin function heap_insert
	.p2align	4, 0x90
_heap_insert:                           ## @heap_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.1:
	movq	%rdx, %rbx
	movl	(%r14), %r15d
	movl	%r15d, %eax
	cmpl	4(%r14), %r15d
	jne	LBB0_4
## %bb.2:
	leal	16(%r15), %esi
	movq	%r14, %rdi
	callq	_heap_resize
	movq	%rax, %rcx
	movl	$1, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
## %bb.3:
	movl	(%r14), %eax
LBB0_4:
	movslq	%r15d, %rcx
	movq	8(%r14), %rdx
	shlq	$4, %rcx
	movq	%rbx, 8(%rdx,%rcx)
	movq	%r12, (%rdx,%rcx)
	incl	%eax
	movl	%eax, (%r14)
	testl	%r15d, %r15d
	jg	LBB0_5
	jmp	LBB0_9
LBB0_7:
	movl	%r12d, %r15d
	testl	%r15d, %r15d
	jle	LBB0_9
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	callq	_HEAP_FATHER
	movl	%eax, %r12d
	movq	8(%r14), %rax
	movslq	%r12d, %r13
	shlq	$4, %r13
	movq	(%rax,%r13), %rdi
	movl	%r15d, %ebx
	shlq	$4, %rbx
	movq	(%rax,%rbx), %rsi
	callq	_DN_KEY_LT
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r14), %rax
	movq	(%rax,%rbx), %rdi
	movq	8(%rax,%rbx), %rsi
	movq	(%rax,%r13), %rdx
	movq	8(%rax,%r13), %rcx
	callq	_HEAP_SWAP
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_SET_OFFSET
	movl	%r12d, %r15d
	testl	%r12d, %r12d
	jg	LBB0_5
	jmp	LBB0_10
LBB0_9:
	movl	%r15d, %r12d
LBB0_10:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_SET_OFFSET
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %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	_heap_insert                    ; -- Begin function heap_insert
	.p2align	2
_heap_insert:                           ; @heap_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	x21, x1
	mov	x19, x0
	cbz	x2, LBB0_4
; %bb.1:
	mov	x22, x2
	ldp	w20, w9, [x19]
	mov	x8, x20
	cmp	w20, w9
	b.ne	LBB0_6
; %bb.2:
	add	w1, w20, #16
	mov	x0, x19
	bl	_heap_resize
	cbz	x0, LBB0_5
; %bb.3:
	mov	w0, #1
	b	LBB0_11
LBB0_4:
	mov	x20, x21
	cmp	w20, #1
	b.ge	LBB0_7
	b	LBB0_9
LBB0_5:
	ldr	w8, [x19]
LBB0_6:
	sxtw	x9, w20
	ldr	x10, [x19, #8]
	add	x9, x10, x9, lsl #4
	stp	x21, x22, [x9]
	add	w8, w8, #1
	str	w8, [x19]
	cmp	w20, #1
	b.lt	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_HEAP_FATHER
	mov	x21, x0
	ldr	x8, [x19, #8]
	sbfiz	x9, x21, #4, #32
	ldr	x0, [x8, x9]
	mov	w22, w20
	lsl	x9, x22, #4
	ldr	x1, [x8, x9]
	bl	_DN_KEY_LT
	cbnz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sxtw	x8, w21
	ldr	x9, [x19, #8]
	add	x10, x9, x22, lsl #4
	add	x8, x9, x8, lsl #4
	ldp	x0, x1, [x10]
	ldp	x2, x3, [x8]
	mov	x4, #0
	bl	_HEAP_SWAP
	mov	x0, x19
	mov	x1, x20
	bl	_SET_OFFSET
	mov	x20, x21
	cmp	w21, #0
	b.gt	LBB0_7
	b	LBB0_10
LBB0_9:
	mov	x21, x20
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	bl	_SET_OFFSET
	mov	w0, #0
LBB0_11:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
