	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function __perf_evsel__read_on_cpu
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.globl	___perf_evsel__read_on_cpu
	.p2align	4, 0x90
___perf_evsel__read_on_cpu:             ## @__perf_evsel__read_on_cpu
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_FD
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	cmpq	$0, (%r12)
	jne	LBB0_6
## %bb.4:
	leal	1(%r14), %esi
	movq	%r12, %rdi
	callq	_perf_evsel__alloc_counts
	testq	%rax, %rax
	js	LBB0_5
LBB0_6:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	setne	%bl
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r13d, %edx
	callq	_FD
	shlq	$4, %rbx
	orq	$8, %rbx
	leaq	-64(%rbp), %rsi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	_readn
	testq	%rax, %rax
	js	LBB0_7
## %bb.8:
	testl	%r15d, %r15d
	je	LBB0_13
## %bb.9:
	movsd	-64(%rbp), %xmm0                ## xmm0 = mem[0],zero
	xorpd	%xmm1, %xmm1
	ucomisd	%xmm1, %xmm0
	jne	LBB0_11
	jp	LBB0_11
## %bb.10:
	movq	$0, -48(%rbp)
	jmp	LBB0_14
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_7:
	movq	_errno@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_13:
	xorpd	%xmm0, %xmm0
	movapd	%xmm0, -64(%rbp)
	jmp	LBB0_14
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_15
LBB0_11:
	movsd	-56(%rbp), %xmm1                ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	jbe	LBB0_14
## %bb.12:
	cvtsi2sdq	-48(%rbp), %xmm2
	mulsd	%xmm2, %xmm1
	divsd	%xmm0, %xmm1
	addsd	LCPI0_0(%rip), %xmm1
	cvttsd2si	%xmm1, %rax
	movq	%rax, -48(%rbp)
LBB0_14:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movslq	%r14d, %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movq	-48(%rbp), %rdx
	movq	%rdx, 16(%rax,%rcx,8)
	movaps	-64(%rbp), %xmm0
	movups	%xmm0, (%rax,%rcx,8)
	xorl	%eax, %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___perf_evsel__read_on_cpu      ; -- Begin function __perf_evsel__read_on_cpu
	.p2align	2
___perf_evsel__read_on_cpu:             ; @__perf_evsel__read_on_cpu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	bl	_FD
	tbnz	x0, #63, LBB0_7
; %bb.1:
	ldr	x8, [x20]
	cbnz	x8, LBB0_3
; %bb.2:
	add	w1, w19, #1
	mov	x0, x20
	bl	_perf_evsel__alloc_counts
	tbnz	x0, #63, LBB0_10
LBB0_3:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_FD
	cmp	w21, #0
	mov	w8, #24
	mov	w9, #8
	csel	x2, x9, x8, eq
	add	x1, sp, #8
	bl	_readn
	tbnz	x0, #63, LBB0_8
; %bb.4:
	cbz	w21, LBB0_9
; %bb.5:
	ldr	d0, [sp, #8]
	fcmp	d0, #0.0
	b.ne	LBB0_12
; %bb.6:
	str	xzr, [sp, #24]
	b	LBB0_14
LBB0_7:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh2:
	adrp	x8, _errno@GOTPAGE
Lloh3:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
	stp	xzr, xzr, [sp, #8]
	b	LBB0_14
LBB0_10:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_12:
	ldr	d1, [sp, #16]
	fcmp	d0, d1
	b.pl	LBB0_14
; %bb.13:
	ldr	d2, [sp, #24]
	scvtf	d2, d2
	fmul	d1, d1, d2
	fdiv	d0, d1, d0
	fmov	d1, #0.50000000
	fadd	d0, d0, d1
	fcvtzs	x8, d0
	str	x8, [sp, #24]
LBB0_14:
	mov	w0, #0
	ldr	x8, [x20]
	ldr	x8, [x8]
	mov	w9, #24
	smaddl	x8, w19, w9, x8
	ldur	q0, [sp, #8]
	ldr	x9, [sp, #24]
	str	x9, [x8, #16]
	str	q0, [x8]
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
