	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_put_event_into_heap            ## -- Begin function put_event_into_heap
	.p2align	4, 0x90
_put_event_into_heap:                   ## @put_event_into_heap
	.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, %r14
	movslq	(%rdi), %rax
	testl	%eax, %eax
	setns	%cl
	movq	_MAX_EVENTS@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	setl	%dl
	andb	%cl, %dl
	movq	_Events@GOTPCREL(%rip), %rcx
	shlq	$3, %rax
	addq	(%rcx), %rax
	cmpq	%rdi, %rax
	sete	%al
	andb	%dl, %al
	movzbl	%al, %edi
	callq	_assert
	cmpl	$0, 4(%r14)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_remove_event_from_heap
	movl	%eax, %r15d
	jmp	LBB0_3
LBB0_2:
	movq	_ev_heap_size@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	incl	%r15d
	movl	%r15d, (%rax)
LBB0_3:
	xorl	%edi, %edi
	cmpl	(%rbx), %r15d
	setle	%dil
	callq	_assert
	cmpl	$2, %r15d
	jl	LBB0_8
## %bb.4:
	movq	_ev_heap@GOTPCREL(%rip), %r13
	movl	%r15d, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	shrl	%r12d
	movq	(%r13), %rax
	movq	(%rax,%r12,8), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_cmp_ev
	testq	%rax, %rax
	jle	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r13), %rax
	movl	%r15d, %ecx
	movq	%rbx, (%rax,%rcx,8)
	movl	%r15d, 4(%rbx)
	cmpl	$3, %r15d
	movl	%r12d, %r15d
	ja	LBB0_5
	jmp	LBB0_9
LBB0_8:
	movl	%r15d, %r12d
LBB0_9:
	movq	_ev_heap@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	%r12d, %rax
	movq	%r14, (%rcx,%rax,8)
	movl	%eax, 4(%r14)
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EVENTS,4,2                 ## @MAX_EVENTS
	.comm	_Events,8,3                     ## @Events
	.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	_put_event_into_heap            ; -- Begin function put_event_into_heap
	.p2align	2
_put_event_into_heap:                   ; @put_event_into_heap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	ldrsw	x8, [x0]
	cmp	w8, #0
Lloh0:
	adrp	x21, _MAX_EVENTS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MAX_EVENTS@GOTPAGEOFF]
	ldr	w9, [x21]
	ccmp	w8, w9, #0, ge
Lloh2:
	adrp	x9, _Events@GOTPAGE
Lloh3:
	ldr	x9, [x9, _Events@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x8, x9, x8, lsl #3
	ccmp	x8, x0, #0, lt
	cset	w0, eq
	bl	_assert
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	w1, #1
	bl	_remove_event_from_heap
	mov	x20, x0
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _ev_heap_size@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ev_heap_size@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w20, w9, #1
	str	w20, [x8]
LBB0_3:
	ldr	w8, [x21]
	cmp	w20, w8
	cset	w0, le
	bl	_assert
Lloh7:
	adrp	x23, _ev_heap@GOTPAGE
Lloh8:
	ldr	x23, [x23, _ev_heap@GOTPAGEOFF]
	cmp	w20, #2
	b.lt	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w21, w20, #1
	ldr	x8, [x23]
	ldr	x22, [x8, w21, uxtw #3]
	mov	x0, x22
	mov	x1, x19
	bl	_cmp_ev
	cmp	x0, #1
	b.lt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23]
	str	x22, [x8, w20, uxtw #3]
	str	w20, [x22, #4]
	cmp	w20, #3
	mov	x20, x21
	b.hi	LBB0_4
	b	LBB0_7
LBB0_6:
	mov	x21, x20
LBB0_7:
	ldr	x8, [x23]
	str	x19, [x8, w21, sxtw #3]
	str	w21, [x19, #4]
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EVENTS,4,2                 ; @MAX_EVENTS
	.comm	_Events,8,3                     ; @Events
	.comm	_ev_heap_size,4,2               ; @ev_heap_size
	.comm	_ev_heap,8,3                    ; @ev_heap
.subsections_via_symbols
