LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/probonopd[P]decodeir/./DecodeIR.h
// Function: setBurst::insert(float*)
void insert( burst b )
    {
        double x = b[0]+b[1];
        super::insert( x );
        bool redo = ( x > mid1 && x < mid2 );
        if ( x < min3 )
        {
            if ( x >= min2 )
            {
                min3 = x;
            }
            else
            {
                min3 = min2;
                double g = min1 - x;
                if ( g <= 0 )
                {
                    min2 = x;
                }
                else
                {
                    min2 = min1;
                    min1 = x;
                    if ( g > mid2-mid1 ) redo = true;
                }
            }
        }
        if ( x > max3 )
        {
            if ( x <= max2 )
            {
                max3 = x;
            }
            else
            {
                max3 = max2;
                double g = x-max1;
                if ( g <= 0 )
                {
                    max2 = x;
                }
                else
                {
                    max2 = max1;
                    max1 = x;
                    if ( g > mid2-mid1 ) redo = true;
                }
            }
        }
        if (redo)
        {
            findMid();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movss (%rsi), %xmm1
addss 0x4(%rsi), %xmm1
movaps %xmm1, -0x30(%rbp)
movq %rdi, %rbx
cvtss2sd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
leaq -0x14(%rbp), %rsi
movss %xmm1, (%rsi)
callq 0x103c4
movaps -0x30(%rbp), %xmm5
movss 0x30(%rbx), %xmm2
movss 0x3c(%rbx), %xmm0
movss 0x40(%rbx), %xmm1
movaps %xmm0, %xmm3
cmpltps %xmm5, %xmm3
movaps %xmm5, %xmm4
cmpltps %xmm1, %xmm4
andps %xmm3, %xmm4
movd %xmm4, %eax
ucomiss %xmm5, %xmm2
jbe 0x101f7
movss 0x34(%rbx), %xmm2
ucomiss %xmm2, %xmm5
jae 0x101eb
movss %xmm2, 0x30(%rbx)
movss 0x38(%rbx), %xmm3
cvtss2sd %xmm3, %xmm2
subsd -0x10(%rbp), %xmm2
xorps %xmm4, %xmm4
ucomisd %xmm2, %xmm4
jae 0x101f2
movss %xmm3, 0x34(%rbx)
movss %xmm5, 0x38(%rbx)
movaps %xmm1, %xmm3
subss %xmm0, %xmm3
cvtss2sd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x101f7
movb $0x1, %al
jmp 0x101f7
movss %xmm5, 0x30(%rbx)
jmp 0x101f7
movss %xmm5, 0x34(%rbx)
ucomiss 0x4c(%rbx), %xmm5
jbe 0x10256
movss 0x48(%rbx), %xmm2
ucomiss %xmm5, %xmm2
jae 0x1024a
movss %xmm2, 0x4c(%rbx)
movss 0x44(%rbx), %xmm2
cvtss2sd %xmm2, %xmm3
movsd -0x10(%rbp), %xmm4
subsd %xmm3, %xmm4
xorpd %xmm3, %xmm3
ucomisd %xmm4, %xmm3
jae 0x10251
movss %xmm2, 0x48(%rbx)
movss %xmm5, 0x44(%rbx)
subss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
ucomisd %xmm0, %xmm4
seta %cl
orb %al, %cl
testb $0x1, %cl
jne 0x1025a
jmp 0x10262
movss %xmm5, 0x4c(%rbx)
jmp 0x10256
movss %xmm5, 0x48(%rbx)
testb $0x1, %al
je 0x10262
movq %rbx, %rdi
callq 0x100e4
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/probonopd[P]decodeir/./DecodeIR.h
// Function: Signal::lead_in(float, float, float, float, float)
int lead_in(float minTot, float maxTot, float maxOn, float minOff, float minFrameInc)
	{
        if (pLead)
        {
            if ( pLead[1] >= minOff && pLead[0] <= maxOn )
            {
                float t = pLead[0] + pLead[1];
                if ( t >= minTot && t <= maxTot && nFrame1 >= t+minFrameInc )
                    return 1;
            }
            if (pLead2)
            {
                if ( pLead2[1] >= minOff && pLead2[0] <= maxOn )
                {
                    float t = pLead2[0] + pLead2[1];
                    if ( t >= minTot && t <= maxTot && nFrame2 >= t+minFrameInc )
                        return 1;
                }
            }
        }
        return 0;
	}

// Assembly:
movq 0xd0(%rdi), %rcx
testq %rcx, %rcx
je 0x102e9
pushq %rbp
movq %rsp, %rbp
movss 0x4(%rcx), %xmm5
ucomiss %xmm3, %xmm5
movl $0x1, %eax
jb 0x102c6
movss (%rcx), %xmm6
ucomiss %xmm6, %xmm2
jae 0x102ec
movq 0xd8(%rdi), %rcx
testq %rcx, %rcx
je 0x102e5
movss 0x4(%rcx), %xmm5
ucomiss %xmm3, %xmm5
jb 0x102e5
movss (%rcx), %xmm3
ucomiss %xmm3, %xmm2
jae 0x1030d
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
addss %xmm6, %xmm5
ucomiss %xmm0, %xmm5
jb 0x102c6
ucomiss %xmm5, %xmm1
jb 0x102c6
movss 0x134(%rdi), %xmm6
addss %xmm4, %xmm5
ucomiss %xmm5, %xmm6
jb 0x102c6
jmp 0x102e7
addss %xmm3, %xmm5
ucomiss %xmm0, %xmm5
jb 0x102e5
ucomiss %xmm5, %xmm1
jb 0x102e5
movss 0x138(%rdi), %xmm0
addss %xmm4, %xmm5
ucomiss %xmm5, %xmm0
jb 0x102e5
jmp 0x102e7
// File: /workspace/github_cpp_makefile_star2_O2/probonopd[P]decodeir/./DecodeIR.h
// Function: parity(unsigned int)
inline unsigned int parity(unsigned int p)
{
    unsigned int x = p ^ (p>>16);
    x = x ^ (x >> 8);
    x = x ^ (x >> 4);
    x = x ^ (x >> 2);
    return ( x ^ (x >> 1) ) & 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
shrl $0x10, %eax
xorl %edi, %eax
movl %eax, %ecx
shrl $0x8, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
xorl %ecx, %eax
movl %eax, %ecx
shrl $0x2, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shrl %eax
xorl %ecx, %eax
andl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Dalgona[P]mine/mine.cpp
// Function: initColors()
void initColors(void)
{
  init_pair(11, 255, 0);    // white on black
  init_pair(12, 234, 234);  // menu unselected
  init_pair(13, 82, 82);    // menu selected
  init_pair(14, 123, 0);    // leaderboard title
  init_pair(15, 82, 0);     // beginner
  init_pair(16, 172, 0);    // intermediate
  init_pair(17, 198, 0);    // expert
  init_pair(18, 227, 0);    // name title 1
  init_pair(19, 214, 0);    // name title 2
  init_pair(20, 227, 0);    // 1st
  init_pair(21, 254, 0);    // 2nd
  init_pair(22, 178, 0);    // 3rd
  init_pair(23, 243, 0);    // 4th
  init_pair(24, 243, 0);    // 5th
  init_pair(30, 238, 234);  // name blank
  init_pair(31, 123, 17);   // name char
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0xb
popq %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x2070
pushq $0xc
popq %rdi
movl $0xea, %esi
movl $0xea, %edx
callq 0x2070
pushq $0xd
popq %rdi
pushq $0x52
popq %rbp
movl %ebp, %esi
movl %ebp, %edx
callq 0x2070
pushq $0xe
popq %rdi
pushq $0x7b
popq %rbx
movl %ebx, %esi
xorl %edx, %edx
callq 0x2070
pushq $0xf
popq %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x10
popq %rdi
movl $0xac, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x11
popq %rbp
movl %ebp, %edi
movl $0xc6, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x12
popq %rdi
movl $0xe3, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x13
popq %rdi
movl $0xd6, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x14
popq %rdi
movl $0xe3, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x15
popq %rdi
movl $0xfe, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x16
popq %rdi
movl $0xb2, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x17
popq %rdi
movl $0xf3, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x18
popq %rdi
movl $0xf3, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x1e
popq %rdi
movl $0xee, %esi
movl $0xea, %edx
callq 0x2070
pushq $0x1f
popq %rdi
movl %ebx, %esi
movl %ebp, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/Dalgona[P]mine/game.cpp
// Function: game::initColors()
void game::initColors()
{
  init_pair(1, 255, 0);      // Guide text
  init_pair(2, 197, 0);      // Game over message
  init_pair(3, 118, 0);      // Game cleared message
  init_pair(4, 86, 0);       // New game message
  /* pairs 11~100 are reserved */
  init_pair(101, 21, 250);   // Number 1
  init_pair(102, 22, 250);   // Number 2
  init_pair(103, 88, 250);   // Number 3
  init_pair(104, 18, 250);   // Number 4
  init_pair(105, 100, 250);  // Number 5
  init_pair(106, 24, 250);   // Number 6
  init_pair(107, 240, 250);  // Number 7
  init_pair(108, 240, 250);  // Number 8
  init_pair(109, 240, 250);  // Number 9
  init_pair(200, 250, 253);  // Unexplored
  init_pair(201, 196, 253);  // Flag
  init_pair(202, 235, 253);  // Question
  init_pair(203, 250, 250);  // Blank
  init_pair(204, 226, 202);  // Explosion
  init_pair(205, 235, 28);   // Correct
}

// Assembly:
pushq %rax
pushq $0x1
popq %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x2
popq %rdi
movl $0xc5, %esi
xorl %edx, %edx
callq 0x2070
pushq $0x3
popq %rdi
pushq $0x76
popq %rsi
xorl %edx, %edx
callq 0x2070
pushq $0x4
popq %rdi
pushq $0x56
popq %rsi
xorl %edx, %edx
callq 0x2070
pushq $0x65
popq %rdi
pushq $0x15
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x66
popq %rdi
pushq $0x16
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x67
popq %rdi
pushq $0x58
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x68
popq %rdi
pushq $0x12
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x69
popq %rdi
pushq $0x64
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x6a
popq %rdi
pushq $0x18
popq %rsi
movl $0xfa, %edx
callq 0x2070
pushq $0x6b
popq %rdi
movl $0xf0, %esi
movl $0xfa, %edx
callq 0x2070
pushq $0x6c
popq %rdi
movl $0xf0, %esi
movl $0xfa, %edx
callq 0x2070
pushq $0x6d
popq %rdi
movl $0xf0, %esi
movl $0xfa, %edx
callq 0x2070
movl $0xc8, %edi
movl $0xfa, %esi
movl $0xfd, %edx
callq 0x2070
movl $0xc9, %edi
movl $0xc4, %esi
movl $0xfd, %edx
callq 0x2070
movl $0xca, %edi
movl $0xeb, %esi
movl $0xfd, %edx
callq 0x2070
movl $0xcb, %edi
movl $0xfa, %esi
movl $0xfa, %edx
callq 0x2070
movl $0xcc, %edi
movl $0xe2, %esi
movl $0xca, %edx
callq 0x2070
pushq $0x1c
popq %rdx
movl $0xcd, %edi
movl $0xeb, %esi
popq %rax
jmp 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/Dalgona[P]mine/game.cpp
// Function: game::setFlag()
void game::setFlag()
{
  int &cp = field[index(cY, cX)];

  if (cp & MF_DISP_UNKNOWN)
  {
    cp &= ~MF_DISP_UNKNOWN;
    cp |= MF_DISP_FLAG;
    nFlags++;
  }
  else if (cp & MF_DISP_QUESTION)
  {
    cp &= ~MF_DISP_QUESTION;
    cp |= MF_DISP_FLAG;
    nFlags++;
  }
  else if (cp & MF_DISP_FLAG)
  {
    cp &= ~MF_DISP_FLAG;
    cp |= MF_DISP_UNKNOWN;
    nFlags--;
  }
}

// Assembly:
movslq 0x28(%rdi), %rcx
movslq 0x2c(%rdi), %rdx
movslq 0x24(%rdi), %rax
imulq %rcx, %rax
addq %rdx, %rax
movq 0x8(%rdi), %rcx
movl (%rcx,%rax,4), %edx
pushq $0x1
popq %rsi
movl $0x40000, %r9d          # imm = 0x40000
movl $0xfffaffff, %r8d       # imm = 0xFFFAFFFF
btl $0x10, %edx
jb 0x4f94
movl $0xfff2ffff, %r8d       # imm = 0xFFF2FFFF
btl $0x13, %edx
jb 0x4f94
btl $0x12, %edx
jae 0x4fa0
pushq $-0x1
popq %rsi
movl $0x10000, %r9d          # imm = 0x10000
andl %r8d, %edx
orl %r9d, %edx
movl %edx, (%rcx,%rax,4)
addl %esi, 0x34(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Dalgona[P]mine/screen.cpp
// Function: screen::enable()
void screen::enable()
{
  if (enabled) return;
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, true);
  updateMaxYX();
  if (has_colors())
    start_color();
  enabled = true;
}

// Assembly:
cmpb $0x0, (%rdi)
jne 0x5c6a
pushq %rbx
movq %rdi, %rbx
callq 0x2330
callq 0x20c0
callq 0x2280
movq 0x4393(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
pushq $0x1
popq %rsi
callq 0x2100
movq %rbx, %rdi
callq 0x5c6c
callq 0x2370
testb %al, %al
je 0x5c66
callq 0x2080
movb $0x1, (%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Dalgona[P]mine/screen.cpp
// Function: screen::mvprintw(int, int, char const*, ...)
void screen::mvprintw(int row, int col, const char *format, ...)
{
  va_list args;
  va_start(args, format);

  if (row < 0) row = rows + row;
  if (col < 0) col = cols + col;
  wmove(stdscr, row, col);
  vwprintw(stdscr, format, args);

  va_end(args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rcx, %rbx
leaq 0x20(%rsp), %rcx
movq %r8, 0x20(%rcx)
movq %r9, 0x28(%rcx)
testb %al, %al
je 0x5da3
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rcx, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%r14)
movl %esi, %eax
sarl $0x1f, %eax
andl 0x4(%rdi), %eax
movl %edx, %ecx
sarl $0x1f, %ecx
andl 0x8(%rdi), %ecx
addl %eax, %esi
addl %ecx, %edx
movq 0x41fa(%rip), %r15      # 0x9fd8
movq (%r15), %rdi
callq 0x2230
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x23e0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/conf2img/conf2img.cpp
// Function: CaptureInteger(gaps::R2Grid&)
static int
CaptureInteger(R2Grid& image)
{
  // Allocate pixel buffer
  unsigned char *pixels = new unsigned char [ 4 * width * height ];

  // Read pixels
  glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);

  // Fill image
  unsigned char *pixelp = pixels;
  for (int iy = 0; iy < height; iy++) {
    for (int ix = 0; ix < width; ix++) {
      unsigned int red = *pixelp++;
      unsigned int green = *pixelp++;
      unsigned int blue = *pixelp++;
      unsigned int alpha = *pixelp++;
      unsigned int value = 0;
      value |= red << 24;
      value |= green << 16;
      value |= blue <<  8;
      value |= alpha;
      image.SetGridValue(ix, iy, value);
    }
  }

  // Delete pixels
  delete [] pixels;
  
  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x13e1d1(%rip), %ebp    # 0x168a80
movl 0x13e1ce(%rip), %r15d   # 0x168a84
movl %ebp, %eax
imull %r15d, %eax
shll $0x2, %eax
movslq %eax, %rdi
callq 0x23040
movq %rax, %r14
movq %rax, (%rsp)
xorl %r12d, %r12d
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl $0x1908, %r8d           # imm = 0x1908
movl $0x1401, %r9d           # imm = 0x1401
callq 0x233b0
movl 0x13e193(%rip), %eax    # 0x168a84
movl 0x13e189(%rip), %ecx    # 0x168a80
testl %ecx, %ecx
cmovlel %r12d, %ecx
testl %eax, %eax
cmovlel %r12d, %eax
shlq $0x2, %rcx
movq %r14, %rdx
cmpl %eax, %r12d
je 0x2a94d
movl 0xc8(%rbx), %esi
imull %r12d, %esi
movslq %esi, %rsi
shlq $0x3, %rsi
addq 0xb8(%rbx), %rsi
xorl %edi, %edi
cmpq %rdi, %rcx
je 0x2a945
movl (%rdx,%rdi), %r8d
bswapl %r8d
cvtsi2sd %r8, %xmm0
movsd %xmm0, (%rsi,%rdi,2)
addq $0x4, %rdi
jmp 0x2a929
incl %r12d
addq %rdi, %rdx
jmp 0x2a90a
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x23c30
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/configuration.cpp
// Function: Configuration::loadConfiguration(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<string> Configuration::loadConfiguration(string filename)
{
    vector<string> cfg;
    ifstream input(filename);
    if (!input.is_open())
    {
        cerr << "could not open " << filename << " for reading.\n";
        exit(1);
    }
    string line;
    while(getline(input, line))
    {
        if(line[0] != '#') //avoid commented lines
        {
            //trim out spaces
            line.erase(remove(line.begin(),line.end(),' '),line.end());
            //to lower
            transform(line.begin(), line.end(), line.begin(), ::tolower);
            cfg.push_back(line);
        }
    }

    return cfg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdx, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
andq $0x0, 0x10(%rdi)
leaq -0x260(%rbp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x22a0
leaq -0x1e8(%rbp), %rdi
callq 0x2060
testb %al, %al
je 0x26e9
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x260(%rbp), %r14
leaq -0x58(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x26be
movq -0x58(%rbp), %rdi
cmpb $0x23, (%rdi)
je 0x2643
movq -0x50(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x29(%rbp)
leaq -0x29(%rbp), %rdx
callq 0x2b31
movq -0x58(%rbp), %rdx
addq -0x50(%rbp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0x2050
movq -0x58(%rbp), %r13
movq -0x50(%rbp), %r12
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x26b0
movsbl (%r13,%rbx), %edi
callq 0x2270
movb %al, (%r13,%rbx)
incq %rbx
jmp 0x2696
movq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x28e2
jmp 0x2643
leaq -0x58(%rbp), %rdi
callq 0x20e0
leaq -0x260(%rbp), %rdi
callq 0x2070
movq -0x38(%rbp), %rax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5900(%rip), %rdi      # 0x7ff0
leaq 0x290d(%rip), %rsi      # 0x5004
callq 0x21b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2180
leaq 0x2906(%rip), %rsi      # 0x5014
movq %rax, %rdi
callq 0x21b0
pushq $0x1
popq %rdi
callq 0x2200
movq %rax, %r14
jmp 0x2738
movq %rax, %r14
jmp 0x2744
jmp 0x272c
jmp 0x272c
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0x20e0
leaq -0x260(%rbp), %rdi
callq 0x2070
movq -0x38(%rbp), %rdi
callq 0x291e
movq %r14, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/configuration.cpp
// Function: Configuration::valueForKey(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Configuration::valueForKey(string key)
{
    int value = 0;
    vector<string> file = this->configFile;
    vector<string>::iterator it;
    for(it = file.begin();it < file.end();it++)
    {
        string fileKey;
        //check where's =
        string::size_type pos = (*it).find('=');
        //takes what's before =
        if (pos != string::npos)
        {
            fileKey =  (*it).substr(0, pos);
        }
        //trim eventual spaces
        fileKey.erase(remove(fileKey.begin(),fileKey.end(),' '),fileKey.end());
        //if key from file is equal to key inputted
        if(fileKey == key)
        {
            //take the value
            string extracted = (*it).substr((*it).find("=")+1);
            //trim eventual blank spaces
            extracted.erase(remove(extracted.begin(),extracted.end(),' '),extracted.end());
            //convert string to int
            value = stoi(extracted);
        }
    }
    
    return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x88(%rbp), %r14
movq %r14, %rdi
callq 0x294a
movq (%r14), %r14
xorl %r15d, %r15d
leaq -0x70(%rbp), %r12
leaq -0x50(%rbp), %r13
cmpq -0x80(%rbp), %r14
jae 0x288b
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r14, %rdi
pushq $0x3d
popq %rsi
xorl %edx, %edx
callq 0x2230
cmpq $-0x1, %rax
je 0x27db
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x21e0
movq %r13, %rdi
movq %r12, %rsi
callq 0x2210
movq %r12, %rdi
callq 0x20e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x70(%rbp)
movq %r12, %rdx
callq 0x2b31
movq -0x50(%rbp), %rdx
addq -0x48(%rbp), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x2050
movq %r13, %rdi
movq %rbx, %rsi
callq 0x299d
testb %al, %al
je 0x287a
movq %r14, %rdi
leaq 0x2805(%rip), %rsi      # 0x5023
xorl %edx, %edx
callq 0x22f0
leaq 0x1(%rax), %rdx
movq %r12, %rdi
movq %r14, %rsi
pushq $-0x1
popq %rcx
callq 0x21e0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq %rdi, %rsi
movb $0x20, -0x29(%rbp)
leaq -0x29(%rbp), %rdx
callq 0x2b31
movq -0x70(%rbp), %rdx
addq -0x68(%rbp), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x2050
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x29c9
movl %eax, %r15d
movq %r12, %rdi
callq 0x20e0
movq %r13, %rdi
callq 0x20e0
addq $0x20, %r14
jmp 0x278a
leaq -0x88(%rbp), %rdi
callq 0x291e
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28af
jmp 0x28af
jmp 0x28c1
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20e0
jmp 0x28c4
jmp 0x28c1
jmp 0x28c1
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x88(%rbp), %rdi
callq 0x291e
movq %rbx, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: update()
void update()
{
	printMap();
	int k,x,y;
	for(int i=0;i<POPULATION;i++)
	{
		people[i].work();
		if(!people[i].working)
		{
			people[i].move();
		}
	}

	if(cfg.automated)
	sleep(cfg.speed);
	else
	getchar();
	system("clear");

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x2f1a
xorl %r14d, %r14d
leaq 0x9e43(%rip), %r15      # 0xcd00
cmpq $0x4b0, %r14            # imm = 0x4B0
je 0x2ee8
leaq (%r15,%r14), %rbx
movq %rbx, %rdi
callq 0x38c8
cmpb $0x0, 0x15(%r15,%r14)
jne 0x2ee2
movq %rbx, %rdi
callq 0x36ec
addq $0x30, %r14
jmp 0x2ebd
leaq 0x52c9(%rip), %rax      # 0x81b8
cmpb $0x0, 0x3c(%rax)
je 0x2eff
movl 0x40(%rax), %edi
callq 0x2130
jmp 0x2f04
callq 0x2250
leaq 0x2139(%rip), %rdi      # 0x5044
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: initMap()
void initMap()
{
	if(cfg.maxLakes>0)
	{
		setWater();
	}

	if(cfg.maxWoods>0)
	{
		setWood();
	}

	if(cfg.maxMountains>0)
	{
		setMountain();
	}

	if(cfg.mapIsland)
	{
		setIsland();
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x50bb(%rip), %rbx      # 0x81b8
cmpl $0x0, 0x24(%rbx)
jle 0x3108
callq 0x3136
cmpl $0x0, 0x2c(%rbx)
jle 0x3113
callq 0x3217
cmpl $0x0, 0x28(%rbx)
jle 0x311e
callq 0x32fa
cmpb $0x1, 0x44(%rbx)
jne 0x312f
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x33dd
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setWater()
void setWater()
{
    int lakes = randBetween(1, cfg.maxLakes);
    for(int i=0;i<lakes;i++)
    {
        int ray = randBetween(1, cfg.maxLakesRay);
				int x = randBetween(ray, WIDTH-ray);
				int y = randBetween(ray, HEIGHT-ray);
        for(int j=x-ray;j<x+ray;j++)
        {
            for(int k=y-ray;k<y+ray;k++)
            {
                map[j][k].kind='-';
                map[j][k].origin='-';
                map[j][k].walkable=true;
            }
        }
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x506d(%rip), %rax      # 0x81b8
movl 0x24(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r14d
xorl %r13d, %r13d
testl %eax, %eax
cmovlel %r13d, %r14d
pushq $0x14
popq %rbx
cmpl %r14d, %r13d
je 0x3208
leaq 0x5043(%rip), %rax      # 0x81b8
movl 0x30(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r15d
pushq $0x50
popq %rsi
subl %eax, %esi
movl %eax, %edi
callq 0x4188
movl %eax, %r12d
movl %ebx, %esi
subl %r15d, %esi
movl %r15d, %edi
callq 0x4188
movl %r12d, %edx
subl %r15d, %edx
addl %r15d, %r12d
movl %eax, %ecx
subl %r15d, %ecx
addl %r15d, %eax
movslq %ecx, %rcx
cltq
movslq %edx, %rdx
movslq %r12d, %rsi
imulq $0xf0, %rdx, %r8
imulq $0xc, %rcx, %rdi
addq %r8, %rdi
addq 0x4de0(%rip), %rdi      # 0x7fb0
movq %rdi, %r8
movq %rcx, %r9
cmpq %rsi, %rdx
jl 0x31ef
jmp 0x3200
movw $0x2d2d, (%r8)          # imm = 0x2D2D
movb $0x1, 0x9(%r8)
incq %r9
addq $0xc, %r8
cmpq %rax, %r9
jl 0x31dd
incq %rdx
addq $0xf0, %rdi
jmp 0x31d0
incl %r13d
jmp 0x3165
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setWood()
void setWood()
{
	int woods = randBetween(1, cfg.maxWoods);

	for(int i=0;i<woods;i++)
	{
		/*set ray*/
		int ray = randBetween(1, cfg.maxWoodsRay);
		/*choose center*/
		int x = randBetween(ray, WIDTH-ray);
		int y = randBetween(ray, HEIGHT-ray);
		/*mapping*/
		for(int j=x-ray;j<x+ray;j++)
		{
			for(int k=y-ray;k<y+ray;k++)
			{
				map[j][k].kind='|';
				map[j][k].origin='|';
			}
		}
	 }

	 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4f8c(%rip), %rax      # 0x81b8
movl 0x2c(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r14d
xorl %r13d, %r13d
testl %eax, %eax
cmovlel %r13d, %r14d
pushq $0x14
popq %rbx
cmpl %r14d, %r13d
je 0x32eb
leaq 0x4f62(%rip), %rax      # 0x81b8
movl 0x38(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r15d
pushq $0x50
popq %rsi
subl %eax, %esi
movl %eax, %edi
callq 0x4188
movl %eax, %r12d
movl %ebx, %esi
subl %r15d, %esi
movl %r15d, %edi
callq 0x4188
movl %r12d, %edx
subl %r15d, %edx
addl %r15d, %r12d
movl %eax, %ecx
subl %r15d, %ecx
addl %r15d, %eax
movslq %ecx, %rcx
cltq
movslq %edx, %rdx
movslq %r12d, %rsi
imulq $0xf0, %rdx, %rdi
imulq $0xc, %rcx, %r8
addq %rdi, %r8
leaq 0x4f4f(%rip), %rdi      # 0x8200
addq %r8, %rdi
incq %rdi
movq %rdi, %r8
movq %rcx, %r9
cmpq %rsi, %rdx
jl 0x32d2
jmp 0x32e3
movw $0x7c7c, -0x1(%r8)      # imm = 0x7C7C
incq %r9
addq $0xc, %r8
cmpq %rax, %r9
jl 0x32c4
incq %rdx
addq $0xf0, %rdi
jmp 0x32b7
incl %r13d
jmp 0x3246
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setMountain()
void setMountain()
{
	int mountains = randBetween(1, cfg.maxMountains);
	for(int i=0;i<mountains;i++)
	{
		/*set ray*/
		int ray = randBetween(1, cfg.maxMountainsRay);
		/*choose center*/
		int x = randBetween(ray, WIDTH-ray);
		int y = randBetween(ray, HEIGHT-ray);
		/*mapping*/
		for(int j=x-ray;j<x+ray;j++)
		{
			for(int k=y-ray;k<y+ray;k++)
			{
				map[j][k].kind='^';
				map[j][k].origin='^';
			}
		}
	 }

	 return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4ea9(%rip), %rax      # 0x81b8
movl 0x28(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r14d
xorl %r13d, %r13d
testl %eax, %eax
cmovlel %r13d, %r14d
pushq $0x14
popq %rbx
cmpl %r14d, %r13d
je 0x33ce
leaq 0x4e7f(%rip), %rax      # 0x81b8
movl 0x34(%rax), %esi
pushq $0x1
popq %rdi
callq 0x4188
movl %eax, %r15d
pushq $0x50
popq %rsi
subl %eax, %esi
movl %eax, %edi
callq 0x4188
movl %eax, %r12d
movl %ebx, %esi
subl %r15d, %esi
movl %r15d, %edi
callq 0x4188
movl %r12d, %edx
subl %r15d, %edx
addl %r15d, %r12d
movl %eax, %ecx
subl %r15d, %ecx
addl %r15d, %eax
movslq %ecx, %rcx
cltq
movslq %edx, %rdx
movslq %r12d, %rsi
imulq $0xf0, %rdx, %rdi
imulq $0xc, %rcx, %r8
addq %rdi, %r8
leaq 0x4e6c(%rip), %rdi      # 0x8200
addq %r8, %rdi
incq %rdi
movq %rdi, %r8
movq %rcx, %r9
cmpq %rsi, %rdx
jl 0x33b5
jmp 0x33c6
movw $0x5e5e, -0x1(%r8)      # imm = 0x5E5E
incq %r9
addq $0xc, %r8
cmpq %rax, %r9
jl 0x33a7
incq %rdx
addq $0xf0, %rdi
jmp 0x339a
incl %r13d
jmp 0x3329
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: setIsland()
void setIsland()
{
	if(cfg.mapIsland)
	 {
		 for(int i=0;i<WIDTH;i++)
		 {
			for(int j=0;j<HEIGHT;j++)
			{
				if(i<2 || j<2 || i>WIDTH-3 || j>HEIGHT-3)
				{
					map[i][j].kind = '-';
					map[i][j].origin = '-';
					map[i][j].walkable=false;
				}
			}
		 }
	 }

	 return;
 }

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x4dd0(%rip), %rax      # 0x81b8
cmpb $0x1, 0x44(%rax)
jne 0x3446
leaq 0x4e0b(%rip), %rax      # 0x8200
xorl %ecx, %ecx
movl $0xffffffee, %edx       # imm = 0xFFFFFFEE
cmpq $0x50, %rcx
je 0x3446
leal -0x4e(%rcx), %esi
xorl %edi, %edi
movl %edx, %r8d
cmpq $0xf0, %rdi
je 0x343b
cmpl $-0x4c, %esi
setae %r9b
cmpl $-0x10, %r8d
setae %r10b
testb %r10b, %r9b
jne 0x3432
movw $0x2d2d, (%rax,%rdi)    # imm = 0x2D2D
movb $0x0, 0x9(%rax,%rdi)
incl %r8d
addq $0xc, %rdi
jmp 0x340a
incq %rcx
addq $0xf0, %rax
jmp 0x33fc
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/map.cpp
// Function: initPeople()
void initPeople()
{
	int x,y;
	for(int k=0;k<POPULATION;k++)
	{
		do
		{
			x = rand() % WIDTH;
			y = rand() % HEIGHT;
		} while(map[x][y].villagerHere || map[x][y].kind=='-');

		people[k].position[0]=x;
		people[k].position[1]=y;
		people[k].underMe=map[x][y].kind;
		map[x][y].villagerHere=true;
		people[k].pathCoordinates = people[k].setPath();
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %r15d, %r15d
pushq $0x50
popq %r13
pushq $0x14
popq %rbx
leaq 0x4d96(%rip), %r12      # 0x8200
cmpq $0x19, %r15
je 0x3504
callq 0x2080
cltd
idivl %r13d
movl %edx, %r14d
callq 0x2080
cltd
idivl %ebx
movslq %r14d, %rax
movslq %edx, %rcx
imulq $0xf0, %rax, %rax
addq %r12, %rax
imulq $0xc, %rcx, %rcx
cmpb $0x0, 0xa(%rcx,%rax)
jne 0x3474
addq %rcx, %rax
movb 0x1(%rax), %cl
cmpb $0x2d, %cl
je 0x3474
imulq $0x30, %r15, %rdi
leaq 0x9847(%rip), %r8       # 0xcd00
leaq (%r8,%rdi), %rsi
movq %r15, -0x30(%rbp)
leaq (%r8,%rdi), %r15
addq $0x18, %r15
movl %r14d, -0xc(%r15)
movl %edx, -0x8(%r15)
movb %cl, -0x4(%r15)
movb $0x1, 0xa(%rax)
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x37ae
movq %r15, %rdi
movq -0x30(%rbp), %r15
movq %r14, %rsi
callq 0x3552
movq %r14, %rdi
callq 0x3514
incq %r15
jmp 0x346a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::fishing()
void Person::fishing()
{
    if(checkAround(this->position[0],this->position[1],'-'))
    {
        this->working = true;
        fish++;
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %edi
movl 0x10(%rbx), %esi
pushq $0x2d
popq %rdx
callq 0x409c
testb %al, %al
je 0x35e8
movb $0x1, 0x15(%rbx)
leaq 0x9bd2(%rip), %rax      # 0xd1b8
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::woodcutting()
void Person::woodcutting()
{
    if(this->underMe=='|')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        wood++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x7c, 0x14(%rdi)
jne 0x3643
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
movb $0x1, 0x15(%rdi)
leaq 0x9ba7(%rip), %rdx      # 0xd1b4
incl (%rdx)
imulq $0xc, %rcx, %rcx
imulq $0xf0, %rax, %rax
addq 0x498f(%rip), %rax      # 0x7fb0
movl 0x4(%rcx,%rax), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax)
cmpl $0x19, %edx
jg 0x3642
addq %rcx, %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::farming()
void Person::farming()
{
    if(this->underMe=='.')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        food++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x2e, 0x14(%rdi)
jne 0x3697
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
movb $0x1, 0x15(%rdi)
leaq 0x9b5b(%rip), %rdx      # 0xd1bc
incl (%rdx)
imulq $0xc, %rcx, %rcx
imulq $0xf0, %rax, %rax
addq 0x493b(%rip), %rax      # 0x7fb0
movl 0x4(%rcx,%rax), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax)
cmpl $0x19, %edx
jg 0x3696
addq %rcx, %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::mining()
void Person::mining()
{
    if(this->underMe=='^')
    {
        int x = this->position[0];
        int y = this->position[1];
        this->working = true;
        stone++;
        map[x][y].usable-=25;
        if(map[x][y].usable<=0)
        {
            this->working=false;
            this->underMe='x';
            map[x][y].isRegenerating=true;
            map[x][y].kind = 'x';
        }
    }

    return;
}

// Assembly:
cmpb $0x5e, 0x14(%rdi)
jne 0x36eb
pushq %rbp
movq %rsp, %rbp
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
movb $0x1, 0x15(%rdi)
leaq 0x9b0b(%rip), %rdx      # 0xd1c0
incl (%rdx)
imulq $0xc, %rcx, %rcx
imulq $0xf0, %rax, %rax
addq 0x48e7(%rip), %rax      # 0x7fb0
movl 0x4(%rcx,%rax), %edx
leal -0x19(%rdx), %esi
movl %esi, 0x4(%rcx,%rax)
cmpl $0x19, %edx
jg 0x36ea
addq %rcx, %rax
movw $0x78, 0x14(%rdi)
movb $0x1, 0x8(%rax)
movb $0x78, 0x1(%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::move()
void Person::move()
{
    map[this->position[0]][this->position[1]].villagerHere = false;
    //move along the path
    //if we don't have a path we create it
    if(this->pathCoordinates.empty())
    {
        cout << "Arrived, looking for another path" << endl;
        this->pathCoordinates = this->setPath();
    }
    this->position[0] = get<0>(this->pathCoordinates.front());
    this->position[1] = get<1>(this->pathCoordinates.front());
    //remove first element
    this->pathCoordinates.erase (this->pathCoordinates.begin());

    this->underMe = map[this->position[0]][this->position[1]].kind;
    map[this->position[0]][this->position[1]].villagerHere = true;

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
movslq 0x10(%rdi), %rcx
imulq $0xc, %rcx, %rcx
imulq $0xf0, %rax, %rax
addq 0x489a(%rip), %rax      # 0x7fb0
movb $0x0, 0xa(%rcx,%rax)
leaq 0x18(%rdi), %r14
movq 0x18(%rdi), %rsi
cmpq 0x20(%rdi), %rsi
jne 0x376a
movq 0x4898(%rip), %rdi      # 0x7fc8
leaq 0x19a1(%rip), %rsi      # 0x50d8
callq 0x21b0
movq %rax, %rdi
callq 0x20f0
leaq -0x30(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x37ae
movq %r14, %rdi
movq %r15, %rsi
callq 0x3552
movq %r15, %rdi
callq 0x3514
movq 0x18(%rbx), %rsi
movl 0x4(%rsi), %eax
movl %eax, 0xc(%rbx)
movl (%rsi), %eax
movl %eax, 0x10(%rbx)
movq %r14, %rdi
callq 0x38fe
movslq 0xc(%rbx), %rax
movslq 0x10(%rbx), %rcx
imulq $0xf0, %rax, %rax
addq 0x481d(%rip), %rax      # 0x7fb0
imulq $0xc, %rcx, %rcx
movb 0x1(%rcx,%rax), %dl
movb %dl, 0x14(%rbx)
movb $0x1, 0xa(%rcx,%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/person.cpp
// Function: Person::setPath()
vector<tuple<int, int>> Person::setPath()
{
    vector<tuple<int, int> > path;
    tuple<int, int> objective = findOneFree(this->preferredTerrain);

    //at the moment, since everything is walkable, move right/left until
    //pos[x] is equal to objective one, then move straight to objective
    int x = this->position[0];
    int y = this->position[1];
    int objectiveX = get<0>(objective);
    int objectiveY = get<1>(objective);
    while(x != objectiveX)
    {
        if(x < objectiveX)
        x++;
        else
        x--;
        path.emplace_back(x,y);
    }
    while(y != objectiveY)
    {
        if(y < objectiveY)
        y++;
        else
        y--;
        path.emplace_back(x,y);
    }

    if(path.empty())
    {
        path.emplace_back(this->position[0], this->position[1]);
    }

    return path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movsbl 0x4(%rsi), %esi
leaq -0x38(%rbp), %rdi
callq 0x41ac
leaq 0xc(%r14), %rax
movq %rax, -0x40(%rbp)
movl 0xc(%r14), %eax
leaq -0x30(%rbp), %r12
movl %eax, (%r12)
movl 0x10(%r14), %eax
addq $0x10, %r14
movq %r14, -0x48(%rbp)
leaq -0x2c(%rbp), %r13
movl %eax, (%r13)
movl -0x38(%rbp), %r15d
movl -0x34(%rbp), %r14d
movl -0x30(%rbp), %eax
cmpl %r14d, %eax
je 0x3833
setl %cl
movzbl %cl, %ecx
leal (%rax,%rcx,2), %eax
decl %eax
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3908
jmp 0x380d
leaq -0x30(%rbp), %r12
leaq -0x2c(%rbp), %r13
movl -0x2c(%rbp), %eax
cmpl %r15d, %eax
je 0x3861
setl %cl
movzbl %cl, %ecx
leal (%rax,%rcx,2), %eax
decl %eax
movl %eax, -0x2c(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3908
jmp 0x383b
movq (%rbx), %rax
cmpq 0x8(%rbx), %rax
jne 0x387a
movq %rbx, %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x3908
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3892
jmp 0x3892
jmp 0x3892
movq %rax, %r14
movq %rbx, %rdi
callq 0x3514
movq %r14, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/societysimulator.cpp
// Function: main
int main()
{
    srand(time(NULL));
    initMap();
    initPeople();
    while(true)
    {
        update();
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x2190
movl %eax, %edi
callq 0x21a0
callq 0x30f0
callq 0x3448
callq 0x2ea4
jmp 0x3b5c
nop
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: checkAround(int, int, char)
bool checkAround(int x, int y, char check)
{
	bool isCheckAroundMe = false;

	if(map[x-1][y].kind==check||
	   map[x][y-1].kind==check||
	   map[x][y+1].kind==check||
	   map[x+1][y].kind==check)
	{
		isCheckAroundMe = true;
	}

	return isCheckAroundMe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rdi), %eax
movslq %eax, %rcx
movslq %esi, %rax
imulq $0xc, %rax, %rax
imulq $0xf0, %rcx, %rcx
addq 0x3ef5(%rip), %rcx      # 0x7fb0
cmpb %dl, 0x1(%rax,%rcx)
je 0x410c
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
imulq $0xf0, %rcx, %rcx
addq 0x3eda(%rip), %rcx      # 0x7fb0
movslq %r8d, %r8
imulq $0xc, %r8, %r8
cmpb %dl, 0x1(%r8,%rcx)
je 0x410c
incl %esi
movslq %esi, %rsi
imulq $0xc, %rsi, %rsi
cmpb %dl, 0x1(%rsi,%rcx)
je 0x410c
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x3eaa(%rip), %rcx      # 0x7fb0
cmpb %dl, 0x1(%rax,%rcx)
jne 0x4110
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x410e
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: checkAroundOrigin(int, int, char)
bool checkAroundOrigin(int x, int y, char check)
{
	bool isCheckAroundMe = false;

	if(map[x-1][y].origin==check||
	   map[x][y-1].origin==check||
	   map[x][y+1].origin==check||
	   map[x+1][y].origin==check)
	{
		isCheckAroundMe = true;
	}

	return isCheckAroundMe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x1(%rdi), %eax
movslq %eax, %rcx
movslq %esi, %rax
imulq $0xc, %rax, %rax
imulq $0xf0, %rcx, %rcx
addq 0x3e7d(%rip), %rcx      # 0x7fb0
cmpb %dl, (%rax,%rcx)
je 0x4180
movslq %edi, %rcx
leal -0x1(%rsi), %r8d
imulq $0xf0, %rcx, %rcx
addq 0x3e63(%rip), %rcx      # 0x7fb0
movslq %r8d, %r8
imulq $0xc, %r8, %r8
cmpb %dl, (%r8,%rcx)
je 0x4180
incl %esi
movslq %esi, %rsi
imulq $0xc, %rsi, %rsi
cmpb %dl, (%rsi,%rcx)
je 0x4180
incl %edi
movslq %edi, %rcx
imulq $0xf0, %rcx, %rcx
addq 0x3e35(%rip), %rcx      # 0x7fb0
cmpb %dl, (%rax,%rcx)
jne 0x4184
movb $0x1, %al
popq %rbp
retq
xorl %eax, %eax
jmp 0x4182
// File: /workspace/github_cpp_makefile_star2_O2/gabryatfendor[P]SocietySimulator/src/utilities.cpp
// Function: findOneFree(char)
tuple<int, int> findOneFree(char kind)
{
	tuple<int, int> free;
	for(int j=0;j<HEIGHT;j++)
		{
		for(int i=0;i<WIDTH;i++)
		{
			if (map[i][j].kind == kind &&
			!map[i][j].villagerAimingHere)
			{
				free = make_tuple(i, j);
				map[i][j].villagerAimingHere = true;
				goto returnme; /*ykes, but from MISRA c++ coding standards
								 this seems to remain the last kind of place in which goto
							     it's still good to use, to exit double for loop*/
			}
		}
	}

	returnme:
	return free;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
andq $0x0, (%rdi)
leaq 0x4042(%rip), %rdx      # 0x8200
addq $0xb, %rdx
xorl %ecx, %ecx
cmpq $0x14, %rcx
je 0x41ff
movq %rdx, %rdi
xorl %r8d, %r8d
cmpq $0x50, %r8
je 0x41ed
cmpb %sil, -0xa(%rdi)
jne 0x41e1
cmpb $0x0, (%rdi)
je 0x41f6
incq %r8
addq $0xf0, %rdi
jmp 0x41d0
incq %rcx
addq $0xc, %rdx
jmp 0x41c4
movl %r8d, 0x4(%rax)
movl %ecx, (%rax)
movb $0x1, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/rsa_enc.cpp
// Function: main
int main(int argc, char *argv[])
{
	unsigned char *pubkey = NULL;
	unsigned int size;

	if (argc < 3)
	{
		printf("Usage: enc public_key plaintext\r\n");
		return -1;
	}

	pubkey = (unsigned char *)get_file(argv[1], &size);
	if (pubkey == NULL)
	{
		printf("Failed to open public key\r\n");
		return -1;
	}

	unsigned char data[256] = {0};

	strcpy((char *)data, argv[2]);
	int data_len = strlen((char *)data);
	printf("plaintext %s\r\n", data); 

	unsigned char encrypted[4098]={};



	RSA *rsa = createRSA(pubkey, true);
	int encrypted_length = RSA_public_encrypt(data_len, data, encrypted, rsa, RSA_PKCS1_PADDING);
	if (encrypted_length == -1)
	{
		char err[130];

		ERR_load_crypto_strings();
		ERR_error_string(ERR_get_error(), err);
		printf("ERROR: %s\n", err);
		return -1;
	}
	RSA_free(rsa);

	printf("Encrypted Length %d\r\n", encrypted_length);
	write_file((char *)"file.enc", (char *)encrypted, encrypted_length);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x11a8, %rsp           # imm = 0x11A8
cmpl $0x2, %edi
jg 0x146c
leaq 0xc61(%rip), %rdi       # 0x20c8
jmp 0x1548
movq %rsi, %r12
movq 0x8(%rsi), %rdi
leaq -0x34(%rbp), %rsi
callq 0x1320
testq %rax, %rax
je 0x1541
movq %rax, %r14
leaq -0x1c0(%rbp), %r15
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x10b0
movq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x10e0
movq %r15, %rdi
callq 0x1090
movq %rax, -0x30(%rbp)
leaq 0xb98(%rip), %rdi       # 0x2058
movq %r15, %rsi
xorl %eax, %eax
callq 0x1050
leaq -0x11d0(%rbp), %rdi
movl $0x1002, %edx           # imm = 0x1002
xorl %esi, %esi
callq 0x10b0
pushq $0x1
popq %r13
movq %r14, %rdi
movl %r13d, %esi
callq 0x129c
movq %rax, %r12
movq -0x30(%rbp), %rdi
movq %r15, %rsi
leaq -0x11d0(%rbp), %rdx
movq %rax, %rcx
movl %r13d, %r8d
callq 0x10c0
cmpl $-0x1, %eax
je 0x1564
movl %eax, %r14d
movq %r12, %rdi
callq 0x1110
leaq 0xb53(%rip), %rdi       # 0x2072
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
leaq 0xb58(%rip), %rdi       # 0x2088
leaq -0x11d0(%rbp), %rsi
movl %r14d, %edx
callq 0x13ce
jmp 0x1550
leaq 0xb65(%rip), %rdi       # 0x20ad
callq 0x1160
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x11a8, %rsp           # imm = 0x11A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x10a0
callq 0x1140
leaq -0xc0(%rbp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1070
leaq 0xadb(%rip), %rdi       # 0x2067
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x154d
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/main.cpp
// Function: main
int main(int argq, char* argv[]) {
	if(argq < 2) {
		cerr << "\a Not enough number of arguments!" << endl;
		cerr << "\a Command line: ./run <input.txt>" << endl;
		return -1;
	}

	char* input;
	input = argv[1];

	Scheduler sched;
	InitializeSemaphores();
	sched.readFile(input);
	sched.simulation();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
cmpl $0x1, %edi
jg 0x2447
movq 0x5bdc(%rip), %rbx      # 0x7ff0
leaq 0x2be9(%rip), %rsi      # 0x5004
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x2bf4(%rip), %rsi      # 0x5026
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
pushq $-0x1
popq %rax
jmp 0x249f
movq 0x8(%rsi), %rbx
leaq -0x210(%rbp), %rdi
callq 0x24d0
callq 0x2c80
leaq -0x30(%rbp), %rdi
leaq -0x9(%rbp), %rdx
movq %rbx, %rsi
callq 0x20a0
leaq -0x210(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x337a
leaq -0x30(%rbp), %rdi
callq 0x20c0
leaq -0x210(%rbp), %rdi
callq 0x35aa
leaq -0x210(%rbp), %rdi
callq 0x2590
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x20c0
jmp 0x24bc
jmp 0x24b9
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x2590
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/process.cpp
// Function: operator<<(std::ostream&, Process const&)
ostream& operator<<(ostream& pl,const Process& punit) {
	pl << "\tPID: " << punit.pid << '\n';
	pl << "\tPriority: " << punit.priority << '\n';
	pl << "\tInitialization Time: " << punit.initTime << '\n';
	pl << "\tExecuting Time: " << punit.processTime << '\n';
	pl << "\tMemory Offset: " << punit.memoryOffset << '\n';
	pl << "\tBlocks Amount " << punit.amoutBlocks << '\n';
	pl << "\tPrinters: " << punit.usePrinter << '\n';
	pl << "\tScanners: " << punit.usescan << '\n';
	pl << "\tModems: " << punit.useModem << '\n';
	pl << "\tSATA: " << punit.useSATA;
	return pl;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x27c7(%rip), %rsi      # 0x5048
callq 0x2170
movl (%r14), %esi
movq %rax, %rdi
callq 0x2230
pushq $0xa
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x27aa(%rip), %rsi      # 0x504f
movq %rbx, %rdi
callq 0x2170
movl 0x4(%r14), %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x2791(%rip), %rsi      # 0x505b
movq %rbx, %rdi
callq 0x2170
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x2783(%rip), %rsi      # 0x5072
movq %rbx, %rdi
callq 0x2170
movl 0x14(%r14), %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x2770(%rip), %rsi      # 0x5084
movq %rbx, %rdi
callq 0x2170
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x275c(%rip), %rsi      # 0x5095
movq %rbx, %rdi
callq 0x2170
movl 0x10(%r14), %esi
movq %rax, %rdi
callq 0x2230
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x2747(%rip), %rsi      # 0x50a5
movq %rbx, %rdi
callq 0x2170
movzbl 0x18(%r14), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x272d(%rip), %rsi      # 0x50b1
movq %rbx, %rdi
callq 0x2170
movzbl 0x19(%r14), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x2713(%rip), %rsi      # 0x50bd
movq %rbx, %rdi
callq 0x2170
movzbl 0x1a(%r14), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
movl %ebp, %esi
callq 0x2190
leaq 0x26f7(%rip), %rsi      # 0x50c7
movq %rbx, %rdi
callq 0x2170
movzbl 0x1b(%r14), %esi
movq %rax, %rdi
callq 0x2210
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/marcellapantarotto[P]pseudoSO/process.cpp
// Function: Process::gives()
void Process::gives() {
	int resource, hit;

	freeResource(resource);
	resource = usesResource();
	hit = blockResource(resource);
	if(hit) {
		blockedResource = resource;
	}
	processTime -= QUANTUM;		// cálculo do tempo
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2cf9
movq %rbx, %rdi
callq 0x2a7c
movl %eax, %ebp
movl %eax, %edi
callq 0x2ccf
testl %eax, %eax
je 0x2a71
movl %ebp, 0x1c(%rbx)
decl 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop