LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::aesEncrypt(unsigned char const*, unsigned long, unsigned char**)
int Crypto::aesEncrypt(const unsigned char *message, size_t messageLength, unsigned char **encryptedMessage) {
  // Allocate memory for everything
  size_t blockLength = 0;
  size_t encryptedMessageLength = 0;

  *encryptedMessage = (unsigned char*)malloc(messageLength + AES_BLOCK_SIZE);
  if(encryptedMessage == NULL) {
    return FAILURE;
  }

  // Encrypt it!
  if(!EVP_EncryptInit_ex(aesEncryptContext, EVP_aes_256_cbc(), NULL, aesKey, aesIv)) {
    return FAILURE;
  }

  if(!EVP_EncryptUpdate(aesEncryptContext, *encryptedMessage, (int*)&blockLength, (unsigned char*)message, messageLength)) {
    return FAILURE;
  }
  encryptedMessageLength += blockLength;

  if(!EVP_EncryptFinal_ex(aesEncryptContext, *encryptedMessage + encryptedMessageLength, (int*)&blockLength)) {
    return FAILURE;
  }

  return encryptedMessageLength + blockLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
andq $0x0, (%rsp)
leaq 0x10(%rdx), %rdi
callq 0x22b0
movq %rax, (%rbx)
movq 0x10(%r14), %r13
callq 0x2150
movq 0x28(%r14), %rcx
movq 0x30(%r14), %r8
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2130
pushq $-0x1
popq %rbp
testl %eax, %eax
je 0x2be2
movq 0x10(%r14), %rdi
movq (%rbx), %rsi
movq %rsp, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x2050
testl %eax, %eax
je 0x2be2
movq %rsp, %rdx
movq (%rdx), %r15
movq 0x10(%r14), %rdi
movq (%rbx), %rsi
addq %r15, %rsi
callq 0x2300
testl %eax, %eax
je 0x2be2
addl (%rsp), %r15d
movl %r15d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::aesDecrypt(unsigned char*, unsigned long, unsigned char**)
int Crypto::aesDecrypt(unsigned char *encryptedMessage, size_t encryptedMessageLength, unsigned char **decryptedMessage) {
  // Allocate memory for everything
  size_t decryptedMessageLength = 0;
  size_t blockLength = 0;

  *decryptedMessage = (unsigned char*)malloc(encryptedMessageLength);
  if(*decryptedMessage == NULL) {
    return FAILURE;
  }

  // Decrypt it!
  if(!EVP_DecryptInit_ex(aesDecryptContext, EVP_aes_256_cbc(), NULL, aesKey, aesIv)) {
    return FAILURE;
  }

  if(!EVP_DecryptUpdate(aesDecryptContext, (unsigned char*)*decryptedMessage, (int*)&blockLength, encryptedMessage, (int)encryptedMessageLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  if(!EVP_DecryptFinal_ex(aesDecryptContext, (unsigned char*)*decryptedMessage + decryptedMessageLength, (int*)&blockLength)) {
    return FAILURE;
  }
  decryptedMessageLength += blockLength;

  return (int)decryptedMessageLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
andq $0x0, (%rsp)
movq %rdx, %rdi
callq 0x22b0
movq %rax, (%r14)
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x2c7e
movq 0x20(%r15), %rbp
callq 0x2150
movq 0x28(%r15), %rcx
movq 0x30(%r15), %r8
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x20a0
testl %eax, %eax
je 0x2c7e
movq 0x20(%r15), %rdi
movq (%r14), %rsi
movq %rsp, %rdx
movq %r13, %rcx
movl %r12d, %r8d
callq 0x2140
testl %eax, %eax
je 0x2c7e
movq %rsp, %rdx
movq (%rdx), %r12
movq 0x20(%r15), %rdi
movq (%r14), %rsi
addq %r12, %rsi
callq 0x20d0
testl %eax, %eax
je 0x2c7e
addl (%rsp), %r12d
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::bioToString(bio_st*, unsigned char**)
int Crypto::bioToString(BIO *bio, unsigned char **string) {
  size_t bioLength = BIO_pending(bio);
  *string = (unsigned char*)malloc(bioLength + 1);

  if(string == NULL) {
    return FAILURE;
  }

  BIO_read(bio, *string, bioLength);

  // Insert the NUL terminator
  (*string)[bioLength] = '\0';

  BIO_free_all(bio);

  return (int)bioLength;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
pushq $0xa
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20b0
movslq %eax, %r15
leaq 0x1(%r15), %rdi
callq 0x22b0
movq %rax, (%r14)
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x2260
movq (%r14), %rax
movb $0x0, (%rax,%r15)
movq %rbx, %rdi
callq 0x20e0
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::writeKeyToFile(_IO_FILE*, int)
int Crypto::writeKeyToFile(FILE *file, int key) {
  switch(key) {
    case KEY_SERVER_PRI:
      if(!PEM_write_PrivateKey(file, localKeypair, NULL, NULL, 0, 0, NULL)) {
        return FAILURE;
      }
      break;

    case KEY_SERVER_PUB:
      if(!PEM_write_PUBKEY(file, localKeypair)) {
        return FAILURE;
      }
      break;

    case KEY_CLIENT_PUB:
      if(!PEM_write_PUBKEY(file, remotePublicKey)) {
        return FAILURE;
      }
      break;

    case KEY_AES:
      fwrite(aesKey, 1, aesKeyLength * 8, file);
      break;

    case KEY_AES_IV:
      fwrite(aesIv, 1, aesIvLength * 8, file);
      break;

    default:
      return FAILURE;
  }

  return SUCCESS;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
pushq $-0x1
popq %rbx
cmpl $0x4, %edx
ja 0x2e68
movq %rsi, %rcx
movl %edx, %eax
leaq 0x1275(%rip), %rdx      # 0x4074
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x33f1(%rip), %rsi      # 0x6200
andq $0x0, (%rsp)
movq %rcx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2120
jmp 0x2e62
pushq $0x40
popq %rdx
pushq $0x30
jmp 0x2e39
movq (%rdi), %rsi
jmp 0x2e5a
pushq $0x38
popq %rdx
pushq $0x28
popq %rax
movq (%rdi,%rax), %rax
movq (%rdi,%rdx), %rdx
shlq $0x3, %rdx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x2390
jmp 0x2e66
movq 0x33a6(%rip), %rsi      # 0x6200
movq %rcx, %rdi
callq 0x2320
testl %eax, %eax
je 0x2e68
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: main
int main() {
  Crypto crypto;

  #ifdef PRINT_KEYS
    printKeys(&crypto);
  #endif

  while(!std::cin.eof()) {
    encryptRsa(&crypto);
    encryptAes(&crypto);
  }

  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x2708
movq 0x314b(%rip), %r14      # 0x5fe0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2eb6
movq %rbx, %rdi
callq 0x2edb
movq %rbx, %rdi
callq 0x302c
jmp 0x2e95
movq %rsp, %rdi
callq 0x28ce
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x28ce
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: encryptRsa(Crypto*)
void encryptRsa(Crypto *crypto) {
  // Get the message to encrypt
  string message = getMessage("Message to RSA encrypt: ");

  // Encrypt the message with RSA
  unsigned char *encryptedMessage = NULL;
  unsigned char *encryptedKey;
  unsigned char *iv;
  size_t encryptedKeyLength;
  size_t ivLength;

  // +1 on the string length argument because we want to encrypt the NUL terminator too
  int encryptedMessageLength = crypto->rsaEncrypt((const unsigned char*)message.c_str(), message.size()+1,
    &encryptedMessage, &encryptedKey, &encryptedKeyLength, &iv, &ivLength);

  if(encryptedMessageLength == -1) {
    fprintf(stderr, "Encryption failed\n");
    return;
  }

  // Print the encrypted message as a base64 string
  char* b64Message = base64Encode(encryptedMessage, encryptedMessageLength);
  printf("Encrypted message: %s\n", b64Message);

  // Decrypt the message
  char *decryptedMessage = NULL;

  int decryptedMessageLength = crypto->rsaDecrypt(encryptedMessage, (size_t)encryptedMessageLength,
    encryptedKey, encryptedKeyLength, iv, ivLength, (unsigned char**)&decryptedMessage);

  if(decryptedMessageLength == -1) {
    fprintf(stderr, "Decryption failed\n");
    return;
  }

  printf("Decrypted message: %s\n", decryptedMessage);

  // Clean up
  free(encryptedMessage);
  free(decryptedMessage);
  free(encryptedKey);
  free(iv);
  free(b64Message);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
leaq 0x119a(%rip), %rsi      # 0x4088
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x313a
movq %rsp, %rcx
andq $0x0, (%rcx)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
incq %rdx
leaq 0x20(%rsp), %rax
leaq 0x10(%rsp), %r10
leaq 0x18(%rsp), %r8
leaq 0x28(%rsp), %r9
movq %r14, %rdi
pushq %rax
pushq %r10
callq 0x2994
popq %rcx
popq %rdx
cmpl $-0x1, %eax
je 0x2fe2
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x24fc
movq %rax, %rbx
leaq 0x1165(%rip), %rdi      # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rax
andq $0x0, (%rax)
movq (%rsp), %rsi
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq %r15, %rdx
pushq %rax
pushq 0x28(%rsp)
callq 0x2a92
popq %rcx
popq %rdx
cmpl $-0x1, %eax
je 0x2ff5
movq 0x8(%rsp), %rsi
leaq 0x1146(%rip), %rdi      # 0x40de
xorl %eax, %eax
callq 0x2030
movq (%rsp), %rdi
callq 0x2280
movq 0x8(%rsp), %rdi
callq 0x2280
movq 0x18(%rsp), %rdi
callq 0x2280
movq 0x10(%rsp), %rdi
callq 0x2280
movq %rbx, %rdi
callq 0x2280
leaq 0x30(%rsp), %rdi
callq 0x2110
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2fe7(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
leaq 0x10ae(%rip), %rdi      # 0x40a1
jmp 0x3006
movq 0x2fd4(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
leaq 0x10c5(%rip), %rdi      # 0x40cb
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
jmp 0x2fce
jmp 0x3017
jmp 0x3017
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: encryptAes(Crypto*)
void encryptAes(Crypto *crypto) {
  // Get the message to encrypt
  string message = getMessage("Message to AES encrypt: ");

  // Encrypt the message with AES
  unsigned char *encryptedMessage = NULL;
  int encryptedMessageLength = crypto->aesEncrypt((const unsigned char*)message.c_str(), message.size()+1, &encryptedMessage);

  if(encryptedMessageLength == -1) {
    fprintf(stderr, "Encryption failed\n");
    return;
  }

  // Print the encrypted message as a base64 string
  char *b64Message = base64Encode(encryptedMessage, encryptedMessageLength);
  printf("Encrypted message: %s\n", b64Message);

  // Decrypt the message
  char *decryptedMessage = NULL;
  int decryptedMessageLength = crypto->aesDecrypt(encryptedMessage, (size_t)encryptedMessageLength, (unsigned char**)&decryptedMessage);

  if(decryptedMessageLength == -1) {
    fprintf(stderr, "Decryption failed\n");
    return;
  }

  printf("Decrypted message: %s\n", decryptedMessage);

  // Clean up
  free(encryptedMessage);
  free(decryptedMessage);
  free(b64Message);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x10b6(%rip), %rsi      # 0x40f5
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x313a
movq %rsp, %rcx
andq $0x0, (%rcx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
incq %rdx
movq %rbx, %rdi
callq 0x2b5c
cmpl $-0x1, %eax
je 0x30f0
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x24fc
movq %rax, %r14
leaq 0x102d(%rip), %rdi      # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rcx
andq $0x0, (%rcx)
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2bf4
cmpl $-0x1, %eax
je 0x3103
movq 0x8(%rsp), %rsi
leaq 0x1024(%rip), %rdi      # 0x40de
xorl %eax, %eax
callq 0x2030
movq (%rsp), %rdi
callq 0x2280
movq 0x8(%rsp), %rdi
callq 0x2280
movq %r14, %rdi
callq 0x2280
leaq 0x10(%rsp), %rdi
callq 0x2110
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2ed9(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
leaq 0xfa0(%rip), %rdi       # 0x40a1
jmp 0x3114
movq 0x2ec6(%rip), %rax      # 0x5fd0
movq (%rax), %rcx
leaq 0xfb7(%rip), %rdi       # 0x40cb
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x2390
jmp 0x30dc
jmp 0x3125
jmp 0x3125
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: getMessage[abi:cxx11](char const*)
string getMessage(const char *prompt) {
  string message;

  printf(prompt);
  fflush(stdout);

  getline(std::cin, message);
  return message;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rsi, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x2e56(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
callq 0x2270
movq 0x2e6f(%rip), %rdi      # 0x5fe0
movq %rbx, %rsi
callq 0x2080
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: printKeys(Crypto*)
void printKeys(Crypto *crypto) {
  // Write the RSA keys to stdout
  crypto->writeKeyToFile(stdout, KEY_SERVER_PRI);
  crypto->writeKeyToFile(stdout, KEY_SERVER_PUB);
  crypto->writeKeyToFile(stdout, KEY_CLIENT_PUB);

  // Write the AES key to stdout in hex
  unsigned char *aesKey;
  size_t aesKeyLength = crypto->getAesKey(&aesKey);
  printBytesAsHex(aesKey, aesKeyLength, "AES Key");

  // Write the AES IV to stdout in hex
  unsigned char *aesIv;
  size_t aesIvLength = crypto->getAesIv(&aesIv);
  printBytesAsHex(aesIv, aesIvLength, "AES IV");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x2e10(%rip), %r14      # 0x5fb8
movq (%r14), %rsi
xorl %edx, %edx
callq 0x2de6
movq (%r14), %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x2de6
movq (%r14), %rsi
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0x2de6
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d96
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xf23(%rip), %rdx       # 0x410e
callq 0x321a
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2dbe
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xf09(%rip), %rdx       # 0x4116
callq 0x321a
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/shanet[P]Crypto-Example/crypto_example.cpp
// Function: printBytesAsHex(unsigned char*, unsigned long, char const*)
void printBytesAsHex(unsigned char *bytes, size_t length, const char *message) {
  printf("%s: ", message);

  for(unsigned int i=0; i<length; i++) {
    printf("%02hhx", bytes[i]);
  }

  puts("");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xeee(%rip), %rdi       # 0x411d
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0xee2(%rip), %r15       # 0x4122
xorl %eax, %eax
movl %eax, %r12d
cmpq %rbx, %r12
jae 0x3260
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
leal 0x1(%r12), %eax
jmp 0x3242
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/imgdiff.cpp
// Function: decodeOneStep(char const*)
void decodeOneStep(const char* filename)
{
  std::vector<unsigned char> image; //the raw pixels
  unsigned width, height;

  //decode
  unsigned error = lodepng::decode(image, width, height, filename);

  //if there's an error, display it
  if(error) std::cout << "decoder error " << error << ": " << lodepng_error_text(error) << std::endl;

  //the pixels are now in the vector "image", 4 bytes per pixel, ordered RGBARGBA..., use it as texture, draw it, ...
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2090
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x28(%rsp), %rcx
pushq $0x6
popq %r8
pushq $0x8
popq %r9
callq 0xa61f
movl %eax, %ebx
leaq 0x28(%rsp), %rdi
callq 0x20c0
testl %ebx, %ebx
je 0x24dd
movq 0x11b3d(%rip), %rdi     # 0x13fd8
leaq 0xab62(%rip), %rsi      # 0xd004
callq 0x2150
movl %ebx, %esi
movq %rax, %rdi
callq 0x2110
leaq 0xab5b(%rip), %rsi      # 0xd013
movq %rax, %rdi
callq 0x2150
movq %rax, %r14
movl %ebx, %edi
callq 0xa1af
movq %r14, %rdi
movq %rax, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20d0
leaq 0x10(%rsp), %rdi
callq 0x343c
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20c0
jmp 0x2503
jmp 0x2500
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x343c
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/imgdiff.cpp
// Function: encodeOneStep(char const*, std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned int, unsigned int)
void encodeOneStep(const char* filename, std::vector<unsigned char>& image, unsigned width, unsigned height)
{
  //Encode the image
  unsigned error = lodepng::encode(filename, image, width, height);

  //if there's an error, display it
  if(error) std::cout << "encoder error " << error << ": "<< lodepng_error_text(error) << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %rdx
movq %r15, %rdi
callq 0x2090
pushq $0x6
popq %r8
pushq $0x8
popq %r9
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xa893
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x20c0
testl %ebx, %ebx
je 0x25ab
movq 0x11a6f(%rip), %rdi     # 0x13fd8
leaq 0xaaa6(%rip), %rsi      # 0xd016
callq 0x2150
movl %ebx, %esi
movq %rax, %rdi
callq 0x2110
leaq 0xaa8d(%rip), %rsi      # 0xd013
movq %rax, %rdi
callq 0x2150
movq %rax, %r14
movl %ebx, %edi
callq 0xa1af
movq %r14, %rdi
movq %rax, %rsi
callq 0x2150
movq %rax, %rdi
callq 0x20d0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/imgdiff.cpp
// Function: PNG::hash()
void hash()
    {
        int block_size = 8;

        for(int x=0;x<w-block_size;x++)
        {
            for(int y=0;y<h-block_size;y++)
            {
                long long int crc = 0;
                for(int i=0;i<block_size;i++)
                {
                    for(int j=0;j<block_size;j++)
                    {
                        crc = ((crc*mul) + rgb(x+i, y+j)) % prime;
                    }
                }
                asd[crc].push_back(Point(x,y));
            }
        }
        cout<<(w-block_size)*(h-block_size)<<" "<<asd.size()<<endl;

    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x40(%rdi), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x59235eb5, %r15d      # imm = 0x59235EB5
movl 0x20(%rbx), %eax
addl $-0x8, %eax
cmpl %eax, %r14d
jae 0x2baf
xorl %r12d, %r12d
movq %r14, 0x18(%rsp)
movl 0x24(%rbx), %eax
addl $-0x8, %eax
cmpl %eax, %r12d
jae 0x2ba7
andq $0x0, (%rsp)
xorl %edx, %edx
xorl %eax, %eax
cmpl $0x8, %eax
je 0x2b7b
movq %rax, 0x20(%rsp)
leal (%rax,%r14), %ebp
xorl %r13d, %r13d
cmpl $0x8, %r13d
je 0x2b6d
imulq $0x167, %rdx, %r14      # imm = 0x167
leal (%r12,%r13), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2de8
cltq
addq %r14, %rax
cqto
idivq %r15
movq %rdx, (%rsp)
incl %r13d
jmp 0x2b3f
movq 0x20(%rsp), %rax
incl %eax
movq 0x18(%rsp), %r14
jmp 0x2b2e
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x2e0c
movl %r14d, 0x8(%rsp)
movl %r12d, 0xc(%rsp)
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3194
incl %r12d
jmp 0x2b16
incl %r14d
jmp 0x2aff
movl 0x24(%rbx), %esi
addl $-0x8, %esi
imull %eax, %esi
movq 0x11419(%rip), %rdi     # 0x13fd8
callq 0x2110
leaq 0xa449(%rip), %rsi      # 0xd014
movq %rax, %rdi
callq 0x2150
movq 0x58(%rbx), %rsi
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x20d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/lodepng.cpp
// Function: bpmnode_compare(void const*, void const*)
static int bpmnode_compare(const void* a, const void* b)
{
  int wa = ((const BPMNode*)a)->weight;
  int wb = ((const BPMNode*)b)->weight;
  if(wa < wb) return -1;
  if(wa > wb) return 1;
  /*make the qsort a stable sort*/
  return ((const BPMNode*)a)->index < ((const BPMNode*)b)->index ? 1 : -1;
}

// Assembly:
movl (%rsi), %eax
cmpl %eax, (%rdi)
jge 0x395a
pushq $-0x1
jmp 0x395e
jle 0x3960
pushq $0x1
popq %rax
retq
movl 0x4(%rdi), %ecx
xorl %eax, %eax
cmpl 0x4(%rsi), %ecx
adcl $-0x1, %eax
orl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/lodepng.cpp
// Function: lodepng::load_file(std::vector<unsigned char, std::allocator<unsigned char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned load_file(std::vector<unsigned char>& buffer, const std::string& filename)
{
  std::ifstream file(filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
  if(!file) return 78;

  /*get filesize*/
  std::streamsize size = 0;
  if(file.seekg(0, std::ios::end).good()) size = file.tellg();
  if(file.seekg(0, std::ios::beg).good()) size -= file.tellg();

  /*read contents of the file into the vector*/
  buffer.resize(size_t(size));
  if(size > 0) file.read((char*)(&buffer[0]), size);

  return 0; /* OK */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x8(%rsp), %r14
pushq $0xe
popq %rdx
movq %r14, %rdi
callq 0x22e0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0xa201
pushq $0x4e
popq %rbp
jmp 0xa27b
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
callq 0x2220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
je 0xa223
xorl %r14d, %r14d
jmp 0xa230
leaq 0x8(%rsp), %rdi
callq 0x22c0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
jne 0xa259
leaq 0x8(%rsp), %rdi
callq 0x22c0
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc6d4
xorl %ebp, %ebp
testq %r14, %r14
jle 0xa27b
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x21e0
leaq 0x8(%rsp), %rdi
callq 0x2050
movl %ebp, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xa297
jmp 0xa297
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/titusnicolae[P]imgdiff2/lodepng.cpp
// Function: lodepng::save_file(std::vector<unsigned char, std::allocator<unsigned char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
unsigned save_file(const std::vector<unsigned char>& buffer, const std::string& filename)
{
  std::ofstream file(filename.c_str(), std::ios::out|std::ios::binary);
  if(!file) return 79;
  file.write(buffer.empty() ? 0 : (char*)&buffer[0], std::streamsize(buffer.size()));
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
movq (%rsi), %rsi
leaq 0x8(%rsp), %r14
pushq $0x14
popq %rdx
movq %r14, %rdi
callq 0x21a0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0xa2df
pushq $0x4f
popq %rbx
jmp 0xa2fe
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
xorl %ebx, %ebx
subq %rax, %rdx
movl $0x0, %esi
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x21f0
leaq 0x8(%rsp), %rdi
callq 0x2260
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2260
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/verstable/./verstable.h
// Function: intmap_t_find_first_empty
static inline bool VT_CAT( NAME, _find_first_empty )(
  NAME *table,
  size_t home_bucket,
  size_t *empty,
  uint16_t *displacement
)
{
  *displacement = 1;
  size_t linear_dispacement = 1;

  while( true )
  {
    *empty = ( home_bucket + linear_dispacement ) & ( table->bucket_count - 1 );
    if( table->metadata[ *empty ] == VT_EMPTY )
      return true;

    if( ++*displacement == VT_DISPLACEMENT_MASK )
      return false;

    linear_dispacement += *displacement;
  }
}

// Assembly:
movw $0x1, (%rcx)
movq 0x10(%rdi), %rax
pushq $0x1
popq %r8
pushq $0x2
popq %r9
leaq (%r8,%rsi), %r10
movq 0x8(%rdi), %r11
decq %r11
andq %r10, %r11
movq %r11, (%rdx)
movzwl (%rax,%r11,2), %r10d
testw %r10w, %r10w
je 0x1b3d
movw %r9w, (%rcx)
addq %r9, %r8
incq %r9
cmpw $0x800, %r9w            # imm = 0x800
jne 0x1b0f
testw %r10w, %r10w
sete %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/test/evaluator_test.cpp
// Function: TestEvalIntegerExpression()
void TestEvalIntegerExpression()
{
	std::vector<std::pair<std::string, int>> tests = {
		{"5", 5},
		{"10", 10},
	};

	for (auto test : tests)
	{
		Object *obj = testEval(test.first);
		testIntegerObject(obj, test.second);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
leaq 0x14(%rsp), %rdx
movl $0x5, (%rdx)
leaq 0x1357e(%rip), %rsi     # 0x1d0e6
leaq 0x30(%rsp), %rdi
callq 0x9eba
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movl $0xa, (%rdx)
leaq 0x1355f(%rip), %rsi     # 0x1d0e8
callq 0x9edc
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x9efe
pushq $0x28
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x30, %rdi
callq 0x5388
addq $-0x28, %rbx
cmpq $-0x28, %rbx
jne 0x9ba8
movq 0x18(%rsp), %rbx
movq 0x20(%rsp), %r13
leaq 0x30(%rsp), %r14
leaq 0x80(%rsp), %r15
cmpq %r13, %rbx
je 0x9c1e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9f38
movq %r15, %rdi
movq %r14, %rsi
callq 0x5250
movq %r15, %rdi
callq 0x9ca3
movq %rax, %r12
movq %r15, %rdi
callq 0x5388
movl 0x50(%rsp), %esi
movq %r12, %rdi
callq 0x9d82
movq %r14, %rdi
callq 0x5388
addq $0x28, %rbx
jmp 0x9bd6
leaq 0x18(%rsp), %rdi
callq 0x9f56
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x28
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x30, %rdi
callq 0x5388
addq $-0x28, %r14
cmpq $-0x28, %r14
jne 0x9c40
jmp 0x9c9b
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5388
jmp 0x9c9b
movq %rax, %rbx
jmp 0x9c9b
movq %rax, %rbx
jmp 0x9c91
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x5388
jmp 0x9c87
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5388
leaq 0x18(%rsp), %rdi
callq 0x9f56
movq %rbx, %rdi
callq 0x5330
// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/test/evaluator_test.cpp
// Function: testEval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Object *testEval(std::string input)
{
	Lexer lexer;
	lexer.New(input);

	Parser parser;
	parser.New(lexer);

	Program *program = parser.ParseProgram();

	Evaluator evaluator;
	Environment *env = new Environment();

	Object *obj = evaluator.Eval(program, env);
	return obj;
}

// Assembly:
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rsi
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rsp), %rdi
callq 0xaeaa
leaq 0x40(%rsp), %rdi
callq 0xe134
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe4d0
leaq 0x40(%rsp), %rdi
callq 0xfcf2
movq %rax, %rbx
pushq $0x40
popq %rdi
callq 0x51c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, (%rax)
movq $0x1, 0x8(%rax)
movups %xmm0, 0x10(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
movups %xmm0, 0x28(%rax)
leaq 0xf(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x15e1c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9f78
leaq 0x10(%rsp), %rdi
callq 0x5388
movq %rbx, %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
retq
jmp 0x9d5c
jmp 0x9d5c
jmp 0x9d5c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9f78
jmp 0x9d70
jmp 0x9d6d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5388
movq %rbx, %rdi
callq 0x5330
// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/test/evaluator_test.cpp
// Function: testIntegerObject(Object*, int)
void testIntegerObject(Object *obj, int expected)
{
	if (obj->type() != "INTEGER")
		std::cout << "object is not Integer, got=" << obj->type() << std::endl;

	Integer *intObj = (Integer *)obj;

	std::cout << intObj->value << std::endl;

	if (intObj->value != expected)
		std::cout << "object has wrong value, got=" << intObj->value << " want=" << expected << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x1326e(%rip), %rsi     # 0x1d016
movq %r15, %rdi
callq 0x9fc7
movl %eax, %ebp
movq %rsp, %rdi
callq 0x5388
testb %bpl, %bpl
je 0x9dfe
movq 0x2220a(%rip), %rdi     # 0x2bfd0
leaq 0x1331e(%rip), %rsi     # 0x1d0eb
callq 0x51b0
movq %rax, %r15
movq (%r14), %rax
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq *(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0x51a0
movq %rax, %rdi
callq 0x50f0
movq %rsp, %rdi
callq 0x5388
movl 0x8(%r14), %esi
movq 0x221c7(%rip), %rdi     # 0x2bfd0
callq 0x5320
movq %rax, %rdi
callq 0x50f0
cmpl %ebx, 0x8(%r14)
je 0x9e5c
movq 0x221ad(%rip), %rdi     # 0x2bfd0
leaq 0x132dd(%rip), %rsi     # 0x1d107
callq 0x51b0
movl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x5320
leaq 0x132e2(%rip), %rsi     # 0x1d124
movq %rax, %rdi
callq 0x51b0
movq %rax, %rdi
movl %ebx, %esi
callq 0x5320
movq %rax, %rdi
callq 0x50f0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9e6b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5388
movq %rbx, %rdi
callq 0x5330
// File: /workspace/github_cpp_makefile_star2_O2/tonymugen[P]sampleSNPs/populations.cpp
// Function: sampFiles::PopIndex::PopIndex(int const*, unsigned long const&)
PopIndex::PopIndex(const int *arr, const size_t &N) : _N(N) {
	for (size_t elInd = 0; elInd < N; elInd++) {
		if (arr[elInd] < 0) {
			cerr << "ERROR: population index #" << elInd << " (base-0) is less than zero (" << arr[elInd] << ") in PopIndex array-based initialization." << endl;
			exit(1);
		}
		
		if (arr[elInd] > _popInd.size()) {
			_popInd.resize(arr[elInd]); // maybe this popID is a few steps ahead of the current
			_popInd[arr[elInd] - 1].push_back(elInd);
		}
		else {
			_popInd[arr[elInd] - 1].push_back(elInd);
		}
		
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq (%rdx), %rcx
movq %rcx, 0x18(%rdi)
xorl %eax, %eax
pushq $0x18
popq %r13
leaq 0x8(%rsp), %r12
movq %rax, 0x8(%rsp)
cmpq %rcx, %rax
jae 0x12060
movslq (%r14,%rax,4), %rsi
testq %rsi, %rsi
js 0x1206e
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
subq %rdi, %rax
cqto
idivq %r13
cmpq %rsi, %rax
jae 0x12040
movq %rbx, %rdi
callq 0x12256
movq 0x8(%rsp), %rax
movslq (%r14,%rax,4), %rax
imulq $0x18, %rax, %rdi
addq (%rbx), %rdi
jmp 0x12047
imulq $0x18, %rsi, %rax
addq %rax, %rdi
addq $-0x18, %rdi
movq %r12, %rsi
callq 0x1228c
movq 0x8(%rsp), %rax
incq %rax
movq (%r15), %rcx
jmp 0x11fff
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8f7b(%rip), %rdi      # 0x1aff0
leaq 0x1edc(%rip), %rsi      # 0x13f58
callq 0x42a0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x41b0
leaq 0x1edd(%rip), %rsi      # 0x13f72
movq %rax, %rdi
callq 0x42a0
movq 0x8(%rsp), %rcx
movl (%r14,%rcx,4), %esi
movq %rax, %rdi
callq 0x4470
leaq 0x1edb(%rip), %rsi      # 0x13f90
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4130
pushq $0x1
popq %rdi
callq 0x42e0
jmp 0x120cf
movq %rax, %r14
movq %rbx, %rdi
callq 0x4d4c
movq %r14, %rdi
callq 0x44a0
// File: /workspace/github_cpp_makefile_star2_O2/tonymugen[P]sampleSNPs/populations.cpp
// Function: sampFiles::PopIndex::PopIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
PopIndex::PopIndex(const string &inFileName){
	ifstream idxFl(inFileName.c_str());
	
	if (!idxFl) {
		cerr << "ERROR: cannot open file " << inFileName << endl;
		exit(1);
	}
	int tmpIn;
	_N = 0;
	while (idxFl >> tmpIn) {
		if (tmpIn < 0) {
			cerr << "ERROR: negative population IDs not allowed when initializing PopIndex" << endl;
			exit(1);
		}
		else if (tmpIn == 0) {
			cerr << "ERROR: population indexes should be base-1 when initializing PopIndex" << endl;
			exit(2);
		}
		if (tmpIn > _popInd.size()) {
			_popInd.resize(tmpIn); // maybe this popID is a few steps ahead of the current
			_popInd[tmpIn - 1].push_back(_N);
			_N++;
		}
		else {
			_popInd[tmpIn - 1].push_back(_N);
			_N++;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq (%rsi), %rsi
leaq 0x8(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x44c0
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x12207
leaq 0x18(%rbx), %r14
xorl %eax, %eax
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
pushq $0x18
popq %r13
movq %rax, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4190
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x121aa
movslq 0x4(%rsp), %rsi
testq %rsi, %rsi
js 0x121c5
testl %esi, %esi
je 0x121e4
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
subq %rdi, %rax
cqto
idivq %r13
cmpq %rsi, %rax
jae 0x1218f
movq %rbx, %rdi
callq 0x12256
movslq 0x4(%rsp), %rax
imulq $0x18, %rax, %rdi
addq (%rbx), %rdi
jmp 0x12196
imulq $0x18, %rsi, %rax
addq %rax, %rdi
addq $-0x18, %rdi
movq %r14, %rsi
callq 0x1228c
movq (%r14), %rax
incq %rax
jmp 0x1213b
leaq 0x8(%rsp), %rdi
callq 0x40c0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8e24(%rip), %rdi      # 0x1aff0
leaq 0x1e00(%rip), %rsi      # 0x13fd3
callq 0x42a0
movq %rax, %rdi
callq 0x4130
pushq $0x1
jmp 0x12201
movq 0x8e05(%rip), %rdi      # 0x1aff0
leaq 0x1e27(%rip), %rsi      # 0x14019
callq 0x42a0
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
callq 0x42e0
movq 0x8de2(%rip), %rdi      # 0x1aff0
leaq 0x1da5(%rip), %rsi      # 0x13fba
callq 0x42a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x4270
movq %rax, %rdi
callq 0x4130
jmp 0x121e0
jmp 0x12238
movq %rax, %r14
jmp 0x12245
jmp 0x12238
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x40c0
movq %rbx, %rdi
callq 0x4d4c
movq %r14, %rdi
callq 0x44a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/viterbi.cpp
// Function: set_genetic_map_at_positions(std::vector<unsigned int, std::allocator<unsigned int>>&, double, std::vector<double, std::allocator<double>>&)
void set_genetic_map_at_positions(vector<unsigned int> &positions, double rate, vector<double> &map_out)
{
	map_out.resize(positions.size());
	map_out[0] = 0;
	for (unsigned int ui=1; ui<map_out.size(); ui++)
	{
		map_out[ui] = map_out[ui-1] + rate * (double(positions[ui] - positions[ui-1]) / 1000000);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movsd %xmm0, (%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x2, %rsi
movq %rbx, %rdi
callq 0x964c
movsd (%rsp), %xmm3
movq (%rbx), %rax
andq $0x0, (%rax)
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movq (%r14), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd 0x26dc2(%rip), %xmm1    # 0x2d008
leal 0x1(%rsi), %edi
cmpq %rdi, %rcx
jbe 0x6271
movl (%rdx,%rdi,4), %r8d
subl (%rdx,%rsi,4), %r8d
cvtsi2sd %r8, %xmm2
divsd %xmm1, %xmm2
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, (%rax,%rdi,8)
incq %rsi
jmp 0x6246
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/viterbi.cpp
// Function: inner_loop_viterbi(std::vector<double, std::allocator<double>> const&, double, double, std::vector<std::vector<bool, std::allocator<bool>>, std::allocator<std::vector<bool, std::allocator<bool>>>> const&, double, double, int, int, int, std::vector<int, std::allocator<int>> const&, bool, std::vector<std::vector<unsigned short, std::allocator<unsigned short>>, std::allocator<std::vector<unsigned short, std::allocator<unsigned short>>>>&, std::vector<double, std::allocator<double>>&)
void inner_loop_viterbi(const vector<double> &v, double p_rec, double p_no_rec,
		const vector<vector<bool> > &haps, double em_match, double em_mismatch,
		int i, int start, int end, const vector<int> &v_idx_to_hap_idx,
		bool allele,
		vector<vector<unsigned short> > &ptr, vector<double> &vb)
{
	vector<double> va(v.size());
	vector<double>::iterator it;

	for (int j=start; j < end; j++)
	{
		transform(v.begin(), v.end(), va.begin(), bind2nd(std::plus<double>(), p_rec));
		va[j] = v[j] + p_no_rec;
		it = max_element(va.begin(), va.end());
		ptr[i-1][j] = distance(va.begin(), it);

		if (haps[ v_idx_to_hap_idx[j] ][i] == allele)
		{	// Match
			vb[j] = em_match + *it;
		}
		else
		{	// Mismatch
			vb[j] = em_mismatch + *it;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x28(%rsp)
movl %r8d, %ebx
movl %ecx, %r13d
movl %edx, %r12d
movsd %xmm3, 0x18(%rsp)
movsd %xmm2, 0x10(%rsp)
movq %rsi, 0x20(%rsp)
movsd %xmm1, 0x38(%rsp)
movsd %xmm0, 0x30(%rsp)
movq %rdi, %r15
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
leaq 0x40(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x9740
movslq %r12d, %r12
movslq %r13d, %rbp
movslq %ebx, %rbx
imulq $0x18, %r12, %r14
cmpq %rbx, %rbp
jge 0x6751
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq 0x40(%rsp), %rdi
xorl %edx, %edx
movsd 0x30(%rsp), %xmm1
leaq (%rax,%rdx), %rsi
cmpq %rcx, %rsi
je 0x66c1
movsd (%rsi), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rdi,%rdx)
addq $0x8, %rdx
jmp 0x66a5
movsd (%rax,%rbp,8), %xmm0
addsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rdi,%rbp,8)
movq 0x48(%rsp), %rsi
callq 0xa5ea
movq %rax, %r13
movl 0x40(%rsp), %eax
movl %r13d, %ecx
subl %eax, %ecx
shrl $0x3, %ecx
movq 0x98(%rsp), %rax
movq (%rax), %rax
movq -0x18(%rax,%r14), %rax
movw %cx, (%rax,%rbp,2)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%rbp,4), %rax
imulq $0x28, %rax, %rdi
movq 0x20(%rsp), %rax
addq (%rax), %rdi
movq %r12, %rsi
callq 0x9792
xorb 0x90(%rsp), %al
movsd 0x18(%rsp), %xmm0
jne 0x6733
movsd 0x10(%rsp), %xmm0
movq 0xa0(%rsp), %rax
movq (%rax), %rax
addsd (%r13), %xmm0
movsd %xmm0, (%rax,%rbp,8)
incq %rbp
jmp 0x6688
leaq 0x40(%rsp), %rdi
callq 0xa19c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x676c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0xa19c
movq %rbx, %rdi
callq 0x5800
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/viterbi.cpp
// Function: get_haplotype_count(std::vector<std::vector<bool, std::allocator<bool>>, std::allocator<std::vector<bool, std::allocator<bool>>>> const&, int, int, int, int&, int&)
void get_haplotype_count(const vector<vector<bool> > &haps, int indv_idx, int start_idx, int end_idx, int &N_exact_match, int &N_one_prct_mismatch)
{
	N_exact_match = 1;	// Obviously the haplotype itself should count towards the total!
	N_one_prct_mismatch = 1;

	int N_hap = haps.size();
	for (int i=0; i < N_hap; i++)
	{
		if (i == indv_idx)
			continue;

		int N_mismatch = 0;
		double frac_mismatch = 0;
		for (int j=start_idx; j<=end_idx; j++)
		{
			if (haps[indv_idx][j] != haps[i][j])
			{
				N_mismatch++;
				frac_mismatch = ((double)N_mismatch) / (end_idx - start_idx + 1.0);
				if (frac_mismatch > 0.01)
					break;
			}
		}

		if (N_mismatch == 0)
			N_exact_match++;
		if (frac_mismatch <= 0.01)
			N_one_prct_mismatch++;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %r10d
movq %rdi, %r15
pushq $0x1
popq %rax
movq %r8, 0x8(%rsp)
movl %eax, (%r8)
movq %r9, 0x10(%rsp)
movl %eax, (%r9)
movq 0x8(%rdi), %rax
subq (%rdi), %rax
pushq $0x28
popq %rdi
cqto
idivq %rdi
movq %rax, %rdx
movslq %ecx, %rax
movq %rax, 0x40(%rsp)
subl %r10d, %ecx
cvtsi2sd %ecx, %xmm0
movslq %esi, %rax
addsd 0x2501b(%rip), %xmm0    # 0x2d018
movsd %xmm0, 0x38(%rsp)
movslq %r10d, %rcx
movq %rcx, 0x20(%rsp)
movl %eax, %ecx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
imulq $0x28, %rax, %r12
movq %rdx, 0x28(%rsp)
movq %rcx, 0x18(%rsp)
cmpq %rdx, %rsi
je 0x80cf
cmpq %rcx, %rsi
je 0x80c7
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %ebx, %ebx
movq %rsi, 0x30(%rsp)
imulq $0x28, %rsi, %r14
movq 0x20(%rsp), %r13
cmpq 0x40(%rsp), %r13
jg 0x8097
movq (%r15), %rdi
addq %r12, %rdi
movq %r13, %rsi
callq 0x9792
movl %eax, %ebp
movq (%r15), %rdi
addq %r14, %rdi
movq %r13, %rsi
callq 0x9792
cmpb %al, %bpl
je 0x8092
incl %ebx
cvtsi2sd %ebx, %xmm0
divsd 0x38(%rsp), %xmm0
movsd %xmm0, (%rsp)
ucomisd 0x24fb8(%rip), %xmm0    # 0x2d048
ja 0x8097
incq %r13
jmp 0x804d
testl %ebx, %ebx
jne 0x80a2
movq 0x8(%rsp), %rax
incl (%rax)
movsd 0x24f9e(%rip), %xmm0    # 0x2d048
ucomisd (%rsp), %xmm0
movq 0x28(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x30(%rsp), %rsi
jb 0x80c7
movq 0x10(%rsp), %rax
incl (%rax)
incq %rsi
jmp 0x8022
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::bcf_file(parameters const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int)
bcf_file::bcf_file(const parameters &p, string &vcf_filename, int idx)
{
	filename = vcf_filename;

	big_endian = is_big_endian();
	is_BGZF = false; stream = p.stream_in;
	N_entries = 0; N_kept_entries = 0;
	meta_data = header();

	if (stream)
	{
		is_BGZF = true;
		open_gz();
	}
	else
		open();

	check_bcf();
	read_header();

	include_indv = vector<bool>(meta_data.N_indv,true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0xc9e4
leaq 0x3492b(%rip), %rax     # 0x40aa8
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x5210
andw $0x0, 0x460(%rbx)
movb (%r14), %al
movb %al, 0x462(%rbx)
andq $0x0, 0x458(%rbx)
leaq 0x10(%rsp), %rdi
callq 0x103ec
leaq 0x250(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xca70
leaq 0x10(%rsp), %rdi
callq 0xcb46
cmpb $0x1, 0x462(%rbx)
jne 0xc1e3
movb $0x1, 0x460(%rbx)
movq (%rbx), %rax
addq $0x8, %rax
jmp 0xc1e6
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
movq %rbx, %rdi
callq 0xc26a
movq %rbx, %rdi
callq 0xc2fa
movl 0x2a8(%rbx), %esi
leaq 0xf(%rsp), %rdx
movb $0x1, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rcx
callq 0xcbc6
addq $0x430, %rbx            # imm = 0x430
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcc2a
movq %r14, %rdi
callq 0xa0a6
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbx
popq %r14
popq %r15
retq
jmp 0xc257
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xcb46
jmp 0xc25a
jmp 0xc257
movq %rax, %r14
movq %rbx, %rdi
callq 0xe8e0
movq %r14, %rdi
callq 0x5800
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::check_bcf()
void bcf_file::check_bcf()
{
	char magic[5];

	read(magic, 5, 1);
	if ((strcmp(magic, bcf_21) == 0) && (strcmp(magic, bcf_22) == 0))
		LOG.error("Does not appear to be a BCF file\n");
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
leaq 0xb(%rsp), %rbx
pushq $0x5
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq 0xc840
leaq 0x35207(%rip), %rsi     # 0x41490
movq %rbx, %rdi
callq 0x5640
testl %eax, %eax
jne 0xc2df
leaq 0x351f9(%rip), %rsi     # 0x41495
leaq 0xb(%rsp), %rdi
callq 0x5640
testl %eax, %eax
jne 0xc2df
leaq 0x2125d(%rip), %rsi     # 0x2d50e
leaq 0x10(%rsp), %rbx
leaq 0xa(%rsp), %rdx
movq %rbx, %rdi
callq 0x5160
leaq 0x35206(%rip), %rdi     # 0x414d0
pushq $0x1
popq %rdx
movq %rbx, %rsi
callq 0x2bf18
leaq 0x10(%rsp), %rdi
callq 0x5908
addq $0x30, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800
// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::read_header()
void bcf_file::read_header()
{
	uint32_t len_text;

	read(&len_text, 1, sizeof(uint32_t));
	char *header_array = new char[(uint32_t)len_text];
	read(header_array, len_text, 1);

	string header(header_array);
	delete [] header_array;
	string line;
	unsigned int line_index = 0;
	header.erase( header.find_last_not_of(" \f\n\r\t\v\0" ) + 1 );

	istringstream iss(header);
	line_index += meta_data.add_FILTER_descriptor("ID=PASS,Description=PASS", line_index);

	while (getline(iss, line))
	{
		if (line[0] == '#')
		{
			if (line[1] == '#')
				meta_data.parse_meta(line, line_index);
			else
				meta_data.parse_header(line);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %rbx
leaq 0x14(%rsp), %r14
pushq $0x1
popq %rdx
pushq $0x4
popq %rcx
movq %r14, %rsi
callq 0xc840
movl (%r14), %r14d
movq %r14, %rdi
callq 0x5030
movq %rax, %r15
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %rax, %rsi
movl %r14d, %edx
callq 0xc840
leaq 0x58(%rsp), %r14
leaq 0x78(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x5160
movq %r15, %rdi
callq 0x55e0
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
andl $0x0, 0x10(%rsp)
leaq 0x211d2(%rip), %rsi     # 0x2d549
pushq $-0x1
popq %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x5840
leaq 0x1(%rax), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x50c0
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x5770
leaq 0x21182(%rip), %rsi     # 0x2d530
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5160
addq $0x250, %rbx            # imm = 0x250
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x110f6
leaq 0x10(%rsp), %r14
movl %eax, (%r14)
leaq 0x38(%rsp), %rdi
callq 0x5908
leaq 0x78(%rsp), %r15
leaq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x5090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc435
movq 0x18(%rsp), %rax
cmpb $0x23, (%rax)
jne 0xc3ef
cmpb $0x23, 0x1(%rax)
jne 0xc428
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x10566
jmp 0xc3ef
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12206
jmp 0xc3ef
leaq 0x78(%rsp), %rdi
callq 0x5910
leaq 0x18(%rsp), %rdi
callq 0x5908
leaq 0x58(%rsp), %rdi
callq 0x5908
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5908
jmp 0xc47d
jmp 0xc47a
jmp 0xc475
movq %rax, %rbx
jmp 0xc487
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x5910
leaq 0x18(%rsp), %rdi
callq 0x5908
leaq 0x58(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800
nop