	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_image                    ## -- Begin function build_image
	.p2align	4, 0x90
_build_image:                           ## @build_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	_kernel@GOTPCREL(%rip), %r13
	cmpq	$0, 16(%r13)
	je	LBB0_2
## %bb.1:
	movq	_kernel@GOTPCREL(%rip), %rdi
	callq	_map_file
LBB0_2:
	movq	_rootfs@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_map_file
	movq	_rootfs_out@GOTPCREL(%rip), %r14
	movl	8(%r14), %edi
	movl	$1, %esi
	callq	_calloc
	movq	%rax, (%r14)
	movq	(%rbx), %rsi
	movl	8(%rbx), %edx
	movq	%rax, %rdi
	callq	_memcpy
	movq	_version_name@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	(%r14), %rdi
	movl	8(%r14), %esi
	callq	_generate_rootfs_header
	movq	%rax, %rbx
	cmpq	$0, 16(%r13)
	je	LBB0_3
## %bb.4:
	movq	16(%r13), %rax
	movq	%rax, 16(%rsp)
	movups	(%r13), %xmm0
	movups	%xmm0, (%rsp)
	callq	_generate_kernel_header
	jmp	LBB0_5
LBB0_3:
	xorl	%eax, %eax
LBB0_5:
	movq	_board_name@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_generate_board_header
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_header_length@GOTPCREL(%rip), %rax
	movl	8(%r14), %edi
	addl	(%rax), %edi
	movq	_out@GOTPCREL(%rip), %r14
	movl	%edi, (%r14)
	cmpq	$0, 16(%r13)
	je	LBB0_7
## %bb.6:
	addl	8(%r13), %edi
	movl	%edi, (%r14)
LBB0_7:
	callq	_malloc
	movq	%rax, 8(%r14)
	movl	(%r14), %edx
	movq	%rax, %rdi
	movl	$255, %esi
	callq	_memset
	movq	8(%r14), %rdi
	movq	_ROOTFS_HEADER_LEN@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	callq	_memcpy
	movslq	(%r15), %rdi
	addq	8(%r14), %rdi
	movq	_BOARD_HEADER_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
	cmpq	$0, 16(%r13)
	je	LBB0_9
## %bb.8:
	movslq	(%r15), %rax
	addq	8(%r14), %rax
	movslq	(%r12), %rdi
	addq	%rax, %rdi
	movq	_KERNEL_HEADER_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_memcpy
LBB0_9:
	movq	_header_length@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	8(%r14), %rdi
	addq	%rbx, %rdi
	movq	_rootfs_out@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	movl	8(%r15), %edx
	callq	_memcpy
	cmpq	$0, 16(%r13)
	je	LBB0_11
## %bb.10:
	movslq	8(%r15), %rax
	addq	%rax, %rbx
	addq	8(%r14), %rbx
	movq	(%r13), %rsi
	movl	8(%r13), %edx
	movq	%rbx, %rdi
	callq	_memcpy
LBB0_11:
	movq	_out@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_write_file
	cmpq	$0, 16(%r13)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_13
## %bb.12:
	movq	_kernel@GOTPCREL(%rip), %rdi
	callq	_unmap_file
LBB0_13:
	movq	_rootfs@GOTPCREL(%rip), %rdi
	callq	_unmap_file
	movq	8(%r14), %rdi
	callq	_free
	movq	(%r15), %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_free
	cmpq	$0, 16(%r13)
	je	LBB0_15
## %bb.14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
LBB0_15:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_free
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_kernel,24,3                    ## @kernel
	.comm	_rootfs,24,3                    ## @rootfs
	.comm	_rootfs_out,16,3                ## @rootfs_out
	.comm	_version_name,4,2               ## @version_name
	.comm	_board_name,4,2                 ## @board_name
	.comm	_header_length,8,3              ## @header_length
	.comm	_out,16,3                       ## @out
	.comm	_ROOTFS_HEADER_LEN,4,2          ## @ROOTFS_HEADER_LEN
	.comm	_BOARD_HEADER_LEN,4,2           ## @BOARD_HEADER_LEN
	.comm	_KERNEL_HEADER_LEN,4,2          ## @KERNEL_HEADER_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_build_image                    ; -- Begin function build_image
	.p2align	2
_build_image:                           ; @build_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
Lloh0:
	adrp	x23, _kernel@GOTPAGE
Lloh1:
	ldr	x23, [x23, _kernel@GOTPAGEOFF]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, _kernel@GOTPAGE
Lloh3:
	ldr	x0, [x0, _kernel@GOTPAGEOFF]
	bl	_map_file
LBB0_2:
Lloh4:
	adrp	x19, _rootfs@GOTPAGE
Lloh5:
	ldr	x19, [x19, _rootfs@GOTPAGEOFF]
	mov	x0, x19
	bl	_map_file
Lloh6:
	adrp	x24, _rootfs_out@GOTPAGE
Lloh7:
	ldr	x24, [x24, _rootfs_out@GOTPAGEOFF]
	ldr	w0, [x24, #8]
	mov	w1, #1
	bl	_calloc
	str	x0, [x24]
	ldr	x1, [x19]
	ldr	w2, [x19, #8]
	bl	_memcpy
Lloh8:
	adrp	x8, _version_name@GOTPAGE
Lloh9:
	ldr	x8, [x8, _version_name@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	ldp	x0, x1, [x24]
	bl	_generate_rootfs_header
	mov	x19, x0
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	q0, [x23]
	str	q0, [sp]
	ldr	x8, [x23, #16]
	str	x8, [sp, #16]
	mov	x0, sp
	bl	_generate_kernel_header
	mov	x20, x0
	b	LBB0_5
LBB0_4:
	mov	x20, #0
LBB0_5:
Lloh11:
	adrp	x8, _board_name@GOTPAGE
Lloh12:
	ldr	x8, [x8, _board_name@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_generate_board_header
	mov	x21, x0
Lloh14:
	adrp	x25, _header_length@GOTPAGE
Lloh15:
	ldr	x25, [x25, _header_length@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x24, #8]
	add	w0, w9, w8
Lloh16:
	adrp	x22, _out@GOTPAGE
Lloh17:
	ldr	x22, [x22, _out@GOTPAGEOFF]
	str	w0, [x22]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w8, [x23, #8]
	add	w0, w8, w0
	str	w0, [x22]
LBB0_7:
	bl	_malloc
	str	x0, [x22, #8]
	ldr	w2, [x22]
	mov	w1, #255
	bl	_memset
	ldr	x0, [x22, #8]
Lloh18:
	adrp	x26, _ROOTFS_HEADER_LEN@GOTPAGE
Lloh19:
	ldr	x26, [x26, _ROOTFS_HEADER_LEN@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x1, x19
	bl	_memcpy
	ldr	x8, [x22, #8]
	ldrsw	x9, [x26]
	add	x0, x8, x9
Lloh20:
	adrp	x27, _BOARD_HEADER_LEN@GOTPAGE
Lloh21:
	ldr	x27, [x27, _BOARD_HEADER_LEN@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	x1, x21
	bl	_memcpy
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x8, [x22, #8]
	ldrsw	x9, [x26]
	ldrsw	x10, [x27]
	add	x8, x8, x9
	add	x0, x8, x10
Lloh22:
	adrp	x8, _KERNEL_HEADER_LEN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _KERNEL_HEADER_LEN@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_memcpy
LBB0_9:
	ldr	x25, [x25]
	ldr	x8, [x22, #8]
	add	x0, x8, x25
	ldr	x1, [x24]
	ldr	w2, [x24, #8]
	bl	_memcpy
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_11
; %bb.10:
	ldrsw	x8, [x24, #8]
	ldr	x9, [x22, #8]
	add	x8, x25, x8
	add	x0, x9, x8
	ldr	x1, [x23]
	ldr	w2, [x23, #8]
	bl	_memcpy
LBB0_11:
Lloh25:
	adrp	x22, _out@GOTPAGE
Lloh26:
	ldr	x22, [x22, _out@GOTPAGEOFF]
	mov	x0, x22
	bl	_write_file
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_13
; %bb.12:
Lloh27:
	adrp	x0, _kernel@GOTPAGE
Lloh28:
	ldr	x0, [x0, _kernel@GOTPAGEOFF]
	bl	_unmap_file
LBB0_13:
Lloh29:
	adrp	x0, _rootfs@GOTPAGE
Lloh30:
	ldr	x0, [x0, _rootfs@GOTPAGEOFF]
	bl	_unmap_file
	ldr	x0, [x22, #8]
	bl	_free
	ldr	x0, [x24]
	bl	_free
	mov	x0, x19
	bl	_free
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_15
; %bb.14:
	mov	x0, x20
	bl	_free
LBB0_15:
	mov	x0, x21
	bl	_free
	mov	w0, #0
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_kernel,24,3                    ; @kernel
	.comm	_rootfs,24,3                    ; @rootfs
	.comm	_rootfs_out,16,3                ; @rootfs_out
	.comm	_version_name,4,2               ; @version_name
	.comm	_board_name,4,2                 ; @board_name
	.comm	_header_length,8,3              ; @header_length
	.comm	_out,16,3                       ; @out
	.comm	_ROOTFS_HEADER_LEN,4,2          ; @ROOTFS_HEADER_LEN
	.comm	_BOARD_HEADER_LEN,4,2           ; @BOARD_HEADER_LEN
	.comm	_KERNEL_HEADER_LEN,4,2          ; @KERNEL_HEADER_LEN
.subsections_via_symbols
