// File: /workspace/github_cpp_makefile_star2_O1/craigbarstow[P]cmd-line-text-editor/text_editor.cc
// Function: save_file(text_ed&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool save_file(text_ed & T, string cl) { //take out couts
  string fn, new_name,CL=cl;
  int start,end;
  bool ok;
  string current_file = T.filename();
  if (cl.find_first_not_of(" ", 1)==string::npos) {  //if no filename given, save as current filename
    T.save_file(current_file); 
    cout << "Saved as \"" << current_file <<"\""<< endl;
    return true;
  } else { //if filename give after s in command line, save as given filename
    new_name = cl.substr(2,cl.length());
    ok = T.save_file(new_name);
    if (!ok) { //if it cant save to the given filename return an error message
      cout << "Can't save to file \"" << T.filename() << "\"." << endl;
    }
    return ok; //return the boolean value indicating whether the save was successful
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x5f86
leaq -0x68(%rbp), %rdi
movq %r14, %rsi
callq 0x6686
leaq 0x4ae8(%rip), %rsi      # 0x73ce
movl $0x1, %edx
movl $0x1, %ecx
movq %rbx, %rdi
callq 0x2210
cmpq $-0x1, %rax
je 0x2a32
movq 0x8(%rbx), %rcx
leaq -0x48(%rbp), %rdi
movl $0x2, %edx
movq %rbx, %rsi
callq 0x2160
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rbx
movq %rbx, %rsi
callq 0x2190
movq (%rbx), %rdi
leaq -0x38(%rbp), %r13
cmpq %r13, %rdi
je 0x2942
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x5f86
leaq -0xc8(%rbp), %rsi
movq %r14, %rdi
callq 0x6910
movl %eax, %ebx
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2996
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2140
testb %bl, %bl
jne 0x2aea
movq 0x7623(%rip), %rdi      # 0x9fc8
leaq 0x49d8(%rip), %rsi      # 0x7384
movl $0x14, %edx
callq 0x2180
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x6686
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x75f7(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %r14
leaq 0x49b9(%rip), %rsi      # 0x7399
movl $0x2, %edx
movq %rax, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2aea
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x2aea
leaq -0xd8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x5f86
leaq -0xe8(%rbp), %rsi
movq %r14, %rdi
callq 0x6910
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2a7e
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x7543(%rip), %rdi      # 0x9fc8
leaq 0x48ed(%rip), %rsi      # 0x7379
movl $0xa, %edx
callq 0x2180
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x7523(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %rbx
leaq 0x49b2(%rip), %rsi      # 0x7466
movl $0x1, %edx
movq %rax, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movb $0x1, %bl
movq %rax, %rdi
callq 0x20d0
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
leaq -0xf8(%rbp), %r14
je 0x2b0a
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2b26
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2b41
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x108(%rbp), %rdi
cmpq %r14, %rdi
je 0x2b5c
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2140
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2bc8
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2bcb
movq -0xd8(%rbp), %rsi
jmp 0x2bbe
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2bcb
movq -0xb8(%rbp), %rsi
jmp 0x2bbe
jmp 0x2bc8
movq %rax, %rbx
jmp 0x2be4
movq %rax, %rbx
jmp 0x2c00
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2bcb
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x2bcb
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2be4
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2c00
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2c1b
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x2c3d
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2260