	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function multiboot_obj_loadfile
_multiboot_obj_loadfile:                ## @multiboot_obj_loadfile
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	callq	_file_findfile
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_file_findfile
	testq	%rax, %rax
	je	LBB0_3
## %bb.9:
	movq	%r12, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_elf64_obj_loadfile
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r14d
	leaq	L_.str.5(%rip), %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printf
	movl	%r14d, %ebx
	jmp	LBB0_11
LBB0_1:
	movq	_EFTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_file_loadraw
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	%rax, %r15
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_setenv
	movq	8(%r15), %rsi
	addq	16(%r15), %rsi
	movq	%r15, %rdi
	callq	_elf64_load_modmetadata
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movq	(%r15), %rsi
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_printf
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movq	%r15, %rdi
	callq	_num_modules
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_roundup
	movq	%rax, 8(%r15)
	movl	%ebx, %edi
	callq	_METADATA_RESV_SIZE
	addq	%rax, 8(%r15)
	movq	%r15, (%r14)
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"elf multiboot kernel"

	.comm	_EFTYPE,4,2                     ## @EFTYPE
L_.str.1:                               ## @.str.1
	.asciz	"elf kernel"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to load %s as a multiboot payload kernel\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"kernelname"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to load kernel %s metadata error: %d\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.5:                               ## @.str.5
	.asciz	"Unable to load %s as an object file, error: %d"

	.no_dead_strip	_multiboot_obj_loadfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function multiboot_obj_loadfile
_multiboot_obj_loadfile:                ; @multiboot_obj_loadfile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, #0
	bl	_file_findfile
	cbz	x0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, #0
	bl	_file_findfile
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_elf64_obj_loadfile
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.3:
	str	x22, [sp]
Lloh4:
	adrp	x0, l_.str.5@PAGE
Lloh5:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x20
	bl	_printf
	b	LBB0_11
LBB0_4:
Lloh6:
	adrp	x8, _EFTYPE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFTYPE@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	b	LBB0_11
LBB0_5:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	w2, #0
	bl	_file_loadraw
	cbz	x0, LBB0_8
; %bb.6:
	mov	x21, x0
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x20
	mov	w2, #1
	bl	_setenv
	ldp	x9, x8, [x21, #8]
	add	x1, x9, x8
	mov	x0, x21
	bl	_elf64_load_modmetadata
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_10
; %bb.7:
	ldr	x1, [x21]
	str	x0, [sp]
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
LBB0_9:
	bl	_printf
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w22, [x8]
	b	LBB0_11
LBB0_10:
	mov	x0, x21
	bl	_num_modules
	mov	x20, x0
	ldr	x0, [x21, #8]
Lloh20:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_roundup
	str	x0, [x21, #8]
	mov	x0, x20
	bl	_METADATA_RESV_SIZE
	mov	w22, #0
	ldr	x8, [x21, #8]
	add	x8, x8, x0
	str	x8, [x21, #8]
	str	x21, [x19]
LBB0_11:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"elf multiboot kernel"

	.comm	_EFTYPE,4,2                     ; @EFTYPE
l_.str.1:                               ; @.str.1
	.asciz	"elf kernel"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to load %s as a multiboot payload kernel\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"kernelname"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to load kernel %s metadata error: %d\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.5:                               ; @.str.5
	.asciz	"Unable to load %s as an object file, error: %d"

	.no_dead_strip	_multiboot_obj_loadfile
.subsections_via_symbols
