// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq 0x4951(%rip), %rdi      # 0x9fc8
leaq 0x1d92(%rip), %rsi      # 0x7410
movl $0x9, %edx
callq 0x2180
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x6676
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq 0x4925(%rip), %rdi      # 0x9fc8
callq 0x2180
movq %rax, %r15
leaq 0x1ce7(%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 -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56ff
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x48c2(%rip), %rdi      # 0x9fc8
leaq 0x1d0d(%rip), %rsi      # 0x741a
movl $0x4, %edx
callq 0x2180
movq 0x48ba(%rip), %rdi      # 0x9fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq 0x489f(%rip), %rdi      # 0x9fd8
leaq -0x40(%rbp), %rsi
callq 0x2290
movq -0x40(%rbp), %rsi
movb (%rsi), %r15b
movzbl %r15b, %ecx
leal -0x41(%rcx), %eax
cmpl $0x37, %eax
ja 0x5ad0
leaq 0x18a4(%rip), %rcx      # 0x7004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x1d0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x5f5e
leaq -0x1e0(%rbp), %rsi
movq %rbx, %rdi
callq 0x3281
movl %eax, %ebx
movq -0x1e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0x1d0(%rbp), %rsi
jmp 0x5bb1
leaq -0x130(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x5f5e
leaq -0x140(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
je 0x57fc
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2140
xorl %ebx, %ebx
jmp 0x5c05
xorb $0x1, (%r14)
jmp 0x5c03
leaq 0x1bbb(%rip), %rsi      # 0x73ce
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x2210
cmpq $-0x1, %rax
je 0x5b54
leaq -0x1b0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1c0(%rbp), %rdi
callq 0x5f5e
leaq -0x1c0(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
testb %al, %al
je 0x5b9c
leaq -0x190(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a0(%rbp), %rdi
callq 0x5f5e
leaq -0x1a0(%rbp), %rsi
movq %rbx, %rdi
callq 0x272e
movl %eax, %ebx
movq -0x1a0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5b9e
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x5b9e
leaq -0x110(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x5f5e
leaq -0x120(%rbp), %rsi
movq %rbx, %rdi
callq 0x272e
movl %eax, %ebx
movq -0x120(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0x110(%rbp), %rsi
jmp 0x5bb1
leaq -0xf0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x5f5e
leaq -0x100(%rbp), %rsi
movq %rbx, %rdi
callq 0x36ce
movl %eax, %ebx
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0xf0(%rbp), %rsi
jmp 0x5bb1
leaq -0x150(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x160(%rbp), %rdi
callq 0x5f5e
movzbl (%r14), %edx
leaq -0x160(%rbp), %rsi
movq %rbx, %rdi
callq 0x2c49
movl %eax, %ebx
movq -0x160(%rbp), %rdi
cmpq %r15, %rdi
je 0x5bb9
movq -0x150(%rbp), %rsi
jmp 0x5bb1
leaq -0xb0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x5f5e
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x4009
movl %eax, %ebx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0xb0(%rbp), %rsi
jmp 0x5bb1
leaq -0xd0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x5f5e
leaq -0xe0(%rbp), %rsi
movq %rbx, %rdi
callq 0x3a74
movl %eax, %ebx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0xd0(%rbp), %rsi
jmp 0x5bb1
leaq -0x90(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x5f5e
movzbl (%r14), %edx
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x45cb
movl %eax, %ebx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5bb9
movq -0x90(%rbp), %rsi
jmp 0x5bb1
callq 0x241c
jmp 0x5bbd
leaq -0x70(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x5f5e
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x4df4
movl %eax, %ebx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0x70(%rbp), %rsi
jmp 0x5bb1
testl %ecx, %ecx
je 0x5c03
movq 0x44e9(%rip), %rdi      # 0x9fc8
leaq 0x1980(%rip), %rsi      # 0x7466
movl $0x1, %edx
callq 0x2180
leaq -0x60(%rbp), %rsi
movb %r15b, (%rsi)
movq 0x44ca(%rip), %rdi      # 0x9fc8
movl $0x1, %edx
callq 0x2180
movq %rax, %rbx
leaq 0x190d(%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 0x18e7(%rip), %rsi      # 0x7439
jmp 0x5bc9
leaq -0x170(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
addq %rsi, %rdx
leaq -0x180(%rbp), %rdi
callq 0x5f5e
leaq -0x180(%rbp), %rsi
movq %rbx, %rdi
callq 0x2873
movl %eax, %ebx
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0x170(%rbp), %rsi
jmp 0x5bb1
xorl %ebx, %ebx
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5bb9
movq -0x1b0(%rbp), %rsi
incq %rsi
callq 0x2140
testb %bl, %bl
jne 0x5c03
movl $0x5, %edx
leaq 0x1883(%rip), %rsi      # 0x744c
movq 0x43f8(%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 0x43d2(%rip), %rdi      # 0x9fc8
callq 0x2040
movq %rax, %rdi
callq 0x20d0
movb $0x1, %bl
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5c1a
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2140
movl %ebx, %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x1a0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5c6e
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x5c6e
movq %rax, %rbx
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x170(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x1b0(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x70(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d9f
movq -0x90(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0xd0(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0xb0(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x1e0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x1d0(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x160(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d9f
movq -0x150(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0xf0(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x120(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x110(%rbp), %rsi
jmp 0x5d92
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
je 0x5d9f
movq -0x130(%rbp), %rsi
jmp 0x5d92
jmp 0x5d9c
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d9f
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2140
jmp 0x5d9f
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5db4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2260