LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/actors/writer.cpp
// Function: Writer::open_file(int)
MPI_File *Writer::open_file(int round)
{
    char filename[100];
    sprintf(filename, "./images/frame_%03d.pbm", round);
    MPI_File *file_handle = &file_handles[round];
    MPI_File_open(MPI_COMM_SELF, filename, MPI_MODE_WRONLY | MPI_MODE_CREATE, MPI_INFO_NULL, file_handle);
    return file_handle;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x138f(%rip), %rsi      # 0x40ae
movq %rsp, %r15
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2060
movslq %ebx, %rbx
shlq $0x3, %rbx
addq 0x30(%r14), %rbx
movq 0x4298(%rip), %rdi      # 0x6fd8
movq 0x4289(%rip), %rcx      # 0x6fd0
pushq $0x5
popq %rdx
movq %r15, %rsi
movq %rbx, %r8
callq 0x20c0
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::randomize()
void Active_block::randomize()
{
    srand(time(NULL) * block_num);
    for (int x = 1; x <= width; x++)
    {
        for (int y = 1; y <= height; y++)
        {

            grid[y][x] = (int)rand() % 100 < 35 ? 1 : 0;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %edi, %edi
callq 0x2140
imull 0x8(%rbx), %eax
movl %eax, %edi
callq 0x2160
pushq $0x1
popq %r14
pushq $0x64
popq %rbp
movq %r14, %r15
movslq 0x1c(%rbx), %rax
cmpq %rax, %r15
jg 0x2e46
movq %r14, %r12
movslq 0x20(%rbx), %rax
cmpq %rax, %r12
jg 0x2e41
callq 0x2070
cltd
idivl %ebp
cmpl $0x23, %edx
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %rax
setl (%rax,%r15)
incq %r12
jmp 0x2e1b
incq %r15
jmp 0x2e0f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::compress(unsigned char*)
void Active_block::compress(unsigned char *buffer)
{
    memset(buffer, 0, width_byte * height);
    for (int grid_y = 1; grid_y <= height; grid_y++)
    {
        for (int grid_x = 1; grid_x <= width; grid_x++)
        {
            /* Information about 8 cells are packed into one byte.
             * If the number of pixels in a row is not divisible by 8, 
             * the remaining bits are left empty.
             */
            if (grid[grid_y][grid_x] == 1)
            {
                int buffer_x = (grid_x - 1) / 8;
                int buffer_y = grid_y - 1;
                int k = (grid_x - 1) % 8;
                int buffer_pos = buffer_y * width_byte + buffer_x;
                buffer[buffer_pos] |= 1 << (7 - k);
            }
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x24(%rdi), %rax
movslq 0x20(%rdi), %rdx
imulq %rax, %rdx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x20b0
pushq $0x1
popq %rax
pushq $0x1
popq %rdx
movq %rax, %rsi
movslq 0x20(%r14), %rcx
cmpq %rcx, %rsi
jg 0x2ed2
leal -0x1(%rsi), %edi
movq %rax, %r8
movslq 0x1c(%r14), %rcx
cmpq %rcx, %r8
jg 0x2ecd
movq 0x30(%r14), %rcx
movq (%rcx,%rsi,8), %rcx
cmpb $0x1, (%rcx,%r8)
jne 0x2ec8
leal -0x1(%r8), %ecx
movl %ecx, %r9d
shrl $0x3, %r9d
movl 0x24(%r14), %r10d
imull %edi, %r10d
addl %r9d, %r10d
notb %cl
andb $0x7, %cl
movl %edx, %r9d
shll %cl, %r9d
movslq %r10d, %rcx
orb %r9b, (%rbx,%rcx)
incq %r8
jmp 0x2e88
incq %rsi
jmp 0x2e79
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::west()
int Active_block::west()
{
    if (first_col)
    {
        // left from first col is last col
        return position_to_block_num(world->cols - 1, y);
    }
    else
    {
        return position_to_block_num(x - 1, y);
    }
}

// Assembly:
cmpb $0x1, 0x29(%rdi)
jne 0x2f80
movq (%rdi), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
jmp 0x2f89
movl 0xc(%rdi), %ecx
movl 0x10(%rdi), %eax
movq (%rdi), %rdi
imull 0x10(%rdi), %eax
addl %ecx, %eax
decl %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::east()
int Active_block::east()
{
    if (last_col)
    {
        // right from last col is first col
        return position_to_block_num(0, y);
    }
    else
    {
        return position_to_block_num(x + 1, y);
    }
}

// Assembly:
cmpb $0x1, 0x2b(%rdi)
jne 0x2fa3
movq (%rdi), %rax
movl 0x10(%rax), %eax
imull 0x10(%rdi), %eax
retq
movl 0xc(%rdi), %eax
movq (%rdi), %rcx
movl 0x10(%rcx), %ecx
imull 0x10(%rdi), %ecx
addl %ecx, %eax
incl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::wrap_border(Border_direction, unsigned char*)
void Active_block::wrap_border(Border_direction dir, unsigned char *buffer)
{
    switch (dir)
    {
    case NORTH:
        wrap_row(1, buffer);
        break;
    case SOUTH:
        wrap_row(height, buffer);
        break;
    case WEST:
        wrap_col(1, buffer);
        break;
    case EAST:
        wrap_col(width, buffer);
        break;
    case NORTH_WEST:
        wrap_corner(1, 1, buffer);
        break;
    case NORTH_EAST:
        wrap_corner(width, 1, buffer);
        break;
    case SOUTH_WEST:
        wrap_corner(1, height, buffer);
        break;
    case SOUTH_EAST:
        wrap_corner(width, height, buffer);
        break;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x30dd
movl %esi, %eax
leaq 0x107a(%rip), %rcx      # 0x40f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rsi
jmp 0x30de
movq 0x30(%rdi), %rax
movq 0x8(%rax), %rax
jmp 0x30d8
movl 0x1c(%rdi), %esi
jmp 0x3104
pushq $0x1
popq %rsi
jmp 0x3104
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movq 0x30(%rdi), %rsi
movq (%rsi,%rcx,8), %rcx
jmp 0x30c7
movl 0x20(%rdi), %esi
jmp 0x30de
movslq 0x1c(%rdi), %rax
movq 0x30(%rdi), %rcx
movq 0x8(%rcx), %rcx
movb (%rcx,%rax), %al
jmp 0x30db
movslq 0x20(%rdi), %rax
movq 0x30(%rdi), %rcx
movq (%rcx,%rax,8), %rax
movb 0x1(%rax), %al
movb %al, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::unwrap_border(Border_direction, unsigned char*)
void Active_block::unwrap_border(Border_direction dir, unsigned char *buffer)
{
    switch (dir)
    {
    case NORTH:
        unwrap_row(0, buffer);
        break;
    case SOUTH:
        unwrap_row(height + 1, buffer);
        break;
    case WEST:
        unwrap_col(0, buffer);
        break;
    case EAST:
        unwrap_col(width + 1, buffer);
        break;
    case NORTH_WEST:
        unwrap_corner(0, 0, buffer);
        break;
    case NORTH_EAST:
        unwrap_corner(width + 1, 0, buffer);
        break;
    case SOUTH_WEST:
        unwrap_corner(0, height + 1, buffer);
        break;
    case SOUTH_EAST:
        unwrap_corner(width + 1, height + 1, buffer);
        break;
    }
}

// Assembly:
cmpl $0x7, %esi
ja 0x3190
movl %esi, %eax
leaq 0xfc4(%rip), %rcx       # 0x4110
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %esi, %esi
jmp 0x31c0
movb (%rdx), %al
movq 0x30(%rdi), %rcx
movq (%rcx), %rcx
movb %al, (%rcx)
retq
movl 0x1c(%rdi), %esi
incl %esi
jmp 0x31e6
xorl %esi, %esi
jmp 0x31e6
movslq 0x1c(%rdi), %rax
movslq 0x20(%rdi), %rcx
movb (%rdx), %dl
movq 0x30(%rdi), %rsi
movq 0x8(%rsi,%rcx,8), %rcx
movb %dl, 0x1(%rcx,%rax)
retq
movl 0x20(%rdi), %esi
incl %esi
jmp 0x31c0
movslq 0x1c(%rdi), %rax
movb (%rdx), %cl
movq 0x30(%rdi), %rdx
movq (%rdx), %rdx
movb %cl, 0x1(%rdx,%rax)
retq
movslq 0x20(%rdi), %rax
movb (%rdx), %cl
movq 0x30(%rdi), %rdx
movq 0x8(%rdx,%rax,8), %rax
movb %cl, (%rax)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::step()
void Active_block::step()
{
    for (int y = 1; y <= height; y++)
    {
        for (int x = 1; x <= width; x++)
        {
            int neighbours;
            neighbours = get_neighbors(x, y);
            next_grid[y][x] = is_alive(neighbours, grid[y][x]);
        }
    }

    //swap pointers
    unsigned char **swap = grid;
    grid = next_grid;
    next_grid = swap;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %r12
movq %r12, %r14
movslq 0x20(%rbx), %rax
cmpq %rax, %r14
jg 0x3289
movq %r12, %r15
movslq 0x1c(%rbx), %rax
cmpq %rax, %r15
jg 0x3284
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x32a4
cmpl $0x3, %eax
je 0x326d
cmpl $0x2, %eax
jne 0x3271
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rax
movb (%rax,%r15), %al
jmp 0x3273
movb $0x1, %al
jmp 0x3273
xorl %eax, %eax
movq 0x38(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movb %al, (%rcx,%r15)
incq %r15
jmp 0x323e
incq %r14
jmp 0x3232
movdqu 0x30(%rbx), %xmm0
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::get_neighbors(int, int)
int Active_block::get_neighbors(int pixel_x, int pixel_y)
{
    int sum = 0;
    // Pixels in row above and below
    for (int i = 0; i < 3; ++i)
    {
        sum += grid[pixel_y - 1][pixel_x - 1 + i];
        sum += grid[pixel_y + 1][pixel_x - 1 + i];
    }
    // Pixels left and right
    sum += grid[pixel_y][pixel_x - 1];
    sum += grid[pixel_y][pixel_x + 1];
    return sum;
}

// Assembly:
movq 0x30(%rdi), %rax
movslq %edx, %rcx
leal -0x1(%rsi), %edx
movslq %edx, %rdx
movq -0x8(%rax,%rcx,8), %r8
addq %rdx, %r8
addq 0x8(%rax,%rcx,8), %rdx
xorl %r9d, %r9d
xorl %edi, %edi
cmpq $0x3, %r9
je 0x32de
movzbl (%r8,%r9), %r10d
addl %r10d, %edi
movzbl (%rdx,%r9), %r10d
addl %r10d, %edi
incq %r9
jmp 0x32c3
movq (%rax,%rcx,8), %rax
movslq %esi, %rcx
movzbl -0x1(%rax,%rcx), %edx
addl %edx, %edi
movzbl 0x1(%rax,%rcx), %eax
addl %edi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::print()
void Active_block::print()
{
    printf("Active_block:\n{\n");
    printf("\tPosition: \t(%d, %d)\n", x, y);
    printf("\tPixel size: \t%d x %d\n", width, height);
    printf("\tWidth Byte: \t%d\n", width_byte);
    printf("\tPixel start: \t(%d x %d)\n", starting_x, starting_y);
    printf("\tSpecial Info:\n");
    printf("\t{\n");
    printf("\t\tFirst Row: \t%c\n", first_row ? '+' : '0');
    printf("\t\tLast Row: \t%c\n", last_row ? '+' : '0');
    printf("\t\tFirst Col: \t%c\n", first_col ? '+' : '0');
    printf("\t\tLast Col: \t%c\n", last_col ? '+' : '0');
    printf("\t}\n");
    printf("}\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xe90(%rip), %rdi       # 0x41ed
callq 0x2210
movl 0xc(%rbx), %esi
movl 0x10(%rbx), %edx
leaq 0xdc1(%rip), %rdi       # 0x4130
xorl %eax, %eax
callq 0x2040
movl 0x1c(%rbx), %esi
movl 0x20(%rbx), %edx
leaq 0xdc3(%rip), %rdi       # 0x4146
xorl %eax, %eax
callq 0x2040
movl 0x24(%rbx), %esi
leaq 0xdc9(%rip), %rdi       # 0x415d
xorl %eax, %eax
callq 0x2040
movl 0x14(%rbx), %esi
movl 0x18(%rbx), %edx
leaq 0xdc7(%rip), %rdi       # 0x416f
xorl %eax, %eax
callq 0x2040
leaq 0xe47(%rip), %rdi       # 0x41fd
callq 0x2210
leaq 0xe4a(%rip), %rdi       # 0x420c
callq 0x2210
movzbl 0x28(%rbx), %eax
xorl $0x1, %eax
leal (%rax,%rax,4), %esi
addl $0x2b, %esi
leaq 0xdae(%rip), %rdi       # 0x4189
xorl %eax, %eax
callq 0x2040
movzbl 0x2a(%rbx), %eax
xorl $0x1, %eax
leal (%rax,%rax,4), %esi
addl $0x2b, %esi
leaq 0xda5(%rip), %rdi       # 0x419b
xorl %eax, %eax
callq 0x2040
movzbl 0x29(%rbx), %eax
xorl $0x1, %eax
leal (%rax,%rax,4), %esi
addl $0x2b, %esi
leaq 0xd9b(%rip), %rdi       # 0x41ac
xorl %eax, %eax
callq 0x2040
movzbl 0x2b(%rbx), %eax
xorl $0x1, %eax
leal (%rax,%rax,4), %esi
addl $0x2b, %esi
leaq 0xd92(%rip), %rdi       # 0x41be
xorl %eax, %eax
callq 0x2040
leaq 0xdd5(%rip), %rdi       # 0x420f
callq 0x2210
leaq 0xdca(%rip), %rdi       # 0x4210
popq %rbx
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: Active_block::print_grid()
void Active_block::print_grid()
{
    // Print the current blocks adress
    printf("Active_block [%d, %d]:\n", x, y);

    // Print all the assigned pixels without the borders
    for (int y = 0; y < height + 2; y++)
    {
        if (y == width + 1)
        {
            printf("\n");
        }
        for (int x = 0; x < width + 2; x++)
        {
            if (x == width + 1)
            {
                printf("\t");
            }
            if (grid[y][x])
            {
                printf("X");
            }
            else
            {
                printf("-");
            }
            if (x == 0)
            {
                printf("\t");
            }
        }
        printf("\n");
        if (y == 0)
        {
            printf("\n");
        }
    }
    printf("\n\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movl 0x10(%rdi), %edx
leaq 0xd68(%rip), %rdi       # 0x41cf
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x2040
pushq $0x9
popq %r14
pushq $0x2d
popq %r12
pushq $0x58
popq %r13
movslq 0x20(%rbx), %rax
addq $0x2, %rax
cmpq %rax, %r15
jge 0x3502
movl 0x1c(%rbx), %eax
incl %eax
cmpq %rax, %r15
jne 0x349c
pushq $0xa
popq %rdi
callq 0x21d0
xorl %ebp, %ebp
movslq 0x1c(%rbx), %rax
leaq 0x2(%rax), %rcx
cmpq %rcx, %rbp
jge 0x34e5
incl %eax
cmpq %rax, %rbp
jne 0x34ba
movl %r14d, %edi
callq 0x21d0
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rax
cmpb $0x0, (%rax,%rbp)
movl %r12d, %edi
je 0x34ce
movl %r13d, %edi
callq 0x21d0
testq %rbp, %rbp
jne 0x34e0
movl %r14d, %edi
callq 0x21d0
incq %rbp
jmp 0x349e
pushq $0xa
popq %rdi
callq 0x21d0
testq %r15, %r15
jne 0x34fa
pushq $0xa
popq %rdi
callq 0x21d0
incq %r15
jmp 0x347d
leaq 0xc3b(%rip), %rdi       # 0x4144
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/active_block.cpp
// Function: print_unsigned_char_array(unsigned char*, int)
void print_unsigned_char_array(unsigned char *arr, int size)
{
    printf("[");
    for (int i = 0; i < size; i++)
    {
        if (i > 0)
        {
            printf(", ");
        }
        printf("%d", arr[i]);
    }
    printf("]\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x5b
popq %rdi
callq 0x21d0
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0xcaa(%rip), %r15       # 0x41ea
leaq 0xca0(%rip), %r12       # 0x41e7
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x3572
testq %r13, %r13
je 0x355e
movq %r12, %rdi
xorl %eax, %eax
callq 0x2040
movzbl (%r14,%r13), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2040
incq %r13
jmp 0x354a
leaq 0xc99(%rip), %rdi       # 0x4212
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/../helpers/grid.h
// Function: create_grid(int, int)
inline unsigned char **create_grid(int width, int height)
{
    unsigned char **grid = new unsigned char *[height];
    for (int i = 0; i < height; ++i)
    {
        grid[i] = new unsigned char[width];
    }
    return grid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl %esi, %eax
shlq $0x3, %rax
xorl %r12d, %r12d
testl %esi, %esi
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
cmovlel %r12d, %ebx
callq 0x2030
movq %rax, %r14
movslq %ebp, %r15
cmpq %r12, %rbx
je 0x35ca
movq %r15, %rdi
callq 0x2030
movq %rax, (%r14,%r12,8)
incq %r12
jmp 0x35b4
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/../helpers/figures.h
// Function: figures::glider(unsigned char**, int, int)
inline void glider(unsigned char **grid, int offset_X = 0, int offset_Y = 0)
{
    grid[4 + offset_Y][4 + offset_X] = 1;
    grid[4 + offset_Y][5 + offset_X] = 1;
    grid[4 + offset_Y][6 + offset_X] = 1;
    grid[3 + offset_Y][6 + offset_X] = 1;
    grid[2 + offset_Y][5 + offset_X] = 1;
}

// Assembly:
movslq %edx, %rax
movq 0x20(%rdi,%rax,8), %rcx
movslq %esi, %rdx
movb $0x1, %sil
movb %sil, 0x4(%rcx,%rdx)
movq 0x20(%rdi,%rax,8), %rcx
movb %sil, 0x5(%rcx,%rdx)
movq 0x20(%rdi,%rax,8), %rcx
movb %sil, 0x6(%rcx,%rdx)
movq 0x18(%rdi,%rax,8), %rcx
movb %sil, 0x6(%rcx,%rdx)
movq 0x10(%rdi,%rax,8), %rax
movb %sil, 0x5(%rax,%rdx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/world.cpp
// Function: World::set_blocks()
void World::set_blocks()
{
    blocks = new Block **[rows];
    for (int row = 0; row < rows; row++)
    {
        blocks[row] = new Block *[cols];
        for (int col = 0; col < cols; col++)
        {
            int block_num = row * cols + col;
            blocks[row][col] = new Block(this, block_num);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xc(%rdi), %r15
leaq (,%r15,8), %rdi
testq %r15, %r15
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq %rax, 0x30(%rbx)
xorl %ebp, %ebp
pushq $0x30
popq %r14
movslq %r15d, %rax
cmpq %rax, %rbp
jge 0x3901
movslq 0x10(%rbx), %r15
leaq (,%r15,8), %rdi
testq %r15, %r15
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq 0x30(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
xorl %r13d, %r13d
movslq %r15d, %rax
cmpq %rax, %r13
jge 0x38f8
imull %ebp, %r15d
addl %r13d, %r15d
movq %r14, %rdi
callq 0x2170
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
movl %r15d, %edx
callq 0x3614
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq %r12, (%rax,%r13,8)
incq %r13
movl 0x10(%rbx), %r15d
jmp 0x38bb
incq %rbp
movl 0xc(%rbx), %r15d
jmp 0x388d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r12, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x2230
// File: /workspace/github_cpp_makefile_star2_O2/Gammelkebab[P]GameOfLife/src/world/world.cpp
// Function: World::print()
void World::print()
{
    printf("World:\n{\n");
    printf("\tPixels: \t%d x %d\n", width, height);
    printf("\tBlocks: \t%d x %d\n", cols, rows);
    printf("\tWorkers: \t%d\n", worker_amt);
    printf("\tTotal rounds: \t%d\n", total_rounds);
    printf("\n}\n");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x8ec(%rip), %rdi       # 0x425d
callq 0x2210
movl (%rbx), %esi
movl 0x4(%rbx), %edx
leaq 0x892(%rip), %rdi       # 0x4214
xorl %eax, %eax
callq 0x2040
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %esi
leaq 0x891(%rip), %rdi       # 0x4227
xorl %eax, %eax
callq 0x2040
movl 0x18(%rbx), %esi
leaq 0x893(%rip), %rdi       # 0x423a
xorl %eax, %eax
callq 0x2040
movl 0x28(%rbx), %esi
leaq 0x891(%rip), %rdi       # 0x4249
xorl %eax, %eax
callq 0x2040
leaq 0x8a0(%rip), %rdi       # 0x4266
popq %rbx
jmp 0x2210
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_19_20.cc
// Function: main
int main(int argc, char const *argv[])
{
	std::vector<std::string> v = {"hello", "c++11", "template"};
	std::list<int> l = {1, 2, 3, 4};

	print1(v, std::cout);
	print2(l, std::cout);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
leaq 0xd5d(%rip), %rsi       # 0x2020
leaq -0xa8(%rbp), %r14
leaq -0x48(%rbp), %rdx
movq %r14, %rdi
callq 0x1060
leaq -0x88(%rbp), %r15
leaq 0xd42(%rip), %rsi       # 0x2026
leaq -0x19(%rbp), %rdx
movq %r15, %rdi
callq 0x1060
leaq -0x68(%rbp), %r15
leaq 0xd31(%rip), %rsi       # 0x202c
leaq -0x1b(%rbp), %rdx
movq %r15, %rdi
callq 0x1060
leaq -0x38(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
pushq $0x3
popq %rdx
leaq -0x1a(%rbp), %rcx
callq 0x140a
pushq $0x40
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1080
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x1321
movaps 0xcce(%rip), %xmm0      # 0x2010
leaq -0x48(%rbp), %rsi
movups %xmm0, (%rsi)
leaq -0xa8(%rbp), %rdi
pushq $0x4
popq %rdx
leaq -0x19(%rbp), %rcx
callq 0x1444
movq 0x2c75(%rip), %rsi      # 0x3fd8
leaq -0x38(%rbp), %rdi
callq 0x147b
movq 0x2c65(%rip), %rsi      # 0x3fd8
leaq -0xa8(%rbp), %rdi
callq 0x14e8
leaq -0xa8(%rbp), %rdi
callq 0x1566
leaq -0x38(%rbp), %rdi
callq 0x153a
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x13f8
movq %rax, %rbx
pushq $0x40
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xa8, %rdi
callq 0x1080
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x13b0
jmp 0x1401
jmp 0x13ce
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x1080
cmpq %r14, %r15
jne 0x13d1
jmp 0x1401
movq %rax, %rbx
jmp 0x1401
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x1566
leaq -0x38(%rbp), %rdi
callq 0x153a
movq %rbx, %rdi
callq 0x1160
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_19_20.cc
// Function: std::ostream& print1<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::ostream&)
std::ostream& print1(const Container& container, std::ostream& os)
{
	for (typename Container::size_type i = 0; i != container.size(); ++i) {
		os << container[i] << " ";
	}
	os << std::endl;

	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0xbcd(%rip), %r15       # 0x2066
xorl %r13d, %r13d
movq (%r14), %rsi
movq 0x8(%r14), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %r13
je 0x14ce
addq %r12, %rsi
movq %rbx, %rdi
callq 0x10d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
incq %r13
addq $0x20, %r12
jmp 0x149c
movq %rbx, %rdi
callq 0x1090
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_19_20.cc
// Function: std::ostream& print2<std::__cxx11::list<int, std::allocator<int>>>(std::__cxx11::list<int, std::allocator<int>> const&, std::ostream&)
std::ostream& print2(const Container& container, std::ostream& os)
{
	for (auto iter = container.cbegin(); iter != container.cend(); ++iter) {
		os << *iter << " ";
	}
	os << std::endl;

	return os;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb66(%rip), %r15       # 0x2066
movq %rdi, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x1526
movl 0x10(%r12), %esi
movq %rbx, %rdi
callq 0x1150
movq %rax, %rdi
movq %r15, %rsi
callq 0x10e0
jmp 0x1503
movq %rbx, %rdi
callq 0x1090
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: get_cpu_ids(std::vector<int, std::allocator<int>>&)
void get_cpu_ids(std::vector<int> &ids) {
    const std::string DOT = std::string(".");
    const std::string MICROCODE = std::string("microcode");
    DIR * dir = opendir("/dev/cpu/");
    if (!dir) {
        std::cerr << "Failed reading CPU ids" << std::endl;
        return;
    }
    struct dirent * ent;
    while ((ent = readdir(dir)) != NULL) {
            std::string name(ent->d_name);
            if (!name.compare(0, DOT.length(), DOT) == 0 && name != MICROCODE) {
                try {
                    ids.push_back(std::stoi(std::string(ent->d_name)));
                } catch (const std::invalid_argument& ia) {
                    std::cerr << "Invalid CPU ID: " << ent->d_name << std::endl;
                }
            }
            
    }
    closedir(dir);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x1c55(%rip), %rsi      # 0x41ce
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x3224
leaq 0x1ab5(%rip), %rsi      # 0x4044
leaq 0x28(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x3224
leaq 0x1aa9(%rip), %rdi      # 0x404e
callq 0x2220
testq %rax, %rax
je 0x26c7
movq %rax, %r14
leaq 0x68(%rsp), %r15
leaq 0x88(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq %r14, %rdi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
je 0x26bd
addq $0x13, %rbx
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3224
movq 0x50(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rcx
callq 0x21f0
testl %eax, %eax
je 0x2650
movq %r15, %rdi
movq %rbp, %rsi
callq 0x325f
testb %al, %al
je 0x2650
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x13(%rsp), %rdx
callq 0x3224
movq %r12, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x3269
movl %eax, 0x14(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x35aa
movq %r12, %rdi
callq 0x22f8
movq %r15, %rdi
callq 0x22f8
jmp 0x25cd
movq %rdx, 0x18(%rsp)
movq %rax, 0x8(%rsp)
jmp 0x267b
movq %rdx, 0x18(%rsp)
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x22f8
cmpl $0x1, 0x18(%rsp)
jne 0x2735
movq 0x8(%rsp), %rdi
callq 0x20a0
movq 0x4959(%rip), %rdi      # 0x6ff0
leaq 0x19d1(%rip), %rsi      # 0x406f
callq 0x2170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
callq 0x2280
jmp 0x2650
movq %r14, %rdi
callq 0x2260
jmp 0x26e2
movq 0x4922(%rip), %rdi      # 0x6ff0
leaq 0x1983(%rip), %rsi      # 0x4058
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x28(%rsp), %rdi
callq 0x22f8
leaq 0x48(%rsp), %rdi
callq 0x22f8
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2730
movq %rax, 0x8(%rsp)
callq 0x2280
jmp 0x2735
movq %rax, %rdi
callq 0x3285
jmp 0x2741
movq %rax, 0x8(%rsp)
jmp 0x2750
movq %rax, 0x8(%rsp)
jmp 0x275a
jmp 0x2741
movq %rax, 0x8(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x22f8
jmp 0x2746
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x22f8
leaq 0x48(%rsp), %rdi
callq 0x22f8
movq 0x8(%rsp), %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: read_msr(long, unsigned int)
uint64_t read_msr(long int msr_addr, unsigned int cpu_id = 0) {
    std::string path = std::string("/dev/cpu/") + std::to_string(cpu_id) + std::string("/msr");
    FILE * f = fopen(path.c_str(), "r");
    if (!f) {
        std::cerr << "Failed reading of C6 state; msr module is not loaded in kernel" << std::endl;
        return 0;
    }
    int err = fseek (f, msr_addr, SEEK_SET);
    if (err) {
        std::cerr << "Failed reading of C6 state; error reading msr" << std::endl;
        fclose(f);
        return 0;
    }
    uint64_t msr_value = 0;
    fread(&msr_value, 8, 1, f);
    fclose(f);
    return msr_value;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x16b1(%rip), %rsi      # 0x404e
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3224
leaq 0x50(%rsp), %rdi
movl %ebp, %esi
callq 0x3350
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x3290
leaq 0x16ad(%rip), %rsi      # 0x4080
leaq 0x30(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x3224
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x3290
leaq 0x30(%rsp), %rdi
callq 0x22f8
leaq 0x10(%rsp), %rdi
callq 0x22f8
leaq 0x50(%rsp), %rdi
callq 0x22f8
leaq 0x70(%rsp), %rdi
callq 0x22f8
movq 0x90(%rsp), %rdi
leaq 0x1732(%rip), %rsi      # 0x4162
callq 0x21d0
testq %rax, %rax
je 0x2a73
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x21b0
testl %eax, %eax
je 0x2a92
movq 0x459b(%rip), %rdi      # 0x6ff0
leaq 0x16da(%rip), %rsi      # 0x4136
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r14, %rdi
callq 0x2180
jmp 0x2a8e
movq 0x4576(%rip), %rdi      # 0x6ff0
leaq 0x1676(%rip), %rsi      # 0x40f7
callq 0x2170
movq %rax, %rdi
callq 0x20d0
xorl %ebx, %ebx
jmp 0x2ab7
leaq 0x10(%rsp), %rbx
andq $0x0, (%rbx)
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x2210
movq %r14, %rdi
callq 0x2180
movq (%rbx), %rbx
leaq 0x90(%rsp), %rdi
callq 0x22f8
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x2ad5
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0x2b17
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x22f8
jmp 0x2af4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x22f8
jmp 0x2b03
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x22f8
jmp 0x2b12
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x22f8
movq %rbx, %rdi
callq 0x2290
movq %rax, %rbx
jmp 0x2b1c
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: print_help()
void print_help() {
    std::cout << "Changes and reads the C6 state on AMD Zen (Epyc/Ryzen) processors." << std::endl;
    std::cout << std::endl <<  "Options:" << std::endl;
    std::cout << FLAG_HELP0 << " or " << FLAG_HELP1 << ": Print this help message." << std::endl;
    std::cout << FLAG_LIST0 << " or " << FLAG_LIST1 << ": List current C6 states." << std::endl;
    std::cout << FLAG_DISABLE << ": Disable C6 states. This is the default behavior." << std::endl;
    std::cout << FLAG_DISABLE_RETRY << ": Disable C6 states. On failure, retry up to "
        << MAX_RETRIES << " times and sleep " << RETRY_SLEEP_DURATION_S << " s between trys." << std::endl;
    std::cout << FLAG_ENABLE << ": Enable C6 states." << std::endl;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x4494(%rip), %rbx      # 0x6fc8
leaq 0x1629(%rip), %rsi      # 0x4164
movq %rbx, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x20d0
leaq 0x164d(%rip), %rsi      # 0x41a7
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x4637(%rip), %rsi      # 0x71a8
movq %rbx, %rdi
callq 0x2160
leaq 0x1630(%rip), %r14      # 0x41b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x4636(%rip), %rsi      # 0x71c8
movq %rax, %rdi
callq 0x2160
leaq 0x1614(%rip), %rsi      # 0x41b5
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x4690(%rip), %rsi      # 0x7248
movq %rbx, %rdi
callq 0x2160
movq %rax, %rdi
movq %r14, %rsi
callq 0x2170
leaq 0x4696(%rip), %rsi      # 0x7268
movq %rax, %rdi
callq 0x2160
leaq 0x15ef(%rip), %rsi      # 0x41d0
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x45f0(%rip), %rsi      # 0x71e8
movq %rbx, %rdi
callq 0x2160
leaq 0x15e3(%rip), %rsi      # 0x41ea
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x45ea(%rip), %rsi      # 0x7208
movq %rbx, %rdi
callq 0x2160
leaq 0x15f0(%rip), %rsi      # 0x421d
movq %rax, %rdi
callq 0x2170
pushq $0x4
popq %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x2100
leaq 0x1600(%rip), %rsi      # 0x424b
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
movq %r14, %rsi
callq 0x2100
leaq 0x15f8(%rip), %rsi      # 0x425d
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x45ac(%rip), %rsi      # 0x7228
movq %rbx, %rdi
callq 0x2160
leaq 0x15e3(%rip), %rsi      # 0x426e
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20d0
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: parse_op_mode(int, char const**)
op_mode parse_op_mode(const int argc, const char *argv[]) {
    if (argc <= 1) {
        std::cout << "Disabling C6 state. Run with \"-h\" to display other options." << std::endl;
        return DISABLE;
    }
    std::string argument(argv[1]);
    if (argument == FLAG_HELP0 || argument == FLAG_HELP1) {
        print_help();
        return NONE;
    } else if (argument == FLAG_LIST0 || argument == FLAG_LIST1) {
        return LIST;
    } else if (argument == FLAG_DISABLE) {
        return DISABLE;
    } else if (argument == FLAG_DISABLE_RETRY) {
        return RETRYDISABLE;
    } else if (argument == FLAG_ENABLE) {
        return ENABLE;
    }
    std::cerr << "Error, unknown parameter: " << argument << std::endl;
    return ERROR;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpl $0x1, %edi
jg 0x2ccb
movq 0x4315(%rip), %rdi      # 0x6fc8
leaq 0x15c8(%rip), %rsi      # 0x4282
callq 0x2170
movq %rax, %rdi
callq 0x20d0
xorl %ebx, %ebx
jmp 0x2d1b
movq 0x8(%rsi), %rsi
leaq 0x10(%rsp), %rbx
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x3224
leaq 0x44c0(%rip), %rsi      # 0x71a8
movq %rbx, %rdi
callq 0x338f
testb %al, %al
jne 0x2d09
leaq 0x44cd(%rip), %rsi      # 0x71c8
leaq 0x10(%rsp), %rdi
callq 0x338f
testb %al, %al
je 0x2d23
callq 0x2b29
pushq $0x4
popq %rbx
leaq 0x10(%rsp), %rdi
callq 0x22f8
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
retq
leaq 0x451e(%rip), %rsi      # 0x7248
leaq 0x10(%rsp), %rdi
callq 0x338f
pushq $0x3
popq %rbx
testb %al, %al
jne 0x2d11
leaq 0x4526(%rip), %rsi      # 0x7268
leaq 0x10(%rsp), %rdi
callq 0x338f
testb %al, %al
jne 0x2d11
leaq 0x4491(%rip), %rsi      # 0x71e8
leaq 0x10(%rsp), %rdi
callq 0x338f
xorl %ebx, %ebx
testb %al, %al
jne 0x2d11
leaq 0x449a(%rip), %rsi      # 0x7208
leaq 0x10(%rsp), %rdi
callq 0x338f
testb %al, %al
je 0x2d80
pushq $0x1
jmp 0x2d10
leaq 0x44a1(%rip), %rsi      # 0x7228
leaq 0x10(%rsp), %rdi
callq 0x338f
testb %al, %al
je 0x2d9c
pushq $0x2
jmp 0x2d10
movq 0x424d(%rip), %rdi      # 0x6ff0
leaq 0x1514(%rip), %rsi      # 0x42be
callq 0x2170
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20d0
pushq $0x5
jmp 0x2d10
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x22f8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: has_amd_cpu()
bool has_amd_cpu() {
    const std::string VENDOR_PREFIX = std::string("vendor_id");
    const std::string VENDOR_REQUIRED = std::string(": AuthenticAMD");
    bool has_amd = false;
    std::string line;
    std::ifstream cpuinfo("/proc/cpuinfo");
    if (cpuinfo.is_open()) {
        while (getline(cpuinfo,line)) {
            if (line.compare(0, VENDOR_PREFIX.length(), VENDOR_PREFIX) == 0
                && line.find(VENDOR_REQUIRED) != std::string::npos) {
                has_amd = true;
                break;
            }
        }
        cpuinfo.close();
  }
  return has_amd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
leaq 0x14e2(%rip), %rsi      # 0x42d9
leaq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x3224
leaq 0x14d6(%rip), %rsi      # 0x42e3
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x3224
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x14be(%rip), %rsi      # 0x42f2
leaq 0x68(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x22b0
leaq 0xe0(%rsp), %rdi
callq 0x2060
testb %al, %al
je 0x2eb7
leaq 0x68(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x48(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
sete %bl
jne 0x2eab
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x21f0
testl %eax, %eax
jne 0x2e66
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x22e0
cmpq $-0x1, %rax
je 0x2e66
leaq 0x68(%rsp), %rdi
callq 0x2050
jmp 0x2eb9
xorl %ebx, %ebx
leaq 0x68(%rsp), %rdi
callq 0x2070
leaq 0x28(%rsp), %rdi
callq 0x22f8
leaq 0x48(%rsp), %rdi
callq 0x22f8
leaq 0x8(%rsp), %rdi
callq 0x22f8
movl %ebx, %eax
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x2f00
movq %rax, %rbx
jmp 0x2f0d
movq %rax, %rbx
jmp 0x2f21
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2070
leaq 0x28(%rsp), %rdi
callq 0x22f8
leaq 0x48(%rsp), %rdi
callq 0x22f8
leaq 0x8(%rsp), %rdi
callq 0x22f8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: retry_execution_main()
int retry_execution_main() {
    if (direct_execution_main(DISABLE)) {
        for (unsigned int i = 0; i < MAX_RETRIES; i++) {
            std::cout << "Disabling C6 state failed; retrying in " << RETRY_SLEEP_DURATION_S 
                << " seconds" << std::endl;
            sleep(RETRY_SLEEP_DURATION_S);
            if (!direct_execution_main(DISABLE)) {
                return 0;
            }
        }
        std::cerr << "Failed disabling C6 state on retry #" << MAX_RETRIES << "; accepting failure" << std::endl;
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4(%rsp), %rdi
andl $0x0, (%rdi)
callq 0x2f33
xorl %ecx, %ecx
testl %eax, %eax
je 0x31b7
pushq $0x5
popq %r14
leaq 0x1264(%rip), %r15      # 0x4385
pushq $0x4
popq %r12
leaq 0x1281(%rip), %r13      # 0x43ad
pushq $0x4
popq %rbp
movq %rsp, %rbx
decl %r14d
je 0x317f
movq 0x3e8a(%rip), %rdi      # 0x6fc8
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
movq %r12, %rsi
callq 0x2100
movq %rax, %rdi
movq %r13, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movl %ebp, %edi
callq 0x2120
andl $0x0, (%rsp)
movq %rbx, %rdi
callq 0x2f33
testl %eax, %eax
jne 0x3132
xorl %ecx, %ecx
jmp 0x31b7
movq 0x3e6a(%rip), %rdi      # 0x6ff0
leaq 0x1229(%rip), %rsi      # 0x43b6
callq 0x2170
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x2100
leaq 0x1237(%rip), %rsi      # 0x43db
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/joakimkistowski[P]amd-disable-c6/amd-disable-c6.cpp
// Function: main
int main(const int argc, const char *argv[]) {
    if (!has_amd_cpu()) {
        std::cerr << "Failed disabling of C6 state; no AMD CPU found" << std::endl;
        return 1;
    }
    op_mode mode = parse_op_mode(argc, argv);
    if (mode == RETRYDISABLE) {
        return retry_execution_main();
    } else {
        return direct_execution_main(mode);
    }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
callq 0x2de0
testb %al, %al
je 0x31f3
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2ca2
movl %eax, 0x4(%rsp)
cmpl $0x1, %eax
jne 0x3213
callq 0x30f4
jmp 0x321d
movq 0x3df6(%rip), %rdi      # 0x6ff0
leaq 0x11ee(%rip), %rsi      # 0x43ef
callq 0x2170
movq %rax, %rdi
callq 0x20d0
pushq $0x1
popq %rax
jmp 0x321d
leaq 0x4(%rsp), %rdi
callq 0x2f33
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/superyuan[P]refeditor/MappingConvertor.cpp
// Function: readMapFile(char const*)
int readMapFile(const char *fileName)
{
	CLineFields mapFile;
    if (mapFile.openFile(fileName)==false) { 
            cerr << "Can not open map file: " << fileName << endl;
            exit (-1);
    }
	mapFile.readline();
	while (mapFile.endofFile()==false) {
		posMap cm;
		string chrName = mapFile.field[0];
		cm.from = atoi(mapFile.field[1].c_str());
		cm.length = atoi(mapFile.field[2].c_str());
		cm.to = atoi(mapFile.field[3].c_str());
		
		if (chrMap[chrName]==NULL) {
			chrMap[chrName] = new vector<posMap>;
		}
		(*chrMap[chrName]).push_back(cm);
		mapFile.readline();
	}
	mapFile.fp->close();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
leaq 0x38(%rsp), %r14
movq %r14, %rdi
callq 0x3d28
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3c7c
testb %al, %al
je 0x26c2
leaq 0x2ab1(%rip), %rsi      # 0x5038
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x3172
leaq 0x38(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x18(%rsp), %rdx
callq 0x3d58
leaq 0x18(%rsp), %rdi
callq 0x2100
leaq 0x38(%rsp), %rbx
leaq 0x78(%rsp), %r14
leaq 0x5f65(%rip), %r15      # 0x8528
leaq 0x98(%rsp), %r12
pushq $0x1
popq %rbp
movq %rbx, %rdi
callq 0x3d44
testb %al, %al
jne 0x269a
movq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x2290
movq 0x38(%rsp), %r13
movq 0x20(%r13), %rdi
callq 0x22e0
movl %eax, 0xc(%rsp)
movq 0x40(%r13), %rdi
callq 0x22e0
movl %eax, 0x10(%rsp)
movq 0x60(%r13), %rdi
callq 0x22e0
movl %eax, 0x14(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x31ae
cmpq $0x0, (%rax)
jne 0x264c
pushq $0x18
popq %rdi
callq 0x21f0
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x31ae
movq %r13, (%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x31ae
movq (%rax), %rdi
leaq 0xc(%rsp), %rsi
callq 0x3214
movq %r12, %rdi
leaq 0x29ca(%rip), %rsi      # 0x5038
leaq 0xb(%rsp), %rdx
callq 0x3172
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x3d58
movq %r12, %rdi
callq 0x2100
movq %r14, %rdi
callq 0x2100
jmp 0x25ce
movq 0x50(%rsp), %rdi
callq 0x2070
leaq 0x38(%rsp), %rdi
callq 0x3238
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5927(%rip), %rdi      # 0x7ff0
leaq 0x2950(%rip), %rsi      # 0x5020
callq 0x21e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21e0
movq %rax, %rdi
callq 0x2110
pushq $-0x1
popq %rdi
callq 0x2240
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x2721
jmp 0x2714
jmp 0x2714
jmp 0x2714
jmp 0x2719
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x2100
jmp 0x271c
movq %rax, %rbx
jmp 0x2726
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x2100
leaq 0x38(%rsp), %rdi
callq 0x3238
movq %rbx, %rdi
callq 0x2350
// File: /workspace/github_cpp_makefile_star2_O2/superyuan[P]refeditor/MappingConvertor.cpp
// Function: mapExtendedChrome(GenomePosition&)
int mapExtendedChrome(GenomePosition &gp2)
{
    int target = gp2.pos+readLength/2; //the middle of the read, in case the read overlap with 2 mini chromosomes.
    if (chrMap[gp2.chrName] != NULL)
	{
		vector<posMap> *v = chrMap[gp2.chrName];
		int min=0;
		int max=v->size()-1;
		int middle = (min+max+1)/2;

		while(min != max) {
			if ((*v)[middle].from <= target) {
				min=middle;
			} else {
				max=middle-1;
			}
			middle = (min+max+1)/2;
		}
		int offset = 0;
		if ( (*v)[min].from <= target)
			offset = (*v)[min].from - (*v)[min].to;
		gp2.pos -= offset;
	}
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x5ddf(%rip), %eax      # 0x8524
pushq $0x2
popq %r14
cltd
idivl %r14d
movl %eax, %ebp
addl 0x20(%rdi), %ebp
leaq 0x5dcf(%rip), %rdi      # 0x8528
movq %rbx, %rsi
callq 0x31ae
cmpq $0x0, (%rax)
je 0x27cc
leaq 0x5dba(%rip), %rdi      # 0x8528
movq %rbx, %rsi
callq 0x31ae
movq (%rax), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
pushq $0xc
popq %rsi
cqto
idivq %rsi
leal -0x1(%rax), %edi
xorl %esi, %esi
cmpl %edi, %esi
je 0x27b1
cltd
idivl %r14d
cltq
imulq $0xc, %rax, %rdx
cmpl %ebp, (%rcx,%rdx)
cmovlel %eax, %esi
leal -0x1(%rax), %eax
cmovgl %eax, %edi
leal (%rdi,%rsi), %eax
incl %eax
jmp 0x2790
movslq %esi, %rax
imulq $0xc, %rax, %rsi
movl (%rcx,%rsi), %eax
xorl %edx, %edx
cmpl %ebp, %eax
jg 0x27c9
addq %rsi, %rcx
movl 0x8(%rcx), %edx
subl %eax, %edx
addl %edx, 0x20(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kuszmaul[P]6886/rdtsc.c
// Function: main
int main (int argc __attribute__((unused)), char *argv[] __attribute__((unused))) {
    struct timespec start, end;
    {
	int r = clock_gettime(CLOCK_MONOTONIC, &start);
	assert(r==0);
    }
    int N = 10000000;
    unsigned long long vv=0;
    for (int i=0; i<N; i++) {
	vv += rdtsc();
    }
    clock_gettime(CLOCK_MONOTONIC, &end);
    double tdiff = ((end.tv_sec-start.tv_sec)
		    + 1e-9*(end.tv_nsec-start.tv_nsec));
    printf("vv=%llu\n", vv);
    printf("Time %.6fs (%gns per call to clock_gettime(CLOCK_MONOTONIC,...)\n",
	   tdiff, 1e9*(tdiff/(double)N));
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x1030
testl %eax, %eax
jne 0x1212
movl $0x989680, %ecx         # imm = 0x989680
xorl %ebx, %ebx
subl $0x1, %ecx
jb 0x1194
rdtsc
movl %eax, %eax
shlq $0x20, %rdx
addq %rax, %rbx
addq %rdx, %rbx
jmp 0x117f
pushq $0x1
popq %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1030
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq 0x8(%rsp), %rax
cvtsi2sd %rax, %xmm0
subq 0x10(%rsp), %rcx
cvtsi2sd %rcx, %xmm1
mulsd 0xe41(%rip), %xmm1      # 0x2008
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
leaq 0xe6d(%rip), %rdi       # 0x2044
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
movsd (%rsp), %xmm0
movapd %xmm0, %xmm1
divsd 0xe1e(%rip), %xmm1      # 0x2010
mulsd 0xe1e(%rip), %xmm1      # 0x2018
leaq 0xe4c(%rip), %rdi       # 0x204d
movb $0x2, %al
callq 0x1040
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0xe07(%rip), %rdi       # 0x2020
leaq 0xe05(%rip), %rsi       # 0x2025
leaq 0xe06(%rip), %rcx       # 0x202d
pushq $0x12
popq %rdx
callq 0x1050
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/Image.h
// Function: Image::Image(char*)
Image::Image(char *type)
{
  if(!strcmp(type, "bw")) 
  {
    imgtype = "bw";
    channels = 1;
    cols = 512; //default
    rows = 512; //default
    imgdata = new unsigned char [cols*rows*channels];
  }
  else
  {
    imgtype = "color";
    channels = 3;
    cols = 512; //default
    rows = 512; //default
    imgdata = new unsigned char [cols*rows*channels];
  }
  
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x62, (%rsi)
jne 0x3f81
cmpb $0x77, 0x1(%rsi)
jne 0x3f81
cmpb $0x0, 0x2(%rsi)
je 0x3fb0
leaq 0xc740(%rip), %rax      # 0x106c8
movq %rax, (%rbx)
movl $0x3, 0x10(%rbx)
movabsq $0x20000000200, %rax    # imm = 0x20000000200
movq %rax, 0x8(%rbx)
movl $0xc0000, %edi          # imm = 0xC0000
callq 0x2030
movq %rax, 0x18(%rbx)
popq %rbx
retq
leaq 0xd6fd(%rip), %rax      # 0x116b4
movq %rax, (%rbx)
movl $0x1, 0x10(%rbx)
movabsq $0x20000000200, %rax    # imm = 0x20000000200
movq %rax, 0x8(%rbx)
movl $0x40000, %edi          # imm = 0x40000
jmp 0x3fa5
// File: /workspace/github_cpp_makefile_star2_O2/rishabh-battulwar[P]imageprocessing/./include/Image.h
// Function: Image::Image(char*, int, int)
Image::Image(char *type, int width, int height)
{
  if(!strcmp(type, "bw")) 
  {
    imgtype = "bw";
    channels = 1;
    cols = width; 
    rows = height;
    imgdata = new unsigned char [cols*rows*channels];
  }
  else
  {
    imgtype = "color";
    channels = 3;
    cols = width; 
    rows = height;
    imgdata = new unsigned char [cols*rows*channels];
  }

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x62, (%rsi)
jne 0x3feb
cmpb $0x77, 0x1(%rsi)
jne 0x3feb
cmpb $0x0, 0x2(%rsi)
je 0x4016
leaq 0xc6d6(%rip), %rax      # 0x106c8
movq %rax, (%rbx)
movl $0x3, 0x10(%rbx)
movl %edx, 0x8(%rbx)
movl %ecx, 0xc(%rbx)
imull %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movslq %ecx, %rdi
callq 0x2030
movq %rax, 0x18(%rbx)
popq %rbx
retq
leaq 0xd697(%rip), %rax      # 0x116b4
movq %rax, (%rbx)
movl $0x1, 0x10(%rbx)
movl %edx, 0x8(%rbx)
movl %ecx, 0xc(%rbx)
imull %edx, %ecx
jmp 0x4008