	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_writeback                      ## -- Begin function writeback
	.p2align	4, 0x90
_writeback:                             ## @writeback
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_mailname@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_Fopen
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r12
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_getc
	movq	_EOF@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	je	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_putc
	movq	%r14, %rdi
	callq	_getc
	cmpl	(%rbx), %eax
	jne	LBB0_3
LBB0_4:
	movq	_msgCount@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jle	LBB0_12
## %bb.5:
	movq	_message@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%r15d, %r15d
	movq	_MPRESERVE@GOTPCREL(%rip), %r13
	movq	%rcx, %rbx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	_MTOUCH@GOTPCREL(%rip), %rsi
	testl	%edx, (%rsi)
	je	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_8 Depth=1
	addq	$4, %rbx
	leaq	(%rcx,%rax,4), %rdx
	cmpq	%rdx, %rbx
	jae	LBB0_13
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	testl	%edx, (%r13)
	je	LBB0_6
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_sendmessage
	testq	%rax, %rax
	js	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%r15d
	movq	_message@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_msgCount@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_7
LBB0_11:
	movq	(%rbx), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	jmp	LBB0_17
LBB0_12:
	xorl	%r15d, %r15d
LBB0_13:
	movq	%r12, %rdi
	callq	_fflush
	movq	%r12, %rdi
	callq	_trunc
	movq	%r12, %rdi
	callq	_ferror
	testq	%rax, %rax
	je	LBB0_19
## %bb.14:
	movq	_mailname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	jmp	LBB0_16
LBB0_15:
	movq	_mailname@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.1(%rip), %rdi
	callq	_warnx
LBB0_16:
	movq	%r12, %rdi
	callq	_Fclose
LBB0_17:
	movl	$-1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	testq	%r14, %r14
	je	LBB0_21
## %bb.20:
	movq	%r14, %rdi
	callq	_Fclose
LBB0_21:
	movq	%r12, %rdi
	callq	_Fclose
	movq	_mailname@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_alter
	movq	(%rbx), %rdx
	cmpl	$1, %r15d
	jne	LBB0_23
## %bb.22:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rdx, %rsi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_18
LBB0_23:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_mailname,8,3                   ## @mailname
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r+"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_EOF,4,2                        ## @EOF
	.comm	_message,8,3                    ## @message
	.comm	_msgCount,8,3                   ## @msgCount
	.comm	_MPRESERVE,4,2                  ## @MPRESERVE
	.comm	_MTOUCH,4,2                     ## @MTOUCH
L_.str.2:                               ## @.str.2
	.asciz	"Held 1 message in %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"Held %d messages in %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_writeback                      ; -- Begin function writeback
	.p2align	2
_writeback:                             ; @writeback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
Lloh0:
	adrp	x22, _mailname@GOTPAGE
Lloh1:
	ldr	x22, [x22, _mailname@GOTPAGEOFF]
	ldr	x0, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Fopen
	cbz	x0, LBB0_12
; %bb.1:
	mov	x19, x0
	cbz	x20, LBB0_5
; %bb.2:
	mov	x0, x20
	bl	_getc
Lloh4:
	adrp	x21, _EOF@GOTPAGE
Lloh5:
	ldr	x21, [x21, _EOF@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x19
	bl	_putc
	mov	x0, x20
	bl	_getc
	b	LBB0_3
LBB0_5:
Lloh6:
	adrp	x24, _msgCount@GOTPAGE
Lloh7:
	ldr	x24, [x24, _msgCount@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x8, #1
	b.lt	LBB0_13
; %bb.6:
	mov	w23, #0
Lloh8:
	adrp	x25, _message@GOTPAGE
Lloh9:
	ldr	x25, [x25, _message@GOTPAGEOFF]
	ldr	x9, [x25]
Lloh10:
	adrp	x26, _MPRESERVE@GOTPAGE
Lloh11:
	ldr	x26, [x26, _MPRESERVE@GOTPAGEOFF]
Lloh12:
	adrp	x27, _MTOUCH@GOTPAGE
Lloh13:
	ldr	x27, [x27, _MTOUCH@GOTPAGEOFF]
	mov	x21, x9
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w11, [x27]
	tst	w11, w10
	b.eq	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x21, #4
	add	x10, x9, x8, lsl #2
	cmp	x21, x10
	b.hs	LBB0_14
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x21]
	ldr	w11, [x26]
	tst	w11, w10
	b.eq	LBB0_7
LBB0_10:                                ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x21
	mov	x1, x19
	mov	x2, #0
	mov	x3, #0
	bl	_sendmessage
	tbnz	x0, #63, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w23, w23, #1
	ldr	x9, [x25]
	ldr	x8, [x24]
	b	LBB0_8
LBB0_12:
	ldr	x1, [x22]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	mov	w0, #-1
	b	LBB0_24
LBB0_13:
	mov	w23, #0
LBB0_14:
	mov	x0, x19
	bl	_fflush
	mov	x0, x19
	bl	_trunc
	mov	x0, x19
	bl	_ferror
	cbz	x0, LBB0_18
; %bb.15:
	ldr	x1, [x22]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_17
LBB0_16:
	ldr	x1, [x22]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warnx
LBB0_17:
	mov	x0, x19
	bl	_Fclose
	mov	w0, #-1
	b	LBB0_24
LBB0_18:
	cbz	x20, LBB0_20
; %bb.19:
	mov	x0, x20
	bl	_Fclose
LBB0_20:
	mov	x0, x19
	bl	_Fclose
	ldr	x0, [x22]
	bl	_alter
	ldr	x8, [x22]
	cmp	w23, #1
	b.ne	LBB0_22
; %bb.21:
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_23
LBB0_22:
	stp	x23, x8, [sp]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_23:
	bl	_printf
	mov	w0, #0
LBB0_24:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_mailname,8,3                   ; @mailname
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r+"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_EOF,4,2                        ; @EOF
	.comm	_message,8,3                    ; @message
	.comm	_msgCount,8,3                   ; @msgCount
	.comm	_MPRESERVE,4,2                  ; @MPRESERVE
	.comm	_MTOUCH,4,2                     ; @MTOUCH
l_.str.2:                               ; @.str.2
	.asciz	"Held 1 message in %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"Held %d messages in %s\n"

.subsections_via_symbols
