// File: /workspace/github_cpp_makefile_star2_O1/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 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1def(%rip), %rbx      # 0x8372
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x44f4
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x44f4
movq 0x4a2d(%rip), %r15      # 0xafe0
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq 0x49f7(%rip), %r14      # 0xafc0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x67ba
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x2200
movq $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 %r13, %rdi
movq %rbp, %rsi
callq 0x2190
movq %rbp, %rdi
leaq 0x1df4(%rip), %rsi      # 0x8438
callq 0x2070
testl %eax, %eax
je 0x6712
movq %rbp, %rdi
leaq 0x1e15(%rip), %rsi      # 0x8470
callq 0x2070
testl %eax, %eax
je 0x6748
movq %rbp, %rdi
leaq 0x1e0f(%rip), %rsi      # 0x8481
callq 0x2070
testl %eax, %eax
je 0x675f
movq %rbp, %rdi
leaq 0x1e02(%rip), %rsi      # 0x848b
callq 0x2070
testl %eax, %eax
je 0x675f
movq %rbp, %rdi
leaq 0x1df4(%rip), %rsi      # 0x8494
callq 0x2070
testl %eax, %eax
je 0x675f
movq %rbp, %rdi
leaq 0x1de8(%rip), %rsi      # 0x849f
callq 0x2070
testl %eax, %eax
je 0x6780
movq %rbp, %rdi
leaq 0x1dda(%rip), %rsi      # 0x84a8
callq 0x2070
testl %eax, %eax
je 0x678e
movq %rbp, %rdi
leaq 0x1dc6(%rip), %rsi      # 0x84ab
callq 0x2070
testl %eax, %eax
je 0x675f
movq %rbp, %rdi
leaq 0x1db8(%rip), %rsi      # 0x84b0
callq 0x2070
movl $0xe, %ebx
leaq 0x1dac(%rip), %rsi      # 0x84b5
testl %eax, %eax
jne 0x6754
jmp 0x679c
movl $0x12, %edx
movq %r14, %rdi
leaq 0x1d1b(%rip), %rsi      # 0x843c
callq 0x2180
movl $0x6, %ebx
movl $0x19, %edx
movq %r14, %rdi
leaq 0x1d15(%rip), %rsi      # 0x844f
callq 0x2180
leaq 0x1d23(%rip), %rsi      # 0x8469
jmp 0x6754
movl $0x8, %ebx
leaq 0x1d24(%rip), %rsi      # 0x8478
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2180
movq %r13, %rdi
movq 0x484f(%rip), %rsi      # 0xafb8
callq 0x21c0
leaq 0xc0(%rsp), %rdi
callq 0x2090
jmp 0x65c9
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x6872
jmp 0x675f
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x6cb6
jmp 0x675f
movq 0x4815(%rip), %rsi      # 0xafb8
leaq 0x48(%rsp), %rdi
callq 0x21c0
leaq 0xc0(%rsp), %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x67d6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x67f2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x684d
jmp 0x680b
movq %rax, %rbx
jmp 0x6831
movq %rax, %rbx
movq 0x479e(%rip), %rsi      # 0xafb8
leaq 0x48(%rsp), %rdi
callq 0x21c0
leaq 0xc0(%rsp), %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x684d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6869
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2230
nop