	.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
	xorl	%r14d, %r14d
	cmpq	$0, (%rbx)
	jle	LBB0_13
## %bb.1:
	movl	8(%rbx), %r13d
	cmpl	$8, %r13d
	jl	LBB0_13
## %bb.2:
	cmpq	$0, 16(%rbx)
	je	LBB0_13
## %bb.3:
	movl	%r13d, %eax
	movl	$2863311531, %r15d              ## imm = 0xAAAAAAAB
	imulq	%rax, %r15
	shrq	$36, %r15
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpl	$3, (%rax)
	jl	LBB0_5
## %bb.4:
	movl	%r13d, %ecx
	shrl	$2, %ecx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	decl	%ecx
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_fprintf
LBB0_5:
	cmpl	$24, %r13d
	jb	LBB0_13
## %bb.6:
	movq	_GH_total@GOTPCREL(%rip), %rax
	addl	%r15d, (%rax)
	movq	_GH_E@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	(%r12), %rax
	leaq	(%rax,%rax,2), %r14
	leaq	(%rdx,%r14,8), %rdi
	movl	%r15d, (%rdx,%r14,8)
	movq	16(%rbx), %rax
	movq	%rax, 16(%rdx,%r14,8)
	movl	12(%rbx), %ecx
	movq	%rdx, %rbx
	leal	3(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$2, %edx
	movslq	%edx, %rcx
	addq	%rcx, %rax
	incq	%rax
	movq	%rax, 8(%rbx,%r14,8)
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_load_heap_v
	movq	(%r12), %r13
	incq	%r13
	movq	%r13, (%r12)
	cmpl	$2, %r13d
	jl	LBB0_7
## %bb.8:
	movl	4(%rbx,%r14,8), %r15d
	movq	_GH@GOTPCREL(%rip), %r14
	movl	%r13d, %ebx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	shrl	%ebx
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movl	4(%rax), %edi
	movl	%r15d, %esi
	callq	_news_id_compare
	testq	%rax, %rax
	jle	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rcx
	movl	%r13d, %edx
	movq	%rcx, (%rax,%rdx,8)
	cmpl	$3, %r13d
	movl	%ebx, %r13d
	ja	LBB0_9
	jmp	LBB0_12
LBB0_7:
	movl	%r13d, %ebx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_10:
	movl	%r13d, %ebx
LBB0_12:
	movq	_GH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movq	%r12, (%rax,%rcx,8)
	movl	$1, %r14d
LBB0_13:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GH_N,8,3                       ## @GH_N
	.comm	_MAX_CLUSTER_SERVERS,8,3        ## @MAX_CLUSTER_SERVERS
	.comm	_verbosity,4,2                  ## @verbosity
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.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	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, 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	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.1:
	ldr	w19, [x20, #8]
	cmp	w19, #8
	b.lt	LBB0_6
; %bb.2:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_6
; %bb.3:
	mov	w8, #43691
	movk	w8, #43690, lsl #16
	umull	x8, w19, w8
	lsr	x21, x8, #36
Lloh5:
	adrp	x8, _verbosity@GOTPAGE
Lloh6:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, #3
	b.lt	LBB0_5
; %bb.4:
	lsr	w8, w19, #2
Lloh8:
	adrp	x9, _stderr@GOTPAGE
Lloh9:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x9]
	sub	w3, w8, #1
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_fprintf
LBB0_5:
	cmp	w19, #24
	b.hs	LBB0_8
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh13:
	adrp	x8, _GH_total@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GH_total@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w21
	str	w9, [x8]
Lloh15:
	adrp	x8, _GH_E@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GH_E@GOTPAGEOFF]
Lloh17:
	ldr	x24, [x8]
	ldr	x25, [x22]
	mov	w8, #24
	madd	x19, x25, x8, x24
	str	w21, [x19]
	ldr	x8, [x20, #16]
	ldr	w9, [x20, #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, [x19, #8]
	mov	x0, x19
	bl	_load_heap_v
	ldr	x8, [x22]
	add	x23, x8, #1
	str	x23, [x22]
Lloh18:
	adrp	x21, _GH@GOTPAGE
Lloh19:
	ldr	x21, [x21, _GH@GOTPAGEOFF]
	cmp	w23, #2
	b.lt	LBB0_12
; %bb.9:
	mov	w8, #24
	madd	x8, x25, x8, x24
	ldr	w20, [x8, #4]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	lsr	w22, w23, #1
	ldr	x8, [x21]
	ldr	x8, [x8, w22, uxtw #3]
	ldr	w0, [x8, #4]
	mov	x1, x20
	bl	_news_id_compare
	cmp	x0, #1
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x21]
	ldr	x9, [x8, x22, lsl #3]
	str	x9, [x8, w23, uxtw #3]
	cmp	w23, #3
	mov	x23, x22
	b.hi	LBB0_10
	b	LBB0_13
LBB0_12:
	mov	x22, x23
LBB0_13:
	ldr	x8, [x21]
	str	x19, [x8, w22, sxtw #3]
	mov	w0, #1
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GH_N,8,3                       ; @GH_N
	.comm	_MAX_CLUSTER_SERVERS,8,3        ; @MAX_CLUSTER_SERVERS
	.comm	_verbosity,4,2                  ; @verbosity
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.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
