	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WinLdrSetupMachineDependent    ## -- Begin function WinLdrSetupMachineDependent
	.p2align	4, 0x90
_WinLdrSetupMachineDependent:           ## @WinLdrSetupMachineDependent
	.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	_DbgPrint@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rdi)
	movq	_MACHINE_TYPE_ISA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	movq	_MM_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	addl	%edi, %edi
	movq	_LoaderStartupPcrPage@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MmAllocateMemoryWithType
	movq	_MM_PAGE_SHIFT@GOTPCREL(%rip), %r14
	movb	(%r14), %cl
	movl	%eax, %edx
	sarl	%cl, %edx
	movq	_PcrBasePage@GOTPCREL(%rip), %rcx
	movl	%edx, (%rcx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movslq	%eax, %rdi
	movl	(%rbx), %esi
	addl	%esi, %esi
	callq	_RtlZeroMemory
	movl	(%rbx), %edi
	leal	4(%rdi), %eax
	negl	%edi
	andl	%eax, %edi
	movq	_LoaderMemoryData@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MmAllocateMemoryWithType
	movq	_NUM_GDT@GOTPCREL(%rip), %rcx
	movq	_NUM_IDT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	addl	(%rcx), %edx
	movb	(%r14), %cl
	sarl	%cl, %eax
	movl	(%rbx), %edi
	leal	(%rdi,%rdx,4), %ebx
	decl	%ebx
	sarl	%cl, %ebx
	movq	_TssBasePage@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	imull	%ebx, %edi
	movl	(%r15), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MmAllocateMemoryWithType
	movq	_GdtIdt@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movb	(%r14), %cl
	shll	%cl, %ebx
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_RtlZeroMemory
	xorl	%eax, %eax
	callq	_MempAllocatePageTables
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WinLdrMapSpecialPages          ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_UiMessageBox                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DbgPrint,8,3                   ## @DbgPrint
	.comm	_MACHINE_TYPE_ISA,4,2           ## @MACHINE_TYPE_ISA
	.comm	_MM_PAGE_SIZE,4,2               ## @MM_PAGE_SIZE
	.comm	_LoaderStartupPcrPage,4,2       ## @LoaderStartupPcrPage
	.comm	_MM_PAGE_SHIFT,4,2              ## @MM_PAGE_SHIFT
	.comm	_PcrBasePage,4,2                ## @PcrBasePage
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate PCR."

	.comm	_LoaderMemoryData,4,2           ## @LoaderMemoryData
	.comm	_TssBasePage,4,2                ## @TssBasePage
	.comm	_NUM_GDT,4,2                    ## @NUM_GDT
	.comm	_NUM_IDT,4,2                    ## @NUM_IDT
	.comm	_GdtIdt,8,3                     ## @GdtIdt
L_.str.1:                               ## @.str.1
	.asciz	"Can't allocate pages for GDT+IDT!"

	.comm	_FALSE,8,3                      ## @FALSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WinLdrSetupMachineDependent    ; -- Begin function WinLdrSetupMachineDependent
	.p2align	2
_WinLdrSetupMachineDependent:           ; @WinLdrSetupMachineDependent
	.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
Lloh0:
	adrp	x8, _DbgPrint@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DbgPrint@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [x0, #8]
Lloh3:
	adrp	x8, _MACHINE_TYPE_ISA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MACHINE_TYPE_ISA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x20, _MM_PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MM_PAGE_SIZE@GOTPAGEOFF]
	str	w8, [x0]
	ldr	w8, [x20]
	lsl	w0, w8, #1
Lloh8:
	adrp	x8, _LoaderStartupPcrPage@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LoaderStartupPcrPage@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_MmAllocateMemoryWithType
Lloh11:
	adrp	x19, _MM_PAGE_SHIFT@GOTPAGE
Lloh12:
	ldr	x19, [x19, _MM_PAGE_SHIFT@GOTPAGEOFF]
	ldr	w8, [x19]
	asr	w8, w0, w8
Lloh13:
	adrp	x9, _PcrBasePage@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PcrBasePage@GOTPAGEOFF]
Lloh15:
	str	w8, [x9]
	cbz	w0, LBB0_3
; %bb.1:
	sxtw	x0, w0
	ldr	w8, [x20]
	lsl	w1, w8, #1
	bl	_RtlZeroMemory
	ldr	w8, [x20]
	add	w9, w8, #4
	neg	w8, w8
	and	w0, w9, w8
Lloh16:
	adrp	x21, _LoaderMemoryData@GOTPAGE
Lloh17:
	ldr	x21, [x21, _LoaderMemoryData@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_MmAllocateMemoryWithType
	ldr	w8, [x19]
	asr	w9, w0, w8
Lloh18:
	adrp	x10, _TssBasePage@GOTPAGE
Lloh19:
	ldr	x10, [x10, _TssBasePage@GOTPAGEOFF]
Lloh20:
	adrp	x11, _NUM_GDT@GOTPAGE
Lloh21:
	ldr	x11, [x11, _NUM_GDT@GOTPAGEOFF]
Lloh22:
	str	w9, [x10]
Lloh23:
	ldr	w9, [x11]
Lloh24:
	adrp	x10, _NUM_IDT@GOTPAGE
Lloh25:
	ldr	x10, [x10, _NUM_IDT@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	add	w9, w10, w9
	ldr	w10, [x20]
	add	w9, w10, w9, lsl #2
	sub	w9, w9, #1
	asr	w20, w9, w8
	mul	w0, w20, w10
	ldr	w1, [x21]
	bl	_MmAllocateMemoryWithType
Lloh27:
	adrp	x8, _GdtIdt@GOTPAGE
Lloh28:
	ldr	x8, [x8, _GdtIdt@GOTPAGEOFF]
Lloh29:
	str	x0, [x8]
	cbz	x0, LBB0_4
; %bb.2:
	ldr	w8, [x19]
	lsl	w1, w20, w8
	bl	_RtlZeroMemory
	bl	_MempAllocatePageTables
	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	_WinLdrMapSpecialPages
LBB0_3:
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	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	_UiMessageBox
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_DbgPrint,8,3                   ; @DbgPrint
	.comm	_MACHINE_TYPE_ISA,4,2           ; @MACHINE_TYPE_ISA
	.comm	_MM_PAGE_SIZE,4,2               ; @MM_PAGE_SIZE
	.comm	_LoaderStartupPcrPage,4,2       ; @LoaderStartupPcrPage
	.comm	_MM_PAGE_SHIFT,4,2              ; @MM_PAGE_SHIFT
	.comm	_PcrBasePage,4,2                ; @PcrBasePage
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate PCR."

	.comm	_LoaderMemoryData,4,2           ; @LoaderMemoryData
	.comm	_TssBasePage,4,2                ; @TssBasePage
	.comm	_NUM_GDT,4,2                    ; @NUM_GDT
	.comm	_NUM_IDT,4,2                    ; @NUM_IDT
	.comm	_GdtIdt,8,3                     ; @GdtIdt
l_.str.1:                               ; @.str.1
	.asciz	"Can't allocate pages for GDT+IDT!"

	.comm	_FALSE,8,3                      ; @FALSE
.subsections_via_symbols
