LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::rsaDecrypt(unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned char**)
int Crypto::rsaDecrypt(unsigned char *encryptedMessage, size_t encryptedMessageLength, unsigned char *encryptedKey,
  size_t encryptedKeyLength, unsigned char *iv, size_t ivLength, unsigned char **decryptedMessage) {

  // Allocate memory for everything
  size_t decryptedMessageLength = 0;
  size_t blockLength = 0;

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

  #ifdef PSEUDO_CLIENT
    EVP_PKEY *key = remotePublicKey;
  #else
    EVP_PKEY *key = localKeypair;
  #endif

  // Decrypt it!
  if(!EVP_OpenInit(rsaDecryptContext, EVP_aes_256_cbc(), encryptedKey, encryptedKeyLength, iv, key)) {
    return FAILURE;
  }

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

  if(!EVP_OpenFinal(rsaDecryptContext, (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
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
movq 0x58(%rsp), %rbx
movq $0x0, (%rsp)
movq 0x50(%rsp), %rdi
addq %rdx, %rdi
callq 0x22b0
movq %rax, (%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2c62
movq %r13, 0x8(%rsp)
movq (%r14), %rbx
movq 0x18(%r14), %r13
callq 0x2130
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq 0x10(%rsp), %r8
movq %rbx, %r9
callq 0x21b0
testl %eax, %eax
je 0x2c5d
movq 0x18(%r14), %rdi
movq 0x58(%rsp), %r12
movq (%r12), %rsi
movq %rsp, %rdx
movq 0x8(%rsp), %rcx
movl %r15d, %r8d
callq 0x2120
testl %eax, %eax
je 0x2c5d
movq %rsp, %rdx
movq (%rdx), %rbx
movq 0x18(%r14), %rdi
movq (%r12), %rsi
addq %rbx, %rsi
callq 0x2250
testl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
je 0x2c62
addl (%rsp), %ebx
movl %ebx, %ecx
jmp 0x2c62
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, (%rsp)
leaq 0x10(%rdx), %rdi
callq 0x22b0
movq %rax, (%rbx)
movq 0x10(%r14), %r13
callq 0x2130
movq 0x28(%r14), %rcx
movq 0x30(%r14), %r8
movq %r13, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2110
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x2cff
movq 0x10(%r14), %rdi
movq (%rbx), %rsi
movq %rsp, %rdx
movq %r12, %rcx
movl %r15d, %r8d
callq 0x2050
testl %eax, %eax
je 0x2cff
movq %rsp, %rdx
movq (%rdx), %r15
movq 0x10(%r14), %rdi
movq (%rbx), %rsi
addq %r15, %rsi
callq 0x2300
testl %eax, %eax
je 0x2cff
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
// File: /workspace/github_cpp_makefile_star2_O1/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
movq $0x0, (%rsp)
movq %rdx, %rdi
callq 0x22b0
movq %rax, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2d9f
movq 0x20(%r15), %rbp
callq 0x2130
movq 0x28(%r15), %rcx
movq 0x30(%r15), %r8
movq %rbp, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x2090
testl %eax, %eax
je 0x2d9f
movq 0x20(%r15), %rdi
movq (%r14), %rsi
movq %rsp, %rdx
movq %r13, %rcx
movl %r12d, %r8d
callq 0x2120
testl %eax, %eax
je 0x2d9f
movq %rsp, %rdx
movq (%rdx), %r12
movq 0x20(%r15), %rdi
movq (%r14), %rsi
addq %r12, %rsi
callq 0x20c0
testl %eax, %eax
je 0x2d9f
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
// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
movq %rsi, %r14
movq %rsi, %rdi
movl $0xa, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20a0
movslq %eax, %r15
leaq 0x1(%r15), %rdi
callq 0x22b0
movq %rax, (%rbx)
movq %r14, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x2260
movq (%rbx), %rax
movb $0x0, (%rax,%r15)
movq %r14, %rdi
callq 0x20d0
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x4, %edx
ja 0x2fac
movq %rsi, %rcx
movl %edx, %eax
leaq 0x113f(%rip), %rdx      # 0x4074
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x32c3(%rip), %rsi      # 0x6208
movq $0x0, (%rsp)
movq %rcx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2100
jmp 0x2fa6
movl $0x40, %edx
movl $0x30, %eax
jmp 0x2f7c
movq (%rdi), %rsi
jmp 0x2f9e
movl $0x38, %edx
movl $0x28, %eax
movq (%rdi,%rax), %rax
movq (%rdi,%rdx), %rdx
shlq $0x3, %rdx
movl $0x1, %esi
movq %rax, %rdi
callq 0x23a0
jmp 0x2faa
movq 0x326a(%rip), %rsi      # 0x6208
movq %rcx, %rdi
callq 0x2320
testl %eax, %eax
je 0x2fac
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x27f0
movq 0x3007(%rip), %r14      # 0x5fe0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x2, 0x20(%r14,%rax)
jne 0x2ffa
movq %rbx, %rdi
callq 0x301f
movq %rbx, %rdi
callq 0x3179
jmp 0x2fd9
movq %rsp, %rdi
callq 0x29be
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x29be
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1056(%rip), %rsi      # 0x4088
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x328c
movq %rsp, %rcx
movq $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 0x2a86
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x3141
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x25dc
movq %rax, %rbx
leaq 0x101c(%rip), %rdi      # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rax
movq $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 0x2ba0
addq $0x10, %rsp
cmpl $-0x1, %eax
je 0x3148
movq 0x8(%rsp), %rsi
leaq 0xff8(%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 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3137
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x243c
jmp 0x311c
callq 0x241a
jmp 0x311c
jmp 0x3153
jmp 0x3153
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3171
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf69(%rip), %rsi       # 0x40f5
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x328c
movq %rsp, %rcx
movq $0x0, (%rcx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
incq %rdx
movq %rbx, %rdi
callq 0x2c74
cmpl $-0x1, %eax
je 0x3254
movq (%rsp), %rdi
movslq %eax, %r15
movq %r15, %rsi
callq 0x25dc
movq %rax, %r14
leaq 0xedd(%rip), %rdi       # 0x40b4
movq %rax, %rsi
xorl %eax, %eax
callq 0x2030
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movq (%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x2d10
cmpl $-0x1, %eax
je 0x325b
movq 0x8(%rsp), %rsi
leaq 0xed1(%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 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x324a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x2480
jmp 0x322f
callq 0x245e
jmp 0x322f
jmp 0x3266
jmp 0x3266
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3284
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq %rsi, %rdi
xorl %eax, %eax
callq 0x2030
movq 0x2d00(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
callq 0x2270
movq 0x2d19(%rip), %rdi      # 0x5fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
movq 0x2cfe(%rip), %rdi      # 0x5fe0
movq %rbx, %rsi
callq 0x2380
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x3309
movq (%r15), %rsi
incq %rsi
callq 0x2200
movq %r14, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c96(%rip), %r14      # 0x5fb8
movq (%r14), %rsi
xorl %edx, %edx
callq 0x2f16
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x2f16
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x2f16
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2eba
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xda5(%rip), %rdx       # 0x410e
callq 0x3398
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ee8
movslq %eax, %rsi
movq (%r14), %rdi
leaq 0xd8b(%rip), %rdx       # 0x4116
callq 0x3398
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd71(%rip), %rdi       # 0x411d
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2030
testq %rbx, %rbx
je 0x33e1
movl $0x1, %ebp
leaq 0xd5b(%rip), %r15       # 0x4122
xorl %eax, %eax
movzbl (%r14,%rax), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movl %ebp, %eax
incl %ebp
cmpq %rbx, %rax
jb 0x33c9
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x22d0
// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x20b0
leaq 0x10(%rsp), %rdi
leaq 0x2c(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0xcf96
movl %eax, %ebp
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2529
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21b0
testl %ebp, %ebp
je 0x25d5
movq 0x14aa0(%rip), %rdi     # 0x16fd8
leaq 0xeac5(%rip), %rsi      # 0x11004
movl $0xe, %edx
callq 0x21f0
movl %ebp, %esi
movq 0x14a86(%rip), %rdi     # 0x16fd8
callq 0x2110
movq %rax, %rbx
leaq 0xeab2(%rip), %rsi      # 0x11013
movl $0x2, %edx
movq %rax, %rdi
callq 0x21f0
movl %ebp, %edi
callq 0xc9a6
movq %rax, %r14
testq %rax, %rax
je 0x2595
movq %r14, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x25ae
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x25ec
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x261a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x261a
jmp 0x2617
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2631
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O1/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 0x20b0
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0xd238
movl %eax, %ebp
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2697
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
testl %ebp, %ebp
je 0x2742
movq 0x14932(%rip), %rbx     # 0x16fd8
leaq 0xe969(%rip), %rsi      # 0x11016
movl $0xe, %edx
movq %rbx, %rdi
callq 0x21f0
movl %ebp, %esi
movq %rbx, %rdi
callq 0x2110
movq %rax, %rbx
leaq 0xe945(%rip), %rsi      # 0x11013
movl $0x2, %edx
movq %rax, %rdi
callq 0x21f0
movl %ebp, %edi
callq 0xc9a6
testq %rax, %rax
je 0x2702
movq %rax, %r14
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x21f0
jmp 0x271b
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq %rbx, %rdi
addq %rax, %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x22f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x276b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x18, %rsp
movq %rdi, %rbx
movl 0x20(%rdi), %eax
addl $-0x8, %eax
je 0x314a
leaq 0x40(%rbx), %r14
xorl %r13d, %r13d
movabsq $0x16f9bedd5c429cc9, %rbp # imm = 0x16F9BEDD5C429CC9
cmpl $0x8, 0x24(%rbx)
je 0x3138
xorl %r12d, %r12d
movq $0x0, 0x10(%rsp)
movl 0x20(%rbx), %edi
movq 0x28(%rbx), %r8
movl %edi, %r9d
imull %r12d, %r9d
addl %r13d, %r9d
shll $0x2, %r9d
shll $0x2, %edi
xorl %r10d, %r10d
xorl %esi, %esi
movl $0x8, %r11d
movl %r9d, %r15d
movl %r15d, %eax
movzbl (%r8,%rax), %eax
leal 0x1(%r15), %ecx
movb (%r8,%rcx), %cl
addb $0x10, %cl
shll %cl, %eax
leal 0x2(%r15), %ecx
movb (%r8,%rcx), %cl
addb $0x8, %cl
shll %cl, %eax
imulq $0x167, %rsi, %rcx      # imm = 0x167
movslq %eax, %rsi
addq %rcx, %rsi
movq %rsi, %rax
imulq %rbp
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x1b, %rdx
addq %rax, %rdx
imulq $0x59235eb5, %rdx, %rax # imm = 0x59235EB5
subq %rax, %rsi
movq %rsi, 0x10(%rsp)
addl %edi, %r15d
decq %r11
jne 0x3082
incl %r10d
addl $0x4, %r9d
cmpl $0x8, %r10d
jne 0x3079
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x335c
movl %r13d, 0x8(%rsp)
movl %r12d, 0xc(%rsp)
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x3119
movq 0x8(%rsp), %rcx
movq %rcx, (%rsi)
addq $0x8, 0x8(%rax)
jmp 0x3126
movq %rax, %rdi
leaq 0x8(%rsp), %rdx
callq 0x367a
incq %r12
movl 0x24(%rbx), %eax
addl $-0x8, %eax
cmpq %rax, %r12
jb 0x3053
incl %r13d
movl 0x20(%rbx), %eax
addl $-0x8, %eax
cmpl %eax, %r13d
jb 0x3046
movl 0x24(%rbx), %esi
addl $-0x8, %esi
imull %eax, %esi
movq 0x13e7e(%rip), %rdi     # 0x16fd8
callq 0x2110
movq %rax, %r14
leaq 0xdeab(%rip), %rsi      # 0x11014
movl $0x1, %edx
movq %rax, %rdi
callq 0x21f0
movq 0x58(%rbx), %rsi
movq %r14, %rdi
callq 0x2110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, (%rdi)
jl 0x3ede
movl $0x1, %eax
jg 0x3ede
movl 0x4(%rdi), %ecx
xorl %eax, %eax
cmpl 0x4(%rsi), %ecx
adcl $-0x1, %eax
orl $0x1, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r14, %rdi
movl $0xe, %edx
callq 0x2330
movq (%r14), %rax
movq -0x18(%rax), %rax
movl $0x4e, %ebp
testb $0x5, 0x28(%rsp,%rax)
jne 0xca76
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
je 0xca1e
xorl %r14d, %r14d
jmp 0xca2b
leaq 0x8(%rsp), %rdi
callq 0x2300
movq %rax, %r14
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
cmpl $0x0, 0x20(%rax,%rcx)
jne 0xca54
leaq 0x8(%rsp), %rdi
callq 0x2300
subq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1014e
xorl %ebp, %ebp
testq %r14, %r14
jle 0xca76
movq (%rbx), %rsi
leaq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x2220
leaq 0x8(%rsp), %rdi
callq 0x2060
movl %ebp, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
jmp 0xca92
jmp 0xca92
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq (%rsi), %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x14, %edx
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl $0x4f, %ebx
testb $0x5, 0x28(%rsp,%rax)
jne 0xcafb
movq (%r14), %rax
movq 0x8(%r14), %rdx
xorl %ebx, %ebx
subq %rax, %rdx
movl $0x0, %esi
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x2230
movq 0xa4ce(%rip), %rax      # 0x16fd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x10(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x8(%rsp,%rcx)
callq 0x2160
leaq 0x100(%rsp), %rdi
callq 0x2090
movl %ebx, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %rsi
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x8(%rsp), %rdi
callq 0xceb2
leaq 0x38(%rsp), %rdi
callq 0x13884
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x13d82
leaq 0x38(%rsp), %rdi
callq 0x15f04
movq %rax, %rbx
movl $0x40, %edi
callq 0x51b0
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x10(%rax)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, (%rax)
movq $0x1, 0x8(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
movups %xmm0, 0x28(%rax)
leaq 0x7(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x1f324
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbd46
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xbaa6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
jmp 0xbaba
jmp 0xbaba
jmp 0xbaba
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbd46
jmp 0xbace
jmp 0xbacb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xbae5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5340
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x1e4ff(%rip), %rsi     # 0x2a016
movq %r15, %rdi
callq 0x50a0
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x18(%rsp), %r13
cmpq %r13, %rdi
je 0xbb3b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
testl %ebp, %ebp
je 0xbbbc
movq 0x2a492(%rip), %r15     # 0x35fd8
leaq 0x1e54f(%rip), %rsi     # 0x2a09c
movl $0x1b, %edx
movq %r15, %rdi
callq 0x5200
movq (%r14), %rax
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq *(%rax)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x5200
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5130
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xbbbc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
movl 0x8(%r14), %esi
movq 0x2a411(%rip), %rdi     # 0x35fd8
callq 0x5320
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x51a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5130
cmpl %ebx, 0x8(%r14)
je 0xbc6e
movq 0x2a3d5(%rip), %r15     # 0x35fd8
leaq 0x1e4ae(%rip), %rsi     # 0x2a0b8
movl $0x1c, %edx
movq %r15, %rdi
callq 0x5200
movl 0x8(%r14), %esi
movq %r15, %rdi
callq 0x5320
movq %rax, %r14
leaq 0x1e4a8(%rip), %rsi     # 0x2a0d5
movl $0x6, %edx
movq %rax, %rdi
callq 0x5200
movq %r14, %rdi
movl %ebx, %esi
callq 0x5320
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x51a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5130
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0xbc97
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5340
nop
// File: /workspace/github_cpp_makefile_star2_O1/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)
movq $0x0, 0x10(%rdi)
movq (%rsi), %rsi
leaq 0x8(%rsp), %rdi
movl $0x8, %edx
callq 0x44e0
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
jne 0x15e82
leaq 0x18(%rbx), %r14
xorl %eax, %eax
leaq 0x8(%rsp), %r15
leaq 0x4(%rsp), %r12
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
movq %rax, (%r14)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x15e0b
movslq 0x4(%rsp), %rsi
testq %rsi, %rsi
js 0x15e26
testl %esi, %esi
je 0x15e54
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
imulq %r13, %rcx
cmpq %rsi, %rcx
jae 0x15dc9
movq %rbx, %rdi
callq 0x15ede
movslq 0x4(%rsp), %rcx
movq (%rbx), %rax
leaq (%rcx,%rcx,2), %rcx
jmp 0x15dcd
leaq (%rsi,%rsi,2), %rcx
movq -0x10(%rax,%rcx,8), %rsi
cmpq -0x8(%rax,%rcx,8), %rsi
je 0x15df0
leaq (%rax,%rcx,8), %rax
addq $-0x10, %rax
movq (%r14), %rcx
movq %rcx, (%rsi)
addq $0x8, %rsi
movq %rsi, (%rax)
jmp 0x15e00
leaq (%rax,%rcx,8), %rdi
addq $-0x18, %rdi
movq %r14, %rdx
callq 0x1611e
movq (%r14), %rax
incq %rax
jmp 0x15d66
leaq 0x8(%rsp), %rdi
callq 0x40b0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x91c3(%rip), %rdi      # 0x1eff0
leaq 0x219f(%rip), %rsi      # 0x17fd3
movl $0x45, %edx
callq 0x42d0
movq 0x91ab(%rip), %rdi      # 0x1eff0
callq 0x4110
movl $0x1, %edi
callq 0x42f0
movq 0x9195(%rip), %rdi      # 0x1eff0
leaq 0x21b7(%rip), %rsi      # 0x18019
movl $0x45, %edx
callq 0x42d0
movq 0x917d(%rip), %rdi      # 0x1eff0
callq 0x4110
movl $0x2, %edi
callq 0x42f0
movq 0x9167(%rip), %rdi      # 0x1eff0
leaq 0x212a(%rip), %rsi      # 0x17fba
movl $0x18, %edx
callq 0x42d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x9148(%rip), %rdi      # 0x1eff0
callq 0x42d0
movq %rax, %rdi
callq 0x4110
jmp 0x15e4a
jmp 0x15ec0
movq %rax, %r14
jmp 0x15ecd
jmp 0x15ec0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x40b0
movq %rbx, %rdi
callq 0x55ec
movq %r14, %rdi
callq 0x44c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movsd %xmm0, (%rsp)
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x2, %rsi
movq %r14, %rdi
callq 0xb7ac
movsd (%rsp), %xmm2
movq (%r14), %rax
movq $0x0, (%rax)
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq $0x2, %rcx
jb 0x6a2d
movq (%rbx), %rdx
movl $0x1, %edi
xorl %esi, %esi
movsd 0x32608(%rip), %xmm0    # 0x39008
movl (%rdx,%rdi,4), %r8d
subl (%rdx,%rsi,4), %r8d
xorps %xmm1, %xmm1
cvtsi2sd %r8, %xmm1
divsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
addsd (%rax,%rsi,8), %xmm1
movsd %xmm1, (%rax,%rdi,8)
leal 0x2(%rsi), %edi
incq %rsi
cmpq %rdi, %rcx
ja 0x6a00
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/viterbi.cpp
// Function: diff(timespec, timespec)
double diff(timespec start, timespec end)
{
	timespec temp;
	if ((end.tv_nsec-start.tv_nsec)<0) {
		temp.tv_sec = end.tv_sec-start.tv_sec-1;
		temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
	} else {
		temp.tv_sec = end.tv_sec-start.tv_sec;
		temp.tv_nsec = end.tv_nsec-start.tv_nsec;
	}
	return temp.tv_sec + (temp.tv_nsec / 1000000000.0);
}

// Assembly:
movq %rcx, %rax
subq %rsi, %rax
js 0x7145
subq %rdi, %rdx
movq %rdx, %rdi
jmp 0x7158
notq %rdi
addq %rdx, %rdi
subq %rsi, %rcx
addq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
movq %rcx, %rax
cvtsi2sd %rdi, %xmm1
cvtsi2sd %rax, %xmm0
divsd 0x31ea6(%rip), %xmm0    # 0x39010
addsd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x1, %eax
movq %r8, -0x10(%rsp)
movl %eax, (%r8)
movq %r9, -0x8(%rsp)
movl %eax, (%r9)
movq (%rdi), %r8
movq 0x8(%rdi), %rax
movq %r8, -0x30(%rsp)
subq %r8, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rdi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rdi
testl %edi, %edi
jle 0x9515
movabsq $-0x8000000000000000, %r10 # imm = 0x8000000000000000
movslq %esi, %rax
leaq (%rax,%rax,4), %rsi
movl %ecx, %r9d
subl %edx, %r9d
cvtsi2sd %r9d, %xmm0
addsd 0x2fc12(%rip), %xmm0    # 0x39018
movq -0x30(%rsp), %r8
leaq (%r8,%rsi,8), %rsi
movq %rsi, -0x18(%rsp)
movslq %edx, %rsi
movq %rsi, -0x20(%rsp)
movl %eax, %esi
andl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
incl %r9d
movl %r9d, -0x34(%rsp)
xorl %r15d, %r15d
leaq 0x3f(%r10), %r12
movsd 0x2fc0d(%rip), %xmm1    # 0x39048
movq %rsi, -0x28(%rsp)
cmpq %rsi, %r15
je 0x9509
xorl %ebp, %ebp
cmpl %edx, %ecx
jge 0x9456
movb $0x1, %al
jmp 0x94f2
movq -0x18(%rsp), %rax
movq (%rax), %r13
leaq (%r15,%r15,4), %rax
movq -0x30(%rsp), %rsi
movq (%rsi,%rax,8), %r11
xorpd %xmm2, %xmm2
movl -0x34(%rsp), %esi
movq -0x20(%rsp), %rbx
leaq 0x3f(%rbx), %r9
testq %rbx, %rbx
cmovnsq %rbx, %r9
sarq $0x6, %r9
leaq (,%r9,8), %r8
addq %r13, %r8
movq %rbx, %rax
andq %r12, %rax
xorl %r14d, %r14d
cmpq %r10, %rax
setbe %r14b
movq -0x8(%r8,%r14,8), %rax
movl %ebx, %r8d
andl $0x3f, %r8d
btq %r8, %rax
setb %al
leaq (%r11,%r9,8), %r9
movq -0x8(%r9,%r14,8), %r9
btq %r8, %r9
sbbb $0x0, %al
je 0x94d9
incl %ebp
xorps %xmm2, %xmm2
cvtsi2sd %ebp, %xmm2
divsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
ja 0x94e0
incq %rbx
decl %esi
jne 0x9478
testl %ebp, %ebp
sete %al
ucomisd %xmm2, %xmm1
setb %bpl
movq -0x28(%rsp), %rsi
testb %al, %al
je 0x94fd
movq -0x10(%rsp), %rax
incl (%rax)
testb %bpl, %bpl
jne 0x9509
movq -0x8(%rsp), %rax
incl (%rax)
incq %r15
cmpq %rdi, %r15
jne 0x9440
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x28, %rsp
leaq 0x3(%rsp), %rbx
movl $0x1, %ecx
movq %rbx, %rsi
movl $0x5, %edx
callq 0xf072
leaq 0x3bb85(%rip), %rsi     # 0x4a468
movq %rbx, %rdi
callq 0x55f0
testl %eax, %eax
jne 0xe94b
leaq 0x3bb77(%rip), %rsi     # 0x4a46d
leaq 0x3(%rsp), %rdi
callq 0x55f0
testl %eax, %eax
jne 0xe94b
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2ac6f(%rip), %rsi     # 0x39583
leaq 0x2ac89(%rip), %rdx     # 0x395a4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xc868
leaq 0x3bb79(%rip), %rdi     # 0x4a4a8
movq %rbx, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xe94b
callq 0x5410
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xe965
callq 0x5410
movq %rbx, %rdi
callq 0x57d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::open()
void bcf_file::open()
{
	int ret;

	if (filename.substr(filename.size()-4) == ".vcf")
			LOG.error("Filename ends in '.vcf'. Shouldn't you be using --vcf?\n");

	if (filename.substr(filename.size()-7) == ".vcf.gz")
			LOG.error("Filename ends in '.vcf.gz'. Shouldn't you be using --gzvcf?\n");

	ret = bgzf_is_bgzf(filename.c_str());

	if (ret == 1)
		is_BGZF = true;
	else
		is_BGZF = false;

	if (is_BGZF)
		open_gz();
	else
	{
		file_tmp.open(filename.c_str(), ios::in);
		if (!file_tmp.is_open())
			LOG.error("Could not open VCF file: " + filename, 0);
		file_in = &file_tmp;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq 0x10(%rdi), %rdx
addq $-0x4, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5480
leaq 0x2a818(%rip), %rsi     # 0x39486
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x78(%rsp), %r12
cmpq %r12, %rdi
je 0xec8a
callq 0x5410
testl %ebp, %ebp
jne 0xecd5
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x2a7ed(%rip), %rsi     # 0x3948b
leaq 0x2a81d(%rip), %rdx     # 0x394c2
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xc868
leaq 0x3b7ef(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xecd5
callq 0x5410
movq 0x10(%rbx), %rdx
addq $-0x7, %rdx
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x5480
leaq 0x2a7c8(%rip), %rsi     # 0x394c3
movq %r15, %rdi
callq 0x50e0
movl %eax, %ebp
movq (%r15), %rdi
cmpq %r12, %rdi
je 0xed12
callq 0x5410
testl %ebp, %ebp
jne 0xed5e
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2a7a4(%rip), %rsi     # 0x394cb
leaq 0x2a7d9(%rip), %rdx     # 0x39507
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xc868
leaq 0x3b766(%rip), %rdi     # 0x4a4a8
movq %r15, %rsi
movl $0x1, %edx
callq 0x3721e
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xed5e
callq 0x5410
movq 0x8(%rbx), %rdi
callq 0x380e5
cmpl $0x1, %eax
sete 0x460(%rbx)
jne 0xed7e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0xede2
leaq 0x38(%rbx), %r15
movq 0x8(%rbx), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x5240
leaq 0xb0(%rbx), %rdi
callq 0x50b0
testb %al, %al
jne 0xedde
leaq 0x2a75e(%rip), %rsi     # 0x39508
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0xb7dd
leaq 0x3b6e7(%rip), %rdi     # 0x4a4a8
movq %r12, %rsi
xorl %edx, %edx
callq 0x3721e
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xedde
callq 0x5410
movq %r15, 0x30(%rbx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xee23
jmp 0xee28
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0xee23
jmp 0xee28
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xee28
callq 0x5410
movq %rbx, %rdi
callq 0x57d0
// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::read(void*, unsigned int, unsigned long)
int bcf_file::read(void *buffer, unsigned int len, size_t size)
{
	int ret;

	if (is_BGZF)
	{
		ret = gzread(gzfile_in, buffer, size*len);
		ret = (ret == (int)(len*size) );
	}
	else
	{
		file_in->read((char*)buffer, size*len);
		ret = !file_in->eof();
	}

	if ((big_endian) && (size > 1)) // Note: don't both swapping character arrays - BCF is defined as little endian.
	{
		unsigned int ui;
		for (ui=0; ui<len; ui++)
			ByteSwap((unsigned char *)buffer+(size*ui), size);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x1, 0x460(%rdi)
movl %edx, %r13d
jne 0xf0b2
movq 0x248(%r15), %rdi
movl %ebx, %r12d
imull %ebp, %r12d
movq %r14, %rsi
movl %r12d, %edx
callq 0x5850
cmpl %r12d, %eax
jmp 0xf0d5
movq 0x30(%r15), %rdi
movq %r13, %rdx
imulq %rbx, %rdx
movq %r14, %rsi
callq 0x5580
movq 0x30(%r15), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x2, 0x20(%rax,%rcx)
sete %r12b
movb 0x461(%r15), %al
xorb $0x1, %al
cmpq $0x2, %rbx
setb %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
orb %al, %dl
jne 0xf109
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x1153a
addq %rbx, %r14
decq %r13
jne 0xf0f4
movzbl %r12b, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::get_entry(std::vector<char, std::allocator<char>>&)
void bcf_file::get_entry(vector<char> &out)
{
	uint32_t size_int[2];
	int ret, read_size = 0;

	ret = read(&size_int[0], 2, sizeof(uint32_t) );
	read_size = size_int[0] + size_int[1];

	if (ret)
	{
		out.resize(read_size+2*sizeof(uint32_t));
		memcpy(&out[0], size_int, 2*sizeof(uint32_t));
		read(&out[2*sizeof(uint32_t)], 1, read_size);
	}
	else
		out.resize(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
movl $0x4, %ecx
movl $0x2, %edx
callq 0xf072
testl %eax, %eax
je 0xf19e
movl 0xc(%rsp), %eax
addl 0x8(%rsp), %eax
movslq %eax, %r15
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0xf31a
movq (%rbx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
movq (%rbx), %rsi
addq $0x8, %rsi
movq %r14, %rdi
movl $0x1, %edx
movq %r15, %rcx
callq 0xf072
jmp 0xf1a8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf31a
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/auton1[P]viterbi/bcf_file.cpp
// Function: bcf_file::eof()
bool bcf_file::eof()
{
	if (is_BGZF)
		return gzeof(gzfile_in);
	else
		return(file_in->eof());
}

// Assembly:
cmpb $0x1, 0x460(%rdi)
jne 0xf21a
pushq %rax
movq 0x248(%rdi), %rdi
callq 0x5110
addq $0x8, %rsp
jmp 0xf22c
movq 0x30(%rdi), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %eax
andl $0x2, %eax
testl %eax, %eax
setne %al
retq