	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_setup_perfctr              ## -- Begin function x86_setup_perfctr
	.p2align	4, 0x90
_x86_setup_perfctr:                     ## @x86_setup_perfctr
	.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, %rbx
	callq	_is_sampling_event
	testl	%eax, %eax
	je	LBB0_1
## %bb.5:
	movq	_x86_pmu@GOTPCREL(%rip), %rax
	cmpl	$0, 28(%rax)
	jne	LBB0_2
LBB0_6:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_x86_pmu@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, (%rbx)
	movl	%esi, 4(%rbx)
	leaq	16(%rbx), %rdi
	callq	_local64_set
LBB0_2:
	movq	24(%rbx), %rax
	movq	_PERF_TYPE_RAW@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	je	LBB0_19
## %bb.3:
	movq	_PERF_TYPE_HW_CACHE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.4:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_ext_hw_attr                ## TAILCALL
LBB0_8:
	movq	32(%rbx), %rdi
	movq	_x86_pmu@GOTPCREL(%rip), %r15
	cmpq	8(%r15), %rdi
	jge	LBB0_9
## %bb.10:
	callq	*16(%r15)
	cmpq	$-1, %rax
	je	LBB0_9
## %bb.11:
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	32(%rbx), %rcx
	movq	_PERF_COUNT_HW_BRANCH_INSTRUCTIONS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.14:
	cmpl	$0, 44(%rbx)
	jne	LBB0_18
## %bb.15:
	cmpl	$1, (%rbx)
	jne	LBB0_18
## %bb.16:
	cmpl	$0, 24(%r15)
	je	LBB0_6
## %bb.17:
	cmpl	$0, 40(%rbx)
	je	LBB0_6
LBB0_18:
	orq	%rax, 8(%rbx)
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_x86_pmu,32,3                   ## @x86_pmu
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_PERF_TYPE_RAW,8,3              ## @PERF_TYPE_RAW
	.comm	_PERF_TYPE_HW_CACHE,8,3         ## @PERF_TYPE_HW_CACHE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_PERF_COUNT_HW_BRANCH_INSTRUCTIONS,8,3 ## @PERF_COUNT_HW_BRANCH_INSTRUCTIONS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_setup_perfctr              ; -- Begin function x86_setup_perfctr
	.p2align	2
_x86_setup_perfctr:                     ; @x86_setup_perfctr
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_is_sampling_event
Lloh0:
	adrp	x8, _x86_pmu@GOTPAGE
Lloh1:
	ldr	x8, [x8, _x86_pmu@GOTPAGEOFF]
	cbz	w0, LBB0_3
; %bb.1:
	ldr	w8, [x8, #28]
	cbnz	w8, LBB0_4
LBB0_2:
Lloh2:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_13
LBB0_3:
	ldr	w1, [x8]
	stp	w1, w1, [x19]
	add	x0, x19, #16
	bl	_local64_set
LBB0_4:
	ldr	x8, [x19, #24]
Lloh4:
	adrp	x9, _PERF_TYPE_RAW@GOTPAGE
Lloh5:
	ldr	x9, [x9, _PERF_TYPE_RAW@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	w8, #0
	b	LBB0_14
LBB0_6:
Lloh7:
	adrp	x9, _PERF_TYPE_HW_CACHE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PERF_TYPE_HW_CACHE@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_set_ext_hw_attr
LBB0_8:
	ldr	x0, [x19, #32]
Lloh10:
	adrp	x20, _x86_pmu@GOTPAGE
Lloh11:
	ldr	x20, [x20, _x86_pmu@GOTPAGEOFF]
	ldr	x8, [x20, #8]
	cmp	x0, x8
	b.ge	LBB0_12
; %bb.9:
	ldr	x8, [x20, #16]
	blr	x8
	cmn	x0, #1
	b.eq	LBB0_12
; %bb.10:
	cbnz	x0, LBB0_15
; %bb.11:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_14:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_15:
	ldr	x8, [x19, #32]
Lloh16:
	adrp	x9, _PERF_COUNT_HW_BRANCH_INSTRUCTIONS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PERF_COUNT_HW_BRANCH_INSTRUCTIONS@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.16:
	ldr	w8, [x19, #44]
	cbnz	w8, LBB0_20
; %bb.17:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_20
; %bb.18:
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_2
; %bb.19:
	ldr	w8, [x19, #40]
	cbz	w8, LBB0_2
LBB0_20:
	mov	w8, #0
	ldr	x9, [x19, #8]
	orr	x9, x9, x0
	str	x9, [x19, #8]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_x86_pmu,32,3                   ; @x86_pmu
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_PERF_TYPE_RAW,8,3              ; @PERF_TYPE_RAW
	.comm	_PERF_TYPE_HW_CACHE,8,3         ; @PERF_TYPE_HW_CACHE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_PERF_COUNT_HW_BRANCH_INSTRUCTIONS,8,3 ; @PERF_COUNT_HW_BRANCH_INSTRUCTIONS
.subsections_via_symbols
