LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/minisearch.cpp
// Function: get_number_of_digits(int)
unsigned int get_number_of_digits(int num)
{
    if (num == 0)
    {
        return 1;
    }
    else
    {
        return floor(log10(abs(num))) + 1;   //https://stackoverflow.com/questions/3068397/finding-the-length-of-an-integer-in-c
    }
}

// Assembly:
testl %edi, %edi
je 0x325f
pushq %rax
movl %edi, %eax
negl %eax
cmovsl %edi, %eax
cvtsi2sd %eax, %xmm0
callq 0x2070
callq 0x2230
addsd 0x1fab(%rip), %xmm0     # 0x5200
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
retq
movl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/minisearch.cpp
// Function: init_newline(unsigned int, unsigned int&)
void init_newline(unsigned int init_llen, unsigned int & curr_llen)
{//go to new line and set cursor to the correct spot for printing
    cout<<endl;
    curr_llen = init_llen;
    for(unsigned int i = 0; i < init_llen; i++)
    {
        cout<<" ";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
movq 0x4ba2(%rip), %r15      # 0x7fd0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movl %ebx, (%r14)
testl %ebx, %ebx
je 0x347e
movq 0x4b6d(%rip), %r14      # 0x7fd0
leaq 0x20b7(%rip), %r15      # 0x5521
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2120
decl %ebx
jne 0x346a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/minisearch.cpp
// Function: manage_whitespace(char*, unsigned int, unsigned int, unsigned int&, int**, int&)
bool manage_whitespace(char * rest_line, unsigned int lwidth, unsigned int init_llen, unsigned int & curr_llen,
                       int ** underline_info, int & underline_info_size)
{
    unsigned int whitespace = calc_whitespace(rest_line); //calculate the whitespace from the beginning of the rest content
    if (whitespace == 0)
    {//the whole rest content is whitespace
        if (underline_info_size > 0)
        {//if there are some words to be underlined
            underline(init_llen, curr_llen, underline_info, underline_info_size, 1);
        }

        return 1;  //send stop signal
    }
    else
    {
        for(unsigned int i = 0; i < whitespace; i++)
        {//print whitespace space by space
            if ((curr_llen + 1) > lwidth)
            {// if there is no free space left in terminal's line
                if (underline_info_size > 0)
                {
                    underline(init_llen, curr_llen, underline_info, underline_info_size, 0);
                }
                else
                {
                    init_newline(init_llen, curr_llen);
                }
            }

            curr_llen++;
            cout<<" ";
        }

        return 0;  //keep printing
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, 0x10(%rsp)
movq %rcx, %r15
movl %edx, 0x8(%rsp)
movl %esi, %r13d
callq 0x3265
testl %eax, %eax
movl %eax, 0xc(%rsp)
je 0x3510
movq 0x4b18(%rip), %rbp      # 0x7fd0
leaq 0x2062(%rip), %r14      # 0x5521
movl %eax, %r12d
movl (%r15), %eax
incl %eax
cmpl %r13d, %eax
jbe 0x34f6
cmpl $0x0, (%rbx)
jle 0x34ea
movl 0x8(%rsp), %edi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x32a0
jmp 0x34f6
movl 0x8(%rsp), %edi
movq %r15, %rsi
callq 0x341d
incl (%r15)
movl $0x1, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2120
decl %r12d
jne 0x34c2
jmp 0x352f
cmpl $0x0, (%rbx)
jle 0x352f
movl 0x8(%rsp), %edi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x32a0
cmpl $0x0, 0xc(%rsp)
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/minisearch.cpp
// Function: reallocate_underline_info(int**, unsigned int, unsigned int, unsigned int)
int ** reallocate_underline_info(int ** underline_info, unsigned int underline_info_size, unsigned int ul_start, unsigned int ul_end)
{
    underline_info = (int **) realloc(underline_info, underline_info_size * sizeof(int *));
    underline_info[underline_info_size - 2] = (int *) malloc(sizeof(int));
    underline_info[underline_info_size - 1] = (int *) malloc(sizeof(int));
    *underline_info[underline_info_size - 2] = ul_start;
    *underline_info[underline_info_size - 1] = ul_end;
    return underline_info;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movl %esi, %esi
shlq $0x3, %rsi
callq 0x2220
movq %rax, %r15
movl $0x4, %edi
callq 0x2170
movq %rax, %r12
leal -0x2(%r14), %eax
movq %r12, (%r15,%rax,8)
movl $0x4, %edi
callq 0x2170
decl %r14d
movq %rax, (%r15,%r14,8)
movl %ebp, (%r12)
movl %ebx, (%rax)
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/minisearch.cpp
// Function: search_doc_word_into_queries(char*, char**, unsigned int)
bool search_doc_word_into_queries(char * doc_word, char ** queries, unsigned int nqs)
{//returns 1 if doc_word is contained in queries and 0 otherwise
    for(unsigned int i = 1; i <= nqs; i++)
    {
        if (strcmp(queries[i], doc_word) == 0)
        {
            return 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edx, %edx
setne %bpl
je 0x382b
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rsi), %rdi
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x382b
movl $0x2, %r12d
cmpl %ebx, %r12d
setbe %bpl
ja 0x382b
movl %r12d, %eax
movq (%r14,%rax,8), %rdi
movq %r15, %rsi
callq 0x2190
incl %r12d
testl %eax, %eax
jne 0x380c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/trie.cpp
// Function: my_trie::destroy(my_trie::node*)
void my_trie::destroy(node * n)
{
    if (n != NULL)
    {
        destroy(n->down);
        destroy(n->right);
        if(n->pl_ptr != NULL)
        { //delete node's posting list before deleting the node itself
            delete n->pl_ptr;
        }
        delete n;
        trie_size--;
    }
}

// Assembly:
testq %rsi, %rsi
je 0x4151
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rsi
callq 0x40fa
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x40fa
movq 0x18(%r14), %r15
testq %r15, %r15
je 0x413d
movq %r15, %rdi
callq 0x4678
movl $0x18, %esi
movq %r15, %rdi
callq 0x2110
movl $0x20, %esi
movq %r14, %rdi
callq 0x2110
decl (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/trie.cpp
// Function: my_trie::create_node(char)
my_trie::node * my_trie::create_node(char ch)
{
    node * new_node = new node;
    new_node->ch = ch;
    new_node->down = NULL;
    new_node->right = NULL;
    new_node->pl_ptr = NULL;
    return new_node;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl $0x20, %edi
callq 0x2100
movb %bl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/trie.cpp
// Function: my_trie::print(bool)
void my_trie::print(bool full_print)
{
    if(first == NULL)
    {
        cout<<"-> Trie cannot be printed because it is empty !"<<endl;
        return;
    }

    if(full_print == 1)
    {
        cout<<"-----> Printing whole trie <-----"<<endl;
    }
    else
    {
        cout<<"---> Printing document frequency vector <---"<<endl;
    }

    print_subtrie(first, full_print); //print trie recursively starting from the root
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x8(%rdi)
je 0x431e
movl %esi, %ebp
movq %rdi, %rbx
movq 0x3cc5(%rip), %rdi      # 0x7fd0
testb %bpl, %bpl
je 0x4364
leaq 0x1199(%rip), %rsi      # 0x54b0
movl $0x21, %edx
jmp 0x4370
movq 0x3cab(%rip), %rbx      # 0x7fd0
leaq 0x1154(%rip), %rsi      # 0x5480
movl $0x2f, %edx
movq %rbx, %rdi
callq 0x2120
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20a0
leaq 0x1167(%rip), %rsi      # 0x54d2
movl $0x2c, %edx
callq 0x2120
movq 0x3c54(%rip), %r14      # 0x7fd0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq 0x8(%rbx), %rsi
movzbl %bpl, %edx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x43b8
nop
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/trie.cpp
// Function: my_trie::print_subtrie(my_trie::node*, bool)
void my_trie::print_subtrie(node * n, bool full_print)
{
    if (n != NULL)
    {
        if(n->pl_ptr != NULL)
        {
            n->pl_ptr->print(full_print);
        }
        print_subtrie(n->down, full_print);
        print_subtrie(n->right, full_print);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzbl %dl, %ebp
testq %rbx, %rbx
je 0x43ee
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x43da
movl %ebp, %esi
callq 0x447e
movq 0x10(%rbx), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x43b8
movq 0x8(%rbx), %rbx
jmp 0x43c5
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/trie.cpp
// Function: my_trie::search_word(char const*)
posting_list * my_trie::search_word(const char * query)
{ //if word exists in the trie return its posting list or NULL otherwise
    node * start_node = first;
    node * last_char_node = NULL;

    for(unsigned int i = 0; i < strlen(query); i++)
    { //iterating query word letter by letter
        node * temp = start_node;

        while(1)
        {
            if (temp == NULL) //we have interated the whole orizontal list and a query word's letter does not exist,
                              // therefore the whole word does not exist
            {
                return NULL;  //query not found
            }

            if(temp->ch == query[i])
            {// a query word's letter has been found so keep searching downwards
                last_char_node = temp;
                start_node = temp->down;
                break;
            }
            else if(temp->ch > query[i])
            {//stop searching. orizontal list is sorted alphabetically
                return NULL;  // query not found
            }
            else
            {//keep iterating the orizontal list
                temp = temp->right;
            }
        }
    }

    return last_char_node->pl_ptr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2050
xorl %edx, %edx
testq %rax, %rax
setne %cl
je 0x4455
movq 0x8(%r14), %rdi
xorl %esi, %esi
testq %rdi, %rdi
je 0x4435
movb (%rbx,%rdx), %r8b
movq %rdi, %r9
movb (%r9), %r10b
cmpb %r8b, %r10b
je 0x443a
jg 0x4435
movq 0x8(%r9), %r9
testq %r9, %r9
jne 0x4422
xorl %r8d, %r8d
jmp 0x4444
movq 0x10(%r9), %rdi
movb $0x1, %r8b
movq %r9, %rsi
testb %r8b, %r8b
je 0x4457
incl %edx
cmpq %rdx, %rax
seta %cl
ja 0x4416
jmp 0x4457
xorl %esi, %esi
testb $0x1, %cl
je 0x4460
xorl %eax, %eax
jmp 0x4464
movq 0x18(%rsi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/posting_list.cpp
// Function: posting_list::print(bool)
void posting_list::print(bool full_print)
{
    if (full_print == 0) //only print df
    {
        cout<<word<<"  "<<pl_size<<endl;
        return;
    }

    node * temp = first;
    if (first == NULL)
    {
        cout<<"Posting list is empty"<<endl;
        return;
    }

    cout<<"-> word:'"<<word<<"'  "<<pl_size<<"  ";

    while(temp != NULL) //print whole posting list
    {
        cout<<"["<<temp->doc_id<<", "<<temp->freq<<"]"<<"  ";
        temp = temp->next;
    }

    cout<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
testl %esi, %esi
je 0x44e2
movq 0x8(%r12), %r14
movq 0x3b34(%rip), %rbx      # 0x7fd0
testq %r14, %r14
je 0x4508
leaq 0x106d(%rip), %rsi      # 0x5515
movl $0x9, %edx
movq %rbx, %rdi
callq 0x2120
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x456e
movq %r15, %rdi
callq 0x2050
movq 0x3afe(%rip), %rdi      # 0x7fd0
movq %r15, %rsi
movq %rax, %rdx
callq 0x2120
jmp 0x458c
movq 0x10(%r12), %rbx
testq %rbx, %rbx
je 0x4521
movq %rbx, %rdi
callq 0x2050
movq 0x3ad5(%rip), %rdi      # 0x7fd0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2120
jmp 0x453f
leaq 0xff0(%rip), %rsi       # 0x54ff
movl $0x15, %edx
movq %rbx, %rdi
callq 0x2120
jmp 0x463f
movq 0x3aa8(%rip), %rax      # 0x7fd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x2240
movq 0x3a8a(%rip), %rbx      # 0x7fd0
leaq 0xfd3(%rip), %rsi       # 0x5520
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2120
movl (%r12), %esi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
jmp 0x463f
movq 0x3a5b(%rip), %rax      # 0x7fd0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x2240
leaq 0xf8c(%rip), %rsi       # 0x551f
movl $0x3, %edx
movq %rbx, %rdi
callq 0x2120
movl (%r12), %esi
movq %rbx, %rdi
callq 0x2090
leaq 0xf6d(%rip), %rsi       # 0x5520
movl $0x2, %edx
movq %rax, %rdi
callq 0x2120
leaq 0xe9e(%rip), %r15       # 0x5465
leaq 0xf55(%rip), %r12       # 0x5523
leaq 0xf51(%rip), %r13       # 0x5526
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2120
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movl 0x4(%r14), %esi
movq %rbp, %rdi
callq 0x2090
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movl $0x2, %edx
movq %rbp, %rdi
leaq 0xeef(%rip), %rsi       # 0x5520
callq 0x2120
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x45d5
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20a0
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/posting_list.cpp
// Function: posting_list::~posting_list()
posting_list::~posting_list()
{
    node * temp = first;
    node * temp2;

    while(temp != NULL) //iterate list
    {
        temp2 = temp->next;
        delete temp;
        temp = temp2;
        pl_size--;
    }

    free(word);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x46a0
movq 0x8(%rdi), %r14
movl $0x10, %esi
callq 0x2110
decl (%rbx)
movq %r14, %rdi
testq %r14, %r14
jne 0x4688
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2140
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/posting_list.cpp
// Function: posting_list::create_node(unsigned int)
posting_list::node * posting_list::create_node(unsigned int doc_id)
{
    node * new_node = new node;
    new_node->doc_id = doc_id;
    new_node->freq = 1;
    new_node->next = NULL ;
    return new_node;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl $0x10, %edi
callq 0x2100
movl %ebx, (%rax)
movl $0x1, 0x4(%rax)
movq $0x0, 0x8(%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/posting_list.cpp
// Function: posting_list::update(char*, unsigned int)
void posting_list::update(char * word, unsigned int doc_id)
{ //create new list node if doc id is not contained in the list or increase its term frequency otherwise
  // posting list is sorted
    node * temp = first;
    node * prev_temp;
    node * n;

    if(first == NULL)
    { // list is empty
        n = create_node(doc_id);
        first = n;
        this->word = (char *) malloc((strlen(word) + 1) * sizeof(char));
        strcpy(this->word, word);
        pl_size++;
    }
    else
    { // list already exists
        while(1)
        {
            if(temp == NULL)
            {// we have iterated the whole list and doc id does not exist. so it will be added at the end of the list
                n = create_node(doc_id);
                pl_size++;
                prev_temp->next = n;
                break;
            }

            if (temp->doc_id == doc_id)
            { // doc id exists
                temp->freq++;     //increase its term frequency
                break;
            }
            else if(temp->doc_id < doc_id)
            { //continue searching
                prev_temp = temp;
                temp = temp->next;
            }
            else
            {//because the list is sorted and the current doc id is bigger than the inserting one
             //we do not have to keep looking the rest of the list (the rest stored doc ids will be different than the inserting one)
             // doc id will be added here
                n = create_node(doc_id);
                pl_size++;
                n->next = temp;

                if(prev_temp == NULL)
                { //we be added at the start of the list
                    first = n;
                }
                else
                {
                    prev_temp->next = n;
                }

                break;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x471d
movq %rax, %r14
cmpl %ebp, (%rax)
je 0x4763
jae 0x4769
movq 0x8(%r14), %rax
movq %r14, %r15
testq %rax, %rax
jne 0x46e5
movl $0x10, %edi
callq 0x2100
movl %ebp, (%rax)
movl $0x1, 0x4(%rax)
movq $0x0, 0x8(%rax)
incl (%rbx)
movq %rax, 0x8(%r14)
jmp 0x4799
movq %rsi, %r14
movl $0x10, %edi
callq 0x2100
movl %ebp, (%rax)
movl $0x1, 0x4(%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x2050
leaq 0x1(%rax), %rdi
callq 0x2170
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x20c0
incl (%rbx)
jmp 0x4799
incl 0x4(%r14)
jmp 0x4799
movl $0x10, %edi
callq 0x2100
movl %ebp, (%rax)
movl $0x1, 0x4(%rax)
movq $0x0, 0x8(%rax)
incl (%rbx)
movq %r14, 0x8(%rax)
testq %r15, %r15
je 0x4795
movq %rax, 0x8(%r15)
jmp 0x4799
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/JohnPapad[P]Mini-Search-Engine/posting_list.cpp
// Function: posting_list::add_doc_id_to_array(unsigned int*, unsigned int&)
unsigned int * posting_list::add_doc_id_to_array(unsigned int * unq_doc_ids, unsigned int & unq_doc_ids_size)
{// adding posting list's doc ids to an array. if a posting list's doc id is already contained in the array do not add it again
    node * temp = first;
    while(temp != NULL) //iterating posting list
    {
        bool doc_id_exists = 0;
        for(unsigned int i = 0; i < unq_doc_ids_size; i++)
        { // checking if current doc id is already contained in the array
            if (unq_doc_ids[i] == temp->doc_id)
            {
                doc_id_exists = 1;  // already exists
                break;
            }
        }

        if(doc_id_exists == 0)
        { //if current doc id is not already contained in the array add it now
            unq_doc_ids_size++;
            unq_doc_ids = (unsigned int *) realloc(unq_doc_ids, unq_doc_ids_size * sizeof(unsigned int));
            unq_doc_ids[unq_doc_ids_size - 1] = temp->doc_id;
        }

        temp = temp->next;
    }

    return unq_doc_ids;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x4808
movq %rdx, %rbx
movl (%rbx), %esi
testq %rsi, %rsi
je 0x47e5
movl (%r14), %ecx
xorl %edx, %edx
cmpl %ecx, (%rax,%rdx,4)
je 0x47ff
incq %rdx
cmpl %edx, %esi
jne 0x47d9
incl %esi
movl %esi, (%rbx)
shlq $0x2, %rsi
movq %rax, %rdi
callq 0x2220
movl (%r14), %ecx
movl (%rbx), %edx
decl %edx
movl %ecx, (%rax,%rdx,4)
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x47cd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: GLUTStop()
void GLUTStop(void)
{
  // Write configuration
  if (output_configuration_filename) {
    if (!WriteConfigurationFile(configuration, output_configuration_filename)) exit(-1);
  }

  // Destroy window 
  glutDestroyWindow(GLUTwindow);

  // Exit
  exit(0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0x1463ee(%rip), %rbx    # 0x16da58
testq %rbx, %rbx
jne 0x27681
movl 0x1463eb(%rip), %edi    # 0x16da60
callq 0xf5258
xorl %edi, %edi
callq 0x23b40
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xa7c24
movq %r14, %rdi
xorl %esi, %esi
callq 0x24000
cmpb $0x1, 0x146401(%rip)    # 0x16daa0
jne 0x276c1
leaq 0xd4bf4(%rip), %rdi     # 0xfc29c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x23080
movq 0x140867(%rip), %rax    # 0x167f20
movq (%rax), %rdi
callq 0x23ad0
movq 0x1461e8(%rip), %rax    # 0x16d8b0
leaq 0x1461e1(%rip), %rdi    # 0x16d8b0
movq %rbx, %rsi
movl $0x1, %edx
callq *0x98(%rax)
testl %eax, %eax
je 0x27743
movl %eax, %ebx
cmpb $0x1, 0x1463b6(%rip)    # 0x16daa0
jne 0x2773b
leaq 0x8(%rsp), %rdi
callq 0xa7c86
leaq 0xd4bc0(%rip), %rdi     # 0xfc2bd
movb $0x1, %al
callq 0x23080
movl 0x1461ba(%rip), %esi    # 0x16d8c4
leaq 0xd4bc3(%rip), %rdi     # 0xfc2d4
xorl %eax, %eax
callq 0x23080
movl 0x1461b6(%rip), %esi    # 0x16d8d4
leaq 0xd4bc0(%rip), %rdi     # 0xfc2e5
xorl %eax, %eax
callq 0x23080
movq 0x1407ed(%rip), %rax    # 0x167f20
movq (%rax), %rdi
callq 0x23ad0
testl %ebx, %ebx
jne 0x2766f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x23b40
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawCameras(int)
static void
DrawCameras(int color_scheme = RGBD_INDEX_COLOR_SCHEME)
{
  // Draw cameras
  for (int i = 0; i < configuration.NImages(); i++) {
    RGBDImage *image = configuration.Image(i);
    if (!CheckVisibility(image, selected_position)) continue;
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index))
      image->DrawCamera(RGBD_HIGHLIGHT_COLOR_SCHEME);
    else image->DrawCamera(color_scheme);
  }
}

// Assembly:
cmpl $0x0, 0x1458f1(%rip)    # 0x16d8c4
jle 0x2803e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %r15d, %r15d
movl $0x4, %ebp
movq 0x1458cb(%rip), %rax    # 0x16d8b8
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0x2ae1c
testl %eax, %eax
je 0x28025
movl 0x1409e5(%rip), %eax    # 0x1689e8
cmpq %rax, %r15
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq (%r14), %rax
cmovel %ebx, %esi
movq %r14, %rdi
movsd 0xd4019(%rip), %xmm0    # 0xfc038
callq *0xc0(%rax)
incq %r15
movslq 0x145895(%rip), %rax    # 0x16d8c4
cmpq %rax, %r15
jl 0x27fe6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawBBoxes(int)
static void
DrawBBoxes(int color_scheme = RGBD_INDEX_COLOR_SCHEME)
{
  // Draw pixels of all images as bboxs in world space
  for (int i = 0; i < configuration.NImages(); i++) {
    RGBDImage *image = configuration.Image(i);
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index)) image->DrawBBox(RGBD_HIGHLIGHT_COLOR_SCHEME);
    else image->DrawBBox(color_scheme);
  }
}

// Assembly:
cmpl $0x0, 0x14587e(%rip)    # 0x16d8c4
jle 0x28091
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
movl $0x4, %ebp
movl 0x14098c(%rip), %eax    # 0x1689e8
cmpq %rax, %r14
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq 0x14584a(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,8), %rdi
movq (%rdi), %rax
cmovel %ebx, %esi
callq *0xc8(%rax)
incq %r14
movslq 0x14583c(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
jl 0x28056
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawFaces(int)
static void
DrawFaces(int color_scheme = RGBD_INDEX_COLOR_SCHEME)
{
  // Draw surfaces
  for (int i = 0; i < configuration.NSurfaces(); i++) {
    RGBDSurface *surface = configuration.Surface(i);
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index)) surface->DrawFaces(RGBD_HIGHLIGHT_COLOR_SCHEME);
    else surface->DrawFaces(color_scheme);
  }
}

// Assembly:
cmpl $0x0, 0x14583b(%rip)    # 0x16d8d4
jle 0x280e1
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
movl $0x4, %ebp
movl 0x140939(%rip), %eax    # 0x1689e8
cmpq %rax, %r14
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq 0x145807(%rip), %rax    # 0x16d8c8
movq (%rax,%r14,8), %rdi
movq (%rdi), %rax
cmovel %ebx, %esi
callq *0x60(%rax)
incq %r14
movslq 0x1457fc(%rip), %rax    # 0x16d8d4
cmpq %rax, %r14
jl 0x280a9
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawPoints(int, int)
static void
DrawPoints(int color_scheme = RGBD_PHOTO_COLOR_SCHEME, int skip = 1)
{
  // Draw pixels of all images as points in world space
  for (int i = 0; i < configuration.NImages(); i++) {
    RGBDImage *image = configuration.Image(i);
    if (!image->DepthChannel()) continue;
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index)) image->DrawPoints(RGBD_HIGHLIGHT_COLOR_SCHEME, skip);
    else image->DrawPoints(color_scheme, skip);
  }
}

// Assembly:
cmpl $0x0, 0x1457db(%rip)    # 0x16d8c4
jle 0x2814a
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
movl $0x4, %ebp
movq 0x1457b8(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,8), %rdi
cmpl $0x4, 0x24(%rdi)
jl 0x28137
movq 0x18(%rdi), %rax
cmpq $0x0, 0x18(%rax)
je 0x28137
movl 0x1408cd(%rip), %eax    # 0x1689e8
cmpq %rax, %r14
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq (%rdi), %rax
cmovel %ebx, %esi
movl $0x1, %edx
callq *0xd8(%rax)
incq %r14
movslq 0x145783(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
jl 0x280f9
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawSurfels(int, int)
static void
DrawSurfels(int color_scheme = RGBD_PHOTO_COLOR_SCHEME, int skip = 1)
{
  // Draw pixels of all images as surfels in world space
  for (int i = 0; i < configuration.NImages(); i++) {
    RGBDImage *image = configuration.Image(i);
    if (!image->DepthChannel()) continue;
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index)) image->DrawSurfels(RGBD_HIGHLIGHT_COLOR_SCHEME, skip);
    else image->DrawSurfels(color_scheme, skip);
  }
}

// Assembly:
cmpl $0x0, 0x145772(%rip)    # 0x16d8c4
jle 0x281b3
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
movl $0x4, %ebp
movq 0x14574f(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,8), %rdi
cmpl $0x4, 0x24(%rdi)
jl 0x281a0
movq 0x18(%rdi), %rax
cmpq $0x0, 0x18(%rax)
je 0x281a0
movl 0x140864(%rip), %eax    # 0x1689e8
cmpq %rax, %r14
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq (%rdi), %rax
cmovel %ebx, %esi
movl $0x1, %edx
callq *0xe0(%rax)
incq %r14
movslq 0x14571a(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
jl 0x28162
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawQuads(int, int)
static void
DrawQuads(int color_scheme = RGBD_PHOTO_COLOR_SCHEME, int skip = 1)
{
  // Draw pixels of all images as quads in world space
  for (int i = 0; i < configuration.NImages(); i++) {
    RGBDImage *image = configuration.Image(i);
    if (!image->DepthChannel()) continue;
    if ((color_scheme != RGBD_INDEX_COLOR_SCHEME) && (i == selected_image_index)) image->DrawQuads(RGBD_HIGHLIGHT_COLOR_SCHEME, skip);
    else image->DrawQuads(color_scheme, skip);
  }
}

// Assembly:
cmpl $0x0, 0x145709(%rip)    # 0x16d8c4
jle 0x2821c
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
movl $0x4, %ebp
movq 0x1456e6(%rip), %rax    # 0x16d8b8
movq (%rax,%r14,8), %rdi
cmpl $0x4, 0x24(%rdi)
jl 0x28209
movq 0x18(%rdi), %rax
cmpq $0x0, 0x18(%rax)
je 0x28209
movl 0x1407fb(%rip), %eax    # 0x1689e8
cmpq %rax, %r14
movl %ebx, %esi
cmovel %ebp, %esi
cmpl $0x3, %ebx
movq (%rdi), %rax
cmovel %ebx, %esi
movl $0x1, %edx
callq *0xe8(%rax)
incq %r14
movslq 0x1456b1(%rip), %rax    # 0x16d8c4
cmpq %rax, %r14
jl 0x281cb
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: GLUTMotion(int, int)
void GLUTMotion(int x, int y)
{
  // Invert y coordinate
  y = GLUTwindow_height - y;

  // Compute mouse movement
  int dx = x - GLUTmouse[0];
  int dy = y - GLUTmouse[1];
  
  // Update mouse drag
  GLUTmouse_drag += dx*dx + dy*dy;

  // Check if control key is down
  if (GLUTmodifiers & GLUT_ACTIVE_CTRL) {
    // Update rubber box
    if (rubber_box_active) {
      DrawRubberBox();
      rubber_box_corners[1] = R2Point(x, y);
      DrawRubberBox();
    }
    else {
      rubber_box_active = TRUE;
      rubber_box_corners[0] = R2Point(x, y);
      rubber_box_corners[1] = R2Point(x, y);
      DrawRubberBox();
    }
  }
  else {
    // World in hand navigation 
    if (GLUTbutton[0]) viewer.RotateWorld(1.0, center, x, y, dx, dy);
    else if (GLUTbutton[1]) viewer.ScaleWorld(1.0, center, x, y, dx, dy);
    else if (GLUTbutton[2]) viewer.TranslateWorld(1.0, center, x, y, dx, dy);
    if (GLUTbutton[0] || GLUTbutton[1] || GLUTbutton[2]) glutPostRedisplay();
  }

  // Remember mouse position 
  GLUTmouse[0] = x;
  GLUTmouse[1] = y;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebp
movl 0x140773(%rip), %ebx    # 0x1689e0
subl %esi, %ebx
movl %edi, %r8d
subl 0x14582b(%rip), %r8d    # 0x16daa4
movl %ebx, %r9d
subl 0x145825(%rip), %r9d    # 0x16daa8
movl %r8d, %eax
imull %r8d, %eax
movl %r9d, %ecx
imull %r9d, %ecx
addl 0x145815(%rip), %eax    # 0x16daac
addl %ecx, %eax
movl %eax, 0x14580d(%rip)    # 0x16daac
testb $0x2, 0x14580a(%rip)    # 0x16dab0
jne 0x282d9
cmpl $0x0, 0x145809(%rip)    # 0x16dab8
je 0x2834d
leaq 0x1456f4(%rip), %rdi    # 0x16d9b0
leaq 0x1456d5(%rip), %rsi    # 0x16d998
movsd 0xd3d45(%rip), %xmm0    # 0xfc010
movl %ebp, %edx
movl %ebx, %ecx
callq 0x3963a
jmp 0x2839f
cvtsi2sd %ebp, %xmm0
cvtsi2sd %ebx, %xmm1
cmpb $0x1, 0x1457cc(%rip)    # 0x16dab4
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
jne 0x282fc
callq 0x283d4
jmp 0x2831f
movb $0x1, 0x1457b1(%rip)    # 0x16dab4
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0xa25d6
leaq 0x145649(%rip), %rdi    # 0x16d960
movq %r14, %rsi
callq 0xa270e
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0xa25d6
leaq 0x145632(%rip), %rdi    # 0x16d970
movq %r14, %rsi
callq 0xa270e
callq 0x283d4
jmp 0x283bf
cmpl $0x0, 0x145768(%rip)    # 0x16dabc
je 0x28377
leaq 0x145653(%rip), %rdi    # 0x16d9b0
leaq 0x145634(%rip), %rsi    # 0x16d998
movsd 0xd3ca4(%rip), %xmm0    # 0xfc010
movl %ebp, %edx
movl %ebx, %ecx
callq 0x395de
jmp 0x2839f
cmpl $0x0, 0x145742(%rip)    # 0x16dac0
je 0x2839f
leaq 0x145629(%rip), %rdi    # 0x16d9b0
leaq 0x14560a(%rip), %rsi    # 0x16d998
movsd 0xd3c7a(%rip), %xmm0    # 0xfc010
movl %ebp, %edx
movl %ebx, %ecx
callq 0x394ec
cmpl $0x0, 0x145712(%rip)    # 0x16dab8
jne 0x283ba
cmpl $0x0, 0x14570d(%rip)    # 0x16dabc
jne 0x283ba
cmpl $0x0, 0x145708(%rip)    # 0x16dac0
je 0x283bf
callq 0xeef18
movl %ebp, 0x1456df(%rip)    # 0x16daa4
movl %ebx, 0x1456dd(%rip)    # 0x16daa8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawRubberBox()
static void 
DrawRubberBox(void)
{
  // Set rendering modes
  glDrawBuffer(GL_FRONT);
  glDisable(GL_DEPTH_TEST);
  glDepthMask(0);
  glLineStipple(1, 0xFF00);
  glEnable(GL_LINE_STIPPLE);
  glLogicOp(GL_XOR);
  glEnable(GL_COLOR_LOGIC_OP);

  // Set projection matrix
  glMatrixMode(GL_PROJECTION);  
  glPushMatrix();
  glLoadIdentity();
  gluOrtho2D(0, GLUTwindow_width, 0, GLUTwindow_height);

  // Set model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();

  // Draw box
  RNGrfxBegin(RN_GRFX_LINE_LOOP);
  RNLoadRgb(1.0, 1.0, 1.0);
  R2LoadPoint(rubber_box_corners[0][0], rubber_box_corners[0][1]);
  R2LoadPoint(rubber_box_corners[0][0], rubber_box_corners[1][1]);
  R2LoadPoint(rubber_box_corners[1][0], rubber_box_corners[1][1]);
  R2LoadPoint(rubber_box_corners[1][0], rubber_box_corners[0][1]);
  RNGrfxEnd();

  // Reset projection matrix
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();

  // Reset model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();

  // Reset rendering modes
  glDisable(GL_COLOR_LOGIC_OP);
  glDisable(GL_LINE_STIPPLE);
  glEnable(GL_DEPTH_TEST);
  glDepthMask(1);
  glDrawBuffer(GL_BACK);
  glFlush();
}

// Assembly:
pushq %rax
movl $0x404, %edi            # imm = 0x404
callq 0x23dd0
movl $0xb71, %edi            # imm = 0xB71
callq 0x231f0
xorl %edi, %edi
callq 0x23510
movl $0x1, %edi
movl $0xff00, %esi           # imm = 0xFF00
callq 0x23b20
movl $0xb24, %edi            # imm = 0xB24
callq 0x23830
movl $0x1506, %edi           # imm = 0x1506
callq 0x24330
movl $0xbf2, %edi            # imm = 0xBF2
callq 0x23830
movl $0x1701, %edi           # imm = 0x1701
callq 0x23cf0
callq 0x23fa0
callq 0x23c80
cvtsi2sdl 0x1405a3(%rip), %xmm1 # 0x1689dc
cvtsi2sdl 0x14059f(%rip), %xmm3 # 0x1689e0
xorps %xmm0, %xmm0
xorps %xmm2, %xmm2
callq 0x23570
movl $0x1700, %edi           # imm = 0x1700
callq 0x23cf0
callq 0x23fa0
callq 0x23c80
movl $0x2, %edi
callq 0x23190
movsd 0xd3b9e(%rip), %xmm0    # 0xfc010
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x23eb0
movsd 0x1454db(%rip), %xmm0   # 0x16d960
movsd 0x1454db(%rip), %xmm1   # 0x16d968
callq 0x23640
movsd 0x1454c6(%rip), %xmm0   # 0x16d960
movsd 0x1454d6(%rip), %xmm1   # 0x16d978
callq 0x23640
movsd 0x1454c1(%rip), %xmm0   # 0x16d970
movsd 0x1454c1(%rip), %xmm1   # 0x16d978
callq 0x23640
movsd 0x1454ac(%rip), %xmm0   # 0x16d970
movsd 0x14549c(%rip), %xmm1   # 0x16d968
callq 0x23640
callq 0x23c90
movl $0x1701, %edi           # imm = 0x1701
callq 0x23cf0
callq 0x24200
movl $0x1700, %edi           # imm = 0x1700
callq 0x23cf0
callq 0x24200
movl $0xbf2, %edi            # imm = 0xBF2
callq 0x231f0
movl $0xb24, %edi            # imm = 0xB24
callq 0x231f0
movl $0xb71, %edi            # imm = 0xB71
callq 0x23830
movl $0x1, %edi
callq 0x23510
movl $0x405, %edi            # imm = 0x405
callq 0x23dd0
popq %rax
jmp 0x23de0
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: GLUTInterface()
void GLUTInterface(void)
{
  // Open window
  int argc = 0;
  char *argv[1];
  argv[argc++] = RNStrdup("conf2texture");
  glutInit(&argc, argv);
  glutInitWindowPosition(100, 100);
  glutInitWindowSize(GLUTwindow_width, GLUTwindow_height);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
  GLUTwindow = glutCreateWindow("Configuration Viewer");
  
  // Initialize grfx (after create context because calls glewInit)
  RNInitGrfx();

  // Initialize graphics modes  
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_CULL_FACE);

  // Initialize lighting
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  static GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
  glEnable(GL_NORMALIZE);

  // Define headlight
  static GLfloat light0_diffuse[] = { 0.5, 0.5, 0.5, 1.0 };
  static GLfloat light0_position[] = { 0.0, 0.0, 1.0, 0.0 };
  glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse);
  glLightfv(GL_LIGHT0, GL_POSITION, light0_position);
  glEnable(GL_LIGHT0);

  // Initialize GLUT callback functions 
  glutDisplayFunc(GLUTRedraw);
  glutReshapeFunc(GLUTResize);
  glutKeyboardFunc(GLUTKeyboard);
  glutSpecialFunc(GLUTSpecial);
  glutMouseFunc(GLUTMouse);
  glutMotionFunc(GLUTMotion);

  // Reset viewer
  ResetViewer();

  // Run main loop -- never returns 
  glutMainLoop();
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x4(%rsp), %rbx
movl $0x0, (%rbx)
leaq 0xd2544(%rip), %rdi     # 0xfc27a
callq 0xaae9b
incl (%rbx)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
callq 0xefbbf
movl $0x64, %edi
movl $0x64, %esi
callq 0xf010c
movl 0x13ec7a(%rip), %edi    # 0x1689dc
movl 0x13ec78(%rip), %esi    # 0x1689e0
callq 0xf0122
movl $0x12, %edi
callq 0xf0141
leaq 0xd2509(%rip), %rdi     # 0xfc287
callq 0xf510c
movl %eax, 0x143cd7(%rip)    # 0x16da60
callq 0xa7d0c
movl $0xb71, %edi            # imm = 0xB71
callq 0x23830
movl $0xb44, %edi            # imm = 0xB44
callq 0x23830
movl $0x1700, %edi           # imm = 0x1700
callq 0x23cf0
callq 0x23c80
leaq 0x13ec48(%rip), %rsi    # 0x168a00
movl $0xb53, %edi            # imm = 0xB53
callq 0x24240
movl $0xb51, %edi            # imm = 0xB51
movl $0x1, %esi
callq 0x23150
movl $0xba1, %edi            # imm = 0xBA1
callq 0x23830
leaq 0x13ec2e(%rip), %rdx    # 0x168a10
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x240e0
leaq 0x13ec28(%rip), %rdx    # 0x168a20
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x240e0
movl $0x4000, %edi           # imm = 0x4000
callq 0x23830
leaq -0x26cb(%rip), %rdi     # 0x2774d
callq 0xee614
leaq -0x1c07(%rip), %rdi     # 0x2821d
callq 0xee669
leaq -0x6da(%rip), %rdi      # 0x29756
callq 0xee6ab
leaq -0xce7(%rip), %rdi      # 0x29155
callq 0xee6f3
leaq -0x191c(%rip), %rdi     # 0x2852c
callq 0xeea3c
leaq -0x1bf7(%rip), %rdi     # 0x2825d
callq 0xeeacc
callq 0x29502
callq 0xf21d7
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/SoftwearDevelopment[P]xattr_syscall_wrapper/listxattr.cc
// Function: void print_with_newline<char*, std::ostream>(char*, char*, std::ostream&)
void print_with_newline(Itr s, Itr end, Os &out) {
  while (s < end) {
    char *next = std::find(s, end, '\0');
    size_t slen = next - s;

    if (next == end) {
      std::cerr << "error: Found string that is not \\0 terminated "
                << "at the end of the xattr list. Exiting confused.";
      exit(1);
    }

    out.write(s, slen);
    out << std::endl;

    s += slen + 1;
  }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpq %rsi, %rdi
jae 0x1766
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
leaq 0xf(%rsp), %r15
movb $0x0, 0xf(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1941
cmpq %r14, %rax
je 0x1774
movq %rax, %r12
movq %rax, %rdx
subq %r13, %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1110
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
incq %r12
movq %r12, %r13
cmpq %r14, %r12
jb 0x1708
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x2875(%rip), %rdi      # 0x3ff0
leaq 0x95d(%rip), %rsi       # 0x20df
callq 0x1120
leaq 0x980(%rip), %rsi       # 0x210e
movq %rax, %rdi
callq 0x1120
movl $0x1, %edi
callq 0x1160
// File: /workspace/github_cpp_makefile_star2_O1/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse3D>::reset_statistics()
virtual
    void reset_statistics ()
    {
        walltime = 0;
        all_events.fill (0);
        longrange_events.fill (0);
        chainend_events.fill (0);
        longrange_predicts = shortrange_predicts = 0;
        cumulative_disp.fill (0.);
        cumulative_xdisp.fill (0.);
    }

// Assembly:
xorl %eax, %eax
movq %rax, 0x24b8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x24f0(%rdi)
movq %rax, 0x2500(%rdi)
movups %xmm0, 0x2508(%rdi)
movq %rax, 0x2518(%rdi)
movups %xmm0, 0x2520(%rdi)
movq %rax, 0x2530(%rdi)
movups %xmm0, 0x24c0(%rdi)
movq %rax, 0x24d0(%rdi)
movups %xmm0, 0x2538(%rdi)
movups %xmm0, 0x24d8(%rdi)
movq %rax, 0x24e8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse2D>::optimize_sr_lr_split(AbstractStorage*)
virtual
    void optimize_sr_lr_split (AbstractStorage *stor_)
    {
        stor_t *stor = downcast (stor_);

        const int num_samples = 1000;
        double try_splits[] = {  2.1,  1.6,  1.7,  2.3,  2.9,  1.8,  1.5,  3.6,
            0.8,  3.9,  3.5, 0.9,  3.4,  2. ,  1.2,  1.4,  1.9,  3.1,  3.7,  3.,
            3.3,  2.4, 2.2,  2.5,  2.8,  2.7,  1. ,  0.6,  0.7,  3.2,  1.3,  3.8,
            2.6, 1.1 };

        uint64_t smallest_time_so_far = time_for_collisions (stor, try_splits[0], num_samples);
        int best_split_so_far = 0;

        const int num_splits = sizeof(try_splits) / sizeof (try_splits[0]);

        for (int i = 1; i != num_splits; ++i)
        {
            uint64_t time_now = time_for_collisions (stor, try_splits[i], num_samples);
            if (time_now < smallest_time_so_far)
            {
                smallest_time_so_far = time_now;
                best_split_so_far = i;
            }
        }

        std::cerr << "info best sr_lr_split " << try_splits[best_split_so_far] <<"\n";
        set_parameter ("sr_lr_split", try_splits[best_split_so_far]);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x40e5f2
movq %rax, %r14
movsd 0x1bdb34(%rip), %xmm0   # 0x5cafa8
movq %rbx, %rdi
movq %rax, %rsi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x40e614
movq %rax, %r15
xorl %ebp, %ebp
movl $0x1, %r13d
leaq 0x1c023a(%rip), %r12    # 0x5cd6d0
movsd (%r12,%r13,8), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x40e614
cmpq %r15, %rax
cmovbl %r13d, %ebp
cmovbq %rax, %r15
incq %r13
cmpq $0x22, %r13
jne 0x40d496
movq $0x656aa0, %r14         # imm = 0x656AA0
leaq 0x1bdf0a(%rip), %rsi    # 0x5cb3d8
movl $0x16, %edx
movq %r14, %rdi
callq 0x4b14d0
movslq %ebp, %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, (%rsp)
movq %r14, %rdi
callq 0x4b2730
leaq 0x1ce6f2(%rip), %rsi    # 0x5dbbea
movl $0x1, %edx
movq %rax, %rdi
callq 0x4b14d0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1bcce3(%rip), %rsi    # 0x5ca1f8
leaq 0x1bcce7(%rip), %rdx    # 0x5ca203
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x40843e
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
callq *0x18(%rax)
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x40d551
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4440d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x40d57a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4440d0
movq %rbx, %rdi
callq 0x4f77a0
// File: /workspace/github_cpp_makefile_star2_O1/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse3D>::calibrate(AbstractStorage*)
virtual
    void calibrate (AbstractStorage *stor_)
    {
        stor_t *stor = downcast (stor_);
        double chexp = measure_chain_expansion (stor, 0);
        double Lmax = stor->periods ().max ();
        calib_constant = Lmax / chexp / 2;

        target_epc = factor_quantity (stor->num_particles (), trunc_periods (stor));
        target_tdisppc = trunc_periods (stor);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4184fe
movq %rax, %r14
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
movl $0x64, %ecx
callq 0x41998e
movsd %xmm0, (%rsp)
movq (%r14), %rax
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq *0x28(%rax)
movl $0x8, %eax
movsd 0x8(%rsp,%rax), %xmm0
ucomisd (%r12), %xmm0
jbe 0x417b5b
leaq (%rsp,%rax), %r12
addq $0x8, %r12
addq $0x8, %rax
cmpq $0x18, %rax
jne 0x417b45
movsd (%r12), %xmm0
divsd (%rsp), %xmm0
mulsd 0x1b3438(%rip), %xmm0   # 0x5cafb0
movsd %xmm0, 0x28(%rbx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x30(%rax)
addq $0x50, %r14
movq 0x60(%r15), %rcx
movq %rcx, 0x30(%rsp)
movups 0x50(%r15), %xmm0
movaps %xmm0, 0x20(%rsp)
movsd 0x1b2473(%rip), %xmm1   # 0x5ca018
xorl %ecx, %ecx
mulsd 0x20(%rsp,%rcx), %xmm1
addq $0x8, %rcx
cmpq $0x18, %rcx
jne 0x417ba7
movq %rax, %xmm2
punpckldq 0x1b34ec(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x1b34f4(%rip), %xmm2   # 0x5cb0c0
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
divsd %xmm1, %xmm0
movsd 0x1b34c4(%rip), %xmm1   # 0x5cb0a8
callq 0x4ee2f0
xorl %eax, %eax
movsd 0x20(%rsp,%rax,8), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0x417beb
movq 0x18(%rsp), %rax
movq %rax, 0x2498(%rbx)
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x2488(%rbx)
movups (%r14), %xmm0
movq 0x10(%r14), %rax
movq %rax, 0x24b0(%rbx)
movups %xmm0, 0x24a0(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse2D>::collide(AbstractStorage*, double)
virtual
    void collide (AbstractStorage *stor_, double disp_per_particle)
    {
        walltime -= gclock ();
        stor_t *stor = downcast (stor_);
        unsigned num_chains = 1 + stor->num_particles () * disp_per_particle / calib_constant;
        this->run (stor, num_chains, calib_constant);
        walltime += gclock ();
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rsi, %r14
movq %rdi, %rbx
callq 0x440898
subq %rax, 0x24a0(%rbx)
movq %r14, %rdi
callq 0x40e5f2
movq %rax, %r14
movq (%rax), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rax, %xmm0
punpckldq 0x1bd9f8(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1bda00(%rip), %xmm0   # 0x5cb0c0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd (%rsp), %xmm1
movsd 0x28(%rbx), %xmm0
divsd %xmm0, %xmm1
addsd 0x1bc936(%rip), %xmm1   # 0x5ca018
cvttsd2si %xmm1, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x412c14
callq 0x440898
addq %rax, 0x24a0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq