	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function Amd64SetupGdt
_Amd64SetupGdt:                         ## @Amd64SetupGdt
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	_KGDT64_NULL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$0, (%rax)
	movq	_KGDT64_R0_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$0, (%rax)
	movq	_KGDT64_R0_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$65535, (%rax)                  ## imm = 0xFFFF
	movq	_KGDT64_R3_CMCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$65535, (%rax)                  ## imm = 0xFFFF
	movq	_KGDT64_R3_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$65535, (%rax)                  ## imm = 0xFFFF
	movq	_KGDT64_R3_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$0, (%rax)
	movq	_KGDT64_R3_CMTEB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movl	$1342192640, (%rax)             ## imm = 0x50003C00
	movq	_KGDT64_SYS_TSS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_KiGetGdtEntry
	movq	_I386_TSS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%rax, %rdi
	movl	%r14d, %esi
	movl	$4, %edx
	xorl	%r8d, %r8d
	callq	_KiInitGdtEntry
	movl	%ebx, -20(%rbp)
	movq	_NUM_GDT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(,%rax,4), %eax
	movl	%eax, -24(%rbp)
	leaq	-24(%rbp), %rdi
	callq	___lgdt
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Amd64SetupGdt(GdtBase = %p, TssBase = %p)\n"

	.comm	_KGDT64_NULL,4,2                ## @KGDT64_NULL
	.comm	_KGDT64_R0_CODE,4,2             ## @KGDT64_R0_CODE
	.comm	_KGDT64_R0_DATA,4,2             ## @KGDT64_R0_DATA
	.comm	_KGDT64_R3_CMCODE,4,2           ## @KGDT64_R3_CMCODE
	.comm	_KGDT64_R3_DATA,4,2             ## @KGDT64_R3_DATA
	.comm	_KGDT64_R3_CODE,4,2             ## @KGDT64_R3_CODE
	.comm	_KGDT64_R3_CMTEB,4,2            ## @KGDT64_R3_CMTEB
	.comm	_KGDT64_SYS_TSS,4,2             ## @KGDT64_SYS_TSS
	.comm	_I386_TSS,4,2                   ## @I386_TSS
	.comm	_NUM_GDT,4,2                    ## @NUM_GDT
L_.str.1:                               ## @.str.1
	.asciz	"Leave Amd64SetupGdt()\n"

	.no_dead_strip	_Amd64SetupGdt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function Amd64SetupGdt
_Amd64SetupGdt:                         ; @Amd64SetupGdt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
	stp	x19, x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh2:
	adrp	x8, _KGDT64_NULL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KGDT64_NULL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	str	wzr, [x0]
Lloh5:
	adrp	x8, _KGDT64_R0_CODE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KGDT64_R0_CODE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	str	wzr, [x0]
Lloh8:
	adrp	x8, _KGDT64_R0_DATA@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KGDT64_R0_DATA@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	mov	w21, #65535
	str	w21, [x0]
Lloh11:
	adrp	x8, _KGDT64_R3_CMCODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KGDT64_R3_CMCODE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	str	w21, [x0]
Lloh14:
	adrp	x8, _KGDT64_R3_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KGDT64_R3_DATA@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	str	w21, [x0]
Lloh17:
	adrp	x8, _KGDT64_R3_CODE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KGDT64_R3_CODE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	str	wzr, [x0]
Lloh20:
	adrp	x8, _KGDT64_R3_CMTEB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KGDT64_R3_CMTEB@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
	mov	w8, #15360
	movk	w8, #20480, lsl #16
	str	w8, [x0]
Lloh23:
	adrp	x8, _KGDT64_SYS_TSS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KGDT64_SYS_TSS@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_KiGetGdtEntry
Lloh26:
	adrp	x8, _I386_TSS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _I386_TSS@GOTPAGEOFF]
Lloh28:
	ldr	w3, [x8]
	mov	x1, x20
	mov	w2, #4
	mov	w4, #0
	bl	_KiInitGdtEntry
Lloh29:
	adrp	x8, _NUM_GDT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NUM_GDT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	lsl	w8, w8, #2
	sub	w8, w8, #1
	stp	w8, w19, [sp, #24]
	add	x0, sp, #24
	bl	___lgdt
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Amd64SetupGdt(GdtBase = %p, TssBase = %p)\n"

	.comm	_KGDT64_NULL,4,2                ; @KGDT64_NULL
	.comm	_KGDT64_R0_CODE,4,2             ; @KGDT64_R0_CODE
	.comm	_KGDT64_R0_DATA,4,2             ; @KGDT64_R0_DATA
	.comm	_KGDT64_R3_CMCODE,4,2           ; @KGDT64_R3_CMCODE
	.comm	_KGDT64_R3_DATA,4,2             ; @KGDT64_R3_DATA
	.comm	_KGDT64_R3_CODE,4,2             ; @KGDT64_R3_CODE
	.comm	_KGDT64_R3_CMTEB,4,2            ; @KGDT64_R3_CMTEB
	.comm	_KGDT64_SYS_TSS,4,2             ; @KGDT64_SYS_TSS
	.comm	_I386_TSS,4,2                   ; @I386_TSS
	.comm	_NUM_GDT,4,2                    ; @NUM_GDT
l_.str.1:                               ; @.str.1
	.asciz	"Leave Amd64SetupGdt()\n"

	.no_dead_strip	_Amd64SetupGdt
.subsections_via_symbols
