	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmc_allocate                   ## -- Begin function pmc_allocate
	.p2align	4, 0x90
_pmc_allocate:                          ## @pmc_allocate
	.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
	movl	%r9d, %r12d
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_PMC_MODE_SS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	je	LBB0_5
## %bb.1:
	movq	_PMC_MODE_TS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_5
## %bb.2:
	movq	_PMC_MODE_SC@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_5
## %bb.3:
	movq	_PMC_MODE_TC@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %ebx
	jmp	LBB0_43
LBB0_5:
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	leaq	-88(%rbp), %rdi
	movl	$32, %esi
	callq	_bzero
	movl	%r14d, -88(%rbp)
	movl	%ebx, -84(%rbp)
	movl	%r13d, -60(%rbp)
	movl	%r12d, -64(%rbp)
	movl	%ebx, %edi
	callq	_PMC_IS_SAMPLING_MODE
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_PMC_CAP_INTERRUPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -68(%rbp)
LBB0_7:
	movq	%r15, %rdi
	callq	_strdup
	movq	%rax, %r12
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	callq	_strsep
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_pmc_pmu_enabled
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	leaq	-88(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_pmc_pmu_pmcallocate
	testq	%rax, %rax
	je	LBB0_33
## %bb.9:
	movq	_EX_USAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	callq	_errx
	jmp	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	callq	_free
	xorl	%r12d, %r12d
LBB0_11:
	movq	_pmc_mdep_event_aliases@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_15
## %bb.12:
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_strcasecmp
	testl	%eax, %eax
	je	LBB0_35
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	24(%rbx), %rsi
	addq	$16, %rbx
	testq	%rsi, %rsi
	jne	LBB0_13
LBB0_15:
	testq	%r12, %r12
	jne	LBB0_17
LBB0_16:
	movq	%r15, %rdi
	callq	_strdup
	movq	%rax, %r12
LBB0_17:
	movq	%r12, -48(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rdi
	callq	_strsep
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_PMC_CLASS_TABLE_SIZE@GOTPCREL(%rip), %r14
	movl	$-1, %ebx
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	cmpq	$0, (%r14)
	je	LBB0_41
## %bb.18:
	xorl	%ebx, %ebx
	movq	_pmc_class_table@GOTPCREL(%rip), %r15
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_20 Depth=1
	incq	%rbx
	movq	(%r14), %rax
	cmpq	%rax, %rbx
	jae	LBB0_25
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %r13
	testq	%r13, %r13
	je	LBB0_19
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	16(%r13), %edi
	callq	_pmc_mdep_is_compatible_class
	testq	%rax, %rax
	je	LBB0_19
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	(%r13), %edx
	movl	20(%r13), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_strncasecmp
	testq	%rax, %rax
	jne	LBB0_19
## %bb.23:
	movslq	(%r13), %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	%rax, %rdi
	movq	%r13, %rsi
	callq	_pmc_match_event_class
	testq	%rax, %rax
	jne	LBB0_38
	jmp	LBB0_24
LBB0_25:
	movq	%r12, %rbx
	testq	%rax, %rax
	je	LBB0_36
## %bb.26:
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	-8(%rax,%r12,8), %r13
	testq	%r13, %r13
	je	LBB0_30
## %bb.28:                              ##   in Loop: Header=BB0_27 Depth=1
	movl	16(%r13), %edi
	callq	_pmc_mdep_is_compatible_class
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_27 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_pmc_match_event_class
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_27 Depth=1
	xorl	%eax, %eax
LBB0_31:                                ##   in Loop: Header=BB0_27 Depth=1
	testq	%rax, %rax
	sete	%cl
	jne	LBB0_37
## %bb.32:                              ##   in Loop: Header=BB0_27 Depth=1
	leaq	1(%r12), %rdx
	cmpq	(%r14), %r12
	movq	%rdx, %r12
	jb	LBB0_27
	jmp	LBB0_37
LBB0_35:
	movq	(%rbx), %rdi
	callq	_strdup
	movq	%rax, %r12
	testq	%r12, %r12
	jne	LBB0_17
	jmp	LBB0_16
LBB0_36:
	movb	$1, %cl
	xorl	%eax, %eax
LBB0_37:
	testb	%cl, %cl
	movq	%rbx, %r12
	jne	LBB0_24
LBB0_38:
	movl	(%rax), %edi
	movl	%edi, -72(%rbp)
	movl	16(%r13), %eax
	movl	%eax, -76(%rbp)
	movq	-48(%rbp), %rsi
	leaq	-88(%rbp), %rdx
	callq	*8(%r13)
	testq	%rax, %rax
	js	LBB0_24
LBB0_33:
	movq	_PMCALLOCATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-88(%rbp), %rsi
	callq	_PMC_CALL
	testq	%rax, %rax
	js	LBB0_34
## %bb.40:
	xorl	%ebx, %ebx
	leaq	-80(%rbp), %rax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_41
LBB0_24:
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	$-1, %ebx
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_41:
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	testq	%r12, %r12
	je	LBB0_43
LBB0_42:
	movq	%r12, %rdi
	callq	_free
LBB0_43:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_34:
	movl	$-1, %ebx
	testq	%r12, %r12
	jne	LBB0_42
	jmp	LBB0_43
	.cfi_endproc
                                        ## -- End function
	.comm	_PMC_MODE_SS,4,2                ## @PMC_MODE_SS
	.comm	_PMC_MODE_TS,4,2                ## @PMC_MODE_TS
	.comm	_PMC_MODE_SC,4,2                ## @PMC_MODE_SC
	.comm	_PMC_MODE_TC,4,2                ## @PMC_MODE_TC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_PMC_CAP_INTERRUPT,4,2          ## @PMC_CAP_INTERRUPT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	","

	.comm	_PMCALLOCATE,4,2                ## @PMCALLOCATE
	.comm	_EX_USAGE,4,2                   ## @EX_USAGE
L_.str.1:                               ## @.str.1
	.asciz	"ERROR: pmc_pmu_allocate failed, check for ctrname %s\n"

	.comm	_pmc_mdep_event_aliases,8,3     ## @pmc_mdep_event_aliases
	.comm	_PMC_CLASS_TABLE_SIZE,8,3       ## @PMC_CLASS_TABLE_SIZE
	.comm	_pmc_class_table,8,3            ## @pmc_class_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmc_allocate                   ; -- Begin function pmc_allocate
	.p2align	2
_pmc_allocate:                          ; @pmc_allocate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x8, _PMC_MODE_SS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMC_MODE_SS@GOTPAGEOFF]
Lloh2:
	adrp	x9, _PMC_MODE_TS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PMC_MODE_TS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _PMC_MODE_SC@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PMC_MODE_SC@GOTPAGEOFF]
Lloh8:
	adrp	x11, _PMC_MODE_TC@GOTPAGE
Lloh9:
	ldr	x11, [x11, _PMC_MODE_TC@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	ldr	w11, [x11]
	cmp	w8, w1
	ccmp	w9, w1, #4, ne
	ccmp	w10, w1, #4, ne
	ccmp	w11, w1, #4, ne
	b.ne	LBB0_6
; %bb.1:
	mov	x20, x5
	mov	x19, x4
	mov	x24, x3
	mov	x23, x2
	mov	x22, x1
	mov	x21, x0
	add	x0, sp, #8
	mov	w1, #32
	bl	_bzero
	stp	w24, w22, [sp, #8]
	stp	w20, w23, [sp, #32]
	mov	x0, x22
	bl	_PMC_IS_SAMPLING_MODE
	cbz	x0, LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _PMC_CAP_INTERRUPT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PMC_CAP_INTERRUPT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [sp, #28]
	orr	w8, w9, w8
	str	w8, [sp, #28]
LBB0_3:
	mov	x0, x21
	bl	_strdup
	mov	x20, x0
	str	x0, [sp, #40]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #40
	bl	_strsep
	mov	x22, x0
	bl	_pmc_pmu_enabled
	cbz	x0, LBB0_7
; %bb.4:
	add	x1, sp, #8
	mov	x0, x22
	bl	_pmc_pmu_pmcallocate
	cbz	x0, LBB0_33
; %bb.5:
Lloh17:
	adrp	x8, _EX_USAGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EX_USAGE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_errx
	b	LBB0_8
LBB0_6:
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _errno@GOTPAGE
Lloh26:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh27:
	str	w8, [x9]
	mov	w21, #-1
	b	LBB0_38
LBB0_7:
	mov	x0, x20
	bl	_free
	mov	x20, #0
LBB0_8:
Lloh28:
	adrp	x8, _pmc_mdep_event_aliases@GOTPAGE
Lloh29:
	ldr	x8, [x8, _pmc_mdep_event_aliases@GOTPAGEOFF]
Lloh30:
	ldr	x22, [x8]
	cbz	x22, LBB0_12
; %bb.9:
	ldr	x1, [x22, #8]
	cbz	x1, LBB0_12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_strcasecmp
	cbz	w0, LBB0_30
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x1, [x22, #24]
	add	x22, x22, #16
	cbnz	x1, LBB0_10
LBB0_12:
	cbnz	x20, LBB0_14
LBB0_13:
	mov	x0, x21
	bl	_strdup
	mov	x20, x0
LBB0_14:
	str	x20, [sp, #40]
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #40
	bl	_strsep
Lloh33:
	adrp	x23, _PMC_CLASS_TABLE_SIZE@GOTPAGE
Lloh34:
	ldr	x23, [x23, _PMC_CLASS_TABLE_SIZE@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_35
; %bb.15:
	mov	x22, x0
	mov	x25, #0
Lloh35:
	adrp	x24, _pmc_class_table@GOTPAGE
Lloh36:
	ldr	x24, [x24, _pmc_class_table@GOTPAGEOFF]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	x25, x25, #1
	ldr	x8, [x23]
	cmp	x25, x8
	b.hs	LBB0_21
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	x21, [x8, x25, lsl #3]
	cbz	x21, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w0, [x21, #16]
	bl	_pmc_mdep_is_compatible_class
	cbz	x0, LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w1, [x21, #20]
	ldr	w2, [x21]
	mov	x0, x22
	bl	_strncasecmp
	cbnz	x0, LBB0_16
; %bb.20:
	ldrsw	x8, [x21]
	add	x0, x22, x8
	mov	x1, x21
	bl	_pmc_match_event_class
	cbnz	x0, LBB0_32
	b	LBB0_35
LBB0_21:
	cbz	x8, LBB0_31
; %bb.22:
	mov	x25, #0
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	x21, [x8, x25, lsl #3]
	cbz	x21, LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	w0, [x21, #16]
	bl	_pmc_mdep_is_compatible_class
	cbz	x0, LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_pmc_match_event_class
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x0, #0
LBB0_27:                                ;   in Loop: Header=BB0_23 Depth=1
	cmp	x0, #0
	cset	w8, eq
	cbnz	x0, LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_23 Depth=1
	add	x25, x25, #1
	ldr	x9, [x23]
	cmp	x25, x9
	b.lo	LBB0_23
LBB0_29:
	tbnz	w8, #0, LBB0_35
	b	LBB0_32
LBB0_30:
	ldr	x0, [x22]
	bl	_strdup
	mov	x20, x0
	cbnz	x20, LBB0_14
	b	LBB0_13
LBB0_31:
	mov	x0, #0
	mov	w8, #1
	tbnz	w8, #0, LBB0_35
LBB0_32:
	ldr	w0, [x0]
	str	w0, [sp, #24]
	ldr	w8, [x21, #16]
	str	w8, [sp, #20]
	ldr	x8, [x21, #8]
	ldr	x1, [sp, #40]
	add	x2, sp, #8
	blr	x8
	tbnz	x0, #63, LBB0_35
LBB0_33:
Lloh37:
	adrp	x8, _PMCALLOCATE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _PMCALLOCATE@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
	add	x22, sp, #8
	add	x1, sp, #8
	bl	_PMC_CALL
	tbnz	x0, #63, LBB0_39
; %bb.34:
	mov	w21, #0
	add	x8, x22, #8
	b	LBB0_36
LBB0_35:
	mov	w21, #-1
Lloh40:
	adrp	x19, _errno@GOTPAGE
Lloh41:
	ldr	x19, [x19, _errno@GOTPAGEOFF]
Lloh42:
	adrp	x8, _EINVAL@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_36:
	ldr	w8, [x8]
	str	w8, [x19]
	cbz	x20, LBB0_38
LBB0_37:
	mov	x0, x20
	bl	_free
LBB0_38:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_39:
	mov	w21, #-1
	cbnz	x20, LBB0_37
	b	LBB0_38
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_PMC_MODE_SS,4,2                ; @PMC_MODE_SS
	.comm	_PMC_MODE_TS,4,2                ; @PMC_MODE_TS
	.comm	_PMC_MODE_SC,4,2                ; @PMC_MODE_SC
	.comm	_PMC_MODE_TC,4,2                ; @PMC_MODE_TC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_PMC_CAP_INTERRUPT,4,2          ; @PMC_CAP_INTERRUPT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	","

	.comm	_PMCALLOCATE,4,2                ; @PMCALLOCATE
	.comm	_EX_USAGE,4,2                   ; @EX_USAGE
l_.str.1:                               ; @.str.1
	.asciz	"ERROR: pmc_pmu_allocate failed, check for ctrname %s\n"

	.comm	_pmc_mdep_event_aliases,8,3     ; @pmc_mdep_event_aliases
	.comm	_PMC_CLASS_TABLE_SIZE,8,3       ; @PMC_CLASS_TABLE_SIZE
	.comm	_pmc_class_table,8,3            ; @pmc_class_table
.subsections_via_symbols
