// File: /workspace/github_cpp_makefile_star2_O3/frainfreeze[P]tss/main.cpp
// Function: main_loop()
void main_loop(){
    //clean whoami and hostname strings
    if (!whoami.empty() && whoami[whoami.length()-1] == '\n') { 
        whoami.erase(whoami.length()-1);
    }
    if (!hostname.empty() && hostname[hostname.length()-1] == '\n') { 
        hostname.erase(hostname.length()-1);
    }

    std::string line;
    std::string args;
    int status;

    do {
        std::string pwd = shell::exec("pwd");
        //clean pwd string
        if (!pwd.empty() && pwd[pwd.length()-1] == '\n') { 
            pwd.erase(pwd.length()-1);
        }

        std::cout << Color::FG_RED << whoami << "@" << hostname << ":" << Color::FG_DEFAULT 
                  << Color::FG_BLUE << pwd << Color::FG_DEFAULT << "$ ";

        std::getline(std::cin, line);
        status = shell::parse(line);
        
        line.clear();
        args.clear();
    } while (status);    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq 0x44ec(%rip), %rax      # 0x71c8
testq %rax, %rax
je 0x2cfd
movq 0x44d8(%rip), %rcx      # 0x71c0
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2cfd
decq %rax
movq %rax, 0x44cf(%rip)      # 0x71c8
movb $0x0, (%rcx,%rax)
movq 0x44e4(%rip), %rax      # 0x71e8
testq %rax, %rax
je 0x2d25
movq 0x44d0(%rip), %rcx      # 0x71e0
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2d25
decq %rax
movq %rax, 0x44c7(%rip)      # 0x71e8
movb $0x0, (%rcx,%rax)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
xorl %ebx, %ebx
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
movq %rbx, -0x8(%rax)
movb %bl, (%rax)
leaq -0xa8(%rbp), %r15
movq 0x4284(%rip), %r13      # 0x6fd8
leaq -0x88(%rbp), %r14
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %r15, %rdi
leaq 0x1382(%rip), %rsi      # 0x40f5
leaq 0x137e(%rip), %rdx      # 0x40f8
callq 0x35a8
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x2906
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2dad
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x2dcc
movq -0x48(%rbp), %rcx
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2dcc
decq %rax
movq %rax, -0x40(%rbp)
movb $0x0, (%rcx,%rax)
movq 0x41ed(%rip), %rdi      # 0x6fc0
movl $0x1f, %esi
callq 0x263c
movq 0x43dc(%rip), %rsi      # 0x71c0
movq 0x43dd(%rip), %rdx      # 0x71c8
movq %rax, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12f4(%rip), %rsi      # 0x40f9
callq 0x21b0
movq 0x43cf(%rip), %rsi      # 0x71e0
movq 0x43d0(%rip), %rdx      # 0x71e8
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12c9(%rip), %rsi      # 0x40fb
callq 0x21b0
movq %r12, %rdi
movl $0x27, %esi
callq 0x263c
movq %rax, %rdi
movl $0x22, %esi
callq 0x263c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
movl $0x27, %esi
callq 0x263c
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1280(%rip), %rsi      # 0x40fd
callq 0x21b0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
callq 0x22b0
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x350a
movq %r14, %rdi
callq 0x2a2f
movl %eax, %r12d
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2eeb
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2180
movq %rbx, -0x60(%rbp)
movq -0x68(%rbp), %rax
movb %bl, (%rax)
movq %rbx, -0xc0(%rbp)
movq -0xc8(%rbp), %rax
movb %bl, (%rax)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2f1e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2180
testl %r12d, %r12d
jne 0x2d5b
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x2f49
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2f62
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2180
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2fd5
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2fd5
movq -0x98(%rbp), %rsi
jmp 0x2fcd
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2fbc
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2fbc
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2fd5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x2ff7
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3010
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2290