	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_perf_event_update          ## -- Begin function x86_perf_event_update
	.p2align	4, 0x90
_x86_perf_event_update:                 ## @x86_perf_event_update
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	4(%rdi), %eax
	movq	_X86_PMC_IDX_FIXED_BTS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_4
## %bb.1:
	movq	%rdi, %r14
	movq	_x86_pmu@GOTPCREL(%rip), %rax
	movl	$64, %r15d
	subl	(%rax), %r15d
	leaq	12(%rdi), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_local64_read
	movl	%eax, %ebx
	movl	16(%r14), %edi
	callq	_rdmsrl
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_local64_cmpxchg
	cmpl	%ebx, %eax
	jne	LBB0_2
## %bb.3:
	movl	%r15d, %ecx
	shll	%cl, %ebx
	negl	%ebx
	sarl	%cl, %ebx
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_local64_add
	addq	$8, %r14
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_local64_sub
LBB0_4:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_x86_pmu,4,2                    ## @x86_pmu
	.comm	_X86_PMC_IDX_FIXED_BTS,4,2      ## @X86_PMC_IDX_FIXED_BTS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_x86_perf_event_update          ; -- Begin function x86_perf_event_update
	.p2align	2
_x86_perf_event_update:                 ; @x86_perf_event_update
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x0, #4]
Lloh0:
	adrp	x9, _X86_PMC_IDX_FIXED_BTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _X86_PMC_IDX_FIXED_BTS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _x86_pmu@GOTPAGE
Lloh4:
	ldr	x8, [x8, _x86_pmu@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #64
	sub	w22, w9, w8
	add	x20, x0, #12
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_local64_read
	mov	x21, x0
	ldr	w0, [x19, #16]
	bl	_rdmsrl
	mov	x0, x20
	mov	x1, x21
	bl	_local64_cmpxchg
	cmp	w0, w21
	b.ne	LBB0_2
; %bb.3:
	lsl	w8, w21, w22
	neg	w8, w8
	asr	w20, w8, w22
	mov	x0, x20
	mov	x1, x19
	bl	_local64_add
	add	x1, x19, #8
	mov	x0, x20
	bl	_local64_sub
LBB0_4:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_x86_pmu,4,2                    ; @x86_pmu
	.comm	_X86_PMC_IDX_FIXED_BTS,4,2      ; @X86_PMC_IDX_FIXED_BTS
.subsections_via_symbols
