	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_pmu_set_msr                ## -- Begin function kvm_pmu_set_msr
	.p2align	4, 0x90
_kvm_pmu_set_msr:                       ## @kvm_pmu_set_msr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rsi), %ebx
	movl	4(%rsi), %r15d
	movslq	%r15d, %r13
	leal	-128(%rbx), %eax
	cmpl	$3, %eax
	ja	LBB0_15
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_5:
	cmpl	$0, 8(%rsi)
	je	LBB0_6
## %bb.7:
	movl	%r15d, 4(%r14)
	jmp	LBB0_22
LBB0_15:
	movq	_MSR_IA32_PERFCTR0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_get_gp_pmc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_get_fixed_pmc
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_18
LBB0_17:
	movq	%r12, %rdi
	callq	_read_pmc
	subl	%eax, %r15d
	addl	%r15d, (%r12)
	jmp	LBB0_22
LBB0_11:
	movslq	12(%r14), %rax
	andq	%rax, %r13
	shlq	$2, %r13
	movl	$1, %eax
	testq	%r13, %r13
	jne	LBB0_23
## %bb.12:
	cmpl	$0, 8(%rsi)
	jne	LBB0_14
## %bb.13:
	movl	%r15d, %eax
	notl	%eax
	andl	%eax, 4(%r14)
LBB0_14:
	movl	%r15d, 16(%r14)
	jmp	LBB0_22
LBB0_8:
	xorl	%eax, %eax
	cmpl	%r15d, 8(%r14)
	je	LBB0_23
## %bb.9:
	movl	$1, %eax
	testl	%r15d, 12(%r14)
	jne	LBB0_23
## %bb.10:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_global_ctrl_changed
	jmp	LBB0_22
LBB0_2:
	xorl	%eax, %eax
	cmpl	%r15d, (%r14)
	je	LBB0_23
## %bb.3:
	movl	$1, %eax
	testl	$-3004, %r15d                   ## imm = 0xF444
	jne	LBB0_23
## %bb.4:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_reprogram_fixed_counters
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	$1, %eax
	jmp	LBB0_23
LBB0_18:
	movq	_MSR_P6_EVNTSEL0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_get_gp_pmc
	movq	%rax, %rdi
	movl	$1, %eax
	testq	%rdi, %rdi
	je	LBB0_23
## %bb.19:
	cmpl	4(%rdi), %r15d
	je	LBB0_22
## %bb.20:
	movabsq	$-4292870144, %rcx              ## imm = 0xFFFFFFFF00200000
	testq	%rcx, %r13
	jne	LBB0_23
## %bb.21:
	movl	%r15d, %esi
	callq	_reprogram_gp_counter
	jmp	LBB0_22
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_11
	.long	L0_0_set_8
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_MSR_IA32_PERFCTR0,4,2          ## @MSR_IA32_PERFCTR0
	.comm	_MSR_P6_EVNTSEL0,4,2            ## @MSR_P6_EVNTSEL0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kvm_pmu_set_msr                ; -- Begin function kvm_pmu_set_msr
	.p2align	2
_kvm_pmu_set_msr:                       ; @kvm_pmu_set_msr
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	ldp	w21, w19, [x1]
	sxtw	x23, w19
	sub	w8, w21, #128
	cmp	w8, #3
	b.hi	LBB0_4
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w8, [x1, #8]
	cbz	w8, LBB0_16
; %bb.3:
	mov	w0, #0
	str	w19, [x20, #4]
	b	LBB0_19
LBB0_4:
Lloh2:
	adrp	x8, _MSR_IA32_PERFCTR0@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MSR_IA32_PERFCTR0@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_get_gp_pmc
	mov	x22, x0
	cbnz	x0, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x21
	bl	_get_fixed_pmc
	mov	x22, x0
	cbz	x0, LBB0_20
LBB0_6:
	mov	x0, x22
	bl	_read_pmc
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x22]
	sub	w8, w19, w8
	add	w8, w8, w9
	str	w8, [x22]
	b	LBB0_19
LBB0_7:
	ldrsw	x8, [x20, #12]
	and	x8, x23, x8
	tst	x8, #0x3fffffffffffffff
	b.ne	LBB0_16
; %bb.8:
	ldr	w8, [x1, #8]
	cbnz	w8, LBB0_10
; %bb.9:
	ldr	w8, [x20, #4]
	bic	w8, w8, w19
	str	w8, [x20, #4]
LBB0_10:
	mov	w0, #0
	str	w19, [x20, #16]
	b	LBB0_19
LBB0_11:
	ldr	w8, [x20, #8]
	cmp	w8, w19
	b.eq	LBB0_18
; %bb.12:
	ldr	w8, [x20, #12]
	tst	w8, w19
	b.ne	LBB0_16
; %bb.13:
	mov	x0, x20
	mov	x1, x19
	bl	_global_ctrl_changed
	b	LBB0_18
LBB0_14:
	ldr	w8, [x20]
	cmp	w8, w19
	b.eq	LBB0_18
; %bb.15:
	mov	w8, #-3004
	tst	w19, w8
	b.eq	LBB0_17
LBB0_16:
	mov	w0, #1
	b	LBB0_19
LBB0_17:
	mov	x0, x20
	mov	x1, x19
	bl	_reprogram_fixed_counters
LBB0_18:
	mov	w0, #0
LBB0_19:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_20:
Lloh5:
	adrp	x8, _MSR_P6_EVNTSEL0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSR_P6_EVNTSEL0@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x21
	bl	_get_gp_pmc
	cbz	x0, LBB0_16
; %bb.21:
	ldr	w8, [x0, #4]
	cmp	w19, w8
	b.eq	LBB0_18
; %bb.22:
	mov	x8, #-65536
	movk	x8, #32, lsl #16
	tst	x23, x8
	b.ne	LBB0_16
; %bb.23:
	mov	x1, x19
	bl	_reprogram_gp_counter
	b	LBB0_18
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_14-LBB0_2)>>2
                                        ; -- End function
	.comm	_MSR_IA32_PERFCTR0,4,2          ; @MSR_IA32_PERFCTR0
	.comm	_MSR_P6_EVNTSEL0,4,2            ; @MSR_P6_EVNTSEL0
.subsections_via_symbols
