// File: /workspace/github_cpp_makefile_star2_O3/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 0x1e33(%rip), %rbx      # 0x840a
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x4592
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x4592
movq 0x49d9(%rip), %r15      # 0xafe0
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq 0x49a3(%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 0x680e
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 0x1e6c(%rip), %rsi      # 0x8504
callq 0x2070
testl %eax, %eax
je 0x6766
movq %rbp, %rdi
leaq 0x1e8d(%rip), %rsi      # 0x853c
callq 0x2070
testl %eax, %eax
je 0x679c
movq %rbp, %rdi
leaq 0x1e87(%rip), %rsi      # 0x854d
callq 0x2070
testl %eax, %eax
je 0x67b3
movq %rbp, %rdi
leaq 0x1e7a(%rip), %rsi      # 0x8557
callq 0x2070
testl %eax, %eax
je 0x67b3
movq %rbp, %rdi
leaq 0x1e6c(%rip), %rsi      # 0x8560
callq 0x2070
testl %eax, %eax
je 0x67b3
movq %rbp, %rdi
leaq 0x1e60(%rip), %rsi      # 0x856b
callq 0x2070
testl %eax, %eax
je 0x67d4
movq %rbp, %rdi
leaq 0x1e52(%rip), %rsi      # 0x8574
callq 0x2070
testl %eax, %eax
je 0x67e2
movq %rbp, %rdi
leaq 0x1e3e(%rip), %rsi      # 0x8577
callq 0x2070
testl %eax, %eax
je 0x67b3
movq %rbp, %rdi
leaq 0x1e30(%rip), %rsi      # 0x857c
callq 0x2070
movl $0xe, %ebx
leaq 0x1e24(%rip), %rsi      # 0x8581
testl %eax, %eax
jne 0x67a8
jmp 0x67f0
movl $0x12, %edx
movq %r14, %rdi
leaq 0x1d93(%rip), %rsi      # 0x8508
callq 0x2180
movl $0x6, %ebx
movl $0x19, %edx
movq %r14, %rdi
leaq 0x1d8d(%rip), %rsi      # 0x851b
callq 0x2180
leaq 0x1d9b(%rip), %rsi      # 0x8535
jmp 0x67a8
movl $0x8, %ebx
leaq 0x1d9c(%rip), %rsi      # 0x8544
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2180
movq %r13, %rdi
movq 0x47fb(%rip), %rsi      # 0xafb8
callq 0x21c0
leaq 0xc0(%rsp), %rdi
callq 0x2090
jmp 0x661d
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x68c6
jmp 0x67b3
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x6cdc
jmp 0x67b3
movq 0x47c1(%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 0x682a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6846
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 0x68a1
jmp 0x685f
movq %rax, %rbx
jmp 0x6885
movq %rax, %rbx
movq 0x474a(%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 0x68a1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x68bd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2230
nop