	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_schedule_events            ## -- Begin function x86_schedule_events
	.p2align	4, 0x90
_x86_schedule_events:                   ## @x86_schedule_events
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_X86_PMC_IDX_MAX@GOTPCREL(%rip), %r14
	movl	(%r14), %ebx
	movq	%rbx, %rax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_BITS_TO_LONGS
	movl	%eax, %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movl	(%r14), %esi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_bitmap_zero
	movl	(%r14), %ebx
	movl	%r12d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_1
## %bb.2:
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%r12,8), %rsi
	movq	%r13, %rdi
	movq	_x86_pmu@GOTPCREL(%rip), %rax
	callq	*8(%rax)
	movq	%rax, %r14
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r14, (%rax,%r12,8)
	movl	8(%r14), %esi
	movl	%ebx, %edi
	callq	_min
	movl	%eax, %ebx
	movl	8(%r14), %esi
	movl	%r15d, %edi
	callq	_max
	movl	%eax, %r15d
	incq	%r12
	cmpq	%r12, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_3
## %bb.4:
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%r14, %rcx
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%r14,8), %r12
	movl	(%r12), %edi
	cmpl	$-1, %edi
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r14,8), %rax
	movq	(%rax), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r12), %edi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r12), %edi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	___set_bit
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r12), %eax
	movl	%eax, (%rcx,%r14,4)
	jmp	LBB0_10
LBB0_12:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_13
LBB0_1:
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
LBB0_13:
	cmpl	%r12d, %r14d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_15
## %bb.14:
	xorl	%r14d, %r14d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_15:
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_perf_assign_events
	testl	%eax, %eax
	setne	%r14b
LBB0_16:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
LBB0_17:
	testq	%rbx, %rbx
	sete	%al
	orb	%r14b, %al
	cmpb	$1, %al
	jne	LBB0_23
## %bb.18:
	testl	%r12d, %r12d
	jle	LBB0_23
## %bb.19:
	xorl	%ebx, %ebx
	movq	_x86_pmu@GOTPCREL(%rip), %r15
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_20 Depth=1
	incq	%rbx
	cmpq	%rbx, %rcx
	je	LBB0_23
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	(%r13), %rcx
	movq	(%rcx,%rbx,8), %rsi
	movq	%r13, %rdi
	callq	*%rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_23:
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	xorl	%ecx, %ecx
	testb	%r14b, %r14b
	cmovel	%ecx, %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_25
## %bb.24:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%r14d, %r14d
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_X86_PMC_IDX_MAX,4,2            ## @X86_PMC_IDX_MAX
	.comm	_x86_pmu,16,3                   ## @x86_pmu
	.comm	_ENOSPC,4,2                     ## @ENOSPC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_schedule_events            ; -- Begin function x86_schedule_events
	.p2align	2
_x86_schedule_events:                   ; @x86_schedule_events
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x21, x2
	mov	x28, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x20, _X86_PMC_IDX_MAX@GOTPAGE
Lloh4:
	ldr	x20, [x20, _X86_PMC_IDX_MAX@GOTPAGEOFF]
	ldr	w0, [x20]
	lsl	x8, x0, #3
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x22, x9, x8
	mov	sp, x22
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_BITS_TO_LONGS
	mov	w8, w0
	lsl	x8, x8, #3
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x25, x9, x8
	mov	sp, x25
	ldr	w1, [x20]
	mov	x0, x25
	bl	_bitmap_zero
	ldr	w23, [x20]
	mov	w8, w28
Lloh9:
	adrp	x27, _x86_pmu@GOTPAGE
Lloh10:
	ldr	x27, [x27, _x86_pmu@GOTPAGEOFF]
	cmp	w28, #1
	stur	x8, [x29, #-96]                 ; 8-byte Folded Spill
	b.lt	LBB0_10
; %bb.1:
	stur	w28, [x29, #-100]               ; 4-byte Folded Spill
	mov	x20, #0
	mov	w24, #0
	lsl	x28, x8, #3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27, #8]
	ldr	x9, [x19]
	ldr	x1, [x9, x20]
	mov	x0, x19
	blr	x8
	mov	x26, x0
	str	x0, [x22, x20]
	ldr	w1, [x0, #8]
	mov	x0, x23
	bl	_min
	mov	x23, x0
	ldr	w1, [x26, #8]
	mov	x0, x24
	bl	_max
	mov	x24, x0
	add	x20, x20, #8
	cmp	x28, x20
	b.ne	LBB0_2
; %bb.3:
	mov	x26, #0
	ldur	w28, [x29, #-100]               ; 4-byte Folded Reload
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x26, x26, #1
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	cmp	x8, x26
	b.eq	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x20, [x8, x26, lsl #3]
	ldr	w0, [x20]
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22, x26, lsl #3]
	ldr	x1, [x8]
	bl	_test_bit
	cbz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	mov	x1, x25
	bl	_test_bit
	cbnz	x0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x20]
	mov	x1, x25
	bl	___set_bit
	cbz	x21, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	str	w8, [x21, x26, lsl #2]
	b	LBB0_4
LBB0_10:
	mov	w24, #0
	mov	w26, #0
LBB0_11:
	cmp	w26, w28
	b.ne	LBB0_13
LBB0_12:
	mov	w20, #0
	b	LBB0_14
LBB0_13:
	mov	x0, x22
	mov	x1, x28
	mov	x2, x23
	mov	x3, x24
	mov	x4, x21
	bl	_perf_assign_events
	cmp	w0, #0
	cset	w20, ne
LBB0_14:
	cmp	x21, #0
	cset	w8, eq
	orr	w8, w8, w20
	cmp	w8, #1
	b.ne	LBB0_20
; %bb.15:
	cmp	w28, #1
	b.lt	LBB0_20
; %bb.16:
	mov	x21, #0
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	lsl	x22, x8, #3
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x21, x21, #8
	cmp	x22, x21
	b.eq	LBB0_20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	cbz	x8, LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x9, [x19]
	ldr	x1, [x9, x21]
	mov	x0, x19
	blr	x8
	b	LBB0_17
LBB0_20:
Lloh11:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	w20, #0
	csneg	w0, wzr, w8, eq
	ldur	x8, [x29, #-88]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_X86_PMC_IDX_MAX,4,2            ; @X86_PMC_IDX_MAX
	.comm	_x86_pmu,16,3                   ; @x86_pmu
	.comm	_ENOSPC,4,2                     ; @ENOSPC
.subsections_via_symbols
