// File: /workspace/github_cpp_makefile_star2_O1/craigbarstow[P]cmd-line-text-editor/text_editor.cc
// Function: Do_Command(text_ed&, bool&)
bool Do_Command (text_ed & T, bool& toggle) { //
 char command;
 string command_line;
 bool success, filename_presence=false;
 cout << "File is \"" << T.filename() << "\"." << endl; //print out filename
 cout << "--> ";
 getline(cin,command_line);  //get input from command line
 command = command_line[0];
 switch (command) {
 case 'h':
 case 'H': Show_Commands(); break;
 case 'a':
 case 'A': success = add_lines(T,command_line); break;
 case 'q':
 case 'Q': return false;
 case 's':
 case 'S':
   if (command_line.find_first_not_of(" ",1)!=string::npos) { //if filename is present, toggle bool to true
     filename_presence = true;
   } 
   if (filename_presence) { //if filename is present, save file to filename and retrieve new filename
     success = save_file(T,command_line) && get_file(T,command_line);
   } else { //otherwise save the file under the current name
     success = save_file(T,command_line);
   }
   break;
 break;
 case 't':
 case 'T': success = type_lines(T,command_line, toggle); break;
 case 'x':
 case 'X': success = save_file(T,command_line);
	   return false;
	   break;
 case 'g':
 case 'G': success = get_file(T,command_line); break;
 case 'n':
 case 'N': if (!toggle) {
	    toggle=true;
	   } else {
	    toggle=false;
	   }
	   success = true; 
	   break;
 case 'd':
 case 'D': success = delete_line(T,command_line); break;
 case 'c':
 case 'C': success = copy_line(T,command_line); break;
 case 'm':
 case 'M': success = move_line(T,command_line); break;
 case 'f':
 case 'F': success = find_and_type(T,command_line, toggle); break;
 case 'r':
 case 'R': success = find_and_replace(T,command_line); break;
 default: if (command) {
              cout << "\"" << command << "\" is not a valid command." << endl;
      cout << "Type \"h\" for help." << endl;
      success = true;
          } else {
    success = true;
  }
 }
 if ( !success ) cout << "Error" << endl;
 return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq 0x48b3(%rip), %rdi      # 0x9fc8
leaq 0x1cf4(%rip), %rsi      # 0x7410
movl $0x9, %edx
callq 0x2180
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x6686
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x4887(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %r15
leaq 0x1c49(%rip), %rsi      # 0x7399
movl $0x2, %edx
movq %rax, %rdi
callq 0x2180
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20d0
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x579d
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x4824(%rip), %rdi      # 0x9fc8
leaq 0x1c6f(%rip), %rsi      # 0x741a
movl $0x4, %edx
callq 0x2180
movq 0x481c(%rip), %rdi      # 0x9fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq 0x4801(%rip), %rdi      # 0x9fd8
leaq -0x48(%rbp), %rsi
callq 0x2290
movq -0x48(%rbp), %rsi
movb (%rsi), %r15b
movzbl %r15b, %ecx
leal -0x41(%rcx), %eax
cmpl $0x37, %eax
ja 0x5adb
leaq 0x1806(%rip), %rcx      # 0x7004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x1d8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x5f86
leaq -0x1e8(%rbp), %rsi
movq %rbx, %rdi
callq 0x32a9
movl %eax, %ebx
movq -0x1e8(%rbp), %rdi
jmp 0x5bcb
leaq -0x78(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x5f86
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x5884
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %ebx, %ebx
jmp 0x5c28
xorb $0x1, (%r14)
jmp 0x5c26
leaq 0x1b33(%rip), %rsi      # 0x73ce
leaq -0x48(%rbp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x2210
cmpq $-0x1, %rax
je 0x5b62
leaq -0x1b8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x5f86
leaq -0x1c8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
movl %eax, %r14d
testb %al, %al
je 0x5b9e
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x5f86
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x272e
movl %eax, %ebx
jmp 0x5ba0
leaq -0x158(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x168(%rbp), %rdi
callq 0x5f86
leaq -0x168(%rbp), %rsi
movq %rbx, %rdi
callq 0x272e
movl %eax, %ebx
movq -0x168(%rbp), %rdi
jmp 0x5bcb
leaq -0x138(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x148(%rbp), %rdi
callq 0x5f86
leaq -0x148(%rbp), %rsi
movq %rbx, %rdi
callq 0x371d
movl %eax, %ebx
movq -0x148(%rbp), %rdi
jmp 0x5bcb
leaq -0x178(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rdi
callq 0x5f86
movzbl (%r14), %edx
leaq -0x188(%rbp), %rsi
movq %rbx, %rdi
callq 0x2c45
movl %eax, %ebx
movq -0x188(%rbp), %rdi
jmp 0x5bcb
leaq -0xf8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x5f86
leaq -0x108(%rbp), %rsi
movq %rbx, %rdi
callq 0x408a
movl %eax, %ebx
movq -0x108(%rbp), %rdi
jmp 0x5bcb
leaq -0x118(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x5f86
leaq -0x128(%rbp), %rsi
movq %rbx, %rdi
callq 0x3aec
movl %eax, %ebx
movq -0x128(%rbp), %rdi
jmp 0x5bcb
leaq -0xd8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x5f86
movzbl (%r14), %edx
leaq -0xe8(%rbp), %rsi
movq %rbx, %rdi
callq 0x4650
movl %eax, %ebx
movq -0xe8(%rbp), %rdi
jmp 0x5bcb
callq 0x241c
jmp 0x5bdb
leaq -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x5f86
leaq -0xc8(%rbp), %rsi
movq %rbx, %rdi
callq 0x4e79
movl %eax, %ebx
movq -0xc8(%rbp), %rdi
jmp 0x5bcb
testl %ecx, %ecx
je 0x5c26
movq 0x44de(%rip), %rdi      # 0x9fc8
leaq 0x1975(%rip), %rsi      # 0x7466
movl $0x1, %edx
callq 0x2180
leaq -0x68(%rbp), %rsi
movb %r15b, (%rsi)
movq 0x44bf(%rip), %rdi      # 0x9fc8
movl $0x1, %edx
callq 0x2180
movq %rax, %rbx
leaq 0x1902(%rip), %rsi      # 0x741f
movl $0x19, %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
movl $0x12, %edx
leaq 0x18dc(%rip), %rsi      # 0x7439
jmp 0x5bec
leaq -0x198(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x5f86
leaq -0x1a8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
movl %eax, %ebx
movq -0x1a8(%rbp), %rdi
jmp 0x5bcb
xorl %ebx, %ebx
testb %r14b, %r14b
je 0x5bc4
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bc4
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x1c8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5bdb
movq (%r15), %rsi
incq %rsi
callq 0x2140
testb $0x1, %bl
jne 0x5c26
movl $0x5, %edx
leaq 0x1860(%rip), %rsi      # 0x744c
movq 0x43d5(%rip), %rbx      # 0x9fc8
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x43af(%rip), %rdi      # 0x9fc8
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movb $0x1, %bl
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5c3d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movl %ebx, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x5c93
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x5c93
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x198(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x1c8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x1b8(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0xb8(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0xd8(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x118(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x108(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0xf8(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x1e8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x1d8(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x188(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x178(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x138(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x168(%rbp), %rdi
cmpq %r15, %rdi
je 0x5dc7
movq -0x158(%rbp), %rsi
jmp 0x5dba
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x5dc7
movq -0x78(%rbp), %rsi
jmp 0x5dba
jmp 0x5dc4
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dc7
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x5dc7
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5ddc
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2260