	.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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	_HN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	___vsort_limit@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	_H@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$8, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_heap_cmp
	testq	%rax, %rax
	js	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_4:
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_heap_sift_up
	jmp	LBB0_5
LBB0_3:
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_heap_sift_down
LBB0_5:
	movq	_H@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%eax, %rdx
	leaq	(%rcx,%rdx,8), %rax
	movl	%ebx, 4(%rcx,%rdx,8)
	movl	%r14d, (%rcx,%rdx,8)
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HN,8,3                         ## @HN
	.comm	___vsort_limit,8,3              ## @__vsort_limit
	.comm	_H,8,3                          ## @H
.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _HN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, ___vsort_limit@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___vsort_limit@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x21, _H@GOTPAGE
Lloh7:
	ldr	x21, [x21, _H@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x21]
	add	x0, x8, #8
	mov	x1, x20
	mov	x2, x19
	bl	_heap_cmp
	tbnz	x0, #63, LBB0_4
; %bb.2:
	mov	x0, #0
	b	LBB0_6
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	bl	_heap_sift_up
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	bl	_heap_sift_down
LBB0_5:
	ldr	x8, [x21]
	add	x0, x8, w0, sxtw #3
	stp	w19, w20, [x0]
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_HN,8,3                         ; @HN
	.comm	___vsort_limit,8,3              ; @__vsort_limit
	.comm	_H,8,3                          ; @H
.subsections_via_symbols
