	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trace_find_next_event          ## -- Begin function trace_find_next_event
	.p2align	4, 0x90
_trace_find_next_event:                 ## @trace_find_next_event
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.1:
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.4:
	movslq	_trace_find_next_event.idx(%rip), %rdx
	movl	(%rdi), %ecx
	cmpl	%ecx, %edx
	jge	LBB0_8
## %bb.5:
	cmpq	%rsi, (%rax,%rdx,8)
	je	LBB0_6
LBB0_8:
	movl	$1, %edx
	cmpl	$2, %ecx
	jl	LBB0_14
## %bb.9:
	movl	$1, %edx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, -8(%rax,%rdx,8)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_10
## %bb.13:
	movl	%ecx, %edx
LBB0_14:
	movl	%edx, _trace_find_next_event.idx(%rip)
LBB0_15:
	xorl	%eax, %eax
	popq	%rbp
	retq
LBB0_3:
	movl	$0, _trace_find_next_event.idx(%rip)
	movq	(%rax), %rax
	popq	%rbp
	retq
LBB0_11:
	movl	%edx, _trace_find_next_event.idx(%rip)
	movq	(%rax,%rdx,8), %rax
	popq	%rbp
	retq
LBB0_6:
	incl	%edx
	movl	%edx, _trace_find_next_event.idx(%rip)
	cmpl	%ecx, %edx
	je	LBB0_15
## %bb.7:
	movslq	%edx, %rcx
	movq	(%rax,%rcx,8), %rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_trace_find_next_event.idx,4,2 ## @trace_find_next_event.idx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trace_find_next_event          ; -- Begin function trace_find_next_event
	.p2align	2
_trace_find_next_event:                 ; @trace_find_next_event
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_12
; %bb.1:
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_15
; %bb.2:
	adrp	x9, _trace_find_next_event.idx@PAGE
	cbz	x1, LBB0_9
; %bb.3:
	ldrsw	x11, [x9, _trace_find_next_event.idx@PAGEOFF]
	ldr	w10, [x0]
	cmp	w11, w10
	b.ge	LBB0_5
; %bb.4:
	ldr	x12, [x8, x11, lsl #3]
	cmp	x12, x1
	b.eq	LBB0_14
LBB0_5:
	cmp	w10, #2
	b.lt	LBB0_10
; %bb.6:
	mov	x11, #0
	sub	x12, x10, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x8, x11, lsl #3]
	cmp	x13, x1
	b.eq	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x11, x11, #1
	cmp	x12, x11
	b.ne	LBB0_7
	b	LBB0_11
LBB0_9:
	str	wzr, [x9, _trace_find_next_event.idx@PAGEOFF]
	ldr	x0, [x8]
	ret
LBB0_10:
	mov	w10, #1
LBB0_11:
	mov	x0, #0
	str	w10, [x9, _trace_find_next_event.idx@PAGEOFF]
LBB0_12:
	ret
LBB0_13:
	add	w10, w11, #1
	str	w10, [x9, _trace_find_next_event.idx@PAGEOFF]
	add	x8, x8, x11, lsl #3
	ldr	x0, [x8, #8]
	ret
LBB0_14:
	add	w11, w11, #1
	str	w11, [x9, _trace_find_next_event.idx@PAGEOFF]
	cmp	w11, w10
	b.ne	LBB0_16
LBB0_15:
	mov	x0, #0
	ret
LBB0_16:
	ldr	x0, [x8, w11, sxtw #3]
	ret
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_trace_find_next_event.idx,4,2 ; @trace_find_next_event.idx
.subsections_via_symbols
