LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: init_dir_entry
void init_dir_entry(unsigned char *entry_datablock,
                    int self_inode_num,
                    int parent_inode_num)
{
    struct ext2_dir_entry *entry;
    // Build first entry for self "."
    entry = (struct ext2_dir_entry *)entry_datablock;
    entry->file_type    = EXT2_FT_DIR;
    entry->inode        = self_inode_num;
    entry->name[0]      = '.';
    entry->name_len     = 1;
    entry->rec_len      = 12;
    // Update self link count
    struct ext2_inode *self_inode = inode_table + (self_inode_num - 1);
    self_inode->i_links_count++;
    
    // Build second entry for parent ".."
    entry = (struct ext2_dir_entry *)(entry_datablock + 12);
    entry->file_type    = EXT2_FT_DIR;
    entry->inode        = parent_inode_num;
    entry->name[0]      = '.';
    entry->name[1]      = '.';
    entry->name_len     = 2;
    entry->rec_len      = EXT2_BLOCK_SIZE - 12;
    // Update parent link count
    struct ext2_inode *parent_inode = inode_table + (parent_inode_num - 1);
    parent_inode->i_links_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x2, 0x7(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movb $0x2e, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x6(%rax)
movq -0x18(%rbp), %rax
movw $0xc, 0x4(%rax)
leaq 0x43c0(%rip), %rax      # 0x60b8
movq (%rax), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movw 0x1a(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1a(%rax)
movq -0x8(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x2, 0x7(%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movb $0x2e, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x2e, 0x9(%rax)
movq -0x18(%rbp), %rax
movb $0x2, 0x6(%rax)
movq -0x18(%rbp), %rax
movw $0x3f4, 0x4(%rax)       # imm = 0x3F4
leaq 0x4353(%rip), %rax      # 0x60b8
movq (%rax), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movw 0x1a(%rax), %cx
addw $0x1, %cx
movw %cx, 0x1a(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: free_inode
void free_inode(int inode_num){
    struct ext2_inode *inode = inode_table +  inode_num - 1;
    int *inode_datablock_array = read_i_block_into_array(inode);
    
    // set del time
    inode->i_dtime = (unsigned int)time(NULL);
    
    // Mark bitmap as free
    
    int i = 0;
    while (inode_datablock_array[i] != -1) {
        dfree(inode_datablock_array[i]);
        i++;
    }
    if (i >= 12) { // free indirect block
        dfree(inode->i_block[12]);
    }
    
    // free inode
    ifree(inode_num);
    
    free(inode_datablock_array);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
leaq 0x3e86(%rip), %rax      # 0x60b8
movq (%rax), %rax
movslq -0x4(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
addq $-0x80, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x15b0
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpl $-0x1, (%rax,%rcx,4)
je 0x2297
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x2930
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x226e
cmpl $0xc, -0x1c(%rbp)
jl 0x22a9
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
callq 0x2930
movl -0x4(%rbp), %edi
callq 0x2880
movq -0x18(%rbp), %rdi
callq 0x1030
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: restore_inode_bitmap
int restore_inode_bitmap(int inode_num) {
    unsigned char *ptr;
    int in_which_byte;
    int off;
    
    in_which_byte = inode_num/8;
    if (inode_num%8) {
        in_which_byte++;
        off = inode_num%8;
    } else {
        off = 8;
    }
    
    
    ptr = inode_bitmap + (in_which_byte - 1);
    
    // check if in use
    if ((*ptr)>>(off - 1) & 1) {
        return -1;
    }
    
    // mark it back to used
    
    *ptr = *ptr | (1<<(off - 1));
    
    //update superblock and gdt
    gdt->bg_free_inodes_count--;
    sb->s_free_inodes_count--;
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x25fe
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
jmp 0x2605
movl $0x8, -0x18(%rbp)
leaq 0x3acc(%rip), %rax      # 0x60d8
movq (%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x263f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x268f
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x3a62(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xe(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xe(%rax)
leaq 0x3a44(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: restore_block_bitmap
int restore_block_bitmap(int block_num) {
    block_num++;
    
    unsigned char *ptr;
    int in_which_byte;
    int off;
    
    in_which_byte = block_num/8;
    if (block_num%8) {
        in_which_byte++;
        off = block_num%8;
    } else {
        off = 8;
    }
    
    
    ptr = block_bitmap + (in_which_byte - 1);
    
    // check if in use
    if ((*ptr)>>(off - 1) & 1) {
        return -1;
    }
    
    // mark it back to used
    
    *ptr = *ptr | (1<<(off - 1));
    
    //update superblock and gdt
    gdt->bg_free_blocks_count--;
    sb->s_free_blocks_count--;
    
    return 0;
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x26e7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
jmp 0x26ee
movl $0x8, -0x18(%rbp)
leaq 0x39db(%rip), %rax      # 0x60d0
movq (%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2728
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2778
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x3979(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xc(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xc(%rax)
leaq 0x395b(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: write_array_into_i_block
void write_array_into_i_block(struct ext2_inode *inode,
                              int *array,
                              int array_size)
{
    int num_block_written = 0;
    int i;
    
    for (i = 0; i < 12; i++) {
        inode->i_block[i] = array[i];
        num_block_written++;
        if (num_block_written == array_size) {
            return;
        }
    }
    
    // If reach here, write into indirect_block
    // allocate a space for indirect_block
    int indirect_block_num = dalloc();
    if (indirect_block_num < 0) {
        exit(ENOSPC);
    }
    inode->i_block[12] = indirect_block_num;
    inode->i_blocks += 2;
    
    // Since disk size is 128kb, only consider the cases that
    //      there is only one indirect block.
    unsigned int *indirect_block = (unsigned int *)(disk + EXT2_BLOCK_SIZE * inode->i_block[12]);
    for (i = 0; i < EXT2_BLOCK_SIZE/4; i++) {
        indirect_block[i] = array[12 + i];
        num_block_written++;
        if (num_block_written == array_size) {
            return;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xc, -0x1c(%rbp)
jge 0x27e1
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x28(%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x27d4
jmp 0x2878
jmp 0x27d6
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x27a1
callq 0x1ba0
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x27f9
movl $0x1c, %edi
callq 0x1120
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x1c(%rax)
leaq 0x3899(%rip), %rax      # 0x60b0
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x58(%rcx), %ecx
shll $0xa, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jge 0x2878
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0xc, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x286b
jmp 0x2878
jmp 0x286d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2834
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: ifree
void ifree(int inode_num) {
    unsigned char *ptr;
    int in_which_byte;
    int off;
    
    in_which_byte = inode_num/8;
    if (inode_num%8) {
        in_which_byte++;
        off = inode_num%8;
    } else {
        off = 8;
    }
    
    
    ptr = inode_bitmap + (in_which_byte - 1);
    *ptr = *ptr & ~(1<<(off - 1));
    
    //update superblock and gdt
    gdt->bg_free_inodes_count++;
    sb->s_free_inodes_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x28be
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
jmp 0x28c5
movl $0x8, -0x18(%rbp)
leaq 0x380c(%rip), %rax      # 0x60d8
movq (%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x37bf(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xe(%rax), %cx
addw $0x1, %cx
movw %cx, 0xe(%rax)
leaq 0x37a1(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: dfree
void dfree(int block_num) {
    block_num++;
    
    unsigned char *ptr;
    int in_which_byte;
    int off;
    
    in_which_byte = block_num/8;
    if (block_num%8) {
        in_which_byte++;
        off = block_num%8;
    } else {
        off = 8;
    }
    
    
    ptr = block_bitmap + in_which_byte - 1;
    *ptr = *ptr & ~(1<<(off - 1));
    
    //update superblock and gdt
    gdt->bg_free_blocks_count++;
    sb->s_free_blocks_count++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x2977
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x18(%rbp)
jmp 0x297e
movl $0x8, -0x18(%rbp)
leaq 0x374b(%rip), %rax      # 0x60d0
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
leaq 0x3707(%rip), %rax      # 0x60c8
movq (%rax), %rax
movw 0xc(%rax), %cx
addw $0x1, %cx
movw %cx, 0xc(%rax)
leaq 0x36e9(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: count_inode_bitmap
int count_inode_bitmap() {
    unsigned char *inode_bitmap_ptr;
    int curr_byte = 0;
    int vaild_byte_count = sb->s_inodes_count/8;
    int result = 0;
    int i;
    
    while (curr_byte < vaild_byte_count) {
        inode_bitmap_ptr = inode_bitmap + curr_byte;
        for (i = 0; i < 8; i++) {
            if (!(*inode_bitmap_ptr>>i & 1)) {
                result++;
            }
            
        }
        curr_byte++;
    }
    
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, -0xc(%rbp)
leaq 0x36be(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl (%rax), %eax
shrl $0x3, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x2a73
leaq 0x36b5(%rip), %rax      # 0x60d8
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x2a68
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x2a5b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2a5d
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2a38
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2a14
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: count_block_bitmap
int count_block_bitmap() {
    unsigned char *block_bitmap_ptr;
    int curr_byte = 0;
    int vaild_byte_count = sb->s_blocks_count/8;
    int result = 0;
    int i;
    
    while (curr_byte < vaild_byte_count) {
        block_bitmap_ptr = block_bitmap + curr_byte;
        for (i = 0; i < 8; i++) {
            if (!(*block_bitmap_ptr>>i & 1)){
                result++;
            }
            
        }
        curr_byte++;
    }
    
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, -0xc(%rbp)
leaq 0x362e(%rip), %rax      # 0x60c0
movq (%rax), %rax
movl 0x4(%rax), %eax
shrl $0x3, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x2b04
leaq 0x361c(%rip), %rax      # 0x60d0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jge 0x2af9
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl -0x18(%rbp), %ecx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x2aec
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2aee
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2ac9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2aa5
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: cut_path
void cut_path(char *path,
              char *parent,
              char *name)
{
    int i;
    // Find out the index of the last '/' in path;
    int last_slash_index = 0;
    for (i = 0; i < strlen(path); i++) {
        if (path[i] == '/') {
            last_slash_index = i;
        }
    }
    // Set parent path
    if (last_slash_index == 0) {
        parent[0] = '/';
        parent[1] = '\0';
    } else {
        memcpy(parent, path, last_slash_index);
        parent[last_slash_index] = '\0';
    }
    // Set name
    strncpy(name, path + last_slash_index + 1, EXT2_NAME_LEN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1070
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x2bd3
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x2bc6
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x2bc8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2b92
cmpl $0x0, -0x20(%rbp)
jne 0x2bea
movq -0x10(%rbp), %rax
movb $0x2f, (%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x1(%rax)
jmp 0x2c07
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movslq -0x20(%rbp), %rdx
callq 0x10d0
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movslq -0x20(%rbp), %rax
addq %rax, %rsi
addq $0x1, %rsi
movl $0xff, %edx
callq 0x1040
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: copy_to_inode_datablock
int copy_to_inode_datablock(struct ext2_inode *dst_file_inode,
                            unsigned char *src_file,
                            int src_size)
{
    // allocate datablock space for cpy_file
    int dst_file_i_block_array_size = src_size/EXT2_BLOCK_SIZE;
    if (src_size%EXT2_BLOCK_SIZE) {
        dst_file_i_block_array_size++;
    }
    dst_file_inode->i_blocks = dst_file_i_block_array_size * 2; // set inode->blocks
    int *dst_file_i_block_array = malloc(sizeof(int) * dst_file_i_block_array_size);
    int i;
    for (i = 0; i < dst_file_i_block_array_size; i++) {
        dst_file_i_block_array[i] = dalloc();
        if (dst_file_i_block_array[i] < 0) {
            return ENOSPC;
        }
    }
    write_array_into_i_block(dst_file_inode, dst_file_i_block_array, dst_file_i_block_array_size);
    // do copy
    i = 0;
    while (i < dst_file_i_block_array_size) {
        unsigned char *src = src_file + EXT2_BLOCK_SIZE * i;
        unsigned char *dst = disk + EXT2_BLOCK_SIZE * dst_file_i_block_array[i];
        memcpy(dst, src, EXT2_BLOCK_SIZE);
        i++;
    }
    
    free(dst_file_i_block_array);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
movl $0x400, %ecx            # imm = 0x400
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x2c6a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %ecx
shll %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movslq -0x20(%rbp), %rdi
shlq $0x2, %rdi
callq 0x10f0
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2ccf
callq 0x1ba0
movl %eax, %edx
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jge 0x2cc2
movl $0x1c, -0x4(%rbp)
jmp 0x2d51
jmp 0x2cc4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2c8e
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0x2780
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x2d41
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
shll $0xa, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
leaq 0x33a7(%rip), %rax      # 0x60b0
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shll $0xa, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x10d0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2ce6
movq -0x28(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carben-dev[P]ext2fs-simple-utilities/ext2_utils.c
// Function: new_inode
int new_inode(unsigned short type,
              unsigned int size){
    // allocate space in inode table
    int new_inode_num = ialloc();
    if (new_inode_num < 0) {
        return ENOSPC;
    }
    struct ext2_inode *new_inode = inode_table + (new_inode_num - 1);
    
    // build dst file inode
    new_inode->i_mode           = 0x0000 | type;
    new_inode->i_uid            = 0;
    new_inode->i_size           = size;
    new_inode->i_ctime          = 0;
    new_inode->i_mtime          = 0;
    new_inode->i_dtime          = 0;
    new_inode->i_gid            = 0;
    new_inode->i_links_count    = 0;
    new_inode->i_blocks         = 0;
    new_inode->i_flags          = 0;
    // block[15]
    new_inode->osd1             = 0;
    new_inode->i_generation     = 0;
    new_inode->i_file_acl       = 0;
    new_inode->i_dir_acl        = 0;
    // padding
    memset(new_inode->extra, 0, 3);
    
    return new_inode_num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %di, %ax
movw %ax, -0x6(%rbp)
movl %esi, -0xc(%rbp)
callq 0x1a90
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x2d8c
movl $0x1c, -0x4(%rbp)
jmp 0x2e60
leaq 0x3325(%rip), %rax      # 0x60b8
movq (%rax), %rax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movzwl -0x6(%rbp), %eax
orl $0x0, %eax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movq -0x18(%rbp), %rax
movw $0x0, 0x2(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rax
movw $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movw $0x0, 0x1a(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x64(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x68(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x6c(%rax)
movq -0x18(%rbp), %rdi
addq $0x74, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x10b0
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::shuffle()
void Genome::shuffle() {
	uniform_int_distribution<size_t> distribution(0, this->haplotypes.size() - 1);

	this->maxIterations = this->haplotypes[0].size() * 100;

	if (this->initialized) {
		auto ploidy = this->haplotypes.size();
		auto length = this->haplotypes[0].size();
		this->haplotypes.clear();
		this->haplotypes = vector<Haplotype>(ploidy, Haplotype(length, ploidy));
	}

	for (auto& r : this->file.reads) {
		this->haplotypes[distribution(this->randomEngine)].add(&r);
	}

	this->initialized = true;

	// for (auto& ch : this->haplotypes) {
	// 	cout << ch << endl;
	// }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x178(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rdx
subq $0x1, %rdx
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5b30
movq -0x178(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
xorl %eax, %eax
movl %eax, %esi
callq 0x5b10
movq %rax, %rdi
callq 0x10860
movq %rax, %rcx
movq -0x178(%rbp), %rax
imulq $0x64, %rcx, %rcx
movq %rcx, 0x3bd8(%rax)
testb $0x1, 0x37c0(%rax)
je 0x2cb1
movq -0x178(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movq %rdi, -0x198(%rbp)
callq 0x5ae0
movq -0x198(%rbp), %rdi
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x5b10
movq %rax, %rdi
callq 0x10860
movq -0x198(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x5b60
movq -0x20(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x28(%rbp), %rsi
movl %eax, %edx
leaq -0x138(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x101e0
leaq -0x139(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x58d0
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdx
movq -0x180(%rbp), %rcx
leaq -0x40(%rbp), %rdi
callq 0x58f0
jmp 0x2c48
movq -0x178(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
leaq -0x40(%rbp), %rsi
callq 0x5970
leaq -0x40(%rbp), %rdi
callq 0x59a0
leaq -0x139(%rbp), %rdi
callq 0x5a00
leaq -0x138(%rbp), %rdi
callq 0x10740
jmp 0x2cb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x148(%rbp)
movl %eax, -0x14c(%rbp)
leaq -0x139(%rbp), %rdi
callq 0x5a00
leaq -0x138(%rbp), %rdi
callq 0x10740
jmp 0x2d85
movq -0x178(%rbp), %rax
addq $0x2380, %rax           # imm = 0x2380
addq $0x58, %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rdi
callq 0x5b80
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rdi
callq 0x5bb0
movq %rax, -0x168(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x5be0
testb $0x1, %al
jne 0x2d08
jmp 0x2d6e
leaq -0x160(%rbp), %rdi
callq 0x5c20
movq -0x178(%rbp), %rsi
movq %rax, -0x170(%rbp)
movq %rsi, %rax
addq $0x2368, %rax           # imm = 0x2368
movq %rax, -0x1a0(%rbp)
addq $0x2438, %rsi           # imm = 0x2438
leaq -0x18(%rbp), %rdi
callq 0x5c40
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0x5b10
movq %rax, %rdi
movq -0x170(%rbp), %rsi
callq 0x10f90
leaq -0x160(%rbp), %rdi
callq 0x5c70
jmp 0x2cef
movq -0x178(%rbp), %rax
movb $0x1, 0x37c0(%rax)
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x148(%rbp), %rdi
callq 0x2410
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::mec()
dnaweight_t Genome::mec() {
	dnaweight_t out = 0;
	for (size_t i = 0; i < haplotypes.size(); i++) {
		out = out + haplotypes[i].mec();
	}

	return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x2e7d
movq -0x20(%rbp), %rdi
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
movq -0x18(%rbp), %rsi
callq 0x5b10
movq %rax, %rdi
callq 0x108a0
movaps %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2e14
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::windowMEC()
dnaweight_t Genome::windowMEC() { 
	dnaweight_t out = 0;
	for (size_t i = 0; i < haplotypes.size(); i++) {
		assert(haplotypes[i].windowMec()>=0);
		out += haplotypes[i].windowMec();
		assert(out>=0);
	}
	return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x2f8a
movq -0x20(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movq -0x18(%rbp), %rsi
callq 0x5b10
movq %rax, %rdi
callq 0x10ac0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2f03
jmp 0x2f22
leaq 0x19234(%rip), %rdi     # 0x1c13e
leaq 0x1924a(%rip), %rsi     # 0x1c15b
movl $0x4c, %edx
leaq 0x1924d(%rip), %rcx     # 0x1c16a
callq 0x2180
movq -0x20(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movq -0x18(%rbp), %rsi
callq 0x5b10
movq %rax, %rdi
callq 0x10ac0
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x2f58
jmp 0x2f77
leaq 0x19232(%rip), %rdi     # 0x1c191
leaq 0x191f5(%rip), %rsi     # 0x1c15b
movl $0x4e, %edx
leaq 0x191f8(%rip), %rcx     # 0x1c16a
callq 0x2180
jmp 0x2f79
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2eb4
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::meanCoverage()
double Genome::meanCoverage() {
    double coverage = 0;
    for (size_t i = 0; i < haplotypes.size(); i++)
		coverage += this->haplotypes[i].meanCoverage();
    return coverage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x30dc
movq -0x20(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movq -0x18(%rbp), %rsi
callq 0x5b10
movq %rax, %rdi
callq 0x107a0
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3084
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::windowTotalCoverage()
double Genome::windowTotalCoverage() {
	double coverage = 0;
	for (size_t i = 0; i < this->haplotypes.size(); i++)
		coverage += this->haplotypes[i].windowTotalCoverage();
	return coverage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x2368, %rdi           # imm = 0x2368
callq 0x5ae0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x316c
movq -0x20(%rbp), %rdi
addq $0x2368, %rdi           # imm = 0x2368
movq -0x18(%rbp), %rsi
callq 0x5b10
movq %rax, %rdi
callq 0x10e30
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3114
movsd -0x10(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::acceptance(double, double)
double Genome::acceptance(double newScore, double curScore) {
	if (newScore < curScore) return 1;
	if (this->t == 0) return 0;
	double energyDiff = curScore - newScore;
	// cout << "Acceptance(" << energyDiff << ") = " << exp(energyDiff / this->t) << endl;

	// cout << "newScore: " << newScore << ", energyDiff: " << energyDiff << ", acceptance: " << exp(energyDiff / this->t) << endl;
	return exp(energyDiff / this->t);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x331d
movsd 0x18d2a(%rip), %xmm0    # 0x1c040
movsd %xmm0, -0x8(%rbp)
jmp 0x3368
movq -0x30(%rbp), %rax
movsd 0x3bc0(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x333e
jp 0x333e
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x3368
movq -0x30(%rbp), %rax
movsd -0x20(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
divsd 0x3bc0(%rax), %xmm0
callq 0x2420
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::setParameters(double, double, unsigned long long)
void Genome::setParameters(double tInitial, double tEnd, iteration_t maxIterations) {
	if (this->curIteration) {
		// Probably warn the user in some way that the simulation is in process
	}

	this->tInitial = tInitial;
	// this->tEnd = tEnd;
	this->tDecay = -log(tEnd / this->tInitial);
	this->maxIterations = maxIterations;

	cout << "decay is " << this->tDecay << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x3be0(%rax)
je 0x33de
jmp 0x33de
movq -0x28(%rbp), %rax
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0x3bc8(%rax)
movsd -0x18(%rbp), %xmm0
divsd 0x3bc8(%rax), %xmm0
callq 0x21e0
movq -0x28(%rbp), %rax
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
movsd %xmm0, 0x3bd0(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x3bd8(%rax)
movq 0x27b92(%rip), %rdi     # 0x2afc8
leaq 0x18d5b(%rip), %rsi     # 0x1c198
callq 0x2230
movq %rax, %rdi
movq -0x28(%rbp), %rax
movsd 0x3bd0(%rax), %xmm0
callq 0x2460
movq %rax, %rdi
movq 0x27b50(%rip), %rsi     # 0x2afb0
callq 0x2270
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::iteration()
void Genome::iteration() {
	auto oldScore = this->windowMec();
	// FIXME: these lines recomputes ALL the sites?? It should only incrementally compute the old and new scores at the sites touched by this read! Inefficient!
	this->move();
	auto newScore = this->windowMec();

	uniform_real_distribution<double> distribution(0, 1);
	double chanceToKeep = this->acceptance(newScore, oldScore);
	double randomIndex = distribution(this->randomEngine);

	bool isGood = newScore < oldScore;
	bool accept = randomIndex <= chanceToKeep;
	assert(!isGood || accept);

	if (isGood) {
		// always accept
	} else if (!accept) {
		// reject
		this->revertMove();
	}

	this->fAccept.record(isGood);

	if (!(isGood || oldScore == newScore)) {
		this->totalBad++;
		if (accept) {
			this->totalBadAccepted++;
		}
		this->pBad.record(chanceToKeep);
	}

#if 0
	uniform_real_distribution<double> d(0, 3);
	if (d(this->randomEngine) <= 1) {
		this->pBad.record(false);
	} else {
		this->pBad.record(true);
	}
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x3180
movq -0x48(%rbp), %rdi
movsd %xmm0, -0x10(%rbp)
callq 0x3490
movq -0x48(%rbp), %rdi
callq 0x3180
movsd %xmm0, -0x18(%rbp)
leaq -0x28(%rbp), %rdi
xorps %xmm0, %xmm0
movsd 0x188fc(%rip), %xmm1    # 0x1c040
callq 0x5c90
movq -0x48(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
callq 0x32e0
movq -0x48(%rbp), %rsi
movsd %xmm0, -0x30(%rbp)
addq $0x2438, %rsi           # imm = 0x2438
leaq -0x28(%rbp), %rdi
callq 0x5cc0
movsd %xmm0, -0x38(%rbp)
movsd -0x18(%rbp), %xmm1
movsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, -0x39(%rbp)
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
setae %al
andb $0x1, %al
movb %al, -0x3a(%rbp)
movb $0x1, %al
testb $0x1, -0x39(%rbp)
movb %al, -0x3b(%rbp)
je 0x37b7
movb -0x3a(%rbp), %al
movb %al, -0x3b(%rbp)
movb -0x3b(%rbp), %al
testb $0x1, %al
jne 0x37c0
jmp 0x37c2
jmp 0x37e1
leaq 0x18a1e(%rip), %rdi     # 0x1c1e7
leaq 0x1898b(%rip), %rsi     # 0x1c15b
movl $0x119, %edx            # imm = 0x119
leaq 0x18a1d(%rip), %rcx     # 0x1c1f9
callq 0x2180
testb $0x1, -0x39(%rbp)
je 0x37e9
jmp 0x37fa
testb $0x1, -0x3a(%rbp)
jne 0x37f8
movq -0x48(%rbp), %rdi
callq 0x3680
jmp 0x37fa
movq -0x48(%rbp), %rdi
movb -0x39(%rbp), %al
andb $0x1, %al
movsbl %al, %esi
callq 0x3870
testb $0x1, -0x39(%rbp)
jne 0x3862
movsd -0x10(%rbp), %xmm0
ucomisd -0x18(%rbp), %xmm0
jne 0x3821
jp 0x3821
jmp 0x3862
movq -0x48(%rbp), %rax
movl 0x2360(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2360(%rax)
testb $0x1, -0x3a(%rbp)
je 0x384d
movq -0x48(%rbp), %rax
movl 0x2364(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2364(%rax)
movq -0x48(%rbp), %rdi
addq $0x408, %rdi            # imm = 0x408
movsd -0x30(%rbp), %xmm0
callq 0x3980
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::AcceptBuffer::record(char)
void Genome::AcceptBuffer::record(char good) {
	size_t next = this->pos == LENGTH - 1 ? 0 : this->pos + 1;
	assert(good == 0 || good == 1);
	if (this->len == LENGTH) {
		this->sum -= this->buffer[next]; // the next one is the first one
	} else {
		this->len++;
	}
	this->pos = next;
	this->buffer[next] = good;
	this->sum += good;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x3e7, 0x3f0(%rax) # imm = 0x3E7
jne 0x389f
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x38b2
movq -0x20(%rbp), %rax
movq 0x3f0(%rax), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movsbl -0x9(%rbp), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x38d5
movsbl -0x9(%rbp), %eax
cmpl $0x1, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x38de
jmp 0x38e0
jmp 0x38ff
leaq 0x18c0b(%rip), %rdi     # 0x1c4f2
leaq 0x1886d(%rip), %rsi     # 0x1c15b
movl $0x201, %edx            # imm = 0x201
leaq 0x18c0f(%rip), %rcx     # 0x1c509
callq 0x2180
movq -0x20(%rbp), %rax
cmpq $0x3e8, 0x3e8(%rax) # imm = 0x3E8
jne 0x392c
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %edx
movl 0x3f8(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x3f8(%rax)
jmp 0x3942
movq -0x20(%rbp), %rax
movq 0x3e8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x3e8(%rax)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x3f0(%rax)
movb -0x9(%rbp), %dl
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movsbl -0x9(%rbp), %ecx
addl 0x3f8(%rax), %ecx
movl %ecx, 0x3f8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::PbadBuffer::record(double)
void Genome::PbadBuffer::record(double acceptance) {
	size_t next = this->pos == LENGTH - 1 ? 0 : this->pos + 1;
	assert(acceptance >= 0.0 && acceptance <= 1.0);
	if (this->len == LENGTH) {
		this->sum -= this->buffer[next]; // the next one is the first one
	} else {
		this->len++;
	}
	this->pos = next;
	this->buffer[next] = acceptance;
	this->sum += acceptance;
	if(this->sum < 0) this->sum = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x3e7, 0x1f48(%rax) # imm = 0x3E7
jne 0x39ae
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x39c1
movq -0x20(%rbp), %rax
movq 0x1f48(%rax), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movb %al, -0x29(%rbp)
jb 0x39ef
movsd 0x1865c(%rip), %xmm0    # 0x1c040
ucomisd -0x10(%rbp), %xmm0
setae %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x39f8
jmp 0x39fa
jmp 0x3a19
leaq 0x18a9b(%rip), %rdi     # 0x1c49c
leaq 0x18753(%rip), %rsi     # 0x1c15b
movl $0x1ee, %edx            # imm = 0x1EE
leaq 0x18aaf(%rip), %rcx     # 0x1c4c3
callq 0x2180
movq -0x20(%rbp), %rax
cmpq $0x3e8, 0x1f40(%rax) # imm = 0x3E8
jne 0x3a4d
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x1f50(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x1f50(%rax)
jmp 0x3a63
movq -0x20(%rbp), %rax
movq 0x1f40(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x1f40(%rax)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x1f48(%rax)
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x10(%rbp), %xmm0
addsd 0x1f50(%rax), %xmm0
movsd %xmm0, 0x1f50(%rax)
xorps %xmm0, %xmm0
ucomisd 0x1f50(%rax), %xmm0
jbe 0x3ab1
movq -0x20(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x1f50(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::getTemperature(unsigned long long)
double Genome::getTemperature(iteration_t iteration) {
	double s = iteration / (double)this->maxIterations;
	double temp = (double)this->tInitial * exp(-this->tDecay * s);

	// cout << iteration << ": " << temp << endl;
	return temp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %xmm0
movaps 0x18530(%rip), %xmm3    # 0x1c010
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x18534(%rip), %xmm2    # 0x1c020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x3bd8(%rax), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x3bc8(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x3bd0(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd -0x18(%rbp), %xmm0
callq 0x2420
movaps %xmm0, %xmm1
movsd -0x28(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::ResetBuffers()
void Genome::ResetBuffers() {
    for (iteration_t i = 0; i < this->fAccept.LENGTH; ++i) this->fAccept.buffer[i]=0;
    for (iteration_t i = 0; i < this->pBad.LENGTH; ++i) this->pBad.buffer[i]=0;
    this->pBad.len = this->fAccept.len = 0;
    this->pBad.pos = this->fAccept.pos = 0;
    this->pBad.sum = this->fAccept.sum = 0;
    this->totalBad = 0;
    this->totalBadAccepted = this->totalGood = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x3e8, -0x10(%rbp)     # imm = 0x3E8
jae 0x3c1c
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3bf8
movq $0x0, -0x18(%rbp)
cmpq $0x3e8, -0x18(%rbp)     # imm = 0x3E8
jae 0x3c50
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, 0x408(%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3c24
movq -0x20(%rbp), %rax
movq $0x0, 0x3e8(%rax)
movq $0x0, 0x2348(%rax)
movq $0x0, 0x3f0(%rax)
movq $0x0, 0x2350(%rax)
movl $0x0, 0x3f8(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2358(%rax)
movl $0x0, 0x2360(%rax)
movl $0x0, 0x400(%rax)
movl $0x0, 0x2364(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::createBlocks()
void Genome::createBlocks() {
	for (Read r : file.reads) {
		if (blocks.empty() || !intersects(blocks.back(), r.range))
			blocks.push_back(r.range);
		else
			blocks.back() = combineBlocks(blocks.back(), r.range);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
addq $0x2380, %rax           # imm = 0x2380
addq $0x58, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5b80
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5bb0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5be0
testb $0x1, %al
jne 0x49c8
jmp 0x4b39
leaq -0x18(%rbp), %rdi
callq 0x5c20
movq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x5eb0
movq -0xb8(%rbp), %rdi
addq $0x3c30, %rdi           # imm = 0x3C30
callq 0x5f00
testb $0x1, %al
jne 0x4a46
movq -0xb8(%rbp), %rdi
addq $0x3c30, %rdi           # imm = 0x3C30
callq 0x5f40
movq -0xb8(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0x60(%rbp)
movups -0x30(%rbp), %xmm0
movaps %xmm0, -0x70(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %r8
callq 0x4b50
movb %al, -0xb9(%rbp)
jmp 0x4a3a
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x4a7e
jmp 0x4a46
movq -0xb8(%rbp), %rdi
addq $0x3c30, %rdi           # imm = 0x3C30
leaq -0x30(%rbp), %rsi
callq 0x5f80
jmp 0x4a5f
jmp 0x4b22
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5ff0
jmp 0x4b42
movq -0xb8(%rbp), %rdi
addq $0x3c30, %rdi           # imm = 0x3C30
callq 0x5f40
movq -0xb8(%rbp), %rdi
movups (%rax), %xmm0
movaps %xmm0, -0xa0(%rbp)
movups -0x30(%rbp), %xmm0
movaps %xmm0, -0xb0(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movq -0xa8(%rbp), %r8
callq 0x4bb0
movq %rdx, -0xd0(%rbp)
movq %rax, -0xc8(%rbp)
jmp 0x4ade
movq -0xb8(%rbp), %rdi
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, -0x90(%rbp)
movq %rax, -0x88(%rbp)
addq $0x3c30, %rdi           # imm = 0x3C30
callq 0x5f40
movq -0x90(%rbp), %rcx
movq %rcx, (%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq -0x50(%rbp), %rdi
callq 0x5ff0
leaq -0x18(%rbp), %rdi
callq 0x5c70
jmp 0x49b2
addq $0xd0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x2410
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/waynebhayes[P]SAHap/src/Genome.cpp
// Function: SAHap::Genome::combineBlocks(SAHap::Range, SAHap::Range)
Range Genome::combineBlocks(Range a, Range b) {
	Range ret;
	ret.start = min(a.start, b.start);
	ret.end = max(a.end, b.end);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x20(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x30(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %r8, -0x28(%rbp)
movq %rdi, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x5770
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6010
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq (%rax), %rax
movq %rax, -0x10(%rbp)
callq 0x6050
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)