	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efi_relocate_kernel            ## -- Begin function efi_relocate_kernel
	.p2align	4, 0x90
_efi_relocate_kernel:                   ## @efi_relocate_kernel
	.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	%r8, -64(%rbp)
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	movq	%rdx, %r13
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.2:
	movq	%rcx, %rbx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:
	cmpq	%r13, %rbx
	jae	LBB0_5
LBB0_3:
	movq	_EFI_INVALID_PARAMETER@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_12
LBB0_5:
	movq	%r9, %r12
	movq	%rsi, %r14
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_EFI_ALLOC_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_round_up
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_6
## %bb.7:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_8
LBB0_6:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_8:
	movq	_allocate_pages@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_EFI_ALLOCATE_ADDRESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_EFI_LOADER_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-64(%rbp), %r8
	movq	%rax, %rcx
	callq	_efi_call_early
	movq	%rax, %r15
	movq	-64(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	je	LBB0_11
## %bb.9:
	movq	16(%rbp), %r8
	leaq	-48(%rbp), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	%rax, %r15
	callq	_efi_low_alloc_above
	movq	(%r15), %r15
	cmpq	%r15, %rax
	jne	LBB0_10
LBB0_11:
	movq	-48(%rbp), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_memcpy
	movq	-48(%rbp), %rax
	movq	%rax, (%r14)
	jmp	LBB0_12
LBB0_10:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_pr_efi_err
	movq	%rbx, %r15
LBB0_12:
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EFI_INVALID_PARAMETER,8,3      ## @EFI_INVALID_PARAMETER
	.comm	_EFI_ALLOC_ALIGN,4,2            ## @EFI_ALLOC_ALIGN
	.comm	_EFI_PAGE_SIZE,8,3              ## @EFI_PAGE_SIZE
	.comm	_allocate_pages,4,2             ## @allocate_pages
	.comm	_EFI_ALLOCATE_ADDRESS,4,2       ## @EFI_ALLOCATE_ADDRESS
	.comm	_EFI_LOADER_DATA,4,2            ## @EFI_LOADER_DATA
	.comm	_EFI_SUCCESS,8,3                ## @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate usable memory for kernel.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_efi_relocate_kernel            ; -- Begin function efi_relocate_kernel
	.p2align	2
_efi_relocate_kernel:                   ; @efi_relocate_kernel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	x4, [sp]
	cbz	x1, LBB0_4
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_4
; %bb.2:
	mov	x24, x3
	cbz	x3, LBB0_4
; %bb.3:
	cmp	x24, x20
	b.hs	LBB0_5
LBB0_4:
Lloh0:
	adrp	x8, _EFI_INVALID_PARAMETER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFI_INVALID_PARAMETER@GOTPAGEOFF]
Lloh2:
	ldr	x26, [x8]
	b	LBB0_9
LBB0_5:
	mov	x22, x6
	mov	x23, x5
	mov	x19, x1
	mov	x21, x0
	ldr	x25, [x1]
Lloh3:
	adrp	x8, _EFI_ALLOC_ALIGN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFI_ALLOC_ALIGN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_round_up
Lloh6:
	adrp	x8, _EFI_PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFI_PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x8]
Lloh9:
	adrp	x8, _allocate_pages@GOTPAGE
Lloh10:
	ldr	x8, [x8, _allocate_pages@GOTPAGEOFF]
Lloh11:
	adrp	x10, _EFI_ALLOCATE_ADDRESS@GOTPAGE
Lloh12:
	ldr	x10, [x10, _EFI_ALLOCATE_ADDRESS@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w1, [x10]
Lloh15:
	adrp	x10, _EFI_LOADER_DATA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _EFI_LOADER_DATA@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x10]
	udiv	x3, x0, x9
	mov	x4, sp
	mov	x0, x8
	bl	_efi_call_early
	mov	x26, x0
	ldr	x8, [sp]
	str	x8, [sp, #8]
Lloh18:
	adrp	x27, _EFI_SUCCESS@GOTPAGE
Lloh19:
	ldr	x27, [x27, _EFI_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.6:
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	mov	x4, x22
	bl	_efi_low_alloc_above
	ldr	x26, [x27]
	cmp	x0, x26
	b.ne	LBB0_8
LBB0_7:
	ldr	x0, [sp, #8]
	mov	x1, x25
	mov	x2, x20
	bl	_memcpy
	ldr	x8, [sp, #8]
	str	x8, [x19]
	b	LBB0_9
LBB0_8:
	mov	x22, x0
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_pr_efi_err
	mov	x26, x22
LBB0_9:
	mov	x0, x26
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EFI_INVALID_PARAMETER,8,3      ; @EFI_INVALID_PARAMETER
	.comm	_EFI_ALLOC_ALIGN,4,2            ; @EFI_ALLOC_ALIGN
	.comm	_EFI_PAGE_SIZE,8,3              ; @EFI_PAGE_SIZE
	.comm	_allocate_pages,4,2             ; @allocate_pages
	.comm	_EFI_ALLOCATE_ADDRESS,4,2       ; @EFI_ALLOCATE_ADDRESS
	.comm	_EFI_LOADER_DATA,4,2            ; @EFI_LOADER_DATA
	.comm	_EFI_SUCCESS,8,3                ; @EFI_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate usable memory for kernel.\n"

.subsections_via_symbols
