	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nhmex_rbox_msr_enable_event
_nhmex_rbox_msr_enable_event:           ## @nhmex_rbox_msr_enable_event
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movslq	20(%rsi), %rax
	imulq	$715827883, %rax, %rcx          ## imm = 0x2AAAAAAB
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx), %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %eax
	cmpl	$5, %eax
	ja	LBB0_6
## %bb.1:
	movl	$3, %edx
	btl	%eax, %edx
	jb	LBB0_7
## %bb.2:
	movl	$12, %edx
	btl	%eax, %edx
	jae	LBB0_4
## %bb.3:
	leal	(%rcx,%rcx,4), %esi
	addl	%eax, %esi
	cmpl	$3, %eax
	adcl	$-1, %esi
	movl	28(%rbx), %r14d
	callq	_nhmex_rbox_shared_reg_config
	movl	%r14d, %edi
	movl	%eax, %esi
	jmp	LBB0_5
LBB0_7:
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	jmp	LBB0_5
LBB0_4:
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_wrmsrl
	movl	28(%rbx), %edi
	incl	%edi
	callq	_wrmsrl
	movl	12(%rbx), %esi
	movl	28(%rbx), %edi
	addl	$2, %edi
LBB0_5:
	callq	_wrmsrl
LBB0_6:
	movl	4(%rbx), %edi
	movq	_NHMEX_PMON_CTL_EN_BIT0@GOTPCREL(%rip), %rax
	movq	_NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%rbx), %esi
	orl	(%rax), %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_wrmsrl                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NHMEX_PMON_CTL_EN_BIT0,4,2     ## @NHMEX_PMON_CTL_EN_BIT0
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_MASK,4,2 ## @NHMEX_R_PMON_CTL_EV_SEL_MASK
	.no_dead_strip	_nhmex_rbox_msr_enable_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nhmex_rbox_msr_enable_event
_nhmex_rbox_msr_enable_event:           ; @nhmex_rbox_msr_enable_event
	.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, x1
	ldr	w9, [x1, #20]
	mov	w8, #43691
	movk	w8, #10922, lsl #16
	smull	x8, w9, w8
	lsr	x10, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w10
	mov	w10, #6
	msub	w9, w8, w10, w9
	cmp	w9, #5
	b.hi	LBB0_7
; %bb.1:
	mov	w10, #1
	lsl	w10, w10, w9
	tst	w10, #0x3
	b.ne	LBB0_4
; %bb.2:
	tst	w10, #0xc
	b.eq	LBB0_5
; %bb.3:
	cmp	w9, #2
	cset	w10, hi
	add	w8, w8, w8, lsl #2
	add	w8, w8, w9
	sub	w1, w8, w10
	ldr	w20, [x19, #28]
	bl	_nhmex_rbox_shared_reg_config
	mov	x1, x0
	mov	x0, x20
	b	LBB0_6
LBB0_4:
	ldp	w1, w0, [x19, #24]
	b	LBB0_6
LBB0_5:
	ldp	w1, w0, [x19, #24]
	bl	_wrmsrl
	ldr	w8, [x19, #28]
	add	w0, w8, #1
	bl	_wrmsrl
	ldr	w8, [x19, #28]
	add	w0, w8, #2
	ldr	w1, [x19, #12]
LBB0_6:
	bl	_wrmsrl
LBB0_7:
Lloh0:
	adrp	x8, _NHMEX_PMON_CTL_EN_BIT0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NHMEX_PMON_CTL_EN_BIT0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPAGEOFF]
	ldp	w10, w0, [x19]
Lloh5:
	ldr	w9, [x9]
	and	w9, w9, w10
	orr	w1, w9, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_wrmsrl
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NHMEX_PMON_CTL_EN_BIT0,4,2     ; @NHMEX_PMON_CTL_EN_BIT0
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_MASK,4,2 ; @NHMEX_R_PMON_CTL_EV_SEL_MASK
	.no_dead_strip	_nhmex_rbox_msr_enable_event
.subsections_via_symbols
