	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __set_gcr3
___set_gcr3:                            ## @__set_gcr3
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_PAGE_MODE_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	8(%rdi), %esi
	movl	12(%rdi), %edi
	movl	%r14d, %edx
	movl	$1, %ecx
	callq	___get_gcr3_pte
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	andq	(%rcx), %r15
	movq	_GCR3_VALID@GOTPCREL(%rip), %rcx
	orq	(%rcx), %r15
	movq	%r15, (%rax)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___amd_iommu_flush_tlb          ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MODE_NONE,8,3             ## @PAGE_MODE_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_GCR3_VALID,8,3                 ## @GCR3_VALID
	.no_dead_strip	___set_gcr3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __set_gcr3
___set_gcr3:                            ; @__set_gcr3
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PAGE_MODE_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_MODE_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #12]
	ldr	w1, [x20, #8]
	mov	x2, x19
	mov	w3, #1
	bl	___get_gcr3_pte
	cbz	x0, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _GCR3_VALID@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GCR3_VALID@GOTPAGEOFF]
	and	x8, x8, x21
Lloh8:
	ldr	x9, [x9]
	orr	x8, x8, x9
	str	x8, [x0]
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	___amd_iommu_flush_tlb
LBB0_3:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MODE_NONE,8,3             ; @PAGE_MODE_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_GCR3_VALID,8,3                 ; @GCR3_VALID
	.no_dead_strip	___set_gcr3
.subsections_via_symbols
