	.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	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	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
	movl	$-1, %eax
	jmp	LBB0_3
LBB0_2:
	leaq	-96(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$72, %edx
	callq	_memset
	movq	56(%rbx), %rdi
	callq	_HOST_TO_BE32
	movq	%rax, -40(%rbp)
	leaq	-32(%rbp), %rdi
	movq	_ROMBIN_SIGNATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ROMBIN_SIG_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	48(%rbx), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rbx), %rax
	movq	%rax, -72(%rbp)
	movq	40(%rbx), %rdi
	callq	_HOST_TO_BE32
	movq	%rax, -56(%rbp)
	movq	32(%rbx), %rdi
	callq	_HOST_TO_BE32
	movq	%rax, -64(%rbp)
	movq	16(%rbx), %rdi
	callq	_HOST_TO_BE16
	movq	%rax, -80(%rbp)
	movq	8(%rbx), %rdi
	callq	_HOST_TO_BE16
	movq	%rax, -88(%rbp)
	movq	(%rbx), %rdi
	callq	_HOST_TO_BE32
	movq	%rax, -96(%rbp)
	movq	56(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	48(%rbx), %rdx
	leaq	L_.str.2(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	40(%rbx), %rdx
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	32(%rbx), %rdx
	leaq	L_.str.4(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	24(%rbx), %rdx
	leaq	L_.str.5(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	16(%rbx), %rdx
	leaq	L_.str.6(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	8(%rbx), %rdx
	leaq	L_.str.7(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	(%rbx), %rdx
	leaq	L_.str.8(%rip), %rsi
	movl	$2, %edi
	callq	_DBG
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$72, %edx
	xorl	%ecx, %ecx
	callq	_write_out_data
LBB0_3:
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	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	_ROMBIN_SIGNATURE,4,2           ## @ROMBIN_SIGNATURE
	.comm	_ROMBIN_SIG_LEN,4,2             ## @ROMBIN_SIG_LEN
L_.str.1:                               ## @.str.1
	.asciz	"hdr.addr      = 0x%08x"

L_.str.2:                               ## @.str.2
	.asciz	"hdr.type      = 0x%02x"

L_.str.3:                               ## @.str.3
	.asciz	"hdr.osize     = 0x%08x"

L_.str.4:                               ## @.str.4
	.asciz	"hdr.csize     = 0x%08x"

L_.str.5:                               ## @.str.5
	.asciz	"hdr.flags     = 0x%02x"

L_.str.6:                               ## @.str.6
	.asciz	"hdr.ocsum     = 0x%04x"

L_.str.7:                               ## @.str.7
	.asciz	"hdr.ccsum     = 0x%04x"

L_.str.8:                               ## @.str.8
	.asciz	"hdr.mmap_addr = 0x%08x"

.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	x20, x1
	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
	mov	w0, #-1
	b	LBB0_3
LBB0_2:
	add	x21, sp, #8
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #72
	bl	_memset
	ldr	x0, [x20, #56]
	bl	_HOST_TO_BE32
	str	x0, [sp, #64]
	add	x0, x21, #64
Lloh8:
	adrp	x8, _ROMBIN_SIGNATURE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ROMBIN_SIGNATURE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _ROMBIN_SIG_LEN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ROMBIN_SIG_LEN@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	x8, [x20, #24]
	ldp	x0, x9, [x20, #40]
	str	x9, [sp, #56]
	str	x8, [sp, #32]
	bl	_HOST_TO_BE32
	str	x0, [sp, #48]
	ldr	x0, [x20, #32]
	bl	_HOST_TO_BE32
	str	x0, [sp, #40]
	ldr	x0, [x20, #16]
	bl	_HOST_TO_BE16
	str	x0, [sp, #24]
	ldr	x0, [x20, #8]
	bl	_HOST_TO_BE16
	str	x0, [sp, #16]
	ldr	x0, [x20]
	bl	_HOST_TO_BE32
	str	x0, [sp, #8]
	ldr	x2, [x20, #56]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #48]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #40]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #32]
Lloh20:
	adrp	x1, l_.str.4@PAGE
Lloh21:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #24]
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #16]
Lloh24:
	adrp	x1, l_.str.6@PAGE
Lloh25:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20, #8]
Lloh26:
	adrp	x1, l_.str.7@PAGE
Lloh27:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #2
	bl	_DBG
	ldr	x2, [x20]
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	w0, #2
	bl	_DBG
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #72
	mov	x3, #0
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.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	_ROMBIN_SIGNATURE,4,2           ; @ROMBIN_SIGNATURE
	.comm	_ROMBIN_SIG_LEN,4,2             ; @ROMBIN_SIG_LEN
l_.str.1:                               ; @.str.1
	.asciz	"hdr.addr      = 0x%08x"

l_.str.2:                               ; @.str.2
	.asciz	"hdr.type      = 0x%02x"

l_.str.3:                               ; @.str.3
	.asciz	"hdr.osize     = 0x%08x"

l_.str.4:                               ; @.str.4
	.asciz	"hdr.csize     = 0x%08x"

l_.str.5:                               ; @.str.5
	.asciz	"hdr.flags     = 0x%02x"

l_.str.6:                               ; @.str.6
	.asciz	"hdr.ocsum     = 0x%04x"

l_.str.7:                               ; @.str.7
	.asciz	"hdr.ccsum     = 0x%04x"

l_.str.8:                               ; @.str.8
	.asciz	"hdr.mmap_addr = 0x%08x"

.subsections_via_symbols
