	.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
	movq	%rdi, %rbx
	movq	_GH_N@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_MAX_CLUSTER_SERVERS@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setb	%dil
	callq	_assert
	movq	(%rbx), %rdx
	movl	8(%rbx), %eax
	testq	%rdx, %rdx
	jle	LBB0_10
## %bb.1:
	cmpl	$4, %eax
	jl	LBB0_10
## %bb.2:
	cmpq	$0, 16(%rbx)
	je	LBB0_10
## %bb.3:
	shrl	$2, %eax
	decl	%eax
	movq	_Q_order@GOTPCREL(%rip), %rcx
	movq	_Q_DOUBLE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	setne	%cl
	movl	%eax, %r15d
	shrl	%cl, %r15d
	movq	_verbosity@GOTPCREL(%rip), %rcx
	cmpl	$3, (%rcx)
	jl	LBB0_5
## %bb.4:
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_fprintf
LBB0_5:
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.6:
	movq	_GH_total@GOTPCREL(%rip), %rax
	addl	%r15d, (%rax)
	movq	_GH_E@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	(%r12), %r14
	shlq	$5, %r14
	leaq	(%r14,%r13), %rax
	movl	%r15d, (%r13,%r14)
	movq	%rax, %r15
	movq	16(%rbx), %rax
	movq	%rax, 24(%r13,%r14)
	movl	12(%rbx), %ecx
	leal	3(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$2, %edx
	movslq	%edx, %rcx
	addq	%rcx, %rax
	incq	%rax
	movq	%rax, 16(%r13,%r14)
	movq	%r15, %rdi
	callq	_load_heap_v
	movq	(%r12), %rax
	incq	%rax
	movq	%rax, (%r12)
	cmpl	$2, %eax
	jl	LBB0_13
## %bb.7:
	movq	8(%r13,%r14), %rdx
	movq	_GH@GOTPCREL(%rip), %r8
	movl	%eax, %ecx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	shrl	%ecx
	movq	(%r8), %rdi
	movq	(%rdi,%rcx,8), %rbx
	cmpq	%rdx, 8(%rbx)
	jbe	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %esi
	movq	%rbx, (%rdi,%rsi,8)
	cmpl	$3, %eax
	movl	%ecx, %eax
	ja	LBB0_8
	jmp	LBB0_14
LBB0_10:
	movq	16(%rbx), %r8
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	movl	%eax, %ecx
	callq	_vkprintf
LBB0_11:
	xorl	%eax, %eax
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movl	%eax, %ecx
LBB0_14:
	movq	_GH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ecx, %rcx
	movq	%r15, (%rax,%rcx,8)
	movl	$1, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_GH_N,8,3                       ## @GH_N
	.comm	_MAX_CLUSTER_SERVERS,8,3        ## @MAX_CLUSTER_SERVERS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"num = %d, res_read = %d, data = %p\n"

	.comm	_Q_order,4,2                    ## @Q_order
	.comm	_Q_DOUBLE,4,2                   ## @Q_DOUBLE
	.comm	_verbosity,4,2                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"gather_heap_insert: %d elements (size %d)\n"

	.comm	_GH_total,4,2                   ## @GH_total
	.comm	_GH_E,8,3                       ## @GH_E
	.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:
	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, x0
Lloh0:
	adrp	x22, _GH_N@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GH_N@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh2:
	adrp	x9, _MAX_CLUSTER_SERVERS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_CLUSTER_SERVERS@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, lo
	bl	_assert
	ldr	x2, [x19]
	ldr	w3, [x19, #8]
	cmp	x2, #1
	ccmp	w3, #4, #8, ge
	b.lt	LBB0_9
; %bb.1:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_9
; %bb.2:
	lsr	w8, w3, #2
Lloh5:
	adrp	x9, _Q_order@GOTPAGE
Lloh6:
	ldr	x9, [x9, _Q_order@GOTPAGEOFF]
	sub	w3, w8, #1
Lloh7:
	ldr	w8, [x9]
Lloh8:
	adrp	x9, _Q_DOUBLE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _Q_DOUBLE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
	lsr	w21, w3, w8
Lloh11:
	adrp	x8, _verbosity@GOTPAGE
Lloh12:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w8, #3
	b.lt	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_fprintf
LBB0_4:
	cbz	w21, LBB0_10
; %bb.5:
Lloh19:
	adrp	x8, _GH_total@GOTPAGE
Lloh20:
	ldr	x8, [x8, _GH_total@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w21
	str	w9, [x8]
Lloh21:
	adrp	x8, _GH_E@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GH_E@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ldr	x9, [x22]
	add	x20, x8, x9, lsl #5
	str	w21, [x20]
	ldr	x8, [x19, #16]
	ldr	w9, [x19, #12]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	add	x9, x8, w9, sxtw
	add	x9, x9, #1
	stp	x9, x8, [x20, #16]
	mov	x0, x20
	bl	_load_heap_v
	ldr	x8, [x22]
	add	x9, x8, #1
	str	x9, [x22]
Lloh24:
	adrp	x8, _GH@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GH@GOTPAGEOFF]
	cmp	w9, #2
	b.lt	LBB0_12
; %bb.6:
	ldr	x11, [x20, #8]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w10, w9, #1
	ldr	x12, [x8]
	ldr	x13, [x12, w10, uxtw #3]
	ldr	x14, [x13, #8]
	cmp	x14, x11
	b.ls	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	str	x13, [x12, w9, uxtw #3]
	cmp	w9, #3
	mov	x9, x10
	b.hi	LBB0_7
	b	LBB0_13
LBB0_9:
	ldr	x4, [x19, #16]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	bl	_vkprintf
LBB0_10:
	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
LBB0_12:
	mov	x10, x9
LBB0_13:
	ldr	x8, [x8]
	str	x20, [x8, w10, sxtw #3]
	mov	w0, #1
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GH_N,8,3                       ; @GH_N
	.comm	_MAX_CLUSTER_SERVERS,8,3        ; @MAX_CLUSTER_SERVERS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"num = %d, res_read = %d, data = %p\n"

	.comm	_Q_order,4,2                    ; @Q_order
	.comm	_Q_DOUBLE,4,2                   ; @Q_DOUBLE
	.comm	_verbosity,4,2                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"gather_heap_insert: %d elements (size %d)\n"

	.comm	_GH_total,4,2                   ; @GH_total
	.comm	_GH_E,8,3                       ; @GH_E
	.comm	_GH,8,3                         ; @GH
	.no_dead_strip	_gather_heap_insert
.subsections_via_symbols
