	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_handle_kernel_image            ## -- Begin function handle_kernel_image
	.p2align	4, 0x90
_handle_kernel_image:                   ## @handle_kernel_image
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %r13
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %r15
	movl	$0, -44(%rbp)
	movq	_CONFIG_RANDOMIZE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	xorl	%eax, %eax
	callq	_nokaslr
	testl	%eax, %eax
	je	LBB0_2
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	jmp	LBB0_7
LBB0_2:
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$4, %esi
	callq	_efi_get_random_bytes
	movq	%rax, %rbx
	movq	_EFI_NOT_FOUND@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_7:
	callq	_pr_efi
LBB0_8:
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	_MIN_KIMG_ALIGN@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_round_down
	movq	_TEXT_OFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movslq	%eax, %rbx
	addq	%rcx, %rbx
	cmpq	%r14, %rbx
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	jae	LBB0_9
## %bb.10:
	movq	(%r13), %r13
	jmp	LBB0_11
LBB0_9:
	xorl	%r13d, %r13d
LBB0_11:
	movq	%r12, %r14
	movq	__edata@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	__text@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	__end@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	subq	%rcx, %r15
	movq	_CONFIG_RANDOMIZE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	testq	%rax, %rax
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_14
## %bb.12:
	cmpl	$0, -44(%rbp)
	je	LBB0_14
## %bb.13:
	movq	_CONFIG_DEBUG_ALIGN_RODATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IS_ENABLED
	movq	_TEXT_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_EFI_KIMG_ALIGN@GOTPCREL(%rip), %rsi
	movl	%ecx, %eax
	cltd
	idivl	(%rsi)
	orl	%ecx, %edx
	movslq	%edx, %rbx
	leaq	(%r15,%rbx), %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rsi, (%rax)
	movq	_MIN_KIMG_ALIGN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %r8d
	movq	%r14, %rdi
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rcx
	callq	_efi_random_alloc
	addq	(%r13), %rbx
	movq	%rbx, (%r12)
	jmp	LBB0_20
LBB0_14:
	addq	%rbx, %r13
	cmpq	%r13, (%r12)
	jne	LBB0_16
## %bb.15:
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_26
LBB0_16:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%rax)
	movq	%r13, (%r12)
	movq	_EFI_ALLOC_ALIGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_round_up
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	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), %ecx
	movq	_EFI_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rbx
	movq	%rax, %rdx
	orq	%rbx, %rdx
	shrq	$32, %rdx
	je	LBB0_17
## %bb.18:
	xorl	%edx, %edx
	divq	%rbx
	jmp	LBB0_19
LBB0_4:
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_8
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_pr_efi_err
	jmp	LBB0_26
LBB0_17:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $eax killed $eax def $rax
LBB0_19:
	movl	%ecx, %edx
	movq	%rax, %rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	callq	_efi_call_early
LBB0_20:
	movq	_EFI_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_22
## %bb.21:
	movq	(%r12), %rdi
	jmp	LBB0_25
LBB0_22:
	movq	_TEXT_OFFSET@GOTPCREL(%rip), %r13
	movslq	(%r13), %rax
	addq	%rax, %r15
	movq	%r14, %r12
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r15, (%r14)
	movq	_MIN_KIMG_ALIGN@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rcx
	callq	_efi_low_alloc
	movq	%rbx, %rdx
	cmpq	(%rbx), %rax
	jne	LBB0_23
## %bb.24:
	movq	%rdx, %rcx
	movslq	(%r13), %rdi
	addq	(%r15), %rdi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rdi, (%rax)
	movq	%rdx, %rbx
LBB0_25:
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	subq	-80(%rbp), %rdx                 ## 8-byte Folded Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
	movq	(%rbx), %rbx
	jmp	LBB0_26
LBB0_23:
	movq	%rax, %rbx
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_pr_efi_err
	movq	$0, (%r14)
LBB0_26:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_RANDOMIZE_BASE,4,2      ## @CONFIG_RANDOMIZE_BASE
	.comm	_EFI_NOT_FOUND,8,3              ## @EFI_NOT_FOUND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EFI_RNG_PROTOCOL unavailable, no randomness supplied\n"

	.comm	_EFI_SUCCESS,8,3                ## @EFI_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"efi_get_random_bytes() failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"KASLR disabled on kernel command line\n"

	.comm	_MIN_KIMG_ALIGN,8,3             ## @MIN_KIMG_ALIGN
	.comm	_TEXT_OFFSET,4,2                ## @TEXT_OFFSET
	.comm	__edata,8,3                     ## @_edata
	.comm	__text,8,3                      ## @_text
	.comm	__end,8,3                       ## @_end
	.comm	_EFI_KIMG_ALIGN,4,2             ## @EFI_KIMG_ALIGN
	.comm	_CONFIG_DEBUG_ALIGN_RODATA,4,2  ## @CONFIG_DEBUG_ALIGN_RODATA
	.comm	_EFI_ALLOC_ALIGN,4,2            ## @EFI_ALLOC_ALIGN
	.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_PAGE_SIZE,8,3              ## @EFI_PAGE_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"Failed to relocate kernel\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_handle_kernel_image            ; -- Begin function handle_kernel_image
	.p2align	2
_handle_kernel_image:                   ; @handle_kernel_image
	.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	x24, x5
	mov	x20, x4
	mov	x23, x3
	mov	x22, x1
	mov	x21, x0
	ldr	x26, [x1]
	str	wzr, [sp, #28]
Lloh0:
	adrp	x19, _CONFIG_RANDOMIZE_BASE@GOTPAGE
Lloh1:
	ldr	x19, [x19, _CONFIG_RANDOMIZE_BASE@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_IS_ENABLED
	cbz	x0, LBB0_6
; %bb.1:
	bl	_nokaslr
	cbz	w0, LBB0_3
; %bb.2:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_3:
	add	x2, sp, #28
	mov	x0, x21
	mov	w1, #4
	bl	_efi_get_random_bytes
Lloh4:
	adrp	x8, _EFI_NOT_FOUND@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EFI_NOT_FOUND@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.4:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
LBB0_5:
	mov	x0, x21
	bl	_pr_efi
LBB0_6:
	mov	x25, x23
	stp	x26, x21, [sp, #8]              ; 16-byte Folded Spill
	mov	x21, x20
Lloh9:
	adrp	x23, _MIN_KIMG_ALIGN@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MIN_KIMG_ALIGN@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	x0, x24
	bl	_round_down
Lloh11:
	adrp	x20, _TEXT_OFFSET@GOTPAGE
Lloh12:
	ldr	x20, [x20, _TEXT_OFFSET@GOTPAGEOFF]
	ldrsw	x8, [x20]
	add	x26, x8, w0, sxtw
	ldr	x8, [x23]
	cmp	x26, x24
	csel	x28, x8, xzr, lo
Lloh13:
	adrp	x8, __edata@GOTPAGE
Lloh14:
	ldr	x8, [x8, __edata@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	x8, [sp]                        ; 8-byte Folded Spill
Lloh16:
	adrp	x8, __text@GOTPAGE
Lloh17:
	ldr	x8, [x8, __text@GOTPAGEOFF]
Lloh18:
	ldr	x27, [x8]
Lloh19:
	adrp	x8, __end@GOTPAGE
Lloh20:
	ldr	x8, [x8, __end@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	sub	x24, x8, x27
	ldr	w0, [x19]
	bl	_IS_ENABLED
	ldr	w8, [sp, #28]
	cmp	x0, #0
	ccmp	w8, #0, #4, ne
	b.ne	LBB0_9
; %bb.7:
	ldr	x9, [x22]
	add	x8, x28, x26
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _EFI_SUCCESS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EFI_SUCCESS@GOTPAGEOFF]
Lloh24:
	ldr	x25, [x8]
	b	LBB0_19
LBB0_9:
Lloh25:
	adrp	x8, _CONFIG_DEBUG_ALIGN_RODATA@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CONFIG_DEBUG_ALIGN_RODATA@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_IS_ENABLED
	ldr	w8, [x20]
Lloh28:
	adrp	x9, _EFI_KIMG_ALIGN@GOTPAGE
Lloh29:
	ldr	x9, [x9, _EFI_KIMG_ALIGN@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w9, w10, w9, w8
	orr	w8, w9, w8
	sxtw	x19, w8
	add	x1, x24, x19
	mov	x26, x21
	str	x1, [x21]
	ldr	x2, [x23]
	ldr	w4, [sp, #28]
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
	mov	x0, x21
	mov	x28, x25
	mov	x3, x25
	bl	_efi_random_alloc
	ldr	x8, [x25]
	add	x8, x8, x19
	str	x8, [x22]
	b	LBB0_11
LBB0_10:
	mov	x28, x25
	str	x8, [x25]
	str	x8, [x22]
Lloh31:
	adrp	x8, _EFI_ALLOC_ALIGN@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EFI_ALLOC_ALIGN@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_round_up
Lloh34:
	adrp	x8, _allocate_pages@GOTPAGE
Lloh35:
	ldr	x8, [x8, _allocate_pages@GOTPAGEOFF]
	mov	x26, x21
	str	x0, [x21]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _EFI_ALLOCATE_ADDRESS@GOTPAGE
Lloh38:
	ldr	x9, [x9, _EFI_ALLOCATE_ADDRESS@GOTPAGEOFF]
Lloh39:
	adrp	x10, _EFI_LOADER_DATA@GOTPAGE
Lloh40:
	ldr	x10, [x10, _EFI_LOADER_DATA@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x9]
Lloh42:
	ldr	w2, [x10]
Lloh43:
	adrp	x9, _EFI_PAGE_SIZE@GOTPAGE
Lloh44:
	ldr	x9, [x9, _EFI_PAGE_SIZE@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	udiv	x3, x0, x9
	mov	x0, x8
	mov	x4, x25
	bl	_efi_call_early
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
LBB0_11:
Lloh46:
	adrp	x19, _EFI_SUCCESS@GOTPAGE
Lloh47:
	ldr	x19, [x19, _EFI_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.12:
	ldr	x0, [x22]
	b	LBB0_15
LBB0_13:
	ldrsw	x8, [x20]
	add	x1, x24, x8
	str	x1, [x26]
	ldr	x2, [x23]
	mov	x0, x21
	mov	x3, x28
	bl	_efi_low_alloc
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_16
; %bb.14:
	ldr	x8, [x28]
	ldrsw	x9, [x20]
	add	x0, x8, x9
	str	x0, [x22]
LBB0_15:
	ldp	x8, x1, [sp]                    ; 16-byte Folded Reload
	sub	x2, x8, x27
	bl	_memcpy
	ldr	x25, [x19]
	b	LBB0_19
LBB0_16:
	mov	x25, x0
Lloh48:
	adrp	x1, l_.str.3@PAGE
Lloh49:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_pr_efi_err
	str	xzr, [x26]
	b	LBB0_19
LBB0_17:
	mov	x25, x0
Lloh50:
	adrp	x8, _EFI_SUCCESS@GOTPAGE
Lloh51:
	ldr	x8, [x8, _EFI_SUCCESS@GOTPAGEOFF]
Lloh52:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_6
; %bb.18:
Lloh53:
	adrp	x1, l_.str.1@PAGE
Lloh54:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_pr_efi_err
LBB0_19:
	mov	x0, x25
	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	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh41
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpAdd	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_RANDOMIZE_BASE,4,2      ; @CONFIG_RANDOMIZE_BASE
	.comm	_EFI_NOT_FOUND,8,3              ; @EFI_NOT_FOUND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EFI_RNG_PROTOCOL unavailable, no randomness supplied\n"

	.comm	_EFI_SUCCESS,8,3                ; @EFI_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"efi_get_random_bytes() failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"KASLR disabled on kernel command line\n"

	.comm	_MIN_KIMG_ALIGN,8,3             ; @MIN_KIMG_ALIGN
	.comm	_TEXT_OFFSET,4,2                ; @TEXT_OFFSET
	.comm	__edata,8,3                     ; @_edata
	.comm	__text,8,3                      ; @_text
	.comm	__end,8,3                       ; @_end
	.comm	_EFI_KIMG_ALIGN,4,2             ; @EFI_KIMG_ALIGN
	.comm	_CONFIG_DEBUG_ALIGN_RODATA,4,2  ; @CONFIG_DEBUG_ALIGN_RODATA
	.comm	_EFI_ALLOC_ALIGN,4,2            ; @EFI_ALLOC_ALIGN
	.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_PAGE_SIZE,8,3              ; @EFI_PAGE_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"Failed to relocate kernel\n"

.subsections_via_symbols
