	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gather_heap_insert
_gather_heap_insert:                    ## @gather_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
	movl	%esi, %edx
	cmpl	$15, %esi
	jg	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
                                        ## kill: def $edx killed $edx killed $rdx
LBB0_2:
	xorl	%eax, %eax
	callq	_vkprintf
	movl	$-1, %ebx
	jmp	LBB0_4
LBB0_3:
	movl	(%rdi), %ecx
	movq	_TL_MAYBE_FALSE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpl	(%rax), %ecx
	jne	LBB0_5
LBB0_4:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_TL_MAYBE_TRUE@GOTPCREL(%rip), %rsi
	xorl	%eax, %eax
	cmpl	(%rsi), %ecx
	leal	-4(%rdx), %r8d
	sete	%al
	cmovnel	%edx, %r8d
	movl	(%rdi,%rax,4), %edx
	movq	_TL_VECTOR_TOTAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_12
## %bb.6:
	leaq	(%rdi,%rax,4), %r12
	movq	_GH_E@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_GH_N@GOTPCREL(%rip), %rdx
	movl	4(%r12), %eax
	movq	_GH_total@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	movq	(%rdx), %rax
	leaq	(%rax,%rax,2), %r13
	movl	8(%r12), %ecx
	movl	%ecx, (%r15,%r13,8)
	movq	_GH_mode@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	andb	$8, %al
	xorl	%ebx, %ebx
	cmpb	$1, %al
	movl	$0, %edx
	adcl	$1, %edx
	movl	%ecx, %eax
	imull	%edx, %eax
	leal	12(,%rax,4), %eax
	cmpl	%r8d, %eax
	jne	LBB0_13
## %bb.7:
	leaq	(%r15,%r13,8), %r14
	addl	$-12, %r8d
	leaq	L_.str.3(%rip), %rsi
	movl	$4, %edi
	movl	%ecx, %edx
	movl	%r8d, %ecx
	xorl	%eax, %eax
	callq	_vkprintf
	cmpl	$0, (%r14)
	je	LBB0_4
## %bb.8:
	addq	$12, %r12
	movq	%r12, 8(%r15,%r13,8)
	movq	%r14, %rdi
	callq	_load_heap_v
	movq	_GH_N@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	incq	%rax
	movq	%rax, (%rcx)
	cmpl	$2, %eax
	jl	LBB0_15
## %bb.9:
	movq	16(%r15,%r13,8), %rdx
	movq	_GH@GOTPCREL(%rip), %r8
	movl	%eax, %ecx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	shrl	%ecx
	movq	(%r8), %rdi
	movq	(%rdi,%rcx,8), %rbx
	cmpq	%rdx, 16(%rbx)
	jbe	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %esi
	movq	%rbx, (%rdi,%rsi,8)
	cmpl	$3, %eax
	movl	%ecx, %eax
	ja	LBB0_10
	jmp	LBB0_16
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	jmp	LBB0_2
LBB0_13:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_vkprintf
	movl	$-1, %ebx
	jmp	LBB0_4
LBB0_15:
	movl	%eax, %ecx
LBB0_16:
	movq	_GH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ecx, %rcx
	movq	%r14, (%rax,%rcx,8)
	movl	$1, %ebx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad result: bytes = %d\n"

	.comm	_TL_MAYBE_FALSE,4,2             ## @TL_MAYBE_FALSE
	.comm	_TL_MAYBE_TRUE,4,2              ## @TL_MAYBE_TRUE
	.comm	_TL_VECTOR_TOTAL,4,2            ## @TL_VECTOR_TOTAL
L_.str.1:                               ## @.str.1
	.asciz	"Bad result: data = %d\n"

	.comm	_GH_E,8,3                       ## @GH_E
	.comm	_GH_N,8,3                       ## @GH_N
	.comm	_GH_total,4,2                   ## @GH_total
	.comm	_GH_mode,4,2                    ## @GH_mode
L_.str.2:                               ## @.str.2
	.asciz	"Bad result: size = %d, H->remaining = %d, bytes = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"gather_heap_insert: %d elements (size %d)\n"

	.comm	_GH,8,3                         ## @GH
	.no_dead_strip	_gather_heap_insert
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gather_heap_insert
_gather_heap_insert:                    ; @gather_heap_insert
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x2, x1
	cmp	w1, #15
	b.gt	LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	w0, #2
LBB0_3:
	bl	_vkprintf
	mov	w0, #-1
	b	LBB0_6
LBB0_4:
	ldr	w8, [x0]
Lloh2:
	adrp	x9, _TL_MAYBE_FALSE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TL_MAYBE_FALSE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
LBB0_5:
	mov	w0, #0
LBB0_6:
	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
	add	sp, sp, #80
	ret
LBB0_7:
Lloh5:
	adrp	x9, _TL_MAYBE_TRUE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TL_MAYBE_TRUE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	sub	w10, w2, #4
	cmp	w8, w9
	csel	w9, w10, w2, eq
	cset	w8, eq
	add	x21, x0, w8, uxtw #2
	ldr	w2, [x21]
Lloh8:
	adrp	x8, _TL_VECTOR_TOTAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TL_VECTOR_TOTAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_14
; %bb.8:
Lloh11:
	adrp	x8, _GH_E@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GH_E@GOTPAGEOFF]
Lloh13:
	ldr	x22, [x8]
Lloh14:
	adrp	x20, _GH_N@GOTPAGE
Lloh15:
	ldr	x20, [x20, _GH_N@GOTPAGEOFF]
	ldr	x23, [x20]
	mov	w8, #24
	madd	x19, x23, x8, x22
	ldr	w8, [x21, #4]
Lloh16:
	adrp	x10, _GH_total@GOTPAGE
Lloh17:
	ldr	x10, [x10, _GH_total@GOTPAGEOFF]
	ldr	w11, [x10]
	add	w8, w11, w8
	str	w8, [x10]
	ldr	w2, [x21, #8]
	str	w2, [x19]
Lloh18:
	adrp	x8, _GH_mode@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GH_mode@GOTPAGEOFF]
	ldrb	w8, [x8]
	tst	w8, #0x8
	mov	w8, #1
	cinc	w8, w8, eq
	mul	w10, w2, w8
	lsl	w10, w10, #2
	add	w10, w10, #12
	cmp	w10, w9
	b.ne	LBB0_15
; %bb.9:
	sub	w8, w9, #12
	str	x8, [sp]
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #4
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_vkprintf
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.10:
	add	x8, x21, #12
	mov	w9, #24
	madd	x21, x23, x9, x22
	str	x8, [x21, #8]
	mov	x0, x19
	bl	_load_heap_v
	ldr	x8, [x20]
	add	x9, x8, #1
	str	x9, [x20]
Lloh22:
	adrp	x8, _GH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GH@GOTPAGEOFF]
	cmp	w9, #2
	b.lt	LBB0_16
; %bb.11:
	ldr	x11, [x21, #16]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsr	w10, w9, #1
	ldr	x12, [x8]
	ldr	x13, [x12, w10, uxtw #3]
	ldr	x14, [x13, #16]
	cmp	x14, x11
	b.ls	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	str	x13, [x12, w9, uxtw #3]
	cmp	w9, #3
	mov	x9, x10
	b.hi	LBB0_12
	b	LBB0_17
LBB0_14:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_15:
	stp	x2, x9, [sp]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	mov	x2, x8
	b	LBB0_3
LBB0_16:
	mov	x10, x9
LBB0_17:
	ldr	x8, [x8]
	str	x19, [x8, w10, sxtw #3]
	mov	w0, #1
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad result: bytes = %d\n"

	.comm	_TL_MAYBE_FALSE,4,2             ; @TL_MAYBE_FALSE
	.comm	_TL_MAYBE_TRUE,4,2              ; @TL_MAYBE_TRUE
	.comm	_TL_VECTOR_TOTAL,4,2            ; @TL_VECTOR_TOTAL
l_.str.1:                               ; @.str.1
	.asciz	"Bad result: data = %d\n"

	.comm	_GH_E,8,3                       ; @GH_E
	.comm	_GH_N,8,3                       ; @GH_N
	.comm	_GH_total,4,2                   ; @GH_total
	.comm	_GH_mode,4,2                    ; @GH_mode
l_.str.2:                               ; @.str.2
	.asciz	"Bad result: size = %d, H->remaining = %d, bytes = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"gather_heap_insert: %d elements (size %d)\n"

	.comm	_GH,8,3                         ; @GH
	.no_dead_strip	_gather_heap_insert
.subsections_via_symbols
