	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmc_pmu_amd_pmcallocate
_pmc_pmu_amd_pmcallocate:               ## @pmc_pmu_amd_pmcallocate
	.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	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$-1, -28(%rbp)
	movq	(%rdx), %rdi
	testq	%rdi, %rdi
	jle	LBB0_2
## %bb.1:
	movq	_PMC_CAP_QUALIFIER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	callq	_AMD_PMC_TO_UNITMASK
	orl	%eax, 8(%r15)
LBB0_2:
	movq	_PMC_CLASS_K8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	leaq	-28(%rbp), %rdx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_pmu_event_get
	movq	%rax, %rbx
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_strcmp
	movl	24(%r14), %edi
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	callq	_AMD_PMC_TO_EVENTMASK
	orl	8(%r15), %eax
	movl	%eax, 8(%r15)
	movq	_PMC_AMD_SUB_CLASS_CORE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%r15)
	movl	(%r15), %ecx
	movq	_PMC_CAP_USER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movq	_PMC_CAP_SYSTEM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %edi
	orl	%esi, %edi
	movl	%edi, %ebx
	andl	%ecx, %ebx
	je	LBB0_8
## %bb.7:
	cmpl	%edi, %ebx
	je	LBB0_8
## %bb.9:
	testl	%ecx, %esi
	je	LBB0_11
## %bb.10:
	movq	_AMD_PMC_USR@GOTPCREL(%rip), %rdx
	jmp	LBB0_13
LBB0_3:
	movl	24(%r14), %edi
	callq	_AMD_PMC_TO_EVENTMASK
	orl	%eax, 8(%r15)
	movq	_PMC_AMD_SUB_CLASS_L3_CACHE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movl	32(%r14), %edi
	callq	_AMD_PMC_TO_L3SLICE
	orl	%eax, 8(%r15)
	movl	28(%r14), %edi
	callq	_AMD_PMC_TO_L3CORE
	orl	%eax, 8(%r15)
	jmp	LBB0_21
LBB0_5:
	callq	_AMD_PMC_TO_EVENTMASK_DF
	orl	%eax, 8(%r15)
	movq	_PMC_AMD_SUB_CLASS_DATA_FABRIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	jmp	LBB0_21
LBB0_8:
	movq	_AMD_PMC_USR@GOTPCREL(%rip), %rdx
	movq	_AMD_PMC_OS@GOTPCREL(%rip), %rsi
	orl	(%rdx), %eax
	orl	(%rsi), %eax
	jmp	LBB0_14
LBB0_11:
	testl	%ecx, %edx
	je	LBB0_15
## %bb.12:
	movq	_AMD_PMC_OS@GOTPCREL(%rip), %rdx
LBB0_13:
	orl	(%rdx), %eax
LBB0_14:
	movl	%eax, 8(%r15)
LBB0_15:
	cmpq	$0, 16(%r14)
	je	LBB0_17
## %bb.16:
	movq	_AMD_PMC_EDGE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, 8(%r15)
LBB0_17:
	cmpq	$0, 8(%r14)
	je	LBB0_19
## %bb.18:
	movq	_AMD_PMC_EDGE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, 8(%r15)
LBB0_19:
	movq	_PMC_CAP_INTERRUPT@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_21
## %bb.20:
	movq	_AMD_PMC_INT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%r15)
LBB0_21:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PMC_CAP_QUALIFIER,4,2          ## @PMC_CAP_QUALIFIER
	.comm	_PMC_CLASS_K8,4,2               ## @PMC_CLASS_K8
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l3cache"

	.comm	_PMC_AMD_SUB_CLASS_L3_CACHE,4,2 ## @PMC_AMD_SUB_CLASS_L3_CACHE
L_.str.1:                               ## @.str.1
	.asciz	"data fabric"

	.comm	_PMC_AMD_SUB_CLASS_DATA_FABRIC,4,2 ## @PMC_AMD_SUB_CLASS_DATA_FABRIC
	.comm	_PMC_AMD_SUB_CLASS_CORE,4,2     ## @PMC_AMD_SUB_CLASS_CORE
	.comm	_PMC_CAP_USER,4,2               ## @PMC_CAP_USER
	.comm	_PMC_CAP_SYSTEM,4,2             ## @PMC_CAP_SYSTEM
	.comm	_AMD_PMC_USR,4,2                ## @AMD_PMC_USR
	.comm	_AMD_PMC_OS,4,2                 ## @AMD_PMC_OS
	.comm	_AMD_PMC_EDGE,4,2               ## @AMD_PMC_EDGE
	.comm	_PMC_CAP_INTERRUPT,4,2          ## @PMC_CAP_INTERRUPT
	.comm	_AMD_PMC_INT,4,2                ## @AMD_PMC_INT
	.no_dead_strip	_pmc_pmu_amd_pmcallocate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmc_pmu_amd_pmcallocate
_pmc_pmu_amd_pmcallocate:               ; @pmc_pmu_amd_pmcallocate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	w8, #-1
	str	w8, [sp, #12]
	ldr	x0, [x2]
	cmp	x0, #1
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _PMC_CAP_QUALIFIER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMC_CAP_QUALIFIER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	bl	_AMD_PMC_TO_UNITMASK
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
LBB0_2:
Lloh3:
	adrp	x8, _PMC_CLASS_K8@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMC_CLASS_K8@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	add	x2, sp, #12
	mov	x0, #0
	mov	x1, x21
	bl	_pmu_event_get
	mov	x21, x0
	ldr	w1, [x0]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w1, [x21]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_strcmp
	mov	x8, x0
	ldr	w0, [x20, #24]
	cbz	x8, LBB0_7
; %bb.4:
	bl	_AMD_PMC_TO_EVENTMASK
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
Lloh10:
	adrp	x9, _PMC_AMD_SUB_CLASS_CORE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PMC_AMD_SUB_CLASS_CORE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #8]
	ldr	w9, [x19]
Lloh13:
	adrp	x10, _PMC_CAP_USER@GOTPAGE
Lloh14:
	ldr	x10, [x10, _PMC_CAP_USER@GOTPAGEOFF]
Lloh15:
	adrp	x12, _PMC_CAP_SYSTEM@GOTPAGE
Lloh16:
	ldr	x12, [x12, _PMC_CAP_SYSTEM@GOTPAGEOFF]
Lloh17:
	ldr	w11, [x10]
Lloh18:
	ldr	w10, [x12]
	orr	w12, w10, w11
	and	w13, w12, w9
	cmp	w13, #0
	ccmp	w13, w12, #4, ne
	b.ne	LBB0_8
; %bb.5:
Lloh19:
	adrp	x10, _AMD_PMC_USR@GOTPAGE
Lloh20:
	ldr	x10, [x10, _AMD_PMC_USR@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
Lloh22:
	adrp	x11, _AMD_PMC_OS@GOTPAGE
Lloh23:
	ldr	x11, [x11, _AMD_PMC_OS@GOTPAGEOFF]
Lloh24:
	ldr	w11, [x11]
	orr	w8, w10, w8
	orr	w8, w8, w11
	b	LBB0_13
LBB0_6:
	ldr	w0, [x20, #24]
	bl	_AMD_PMC_TO_EVENTMASK
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
Lloh25:
	adrp	x9, _PMC_AMD_SUB_CLASS_L3_CACHE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PMC_AMD_SUB_CLASS_L3_CACHE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #8]
	ldr	w0, [x20, #32]
	bl	_AMD_PMC_TO_L3SLICE
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	str	w8, [x19, #8]
	ldr	w0, [x20, #28]
	bl	_AMD_PMC_TO_L3CORE
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
	b	LBB0_20
LBB0_7:
	bl	_AMD_PMC_TO_EVENTMASK_DF
	ldr	w8, [x19, #8]
	orr	w8, w8, w0
Lloh28:
	adrp	x9, _PMC_AMD_SUB_CLASS_DATA_FABRIC@GOTPAGE
Lloh29:
	ldr	x9, [x9, _PMC_AMD_SUB_CLASS_DATA_FABRIC@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #8]
	b	LBB0_21
LBB0_8:
	tst	w11, w9
	b.eq	LBB0_10
; %bb.9:
Lloh31:
	adrp	x10, _AMD_PMC_USR@GOTPAGE
Lloh32:
	ldr	x10, [x10, _AMD_PMC_USR@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	tst	w10, w9
	b.eq	LBB0_14
; %bb.11:
Lloh33:
	adrp	x10, _AMD_PMC_OS@GOTPAGE
Lloh34:
	ldr	x10, [x10, _AMD_PMC_OS@GOTPAGEOFF]
LBB0_12:
	ldr	w10, [x10]
	orr	w8, w10, w8
LBB0_13:
	str	w8, [x19, #8]
LBB0_14:
	ldr	x11, [x20, #16]
Lloh35:
	adrp	x10, _AMD_PMC_EDGE@GOTPAGE
Lloh36:
	ldr	x10, [x10, _AMD_PMC_EDGE@GOTPAGEOFF]
	cbz	x11, LBB0_16
; %bb.15:
	ldr	w11, [x10]
	orr	w8, w8, w11
	str	w8, [x19, #8]
LBB0_16:
	ldr	x11, [x20, #8]
	cbz	x11, LBB0_18
; %bb.17:
	ldr	w10, [x10]
	orr	w8, w8, w10
	str	w8, [x19, #8]
LBB0_18:
Lloh37:
	adrp	x10, _PMC_CAP_INTERRUPT@GOTPAGE
Lloh38:
	ldr	x10, [x10, _PMC_CAP_INTERRUPT@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_21
; %bb.19:
Lloh40:
	adrp	x9, _AMD_PMC_INT@GOTPAGE
Lloh41:
	ldr	x9, [x9, _AMD_PMC_INT@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	orr	w8, w8, w9
LBB0_20:
	str	w8, [x19, #8]
LBB0_21:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_PMC_CAP_QUALIFIER,4,2          ; @PMC_CAP_QUALIFIER
	.comm	_PMC_CLASS_K8,4,2               ; @PMC_CLASS_K8
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l3cache"

	.comm	_PMC_AMD_SUB_CLASS_L3_CACHE,4,2 ; @PMC_AMD_SUB_CLASS_L3_CACHE
l_.str.1:                               ; @.str.1
	.asciz	"data fabric"

	.comm	_PMC_AMD_SUB_CLASS_DATA_FABRIC,4,2 ; @PMC_AMD_SUB_CLASS_DATA_FABRIC
	.comm	_PMC_AMD_SUB_CLASS_CORE,4,2     ; @PMC_AMD_SUB_CLASS_CORE
	.comm	_PMC_CAP_USER,4,2               ; @PMC_CAP_USER
	.comm	_PMC_CAP_SYSTEM,4,2             ; @PMC_CAP_SYSTEM
	.comm	_AMD_PMC_USR,4,2                ; @AMD_PMC_USR
	.comm	_AMD_PMC_OS,4,2                 ; @AMD_PMC_OS
	.comm	_AMD_PMC_EDGE,4,2               ; @AMD_PMC_EDGE
	.comm	_PMC_CAP_INTERRUPT,4,2          ; @PMC_CAP_INTERRUPT
	.comm	_AMD_PMC_INT,4,2                ; @AMD_PMC_INT
	.no_dead_strip	_pmc_pmu_amd_pmcallocate
.subsections_via_symbols
