	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function filesave
_filesave:                              ## @filesave
	.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	$136, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_path@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_1
LBB0_4:
	movq	_lines@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	movq	_bytes@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.5:
	testl	%edx, %edx
	jle	LBB0_12
## %bb.6:
	movl	$1, %eax
	cmpb	$0, -1(%rsi,%rax)
	jne	LBB0_9
	.p2align	4, 0x90
LBB0_8:
	movb	$10, -1(%rsi,%rax)
	movl	(%r15), %edx
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%edx, %rcx
	cmpq	%rcx, %rax
	jge	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%rbx), %rsi
	incq	%rax
	cmpb	$0, -1(%rsi,%rax)
	jne	LBB0_9
	jmp	LBB0_8
LBB0_11:
	movq	(%rbx), %rsi
LBB0_12:
	movq	(%r14), %rdi
	xorl	%ecx, %ecx
	callq	_r_file_dump
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	(%r14), %rsi
	movl	(%r15), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	movb	$0, -160(%rbp)
	movq	_stdin@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-160(%rbp), %rdi
	movl	$127, %esi
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movb	$0, -33(%rbp)
	leaq	-160(%rbp), %rdi
	callq	_strlen
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.3:
	decl	%eax
	movb	$0, -160(%rbp,%rax)
	movq	(%r14), %rdi
	callq	_free
	leaq	-160(%rbp), %rdi
	callq	_strdup
	movq	%rax, (%r14)
	jmp	LBB0_4
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
LBB0_15:
	movq	(%rbx), %rdi
	movl	$10, %esi
	callq	_r_str_split
	movq	_nlines@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	addq	$136, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_path,8,3                       ## @path
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"File: "

	.comm	_stdin,4,2                      ## @stdin
	.comm	_lines,8,3                      ## @lines
	.comm	_bytes,4,2                      ## @bytes
L_.str.1:                               ## @.str.1
	.asciz	"File '%s' saved (%d byte(s))\n"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot save file\n"

	.comm	_nlines,4,2                     ## @nlines
	.no_dead_strip	_filesave
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function filesave
_filesave:                              ; @filesave
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x19, _path@GOTPAGE
Lloh4:
	ldr	x19, [x19, _path@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_9
LBB0_1:
Lloh5:
	adrp	x20, _lines@GOTPAGE
Lloh6:
	ldr	x20, [x20, _lines@GOTPAGEOFF]
	ldr	x1, [x20]
Lloh7:
	adrp	x21, _bytes@GOTPAGE
Lloh8:
	ldr	x21, [x21, _bytes@GOTPAGEOFF]
	ldr	w2, [x21]
	cmp	x1, #0
	ccmp	w2, #1, #8, ne
	b.lt	LBB0_7
; %bb.2:
	mov	x8, #0
	mov	w9, #10
	ldrb	w10, [x1, x8]
	cbnz	w10, LBB0_4
LBB0_3:
	strb	w9, [x1, x8]
	ldr	w2, [x21]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, #1
	cmp	x8, w2, sxtw
	b.ge	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [x20]
	ldrb	w10, [x1, x8]
	cbnz	w10, LBB0_4
	b	LBB0_3
LBB0_6:
	ldr	x1, [x20]
LBB0_7:
	ldr	x0, [x19]
	mov	w3, #0
	bl	_r_file_dump
	cbz	x0, LBB0_12
; %bb.8:
	ldr	x8, [x19]
	ldr	w9, [x21]
	stp	x8, x9, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_9:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	strb	wzr, [sp, #24]
Lloh13:
	adrp	x8, _stdin@GOTPAGE
Lloh14:
	ldr	x8, [x8, _stdin@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	add	x0, sp, #24
	mov	w1, #127
	bl	_fgets
	cbz	x0, LBB0_1
; %bb.10:
	strb	wzr, [sp, #151]
	add	x20, sp, #24
	add	x0, sp, #24
	bl	_strlen
	subs	w8, w0, #1
	b.lt	LBB0_1
; %bb.11:
	strb	wzr, [x20, w8, uxtw]
	ldr	x0, [x19]
	bl	_free
	add	x0, sp, #24
	bl	_strdup
	str	x0, [x19]
	b	LBB0_1
LBB0_12:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_13:
	bl	_eprintf
	ldr	x0, [x20]
	mov	w1, #10
	bl	_r_str_split
Lloh18:
	adrp	x8, _nlines@GOTPAGE
Lloh19:
	ldr	x8, [x8, _nlines@GOTPAGEOFF]
Lloh20:
	str	w0, [x8]
	ldur	x8, [x29, #-40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_path,8,3                       ; @path
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"File: "

	.comm	_stdin,4,2                      ; @stdin
	.comm	_lines,8,3                      ; @lines
	.comm	_bytes,4,2                      ; @bytes
l_.str.1:                               ; @.str.1
	.asciz	"File '%s' saved (%d byte(s))\n"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot save file\n"

	.comm	_nlines,4,2                     ; @nlines
	.no_dead_strip	_filesave
.subsections_via_symbols
