	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amd_set_mtrr
_amd_set_mtrr:                          ## @amd_set_mtrr
	.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	%ecx, %r12d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MSR_K6_UWCCR@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_rdmsr
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	negq	%rbx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	$15, %cl
	subb	%al, %cl
	shrq	%cl, %rbx
	andl	$131068, %ebx                   ## imm = 0x1FFFC
	movl	%eax, %ecx
	shlq	%cl, %r15
	incl	%r12d
	movslq	%r12d, %rax
	orq	%r15, %rax
	orq	%rbx, %rax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	movl	%r14d, %ecx
	movq	%rax, -64(%rbp,%rcx,8)
	xorl	%eax, %eax
	callq	_wbinvd
	movl	(%r13), %edi
	movq	-64(%rbp), %rsi
	movq	-56(%rbp), %rdx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_4
## %bb.5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wrmsr                          ## TAILCALL
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MSR_K6_UWCCR,4,2               ## @MSR_K6_UWCCR
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_amd_set_mtrr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amd_set_mtrr
_amd_set_mtrr:                          ; @amd_set_mtrr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x23, _MSR_K6_UWCCR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MSR_K6_UWCCR@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_rdmsr
	cbz	x22, LBB0_2
; %bb.1:
	neg	x8, x22
Lloh5:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	mov	w10, #15
	sub	w10, w10, w9
	lsr	x8, x8, x10
	and	x8, x8, #0x1fffc
	lsl	x9, x21, x9
	add	w10, w20, #1
	sxtw	x10, w10
	orr	x9, x9, x10
	orr	x8, x9, x8
	b	LBB0_3
LBB0_2:
	mov	x8, #0
LBB0_3:
	add	x9, sp, #8
	str	x8, [x9, w19, uxtw #3]
	bl	_wbinvd
	ldr	w0, [x23]
	ldp	x1, x2, [sp, #8]
	ldr	x8, [sp, #24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
	add	sp, sp, #96
	b	_wrmsr
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MSR_K6_UWCCR,4,2               ; @MSR_K6_UWCCR
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_amd_set_mtrr
.subsections_via_symbols
