	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_header               ## -- Begin function write_out_header
	.p2align	4, 0x90
_write_out_header:                      ## @write_out_header
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_errno@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_fseek
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_ERRS
	movq	_ERR_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_7
LBB0_2:
	movq	_board@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	cmpl	$128, %ecx
	je	LBB0_5
## %bb.3:
                                        ## implicit-def: $eax
	cmpl	$129, %ecx
	jne	LBB0_7
## %bb.4:
	movq	_header@GOTPCREL(%rip), %r14
	movl	8(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -24(%rbp)
	movl	12(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -32(%rbp)
	movl	$64, %edi
	callq	_HOST_TO_LE32
	movq	%rax, -40(%rbp)
	movq	_kernel_image@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -48(%rbp)
	movl	4(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -56(%rbp)
	movq	_CAS_MAGIC1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -64(%rbp)
	movq	_CAS_MAGIC2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -72(%rbp)
	movq	_CAS_MAGIC3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_6
LBB0_5:
	movq	_header@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -24(%rbp)
	movl	4(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -32(%rbp)
	movl	$64, %edi
	callq	_HOST_TO_LE32
	movq	%rax, -40(%rbp)
	movq	_kernel_image@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -48(%rbp)
	movl	4(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -56(%rbp)
	movl	(%r14), %edi
	addl	$64, %edi
	callq	_HOST_TO_LE32
	movq	%rax, -64(%rbp)
	movq	_fs_image@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -72(%rbp)
	movl	4(%r14), %edi
LBB0_6:
	callq	_HOST_TO_LE32
	movq	%rax, -80(%rbp)
	leaq	-80(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$64, %edx
	xorl	%ecx, %ecx
	callq	_write_out_data
LBB0_7:
	addq	$64, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fseek failed on output file"

	.comm	_ERR_FATAL,4,2                  ## @ERR_FATAL
	.comm	_board,8,3                      ## @board
	.comm	_header,16,2                    ## @header
	.comm	_kernel_image,8,2               ## @kernel_image
	.comm	_CAS_MAGIC1,4,2                 ## @CAS_MAGIC1
	.comm	_CAS_MAGIC2,4,2                 ## @CAS_MAGIC2
	.comm	_CAS_MAGIC3,4,2                 ## @CAS_MAGIC3
	.comm	_fs_image,8,2                   ## @fs_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_out_header               ; -- Begin function write_out_header
	.p2align	2
_write_out_header:                      ; @write_out_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _errno@GOTPAGE
Lloh1:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_fseek
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERRS
Lloh8:
	adrp	x8, _ERR_FATAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERR_FATAL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_2:
Lloh11:
	adrp	x8, _board@GOTPAGE
Lloh12:
	ldr	x8, [x8, _board@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #128
	b.eq	LBB0_5
; %bb.3:
                                        ; implicit-def: $w0
	cmp	w8, #129
	b.ne	LBB0_7
; %bb.4:
Lloh14:
	adrp	x20, _header@GOTPAGE
Lloh15:
	ldr	x20, [x20, _header@GOTPAGEOFF]
	ldr	w0, [x20, #8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #56]
	ldr	w0, [x20, #12]
	bl	_HOST_TO_LE32
	str	x0, [sp, #48]
	mov	w0, #64
	bl	_HOST_TO_LE32
	str	x0, [sp, #40]
Lloh16:
	adrp	x20, _kernel_image@GOTPAGE
Lloh17:
	ldr	x20, [x20, _kernel_image@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_HOST_TO_LE32
	str	x0, [sp, #32]
	ldr	w0, [x20, #4]
	bl	_HOST_TO_LE32
	str	x0, [sp, #24]
Lloh18:
	adrp	x8, _CAS_MAGIC1@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CAS_MAGIC1@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #16]
Lloh21:
	adrp	x8, _CAS_MAGIC2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CAS_MAGIC2@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #8]
Lloh24:
	adrp	x8, _CAS_MAGIC3@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CAS_MAGIC3@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	b	LBB0_6
LBB0_5:
Lloh27:
	adrp	x20, _header@GOTPAGE
Lloh28:
	ldr	x20, [x20, _header@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_HOST_TO_LE32
	str	x0, [sp, #56]
	ldr	w0, [x20, #4]
	bl	_HOST_TO_LE32
	str	x0, [sp, #48]
	mov	w0, #64
	bl	_HOST_TO_LE32
	str	x0, [sp, #40]
Lloh29:
	adrp	x20, _kernel_image@GOTPAGE
Lloh30:
	ldr	x20, [x20, _kernel_image@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_HOST_TO_LE32
	str	x0, [sp, #32]
	ldr	w0, [x20, #4]
	bl	_HOST_TO_LE32
	str	x0, [sp, #24]
	ldr	w8, [x20]
	add	w0, w8, #64
	bl	_HOST_TO_LE32
	str	x0, [sp, #16]
Lloh31:
	adrp	x20, _fs_image@GOTPAGE
Lloh32:
	ldr	x20, [x20, _fs_image@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_HOST_TO_LE32
	str	x0, [sp, #8]
	ldr	w0, [x20, #4]
LBB0_6:
	bl	_HOST_TO_LE32
	str	x0, [sp]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #64
	mov	x3, #0
	bl	_write_out_data
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fseek failed on output file"

	.comm	_ERR_FATAL,4,2                  ; @ERR_FATAL
	.comm	_board,8,3                      ; @board
	.comm	_header,16,2                    ; @header
	.comm	_kernel_image,8,2               ; @kernel_image
	.comm	_CAS_MAGIC1,4,2                 ; @CAS_MAGIC1
	.comm	_CAS_MAGIC2,4,2                 ; @CAS_MAGIC2
	.comm	_CAS_MAGIC3,4,2                 ; @CAS_MAGIC3
	.comm	_fs_image,8,2                   ; @fs_image
.subsections_via_symbols
