	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcMemGetMemoryMap              ## -- Begin function PcMemGetMemoryMap
	.p2align	4, 0x90
_PcMemGetMemoryMap:                     ## @PcMemGetMemoryMap
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	xorl	%eax, %eax
	callq	_PcMemCheckUsableMemorySize
	movq	_PcMemoryMap@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_MAX_BIOS_DESCRIPTORS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_PcMemGetBiosMemoryMap
	testq	%rax, %rax
	jne	LBB0_14
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	leaq	-80(%rbp), %rdi
	leaq	-72(%rbp), %rsi
	callq	_GetExtendedMemoryConfiguration
	movl	(%r13), %ebx
	movl	(%r14), %r15d
	xorl	%eax, %eax
	callq	_PcMemGetConventionalMemorySize
	shll	$10, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	cltd
	idivl	(%r12)
	movslq	%eax, %rcx
	movq	_LoaderFree@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%ebx, %edi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_AddMemoryDescriptor
	movl	(%r13), %edi
	movl	(%r14), %esi
	movslq	(%r12), %rbx
	movl	$1048576, %eax                  ## imm = 0x100000
	xorl	%edx, %edx
	idivl	%ebx
	movslq	%eax, %rcx
	movq	-80(%rbp), %rax
	shlq	$10, %rax
	movq	%rax, %rdx
	orq	%rbx, %rdx
	shrq	$32, %rdx
	je	LBB0_2
## %bb.3:
	cqto
	idivq	%rbx
	jmp	LBB0_4
LBB0_2:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
LBB0_4:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	_LoaderFree@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%rcx, %rdx
	movq	%rax, %rcx
	callq	_AddMemoryDescriptor
	movq	_PcMapCount@GOTPCREL(%rip), %r12
	movl	%eax, (%r12)
	movq	-72(%rbp), %rbx
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.5:
	movl	(%r13), %edi
	movl	(%r14), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movl	$16777216, %eax                 ## imm = 0x1000000
	xorl	%edx, %edx
	idivl	%ecx
	movslq	%eax, %r9
	shlq	$16, %rbx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_8
LBB0_6:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_8:
	movq	_LoaderFree@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movq	%r9, %rdx
	movq	%rax, %rcx
	callq	_AddMemoryDescriptor
	movl	%eax, (%r12)
LBB0_9:
	leaq	-64(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_GetEbdaLocation
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:
	movl	(%r13), %r12d
	movl	(%r14), %r15d
	movq	-64(%rbp), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	%rdi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.12:
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rbx
	jmp	LBB0_13
LBB0_11:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_13:
	movq	-56(%rbp), %rsi
	callq	_ADDRESS_AND_SIZE_TO_SPAN_PAGES
	movq	_LoaderFirmwarePermanent@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	movl	%r12d, %edi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	movq	%rax, %rcx
	callq	_AddMemoryDescriptor
	movq	_PcMapCount@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_14:
	movl	(%r13), %edi
	movq	_LoaderFirmwarePermanent@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	xorl	%esi, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_SetMemory
	movl	(%r13), %edi
	movl	(%rbx), %ecx
	movl	$655360, %esi                   ## imm = 0xA0000
	movl	$327680, %edx                   ## imm = 0x50000
	callq	_SetMemory
	movl	(%r13), %edi
	movq	_LoaderSpecialMemory@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	$983040, %esi                   ## imm = 0xF0000
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_SetMemory
	movl	(%r13), %edi
	movl	(%rbx), %ecx
	movl	$16773120, %esi                 ## imm = 0xFFF000
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_SetMemory
	movl	(%r13), %edi
	callq	_PcMemFinalizeMemoryMap
	movq	%rax, (%r15)
	movl	(%r13), %eax
	addq	$40, %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	"PcMemGetMemoryMap()\n"

	.comm	_PcMemoryMap,4,2                ## @PcMemoryMap
	.comm	_MAX_BIOS_DESCRIPTORS,4,2       ## @MAX_BIOS_DESCRIPTORS
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_LoaderFree,4,2                 ## @LoaderFree
	.comm	_PcMapCount,4,2                 ## @PcMapCount
	.comm	_LoaderFirmwarePermanent,4,2    ## @LoaderFirmwarePermanent
	.comm	_LoaderSpecialMemory,4,2        ## @LoaderSpecialMemory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PcMemGetMemoryMap              ; -- Begin function PcMemGetMemoryMap
	.p2align	2
_PcMemGetMemoryMap:                     ; @PcMemGetMemoryMap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	bl	_PcMemCheckUsableMemorySize
Lloh2:
	adrp	x23, _PcMemoryMap@GOTPAGE
Lloh3:
	ldr	x23, [x23, _PcMemoryMap@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh4:
	adrp	x22, _MAX_BIOS_DESCRIPTORS@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MAX_BIOS_DESCRIPTORS@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_PcMemGetBiosMemoryMap
Lloh6:
	adrp	x24, _LoaderFirmwarePermanent@GOTPAGE
Lloh7:
	ldr	x24, [x24, _LoaderFirmwarePermanent@GOTPAGEOFF]
	cbnz	x0, LBB0_5
; %bb.1:
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_GetExtendedMemoryConfiguration
	ldr	w20, [x23]
	ldr	w21, [x22]
	bl	_PcMemGetConventionalMemorySize
	lsl	w8, w0, #10
Lloh8:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x25]
	sdiv	w8, w8, w9
	sxtw	x3, w8
Lloh10:
	adrp	x27, _LoaderFree@GOTPAGE
Lloh11:
	ldr	x27, [x27, _LoaderFree@GOTPAGEOFF]
	ldr	w4, [x27]
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	bl	_AddMemoryDescriptor
	ldr	w0, [x23]
	ldr	w1, [x22]
	ldrsw	x8, [x25]
	mov	w9, #1048576
	sdiv	w9, w9, w8
	sxtw	x2, w9
	ldr	x9, [sp, #24]
	lsl	x9, x9, #10
	ldr	w4, [x27]
	sdiv	x3, x9, x8
	bl	_AddMemoryDescriptor
Lloh12:
	adrp	x26, _PcMapCount@GOTPAGE
Lloh13:
	ldr	x26, [x26, _PcMapCount@GOTPAGEOFF]
	str	w0, [x26]
	ldr	x8, [sp, #16]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x23]
	ldr	w1, [x22]
	ldrsw	x9, [x25]
	mov	w10, #16777216
	sdiv	w10, w10, w9
	sxtw	x2, w10
	lsl	x8, x8, #16
	ldr	w4, [x27]
	sdiv	x3, x8, x9
	bl	_AddMemoryDescriptor
	str	w0, [x26]
LBB0_3:
	add	x0, sp, #8
	mov	x1, sp
	bl	_GetEbdaLocation
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w20, [x23]
	ldr	w21, [x22]
	ldp	x1, x0, [sp]
	ldrsw	x8, [x25]
	sdiv	x22, x0, x8
	bl	_ADDRESS_AND_SIZE_TO_SPAN_PAGES
	mov	x3, x0
	ldr	w4, [x24]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_AddMemoryDescriptor
	str	w0, [x26]
LBB0_5:
	ldr	w0, [x23]
	ldr	w3, [x24]
	mov	w1, #0
	mov	w2, #4096
	bl	_SetMemory
	ldr	w0, [x23]
	ldr	w3, [x24]
	mov	w1, #655360
	mov	w2, #327680
	bl	_SetMemory
	ldr	w0, [x23]
Lloh14:
	adrp	x20, _LoaderSpecialMemory@GOTPAGE
Lloh15:
	ldr	x20, [x20, _LoaderSpecialMemory@GOTPAGEOFF]
	ldr	w3, [x20]
	mov	w1, #983040
	mov	w2, #65536
	bl	_SetMemory
	ldr	w0, [x23]
	ldr	w3, [x20]
	mov	w1, #16773120
	mov	w2, #4096
	bl	_SetMemory
	ldr	w0, [x23]
	bl	_PcMemFinalizeMemoryMap
	str	x0, [x19]
	ldr	w0, [x23]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PcMemGetMemoryMap()\n"

	.comm	_PcMemoryMap,4,2                ; @PcMemoryMap
	.comm	_MAX_BIOS_DESCRIPTORS,4,2       ; @MAX_BIOS_DESCRIPTORS
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_LoaderFree,4,2                 ; @LoaderFree
	.comm	_PcMapCount,4,2                 ; @PcMapCount
	.comm	_LoaderFirmwarePermanent,4,2    ; @LoaderFirmwarePermanent
	.comm	_LoaderSpecialMemory,4,2        ; @LoaderSpecialMemory
.subsections_via_symbols
