	.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	%r15
	pushq	%r14
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-104(%rbp), %rdi
	xorl	%esi, %esi
	movl	$80, %edx
	callq	_memset
	movq	_MYLO_MAGIC_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -32(%rbp)
	movq	_fw_header@GOTPCREL(%rip), %rbx
	movl	32(%rbx), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -40(%rbp)
	movl	28(%rbx), %edi
	callq	_HOST_TO_LE16
	movq	%rax, -48(%rbp)
	movl	24(%rbx), %edi
	callq	_HOST_TO_LE16
	movq	%rax, -56(%rbp)
	movl	20(%rbx), %edi
	callq	_HOST_TO_LE16
	movq	%rax, -64(%rbp)
	movl	16(%rbx), %edi
	callq	_HOST_TO_LE16
	movq	%rax, -72(%rbp)
	movl	12(%rbx), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -80(%rbp)
	movl	8(%rbx), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -88(%rbp)
	movl	4(%rbx), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -96(%rbp)
	movl	(%rbx), %edi
	callq	_HOST_TO_LE32
	movq	%rax, -104(%rbp)
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fseek
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_errmsg
	movl	$-1, %eax
	jmp	LBB0_3
LBB0_2:
	leaq	-104(%rbp), %rsi
	movq	%r15, %rdi
	movl	$80, %edx
	movq	%r14, %rcx
	callq	_write_out_data
LBB0_3:
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MYLO_MAGIC_FIRMWARE,4,2        ## @MYLO_MAGIC_FIRMWARE
	.comm	_fw_header,36,2                 ## @fw_header
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fseek failed on output file"

.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, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x1
	mov	x20, x0
	mov	x0, sp
	mov	w1, #0
	mov	w2, #80
	bl	_memset
Lloh0:
	adrp	x8, _MYLO_MAGIC_FIRMWARE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MYLO_MAGIC_FIRMWARE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #72]
Lloh3:
	adrp	x21, _fw_header@GOTPAGE
Lloh4:
	ldr	x21, [x21, _fw_header@GOTPAGEOFF]
	ldr	w0, [x21, #32]
	bl	_HOST_TO_LE32
	str	x0, [sp, #64]
	ldr	w0, [x21, #28]
	bl	_HOST_TO_LE16
	str	x0, [sp, #56]
	ldr	w0, [x21, #24]
	bl	_HOST_TO_LE16
	str	x0, [sp, #48]
	ldr	w0, [x21, #20]
	bl	_HOST_TO_LE16
	str	x0, [sp, #40]
	ldr	w0, [x21, #16]
	bl	_HOST_TO_LE16
	str	x0, [sp, #32]
	ldr	w0, [x21, #12]
	bl	_HOST_TO_LE32
	str	x0, [sp, #24]
	ldr	w0, [x21, #8]
	bl	_HOST_TO_LE32
	str	x0, [sp, #16]
	ldr	w0, [x21, #4]
	bl	_HOST_TO_LE32
	str	x0, [sp, #8]
	ldr	w0, [x21]
	bl	_HOST_TO_LE32
	str	x0, [sp]
Lloh5:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_fseek
	cbz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errmsg
	mov	w0, #-1
	b	LBB0_3
LBB0_2:
	mov	x1, sp
	mov	x0, x20
	mov	w2, #80
	mov	x3, x19
	bl	_write_out_data
LBB0_3:
	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
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MYLO_MAGIC_FIRMWARE,4,2        ; @MYLO_MAGIC_FIRMWARE
	.comm	_fw_header,36,2                 ; @fw_header
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fseek failed on output file"

.subsections_via_symbols
