	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nhmex_mbox_get_shared_reg
_nhmex_mbox_get_shared_reg:             ## @nhmex_mbox_get_shared_reg
	.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	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %r14
	movq	_EXTRA_REG_NHMEX_M_ZDP_CTL_FVC@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	cmpl	%esi, %eax
	jle	LBB0_4
## %bb.1:
	movq	(%r14), %r12
	movslq	%r13d, %rax
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r12,%rbx,4), %r13
	leaq	(%r12,%rbx,4), %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	(%r12,%rbx,4), %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	xorl	%ebx, %ebx
	cmpl	%r15d, (%r13)
	jne	LBB0_20
LBB0_3:
	movq	%r12, %rdi
	callq	_atomic_inc
	movl	%r15d, (%r13)
	jmp	LBB0_19
LBB0_4:
	subl	%eax, %r13d
	xorl	%edi, %edi
	cmpl	$4, %r13d
	setge	%dil
	callq	_WARN_ON_ONCE
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jne	LBB0_21
## %bb.5:
	movq	_uncore_nhmex@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.7:
	movq	_WSMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_NHMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r14), %rbx
	movslq	(%r12), %rax
	leaq	(%rax,%rax,2), %r12
	leaq	(%rbx,%r12,4), %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	leaq	(%rbx,%r12,4), %rdi
	addq	$8, %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_atomic_read
	movl	%eax, %edi
	movl	%r13d, %esi
	movl	$8, %edx
	callq	___BITS_VALUE
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movq	_uncore_nhmex@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	movl	%r13d, %edi
	callq	_NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
	jmp	LBB0_12
LBB0_11:
	movl	%r13d, %edi
	callq	_WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
LBB0_12:
	orl	%eax, -48(%rbp)                 ## 4-byte Folded Spill
LBB0_13:
	leaq	(%rbx,%r12,4), %r12
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_atomic_read
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	(%r12), %eax
	xorl	%r15d, %eax
	xorl	%ebx, %ebx
	testl	%eax, -48(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_20
LBB0_15:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	leal	(,%r13,8), %ecx
	movl	$1, %edi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_atomic_add
	movq	_uncore_nhmex@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_17
## %bb.16:
	movq	_NHMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
	jmp	LBB0_18
LBB0_17:
	movq	_WSMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
LBB0_18:
	orl	%ebx, %eax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %ecx
	xorl	%ecx, %r15d
	andl	%eax, %r15d
	xorl	%ecx, %r15d
	movl	%r15d, (%rdx)
LBB0_19:
	movl	$1, %ebx
LBB0_20:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EXTRA_REG_NHMEX_M_ZDP_CTL_FVC,4,2 ## @EXTRA_REG_NHMEX_M_ZDP_CTL_FVC
	.comm	_uncore_nhmex,8,3               ## @uncore_nhmex
	.comm	_NHMEX_M_PMON_ZDP_CTL_FVC_MASK,4,2 ## @NHMEX_M_PMON_ZDP_CTL_FVC_MASK
	.comm	_WSMEX_M_PMON_ZDP_CTL_FVC_MASK,4,2 ## @WSMEX_M_PMON_ZDP_CTL_FVC_MASK
	.no_dead_strip	_nhmex_mbox_get_shared_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nhmex_mbox_get_shared_reg
_nhmex_mbox_get_shared_reg:             ; @nhmex_mbox_get_shared_reg
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x22, _EXTRA_REG_NHMEX_M_ZDP_CTL_FVC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EXTRA_REG_NHMEX_M_ZDP_CTL_FVC@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.1:
	ldr	x8, [x20]
	mov	w9, #12
	smaddl	x22, w1, w9, x8
	add	x20, x22, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x21, x22, #8
	mov	x0, x21
	bl	_atomic_read
	cbz	w0, LBB0_3
; %bb.2:
	ldr	w8, [x22]
	cmp	w8, w19
	b.ne	LBB0_13
LBB0_3:
	mov	x0, x21
	bl	_atomic_inc
	str	w19, [x22]
	b	LBB0_18
LBB0_4:
	sub	w21, w1, w8
	cmp	w21, #3
	cset	w0, gt
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_6
; %bb.5:
	mov	w19, #0
	b	LBB0_20
LBB0_6:
Lloh2:
	adrp	x26, _uncore_nhmex@GOTPAGE
Lloh3:
	ldr	x26, [x26, _uncore_nhmex@GOTPAGEOFF]
	ldr	x8, [x26]
Lloh4:
	adrp	x24, _WSMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPAGE
Lloh5:
	ldr	x24, [x24, _WSMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPAGEOFF]
Lloh6:
	adrp	x25, _NHMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPAGE
Lloh7:
	ldr	x25, [x25, _NHMEX_M_PMON_ZDP_CTL_FVC_MASK@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x24, x25, eq
	ldr	w27, [x8]
	ldr	x8, [x20]
	ldrsw	x9, [x22]
	mov	w10, #12
	madd	x23, x9, x10, x8
	add	x20, x23, #4
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x22, x23, #8
	mov	x0, x22
	bl	_atomic_read
	mov	x1, x21
	mov	w2, #8
	bl	___BITS_VALUE
	cbz	x0, LBB0_11
; %bb.7:
	ldr	x8, [x26]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
	b	LBB0_10
LBB0_9:
	mov	x0, x21
	bl	_WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
LBB0_10:
	orr	w27, w0, w27
LBB0_11:
	mov	x0, x22
	bl	_atomic_read
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w8, [x23]
	eor	w8, w8, w19
	tst	w8, w27
	b.eq	LBB0_14
LBB0_13:
	mov	w19, #0
	b	LBB0_19
LBB0_14:
	lsl	w8, w21, #3
	mov	w9, #1
	lsl	w0, w9, w8
	mov	x1, x22
	bl	_atomic_add
	ldr	x8, [x26]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	w22, [x25]
	mov	x0, x21
	bl	_NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
	b	LBB0_17
LBB0_16:
	ldr	w22, [x24]
	mov	x0, x21
	bl	_WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK
LBB0_17:
	orr	w8, w0, w22
	ldr	w9, [x23]
	bic	w9, w9, w8
	and	w8, w8, w19
	orr	w8, w9, w8
	str	w8, [x23]
LBB0_18:
	mov	w19, #1
LBB0_19:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_20:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EXTRA_REG_NHMEX_M_ZDP_CTL_FVC,4,2 ; @EXTRA_REG_NHMEX_M_ZDP_CTL_FVC
	.comm	_uncore_nhmex,8,3               ; @uncore_nhmex
	.comm	_NHMEX_M_PMON_ZDP_CTL_FVC_MASK,4,2 ; @NHMEX_M_PMON_ZDP_CTL_FVC_MASK
	.comm	_WSMEX_M_PMON_ZDP_CTL_FVC_MASK,4,2 ; @WSMEX_M_PMON_ZDP_CTL_FVC_MASK
	.no_dead_strip	_nhmex_mbox_get_shared_reg
.subsections_via_symbols
