// File: /workspace/github_c_makefile_star2_O1/ArchLuke[P]YouSuck/Engine.c
// Function: ParseGo
static
void ParseGo(char* line, S_SEARCHINFO *info, S_BOARD *pos) {
    
    int depth = -1, movestogo = 30,movetime = -1;
    int time = -1, inc = 0;
        char *ptr = NULL;
    info->timeset = FALSE;
    
    if ((ptr = strstr(line,"infinite"))) {
        ;
    }
    
    if ((ptr = strstr(line,"binc")) && pos->side == BLACK) {
        inc = atoi(ptr + 5);
    }
    
    if ((ptr = strstr(line,"winc")) && pos->side == WHITE) {
        inc = atoi(ptr + 5);
    }
    
    if ((ptr = strstr(line,"wtime")) && pos->side == WHITE) {
        time = atoi(ptr + 6);
    }
      
    if ((ptr = strstr(line,"btime")) && pos->side == BLACK) {
        time = atoi(ptr + 6);
    }
      
    if ((ptr = strstr(line,"movestogo"))) {
        movestogo = atoi(ptr + 10);
    }
      
    if ((ptr = strstr(line,"movetime"))) {
        movetime = atoi(ptr + 9);
    }
      
    if ((ptr = strstr(line,"depth"))) {
        depth = atoi(ptr + 6);
    }
    
    if(movetime != -1) {
        time = movetime;
        movestogo = 1;
    }
    
    info->starttime = GetTimeMs();
    info->depth = depth;
    
    if(time != -1) {
        info->timeset = TRUE;
        time /= movestogo;
        time -= 50;        
        info->stoptime = info->starttime + time + inc;
    }
    
    if(depth == -1) {
        info->depth = MAXDEPTH;
    }
    
    printf("time:%d start:%d stop:%d depth:%d timeset:%d\n",
        time,info->starttime,info->stoptime,info->depth,info->timeset);
    SearchPosition(pos, info);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, %r14
movl $0x0, 0x2455b(%rip)     # 0x2717c
leaq 0x5085(%rip), %rsi      # 0x7cad
callq 0x1120
testq %rax, %rax
setne %cl
movl 0x9266(%rip), %r15d     # 0xbea0
cmpl $0x1, %r15d
sete %dl
andb %cl, %dl
xorl %ebx, %ebx
cmpb $0x1, %dl
jne 0x2c58
addq $0x5, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %ebx
leaq 0x5053(%rip), %rsi      # 0x7cb2
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
setne %cl
testl %r15d, %r15d
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2c88
addq $0x5, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %ebx
testl %r15d, %r15d
sete %bpl
leaq 0x5021(%rip), %rsi      # 0x7cb7
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
setne %cl
andb %bpl, %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x1, %cl
jne 0x2cbf
addq $0x6, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %ebp
cmpl $0x1, %r15d
sete %r15b
leaq 0x4fef(%rip), %rsi      # 0x7cbd
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
setne %cl
andb %r15b, %cl
cmpb $0x1, %cl
jne 0x2cf2
addq $0x6, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %ebp
leaq 0x4fca(%rip), %rsi      # 0x7cc3
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
je 0x2d17
addq $0xa, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %r12d
jmp 0x2d1d
movl $0x1e, %r12d
leaq 0x4fa9(%rip), %rsi      # 0x7ccd
movq %r14, %rdi
callq 0x1120
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2d4c
addq $0x9, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %r13d
leaq 0x4f83(%rip), %rsi      # 0x7cd6
movq %r14, %rdi
callq 0x1120
testq %rax, %rax
je 0x2d6f
addq $0x6, %rax
movq %rax, %rdi
callq 0x1100
movl %eax, %r15d
cmpl $-0x1, %r13d
cmovnel %r13d, %ebp
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1090
imull $0x3e8, (%r14), %ecx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r14)
movq %rdx, %r10
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %r10
addl %eax, %r10d
addl %ecx, %r10d
movl %r10d, 0x243ba(%rip)    # 0x27170
movl %r15d, 0x243bb(%rip)    # 0x27178
cmpl $-0x1, %ebp
je 0x2df4
cmpl $-0x1, %r13d
movl $0x1, %ecx
cmovel %r12d, %ecx
movl $0x1, 0x243a3(%rip)     # 0x2717c
movl %ebp, %eax
cltd
idivl %ecx
addl %r10d, %ebx
leal (%rax,%rbx), %ecx
addl $-0x32, %ecx
movl %eax, %esi
addl $-0x32, %esi
movl %ecx, 0x24382(%rip)     # 0x27174
jmp 0x2df9
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpl $-0x1, %r15d
jne 0x2e09
movl $0x40, 0x2436f(%rip)    # 0x27178
movl 0x24365(%rip), %ecx     # 0x27174
movl 0x24362(%rip), %r8d     # 0x27178
movl 0x2435f(%rip), %r9d     # 0x2717c
leaq 0x4eb8(%rip), %rdi      # 0x7cdc
xorl %r15d, %r15d
movl %r10d, %edx
xorl %eax, %eax
callq 0x1080
leaq 0x8e68(%rip), %rbx      # 0xbca0
movslq 0x9071(%rip), %rax      # 0xbeb0
leaq (%rax,%rax,2), %rax
movl 0x258(%rbx,%rax,8), %ebp
movl %ebp, %edi
callq 0x4aa4
leaq 0x4eb2(%rip), %rdi      # 0x7d0a
leaq 0x245f5(%rip), %r14     # 0x27454
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
movl 0x8a51(%rip), %edi      # 0xb8c0
callq 0x4aa4
leaq 0x4e9f(%rip), %rdi      # 0x7d1a
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
cmpl $0x0, 0x8a38(%rip)      # 0xb8c4
je 0x2ed5
cmpl 0x8a2c(%rip), %ebp      # 0xb8c0
jne 0x2ed5
leaq 0x516e(%rip), %rdi      # 0x800b
callq 0x1060
movl 0x8a1c(%rip), %edi      # 0xb8c4
callq 0x4aa4
leaq 0x4e7c(%rip), %rdi      # 0x7d30
leaq 0x24599(%rip), %rsi     # 0x27454
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1080
movl %ebx, 0x89fa(%rip)      # 0xb8c4
movl %ebx, 0x89f0(%rip)      # 0xb8c0
jmp 0x32fc
movq $0x0, 0x15248(%rip) # 0x18128
movl %r15d, 0x15249(%rip)    # 0x18130
movl %r15d, 0x8fbe(%rip)     # 0xbeac
leaq 0x15363(%rip), %rdi     # 0x18258
movl $0x1a60, %edx           # imm = 0x1A60
xorl %esi, %esi
callq 0x10a0
xorps %xmm0, %xmm0
movups %xmm0, 0x2427d(%rip)    # 0x27188
movl %r15d, 0x24286(%rip)    # 0x27198
movl $0x0, 0x10(%rsp)
cmpl %r15d, 0x24257(%rip)    # 0x27178
jle 0x3088
movl $0x1, %r14d
leaq 0x20(%rsp), %r15
leaq 0x4e6e(%rip), %r13      # 0x7da7
leaq 0x24514(%rip), %rbp     # 0x27454
movl $0x0, 0x10(%rsp)
movl $0xffff8ad0, %edi       # imm = 0xFFFF8AD0
movl $0x7530, %esi           # imm = 0x7530
movl %r14d, %edx
movl $0x1, %ecx
movq %r15, %r8
xorl %r9d, %r9d
callq 0x4b6a
movl %eax, %r12d
movl 0x24222(%rip), %eax     # 0x27190
cmpl $0x1, %eax
je 0x306f
movl %eax, 0xc(%rsp)
movl %r14d, %edi
callq 0x50e7
movl 0x151cf(%rip), %eax     # 0x18158
movl %eax, 0x10(%rsp)
movq 0x241f4(%rip), %r15     # 0x27188
leaq 0x830(%rsp), %rdi
xorl %esi, %esi
callq 0x1090
imull $0x3e8, 0x830(%rsp), %ecx # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x838(%rsp)
movq %rdx, %r8
shrq $0x3f, %r8
shrq $0x7, %rdx
addl %edx, %r8d
addl %ecx, %r8d
subl 0x24198(%rip), %r8d     # 0x27170
leaq 0x4d98(%rip), %rdi      # 0x7d77
movl %r12d, %esi
movl %r14d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1080
movl %r14d, %edi
callq 0x50e7
movl %eax, %r12d
leaq 0x4da3(%rip), %rdi      # 0x7da4
xorl %eax, %eax
callq 0x1080
testl %r12d, %r12d
jle 0x3035
movl %r12d, %r12d
xorl %r15d, %r15d
movl 0xc4b8(%rbx,%r15,4), %edi
callq 0x4aa4
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1080
incq %r15
cmpq %r15, %r12
jne 0x3013
movl $0xa, %edi
callq 0x1040
movl 0x150e7(%rip), %esi     # 0x1812c
movl 0x150dd(%rip), %edx     # 0x18128
movl 0x150d3(%rip), %ecx     # 0x18124
movl 0x150d8(%rip), %r8d     # 0x18130
leaq 0x4d4c(%rip), %rdi      # 0x7dab
xorl %eax, %eax
callq 0x1080
leaq 0x20(%rsp), %r15
movl 0xc(%rsp), %eax
cmpl $0x1, %eax
je 0x3088
leal 0x1(%r14), %eax
cmpl 0x240f9(%rip), %r14d    # 0x27178
movl %eax, %r14d
jl 0x2f48
movl 0x10(%rsp), %ebx
movl %ebx, %edi
callq 0x4aa4
leaq 0x4ca4(%rip), %rdi      # 0x7d3e
leaq 0x243b3(%rip), %rsi     # 0x27454
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x1080
movq $0x0, 0x15072(%rip) # 0x18128
movl %r14d, 0x15073(%rip)    # 0x18130
movl %r14d, 0x8de8(%rip)     # 0xbeac
leaq 0x1518d(%rip), %rdi     # 0x18258
movl $0x1a60, %edx           # imm = 0x1A60
xorl %esi, %esi
callq 0x10a0
xorps %xmm0, %xmm0
movups %xmm0, 0x240a7(%rip)    # 0x27188
movl %r14d, 0x240b0(%rip)    # 0x27198
leaq 0x20(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x1090
imull $0x3e8, (%r15), %ecx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r15)
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x7, %rdx
addl %eax, %edx
addl %ecx, %edx
movl %edx, 0x2404f(%rip)     # 0x27170
movq $0x40, 0x2404c(%rip) # 0x27178
movl %ebx, %edi
callq 0x3701
movq 0x8d86(%rip), %rcx      # 0xbec0
movslq 0x14fdf(%rip), %rsi     # 0x18120
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq 0x14fc8(%rip), %rax     # 0x18118
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq %rcx, (%rax,%rdx,8)
jne 0x3165
leaq (%rax,%rdx,8), %rax
movl 0x8(%rax), %r14d
testl %r14d, %r14d
je 0x32fc
movl %r14d, 0x874b(%rip)     # 0xb8c0
movl %r14d, %edi
callq 0x4aa4
leaq 0x4bc7(%rip), %rdi      # 0x7d4b
leaq 0x242c9(%rip), %rsi     # 0x27454
xorl %eax, %eax
callq 0x1080
movl %r14d, %edi
callq 0x3701
leaq 0x4e78(%rip), %rdi      # 0x8019
callq 0x1060
movq 0x8d13(%rip), %rcx      # 0xbec0
movslq 0x14f6c(%rip), %rsi     # 0x18120
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq 0x14f55(%rip), %rax     # 0x18118
movslq %edx, %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq %rcx, (%rax,%rdx,8)
jne 0x32fc
leaq (%rax,%rdx,8), %rax
movl 0xc(%rax), %r15d
cmpl $0x1f4, %r15d           # imm = 0x1F4
jg 0x32fc
movq %rdx, 0x10(%rsp)
movl 0x8(%rax), %r12d
movl 0x10(%rax), %eax
movl %eax, 0xc(%rsp)
leaq 0x830(%rsp), %rsi
movl %r12d, %edi
movl %r15d, %edx
callq 0x57fd
movl %eax, %ebx
xorl %ebp, %ebp
cmpl $0xffff8ad1, %eax       # imm = 0xFFFF8AD1
cmovgel %r12d, %ebp
leaq 0x20(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x39ab
movl 0x800(%r13), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
js 0x32d8
cmpl $0x1, 0x23f4e(%rip)     # 0x27190
je 0x32d8
xorl %r13d, %r13d
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
callq 0x59bf
movl $0xffff8ad0, %edi       # imm = 0xFFFF8AD0
movl $0x7530, %esi           # imm = 0x7530
movl 0xc(%rsp), %edx
movl $0x1, %ecx
movq %r14, %r8
movl $0x1, %r9d
callq 0x4b6a
movq 0x14e95(%rip), %rcx     # 0x18118
movq 0x10(%rsp), %rsi
movq (%rcx,%rsi,8), %rdx
cmpq 0x8c2d(%rip), %rdx      # 0xbec0
jne 0x32d8
addl $0x32, %eax
cmpl %r15d, %eax
jle 0x32d8
leaq (%rcx,%rsi,8), %rax
movl 0x8(%rax), %r12d
movl %r12d, %edi
leaq 0x830(%rsp), %rsi
movl %r15d, %edx
callq 0x57fd
cmpl %ebx, %eax
cmovgl %eax, %ebx
cmovgl %r12d, %ebp
cmpl 0x1c(%rsp), %r13d
jge 0x32d8
incl %r13d
cmpl $0x1, 0x23ebe(%rip)     # 0x27190
jne 0x324b
movl %ebp, 0x85e6(%rip)      # 0xb8c4
movl %ebp, %edi
callq 0x4aa4
leaq 0x4ae9(%rip), %rdi      # 0x7dd5
leaq 0x24161(%rip), %rdx     # 0x27454
movl %ebx, %esi
xorl %eax, %eax
callq 0x1080
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq