	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p4_pmu_schedule_events
_p4_pmu_schedule_events:                ## @p4_pmu_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, %r13
	movl	%esi, %r12d
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_X86_PMC_IDX_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %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, %rbx
	movq	_P4_ESCR_MSR_TABLE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %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, %r14
	xorl	%eax, %eax
	callq	_smp_processor_id
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_X86_PMC_IDX_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_bitmap_zero
	movl	(%r15), %esi
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_bitmap_zero
	testl	%r12d, %r12d
	je	LBB0_28
## %bb.1:
	movl	%r12d, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_bit
	movl	%r12d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_bit
	incq	%r15
	cmpq	%r15, -88(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_28
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %r14
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_p4_ht_thread
	movl	%eax, %r13d
	movq	8(%r14), %rdi
	callq	_p4_config_get_bind
	movq	%rax, %rbx
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %edi
	callq	_p4_get_escr_idx
	movl	%eax, %r12d
	xorl	%edi, %edi
	cmpl	$-1, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_22
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, (%r14)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_p4_should_swap_ts
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_p4_next_cntr
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movl	%r12d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_24
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	callq	_p4_get_alias_event
	testq	%rax, %rax
	je	LBB0_22
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_p4_config_get_bind
	movq	%rax, %rbx
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %edi
	callq	_p4_get_escr_idx
	movl	%eax, %r12d
	xorl	%edi, %edi
	cmpl	$-1, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_22
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, (%r14)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_p4_should_swap_ts
	testl	%eax, %eax
	je	LBB0_5
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_p4_next_cntr
	cmpl	$-1, %eax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movl	%r12d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_24
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	callq	_p4_get_alias_event
	testq	%rax, %rax
	je	LBB0_22
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, 8(%r14)
	movq	%rax, %rdi
	callq	_p4_config_get_bind
	movq	%rax, %rbx
	movq	(%rax), %rax
	movl	(%rax,%r13,4), %edi
	callq	_p4_get_escr_idx
	movl	%eax, %r12d
	xorl	%edi, %edi
	cmpl	$-1, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, (%r14)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_p4_should_swap_ts
	testl	%eax, %eax
	je	LBB0_5
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	%r13d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_p4_next_cntr
	cmpl	$-1, %eax
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %ebx
	movl	%r12d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_20
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_p4_pmu_swap_config_ts
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %ebx
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, (%r13,%r15,4)
	jmp	LBB0_27
LBB0_20:
	movq	8(%r14), %rdi
	callq	_p4_get_alias_event
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movq	%rax, 8(%r14)
LBB0_22:
	cmpl	%r15d, -88(%rbp)                ## 4-byte Folded Reload
	jne	LBB0_23
LBB0_28:
	xorl	%eax, %eax
	jmp	LBB0_29
LBB0_23:
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_29:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_31
## %bb.30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_X86_PMC_IDX_MAX,4,2            ## @X86_PMC_IDX_MAX
	.comm	_P4_ESCR_MSR_TABLE_SIZE,4,2     ## @P4_ESCR_MSR_TABLE_SIZE
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.no_dead_strip	_p4_pmu_schedule_events
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p4_pmu_schedule_events
_p4_pmu_schedule_events:                ; @p4_pmu_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, #16
	mov	x19, x2
	mov	x24, x1
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
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]
	bl	_BITS_TO_LONGS
	mov	w8, w0
	lsl	x8, x8, #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	x21, x9, x8
	mov	sp, x21
Lloh7:
	adrp	x25, _P4_ESCR_MSR_TABLE_SIZE@GOTPAGE
Lloh8:
	ldr	x25, [x25, _P4_ESCR_MSR_TABLE_SIZE@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_BITS_TO_LONGS
	mov	w8, w0
	lsl	x8, x8, #3
	mov	x9, x8
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	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
	bl	_smp_processor_id
	mov	x23, x0
	ldr	w1, [x20]
	mov	x0, x21
	bl	_bitmap_zero
	ldr	w1, [x25]
	mov	x0, x22
	bl	_bitmap_zero
	cbz	w24, LBB0_26
; %bb.1:
	mov	x28, #0
	mov	w20, w24
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w27, [x24]
	cbz	x19, LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	w27, [x19, x28, lsl #2]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x27
	mov	x1, x21
	bl	_set_bit
	mov	x0, x25
	mov	x1, x22
	bl	_set_bit
	add	x28, x28, #1
	cmp	x20, x28
	b.eq	LBB0_26
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	x24, [x8, x28, lsl #3]
	mov	x0, x23
	bl	_p4_ht_thread
	mov	x26, x0
	ldr	x0, [x24, #8]
	bl	_p4_config_get_bind
	mov	x27, x0
	ldr	x8, [x0]
	ldr	w0, [x8, w26, uxtw #2]
	bl	_p4_get_escr_idx
	mov	x25, x0
	cmn	w0, #1
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_25
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	cmn	w8, #1
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x24, #8]
	mov	x1, x23
	bl	_p4_should_swap_ts
	cbz	w0, LBB0_2
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w26, w26
	mov	x0, x26
	mov	x1, x21
	mov	x2, x27
	bl	_p4_next_cntr
	cmn	w0, #1
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	mov	x0, x25
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_22
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x24, #8]
	bl	_p4_get_alias_event
	cbz	x0, LBB0_25
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	str	x0, [x24, #8]
	bl	_p4_config_get_bind
	mov	x27, x0
	ldr	x8, [x0]
	ldr	w0, [x8, x26, lsl #2]
	bl	_p4_get_escr_idx
	mov	x25, x0
	cmn	w0, #1
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_25
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	cmn	w8, #1
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x24, #8]
	mov	x1, x23
	bl	_p4_should_swap_ts
	cbz	w0, LBB0_2
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	mov	x1, x21
	mov	x2, x27
	bl	_p4_next_cntr
	cmn	w0, #1
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	mov	x0, x25
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_22
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x24, #8]
	bl	_p4_get_alias_event
	cbz	x0, LBB0_25
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	str	x0, [x24, #8]
	bl	_p4_config_get_bind
	mov	x27, x0
	ldr	x8, [x0]
	ldr	w0, [x8, x26, lsl #2]
	bl	_p4_get_escr_idx
	mov	x25, x0
	cmn	w0, #1
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_25
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x24]
	cmn	w8, #1
	b.eq	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x24, #8]
	mov	x1, x23
	bl	_p4_should_swap_ts
	cbz	w0, LBB0_2
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x26
	mov	x1, x21
	mov	x2, x27
	bl	_p4_next_cntr
	cmn	w0, #1
	b.eq	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x0
	mov	x0, x25
	mov	x1, x22
	bl	_test_bit
	cbnz	x0, LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_p4_pmu_swap_config_ts
	cbnz	x19, LBB0_3
	b	LBB0_4
LBB0_23:
	ldr	x0, [x24, #8]
	bl	_p4_get_alias_event
	cbz	x0, LBB0_25
; %bb.24:
	str	x0, [x24, #8]
LBB0_25:
	cmp	w20, w28
	b.ne	LBB0_27
LBB0_26:
	mov	w0, #0
	b	LBB0_28
LBB0_27:
Lloh11:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_28:
	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_30
; %bb.29:
	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_30:
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_X86_PMC_IDX_MAX,4,2            ; @X86_PMC_IDX_MAX
	.comm	_P4_ESCR_MSR_TABLE_SIZE,4,2     ; @P4_ESCR_MSR_TABLE_SIZE
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.no_dead_strip	_p4_pmu_schedule_events
.subsections_via_symbols
