	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function p4_validate_raw_event
_p4_validate_raw_event:                 ## @p4_validate_raw_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	%rdi, %r14
	movl	(%rdi), %edi
	callq	_p4_config_unpack_event
	movl	%eax, %ebx
	movq	_p4_event_bind_map@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jae	LBB0_7
## %bb.1:
	movl	%ebx, %edi
	callq	_p4_event_match_cpu_model
	testl	%eax, %eax
	je	LBB0_7
## %bb.2:
	xorl	%eax, %eax
	callq	_p4_ht_active
	testq	%rax, %rax
	je	LBB0_3
## %bb.8:
	movq	(%r15), %rax
	movl	%ebx, %ebx
	movq	%rbx, %rcx
	shlq	$4, %rcx
	cmpq	$0, 8(%rax,%rcx)
	je	LBB0_4
## %bb.9:
	xorl	%eax, %eax
	callq	_perf_paranoid_cpu
	testq	%rax, %rax
	je	LBB0_4
## %bb.10:
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	jne	LBB0_4
## %bb.11:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_3:
	movl	%ebx, %ebx
LBB0_4:
	movl	(%r14), %edi
	callq	_p4_config_unpack_escr
	movq	_P4_ESCR_EVENTMASK_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	(%r15), %rcx
	shlq	$4, %rbx
	movl	(%rcx,%rbx), %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_7
## %bb.5:
	movl	(%r14), %edi
	movq	_P4_PEBS_CONFIG_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_p4_config_pebs_has
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movl	(%r14), %edi
	callq	_p4_config_unpack_metric
	movl	%eax, %ebx
	movq	_p4_pebs_bind_map@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	%ecx, %ebx
	jb	LBB0_13
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_p4_event_bind_map,8,3          ## @p4_event_bind_map
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_P4_ESCR_EVENTMASK_MASK,4,2     ## @P4_ESCR_EVENTMASK_MASK
	.comm	_P4_PEBS_CONFIG_ENABLE,4,2      ## @P4_PEBS_CONFIG_ENABLE
	.comm	_p4_pebs_bind_map,8,3           ## @p4_pebs_bind_map
	.no_dead_strip	_p4_validate_raw_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function p4_validate_raw_event
_p4_validate_raw_event:                 ; @p4_validate_raw_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, x0
	ldr	w0, [x0]
	bl	_p4_config_unpack_event
	mov	x20, x0
Lloh0:
	adrp	x21, _p4_event_bind_map@GOTPAGE
Lloh1:
	ldr	x21, [x21, _p4_event_bind_map@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w20, w0
	b.hs	LBB0_12
; %bb.1:
	mov	x0, x20
	bl	_p4_event_match_cpu_model
	cbz	w0, LBB0_12
; %bb.2:
	bl	_p4_ht_active
	cbz	x0, LBB0_7
; %bb.3:
	ldr	x8, [x21]
	mov	w22, w20
	add	x8, x8, w20, uxtw #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_8
; %bb.4:
	bl	_perf_paranoid_cpu
	cbz	x0, LBB0_8
; %bb.5:
Lloh2:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_capable
	cbnz	w0, LBB0_8
; %bb.6:
Lloh5:
	adrp	x8, _EACCES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_13
LBB0_7:
	mov	w22, w20
LBB0_8:
	ldr	w0, [x19]
	bl	_p4_config_unpack_escr
Lloh7:
	adrp	x8, _P4_ESCR_EVENTMASK_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _P4_ESCR_EVENTMASK_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	and	w8, w8, w0
	ldr	x9, [x21]
	lsl	x10, x22, #4
	ldr	w9, [x9, x10]
	bics	wzr, w8, w9
	b.ne	LBB0_12
; %bb.9:
	ldr	w0, [x19]
Lloh10:
	adrp	x8, _P4_PEBS_CONFIG_ENABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _P4_PEBS_CONFIG_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_p4_config_pebs_has
	cbnz	x0, LBB0_12
; %bb.10:
	ldr	w0, [x19]
	bl	_p4_config_unpack_metric
	mov	x19, x0
Lloh13:
	adrp	x8, _p4_pebs_bind_map@GOTPAGE
Lloh14:
	ldr	x8, [x8, _p4_pebs_bind_map@GOTPAGEOFF]
Lloh15:
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	cmp	w19, w0
	b.hs	LBB0_12
; %bb.11:
	mov	w0, #0
	b	LBB0_14
LBB0_12:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_p4_event_bind_map,8,3          ; @p4_event_bind_map
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_P4_ESCR_EVENTMASK_MASK,4,2     ; @P4_ESCR_EVENTMASK_MASK
	.comm	_P4_PEBS_CONFIG_ENABLE,4,2      ; @P4_PEBS_CONFIG_ENABLE
	.comm	_p4_pebs_bind_map,8,3           ; @p4_pebs_bind_map
	.no_dead_strip	_p4_validate_raw_event
.subsections_via_symbols
