// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0xe8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xe8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0xa8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x21e0
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x5166
leaq 0x3d36(%rip), %rsi      # 0x63ce
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x2120
cmpq $-0x1, %rax
je 0x2761
movq 0x8(%r14), %rcx
leaq -0x38(%rbp), %rdi
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x21a0
leaq -0xb8(%rbp), %r14
leaq -0x38(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq %r15, %rdi
callq 0x20d0
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
callq 0x21e0
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x531e
movl %eax, %r15d
leaq -0x78(%rbp), %rdi
callq 0x20d0
movb $0x1, %r14b
testb %r15b, %r15b
jne 0x27c5
movq 0x68b3(%rip), %rdi      # 0x8fc8
leaq 0x3c68(%rip), %rsi      # 0x6384
callq 0x2190
movq %rax, %r14
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x5166
leaq -0x38(%rbp), %rsi
movq %r14, %rdi
callq 0x2170
leaq 0x3c56(%rip), %rsi      # 0x6399
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq -0x38(%rbp), %rdi
callq 0x20d0
xorl %r14d, %r14d
jmp 0x27c5
leaq -0x98(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x21e0
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x531e
leaq -0x98(%rbp), %rdi
callq 0x20d0
movq 0x6835(%rip), %rdi      # 0x8fc8
leaq 0x3bdf(%rip), %rsi      # 0x6379
callq 0x2190
leaq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x3cb4(%rip), %rsi      # 0x6466
movq %rax, %rdi
callq 0x2190
movb $0x1, %r14b
movq %rax, %rdi
callq 0x20f0
leaq -0x58(%rbp), %rdi
callq 0x20d0
leaq -0xd8(%rbp), %rdi
callq 0x20d0
leaq -0xb8(%rbp), %rdi
callq 0x20d0
leaq -0xf8(%rbp), %rdi
callq 0x20d0
movl %r14d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2834
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x2823
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x2823
jmp 0x2834
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20d0
jmp 0x2837
movq %rax, %rbx
jmp 0x2840
movq %rax, %rbx
jmp 0x284c
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20d0
leaq -0xd8(%rbp), %rdi
callq 0x20d0
leaq -0xb8(%rbp), %rdi
callq 0x20d0
leaq -0xf8(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2260