// File: /workspace/github_cpp_makefile_star2_O1/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 0x44da(%rip), %rax      # 0x71c8
testq %rax, %rax
je 0x2d0f
movq 0x44c6(%rip), %rcx      # 0x71c0
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2d0f
decq %rax
movq %rax, 0x44bd(%rip)      # 0x71c8
movb $0x0, (%rcx,%rax)
movq 0x44d2(%rip), %rax      # 0x71e8
testq %rax, %rax
je 0x2d37
movq 0x44be(%rip), %rcx      # 0x71e0
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2d37
decq %rax
movq %rax, 0x44b5(%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 0x4272(%rip), %r13      # 0x6fd8
leaq -0x88(%rbp), %r14
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %r15, %rdi
leaq 0x1370(%rip), %rsi      # 0x40f5
leaq 0x136c(%rip), %rdx      # 0x40f8
callq 0x35b6
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x2916
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2dbf
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x2dde
movq -0x48(%rbp), %rcx
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x2dde
decq %rax
movq %rax, -0x40(%rbp)
movb $0x0, (%rcx,%rax)
movq 0x41db(%rip), %rdi      # 0x6fc0
movl $0x1f, %esi
callq 0x264c
movq 0x43ca(%rip), %rsi      # 0x71c0
movq 0x43cb(%rip), %rdx      # 0x71c8
movq %rax, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12e2(%rip), %rsi      # 0x40f9
callq 0x21b0
movq 0x43bd(%rip), %rsi      # 0x71e0
movq 0x43be(%rip), %rdx      # 0x71e8
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0x12b7(%rip), %rsi      # 0x40fb
callq 0x21b0
movq %r12, %rdi
movl $0x27, %esi
callq 0x264c
movq %rax, %rdi
movl $0x22, %esi
callq 0x264c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rax, %rdi
callq 0x21b0
movq %rax, %rdi
movl $0x27, %esi
callq 0x264c
movl $0x2, %edx
movq %rax, %rdi
leaq 0x126e(%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 0x351c
movq %r14, %rdi
callq 0x2a41
movl %eax, %r12d
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2efd
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 0x2f30
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2180
testl %r12d, %r12d
jne 0x2d6d
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x2f5b
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2f74
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 0x2fe7
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2fe7
movq -0x98(%rbp), %rsi
jmp 0x2fdf
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2fce
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2180
jmp 0x2fce
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2fe7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x3009
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3022
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2290