	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_event
_add_event:                             ## @add_event
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %rdi
	movl	(%r15), %eax
	leal	8(,%rax,8), %esi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, 8(%r15)
	movl	(%r15), %r9d
	testl	%r9d, %r9d
	jle	LBB0_3
## %bb.4:
	movq	(%r14), %rdi
	leal	-1(%r9), %r8d
	incq	%r8
	leal	(,%r9,8), %edx
	xorl	%ebx, %ebx
	movq	%rax, %rsi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rcx
	cmpq	%rdi, (%rcx)
	jg	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	addq	$8, %rsi
	addl	$-8, %edx
	cmpq	%rbx, %r9
	jne	LBB0_5
## %bb.7:
	movq	%r8, %rbx
	jmp	LBB0_8
LBB0_1:
	movl	$-1, %eax
	jmp	LBB0_9
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_10:
	leaq	8(%rsi), %rdi
	callq	_memmove
	movq	8(%r15), %rax
	movl	(%r15), %r9d
LBB0_8:
	movl	%ebx, %ecx
	movq	%r14, (%rax,%rcx,8)
	incl	%r9d
	movl	%r9d, (%r15)
	movq	%r15, 8(%r14)
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_add_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_event
_add_event:                             ; @add_event
	.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, x1
	mov	x20, x0
	ldr	x0, [x0, #8]
	ldr	w8, [x20]
	lsl	w8, w8, #3
	add	w1, w8, #8
	bl	_realloc
	cbz	x0, LBB0_6
; %bb.1:
	str	x0, [x20, #8]
	ldr	w9, [x20]
	cmp	w9, #0
	b.le	LBB0_7
; %bb.2:
	mov	x21, #0
	ldr	x10, [x19]
	sub	w8, w9, #1
	add	x8, x8, #1
	lsl	w2, w9, #3
	mov	x1, x0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x1]
	ldr	x11, [x11]
	cmp	x11, x10
	b.gt	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x21, #1
	add	x1, x1, #8
	sub	w2, w2, #8
	cmp	x9, x21
	b.ne	LBB0_3
; %bb.5:
	mov	x21, x8
	b	LBB0_9
LBB0_6:
	mov	w8, #-1
	b	LBB0_10
LBB0_7:
	mov	x21, #0
	b	LBB0_9
LBB0_8:
	add	x0, x1, #8
	bl	_memmove
	ldr	x0, [x20, #8]
	ldr	w9, [x20]
LBB0_9:
	mov	w8, #0
	str	x19, [x0, w21, uxtw #3]
	add	w9, w9, #1
	str	w9, [x20]
	str	x20, [x19, #8]
LBB0_10:
	mov	x0, x8
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_add_event
.subsections_via_symbols
