	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_rootfs                   ## -- Begin function write_rootfs
	.p2align	4, 0x90
_write_rootfs:                          ## @write_rootfs
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	_ROOTFS_START@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	%rax, %rbx
	movq	_ROOTFS_SIZE@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	movq	%r14, %rcx
	callq	_fwrite
	cmpq	(%r15), %rax
	jne	LBB0_4
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	callq	_write_rootfs.cold.1
	jmp	LBB0_3
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	movq	%r14, %rdi
	callq	_fclose
	movl	$-1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function write_rootfs.cold.1
_write_rootfs.cold.1:                   ## @write_rootfs.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_app_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_perror
	pushq	$-1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wb"

	.comm	_app_name,8,3                   ## @app_name
	.comm	_ROOTFS_START,4,2               ## @ROOTFS_START
	.comm	_ROOTFS_SIZE,8,3                ## @ROOTFS_SIZE
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.asciz	"%s: can't write image file\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_rootfs                   ; -- Begin function write_rootfs
	.p2align	2
_write_rootfs:                          ; @write_rootfs
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x8, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_fopen
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _ROOTFS_START@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ROOTFS_START@GOTPAGEOFF]
Lloh4:
	ldrsw	x8, [x8]
	add	x0, x20, x8
Lloh5:
	adrp	x20, _ROOTFS_SIZE@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ROOTFS_SIZE@GOTPAGEOFF]
	ldr	x2, [x20]
	mov	w1, #1
	mov	x3, x19
	bl	_fwrite
	ldr	x8, [x20]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	bl	_write_rootfs.cold.1
LBB0_4:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _app_name@GOTPAGE
Lloh11:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh12:
	ldr	x2, [x8]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	x0, x19
	bl	_fclose
	mov	w0, #-1
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function write_rootfs.cold.1
_write_rootfs.cold.1:                   ; @write_rootfs.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh15:
	adrp	x8, _app_name@GOTPAGE
Lloh16:
	ldr	x8, [x8, _app_name@GOTPAGEOFF]
Lloh17:
	ldr	x0, [x8]
	bl	_perror
	mov	w0, #-1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wb"

	.comm	_app_name,8,3                   ; @app_name
	.comm	_ROOTFS_START,4,2               ; @ROOTFS_START
	.comm	_ROOTFS_SIZE,8,3                ; @ROOTFS_SIZE
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.asciz	"%s: can't write image file\n"

.subsections_via_symbols
