	.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	$0, 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:
	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
	movl	(%r14), %ecx
	movl	%eax, %edx
	sarl	%cl, %edx
	movq	_TssBasePage@GOTPCREL(%rip), %rsi
	movl	%edx, (%rsi)
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	_NUM_GDT@GOTPCREL(%rip), %rax
	movq	_NUM_IDT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	addl	(%rax), %edx
	movl	(%rbx), %edi
	leal	(%rdi,%rdx,4), %ebx
	decl	%ebx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %ebx
	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_6
## %bb.7:
	movb	(%r14), %cl
	shll	%cl, %ebx
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_RtlZeroMemory
	xorl	%eax, %eax
	callq	_MempAllocatePageTables
	movq	_FALSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	callq	_BugCheck
LBB0_9:
	xorl	%eax, %eax
	callq	_WinLdrMapSpecialPages
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WinLdrSetupSpecialDataPointers ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_UiMessageBox                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.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	"Could not allocate PCR."

	.comm	_LoaderMemoryData,4,2           ## @LoaderMemoryData
	.comm	_TssBasePage,4,2                ## @TssBasePage
L_.str.1:                               ## @.str.1
	.asciz	"Could not allocate TSS."

	.comm	_NUM_GDT,4,2                    ## @NUM_GDT
	.comm	_NUM_IDT,4,2                    ## @NUM_IDT
	.comm	_GdtIdt,8,3                     ## @GdtIdt
L_.str.2:                               ## @.str.2
	.asciz	"Could not allocate pages for GDT+IDT!"

	.comm	_FALSE,8,3                      ## @FALSE
L_.str.3:                               ## @.str.3
	.asciz	"MempAllocatePageTables failed!\n"

.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
	str	xzr, [x0, #8]
Lloh0:
	adrp	x8, _MACHINE_TYPE_ISA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MACHINE_TYPE_ISA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x20, _MM_PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x20, [x20, _MM_PAGE_SIZE@GOTPAGEOFF]
	str	w8, [x0]
	ldr	w8, [x20]
	lsl	w0, w8, #1
Lloh5:
	adrp	x8, _LoaderStartupPcrPage@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LoaderStartupPcrPage@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_MmAllocateMemoryWithType
Lloh8:
	adrp	x19, _MM_PAGE_SHIFT@GOTPAGE
Lloh9:
	ldr	x19, [x19, _MM_PAGE_SHIFT@GOTPAGEOFF]
	ldr	w8, [x19]
	asr	w8, w0, w8
Lloh10:
	adrp	x9, _PcrBasePage@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PcrBasePage@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
	cbz	w0, LBB0_6
; %bb.1:
	ldr	w8, [x20]
	add	w9, w8, #4
	neg	w8, w8
	and	w0, w9, w8
Lloh13:
	adrp	x21, _LoaderMemoryData@GOTPAGE
Lloh14:
	ldr	x21, [x21, _LoaderMemoryData@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_MmAllocateMemoryWithType
	ldr	w8, [x19]
	asr	w9, w0, w8
Lloh15:
	adrp	x10, _TssBasePage@GOTPAGE
Lloh16:
	ldr	x10, [x10, _TssBasePage@GOTPAGEOFF]
Lloh17:
	str	w9, [x10]
	cbz	w0, LBB0_7
; %bb.2:
Lloh18:
	adrp	x9, _NUM_GDT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NUM_GDT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _NUM_IDT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _NUM_IDT@GOTPAGEOFF]
Lloh23:
	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
Lloh24:
	adrp	x8, _GdtIdt@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GdtIdt@GOTPAGEOFF]
Lloh26:
	str	x0, [x8]
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w8, [x19]
	lsl	w1, w20, w8
	bl	_RtlZeroMemory
	bl	_MempAllocatePageTables
Lloh27:
	adrp	x8, _FALSE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.4:
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_BugCheck
LBB0_5:
	bl	_WinLdrMapSpecialPages
	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	_WinLdrSetupSpecialDataPointers
LBB0_6:
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh36:
	adrp	x0, l_.str.2@PAGE
Lloh37:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_9:
	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	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.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	"Could not allocate PCR."

	.comm	_LoaderMemoryData,4,2           ; @LoaderMemoryData
	.comm	_TssBasePage,4,2                ; @TssBasePage
l_.str.1:                               ; @.str.1
	.asciz	"Could not allocate TSS."

	.comm	_NUM_GDT,4,2                    ; @NUM_GDT
	.comm	_NUM_IDT,4,2                    ; @NUM_IDT
	.comm	_GdtIdt,8,3                     ; @GdtIdt
l_.str.2:                               ; @.str.2
	.asciz	"Could not allocate pages for GDT+IDT!"

	.comm	_FALSE,8,3                      ; @FALSE
l_.str.3:                               ; @.str.3
	.asciz	"MempAllocatePageTables failed!\n"

.subsections_via_symbols
