	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reserve_kernel_base
_reserve_kernel_base:                   ## @reserve_kernel_base
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	leaq	-64(%rbp), %rax
	movq	%rax, -136(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, -128(%rbp)
	leaq	-144(%rbp), %rax
	movq	%rax, -120(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -112(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -96(%rbp)
	movq	_MAX_UNCOMP_KERNEL_SIZE@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	leaq	(%rax,%rsi), %rcx
	movq	%rcx, -80(%rbp)
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_3:
	movq	_allocate_pages@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_EFI_ALLOCATE_MAX_ADDRESS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	leaq	-80(%rbp), %r8
	movl	$131, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_efi_call_early
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	cmpq	%r13, -80(%rbp)
	jne	LBB0_6
## %bb.5:
	movq	%r13, (%r12)
	movq	(%r14), %rax
	movq	%rax, (%r15)
	movq	(%rcx), %r12
	jmp	LBB0_22
LBB0_6:
	leaq	-136(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_efi_get_memory_map
	movq	%rax, %r12
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_23
## %bb.7:
	movq	-64(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.8:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rsi
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_9 Depth=1
	addq	-88(%rbp), %r15
	cmpq	%rax, %r15
	jae	LBB0_21
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-72(%rbp), %rcx
	movq	(%rcx,%r15), %rdi
	movq	%rdi, -48(%rbp)
	movq	(%r14), %rdx
	addq	%r13, %rdx
	cmpq	%rdx, %rdi
	jae	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rsi), %rbx
	imulq	8(%rcx,%r15), %rbx
	addq	%rdi, %rbx
	cmpq	%r13, %rbx
	jbe	LBB0_18
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	16(%rcx,%r15), %ecx
	leal	-131(%rcx), %edx
	cmpl	$2, %edx
	jb	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$130, %ecx
	jne	LBB0_20
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rsi
	callq	_max
	movq	%rax, -48(%rbp)
	movl	(%r14), %esi
	addl	%r13d, %esi
	movq	%rbx, %rdi
	callq	_min
	movq	_allocate_pages@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	subq	-48(%rbp), %rax
	movq	_EFI_ALLOCATE_ADDRESS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rsi
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rcx
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ecx
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	$128, %edx
	leaq	-48(%rbp), %r8
	xorl	%eax, %eax
	callq	_efi_call_early
	movq	%rax, %r12
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-64(%rbp), %rax
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rsi
	jmp	LBB0_18
LBB0_23:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_pr_efi_err
	jmp	LBB0_22
LBB0_20:
	movq	_EFI_OUT_OF_RESOURCES@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	jmp	LBB0_21
LBB0_19:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_pr_efi_err
LBB0_21:
	movq	_free_pool@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %rsi
	xorl	%eax, %eax
	callq	_efi_call_early
LBB0_22:
	movq	%r12, %rax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_UNCOMP_KERNEL_SIZE,8,3     ## @MAX_UNCOMP_KERNEL_SIZE
	.comm	_EFI_PAGE_SIZE,8,3              ## @EFI_PAGE_SIZE
	.comm	_allocate_pages,4,2             ## @allocate_pages
	.comm	_EFI_ALLOCATE_MAX_ADDRESS,4,2   ## @EFI_ALLOCATE_MAX_ADDRESS
	.comm	_EFI_SUCCESS,8,3                ## @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reserve_kernel_base(): Unable to retrieve memory map.\n"

	.comm	_EFI_ALLOCATE_ADDRESS,4,2       ## @EFI_ALLOCATE_ADDRESS
L_.str.1:                               ## @.str.1
	.asciz	"reserve_kernel_base(): alloc failed.\n"

	.comm	_EFI_OUT_OF_RESOURCES,8,3       ## @EFI_OUT_OF_RESOURCES
	.comm	_free_pool,4,2                  ## @free_pool
	.no_dead_strip	_reserve_kernel_base
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reserve_kernel_base
_reserve_kernel_base:                   ; @reserve_kernel_base
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x28, x27, [sp, #128]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	add	x8, sp, #104
	add	x9, sp, #96
	stp	x8, x9, [sp, #40]
	add	x8, sp, #88
	stp	x8, xzr, [sp, #56]
	sub	x8, x29, #96
	stp	xzr, x8, [sp, #72]
Lloh0:
	adrp	x23, _MAX_UNCOMP_KERNEL_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAX_UNCOMP_KERNEL_SIZE@GOTPAGEOFF]
	ldr	x8, [x23]
	add	x9, x8, x1
	stur	x9, [x29, #-88]
Lloh2:
	adrp	x24, _EFI_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EFI_PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x25, _allocate_pages@GOTPAGE
Lloh5:
	ldr	x25, [x25, _allocate_pages@GOTPAGEOFF]
	ldr	x9, [x24]
	ldr	w0, [x25]
	udiv	x8, x8, x9
Lloh6:
	adrp	x9, _EFI_ALLOCATE_MAX_ADDRESS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EFI_ALLOCATE_MAX_ADDRESS@GOTPAGEOFF]
Lloh8:
	ldrsw	x1, [x9]
	sub	x9, x29, #88
	stp	x8, x9, [sp, #8]
	mov	w9, #131
	str	x9, [sp]
	bl	_efi_call_early
Lloh9:
	adrp	x26, _EFI_SUCCESS@GOTPAGE
Lloh10:
	ldr	x26, [x26, _EFI_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_3
; %bb.1:
	ldur	x8, [x29, #-88]
	cmp	x8, x20
	b.ne	LBB0_3
; %bb.2:
	str	x20, [x22]
	ldr	x8, [x23]
	str	x8, [x21]
	ldr	x21, [x26]
	b	LBB0_16
LBB0_3:
	add	x1, sp, #40
	mov	x0, x19
	bl	_efi_get_memory_map
	mov	x21, x0
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.4:
	ldr	x8, [sp, #104]
	cbz	x8, LBB0_15
; %bb.5:
	mov	x27, #0
	mov	w28, #128
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [sp, #96]
	add	x27, x9, x27
	cmp	x27, x8
	b.hs	LBB0_15
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldur	x9, [x29, #-96]
	add	x9, x9, x27
	ldr	x0, [x9]
	str	x0, [sp, #32]
	ldr	x10, [x9, #8]
	ldr	x11, [x24]
	madd	x22, x11, x10, x0
	ldr	x10, [x23]
	add	x10, x10, x20
	cmp	x0, x10
	ccmp	x22, x20, #0, lo
	b.ls	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w9, [x9, #16]
	sub	w10, w9, #131
	cmp	w10, #2
	b.lo	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w9, #130
	b.ne	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x20
	bl	_max
	str	x0, [sp, #32]
	ldr	w8, [x23]
	add	w1, w8, w20
	mov	x0, x22
	bl	_min
	ldr	w8, [x25]
Lloh11:
	adrp	x9, _EFI_ALLOCATE_ADDRESS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EFI_ALLOCATE_ADDRESS@GOTPAGEOFF]
Lloh13:
	ldrsw	x1, [x9]
	ldr	x9, [sp, #32]
	sub	x9, x0, x9
	ldr	x10, [x24]
	udiv	x9, x9, x10
	add	x10, sp, #32
	stp	x9, x10, [sp, #8]
	str	x28, [sp]
	mov	x0, x8
	bl	_efi_call_early
	mov	x21, x0
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [sp, #104]
	b	LBB0_6
LBB0_12:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_pr_efi_err
	b	LBB0_16
LBB0_13:
Lloh16:
	adrp	x8, _EFI_OUT_OF_RESOURCES@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFI_OUT_OF_RESOURCES@GOTPAGEOFF]
Lloh18:
	ldr	x21, [x8]
	b	LBB0_15
LBB0_14:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_pr_efi_err
LBB0_15:
Lloh21:
	adrp	x8, _free_pool@GOTPAGE
Lloh22:
	ldr	x8, [x8, _free_pool@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldur	x1, [x29, #-96]
	bl	_efi_call_early
LBB0_16:
	mov	x0, x21
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #128]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_UNCOMP_KERNEL_SIZE,8,3     ; @MAX_UNCOMP_KERNEL_SIZE
	.comm	_EFI_PAGE_SIZE,8,3              ; @EFI_PAGE_SIZE
	.comm	_allocate_pages,4,2             ; @allocate_pages
	.comm	_EFI_ALLOCATE_MAX_ADDRESS,4,2   ; @EFI_ALLOCATE_MAX_ADDRESS
	.comm	_EFI_SUCCESS,8,3                ; @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reserve_kernel_base(): Unable to retrieve memory map.\n"

	.comm	_EFI_ALLOCATE_ADDRESS,4,2       ; @EFI_ALLOCATE_ADDRESS
l_.str.1:                               ; @.str.1
	.asciz	"reserve_kernel_base(): alloc failed.\n"

	.comm	_EFI_OUT_OF_RESOURCES,8,3       ; @EFI_OUT_OF_RESOURCES
	.comm	_free_pool,4,2                  ; @free_pool
	.no_dead_strip	_reserve_kernel_base
.subsections_via_symbols
