	.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, %r8d
	cmpl	$15, %esi
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movl	%r8d, %edx
	jmp	LBB0_6
LBB0_2:
	movq	%rdi, %r15
	movl	(%rdi), %edx
	movq	_TL_SEARCH_RESULT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_5
## %bb.3:
	movq	_GH_E@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	_GH_N@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %r13
	movl	4(%r15), %edx
	movl	%edx, (%r12,%r13,8)
	leal	-3(%rdx), %eax
	cmpl	$-3, %eax
	ja	LBB0_9
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
LBB0_6:
	xorl	%eax, %eax
	callq	_vkprintf
LBB0_7:
	movl	$-1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	(%r12,%r13,8), %rdi
	movl	8(%r15), %eax
	movq	_GH_total@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	movl	12(%r15), %ecx
	movl	%ecx, 4(%r12,%r13,8)
	movl	(%rdi), %eax
	movq	_GH_mode@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_FLAG_SORT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%edx, %esi
	cmpl	$1, %esi
	movl	%eax, %esi
	sbbl	$-1, %esi
	movq	_FLAG_GROUP_HASH@GOTPCREL(%rip), %r9
	xorl	%ebx, %ebx
	testl	%edx, (%r9)
	setne	%bl
	leal	(%rsi,%rbx,2), %edx
	movl	%ecx, %esi
	imull	%edx, %esi
	leal	16(,%rsi,4), %esi
	cmpl	%r8d, %esi
	jne	LBB0_17
## %bb.10:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	leaq	(%r12,%r13,8), %r14
	addq	$4, %r14
	movq	_GH_n@GOTPCREL(%rip), %rdx
	cmpl	%eax, (%rdx)
	jge	LBB0_12
## %bb.11:
	movl	%eax, (%rdx)
	movl	(%r14), %ecx
LBB0_12:
	addl	$-16, %r8d
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$4, %edi
	movl	%ecx, %edx
	movl	%r8d, %ecx
	xorl	%eax, %eax
	callq	_vkprintf
	cmpl	$0, (%r14)
	je	LBB0_8
## %bb.13:
	addq	$16, %r15
	movq	%r15, 8(%r12,%r13,8)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	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_19
## %bb.14:
	movq	16(%r12,%r13,8), %rdx
	movq	_GH@GOTPCREL(%rip), %r8
	movl	%eax, %ecx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	shrl	%ecx
	movq	(%r8), %rdi
	movq	(%rdi,%rcx,8), %rbx
	cmpq	%rdx, 16(%rbx)
	jbe	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%eax, %esi
	movq	%rbx, (%rdi,%rsi,8)
	cmpl	$3, %eax
	movl	%ecx, %eax
	ja	LBB0_15
	jmp	LBB0_20
LBB0_17:
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_vkprintf
	jmp	LBB0_7
LBB0_19:
	movl	%eax, %ecx
LBB0_20:
	movq	_GH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ecx, %rcx
	movq	%r14, (%rax,%rcx,8)
	movl	$1, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad result: bytes = %d\n"

	.comm	_TL_SEARCH_RESULT,4,2           ## @TL_SEARCH_RESULT
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
L_.str.2:                               ## @.str.2
	.asciz	"Bad result: H->n = %d\n"

	.comm	_GH_total,4,2                   ## @GH_total
	.comm	_GH_mode,4,2                    ## @GH_mode
	.comm	_FLAG_SORT,4,2                  ## @FLAG_SORT
	.comm	_FLAG_GROUP_HASH,4,2            ## @FLAG_GROUP_HASH
L_.str.3:                               ## @.str.3
	.asciz	"Bad result: size = %d, H->remaining = %d, bytes = %d\n"

	.comm	_GH_n,4,2                       ## @GH_n
L_.str.4:                               ## @.str.4
	.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	x8, x1
	cmp	w1, #15
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	mov	x2, x8
	b	LBB0_7
LBB0_2:
	mov	x20, x0
	ldr	w2, [x0]
Lloh2:
	adrp	x9, _TL_SEARCH_RESULT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TL_SEARCH_RESULT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w2, w9
	b.ne	LBB0_5
; %bb.3:
Lloh5:
	adrp	x9, _GH_E@GOTPAGE
Lloh6:
	ldr	x9, [x9, _GH_E@GOTPAGEOFF]
Lloh7:
	ldr	x22, [x9]
Lloh8:
	adrp	x21, _GH_N@GOTPAGE
Lloh9:
	ldr	x21, [x21, _GH_N@GOTPAGEOFF]
	ldr	x23, [x21]
	mov	w9, #24
	madd	x19, x23, x9, x22
	ldr	w2, [x20, #4]
	str	w2, [x19]
	sub	w9, w2, #3
	cmn	w9, #3
	b.hi	LBB0_9
; %bb.4:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	w0, #2
LBB0_7:
	bl	_vkprintf
	mov	w0, #-1
LBB0_8:
	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_9:
Lloh14:
	adrp	x9, _GH_total@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GH_total@GOTPAGEOFF]
	ldr	w10, [x9]
	ldp	w11, w2, [x20, #8]
	add	w10, w10, w11
	str	w10, [x9]
	mov	w9, #24
	madd	x24, x23, x9, x22
	str	w2, [x24, #4]!
	ldr	w10, [x19]
Lloh16:
	adrp	x9, _GH_mode@GOTPAGE
Lloh17:
	ldr	x9, [x9, _GH_mode@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x11, _FLAG_SORT@GOTPAGE
Lloh20:
	ldr	x11, [x11, _FLAG_SORT@GOTPAGEOFF]
Lloh21:
	ldr	w11, [x11]
	tst	w11, w9
	cinc	w11, w10, ne
Lloh22:
	adrp	x12, _FLAG_GROUP_HASH@GOTPAGE
Lloh23:
	ldr	x12, [x12, _FLAG_GROUP_HASH@GOTPAGEOFF]
Lloh24:
	ldr	w12, [x12]
	tst	w12, w9
	cset	w9, ne
	add	w9, w11, w9, lsl #1
	mul	w11, w2, w9
	lsl	w11, w11, #2
	add	w11, w11, #16
	cmp	w11, w8
	b.ne	LBB0_17
; %bb.10:
Lloh25:
	adrp	x9, _GH_n@GOTPAGE
Lloh26:
	ldr	x9, [x9, _GH_n@GOTPAGEOFF]
	ldr	w11, [x9]
	cmp	w11, w10
	b.ge	LBB0_12
; %bb.11:
	str	w10, [x9]
	ldr	w2, [x24]
LBB0_12:
	sub	w8, w8, #16
	str	x8, [sp]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #4
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_vkprintf
	ldr	w8, [x24]
	cbz	w8, LBB0_20
; %bb.13:
	add	x8, x20, #16
	mov	w9, #24
	madd	x20, x23, x9, x22
	str	x8, [x20, #8]
	mov	x0, x19
	bl	_load_heap_v
	ldr	x8, [x21]
	add	x9, x8, #1
	str	x9, [x21]
Lloh29:
	adrp	x8, _GH@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GH@GOTPAGEOFF]
	cmp	w9, #2
	b.lt	LBB0_18
; %bb.14:
	ldr	x11, [x20, #16]
LBB0_15:                                ; =>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_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	str	x13, [x12, w9, uxtw #3]
	cmp	w9, #3
	mov	x9, x10
	b.hi	LBB0_15
	b	LBB0_19
LBB0_17:
	stp	x2, x8, [sp]
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	mov	x2, x9
	b	LBB0_7
LBB0_18:
	mov	x10, x9
LBB0_19:
	ldr	x8, [x8]
	str	x19, [x8, w10, sxtw #3]
	mov	w0, #1
	b	LBB0_8
LBB0_20:
	mov	w0, #0
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad result: bytes = %d\n"

	.comm	_TL_SEARCH_RESULT,4,2           ; @TL_SEARCH_RESULT
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
l_.str.2:                               ; @.str.2
	.asciz	"Bad result: H->n = %d\n"

	.comm	_GH_total,4,2                   ; @GH_total
	.comm	_GH_mode,4,2                    ; @GH_mode
	.comm	_FLAG_SORT,4,2                  ; @FLAG_SORT
	.comm	_FLAG_GROUP_HASH,4,2            ; @FLAG_GROUP_HASH
l_.str.3:                               ; @.str.3
	.asciz	"Bad result: size = %d, H->remaining = %d, bytes = %d\n"

	.comm	_GH_n,4,2                       ; @GH_n
l_.str.4:                               ; @.str.4
	.asciz	"gather_heap_insert: %d elements (size %d)\n"

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