LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: heap_free
void heap_free(heap *h, FILE *f_out, int level) {

  int i;
  for (i=0; i<h->size; i++){
    //fclose(h->heap[i]->f_in);
    free(h->heap[i]->buffer);
    free(h->heap[i]);
  }

  #if OUTPUT_BUFFER 
    if(h->out_idx) write_buffer(h, f_out, level);
    free(h->out_buffer);
  #endif
  
  fclose(h->f_in);
      
  free(h->heap);
  free(h);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x2b0b
xorl %r15d, %r15d
movq (%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax), %rdi
callq 0x306d
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x306d
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x2ae4
cmpl $0x0, 0x210(%rbx)
je 0x2b21
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x29f6
movq 0x208(%rbx), %rdi
callq 0x306d
movq 0x200(%rbx), %rdi
callq 0x10b0
movq (%rbx), %rdi
callq 0x306d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x306d
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: heapfy_up
void heapfy_up(heap *h, int i) {

  int p = (int) floor((i-1)/2);

  while (i>0 && key(i) < key(p)) {  
      
    heap_node *auxn = h->heap[i];
    h->heap[i] = h->heap[p];
    h->heap[p] = auxn;

    i = p;
    p = (int) floor((i-1)/2);
  }
}

// Assembly:
testl %esi, %esi
jle 0x2bba
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ecx
leal -0x1(%rcx), %edx
shrl $0x1f, %edx
movl %esi, %eax
leal (%rcx,%rdx), %esi
decl %esi
sarl %esi
movq (%rdi), %rcx
movq (%rcx,%rax,8), %rdx
movq (%rdx), %r10
movslq 0x8(%rdx), %r11
shlq $0x4, %r11
movq (%r10,%r11), %rbx
movslq %esi, %r8
movq (%rcx,%r8,8), %r9
movq (%r9), %r14
movslq 0x8(%r9), %r15
shlq $0x4, %r15
cmpq (%r14,%r15), %rbx
movq 0x8(%r10,%r11), %r10
sbbq 0x8(%r14,%r15), %r10
jae 0x2bb5
movq %r9, (%rcx,%rax,8)
movq (%rdi), %rcx
movq %rdx, (%rcx,%r8,8)
cmpl $0x2, %eax
jg 0x2b5c
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: heapfy_down
void heapfy_down(heap *h, int i) {

  int last = h->size-1;

  // Selects the child s of i with smaller cost:
  int l = 2*i+1;
  int r = l+1;
  int s;
  if (r <= last)
    s = key(l) < key(r) ? l : r;    
  else if (l == last)
    s = l;
  else
    return;

  // Swaps down:
  while (key(i) > key(s)) {   
    
    heap_node *aux = h->heap[i];
    h->heap[i] = h->heap[s];
    h->heap[s] = aux;

    i = s;
    l = 2*i+1;
    r = l+1;

    if (r <= last)
      s = key(l) < key(r) ? l : r;      
    else if (l == last)
      s = l;
    else
      return;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ecx
leal 0x1(,%rsi,2), %edx
leal 0x2(,%rsi,2), %r8d
cmpl %eax, %r8d
jge 0x2c1d
movq (%rdi), %r9
movslq %edx, %r10
movq (%r9,%r10,8), %r10
movq (%r10), %r11
movslq 0x8(%r10), %r10
shlq $0x4, %r10
movq (%r11,%r10), %rbx
movslq %r8d, %r14
movq (%r9,%r14,8), %r9
movq (%r9), %r14
movslq 0x8(%r9), %r9
shlq $0x4, %r9
cmpq (%r14,%r9), %rbx
movq 0x8(%r11,%r10), %r10
sbbq 0x8(%r14,%r9), %r10
cmovael %r8d, %edx
jmp 0x2c25
cmpl %ecx, %edx
jne 0x2cd7
movslq %esi, %r8
movl %edx, %esi
movq (%rdi), %r9
movq (%r9,%r8,8), %rdx
movq (%rdx), %rbx
movslq 0x8(%rdx), %r14
shlq $0x4, %r14
movslq %esi, %r10
movq (%r9,%r10,8), %r11
movq (%r11), %r15
movslq 0x8(%r11), %r12
shlq $0x4, %r12
movq (%r15,%r12), %r13
cmpq (%rbx,%r14), %r13
movq 0x8(%r15,%r12), %r15
sbbq 0x8(%rbx,%r14), %r15
jae 0x2cd7
movq %r11, (%r9,%r8,8)
movq (%rdi), %r8
movq %rdx, (%r8,%r10,8)
leal 0x1(,%r10,2), %edx
leal 0x2(,%r10,2), %r8d
cmpl %eax, %r8d
jge 0x2cc5
movq (%rdi), %r9
movslq %edx, %r10
movq (%r9,%r10,8), %r10
movq (%r10), %r11
movslq 0x8(%r10), %r10
shlq $0x4, %r10
movq (%r11,%r10), %rbx
movslq %r8d, %r14
movq (%r9,%r14,8), %r9
movq (%r9), %r14
movslq 0x8(%r9), %r9
shlq $0x4, %r9
cmpq (%r14,%r9), %rbx
movq 0x8(%r11,%r10), %r10
sbbq 0x8(%r14,%r9), %r10
jb 0x2cc0
movl %r8d, %edx
movb $0x1, %r8b
jmp 0x2cce
cmpl %ecx, %edx
sete %r8b
cmovnel %esi, %edx
testb %r8b, %r8b
jne 0x2c25
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: read_buffer
void  read_buffer(heap *h, heap_node *node){

//  fseek(h->f_in, node->seek*sizeof(pair), SEEK_SET);
    fseek(h->f_in, node->seek*(h->pos_size+h->lcp_size), SEEK_SET);

    int i;
    for(i=0; i<h->input_size; i++){
      node->buffer[i]=0;
      int e = fread(&node->buffer[i], h->pos_size+h->lcp_size, 1, h->f_in);
      if(e!=1) {perror(__func__); exit(1);}
      if(node->buffer[i]==MAX_KEY) break; 
    }

    node->seek += h->input_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x200(%rdi), %rdi
movslq 0x214(%r14), %rax
movslq 0x218(%r14), %rsi
addq %rax, %rsi
imulq 0x10(%rbx), %rsi
xorl %edx, %edx
callq 0x1140
cmpq $0x0, 0x220(%r14)
je 0x2db7
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rbx), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi,%r15)
addq %r15, %rdi
movslq 0x214(%r14), %rax
movslq 0x218(%r14), %rsi
addq %rax, %rsi
movq 0x200(%r14), %rcx
movl $0x1, %edx
callq 0x1090
cmpl $0x1, %eax
jne 0x2dce
movq (%rbx), %rax
movl 0x218(%r14), %edx
addl 0x214(%r14), %edx
shll $0x3, %edx
movb $-0x80, %cl
subb %dl, %cl
movq $-0x1, %rdx
shrq %cl, %rdx
testb $0x40, %cl
movq $-0x1, %rcx
cmovneq %rdx, %rcx
movl $0x0, %esi
cmoveq %rdx, %rsi
xorq 0x8(%rax,%r15), %rsi
xorq (%rax,%r15), %rcx
orq %rsi, %rcx
je 0x2db7
incq %r12
addq $0x10, %r15
cmpq %r12, 0x220(%r14)
ja 0x2d27
movq 0x220(%r14), %rax
addq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
callq 0x1308
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: heap_insert
int heap_insert(heap *h, size_t pos) {

  if (!h->heap[h->size])
    h->heap[h->size] = malloc(sizeof(heap_node));

  if (!h->heap[h->size]) 
    return errno = ENOMEM;

  heap_node *node = h->heap[h->size];

  //alloc buffer <pos, lcp>
  node->buffer = (pair*) malloc(h->input_size*sizeof(pair));
  if (!node->buffer) 
    return errno = ENOMEM;
  node->idx = 0;
  
  //load buffer
  node->seek = pos;
  read_buffer(h, node);

  #if DEBUG
    int i;
    for(i=0; i<h->input_size; i++) 
      printf("<%lu, %lu (%lu)> ", lcp(node->buffer[i]), pos(node->buffer[i]), node->buffer[i]);
    printf("**\n");
  #endif
  
  heapfy_up(h,h->size++);

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
movslq 0x8(%rdi), %r14
cmpq $0x0, (%r12,%r14,8)
jne 0x2e00
movl $0x18, %edi
callq 0x2fb6
movq %rax, (%r12,%r14,8)
movq (%rbx), %rax
movq (%rax,%r14,8), %r14
testq %r14, %r14
je 0x2ed7
movq 0x220(%rbx), %rdi
shlq $0x4, %rdi
callq 0x2fb6
movq %rax, (%r14)
testq %rax, %rax
je 0x2ed7
movl $0x0, 0x8(%r14)
movq %r15, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ce1
cmpq $0x0, 0x220(%rbx)
je 0x2eb6
leaq 0x172c(%rip), %r12      # 0x4580
leaq 0x1706(%rip), %r15      # 0x4561
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r14), %rcx
movq (%rcx,%r13), %rax
movq 0x8(%rcx,%r13), %r8
movslq 0x218(%rbx), %rdx
leal (,%rdx,8), %ecx
movq %r8, %rdi
shrq %cl, %rdi
shlq $0x4, %rdx
movq (%rdx,%r12), %rsi
movq %rax, %rdx
shrdq %cl, %r8, %rdx
andq %rax, %rsi
testb $0x40, %cl
cmovneq %rdi, %rdx
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x10d0
incq %rbp
addq $0x10, %r13
cmpq %rbp, 0x220(%rbx)
ja 0x2e60
leaq 0x1583(%rip), %rdi      # 0x4440
callq 0x1080
movl 0x8(%rbx), %esi
leal 0x1(%rsi), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x2b53
xorl %eax, %eax
jmp 0x2ee7
callq 0x1050
movl $0xc, (%rax)
movl $0xc, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/felipelouza[P]egap/tools/heap.c
// Function: heap_delete_min
pair heap_delete_min(heap *h) {

  heap_node *node = h->heap[0];

  pair tmp=0;
  tmp= node->buffer[node->idx];

  if(++node->idx == h->input_size){ //load from disk
    node->idx = 0; 
    read_buffer(h, node);
  }

  heapfy_down(h,0);
  
  return tmp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movslq 0x8(%rsi), %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movq (%rax,%rdx), %r14
movq 0x8(%rax,%rdx), %r15
incq %rcx
movl %ecx, 0x8(%rsi)
cmpq %rcx, 0x220(%rdi)
jne 0x2f39
movl $0x0, 0x8(%rsi)
movq %rbx, %rdi
callq 0x2ce1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2bbb
movq %r14, %rax
movq %r15, %rdx
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: initialize
int initialize(FILE *fileName, DocumentNode *documentArray){
    int maxLength = 1, curLength = 0, lineId = 0, docWords;
    char lineBuffer[100000], *newDoc;

    // start reading the file until EOF is read
    while(fgets(lineBuffer, 99999, fileName)){                  // read docfile contents
        strtok(lineBuffer, "\n");                               // remove the useless \n character at the end of the line

        curLength = strlen(lineBuffer);
        if( curLength > maxLength)
            maxLength = curLength;

        // every document will have the length of the line read
        newDoc = (char *) malloc(strlen(lineBuffer) +1);
        // copy the useful content (just the text) of lineBuffer to newDoc
        strcpy(newDoc, lineBuffer);

        docWords = 1;                                           // init at 1 so we don't have to increment it for this instance
        strtok(lineBuffer, "/");

        while((strtok(NULL, "/"))){                             // count the path's words
            docWords++;
        }

        addDocument(documentArray, lineId, newDoc, docWords);   // add document to our array
        lineId++;
    }
    return maxLength;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x186b8, %rsp          # imm = 0x186B8
movq %rsi, -0x38(%rbp)
movq %rdi, %rdx
leaq -0x186e0(%rbp), %rdi
movl $0x1869f, %esi          # imm = 0x1869F
movq %rdx, -0x30(%rbp)
callq 0x2170
movl $0x1, %r15d
testq %rax, %rax
je 0x2922
xorl %r13d, %r13d
leaq -0x186e0(%rbp), %rbx
leaq 0x29d9(%rip), %r12      # 0x5269
movq %rbx, %rdi
leaq 0x2bc4(%rip), %rsi      # 0x545e
callq 0x22d0
movq %rbx, %rdi
callq 0x20d0
movq %rax, %r14
leaq 0x1(%rax), %rdi
callq 0x2240
movq %rax, -0x40(%rbp)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2050
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22d0
xorl %ebx, %ebx
xorl %edi, %edi
movq %r12, %rsi
callq 0x22d0
incl %ebx
testq %rax, %rax
jne 0x28cf
cmpl %r14d, %r15d
cmovlel %r14d, %r15d
movq %r13, %rax
shlq $0x4, %rax
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq %rdx, (%rcx,%rax)
movl %ebx, 0x8(%rcx,%rax)
incq %r13
leaq -0x186e0(%rbp), %rbx
movq %rbx, %rdi
movl $0x1869f, %esi          # imm = 0x1869F
movq -0x30(%rbp), %rdx
callq 0x2170
testq %rax, %rax
jne 0x2890
movl %r15d, %eax
addq $0x186b8, %rsp          # imm = 0x186B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: destroyDocuments
void destroyDocuments(DocumentNode *documentNodes, int nLines){
    int i;

    for (i = 0;i < nLines; i++)
        free(documentNodes[i].text);
    free(documentNodes);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
jle 0x2979
movl %esi, %r14d
shlq $0x4, %r14
xorl %r15d, %r15d
movq (%rbx,%r15), %rdi
callq 0x2030
addq $0x10, %r15
cmpq %r15, %r14
jne 0x2967
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: determineWorkload
int determineWorkload(int nDocs, int numWorkers, int *remainder){
    int increment = 0;

    if ((nDocs % numWorkers) == 0){
        increment = nDocs / numWorkers;            // determine how many files each worker will get
    }
    else if ((nDocs % numWorkers) > 0){
        increment = nDocs / numWorkers;
        (*remainder) = nDocs % numWorkers;
    }

    return increment;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdx, %rcx
movl %edi, %eax
cltd
idivl %esi
testl %edx, %edx
je 0x29a1
jle 0x29a8
movl %edx, (%rcx)
jmp 0x29aa
movl %edi, %eax
cltd
idivl %esi
jmp 0x29aa
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: splitWorkload
int *splitWorkload(int increment, int *remainder, int numWorkers) {
    int i, *workerLoad;

    workerLoad = (int *) malloc(sizeof(int) * numWorkers);

    for(i = 0; i < numWorkers; i++){
        if(*remainder > 0) {
            workerLoad[i] = increment + 1;          // split the remainder between the workers
            (*remainder)--;
        }
        else
            workerLoad[i] = increment;
    }

    return workerLoad;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %rbx
movl %edi, %r14d
movslq %edx, %r12
leaq (,%r12,4), %rdi
callq 0x2240
testl %r12d, %r12d
jle 0x29f9
leal 0x1(%r14), %ecx
movl (%rbx), %edx
movl %r15d, %esi
xorl %edi, %edi
testl %edx, %edx
jle 0x29ed
movl %ecx, (%rax,%rdi,4)
decl %edx
movl %edx, (%rbx)
jmp 0x29f1
movl %r14d, (%rax,%rdi,4)
incq %rdi
cmpq %rdi, %rsi
jne 0x29e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: distributeDocs
void distributeDocs(DocumentNode *documentArray, int *incrementArray, int numWorkers, int *fdIn){
    int i, j, lines = 0;
    char tempSize[5], sizeTriple[4] = "000", sizeDouble[3] = "00", sizeSimple[2] = "0";

    for(i = 0; i < numWorkers; i++){
        for(j = 0; j < incrementArray[i]; j++){
            // Pipe atomicity is guaranteed at 4096 bytes max so make the size payload contain 4 digits
            if(strlen(documentArray[lines].text) < 10 )
                sprintf(tempSize, "%s%d",sizeTriple, (int) strlen(documentArray[lines].text));
            else if(strlen(documentArray[lines].text) < 100)
                sprintf(tempSize, "%s%d", sizeDouble, (int) strlen(documentArray[lines].text));
            else if(strlen(documentArray[lines].text) < 1000)
                sprintf(tempSize, "%s%d", sizeSimple, (int) strlen(documentArray[lines].text));

            if((write(fdIn[i], tempSize, strlen(tempSize))) == -1)
                perror("write");

            if((write(fdIn[i], documentArray[lines].text, strlen(documentArray[lines].text))) == -1)
                perror("write");

            lines++;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, -0x58(%rbp)
movl $0x303030, -0x3c(%rbp)  # imm = 0x303030
movb $0x0, -0x2c(%rbp)
movw $0x3030, -0x2e(%rbp)    # imm = 0x3030
movw $0x30, -0x2a(%rbp)
testl %edx, %edx
jle 0x2b39
movq %rcx, %r12
movl %edx, %eax
movq %rax, -0x60(%rbp)
xorl %ebx, %ebx
xorl %ecx, %ecx
movq -0x50(%rbp), %rax
cmpl $0x0, (%rax,%rbx,4)
jle 0x2b2c
movl %ecx, -0x34(%rbp)
movslq %ecx, %r13
shlq $0x4, %r13
addq -0x58(%rbp), %r13
xorl %edx, %edx
movl %edx, -0x38(%rbp)
movq (%r13), %rdi
callq 0x20d0
leaq -0x3c(%rbp), %rdx
cmpq $0xa, %rax
jb 0x2a91
leaq -0x2e(%rbp), %rdx
cmpq $0x64, %rax
jb 0x2a91
leaq -0x2a(%rbp), %rdx
cmpq $0x3e7, %rax            # imm = 0x3E7
ja 0x2aa5
leaq -0x41(%rbp), %rdi
leaq 0x26ea(%rip), %rsi      # 0x5186
movl %eax, %ecx
xorl %eax, %eax
callq 0x2320
movl (%r12,%rbx,4), %r15d
leaq -0x41(%rbp), %r14
movq %r14, %rdi
callq 0x20d0
movl %r15d, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2090
cmpq $-0x1, %rax
je 0x2b0b
movq %r12, %r14
movl (%r12,%rbx,4), %r15d
movq (%r13), %r12
movq %r12, %rdi
callq 0x20d0
movl %r15d, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2090
cmpq $-0x1, %rax
je 0x2b19
movl -0x38(%rbp), %edx
incl %edx
addq $0x10, %r13
movq -0x50(%rbp), %rax
cmpl (%rax,%rbx,4), %edx
movq %r14, %r12
jl 0x2a65
jmp 0x2b27
leaq 0x2679(%rip), %rdi      # 0x518b
callq 0x22c0
jmp 0x2ac9
leaq 0x266b(%rip), %rdi      # 0x518b
callq 0x22c0
jmp 0x2af0
movl -0x34(%rbp), %ecx
addl %edx, %ecx
incq %rbx
cmpq -0x60(%rbp), %rbx
jne 0x2a47
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/utilities.c
// Function: countWords
int countWords(char *query){
    int counter = 0, queryLength = strlen(query), i = 0;

    if (!strcmp(query, ""))
        return 0;

    while (i++ <= queryLength && counter < 10){
        if (*query == ' ' || *query == '\t' || *query == '\0')
            counter++;      // increase the number of words
        query++;            // go to next character
    }
    return counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20d0
cmpb $0x0, (%rbx)
setne %cl
testl %eax, %eax
setns %dl
andb %cl, %dl
xorl %ecx, %ecx
cmpb $0x1, %dl
jne 0x2ddd
xorl %edx, %edx
movabsq $0x100000201, %rsi      # imm = 0x100000201
xorl %ecx, %ecx
movzbl (%rbx,%rdx), %edi
cmpq $0x20, %rdi
ja 0x2dd1
btq %rdi, %rsi
jae 0x2dd1
incl %ecx
incq %rdx
cmpl %eax, %edx
jg 0x2ddd
cmpl $0xa, %ecx
jl 0x2dbf
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: place
void place(pool_t *pool, char *url) {

    pthread_mutex_lock(&mtx);

    while (pool->count >= POOL_SIZE){
        pthread_cond_wait(&cond_nonfull, &mtx);
    }
    pool->end = (pool->end + 1) % POOL_SIZE;

    strcpy(pool->url[pool->end], url);
    pool->count++;

    pthread_mutex_unlock(&mtx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x574b(%rip), %rdi      # 0x8598
callq 0x23b0
cmpl $0x32, 0x1390(%rbx)
jl 0x2e7d
leaq 0x57b6(%rip), %r15      # 0x8618
leaq 0x572f(%rip), %r12      # 0x8598
movq %r15, %rdi
movq %r12, %rsi
callq 0x20a0
cmpl $0x31, 0x1390(%rbx)
jg 0x2e69
movl 0x138c(%rbx), %eax
movl %eax, %ecx
incl %ecx
movslq %ecx, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x24, %rcx
addl %edx, %ecx
imull $0x32, %ecx, %ecx
negl %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x138c(%rbx)
cltq
imulq $0x64, %rax, %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x2050
incl 0x1390(%rbx)
leaq 0x56cd(%rip), %rdi      # 0x8598
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: obtain
char  *obtain(pool_t *pool) {
    char *url;

    pthread_mutex_lock(&mtx);

    while (pool->count <= 0){
        ready++;
        pthread_cond_wait(&cond_nonempty, &mtx);
    }
    url = pool->url[pool->end];

    pool->start = (pool->start + 1) % POOL_SIZE;
    pool->count--;
    pthread_mutex_unlock(&mtx);

    return url;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x56ac(%rip), %rdi      # 0x8598
callq 0x23b0
movl 0x1390(%rbx), %eax
testl %eax, %eax
jg 0x2f24
leaq 0x56e6(%rip), %r14      # 0x85e8
leaq 0x568f(%rip), %r15      # 0x8598
incl 0x5741(%rip)            # 0x8650
movq %r14, %rdi
movq %r15, %rsi
callq 0x20a0
movl 0x1390(%rbx), %eax
testl %eax, %eax
jle 0x2f09
movslq 0x138c(%rbx), %rcx
imulq $0x64, %rcx, %r14
addq %rbx, %r14
movl 0x1388(%rbx), %ecx
movl %ecx, %edx
incl %edx
movslq %edx, %rdx
imulq $0x51eb851f, %rdx, %rdx # imm = 0x51EB851F
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x24, %rdx
addl %esi, %edx
imull $0x32, %edx, %edx
negl %edx
addl %edx, %ecx
incl %ecx
movl %ecx, 0x1388(%rbx)
decl %eax
movl %eax, 0x1390(%rbx)
leaq 0x5627(%rip), %rdi      # 0x8598
callq 0x2230
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: readSaveFolder
void readSaveFolder(char *path){
    DIR *dp;
    struct dirent *dir;
    char *newName;
    if((dp = opendir(path)) == NULL){                       // Open directory
        perror("save_dir opendir");
        return;
    }
    while((dir = readdir(dp)) != NULL){                     // Read contents till the end
        if(dir->d_ino == 0)                                 // Ignore removed entries
            continue;
        newName = malloc(strlen(path)+strlen(dir->d_name)+2);
        strcpy(newName, path);                              // Compose pathname

        if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..") ) { //Filter out
            //do nothing
        }
        else{
            strcat(newName, dir->d_name);
            strcat(newName, "/");
            insertDocfile(newName);
        }
        free(newName);
    }
    closedir(dp);                                           // Close directory
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20c0
testq %rax, %rax
je 0x35be
movq %rax, %r14
movq %rax, %rdi
callq 0x2220
testq %rax, %rax
je 0x35a8
movq %rax, %r13
leaq 0x2001(%rip), %r15      # 0x5510
cmpq $0x0, (%r13)
je 0x3594
movq %rbx, %rdi
callq 0x20d0
movq %rax, %r12
addq $0x13, %r13
movq %r13, %rdi
callq 0x20d0
leaq (%r12,%rax), %rdi
addq $0x2, %rdi
callq 0x2240
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2050
movq %r13, %rdi
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x358c
movq %r13, %rdi
leaq 0x1fae(%rip), %rsi      # 0x550f
callq 0x2190
testl %eax, %eax
je 0x358c
movq %r12, %rdi
movq %r13, %rsi
callq 0x2310
movq %r12, %rdi
callq 0x20d0
movw $0x2f, (%r12,%rax)
movq %r12, %rdi
callq 0x3dc0
movq %r12, %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2220
movq %rax, %r13
testq %rax, %rax
jne 0x350f
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2140
leaq 0x1ef9(%rip), %rdi      # 0x54be
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x22c0
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: prepareReq
int prepareReq(char *domain, int port, char *path, int sockfd){
    char request[500];

    sprintf(request, "GET %s HTTP/1.1\nUser-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)\nHost: %s\nAccept-Language: en-us\nAccept-Encoding: gzip, deflate\nConnection: Keep-Alive\n\n", path, domain);
    customWrite(sockfd, request, strlen(request));

    return (int) strlen(request);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %ecx, %ebx
movq %rdi, %rcx
leaq 0x1a24(%rip), %rsi      # 0x53bd
leaq -0x210(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2320
movq %r14, %rdi
callq 0x20d0
movl %ebx, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x36b2
movq %r14, %rdi
callq 0x20d0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: getHeaderSize
int getHeaderSize(char *header){
    char *size;
    int headerSize = 0, start, end;

    start = strlen(header);
    size = strstr(header, "<!DOCTYPE html>");
    end = strlen(size);

    headerSize = start - end;

    return headerSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x20d0
movq %rax, %r14
leaq 0x1a3f(%rip), %rsi      # 0x5471
movq %rbx, %rdi
callq 0x23a0
movq %rax, %rdi
callq 0x20d0
subl %eax, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: createSaveFile
FILE *createSaveFile(char *path, char *save_dir){
    char folderName[200], saveDir[200], *folder, tempPath[200];
    FILE *file;
    struct stat st = {0};

    strcpy(saveDir, "./");
    strcat(saveDir, save_dir);
    strcat(saveDir, "/");

    if (stat(saveDir, &st) == -1) {
        if(mkdir(saveDir, 0700) == -1)                  // Create parent dir
            perror("parent mkdir");
    }
    strcpy(tempPath,path);
    folder = strtok(tempPath, "/");

    strcat(saveDir, folder);

    if (stat(saveDir, &st) == -1) {
        if(mkdir(saveDir, 0700) == -1)                  // Create siteX dir
            perror("subdir mkdir");
    }

    strcpy(folderName, save_dir);
    strcat(folderName, path);

    file = fopen(folderName, "w+");                     // Create desired file

    if(file == NULL){
        perror_exit("fopen");
    }

    return file;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x300, %rsp            # imm = 0x300
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x180(%rbp), %r15
movl $0x90, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2120
leaq -0xf0(%rbp), %r12
movw $0x2f2e, (%r12)         # imm = 0x2F2E
movb $0x0, 0x2(%r12)
movq %r12, %rdi
movq %r14, %rsi
callq 0x2310
movq %r12, %rdi
callq 0x20d0
movw $0x2f, -0xf0(%rbp,%rax)
movq %r12, %rdi
movq %r15, %rsi
callq 0x21e0
cmpl $-0x1, %eax
jne 0x3af0
leaq -0xf0(%rbp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2060
cmpl $-0x1, %eax
je 0x3b8e
leaq -0x250(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2050
leaq 0x1760(%rip), %rsi      # 0x5269
movq %r15, %rdi
callq 0x22d0
leaq -0xf0(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x2310
leaq -0x180(%rbp), %rsi
movq %r15, %rdi
callq 0x21e0
cmpl $-0x1, %eax
jne 0x3b4d
leaq -0xf0(%rbp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2060
cmpl $-0x1, %eax
je 0x3b9f
leaq -0x320(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2050
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2310
leaq 0x192a(%rip), %rsi      # 0x549b
movq %r15, %rdi
callq 0x22b0
testq %rax, %rax
je 0x3bad
addq $0x300, %rsp            # imm = 0x300
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18ec(%rip), %rdi      # 0x5481
callq 0x22c0
jmp 0x3af0
leaq 0x18e8(%rip), %rdi      # 0x548e
callq 0x22c0
jmp 0x3b4d
callq 0x2410
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: searchUrl
char *searchUrl(char *inputFile, pool_t *pool){
    char *ahref, *relativeUrl, *temp, *saveptr, *fullpath, *finalUrl = NULL;
    int exists = 0;

    temp = (char *) malloc(strlen(inputFile) + 1);

    while ((ahref = strstr(inputFile, "<a href="))) {
        strcpy(temp, ahref);
        relativeUrl = strtok_r(temp + 8, "\"", &saveptr);                                       // Thread safe strtok

        finalUrl = (char *) malloc(strlen(relativeUrl) + 1);
        fullpath = (char *) malloc(strlen("./save_dir") + strlen(relativeUrl) + 1);

        finalUrl = stringReplace(relativeUrl, finalUrl);

        strcpy(fullpath, "save_dir");
        strcat(fullpath, finalUrl);                                                             // Pass relative path to access

        if ((searchPool(pool, finalUrl) == 1) && ((!fileExist(fullpath)))) {   					// Url doesnt exist anywhere
            place(pool, finalUrl);
        }
        if(inputFile != NULL)
            inputFile = ahref + 8;                                                              // Move pointer after a href
    }
    free(temp);
    free(finalUrl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, -0x30(%rbp)
movq %rdi, %r14
callq 0x20d0
leaq 0x1(%rax), %rdi
callq 0x2240
movq %rax, %rbx
leaq 0x18bf(%rip), %rsi      # 0x54a4
movq %r14, -0x40(%rbp)
movq %r14, %rdi
callq 0x23a0
testq %rax, %rax
je 0x3cda
movq %rax, %r12
movq %rbx, %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq %rbx, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2050
movq -0x38(%rbp), %rdi
leaq 0x188c(%rip), %rsi      # 0x54ad
leaq -0x48(%rbp), %rdx
callq 0x2150
movq %rax, %rbx
movq %rax, %rdi
callq 0x20d0
movq %rax, %r13
leaq 0x1(%rax), %rdi
callq 0x2240
movq %rax, %r15
addq $0xb, %r13
movq %r13, %rdi
callq 0x2240
movq %rax, %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3cff
movabsq $0x7269645f65766173, %rax # imm = 0x7269645F65766173
movq %rax, (%r13)
movb $0x0, 0x8(%r13)
movq %r13, %rdi
movq %r15, %rsi
callq 0x2310
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x3d4b
testl %eax, %eax
je 0x3cab
movq %r13, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21e0
testl %eax, %eax
je 0x3cab
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x2e35
addq $0x8, %r12
movq -0x40(%rbp), %rax
testq %rax, %rax
cmoveq %rax, %r12
movq %r12, %rdi
leaq 0x17e0(%rip), %rsi      # 0x54a4
callq 0x23a0
movq %rax, %r12
testq %rax, %rax
movq %r14, %rbx
jne 0x3c08
jmp 0x3cdd
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2030
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: stringReplace
char *stringReplace(char *string, char *output){

    if((strstr(string, "..")) != NULL){                             // If the file is like "../siteX/"
        string += 2;
    }
    else if(strstr(string, "./") != NULL)                           // If the file is like "./siteY/"
        string++;

    strcpy(output, string);

    return output;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x17fc(%rip), %rsi      # 0x550f
callq 0x23a0
movl $0x2, %ecx
testq %rax, %rax
jne 0x3d39
leaq 0x153f(%rip), %rsi      # 0x5268
movq %r14, %rdi
callq 0x23a0
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
addq %rcx, %r14
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: searchPool
int searchPool(pool_t *pool, char *url){
    int max, i;
    max = pool->count;
    for (i = 0; i <= max; i++) {
        if (!strcmp(url, pool->url[i]))                             // Url exists in pool
            return 0;
    }

    return 1;                                                       // Url doesnt exist
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x1390(%rdi), %r12d
movl $0x1, %ebx
testl %r12d, %r12d
js 0x3d8c
movq %rsi, %r14
movq %rdi, %r15
incq %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x3d8a
addq $0x64, %r15
decq %r12
jne 0x3d70
jmp 0x3d8c
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/support.c
// Function: insertDocfile
void insertDocfile(char *path){
    FILE *file;

    file = fopen("docfile", "a");                          	// Create desired file

    if(file == NULL){
        perror_exit("fopen");
    }

    fprintf(file, "%s\n", path);

    fclose(file);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x14e1(%rip), %rdi      # 0x52b2
leaq 0x16e0(%rip), %rsi      # 0x54b8
callq 0x22b0
testq %rax, %rax
je 0x3e05
movq %rax, %r14
leaq 0x16ce(%rip), %rsi      # 0x54ba
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20b0
callq 0x2428
nop
// File: /workspace/github_c_makefile_star2_O1/devkot[P]SearchEngine/Crawler/jobexec.c
// Function: cleanUp
void cleanUp(int numWorkers, DocumentNode *documentArray, int nDocs) {
    int i;
    char pipeOut[50], pipeIn[50];

    for (i = 0; i < numWorkers; i++) {
        sprintf(pipeIn, "/tmp/fifo_%d_in", i);
        sprintf(pipeOut, "/tmp/fifo_%d_out", i);

        close(fdIn[i]);
        close(fdOut[i]);

        unlink(pipeIn);
        unlink(pipeOut);
    }

    destroyDocuments(documentArray, nDocs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
testl %edi, %edi
jle 0x4139
movl %edi, %r15d
leaq -0x70(%rbp), %r12
leaq -0xb0(%rbp), %rbx
leaq 0x4592(%rip), %r13      # 0x8668
xorl %r14d, %r14d
movq %r12, %rdi
leaq 0x14d6(%rip), %rsi      # 0x55b9
movl %r14d, %edx
xorl %eax, %eax
callq 0x2320
movq %rbx, %rdi
leaq 0x14d2(%rip), %rsi      # 0x55c9
movl %r14d, %edx
xorl %eax, %eax
callq 0x2320
leaq 0x4558(%rip), %rax      # 0x8660
movq (%rax), %rax
movl (%rax,%r14,4), %edi
callq 0x2130
movq (%r13), %rax
movl (%rax,%r14,4), %edi
callq 0x2130
movq %r12, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
incq %r14
cmpq %r14, %r15
jne 0x40d9
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x294c
// File: /workspace/github_c_makefile_star2_O1/adelciotto[P]scg/examples/basic.c
// Function: main
int main(int arcg, char *argv[]) {
    scg_config_t config = scg_config_new_default();
    config.video.title = "SCG Example: Basic";

    scg_app_t app;
    scg_app_init(&app, config);

    while (scg_app_process_events(&app)) {
        draw(app.draw_target);

        scg_app_present(&app);
    }

    scg_app_free(&app);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movabsq $0x1e000000280, %rax    # imm = 0x1E000000280
movq %rax, 0x38(%rsp)
movl $0x1, 0x48(%rsp)
xorl %eax, %eax
movb %al, 0x4c(%rsp)
movl $0x1010101, 0x4d(%rsp)  # imm = 0x1010101
movb %al, 0x54(%rsp)
movl $0x40, 0x58(%rsp)
leaq 0x107e(%rip), %rax      # 0x659c
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3e81
movq %rbx, %rdi
callq 0x49dc
testb %al, %al
je 0x566e
movss 0xaa7(%rip), %xmm3      # 0x600c
movq 0x98(%rsp), %r15
movl (%r15), %ebx
movl 0x4(%r15), %r13d
testl %r13d, %r13d
jle 0x561a
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss 0xa7c(%rip), %xmm2      # 0x6008
movaps %xmm2, %xmm4
xorps %xmm1, %xmm1
cvtsi2ss %r13d, %xmm1
divss %xmm0, %xmm4
divss %xmm1, %xmm2
movss %xmm2, 0x30(%rsp)
xorl %ebp, %ebp
movss %xmm4, 0x34(%rsp)
testl %ebx, %ebx
jle 0x5613
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
mulss 0x30(%rsp), %xmm0
mulss %xmm3, %xmm0
cvttss2si %xmm0, %eax
shll $0x8, %eax
movzwl %ax, %r14d
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
mulss %xmm4, %xmm0
mulss %xmm3, %xmm0
cvttss2si %xmm0, %ecx
shll $0x10, %ecx
orl %r14d, %ecx
orl $0xff000080, %ecx       # imm = 0xFF000080
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x2b68
movss 0x34(%rsp), %xmm4
movss 0xa01(%rip), %xmm3      # 0x600c
incl %r12d
cmpl %r12d, %ebx
jne 0x55d0
incl %ebp
cmpl %r13d, %ebp
jne 0x55ad
movl %ebx, %edx
shrl $0x1f, %edx
addl %ebx, %edx
sarl %edx
movl %r13d, %ecx
shrl $0x1f, %ecx
addl %r13d, %ecx
sarl %ecx
movq %r15, %rdi
leaq 0x1b6a(%rip), %rsi      # 0x71a2
movl $0x1, %r8d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
callq 0x3977
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x4b28
movq %rbx, %rdi
callq 0x49dc
movss 0x9a6(%rip), %xmm3      # 0x600c
testb %al, %al
jne 0x5565
leaq 0x60(%rsp), %rdi
callq 0x4ff7
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: match_rule
int match_rule (struct _token * tokens)
{
    struct _token * next;
    int i, j;

    for (i = 0; rule_matrix[i][0] != ASSEM_TERM; i++) {
        j = 0;
        next = tokens;
        while (1) {
            if (rule_matrix[i][j] == ASSEM_TERM)
                return i;
            if (next == NULL)
                break;
            if (rule_matrix[i][j] != token_to_assem(next))
                break;
            next = next->next;
            j++;
        }
    }
    return -1;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpb $-0x71, 0x6cca(%rip)    # 0x9180
je 0x2519
pushq %rbx
leaq 0x6cc1(%rip), %rdx      # 0x9181
xorl %ecx, %ecx
leaq 0x6cb7(%rip), %rsi      # 0x9180
movl $0x80, %r8d
movb (%rsi,%rcx,8), %r10b
cmpb $-0x71, %r10b
je 0x2516
movq %rdx, %r9
movq %rdi, %r11
testq %r11, %r11
je 0x2505
movl (%r11), %ebx
cmpl $0xb, %ebx
cmovbl %r8d, %ebx
cmpb %bl, %r10b
jne 0x2505
movq 0x10(%r11), %r11
movb (%r9), %r10b
incq %r9
cmpb $-0x71, %r10b
jne 0x24df
jmp 0x2516
addq $0x8, %rdx
cmpb $-0x71, 0x8(%rsi,%rcx,8)
leaq 0x1(%rcx), %rcx
jne 0x24cf
jmp 0x2518
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: advance_token
struct _token * advance_token (struct _token * token, int steps)
{
    int i;
    for (i = 0; i < steps; i++) {
        token = token->next;
    }
    return token;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
jle 0x2548
movq 0x10(%rax), %rax
decl %esi
jne 0x2540
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: token_peek
struct _token * token_peek (struct _token * token, int depth)
{
    int i;
    for (i = 0; i < depth; i++) {
        token = token->next;
    }
    return token;
}

// Assembly:
movq %rdi, %rax
testl %esi, %esi
jle 0x2558
movq 0x10(%rax), %rax
decl %esi
jne 0x2550
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: label_create
struct _label * label_create (const char * str, uint16_t location)
{
    struct _label * label;

    label = (struct _label *) malloc(sizeof(struct _label));
    label->str = (char *) malloc(strlen(str) + 1);
    strcpy(label->str, str);
    label->location = location;
    label->next = NULL;

    return label;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x18, %edi
callq 0x21f0
movq %rax, %r15
movq %r14, %rdi
callq 0x2100
leaq 0x1(%rax), %rdi
callq 0x21f0
movq %rax, (%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x20a0
movw %bx, 0x8(%r15)
movq $0x0, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: labels_append
void labels_append (struct _labels * labels, struct _label * label)
{
    if (labels->first == NULL) {
        labels->first = label;
        labels->last  = label;
    }
    else {
        labels->last->next = label;
        labels->last = label;
    }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x25b9
movq 0x8(%rdi), %rax
addq $0x8, %rdi
movq %rsi, 0x10(%rax)
jmp 0x25c0
movq %rsi, (%rdi)
addq $0x8, %rdi
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: get_tokens
struct _token * get_tokens (const char * filename)
{
    FILE * fh;
    size_t filesize;
    char * buf;

    fh = fopen(filename, "r");
    if (fh == NULL) {
        fprintf(stderr, "could not open file %s\n", filename);
        return NULL;
    }

    fseek(fh, 0, SEEK_END);
    filesize = ftell(fh);
    fseek(fh, 0, SEEK_SET);

    buf = (char *) malloc(filesize + 1);

    fread(buf, 1, filesize, fh);
    buf[filesize] = '\0';

    fclose(fh);

    struct _token * tokens = lexer(buf);

    if (tokens == NULL)
        printf("lexer error in file: %s\n", filename);

    free(buf);

    return tokens;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3b42(%rip), %rsi      # 0x66d7
callq 0x2270
testq %rax, %rax
je 0x2c31
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2210
movq %r14, %rdi
callq 0x21d0
movq %rax, %r12
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2210
leaq 0x1(%r12), %rdi
callq 0x21f0
movq %rax, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r12, %rdx
movq %r14, %rcx
callq 0x20d0
movb $0x0, (%r15,%r12)
movq %r14, %rdi
callq 0x20f0
movq %r15, %rdi
callq 0x32f7
movq %rax, %r14
testq %rax, %rax
jne 0x2c1a
leaq 0x365c(%rip), %rdi      # 0x626c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2120
movq %r15, %rdi
callq 0x2040
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x63c0(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x3612(%rip), %rsi      # 0x6254
xorl %r14d, %r14d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
jmp 0x2c22
// File: /workspace/github_c_makefile_star2_O1/endeav0r[P]hsvm/src/assembler.c
// Function: write_mem
int write_mem (const char * filename, unsigned char * mem, int mem_size)
{
    FILE * fh;

    fh = fopen(filename, "wb");
    if (fh == NULL) {
        fprintf(stderr, "could not open file %s\n", filename);
        return -1;
    }

    fwrite(mem, 1, mem_size, fh);

    fclose(fh);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x361e(%rip), %rsi      # 0x6285
callq 0x2270
testq %rax, %rax
je 0x2c9c
movq %rax, %r15
movslq %ebp, %rdx
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x22c0
movq %r15, %rdi
callq 0x20f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6355(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x35a7(%rip), %rsi      # 0x6254
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2c91
// File: /workspace/github_c_makefile_star2_O1/FastFilter[P]BlockBloomSimulator/src/windowedblockmodel.h
// Function: findBestBitsPerKeyPerBlockWindow
size_t findBestBitsPerKeyPerBlockWindow(size_t HowManyKeys, size_t bitbudget,
                                  size_t BlockSizeInBits, size_t WindowSizeInBits,
                                  sim_stats_t *beststats, bool verbose) {
  windowed_model_t m;
  m.TotalBits = bitbudget;
  m.BlockSizeInBits = BlockSizeInBits;
  m.WindowSizeInBits = WindowSizeInBits;
  size_t howmanytests = 50000;
  bitset_t *b = bitset_create_with_capacity(bitbudget);
  beststats->collision_rate = 1.0;
  size_t BestBitsPerKeyPerBlock = 0;
  for (size_t BitsPerKeyPerBlock = 1;
       (BitsPerKeyPerBlock <= 16) ||
       (BestBitsPerKeyPerBlock == BitsPerKeyPerBlock);
       BitsPerKeyPerBlock++) {
    m.BitsPerKeyPerBlock = BitsPerKeyPerBlock;
    // we take the average of several attempts
    //double collisionrate = 0;
    sim_stats_t s;
    s.collision_rate = 0;
    s.density = 0;
    size_t attempts = HowManyKeys < 10000000 ? 5 : 1;
    for (int i = 0; i < attempts; i++) {
      sim_stats_t ts = simulateWindow(HowManyKeys, m, howmanytests, b);
      s.density += ts.density;
      s.collision_rate += ts.collision_rate;
    }
    s.collision_rate /= attempts;
    s.density /= attempts;

    if (s.collision_rate * 1.01 <
        beststats->collision_rate) { // has to be at least one percent better
      beststats->collision_rate = s.collision_rate;
      beststats->density = s.density; 
      BestBitsPerKeyPerBlock = BitsPerKeyPerBlock;
    }
  }
  bitset_free(b);
  return BestBitsPerKeyPerBlock;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movq %rdi, %r14
movq %rsi, 0x50(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movq %rsi, %rdi
callq 0x1da4
movq %rax, %r15
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
xorl %ecx, %ecx
cmpq $0x989680, %r14         # imm = 0x989680
setb %cl
leaq 0x1(,%rcx,4), %rcx
movq %rcx, 0x30(%rsp)
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rax, (%rbx)
movl $0x1, %ebp
xorl %r12d, %r12d
movq %rbp, 0x48(%rsp)
xorps %xmm2, %xmm2
movq 0x30(%rsp), %r13
xorps %xmm3, %xmm3
movsd %xmm3, 0x38(%rsp)
movsd %xmm2, 0x40(%rsp)
movupd 0x48(%rsp), %xmm0
movupd 0x58(%rsp), %xmm1
movupd %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
movl $0xc350, %esi           # imm = 0xC350
movq %r14, %rdi
movq %r15, %rdx
callq 0x1273
movsd 0x38(%rsp), %xmm3
movsd 0x40(%rsp), %xmm2
addsd %xmm1, %xmm3
addsd %xmm0, %xmm2
decq %r13
jne 0x15d5
divsd 0x28(%rsp), %xmm2
movapd %xmm2, %xmm0
mulsd 0x1a3d(%rip), %xmm0     # 0x3070
movsd (%rbx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x164f
divsd 0x28(%rsp), %xmm3
movsd %xmm2, (%rbx)
movsd %xmm3, 0x8(%rbx)
movq %rbp, %r12
incq %rbp
cmpq $0x11, %rbp
setb %al
cmpq %rbp, %r12
sete %cl
orb %al, %cl
jne 0x15c5
movq %r15, %rdi
callq 0x20d1
movq %r12, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FastFilter[P]BlockBloomSimulator/src/windowedblockmodel.h
// Function: assessWindowedBlockSize
void assessWindowedBlockSize(size_t HowManyKeys, size_t BlockSizeInBits, size_t WindowSizeInBits, bool verbose) {
  for (size_t bitsperkey = 8; bitsperkey <= 16; bitsperkey += 4) {
    size_t bitbudget = bitsperkey * HowManyKeys;
    sim_stats_t beststats;
    size_t bestbitsperbucket = findBestBitsPerKeyPerBlockWindow(
        HowManyKeys, bitbudget, BlockSizeInBits, WindowSizeInBits, &beststats, verbose);
    double density = bestbitsperbucket * 1.0 / bitsperkey;

    double theoretical_best_bits = log(1.0/beststats.collision_rate) / log(2.0);
    double inefficiency = (bitsperkey/theoretical_best_bits - 1.0) * 100.0;
    

    printf("bits per key %3zu WindowSizeInBits %3zu best bits per bucket = %zu, max density = %0.0f %%, density = %0.0f %%, collision rate = "
           "%0.3f %%, inefficiency = %0.1f %% \n",
           bitsperkey, WindowSizeInBits, bestbitsperbucket, density * 100,   beststats.density * 100, beststats.collision_rate * 100, inefficiency);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, 0x8(%rsp)
movq %rdi, %r15
leaq (,%rdi,8), %r12
leaq (,%rdi,4), %r14
movl $0x4, %r13d
addq $0x4, %r13
movq %r15, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rcx
leaq 0x20(%rsp), %r8
xorl %r9d, %r9d
callq 0x155f
movq %rax, %rbp
movq %rax, %xmm0
punpckldq 0x1931(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x1939(%rip), %xmm0     # 0x3020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
movsd %xmm0, 0x10(%rsp)
divsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x20(%rsp), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd 0x1959(%rip), %xmm0     # 0x3078
divsd %xmm1, %xmm0
callq 0x1090
divsd 0x1950(%rip), %xmm0     # 0x3080
movsd 0x10(%rsp), %xmm3
divsd %xmm0, %xmm3
addsd 0x1946(%rip), %xmm3     # 0x3088
movsd 0x1946(%rip), %xmm4     # 0x3090
mulsd %xmm4, %xmm3
movapd 0x30(%rsp), %xmm0
mulsd %xmm4, %xmm0
movsd 0x28(%rsp), %xmm1
mulsd %xmm4, %xmm1
movsd 0x18(%rsp), %xmm2
mulsd %xmm4, %xmm2
leaq 0x1925(%rip), %rdi      # 0x3098
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movb $0x4, %al
callq 0x1070
addq %r14, %r12
cmpq $0xd, %r13
jb 0x16b0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FastFilter[P]BlockBloomSimulator/src/windowedblockmodel.c
// Function: compute
void compute(size_t HowManyKeys) {
  bool verbose = false;
  printf("Number of keys %zu \n", HowManyKeys);
  printf(" cache line (512-bits) \n");
  assessBlockSize(HowManyKeys, 512, verbose);

  for(size_t window = 8; window <= 512; window*=2) {
    assessWindowedBlockSize(HowManyKeys, 512, window, verbose);
  }
  printf("\n");

  printf("quarter cache line (128-bits) \n");
  assessBlockSize(HowManyKeys, 128, verbose);

  for(size_t window = 8; window <= 128; window*=2) {
    assessWindowedBlockSize(HowManyKeys, 128, window, verbose);
  }  

  printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x154c(%rip), %rdi      # 0x31cc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0x1550(%rip), %rdi      # 0x31e1
callq 0x1060
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1b63
movl $0x8, %r14d
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1681
leaq (%r14,%r14), %rax
cmpq $0x101, %r14            # imm = 0x101
movq %rax, %r14
jb 0x1cab
movl $0xa, %edi
callq 0x1040
leaq 0x151b(%rip), %rdi      # 0x31f9
callq 0x1060
movl $0x80, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1b63
movl $0x8, %r14d
movl $0x80, %esi
movq %rbx, %rdi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1681
leaq (%r14,%r14), %rax
cmpq $0x41, %r14
movq %rax, %r14
jb 0x1cf8
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1040