LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::IsSide1(char*, int, int, int&, int&)
bool ChessBoard::IsSide1(char oneLine[], int len , int pos, int &resL, int &resR)
{
    char side = oneLine[pos];
    if( Chess_Empty == side  )
        return  false;
    if( pos > len || pos<0 )
        return false;
    if( side != oneLine[pos])
        return false;

    int ri =pos, li=pos;
    int rr =pos, ll=pos;
    while( oneLine[li-1] == side )  li--;
    while( oneLine[ri+1] == side )  ri++;
    rr = ri; ll = li; 
    while( oneLine[ll-1] == Chess_Empty || oneLine[ll-1] == side ) ll--;
    while( oneLine[rr+1] == Chess_Empty || oneLine[rr+1] == side ) rr++;

    if(rr - ll +1 < 5)
        return false;
    if( rr==ri && ll < li ) 
        return true;
    if( ll == li && rr > ri ) 
        return true;

    return false;
}

// Assembly:
movslq %ecx, %rax
movb (%rsi,%rax), %dil
cmpb $0x65, %dil
je 0x2381
cmpl %edx, %ecx
setg %dl
testl %ecx, %ecx
sets %r8b
orb %dl, %r8b
jne 0x2381
movl $0xfffffffd, %r9d       # imm = 0xFFFFFFFD
movq %rax, %rdx
movl %r9d, %r8d
decq %rax
leal 0x1(%r8), %r9d
cmpb %dil, -0x1(%rsi,%rdx)
je 0x22e9
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %ecx, %r9d
addl $-0x2, %ecx
addq %rsi, %r9
incq %r9
movq %r9, %r10
incl %r8d
incl %ecx
incq %r9
cmpb %dil, (%r10)
je 0x2310
movabsq $-0x2, %r10
movb (%rsi,%rax), %r11b
cmpb $0x65, %r11b
sete %bl
cmpb %dil, %r11b
sete %r11b
orb %bl, %r11b
incl %r8d
incq %r10
decq %rsi
testb %r11b, %r11b
jne 0x232a
leal 0x1(%rcx), %esi
subq %r10, %rax
xorl %r11d, %r11d
movb -0x1(%r9,%r11), %bl
cmpb $0x65, %bl
sete %r14b
cmpb %dil, %bl
sete %bl
orb %r14b, %bl
incq %r11
incl %ecx
incl %r8d
testb %bl, %bl
jne 0x2356
cmpl $0x4, %r8d
popq %rbx
popq %r14
popq %rbp
jge 0x2384
xorl %eax, %eax
retq
cmpq $0x1, %r11
sete %dil
cmpq %rdx, %rax
setl %dl
movb $0x1, %al
testb %dil, %dl
jne 0x2383
cmpq $-0x1, %r10
sete %dl
cmpl %esi, %ecx
setg %al
andb %dl, %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculateLine(char*, int, int, int&, int&)
BoardType  ChessBoard::CalculateLine(char  oneLine[],  int len , int pos, int &resL , int &resR)
{
    if(IsLong(oneLine, len , pos, resL , resR ) )
        return Board_LONG;
    if(Is5(oneLine, len , pos , resL , resR))
        return Board_FIVE;
    if(IsOpen4(oneLine, len , pos ,resL , resR))
        return Board_FOUR;
    if(IsSide4(oneLine, len , pos, resL , resR)   )
        return Board_SFOUR;
    if(IsOpen3(oneLine , len , pos, resL, resR) )
        return Board_THREE;
    if(IsSide3(oneLine, len , pos , resL , resR) )
        return Board_STHREE;
    if(IsOpen2(oneLine, len , pos, resL , resR ))
        return Board_TWO;
    if(IsSide2(oneLine, len , pos, resL , resR) ) 
        return Board_STWO;
    if(IsOpen1(oneLine, len, pos, resL, resR) )
        return Board_ONE;
    if(IsSide1(oneLine, len , pos, resL, resR))
        return Board_SONE;
    
    return Board_NOVALUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %r13
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
callq 0x1432
testb %al, %al
je 0x23d4
pushq $0xa
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x149e
testb %al, %al
je 0x23f2
pushq $0x1
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x1508
testb %al, %al
je 0x2410
pushq $0x2
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x15c6
testb %al, %al
je 0x242e
pushq $0x3
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x1846
testb %al, %al
je 0x2449
pushq $0x4
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x1a5e
testb %al, %al
je 0x2464
pushq $0x5
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x1c76
testb %al, %al
je 0x247f
pushq $0x6
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x1e8e
testb %al, %al
je 0x249a
pushq $0x7
jmp 0x24b3
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
movq %r13, %r8
movq %r12, %r9
callq 0x20a6
testb %al, %al
je 0x24c3
pushq $0x8
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rsi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x22be
movzbl %al, %eax
leal (%rax,%rax,8), %eax
jmp 0x24b4
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculatePosShu(int, int, char)
BoardType ChessBoard:: CalculatePosShu(int x, int y, ChessSide side)
{
   if( x==0 || y== 0 || x > m_size || y> m_size )  
        return 0;
    char  line[30]; 
    int pos =0;
    for(int i=0;i<= m_size+1; i++ )
        line[i] = m_board[i][y];
    pos = x;

    int rl , rr;
    return CalculateLine( line, m_size+2, pos,rl, rr );
}

// Assembly:
movl %edx, %r8d
movl %esi, %ecx
testl %esi, %esi
sete %dl
testl %r8d, %r8d
sete %sil
xorl %eax, %eax
orb %dl, %sil
jne 0x25a8
movslq 0x194(%rdi), %rdx
cmpl %ecx, %edx
setl %sil
cmpl %r8d, %edx
setl %r9b
orb %sil, %r9b
jne 0x25a8
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x1(%rdx), %rax
movslq %r8d, %rsi
addq %rdi, %rsi
addq $0x4, %rsi
xorl %edi, %edi
cmpq %rax, %rdi
jg 0x258f
movb (%rsi), %r8b
movb %r8b, -0x30(%rbp,%rdi)
incq %rdi
addq $0x14, %rsi
jmp 0x2579
addl $0x2, %edx
leaq -0x30(%rbp), %rsi
leaq -0x8(%rbp), %r8
leaq -0x4(%rbp), %r9
callq 0x23a8
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculatePosLeft(int, int, char)
BoardType  ChessBoard:: CalculatePosLeft(int x, int y, ChessSide side)
{
    if( x==0 || y== 0 || x > m_size || y> m_size )  
        return 0;

    char line[30];
    int  kk =0;
    int  pos = 0;
    if( x>=y ) // (x-y,0), (x-y+1,1) (x-y+2,2) ...... 
    {
       int  xx = x-y;
       int  yy = 0;
       for(kk=0 ; xx <=m_size +2; xx ++, kk++, yy++ )
       {
            line[kk] = m_board[xx][yy];
            if( xx == x )
                pos = kk;
       }
    }
    else //(0, y-x) , (1, y-x +1), (2, y-x+2)
    {
        int xx =  0; 
        int yy = y-x; 
        for( kk=0; yy<=m_size+2; xx++, yy++, kk++ )
        {
            line[kk] = m_board[xx][yy];
            if(xx == x )
                pos = kk;
        }
    }
    int rr, rl;
    return CalculateLine( line, m_size+2, pos,rl, rr );

}

// Assembly:
movl %edx, %ecx
testl %esi, %esi
sete %dl
testl %ecx, %ecx
sete %r8b
xorl %eax, %eax
orb %dl, %r8b
jne 0x2676
movslq 0x194(%rdi), %rdx
cmpl %esi, %edx
setl %r8b
cmpl %ecx, %edx
setl %r9b
orb %r8b, %r9b
jne 0x2676
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
addq $0x2, %rdx
movl %esi, %eax
subl %ecx, %eax
jge 0x2627
subl %esi, %ecx
movl %esi, %eax
movslq %ecx, %rsi
movslq %edx, %r8
addq %rsi, %rdi
addq $0x4, %rdi
xorl %r9d, %r9d
xorl %ecx, %ecx
leaq (%rsi,%r9), %r10
cmpq %r8, %r10
jg 0x2660
movb (%rdi), %r10b
movb %r10b, -0x30(%rbp,%r9)
cmpq %r9, %rax
cmovel %r9d, %ecx
incq %r9
addq $0x15, %rdi
jmp 0x2606
cltq
movslq %esi, %rsi
subq %rax, %rsi
imulq $0x14, %rax, %rcx
addq %rcx, %rdi
addq $0x4, %rdi
xorl %r8d, %r8d
xorl %ecx, %ecx
leaq (%rax,%r8), %r9
cmpq %rdx, %r9
jg 0x2660
movb (%rdi), %r9b
movb %r9b, -0x30(%rbp,%r8)
cmpq %r8, %rsi
cmovel %r8d, %ecx
incq %r8
addq $0x15, %rdi
jmp 0x263f
leaq -0x30(%rbp), %rsi
leaq -0x4(%rbp), %r8
leaq -0x8(%rbp), %r9
callq 0x23a8
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculatePosRight(int, int, char)
BoardType  ChessBoard:: CalculatePosRight(int x, int y, ChessSide side)
{
   if( x==0 || y== 0 || x > m_size || y> m_size )  
        return 0;
   char line[30];
   int kk = 0;
   int pos = 0;
   if( x + y <= m_size+2 )  // (x+y,0), (x+y-1, 1) .....
   {
        int xx = x+y;
        int yy = 0;
        for( kk=0; xx >= 0 ; kk++,yy++ , xx--  )
        {
            line[kk] = m_board[xx][yy];
            if( xx == x )
                pos = kk;
        }
   }
   else  //(m_size+2 , y-(m_size+2-x) ), ....( y+x - (m-size-2)   ,  m_size+2)
   {
       int xx = m_size+2;
       int yy = y+x - m_size-2; 
       for(kk=0; yy<=m_size+2 && xx>=0;  xx--, yy++ , kk++ )
       {
            line[kk] = m_board[xx][yy]; 
            if( xx ==  x)
                pos = kk;
       }
   }
   int rr, rl;
   return CalculateLine( line, m_size+2, pos,rl, rr );
}

// Assembly:
movl %edx, %ecx
testl %esi, %esi
sete %dl
testl %ecx, %ecx
sete %r8b
xorl %eax, %eax
orb %dl, %r8b
jne 0x2749
movslq 0x194(%rdi), %r8
cmpl %esi, %r8d
setl %dl
cmpl %ecx, %r8d
setl %r9b
orb %dl, %r9b
jne 0x2749
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leal (%rcx,%rsi), %eax
leaq 0x2(%r8), %rdx
cmpl %edx, %eax
jle 0x2703
subl %r8d, %eax
addl $-0x2, %eax
addq $0x4, %rdi
cltq
xorl %r8d, %r8d
xorl %ecx, %ecx
movl %edx, %r9d
cmpq %rdx, %rax
jg 0x2733
testl %r9d, %r9d
js 0x2733
movl %r9d, %r10d
imulq $0x14, %r10, %r10
addq %rdi, %r10
movb (%rax,%r10), %r10b
cmpl %esi, %r9d
cmovel %r8d, %ecx
movb %r10b, -0x30(%rbp,%r8)
decl %r9d
incq %rax
incq %r8
jmp 0x26d4
addq $0x4, %rdi
movl %ecx, %esi
xorl %r8d, %r8d
xorl %ecx, %ecx
testl %eax, %eax
js 0x2733
movl %eax, %r9d
imulq $0x14, %r9, %r9
movb (%rdi,%r9), %r9b
cmpl %r8d, %esi
cmovel %r8d, %ecx
movb %r9b, -0x30(%rbp,%r8)
incq %r8
decl %eax
incq %rdi
jmp 0x270e
leaq -0x30(%rbp), %rsi
leaq -0x4(%rbp), %r8
leaq -0x8(%rbp), %r9
callq 0x23a8
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::GetPossbilePos(char, std::vector<StPos, std::allocator<StPos>>&)
int ChessBoard::GetPossbilePos(ChessSide side, std::vector<StPos >  &list)
{
    for(int i =1; i<=m_size; i++ )
        for(int j=1; j<=m_size; j++ )
        {
            if( m_board[i][j] !=  Chess_Empty )    
                continue;
            int dist  = m_size;
            for(int k=0; k< m_chessList.size(); k++ )
            {
                int xx = i - m_chessList[k].x;
                int yy = j - m_chessList[k].y;
                if(xx<0 ) xx = -xx;
                if(yy<0 ) yy = -yy;
                int tt = (xx>yy)?xx:yy;
                dist = (tt<dist )?tt:dist;
                if(dist <=2)
                    break;
            }
            if( dist<=2 )
            {
                StPos pos(i,j,side);
                list.push_back(pos);
            }
        }
    return  list.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x30(%rbp)
movl %esi, %r14d
movq %rdi, %r15
leaq 0x4(%rdi), %rax
movq %rax, -0x38(%rbp)
movl 0x194(%rdi), %ecx
pushq $0x1
popq %r12
movl %ecx, %esi
movslq %esi, %rax
cmpq %rax, %r12
jg 0x283e
imulq $0x14, %r12, %r13
addq -0x38(%rbp), %r13
pushq $0x1
popq %rbx
movslq %esi, %rax
cmpq %rax, %rbx
jg 0x2836
cmpb $0x65, (%rbx,%r13)
jne 0x282c
movq 0x240(%r15), %rdi
movq 0x248(%r15), %rax
subq %rdi, %rax
cqto
pushq $0x18
popq %r8
idivq %r8
incq %rax
addq $0x4, %rdi
decq %rax
je 0x2803
movl %r12d, %edx
subl -0x4(%rdi), %edx
movl %ebx, %r8d
subl (%rdi), %r8d
addq $0x18, %rdi
movl %edx, %r9d
negl %r9d
cmovsl %edx, %r9d
movl %r8d, %edx
negl %edx
cmovsl %r8d, %edx
cmpl %edx, %r9d
cmoval %r9d, %edx
cmpl %esi, %edx
cmovll %edx, %esi
cmpl $0x2, %esi
jg 0x27c8
jmp 0x2808
cmpl $0x2, %esi
jg 0x282c
movl %r12d, -0x50(%rbp)
movl %ebx, -0x4c(%rbp)
movb %r14b, -0x40(%rbp)
andq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x32b2
movl 0x194(%r15), %ecx
incq %rbx
movl %ecx, %esi
jmp 0x2790
incq %r12
jmp 0x2779
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::CalculateOnePos(int, int, char, int)
int64_t ChessBoard::CalculateOnePos(int x, int y , ChessSide side, int flag )
{
    BoardType  res[4]={0};
    res[0] = CalculatePosHeng(x, y, side);
    res[1] = CalculatePosShu(x,y, side);
    res[2] = CalculatePosLeft(x, y, side);
    res[3] = CalculatePosRight(x, y, side);
    //printf("CaluatOne pos(%u %u)  %u \n", x, y , res[0]);
    //printf("CaluatOne pos(%u %u)  %u \n", x, y , res[1]);
    //printf("CaluatOne pos(%u %u)  %u \n", x, y , res[2]);
    //printf("CaluatOne pos(%u %u)  %u \n", x, y , res[3]);
    //memset(m_bType, 0 , sizeof(m_bType));
    //memset(m_wType, 0 , sizeof(m_wType));


    int xx = x - (1+m_size)/2;
    int yy = y - (1+m_size)/2; 
    if(xx<0 ) xx = -xx;
    if(yy<0 ) yy = -yy;
    int dist = (xx>yy )? xx:yy;


    int64_t score =   ScoreList[res[0]] + ScoreList[res[1]] + ScoreList[res[2]] 
        + ScoreList[res[3]];
    if(flag != 0 )
    {
        if(side == Chess_Black )
        {
            m_bType[res[0]] ++;
            m_bType[res[1]] ++;
            m_bType[res[2]] ++;
            m_bType[res[3]] ++;

        }
        if(side == Chess_White )
        {
            m_wType[res[0]] ++;
            m_wType[res[1]] ++;
            m_wType[res[2]] ++;
            m_wType[res[3]] ++;

        }
    }

    return score + (1+m_size)/2 - dist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x38(%rbp)
movl %ecx, -0x34(%rbp)
movl %edx, %r14d
movl %esi, %ebx
movq %rdi, %r15
xorl %ecx, %ecx
callq 0x24d8
movl %eax, -0x30(%rbp)
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x2530
movl %eax, %r13d
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x25aa
movl %eax, %r12d
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x2678
movl %eax, %ecx
movl 0x194(%r15), %eax
movl -0x30(%rbp), %edx
leaq 0x37d0(%rip), %r8       # 0x60a0
movslq (%r8,%rdx,4), %rsi
movq %rsi, -0x30(%rbp)
movl %r13d, %r9d
movslq (%r8,%r9,4), %rdi
movl %r12d, %r10d
movslq (%r8,%r10,4), %rsi
movl %ecx, %r11d
movslq (%r8,%r11,4), %rcx
cmpl $0x0, -0x38(%rbp)
je 0x2925
movsbl -0x34(%rbp), %r12d
cmpl $0x62, %r12d
je 0x290c
cmpl $0x77, %r12d
jne 0x2925
movl $0x1ec, %r12d           # imm = 0x1EC
jmp 0x2912
movl $0x19c, %r12d           # imm = 0x19C
addq %r12, %r15
incl (%r15,%rdx,4)
incl (%r15,%r9,4)
incl (%r15,%r10,4)
incl (%r15,%r11,4)
incl %eax
pushq $0x2
popq %r8
cltd
idivl %r8d
subl %eax, %r14d
movl %r14d, %edx
negl %edx
cmovsl %r14d, %edx
subl %eax, %ebx
movl %ebx, %r8d
negl %r8d
cmovsl %ebx, %r8d
addq -0x30(%rbp), %rdi
addq %rcx, %rsi
addq %rdi, %rsi
cmpl %edx, %r8d
cmovbel %edx, %r8d
cltq
addq %rsi, %rax
subq %r8, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/smallHW89[P]gobang/GoBang_ChessBoard.cpp
// Function: ChessBoard::PutHumenChessGetAI(StPos&, StPos&)
int ChessBoard:: PutHumenChessGetAI(StPos &humPos, StPos &aiPos)
{
    if( m_aiside == Chess_Black   && m_stepnum == 0 )
    {
        aiPos.x = (1+m_size)/2;
        aiPos.y = (1+m_size)/2;
        return 0;
    }
    else if( m_aiside == Chess_White && m_stepnum == 0 )
    {
        PutChess(humPos.x, humPos.y, Chess_Black);

        int x ,y;
        x = y = (1+m_size)/2;
        int k = random()%8; 
        if( k==0 ){
            aiPos.x = x-1;   aiPos.y = y-1;
        }
        if(k==1){
            aiPos.x = x-1;   aiPos.y = y ;
        }
        if(k==2){
            aiPos.x = x-1;   aiPos.y = y+1;
        }
        if(k==3){
            aiPos.x = x ;  aiPos.y = y-1;
        }
        if(k==4){
            aiPos.x = x ; aiPos.y = y+1 ;
        }
        if(k==5){
            aiPos.x = x+1; aiPos.y = y-1;
        }
        if(k==6){
            aiPos.x = x+1; aiPos.y = y;
        }
        if(k==7){
            aiPos.x = x+1; aiPos.y =  y+1;
        }
        return 0;
    }

    PutChess(humPos.x, humPos.y, m_otherside);
    
    int ret = GetNextPosMinMax(2, aiPos,MM_MIN, MM_MAX );
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movb 0x198(%rdi), %al
cmpb $0x62, %al
sete %dl
movl (%rdi), %ecx
testl %ecx, %ecx
sete %dil
andb %dl, %dil
cmpb $0x1, %dil
jne 0x31e2
movl 0x194(%r14), %eax
incl %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, (%rbx)
movl %eax, 0x4(%rbx)
jmp 0x32ab
testl %ecx, %ecx
sete %cl
cmpb $0x77, %al
sete %dil
andb %cl, %dil
movl (%rsi), %eax
movl 0x4(%rsi), %edx
cmpb $0x1, %dil
jne 0x3242
pushq $0x62
popq %rcx
movq %r14, %rdi
movl %eax, %esi
callq 0x128c
movl 0x194(%r14), %eax
incl %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %r14d
callq 0x1070
pushq $0x8
popq %rcx
cqto
idivq %rcx
cmpq $0x7, %rdx
ja 0x32ab
leaq 0xdd0(%rip), %rax       # 0x4004
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
decl %r14d
jmp 0x3289
movsbl 0x199(%r14), %ecx
movq %r14, %rdi
movl %eax, %esi
callq 0x128c
pushq $0x2
popq %rsi
movl $0x77359400, %r8d       # imm = 0x77359400
movq %r14, %rdi
movq %rbx, %rdx
movq $-0x77359400, %rcx      # imm = 0x88CA6C00
callq 0x2b22
jmp 0x32ab
movl %r14d, (%rbx)
jmp 0x327c
leal -0x1(%r14), %eax
movl %eax, (%rbx)
incl %r14d
jmp 0x32a7
movl %r14d, (%rbx)
jmp 0x329b
incl %r14d
movl %r14d, (%rbx)
jmp 0x32a7
movl %r14d, %eax
decl %eax
jmp 0x32a5
leal 0x1(%r14), %eax
movl %eax, (%rbx)
decl %r14d
jmp 0x32a7
movl %r14d, %eax
incl %eax
movl %eax, (%rbx)
movl %r14d, 0x4(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::cache_mock(long, long, long, long, long, long)
cache_mock::cache_mock(long int d, long int c, long int m, long int b, long int l, long int s) : desc(d), cache_size(c), mem_size(m), block_size(b), lru(l), set_size(s)
{
    if (d == 1)
        set_size = 1;
    else if (d == 2)
        set_size = c / b;
    no_sets = cache_size / (block_size * set_size);
    container_init();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r10
movq 0x10(%rbp), %r11
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
movq %rcx, 0x10(%rdi)
movq %r8, 0x18(%rdi)
movq %r11, 0x20(%rdi)
movq %r9, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
andq $0x0, 0x48(%rdi)
cmpq $0x1, %rsi
je 0x16f0
cmpq $0x2, %rsi
jne 0x16f7
movq %r10, %rax
cqto
idivq %r8
movq %rax, %rsi
movq %rsi, 0x20(%rdi)
movq %rsi, %r11
leaq 0x38(%rdi), %rbx
imulq %r8, %r11
movq %r10, %rax
cqto
idivq %r11
movq %rax, 0x28(%rdi)
callq 0x1728
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x1d0a
movq %r14, %rdi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::container_init()
void cache_mock::container_init()
{
    if (container.size())
        container.clear();
    long int size = cache_size / block_size;
    for (long int i = 0; i < size; i++)
    {
        vector<long int> block;
        block.push_back(i);
        block.push_back(-1);           //tag_bit
        block.push_back(0);            //dirty_bit
        block.push_back(i % set_size); //hierarchy
        for (long int j = 0; j < block_size; j++)
        {
            block.push_back(-1);
        }
        container.push_back(block);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movq 0x40(%rdi), %rax
cmpq 0x38(%rdi), %rax
je 0x1752
movq %r15, %rdi
callq 0x1e14
movq 0x8(%rbx), %rax
cqto
idivq 0x18(%rbx)
movq %rax, -0x40(%rbp)
xorl %eax, %eax
leaq -0x60(%rbp), %r12
leaq -0x30(%rbp), %r13
movq %rax, -0x38(%rbp)
cmpq -0x40(%rbp), %rax
jge 0x1806
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
andq $0x0, -0x50(%rbp)
movq %r12, %rdi
leaq -0x38(%rbp), %rsi
callq 0x1e22
orq $-0x1, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x24b8
andq $0x0, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x24b8
movq -0x38(%rbp), %rax
cqto
idivq 0x20(%rbx)
movq %rdx, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x24b8
xorl %r14d, %r14d
cmpq 0x18(%rbx), %r14
jge 0x17e7
orq $-0x1, -0x30(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x24b8
incq %r14
jmp 0x17cc
movq %r15, %rdi
movq %r12, %rsi
callq 0x1e4a
movq %r12, %rdi
callq 0x2090
movq -0x38(%rbp), %rax
incq %rax
jmp 0x176a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x181d
jmp 0x181d
jmp 0x181d
jmp 0x181d
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::container_display()
void cache_mock::container_display()
{
    if(!desc)
        printf("Set\t");
    printf("ID\tTag\tDirty\thierarchy\tBlock-Display\n");
    for (long int i = 0; i < container.size(); i++)
    {
        if (!desc)
        {
            if(!(i % set_size))
            {
                printf("\n");
                printf("%ld",i/set_size);
            }
            printf("\t");
        }
        for (long int j = 0; j < container[i].size(); j++)
        {
            printf("%ld\t", container[i][j]);
            if (j == 3)
            {
                printf("\t");
            }
        }
        printf("\n");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x18f7
leaq 0x1960(%rip), %rdi      # 0x3250
xorl %eax, %eax
callq 0x1030
leaq 0x197a(%rip), %rdi      # 0x3278
callq 0x1130
pushq $0x9
popq %r12
leaq 0x194b(%rip), %r13      # 0x3259
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
subq 0x38(%rbx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rax, %r14
jae 0x19c1
cmpq $0x0, (%rbx)
jne 0x1968
movq %r14, %rax
cqto
idivq 0x20(%rbx)
testq %rdx, %rdx
jne 0x1960
pushq $0xa
popq %rdi
callq 0x1100
movq %r14, %rax
cqto
idivq 0x20(%rbx)
leaq 0x18ff(%rip), %rdi      # 0x3255
movq %rax, %rsi
xorl %eax, %eax
callq 0x1030
movl %r12d, %edi
callq 0x1100
movq %r14, -0x30(%rbp)
imulq $0x18, %r14, %r14
xorl %r15d, %r15d
movq 0x38(%rbx), %rcx
movq (%rcx,%r14), %rax
movq 0x8(%rcx,%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
jae 0x19ad
movq (%rax,%r15,8), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1030
cmpq $0x3, %r15
jne 0x19a8
movl %r12d, %edi
callq 0x1100
incq %r15
jmp 0x1973
pushq $0xa
popq %rdi
callq 0x1100
movq -0x30(%rbp), %r14
incq %r14
jmp 0x1911
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::loader(long)
long int cache_mock::loader(long int address)
{
    if (address >= mem_size || address < 0)
        return -1;
    long int block = address / block_size;
    long int set = block % no_sets;
    long int tag = address / (block_size * no_sets);
    for (long int i = 0; i < set_size; i++) // Hit Case!!!
    {
        if (container[set * set_size + i][1] == tag)
        {
            if (lru)
                container[set * set_size + i][3] = container[find_hierarchy_max(set)][3] + 1;
            return 1;
        }
    }
    //miss case
    long int min_heir = find_hierarchy_min(set);
    container[min_heir][1] = tag;
    container[min_heir][2] = 0;
    container[min_heir][3] = container[find_hierarchy_max(set)][3] + 1;
    for (int i = 4; i < container[0].size(); i++)
    {
        container[min_heir][i] = block * block_size + i - 4;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %r12
testq %rsi, %rsi
js 0x1a80
movq %rdi, %rbx
cmpq %rsi, 0x10(%rdi)
jle 0x1a80
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rcx
movq %rsi, %rax
cqto
idivq %rdi
movq %rax, %r14
movq 0x28(%rbx), %r8
cqto
idivq %r8
movq %rdx, %r9
imulq %rdi, %r8
movq %rsi, %rax
cqto
idivq %r8
movq %rax, %r12
movq %r9, %rax
imulq %rcx, %rax
movq 0x38(%rbx), %r13
imulq $0x18, %rax, %rax
addq %r13, %rax
xorl %edx, %edx
testq %rcx, %rcx
cmovgq %rcx, %rdx
incq %rdx
decq %rdx
je 0x1a92
movq (%rax), %r15
addq $0x18, %rax
cmpq %r12, 0x8(%r15)
jne 0x1a44
pushq $0x1
popq %r12
cmpq $0x0, 0x30(%rbx)
je 0x1a80
movq %rbx, %rdi
movq %r9, %rsi
callq 0x1b02
imulq $0x18, %rax, %rax
movq (%r13,%rax), %rax
movq 0x18(%rax), %rax
incq %rax
movq %rax, 0x18(%r15)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r9, %rsi
movq %r9, -0x30(%rbp)
callq 0x1b54
imulq $0x18, %rax, %rax
movq (%r13,%rax), %r15
movq %r12, 0x8(%r15)
andq $0x0, 0x10(%r15)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x1b02
imulq $0x18, %rax, %rax
movq (%r13,%rax), %rax
movq 0x18(%rax), %rax
incq %rax
movq %rax, 0x18(%r15)
movq 0x8(%r13), %rax
subq (%r13), %rax
sarq $0x3, %rax
pushq $0x4
popq %rcx
xorl %r12d, %r12d
cmpq %rcx, %rax
jbe 0x1a80
movq 0x18(%rbx), %rdx
imulq %r14, %rdx
addq %rcx, %rdx
addq $-0x4, %rdx
movq %rdx, (%r15,%rcx,8)
incq %rcx
jmp 0x1ae5
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::find_hierarchy_max(long)
long int cache_mock::find_hierarchy_max(long int set)
{
    long int max = set * set_size;
    for (long int i = 0; i < set_size; i++)
    {
        if (container[set * set_size + i][3] > container[max][3])
        {
            max = set * set_size + i;
        }
    }
    return (max);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rax
imulq %rax, %rsi
xorl %ecx, %ecx
testq %rax, %rax
cmovgq %rax, %rcx
movq 0x38(%rdi), %rdx
imulq $0x18, %rsi, %rdi
addq %rdx, %rdi
movq %rsi, %rax
subq $0x1, %rcx
jb 0x1b52
movq (%rdi), %r8
movq 0x18(%r8), %r9
imulq $0x18, %rax, %r8
movq (%rdx,%r8), %r10
movq %rsi, %r8
cmpq 0x18(%r10), %r9
jg 0x1b46
movq %rax, %r8
incq %rsi
addq $0x18, %rdi
movq %r8, %rax
jmp 0x1b25
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/niksram[P]Cache-Mapping-Simulator/cache_mapper.cpp
// Function: cache_mock::find_hierarchy_min(long)
long int cache_mock::find_hierarchy_min(long int set)
{
    long int min = set * set_size;
    for (long int i = 0; i < set_size; i++)
    {
        if (container[set * set_size + i][3] < container[min][3])
        {
            min = set * set_size + i;
        }
    }
    return (min);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x20(%rdi), %rax
imulq %rax, %rsi
xorl %ecx, %ecx
testq %rax, %rax
cmovgq %rax, %rcx
movq 0x38(%rdi), %rdx
imulq $0x18, %rsi, %rdi
addq %rdx, %rdi
movq %rsi, %rax
subq $0x1, %rcx
jb 0x1ba4
movq (%rdi), %r8
movq 0x18(%r8), %r9
imulq $0x18, %rax, %r8
movq (%rdx,%r8), %r10
movq %rsi, %r8
cmpq 0x18(%r10), %r9
jl 0x1b98
movq %rax, %r8
incq %rsi
addq $0x18, %rdi
movq %r8, %rax
jmp 0x1b77
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Terrain.cpp
// Function: Terrain::update(int)
void Terrain::update(int t)
{
    // update children
    LOOPV(i, this)
    {
        get_child(i)->update(t);
        if (get_child(i)->should_remove_from_parent() == true)
        {
            delete get_children()->remove(i);
            --i;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x8b98
cmpq 0x8(%rax), %r15
jae 0x7622
movq %r14, %rdi
movq %r15, %rsi
callq 0x8bb4
movq (%rax), %rcx
movq %rax, %rdi
movl %ebx, %esi
callq *0x10(%rcx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8bb4
movq %rax, %rdi
callq 0x8c52
testb %al, %al
je 0x761d
movq %r14, %rdi
callq 0x8b98
movq %rax, %rdi
movq %r15, %rsi
callq 0x53d0
testq %rax, %rax
je 0x761a
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
decq %r15
incq %r15
jmp 0x75be
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: test_point()
void test_point()
{
    printf("Testing Point..\n\n");

    Point<int> p1(3, 4);
    assert(p1.length() == 5, "length");
    Point<int> p2(3, 4);
    assert(p1 == p2, "equality");
    Point<int> res(0, 0);
    assert(p1 - p2 == res, "minus");
    res.x = 6;
    res.y = 8;
    assert(p2 + p2 == res, "addition");
    res.x = 9;
    res.y = 16;
    assert(p1 * p2 == res, "times");
    res.x = 1;
    res.y = 1;
    assert(p1 / p2 == res, "divide");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2075(%rip), %rdi      # 0xb459
callq 0x3360
leaq 0x1f46(%rip), %rsi      # 0xb336
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x9378
leaq 0x1f3c(%rip), %rsi      # 0xb33d
movl %ebx, %edi
callq 0x9378
leaq 0x1f37(%rip), %rsi      # 0xb346
movl %ebx, %edi
callq 0x9378
leaq 0x1f2f(%rip), %rsi      # 0xb34c
movl %ebx, %edi
callq 0x9378
leaq 0x1f2a(%rip), %rsi      # 0xb355
movl %ebx, %edi
callq 0x9378
leaq 0x1f22(%rip), %rsi      # 0xb35b
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9378
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: test_timer()
void test_timer()
{
    printf("\nTesting Timer..\n\n");
    Timer timer(0.1, 20);

    printf("interval 0.1s ticks 20\n\n");
    while (timer.tick())
    {
        ConsoleTools::move_cursor(ConsoleTools::up, 1);
        ConsoleTools::clear_line();
        printf("%d\n", timer.get_tick_count());
    }

    timer.reset();
    printf("\n");

    Timer inf(0.05, true);
    printf("infinite ticks. break at 50. interval 0.05s\n\n");

    while (inf.tick())
    {
        ConsoleTools::move_cursor(ConsoleTools::up, 1);
        ConsoleTools::clear_line();
        printf("%d\n", inf.get_tick_count());
        if (inf.get_tick_count() >= 50)
        {
            break;
        }
    }

    TestTimerDelegate test_timer;
    test_timer.test1();
    test_timer.test2();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
leaq 0x1bae(%rip), %rdi      # 0xb49e
callq 0x3360
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
leaq -0x88(%rbp), %rbx
movq %rax, 0x8(%rbx)
movq $0x14, 0x10(%rbx)
andw $0x0, 0x18(%rbx)
leaq 0x1b92(%rip), %rdi      # 0xb4b0
callq 0x3360
pushq $0x41
popq %r14
pushq $0x1
popq %r15
leaq 0x1b0e(%rip), %r12      # 0xb440
movq %rbx, %rdi
callq 0x7f9c
testb %al, %al
je 0x9964
movl %r14d, %edi
movl %r15d, %esi
callq 0x38c8
callq 0x3894
movq %rbx, %rdi
callq 0x7fc0
movq %r12, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x3050
jmp 0x9932
leaq -0x88(%rbp), %rdi
callq 0x807e
pushq $0xa
popq %rdi
callq 0x3300
movabsq $0x3fa999999999999a, %rax # imm = 0x3FA999999999999A
leaq -0xa8(%rbp), %rbx
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
movw $0x1, 0x18(%rbx)
leaq 0x1b29(%rip), %rdi      # 0xb4c8
callq 0x3360
pushq $0x41
popq %r14
pushq $0x1
popq %r15
leaq 0x1a8d(%rip), %r12      # 0xb440
movq %rbx, %rdi
callq 0x7f9c
testb %al, %al
je 0x99f0
movl %r14d, %edi
movl %r15d, %esi
callq 0x38c8
callq 0x3894
movq %rbx, %rdi
callq 0x7fc0
movq %r12, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x3050
movq %rbx, %rdi
callq 0x7fc0
cmpl $0x32, %eax
jl 0x99b3
leaq -0x68(%rbp), %rdi
callq 0xa3cc
leaq -0x60(%rbp), %rdi
callq 0x8018
leaq -0x40(%rbp), %rdi
callq 0x8018
leaq 0x7366(%rip), %rax      # 0x10d78
movq %rax, -0x68(%rbp)
leaq 0x17a4(%rip), %rdi      # 0xb1c1
callq 0x3360
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x733c(%rip), %rax      # 0x10d78
movq %rax, -0x68(%rbp)
leaq 0x177a(%rip), %rdi      # 0xb1c1
callq 0x3360
movq %rbx, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: test_view()
void test_view()
{
    printf("\nTesting views...\n");

    View *view = new View(0, 0, 600, 600);
    view->add_child(new View(0, 0, 20, 20));
    view->add_child(new View(40, 40, 30, 50));

    assert(view->get_children()->get_count() == 2, "children count");

    LOOPV(i, view)
    {
        View *v = view->get_child(i);
        assert(v->get_size().x == (i+2)*10, "iterate");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x162a(%rip), %rdi      # 0xb522
callq 0x3360
pushq $0x38
popq %rdi
callq 0x3280
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x258, %ecx            # imm = 0x258
movl $0x258, %r8d            # imm = 0x258
callq 0xa472
pushq $0x38
popq %rdi
callq 0x3280
movq %rax, %r14
pushq $0x14
popq %rcx
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %ecx, %r8d
callq 0xa472
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8ba2
pushq $0x38
popq %rdi
callq 0x3280
movq %rax, %r14
pushq $0x28
popq %rdx
pushq $0x1e
popq %rcx
pushq $0x32
popq %r8
movq %rax, %rdi
movl %edx, %esi
callq 0xa472
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8ba2
movq %rbx, %rdi
callq 0x8b98
xorl %edi, %edi
cmpq $0x2, 0x8(%rax)
sete %dil
leaq 0x1476(%rip), %rsi      # 0xb401
callq 0x9378
pushq $0x14
popq %r12
xorl %r14d, %r14d
leaq 0x1472(%rip), %r15      # 0xb410
movq %rbx, %rdi
callq 0x8b98
cmpq 0x8(%rax), %r14
jae 0x9fdb
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8bb4
movq %rax, %rdi
callq 0x8c9e
cltq
xorl %edi, %edi
cmpq %rax, %r12
sete %dil
movq %r15, %rsi
callq 0x9378
incq %r14
addq $0xa, %r12
jmp 0x9f9e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9fe6
movq %rax, %r15
movq %r14, %rbx
jmp 0x9ff1
movq %rax, %r15
movq %rbx, %rdi
callq 0x3260
movq %r15, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: fexists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool fexists(std::string fname)
{
    bool exists = false;
    std::ifstream file(fname.c_str(), std::ios::binary);
    exists = file.good();
    file.close();
    return exists;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq (%rdi), %rsi
leaq -0x218(%rbp), %rbx
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x33f0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl -0x1f8(%rbp,%rax), %r14d
movq %rbx, %rdi
callq 0x3090
testl %r14d, %r14d
sete %bl
leaq -0x218(%rbp), %rdi
callq 0x30c0
movl %ebx, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rdi
callq 0x3a1e
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: test_sounds()
void test_sounds()
{
    printf("\nTesting sound files (passed/failed : found/not found)\n\n");

    assert(fexists("music.wav") == true, "music.wav");
    assert(fexists("boom.wav") == true, "boom.wav");
    assert(fexists("beep.wav") == true, "beep.wav");
    assert(fexists("fire.wav") == true, "fire.wav");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
leaq 0x14a7(%rip), %rdi      # 0xb534
callq 0x3360
leaq 0x137f(%rip), %rsi      # 0xb418
leaq -0x90(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x3120
leaq -0x90(%rbp), %rdi
callq 0xa001
movzbl %al, %edi
leaq 0x1359(%rip), %rsi      # 0xb418
callq 0x9378
leaq -0x90(%rbp), %rdi
callq 0x32d0
leaq 0x1027(%rip), %rsi      # 0xb0fe
leaq -0x70(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x3120
leaq -0x70(%rbp), %rdi
callq 0xa001
movzbl %al, %edi
leaq 0x1007(%rip), %rsi      # 0xb0fe
callq 0x9378
leaq -0x70(%rbp), %rdi
callq 0x32d0
leaq 0xfc4(%rip), %rsi       # 0xb0d0
leaq -0x50(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x3120
leaq -0x50(%rbp), %rdi
callq 0xa001
movzbl %al, %edi
leaq 0xfa4(%rip), %rsi       # 0xb0d0
callq 0x9378
leaq -0x50(%rbp), %rdi
callq 0x32d0
leaq 0x1127(%rip), %rsi      # 0xb268
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x3120
leaq -0x30(%rbp), %rdi
callq 0xa001
movzbl %al, %edi
leaq 0x1107(%rip), %rsi      # 0xb268
callq 0x9378
leaq -0x30(%rbp), %rdi
callq 0x32d0
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
jmp 0xa1a9
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x32d0
jmp 0xa1ac
jmp 0xa1a9
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x32d0
jmp 0xa1ac
jmp 0xa1a9
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x32d0
jmp 0xa1ac
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x32d0
jmp 0xa1ac
movq %rax, %rdi
callq 0x3a1e
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: main
int main(int argc, char const *argv[])
{
    ConsoleTools::clear_screen();

    TextureTools::load_texture_file("textures.txt");

    test_point();
    test_array();
    test_view();
    test_textures();
    test_sounds();

    test_timer();

    ConsoleTools::set_cursor(0, ConsoleTools::get_terminal_size().y-1);
    ConsoleTools::end_color();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
callq 0x3862
leaq 0x1240(%rip), %rsi      # 0xb422
leaq -0x30(%rbp), %rbx
leaq -0x9(%rbp), %rdx
movq %rbx, %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x772e
leaq -0x30(%rbp), %rdi
callq 0x32d0
callq 0x93d7
callq 0x9446
callq 0x9ee6
callq 0x9a54
callq 0xa07a
callq 0x98d7
callq 0x38e0
shrq $0x20, %rax
leal -0x1(%rax), %esi
xorl %edi, %edi
callq 0x387e
callq 0x3824
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rdi
callq 0x3a1e
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/./MutableArray.h
// Function: MutableArray<Timer*>::clear()
void clear()
    {
        for (int i = 0; i < _count; ++i)
        {
            if (_items[i] != 0)
            {
                remove(i);
            }
        }

        _count = 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpq %r14, 0x8(%rbx)
jbe 0xa2f9
movq (%rbx), %rax
cmpq $0x0, (%rax,%r14,8)
je 0xa2f4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa296
incq %r14
jmp 0xa2d9
andq $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: TestTimerDelegate::TestTimerDelegate()
TestTimerDelegate()
    {
        timer1 = Timer(0.1, 20);
        timer1.set_delegate(this);

        timer2 = Timer(0.05, true);
        timer2.set_delegate(this);

        printf("\nTesting delegate timer\n\n");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x6998(%rip), %rax      # 0x10d78
movq %rax, (%rdi)
xorps %xmm0, %xmm0
andw $0x0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
andq $0x0, 0x8(%rdi)
leaq 0x8(%rdi), %rbx
leaq 0x28(%rdi), %r15
movabsq $0x3fb999999999999a, %rax # imm = 0x3FB999999999999A
movq %rax, 0x10(%rdi)
movq $0x14, 0x18(%rdi)
andw $0x0, 0x20(%rdi)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8068
andq $0x0, 0x28(%r14)
movabsq $0x3fa999999999999a, %rax # imm = 0x3FA999999999999A
movq %rax, 0x30(%r14)
andq $0x0, 0x38(%r14)
movw $0x1, 0x40(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x8068
leaq 0x10a2(%rip), %rdi      # 0xb4f5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3360
andq $0x0, (%r15)
andq $0x0, (%rbx)
movq %rax, %rdi
callq 0x33d0
// File: /workspace/github_cpp_makefile_star2_O2/Jacobious52[P]Tanks/Test.cpp
// Function: TestTimerDelegate::timer_did_tick(Timer*, int)
void timer_did_tick(Timer *sender, int t)
    {
        if (sender == &timer1)
        {
            ConsoleTools::move_cursor(ConsoleTools::up, 1);
            ConsoleTools::clear_line();
            printf("delegate tick 1: %d\n", t);
        }
        else if (sender == &timer2)
        {
            ConsoleTools::move_cursor(ConsoleTools::up, 1);
            ConsoleTools::clear_line();
            printf("delegate tick 2: %d\n", t);
            if (t == 15)
            {
                timer2.end();
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
leaq 0x8(%rdi), %rax
cmpq %rsi, %rax
je 0xa528
movq %rdi, %r14
addq $0x28, %r14
cmpq %rsi, %r14
jne 0xa523
pushq $0x41
popq %rdi
pushq $0x1
popq %rsi
callq 0x38c8
callq 0x3894
leaq 0xf3b(%rip), %rdi       # 0xb444
movl %ebx, %esi
xorl %eax, %eax
callq 0x3050
cmpl $0xf, %ebx
jne 0xa523
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x804a
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x41
popq %rdi
pushq $0x1
popq %rsi
callq 0x38c8
callq 0x3894
leaq 0xef0(%rip), %rdi       # 0xb42f
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x3050
// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./point_cloud_segmenter.cc
// Function: PointCloudSegmenter::ExtractInitialSeeds(std::vector<Vec3, std::allocator<Vec3>>&, std::vector<Vec3, std::allocator<Vec3>>&)
void PointCloudSegmenter::ExtractInitialSeeds(std::vector<Vec3>& cloud_seg, std::vector<Vec3>& seeds) {
  if (!cloud_seg.empty()) {

    //Sort points in current segment by height
    std::sort(cloud_seg.begin(), cloud_seg.end(), CompareZ);

    Vec3 lpr;

    //Calc Lowest Point Representative (LPR)
    std::vector<Vec3>::iterator it;
    int i = 0;

    for (it = cloud_seg.begin(); it != cloud_seg.end(); it++) {
      if (it->z > -4) {
        if (i == n_lpr) break;

        lpr.x += it->x;
        lpr.y += it->y;
        lpr.z += it->z;

        i++;
      }
    }

    lpr.x /= n_lpr;
    lpr.y /= n_lpr;
    lpr.z /= n_lpr;

    //Add point as initial seed if its dist to lpr is < th_seeds
    for (it =  cloud_seg.begin(); it != cloud_seg.end(); it++) {
      if (it->z - lpr.z < this->th_seeds) {
        seeds.push_back(*it);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
cmpq %rsi, %rdi
je 0x29fd
movq %rdx, %rbx
leaq -0x55b(%rip), %rdx      # 0x241c
callq 0x4ae2
movq (%r14), %r12
movq 0x8(%r14), %rax
movl 0x5c(%r15), %ecx
xorl %edx, %edx
xorps %xmm2, %xmm2
movss 0x46f0(%rip), %xmm0     # 0x7084
movq %r12, %rsi
cmpq %rax, %rsi
je 0x29b6
movss 0x8(%rsi), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x29b0
cmpl %ecx, %edx
je 0x29b6
addss %xmm1, %xmm2
incl %edx
addq $0x1c, %rsi
jmp 0x2997
cvtsi2ss %ecx, %xmm0
divss %xmm0, %xmm2
movss %xmm2, -0x24(%rbp)
cmpq %rax, %r12
je 0x29fd
movss 0x8(%r12), %xmm0
subss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x48(%r15), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x29f7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ca0
movss -0x24(%rbp), %xmm2
movq 0x8(%r14), %rax
addq $0x1c, %r12
jmp 0x29c3
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./point_cloud_segmenter.cc
// Function: PointCloudSegmenter::ExtractClusters(std::vector<Scanline, std::allocator<Scanline>>&)
std::vector<Vec3> PointCloudSegmenter::ExtractClusters( std::vector<Scanline>& scanlines ) {
  std::vector<Scanline>::iterator s_it;
  std::vector<Vec3>::iterator v_it;
  std::vector<Vec3> out_points;
  int i = 0;

  for (s_it = scanlines.begin(); s_it != scanlines.end(); s_it++, i++ ) {
    for (v_it = s_it->points.begin(); v_it != s_it->points.end(); v_it++) {
      if (v_it->label < this->rtable.size() && v_it->label != -3) {
        v_it->label = this->rtable[v_it->label];
        out_points.push_back(*v_it);
      }
    }
  }
  return out_points;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq (%rdx), %r13
movss 0x3b5d(%rip), %xmm2     # 0x7088
cmpq 0x8(%r14), %r13
je 0x35d9
movq 0x48(%r13), %r12
cmpq 0x50(%r13), %r12
je 0x35d0
movq 0xb8(%r15), %rax
movq 0xc0(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
js 0x3561
cvtsi2ss %rcx, %xmm1
jmp 0x3576
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
movss 0x18(%r12), %xmm0
ucomiss %xmm2, %xmm0
jne 0x3584
jnp 0x35c7
ucomiss %xmm0, %xmm1
jbe 0x35c7
cvttss2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subss 0x3aef(%rip), %xmm0     # 0x708c
cvttss2si %xmm0, %rsi
andq %rdx, %rsi
orq %rcx, %rsi
cvtsi2ssl (%rax,%rsi,4), %xmm0
movss %xmm0, 0x18(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3ca0
movss 0x3ac1(%rip), %xmm2     # 0x7088
addq $0x1c, %r12
jmp 0x3539
addq $0x70, %r13
jmp 0x352b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x47fe
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./point_cloud_segmenter.cc
// Function: PointCloudSegmenter::FindNearestNeighbor(Scanline&, Scanline&, int, int, int)
int PointCloudSegmenter::FindNearestNeighbor(Scanline& scan_current, Scanline& scan_above, int start_index, int end_index, int point_index) {
  double conversion_factor = scan_above.points.size() / scan_current.points.size();
  int above_start = floor(start_index * conversion_factor);
  int above_end = floor(end_index * conversion_factor);

  // Determine nearest point to search at
  Vec3 current = scan_current.points[point_index];
  float query[3] = {current.x, current.y, current.z};

  // Set up KNN result set
  size_t result_index;
  float result_dist_squared;
  nanoflann::KNNResultSet<float> results(1);
  results.init(&result_index, &result_dist_squared);

  // Perform search
  scan_above.tree->findNeighbors(results, &query[0], nanoflann::SearchParams(10));

  if (result_dist_squared < this->th_merge * this->th_merge) {
    return scan_above.tree_point_cloud->get_label(result_index);
  }

  return  -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq 0x48(%rsi), %rax
movslq %r9d, %rcx
imulq $0x1c, %rcx, %rcx
movq (%rax,%rcx), %rsi
movss 0x8(%rax,%rcx), %xmm0
leaq -0x3c(%rbp), %rdx
movq %rsi, (%rdx)
movss %xmm0, 0x8(%rdx)
leaq -0x60(%rbp), %rsi
movq $0x1, 0x10(%rsi)
leaq -0x20(%rbp), %rax
movq %rax, (%rsi)
leaq -0x24(%rbp), %r15
movq %r15, 0x8(%rsi)
andq $0x0, 0x18(%rsi)
movl $0x7f7fffff, (%r15)     # imm = 0x7F7FFFFF
movq 0x68(%rbx), %rdi
leaq -0x30(%rbp), %rcx
movq $0xa, (%rcx)
movb $0x1, 0x8(%rcx)
callq 0x4140
cvtss2sd (%r15), %xmm0
movsd 0x78(%r14), %xmm1
mulsd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x36a7
movq 0x60(%rbx), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
imulq $0x28, -0x20(%rbp), %rdx
imulq $0x1c, 0x20(%rax,%rdx), %rax
movq (%rcx), %rcx
cvttss2si 0x18(%rcx,%rax), %eax
jmp 0x36aa
pushq $-0x1
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./point_cloud_segmenter.cc
// Function: PointCloudSegmenter::ResolveMerge(int, int)
void PointCloudSegmenter::ResolveMerge(int x, int y) {
  int u = this->rtable.at(x);
  int v = this->rtable.at(y);

  if (u < v) {
    MergeOperation(u, v);
  } else if (u > v) {
    MergeOperation(v, u);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rdi, %rbx
leaq 0xb8(%rdi), %r12
movslq %esi, %rsi
movq %r12, %rdi
callq 0x411e
movl (%rax), %r14d
movslq %r15d, %rsi
movq %r12, %rdi
callq 0x411e
movl (%rax), %edx
cmpl %edx, %r14d
jge 0x373c
movq %rbx, %rdi
movl %r14d, %esi
jmp 0x3746
jle 0x3753
movq %rbx, %rdi
movl %edx, %esi
movl %r14d, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x375c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mitchellsayer[P]FastPointCloudSegmentation/src/./point_cloud_segmenter.cc
// Function: PointCloudSegmenter::MergeOperation(int, int)
void PointCloudSegmenter::MergeOperation(int u, int v) {
  int i = v;

  while (i != -1) {
    this->rtable[i] = u;
    i = this->next[i];
  }

  this->next[this->tail[u]] = v;
  this->tail[u] = this->tail[v];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x88(%rdi), %rax
movq 0xb8(%rdi), %rcx
movl %edx, %r8d
cmpl $-0x1, %r8d
je 0x3784
movslq %r8d, %r8
movl %esi, (%rcx,%r8,4)
movl (%rax,%r8,4), %r8d
jmp 0x3771
movslq %esi, %rcx
movq 0xa0(%rdi), %rsi
movslq (%rsi,%rcx,4), %rdi
movl %edx, (%rax,%rdi,4)
movslq %edx, %rax
movl (%rsi,%rax,4), %eax
movl %eax, (%rsi,%rcx,4)
popq %rbp
retq