// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x5f5e
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x6676
leaq 0x4aea(%rip), %rsi      # 0x73ce
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %rdi
callq 0x2210
cmpq $-0x1, %rax
je 0x2a34
movq 0x8(%r14), %rcx
leaq -0x48(%rbp), %rdi
movl $0x2, %edx
movq %r14, %rsi
callq 0x2160
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %r14
movq %r14, %rsi
callq 0x2190
movq (%r14), %rdi
leaq -0x38(%rbp), %r12
cmpq %r12, %rdi
je 0x2940
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
leaq -0xb8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x5f5e
leaq -0xc8(%rbp), %rsi
movq %rbx, %rdi
callq 0x6900
movl %eax, %r15d
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2995
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2140
movb $0x1, %r14b
testb %r15b, %r15b
jne 0x2aed
movq 0x7620(%rip), %rdi      # 0x9fc8
leaq 0x49d5(%rip), %rsi      # 0x7384
movl $0x14, %edx
callq 0x2180
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x6676
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x75f4(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %rbx
leaq 0x49b6(%rip), %rsi      # 0x7399
movl $0x2, %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
movq %rax, %rdi
callq 0x20d0
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x2a2c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %r14d, %r14d
jmp 0x2aed
leaq -0xd8(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x5f5e
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x6900
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2a80
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x7541(%rip), %rdi      # 0x9fc8
leaq 0x48eb(%rip), %rsi      # 0x7379
movl $0xa, %edx
callq 0x2180
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x7521(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %rbx
leaq 0x49b0(%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, %r14b
movq %rax, %rdi
callq 0x20d0
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b06
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2b22
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2b3d
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x2b5f
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2140
movl %r14d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2bcc
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2bcf
movq -0xd8(%rbp), %rsi
jmp 0x2bc2
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2bcf
movq -0xb8(%rbp), %rsi
jmp 0x2bc2
jmp 0x2bcc
movq %rax, %rbx
jmp 0x2be8
movq %rax, %rbx
jmp 0x2c04
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x2bcf
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x2bcf
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2be8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2c04
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2c1f
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x2c41
movq -0xf8(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2260