	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_spe_pmu_event_init
_arm_spe_pmu_event_init:                ## @arm_spe_pmu_event_init
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	callq	_to_spe_pmu
	movq	%rax, %r14
	movq	8(%rbx), %rax
	movq	16(%rbx), %rcx
	cmpq	(%rax), %rcx
	jne	LBB0_1
## %bb.2:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	js	LBB0_4
## %bb.3:
	leaq	4(%r14), %rsi
	callq	_cpumask_test_cpu
	testl	%eax, %eax
	je	LBB0_1
LBB0_4:
	movq	%rbx, %rdi
	callq	_arm_spe_event_to_pmsevfr
	movq	_SYS_PMSEVFR_EL1_RES0@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_5
## %bb.6:
	cmpq	$0, 32(%rbx)
	je	LBB0_7
LBB0_5:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_18:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpq	$0, 24(%rbx)
	je	LBB0_9
## %bb.8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_9:
	movq	%rbx, %rdi
	callq	_arm_spe_event_to_pmsfcr
	movl	%eax, %r15d
	movq	_SYS_PMSFCR_EL1_FE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_11
## %bb.10:
	movq	_SPE_PMU_FEAT_FILT_EVT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_5
LBB0_11:
	movq	_SYS_PMSFCR_EL1_FT_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_13
## %bb.12:
	movq	_SPE_PMU_FEAT_FILT_TYP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_5
LBB0_13:
	movq	_SYS_PMSFCR_EL1_FL_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	testl	%r15d, %eax
	je	LBB0_15
## %bb.14:
	movq	_SPE_PMU_FEAT_FILT_LAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_5
LBB0_15:
	movq	%rbx, %rdi
	callq	_arm_spe_event_to_pmscr
	movl	%eax, %r14d
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_19
## %bb.16:
	movq	_SYS_PMSCR_EL1_PA_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, %r15d
	movq	_SYS_PMSCR_EL1_CX_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	movl	%eax, %r12d
	orl	%r15d, %r12d
	movq	_SYS_PMSCR_EL1_PCT_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT
	orl	%r12d, %eax
	testl	%r14d, %eax
	je	LBB0_19
## %bb.17:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_SYS_PMSEVFR_EL1_RES0,4,2       ## @SYS_PMSEVFR_EL1_RES0
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SYS_PMSFCR_EL1_FE_SHIFT,4,2    ## @SYS_PMSFCR_EL1_FE_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_EVT,4,2      ## @SPE_PMU_FEAT_FILT_EVT
	.comm	_SYS_PMSFCR_EL1_FT_SHIFT,4,2    ## @SYS_PMSFCR_EL1_FT_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_TYP,4,2      ## @SPE_PMU_FEAT_FILT_TYP
	.comm	_SYS_PMSFCR_EL1_FL_SHIFT,4,2    ## @SYS_PMSFCR_EL1_FL_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_LAT,4,2      ## @SPE_PMU_FEAT_FILT_LAT
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	_SYS_PMSCR_EL1_PA_SHIFT,4,2     ## @SYS_PMSCR_EL1_PA_SHIFT
	.comm	_SYS_PMSCR_EL1_CX_SHIFT,4,2     ## @SYS_PMSCR_EL1_CX_SHIFT
	.comm	_SYS_PMSCR_EL1_PCT_SHIFT,4,2    ## @SYS_PMSCR_EL1_PCT_SHIFT
	.comm	_EACCES,4,2                     ## @EACCES
	.no_dead_strip	_arm_spe_pmu_event_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_spe_pmu_event_init
_arm_spe_pmu_event_init:                ; @arm_spe_pmu_event_init
	.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, x0
	ldr	x0, [x0, #8]
	bl	_to_spe_pmu
	ldp	x9, x8, [x19, #8]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	mov	x20, x0
	ldr	x0, [x19]
	tbnz	x0, #63, LBB0_3
; %bb.2:
	add	x1, x20, #4
	bl	_cpumask_test_cpu
	cbz	w0, LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_arm_spe_event_to_pmsevfr
Lloh0:
	adrp	x8, _SYS_PMSEVFR_EL1_RES0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_PMSEVFR_EL1_RES0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
LBB0_5:
Lloh3:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _ENOENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
LBB0_9:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_11
; %bb.10:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_11:
	mov	x0, x19
	bl	_arm_spe_event_to_pmsfcr
	mov	x21, x0
Lloh9:
	adrp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AP_SYS_ADMIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_19
LBB0_18:
	mov	w0, #0
	b	LBB0_8
LBB0_19:
Lloh30:
	adrp	x8, _SYS_PMSCR_EL1_PA_SHIFT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SYS_PMSCR_EL1_PA_SHIFT@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	bl	_BIT
	mov	x20, x0
Lloh33:
	adrp	x8, _SYS_PMSCR_EL1_CX_SHIFT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SYS_PMSCR_EL1_CX_SHIFT@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_BIT
	orr	w20, w0, w20
Lloh36:
	adrp	x8, _SYS_PMSCR_EL1_PCT_SHIFT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SYS_PMSCR_EL1_PCT_SHIFT@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	bl	_BIT
	orr	w8, w20, w0
	tst	w8, w19
	b.eq	LBB0_18
; %bb.20:
Lloh39:
	adrp	x8, _EACCES@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_SYS_PMSEVFR_EL1_RES0,4,2       ; @SYS_PMSEVFR_EL1_RES0
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SYS_PMSFCR_EL1_FE_SHIFT,4,2    ; @SYS_PMSFCR_EL1_FE_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_EVT,4,2      ; @SPE_PMU_FEAT_FILT_EVT
	.comm	_SYS_PMSFCR_EL1_FT_SHIFT,4,2    ; @SYS_PMSFCR_EL1_FT_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_TYP,4,2      ; @SPE_PMU_FEAT_FILT_TYP
	.comm	_SYS_PMSFCR_EL1_FL_SHIFT,4,2    ; @SYS_PMSFCR_EL1_FL_SHIFT
	.comm	_SPE_PMU_FEAT_FILT_LAT,4,2      ; @SPE_PMU_FEAT_FILT_LAT
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	_SYS_PMSCR_EL1_PA_SHIFT,4,2     ; @SYS_PMSCR_EL1_PA_SHIFT
	.comm	_SYS_PMSCR_EL1_CX_SHIFT,4,2     ; @SYS_PMSCR_EL1_CX_SHIFT
	.comm	_SYS_PMSCR_EL1_PCT_SHIFT,4,2    ; @SYS_PMSCR_EL1_PCT_SHIFT
	.comm	_EACCES,4,2                     ; @EACCES
	.no_dead_strip	_arm_spe_pmu_event_init
.subsections_via_symbols
