	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadAndBootWindowsCommon       ## -- Begin function LoadAndBootWindowsCommon
	.p2align	4, 0x90
_LoadAndBootWindowsCommon:              ## @LoadAndBootWindowsCommon
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %r13
	movl	%edi, %r15d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	xorl	%edi, %edi
	testl	%r15d, %r15d
	setne	%dil
	callq	_ASSERT
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_strstr
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_UiDrawBackdrop
	leaq	L_.str.2(%rip), %rdx
	movl	$20, %edi
	movl	$100, %esi
	callq	_UiDrawProgressBarCenter
	xorl	%eax, %eax
	callq	_MachHwDetect
	movl	%eax, 8(%r13)
	leaq	-48(%rbp), %r8
	movl	%r15d, %edi
	movq	%r13, %rsi
	movq	%r12, %rdx
	movq	%r14, %rcx
	callq	_LoadWindowsCore
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_UiDrawBackdrop
	leaq	L_.str.4(%rip), %rdx
	movl	$100, %edi
	movl	$100, %esi
	callq	_UiDrawProgressBarCenter
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_WinLdrLoadBootDrivers
	testq	%rax, %rax
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rax, %rsi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	xorl	%eax, %eax
	callq	_IniCleanup
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	movl	%r15d, %r8d
	callq	_WinLdrInitializePhase1
	movq	-48(%rbp), %rax
	movq	(%rax), %r14
	movq	%r13, %rdi
	callq	_PaToVa
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_MachPrepareForReactOS
	movq	%r13, %rdi
	callq	_WinLdrSetupMachineDependent
	movq	%r13, %rdi
	callq	_WinLdrSetupMemoryLayout
	xorl	%eax, %eax
	callq	_WinLdrSetProcessorContext
	movq	_LoaderPagesSpanned@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r13), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str.8(%rip), %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_TRACE
	movq	_KI_USER_SHARED_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MM_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_RtlZeroMemory
	movq	%rbx, %rdi
	callq	_WinLdrpDumpMemoryDescriptors
	movq	%rbx, %rdi
	callq	_WinLdrpDumpBootDriver
	movq	%rbx, %rdi
	callq	_WinLdrpDumpArcDisks
	movq	%rbx, %rdi
	callq	*%r14
	movq	_ESUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str.3(%rip), %rdi
	callq	_UiMessageBox
	movq	_ENOEXEC@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LoadAndBootWindowsCommon()\n"

L_.str.1:                               ## @.str.1
	.asciz	"\\"

L_.str.2:                               ## @.str.2
	.asciz	"Detecting hardware..."

L_.str.3:                               ## @.str.3
	.asciz	"Error loading NTOS core."

	.comm	_ENOEXEC,4,2                    ## @ENOEXEC
L_.str.4:                               ## @.str.4
	.asciz	"Loading boot drivers..."

L_.str.5:                               ## @.str.5
	.asciz	"Boot drivers loading %s\n"

L_.str.6:                               ## @.str.6
	.asciz	"successful"

L_.str.7:                               ## @.str.7
	.asciz	"failed"

	.comm	_LoaderPagesSpanned,4,2         ## @LoaderPagesSpanned
L_.str.8:                               ## @.str.8
	.asciz	"Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n"

	.comm	_KI_USER_SHARED_DATA,8,3        ## @KI_USER_SHARED_DATA
	.comm	_MM_PAGE_SIZE,4,2               ## @MM_PAGE_SIZE
	.comm	_ESUCCESS,4,2                   ## @ESUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_LoadAndBootWindowsCommon       ; -- Begin function LoadAndBootWindowsCommon
	.p2align	2
_LoadAndBootWindowsCommon:              ; @LoadAndBootWindowsCommon
	.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	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	cmp	w21, #0
	cset	w0, ne
	bl	_ASSERT
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_strstr
	mov	x23, x0
	bl	_UiDrawBackdrop
Lloh4:
	adrp	x2, l_.str.2@PAGE
Lloh5:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w0, #20
	mov	w1, #100
	bl	_UiDrawProgressBarCenter
	bl	_MachHwDetect
	str	w0, [x19, #8]
	add	x4, sp, #24
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	mov	x3, x20
	bl	_LoadWindowsCore
	cbz	x0, LBB0_2
; %bb.1:
	bl	_UiDrawBackdrop
Lloh6:
	adrp	x2, l_.str.4@PAGE
Lloh7:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	w0, #100
	mov	w1, #100
	bl	_UiDrawProgressBarCenter
	mov	x0, x19
	mov	x1, x20
	bl	_WinLdrLoadBootDrivers
Lloh8:
	adrp	x8, l_.str.6@PAGE
Lloh9:
	add	x8, x8, l_.str.6@PAGEOFF
Lloh10:
	adrp	x9, l_.str.7@PAGE
Lloh11:
	add	x9, x9, l_.str.7@PAGEOFF
	cmp	x0, #0
	csel	x8, x9, x8, eq
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.5@PAGE
Lloh13:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_TRACE
	bl	_IniCleanup
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	mov	x3, x20
	mov	x4, x21
	bl	_WinLdrInitializePhase1
	ldr	x8, [sp, #24]
	ldr	x21, [x8]
	mov	x0, x19
	bl	_PaToVa
	mov	x20, x0
	bl	_MachPrepareForReactOS
	mov	x0, x19
	bl	_WinLdrSetupMachineDependent
	mov	x0, x19
	bl	_WinLdrSetupMemoryLayout
	bl	_WinLdrSetProcessorContext
Lloh14:
	adrp	x8, _LoaderPagesSpanned@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LoaderPagesSpanned@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	x9, [x19]
	str	w8, [x9]
	stp	x21, x20, [sp]
Lloh17:
	adrp	x0, l_.str.8@PAGE
Lloh18:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_TRACE
Lloh19:
	adrp	x8, _KI_USER_SHARED_DATA@GOTPAGE
Lloh20:
	ldr	x8, [x8, _KI_USER_SHARED_DATA@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x8, _MM_PAGE_SIZE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MM_PAGE_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	bl	_RtlZeroMemory
	mov	x0, x20
	bl	_WinLdrpDumpMemoryDescriptors
	mov	x0, x20
	bl	_WinLdrpDumpBootDriver
	mov	x0, x20
	bl	_WinLdrpDumpArcDisks
	mov	x0, x20
	blr	x21
Lloh25:
	adrp	x8, _ESUCCESS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ESUCCESS@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh27:
	adrp	x0, l_.str.3@PAGE
Lloh28:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_UiMessageBox
Lloh29:
	adrp	x8, _ENOEXEC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOEXEC@GOTPAGEOFF]
LBB0_3:
	ldr	w0, [x8]
	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
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LoadAndBootWindowsCommon()\n"

l_.str.1:                               ; @.str.1
	.asciz	"\\"

l_.str.2:                               ; @.str.2
	.asciz	"Detecting hardware..."

l_.str.3:                               ; @.str.3
	.asciz	"Error loading NTOS core."

	.comm	_ENOEXEC,4,2                    ; @ENOEXEC
l_.str.4:                               ; @.str.4
	.asciz	"Loading boot drivers..."

l_.str.5:                               ; @.str.5
	.asciz	"Boot drivers loading %s\n"

l_.str.6:                               ; @.str.6
	.asciz	"successful"

l_.str.7:                               ; @.str.7
	.asciz	"failed"

	.comm	_LoaderPagesSpanned,4,2         ; @LoaderPagesSpanned
l_.str.8:                               ; @.str.8
	.asciz	"Hello from paged mode, KiSystemStartup %p, LoaderBlockVA %p!\n"

	.comm	_KI_USER_SHARED_DATA,8,3        ; @KI_USER_SHARED_DATA
	.comm	_MM_PAGE_SIZE,4,2               ; @MM_PAGE_SIZE
	.comm	_ESUCCESS,4,2                   ; @ESUCCESS
.subsections_via_symbols
