	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmc_pmu_pmcallocate            ## -- Begin function pmc_pmu_pmcallocate
	.p2align	4, 0x90
_pmc_pmu_pmcallocate:                   ## @pmc_pmu_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$-1, -36(%rbp)
	xorl	%eax, %eax
	callq	_pmu_events_mfr
	movq	%rax, %r12
	movq	_PMU_INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_1
## %bb.2:
	leaq	8(%r14), %rdi
	movl	$4, %esi
	callq	_bzero
	movq	_PMC_CAP_READ@GOTPCREL(%rip), %rax
	movq	_PMC_CAP_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, (%r14)
	movq	%rbx, %rdi
	callq	_pmu_alias_get
	movq	%rax, %r15
	leaq	-36(%rbp), %rdx
	xorl	%edi, %edi
	movq	%rax, %rsi
	callq	_pmu_event_get
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %rbx
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	leaq	-36(%rbp), %rdx
	xorl	%edi, %edi
	callq	_pmu_event_get
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_1
LBB0_5:
	movl	-36(%rbp), %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	-36(%rbp), %eax
	movl	%eax, 4(%r14)
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.6:
	leaq	-40(%rbp), %rdi
	callq	_pmu_parse_event
	testq	%rax, %rax
	je	LBB0_7
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_PMU_INTEL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_9
## %bb.8:
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pmc_pmu_intel_pmcallocate
	jmp	LBB0_10
LBB0_9:
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pmc_pmu_amd_pmcallocate
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_PMU_INVALID,8,3                ## @PMU_INVALID
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PMC_CAP_READ,4,2               ## @PMC_CAP_READ
	.comm	_PMC_CAP_WRITE,4,2              ## @PMC_CAP_WRITE
	.comm	_PMU_INTEL,8,3                  ## @PMU_INTEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmc_pmu_pmcallocate            ; -- Begin function pmc_pmu_pmcallocate
	.p2align	2
_pmc_pmu_pmcallocate:                   ; @pmc_pmu_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	x19, x1
	mov	x21, x0
	mov	w8, #-1
	str	w8, [sp, #4]
	bl	_pmu_events_mfr
Lloh0:
	adrp	x8, _PMU_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PMU_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.1:
	mov	x20, x0
	add	x0, x19, #8
	mov	w1, #4
	bl	_bzero
Lloh3:
	adrp	x8, _PMC_CAP_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMC_CAP_READ@GOTPAGEOFF]
Lloh5:
	adrp	x9, _PMC_CAP_WRITE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PMC_CAP_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
	mov	x0, x21
	bl	_pmu_alias_get
	mov	x21, x0
	add	x2, sp, #4
	mov	x0, #0
	mov	x1, x21
	bl	_pmu_event_get
	cbz	x0, LBB0_6
; %bb.2:
	mov	x22, x0
	ldr	x1, [x0]
	cbz	x1, LBB0_4
; %bb.3:
	add	x2, sp, #4
	mov	x0, #0
	bl	_pmu_event_get
	mov	x22, x0
	cbz	x0, LBB0_6
LBB0_4:
	ldr	w8, [sp, #4]
	mvn	w8, w8
	lsr	w0, w8, #31
	bl	_assert
	ldr	w8, [sp, #4]
	str	w8, [x19, #4]
	ldr	x1, [x22, #8]
	cbz	x1, LBB0_6
; %bb.5:
	add	x0, sp, #8
	bl	_pmu_parse_event
	cbz	x0, LBB0_8
LBB0_6:
Lloh9:
	adrp	x8, _ENOENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
LBB0_7:
	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
LBB0_8:
Lloh12:
	adrp	x8, _PMU_INTEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PMU_INTEL@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	cmp	x20, x8
	b.ne	LBB0_10
; %bb.9:
	bl	_pmc_pmu_intel_pmcallocate
	b	LBB0_7
LBB0_10:
	bl	_pmc_pmu_amd_pmcallocate
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PMU_INVALID,8,3                ; @PMU_INVALID
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PMC_CAP_READ,4,2               ; @PMC_CAP_READ
	.comm	_PMC_CAP_WRITE,4,2              ; @PMC_CAP_WRITE
	.comm	_PMU_INTEL,8,3                  ; @PMU_INTEL
.subsections_via_symbols
