	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amd_thresholding_update
_amd_thresholding_update:               ## @amd_thresholding_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	%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
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movl	%edi, %r15d
	movq	_amd_et_state@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	movq	(%rbx,%rax,8), %r14
	movslq	%r12d, %r13
	movq	_mca_msr_ops@GOTPCREL(%rip), %rax
	movl	%r13d, %edi
	callq	*(%rax)
	movl	%eax, %edi
	callq	_rdmsr
	movl	%eax, %r12d
	movq	_MC_MISC_AMD_CNT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	movq	_MC_MISC_AMD_CNT_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_MC_MISC_AMD_CNT_MAX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r9d
	subl	%r9d, %eax
	movl	(%r14,%r13,8), %r8d
	movl	4(%r14,%r13,8), %edx
	addl	%r8d, %eax
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_update_threshold
	movl	%eax, (%r14,%r13,8)
	movq	_MC_MISC_AMD_CNT_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%r12d, %edx
	movl	(%rbx), %esi
	subl	%eax, %esi
	movq	_MC_MISC_AMD_CNT_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	orl	%edx, %esi
	movq	_MC_MISC_AMD_OVERFLOW@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	%esi, %ebx
	movl	%r13d, %edi
	movq	_mca_msr_ops@GOTPCREL(%rip), %rax
	callq	*(%rax)
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_wrmsr
	testl	%r15d, %r15d
	je	LBB0_3
## %bb.1:
	movq	_CMCI@GOTPCREL(%rip), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_time_uptime@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14,%r13,8)
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amd_et_state,8,3               ## @amd_et_state
	.comm	_cpuid,4,2                      ## @cpuid
	.comm	_mca_msr_ops,8,3                ## @mca_msr_ops
	.comm	_MC_MISC_AMD_CNT_MASK,4,2       ## @MC_MISC_AMD_CNT_MASK
	.comm	_MC_MISC_AMD_CNT_SHIFT,4,2      ## @MC_MISC_AMD_CNT_SHIFT
	.comm	_MC_MISC_AMD_CNT_MAX,4,2        ## @MC_MISC_AMD_CNT_MAX
	.comm	_MC_MISC_AMD_OVERFLOW,4,2       ## @MC_MISC_AMD_OVERFLOW
	.comm	_CMCI,4,2                       ## @CMCI
	.comm	_time_uptime,4,2                ## @time_uptime
	.no_dead_strip	_amd_thresholding_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amd_thresholding_update
_amd_thresholding_update:               ; @amd_thresholding_update
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _amd_et_state@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amd_et_state@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
Lloh3:
	adrp	x8, _cpuid@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cpuid@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_PCPU_GET
	ldr	x24, [x22, x0, lsl #3]
Lloh6:
	adrp	x8, _mca_msr_ops@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mca_msr_ops@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	mov	x0, x21
	blr	x8
	bl	_rdmsr
	mov	x22, x0
Lloh9:
	adrp	x26, _MC_MISC_AMD_CNT_MASK@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MC_MISC_AMD_CNT_MASK@GOTPAGEOFF]
	ldr	w8, [x26]
	and	w8, w8, w0
Lloh11:
	adrp	x27, _MC_MISC_AMD_CNT_SHIFT@GOTPAGE
Lloh12:
	ldr	x27, [x27, _MC_MISC_AMD_CNT_SHIFT@GOTPAGEOFF]
	ldr	w9, [x27]
	asr	w8, w8, w9
Lloh13:
	adrp	x28, _MC_MISC_AMD_CNT_MAX@GOTPAGE
Lloh14:
	ldr	x28, [x28, _MC_MISC_AMD_CNT_MAX@GOTPAGEOFF]
	ldr	w5, [x28]
	sbfiz	x25, x21, #3, #32
	add	x23, x24, x25
	ldr	w4, [x24, x25]
	sub	w8, w8, w5
	add	w3, w8, w4
	ldr	w2, [x23, #4]!
	mov	x0, x19
	mov	x1, x20
	bl	_update_threshold
	str	w0, [x24, x25]
	ldr	w8, [x26]
	bic	w8, w22, w8
	ldr	w9, [x28]
	sub	w9, w9, w0
	ldr	w10, [x27]
	lsl	w9, w9, w10
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _MC_MISC_AMD_OVERFLOW@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MC_MISC_AMD_OVERFLOW@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	bic	w22, w8, w9
Lloh18:
	adrp	x8, _mca_msr_ops@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mca_msr_ops@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	mov	x0, x21
	blr	x8
	mov	x1, x22
	bl	_wrmsr
	cbz	w20, LBB0_3
; %bb.1:
Lloh21:
	adrp	x8, _CMCI@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CMCI@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_3
; %bb.2:
Lloh24:
	adrp	x8, _time_uptime@GOTPAGE
Lloh25:
	ldr	x8, [x8, _time_uptime@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x23]
LBB0_3:
	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 AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_amd_et_state,8,3               ; @amd_et_state
	.comm	_cpuid,4,2                      ; @cpuid
	.comm	_mca_msr_ops,8,3                ; @mca_msr_ops
	.comm	_MC_MISC_AMD_CNT_MASK,4,2       ; @MC_MISC_AMD_CNT_MASK
	.comm	_MC_MISC_AMD_CNT_SHIFT,4,2      ; @MC_MISC_AMD_CNT_SHIFT
	.comm	_MC_MISC_AMD_CNT_MAX,4,2        ; @MC_MISC_AMD_CNT_MAX
	.comm	_MC_MISC_AMD_OVERFLOW,4,2       ; @MC_MISC_AMD_OVERFLOW
	.comm	_CMCI,4,2                       ; @CMCI
	.comm	_time_uptime,4,2                ; @time_uptime
	.no_dead_strip	_amd_thresholding_update
.subsections_via_symbols
