	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pop_heap_head                  ## -- Begin function pop_heap_head
	.p2align	4, 0x90
_pop_heap_head:                         ## @pop_heap_head
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ev_heap_size@GOTPCREL(%rip), %r14
	movslq	(%r14), %r13
	xorl	%edi, %edi
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movq	_ev_heap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	cmpl	$1, (%rbx)
	sete	%dil
LBB0_4:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_assert
	movl	$0, (%rbx)
	decl	(%r14)
	je	LBB0_17
## %bb.5:
	movq	_ev_heap@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movq	(%rax,%r13,8), %r15
	movl	$1, %r12d
	cmpl	$3, %r13d
	jl	LBB0_16
## %bb.6:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	leal	-1(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$1, %r14d
	movl	$2, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jge	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rdx), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rdi
	movl	%ebx, %r12d
	orl	$1, %r12d
	movslq	%r12d, %rcx
	movq	(%rax,%rcx,8), %rsi
	callq	_cmp_ev
	testq	%rax, %rax
	jg	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %r12d
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	_ev_heap@GOTPCREL(%rip), %rdx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %r12d
LBB0_12:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rdx), %rax
	movslq	%r12d, %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	%r15, %r13
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%rdx, %r15
	callq	_cmp_ev
	testq	%rax, %rax
	jle	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r15), %rax
	movslq	%r14d, %rcx
	movq	%rbx, (%rax,%rcx,8)
	movl	%ecx, (%rbx)
	leal	(%r12,%r12), %ebx
	movl	%r12d, %r14d
	cmpl	-64(%rbp), %ebx                 ## 4-byte Folded Reload
	movq	%r15, %rdx
	movq	%r13, %r15
	jl	LBB0_7
	jmp	LBB0_15
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_13:
	movl	%r14d, %r12d
	movq	%r15, %rdx
	movq	%r13, %r15
LBB0_15:
	movq	(%rdx), %rax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_16:
	movslq	%r12d, %rcx
	movq	%r15, (%rax,%rcx,8)
	movl	%ecx, (%r15)
LBB0_17:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ev_heap_size,4,2               ## @ev_heap_size
	.comm	_ev_heap,8,3                    ## @ev_heap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pop_heap_head                  ; -- Begin function pop_heap_head
	.p2align	2
_pop_heap_head:                         ; @pop_heap_head
	.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
Lloh0:
	adrp	x20, _ev_heap_size@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ev_heap_size@GOTPAGEOFF]
	ldrsw	x23, [x20]
	cbz	w23, LBB0_3
; %bb.1:
Lloh2:
	adrp	x22, _ev_heap@GOTPAGE
Lloh3:
	ldr	x22, [x22, _ev_heap@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x19, [x8, #8]
	cbz	x19, LBB0_4
; %bb.2:
	ldr	w8, [x19]
	cmp	w8, #1
	cset	w0, eq
	b	LBB0_5
LBB0_3:
	mov	x19, #0
	b	LBB0_17
LBB0_4:
	mov	w0, #0
LBB0_5:
	bl	_assert
	str	wzr, [x19]
	ldr	w8, [x20]
	subs	w8, w8, #1
	str	w8, [x20]
	b.eq	LBB0_17
; %bb.6:
	ldr	x8, [x22]
	ldr	x20, [x8, x23, lsl #3]
	cmp	w23, #3
	b.lt	LBB0_13
; %bb.7:
	sub	w24, w23, #1
	mov	w25, #1
	mov	w21, #2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w21, w24
	b.ge	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x22]
	sxtw	x9, w21
	ldr	x0, [x8, w21, sxtw #3]
	orr	x26, x9, #0x1
	ldr	x1, [x8, x26, lsl #3]
	bl	_cmp_ev
	cmp	x0, #0
	csel	w26, w26, w21, gt
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x26, x21
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x22]
	ldr	x21, [x8, w26, sxtw #3]
	mov	x0, x20
	mov	x1, x21
	bl	_cmp_ev
	cmp	x0, #1
	b.lt	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x22]
	str	x21, [x8, w25, sxtw #3]
	str	w25, [x21]
	lsl	w21, w26, #1
	mov	x25, x26
	cmp	w21, w23
	b.lt	LBB0_8
	b	LBB0_15
LBB0_13:
	mov	w26, #1
	b	LBB0_16
LBB0_14:
	mov	x26, x25
LBB0_15:
	ldr	x8, [x22]
LBB0_16:
	str	x20, [x8, w26, sxtw #3]
	str	w26, [x20]
LBB0_17:
	mov	x0, x19
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_ev_heap_size,4,2               ; @ev_heap_size
	.comm	_ev_heap,8,3                    ; @ev_heap
.subsections_via_symbols
