// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x496c(%rip), %rdi      # 0x8fc8
leaq 0x1dad(%rip), %rsi      # 0x6410
callq 0x2190
movq %rax, %r15
leaq -0x1d8(%rbp), %rdi
movq %rbx, %rsi
callq 0x5166
leaq -0x1d8(%rbp), %rsi
movq %r15, %rdi
callq 0x2170
leaq 0x1d09(%rip), %rsi      # 0x6399
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq -0x1d8(%rbp), %rdi
callq 0x20d0
movq 0x4915(%rip), %rdi      # 0x8fc8
leaq 0x1d60(%rip), %rsi      # 0x641a
callq 0x2190
movq 0x4912(%rip), %rdi      # 0x8fd8
leaq -0x38(%rbp), %rsi
callq 0x2050
movq -0x38(%rbp), %rax
movb (%rax), %r15b
movzbl %r15b, %ecx
leal -0x41(%rcx), %eax
cmpl $0x37, %eax
ja 0x4913
leaq 0x1917(%rip), %rcx      # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x1b8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x1b8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2ce7
movl %eax, %ebx
leaq -0x1b8(%rbp), %rdi
jmp 0x4982
leaq -0x138(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x138(%rbp), %rsi
movq %rbx, %rdi
callq 0x263d
leaq -0x138(%rbp), %rdi
callq 0x20d0
xorl %ebx, %ebx
jmp 0x49a8
xorb $0x1, (%r14)
jmp 0x49a6
leaq 0x1c69(%rip), %rsi      # 0x63ce
leaq -0x38(%rbp), %rdi
pushq $0x1
popq %rdx
callq 0x2120
cmpq $-0x1, %rax
je 0x495a
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x263d
testb %al, %al
je 0x49c1
leaq -0x198(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x198(%rbp), %rsi
movq %rbx, %rdi
callq 0x255a
movl %eax, %ebx
leaq -0x198(%rbp), %rdi
callq 0x20d0
leaq -0x58(%rbp), %rdi
jmp 0x4982
leaq -0x118(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x118(%rbp), %rsi
movq %rbx, %rdi
callq 0x255a
movl %eax, %ebx
leaq -0x118(%rbp), %rdi
jmp 0x4982
leaq -0xf8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0xf8(%rbp), %rsi
movq %rbx, %rdi
callq 0x2f8f
movl %eax, %ebx
leaq -0xf8(%rbp), %rdi
jmp 0x4982
leaq -0x158(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
movzbl (%r14), %edx
leaq -0x158(%rbp), %rsi
movq %rbx, %rdi
callq 0x286c
movl %eax, %ebx
leaq -0x158(%rbp), %rdi
jmp 0x4982
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdi
callq 0x36a8
movl %eax, %ebx
leaq -0xb8(%rbp), %rdi
jmp 0x4982
leaq -0xd8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0xd8(%rbp), %rsi
movq %rbx, %rdi
callq 0x3274
movl %eax, %ebx
leaq -0xd8(%rbp), %rdi
jmp 0x4982
leaq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
movzbl (%r14), %edx
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x3ae2
movl %eax, %ebx
leaq -0x98(%rbp), %rdi
jmp 0x4982
callq 0x241c
jmp 0x498b
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x40a9
movl %eax, %ebx
leaq -0x78(%rbp), %rdi
jmp 0x4982
testl %ecx, %ecx
je 0x49a6
movq 0x46a6(%rip), %rdi      # 0x8fc8
leaq 0x1b3d(%rip), %rsi      # 0x6466
callq 0x2190
movsbl %r15b, %esi
movq %rax, %rdi
callq 0x21b0
leaq 0x1ade(%rip), %rsi      # 0x641f
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x20f0
leaq 0x1ae1(%rip), %rsi      # 0x6439
jmp 0x4992
leaq -0x178(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq -0x178(%rbp), %rsi
movq %rbx, %rdi
callq 0x263d
movl %eax, %ebx
leaq -0x178(%rbp), %rdi
callq 0x20d0
testb %bl, %bl
jne 0x49a6
leaq 0x1aba(%rip), %rsi      # 0x644c
movq 0x462f(%rip), %rdi      # 0x8fc8
callq 0x2190
movq %rax, %rdi
callq 0x20f0
movb $0x1, %bl
leaq -0x38(%rbp), %rdi
callq 0x20d0
movl %ebx, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x20d0
jmp 0x498b
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
callq 0x20d0
jmp 0x49ec
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
jmp 0x4a67
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
jmp 0x4a67
jmp 0x4a6e
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
callq 0x20d0
jmp 0x4a71
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x2260