// File: /workspace/github_cpp_makefile_star2_O2/bjohnsonfl[P]Overhead-Chess-Engine-/UCI.cpp
// Function: UCI::loop()
void UCI::loop(){
    
    
     std::string line ="";
     std::string token = "";
    returnState newState = returnState();
     
     while (std::getline(std::cin, line))
     {
         std::istringstream stream (line);
         token.clear();
         stream >> std::skipws >> token;
       
     
         if(token == "uci")
            {
                std::cout << "id name: Overhead\n";
                std::cout << "id author: Blake Johnson\n";
                std::cout << "uciok\n";
            }
         else if( token == "isready") std::cout << "readyok\n";
         else if( token == "setoption"); //do options later
         else if( token == "register");  //later
         else if( token == "ucinewgame"); //do prep for new game
         else if( token == "position") parsePosition(stream, newState);
         else if (token == "go") parseGo(stream);
         
         //Try and figure out a solution to poll the stream buffer. getline blocks which is not a solution
         //uci says white space before message is possible so peeking is not a solution
         else if (token == "stop");
         else if(token == "quit") break;
     
         else std::cout <<"not a command\n";
     
     
     }
    
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, (%rsp)
leaq 0x13c4(%rip), %rbx      # 0x739e
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0x26c4
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0x26c4
movq 0x4fdb(%rip), %r14      # 0xafe0
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x1449(%rip), %rbx      # 0x7464
movq 0x4f8e(%rip), %rbp      # 0xafb0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6199
movq %r12, %rdi
movq %r15, %rsi
pushq $0x8
popq %rdx
callq 0x2200
andq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rax
orl $0x1000, 0x60(%rsp,%rax) # imm = 0x1000
movq %r12, %rdi
movq %r13, %rsi
callq 0x21a0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x5634
testb %al, %al
je 0x60ad
movq %rbp, %rdi
leaq 0x13d8(%rip), %rsi      # 0x7468
callq 0x2170
movq %rbp, %rdi
leaq 0x13dc(%rip), %rsi      # 0x747b
callq 0x2170
leaq 0x13ea(%rip), %rsi      # 0x7495
jmp 0x60c7
movq %r13, %rdi
leaq 0x13e5(%rip), %rsi      # 0x749c
callq 0x5634
leaq 0x13e1(%rip), %rsi      # 0x74a4
testb %al, %al
je 0x60dc
movq %rbp, %rdi
callq 0x2170
movq %r12, %rdi
callq 0x20c0
jmp 0x6022
movq %r13, %rdi
leaq 0x13c7(%rip), %rsi      # 0x74ad
callq 0x5634
testb %al, %al
jne 0x60cf
movq %r13, %rdi
leaq 0x13be(%rip), %rsi      # 0x74b7
callq 0x5634
testb %al, %al
jne 0x60cf
movq %r13, %rdi
leaq 0x13b4(%rip), %rsi      # 0x74c0
callq 0x5634
testb %al, %al
jne 0x60cf
movq %r13, %rdi
leaq 0x13ac(%rip), %rsi      # 0x74cb
callq 0x5634
testb %al, %al
je 0x6136
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x61f4
jmp 0x60cf
movq %r13, %rdi
leaq 0x1394(%rip), %rsi      # 0x74d4
callq 0x5634
testb %al, %al
je 0x615a
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x64e4
jmp 0x60cf
movq %r13, %rdi
leaq 0x1373(%rip), %rsi      # 0x74d7
callq 0x5634
testb %al, %al
jne 0x60cf
movq %r13, %rdi
leaq 0x1361(%rip), %rsi      # 0x74dc
callq 0x5634
leaq 0x135a(%rip), %rsi      # 0x74e1
testb %al, %al
je 0x60c7
leaq 0x48(%rsp), %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x2288
leaq 0x28(%rsp), %rdi
callq 0x2288
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x61e2
jmp 0x61c6
movq %rax, %rbx
jmp 0x61d8
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20c0
leaq 0x8(%rsp), %rdi
callq 0x2288
leaq 0x28(%rsp), %rdi
callq 0x2288
movq %rbx, %rdi
callq 0x2230