	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_image_writeout                 ## -- Begin function image_writeout
	.p2align	4, 0x90
_image_writeout:                        ## @image_writeout
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rcx
	testq	%rcx, %rcx
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movslq	24(%rsi), %rdx
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_DBG
	movq	_CSUM_TYPE_32@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_csum_init
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	callq	_image_writeout_file
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	8(%r15), %rbx
	subq	(%r15), %rbx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_DBG
	movl	20(%r15), %edx
	leaq	-40(%rbp), %r12
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rcx
	callq	_write_out_padding
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_csum_get
	movl	%eax, 16(%r15)
	jmp	LBB0_4
LBB0_1:
	xorl	%ebx, %ebx
LBB0_4:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing image, file=%s, file_size=%d\n"

	.comm	_CSUM_TYPE_32,4,2               ## @CSUM_TYPE_32
L_.str.1:                               ## @.str.1
	.asciz	"padding desc, length=%zu"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_image_writeout                 ; -- Begin function image_writeout
	.p2align	2
_image_writeout:                        ; @image_writeout
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x1]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldrsw	x2, [x1, #24]
	str	x8, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_DBG
Lloh2:
	adrp	x8, _CSUM_TYPE_32@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSUM_TYPE_32@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_csum_init
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_image_writeout_file
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldp	x9, x8, [x19]
	sub	x21, x8, x9
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x21
	bl	_DBG
	ldr	w2, [x19, #20]
	add	x3, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_write_out_padding
	mov	x21, x0
	add	x0, sp, #8
	bl	_csum_get
	str	w0, [x19, #16]
	b	LBB0_4
LBB0_3:
	mov	w21, #0
LBB0_4:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing image, file=%s, file_size=%d\n"

	.comm	_CSUM_TYPE_32,4,2               ; @CSUM_TYPE_32
l_.str.1:                               ; @.str.1
	.asciz	"padding desc, length=%zu"

.subsections_via_symbols
