	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nhmex_rbox_hw_config
_nhmex_rbox_hw_config:                  ## @nhmex_rbox_hw_config
	.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	_NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	16(%rsi), %eax
	movq	_NHMEX_R_PMON_CTL_EV_SEL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	cmpl	$24, %eax
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_2:
	movq	%rsi, %rbx
	movl	%eax, 32(%rsi)
	movl	12(%rsi), %ecx
	movl	%ecx, 36(%rsi)
	movslq	%eax, %rcx
	imulq	$715827883, %rcx, %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
	xorl	%r14d, %r14d
	cmpl	$5, %eax
	ja	LBB0_10
## %bb.3:
	movq	(%rdi), %rdx
	movl	(%rdx), %edx
	leal	(%rcx,%rdx,4), %edi
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_6:
	callq	_NHMEX_R_MSR_PORTN_QLX_CFG
	movl	%eax, 40(%rbx)
	jmp	LBB0_10
LBB0_4:
	callq	_NHMEX_R_MSR_PORTN_IPERF_CFG0
	movl	%eax, 40(%rbx)
	jmp	LBB0_10
LBB0_5:
	callq	_NHMEX_R_MSR_PORTN_IPERF_CFG1
	movl	%eax, 40(%rbx)
	jmp	LBB0_10
LBB0_8:
	callq	_NHMEX_R_MSR_PORTN_XBR_SET2_MM_CFG
	jmp	LBB0_9
LBB0_7:
	callq	_NHMEX_R_MSR_PORTN_XBR_SET1_MM_CFG
LBB0_9:
	movl	%eax, 40(%rbx)
	movl	8(%rbx), %eax
	movl	%eax, 24(%rbx)
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_5
	.long	L0_0_set_6
	.long	L0_0_set_6
	.long	L0_0_set_7
	.long	L0_0_set_8
	.end_data_region
                                        ## -- End function
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_MASK,4,2 ## @NHMEX_R_PMON_CTL_EV_SEL_MASK
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_SHIFT,4,2 ## @NHMEX_R_PMON_CTL_EV_SEL_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_nhmex_rbox_hw_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nhmex_rbox_hw_config
_nhmex_rbox_hw_config:                  ; @nhmex_rbox_hw_config
	.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
	ldr	w8, [x1, #16]
Lloh0:
	adrp	x9, _NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NHMEX_R_PMON_CTL_EV_SEL_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh3:
	adrp	x9, _NHMEX_R_PMON_CTL_EV_SEL_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NHMEX_R_PMON_CTL_EV_SEL_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cmp	w8, #24
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_2:
	mov	x19, x1
	ldr	w9, [x1, #12]
	stp	w8, w9, [x1, #32]
	mov	w9, #43691
	movk	w9, #10922, lsl #16
	smull	x9, w8, w9
	lsr	x10, x9, #63
	lsr	x9, x9, #32
	add	w9, w9, w10
	mov	w10, #6
	msub	w8, w9, w10, w8
	cmp	w8, #5
	b.hi	LBB0_5
; %bb.3:
	ldr	x10, [x0]
	ldr	w10, [x10]
	add	w0, w9, w10, lsl #2
Lloh9:
	adrp	x9, lJTI0_0@PAGE
Lloh10:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_4
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_4:
	bl	_NHMEX_R_MSR_PORTN_QLX_CFG
	b	LBB0_8
LBB0_5:
	mov	w0, #0
	b	LBB0_12
LBB0_6:
	bl	_NHMEX_R_MSR_PORTN_IPERF_CFG0
	b	LBB0_8
LBB0_7:
	bl	_NHMEX_R_MSR_PORTN_IPERF_CFG1
LBB0_8:
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #40]
	b	LBB0_12
LBB0_9:
	bl	_NHMEX_R_MSR_PORTN_XBR_SET2_MM_CFG
	b	LBB0_11
LBB0_10:
	bl	_NHMEX_R_MSR_PORTN_XBR_SET1_MM_CFG
LBB0_11:
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #40]
	ldr	w8, [x19, #8]
	str	w8, [x19, #24]
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_4)>>2
	.byte	(LBB0_7-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_10-LBB0_4)>>2
	.byte	(LBB0_9-LBB0_4)>>2
                                        ; -- End function
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_MASK,4,2 ; @NHMEX_R_PMON_CTL_EV_SEL_MASK
	.comm	_NHMEX_R_PMON_CTL_EV_SEL_SHIFT,4,2 ; @NHMEX_R_PMON_CTL_EV_SEL_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_nhmex_rbox_hw_config
.subsections_via_symbols
