LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::generateRsaKeypair(evp_pkey_st**)
int Crypto::generateRsaKeypair(EVP_PKEY **keypair) {
  EVP_PKEY_CTX *context = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);

  if(EVP_PKEY_keygen_init(context) <= 0) {
    return FAILURE;
  }

  if(EVP_PKEY_CTX_set_rsa_keygen_bits(context, RSA_KEYLEN) <= 0) {
    return FAILURE;
  }

  if(EVP_PKEY_keygen(context, keypair) <= 0) {
    return FAILURE;
  }

  EVP_PKEY_CTX_free(context);

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x6, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x23f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x22e0
cmpl $0x0, %eax
jg 0x28f9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2940
movq -0x20(%rbp), %rdi
movl $0x800, %esi            # imm = 0x800
callq 0x21b0
cmpl $0x0, %eax
jg 0x2915
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2940
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x22c0
cmpl $0x0, %eax
jg 0x2930
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2940
movq -0x20(%rbp), %rdi
callq 0x2370
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::init()
int Crypto::init() {
  // Initalize contexts
  rsaEncryptContext = EVP_CIPHER_CTX_new();
  aesEncryptContext = EVP_CIPHER_CTX_new();

  rsaDecryptContext = EVP_CIPHER_CTX_new();
  aesDecryptContext = EVP_CIPHER_CTX_new();

  // Check if any of the contexts initializations failed
  if(rsaEncryptContext == NULL || aesEncryptContext == NULL || rsaDecryptContext == NULL || aesDecryptContext == NULL) {
    return FAILURE;
  }

  /* Don't set key or IV right away; we want to set lengths */
  EVP_CIPHER_CTX_init(aesEncryptContext);
  EVP_CIPHER_CTX_init(aesDecryptContext);

  EVP_CipherInit_ex(aesEncryptContext, EVP_aes_256_cbc(), NULL, NULL, NULL, 1);

  /* Now we can set key and IV lengths */
  aesKeyLength = EVP_CIPHER_CTX_key_length(aesEncryptContext);
  aesIvLength = EVP_CIPHER_CTX_iv_length(aesEncryptContext);

  // Generate RSA and AES keys
  generateRsaKeypair(&localKeypair);
  generateAesKey(&aesKey, &aesIv);

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x2180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
callq 0x2180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
callq 0x2180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
callq 0x2180
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpq $0x0, 0x8(%rax)
je 0x29cc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x29cc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x29cc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x29d8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2a77
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2350
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2350
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x2160
movq -0x20(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %r8d
movl $0x1, %r9d
movq %r8, %rdx
movq %r8, %rcx
callq 0x2220
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x21e0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
movq %rcx, 0x38(%rax)
movq 0x10(%rax), %rdi
callq 0x2110
movq -0x18(%rbp), %rdi
cltq
movq %rax, 0x40(%rdi)
leaq 0x37d4(%rip), %rsi      # 0x6228
callq 0x28c0
movq -0x18(%rbp), %rdi
movq %rdi, %rsi
addq $0x28, %rsi
movq %rdi, %rdx
addq $0x30, %rdx
callq 0x2bf0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::Crypto(unsigned char*, unsigned long)
Crypto::Crypto(unsigned char *remotePublicKey, size_t remotePublicKeyLength) {
  localKeypair = NULL;
  this->remotePublicKey = NULL;

  setRemotePublicKey(remotePublicKey, remotePublicKeyLength);
  init();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq $0x0, 0x3781(%rip) # 0x6228
movq $0x0, (%rdi)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2ad0
movq -0x20(%rbp), %rdi
callq 0x2950
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::setRemotePublicKey(unsigned char*, unsigned long)
int Crypto::setRemotePublicKey(unsigned char *publicKey, size_t publicKeyLength) {
  BIO *bio = BIO_new(BIO_s_mem());

  if(BIO_write(bio, publicKey, publicKeyLength) != (int)publicKeyLength) {
    return FAILURE;
  }

  PEM_read_bio_PUBKEY(bio, &remotePublicKey, NULL, NULL);
  BIO_free_all(bio);

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x21c0
movq %rax, %rdi
callq 0x2380
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
callq 0x2250
movq -0x20(%rbp), %rcx
cmpl %ecx, %eax
je 0x2b21
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b45
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x20e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::~Crypto()
Crypto::~Crypto() {
  EVP_PKEY_free(localKeypair);
  EVP_PKEY_free(remotePublicKey);

  EVP_CIPHER_CTX_free(rsaEncryptContext);
  EVP_CIPHER_CTX_free(aesEncryptContext);

  EVP_CIPHER_CTX_free(rsaDecryptContext);
  EVP_CIPHER_CTX_free(aesDecryptContext);

  free(aesKey);
  free(aesIv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x36bd(%rip), %rdi      # 0x6228
callq 0x2170
jmp 0x2b72
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2170
jmp 0x2b80
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2240
jmp 0x2b8f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2240
jmp 0x2b9e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2240
jmp 0x2bad
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2240
jmp 0x2bbc
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x22a0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x22a0
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x35b0
nopw %cs:(%rax,%rax)
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::generateAesKey(unsigned char**, unsigned char**)
int Crypto::generateAesKey(unsigned char **aesKey, unsigned char **aesIv) {
  *aesKey = (unsigned char*)malloc(aesKeyLength);
  *aesIv = (unsigned char*)malloc(aesIvLength);

  if(*aesKey == NULL || *aesIv == NULL) {
    return FAILURE;
  }

  // For the AES key we have the option of using a PBKDF or just using straight random
  // data for the key and IV. Depending on your use case, you will want to pick one or another.
  #ifdef USE_PBKDF
    unsigned char *aesPass = (unsigned char*)malloc(aesKeyLength);
    unsigned char *aesSalt = (unsigned char*)malloc(8);

    if(aesPass == NULL || aesSalt == NULL) {
      return FAILURE;
    }

    // Get some random data to use as the AES pass and salt
    if(RAND_bytes(aesPass, aesKeyLength) == 0) {
      return FAILURE;
    }

    if(RAND_bytes(aesSalt, 8) == 0) {
      return FAILURE;
    }

    if(EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha256(), aesSalt, aesPass, aesKeyLength, AES_ROUNDS, *aesKey, *aesIv) == 0) {
      return FAILURE;
    }

    free(aesPass);
    free(aesSalt);
  #else
    if(RAND_bytes(*aesKey, aesKeyLength) == 0) {
      return FAILURE;
    }

    if(RAND_bytes(*aesIv, aesIvLength) == 0) {
      return FAILURE;
    }
  #endif

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x38(%rax), %rdi
callq 0x22d0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rdx, (%rcx)
movq 0x40(%rax), %rdi
callq 0x22d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2c4a
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2c53
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ca2
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rdi
movq 0x38(%rax), %rax
movl %eax, %esi
callq 0x2310
cmpl $0x0, %eax
jne 0x2c77
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ca2
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdi
movq 0x40(%rax), %rax
movl %eax, %esi
callq 0x2310
cmpl $0x0, %eax
jne 0x2c9b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ca2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rdi
addq 0x10(%rbp), %rdi
callq 0x22d0
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, (%rax)
movq 0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2ead
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f6f
movq -0x58(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
callq 0x2160
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x38(%rbp), %r8
movq -0x50(%rbp), %r9
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ef1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f6f
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rbp), %rax
movq (%rax), %rsi
addq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl %eax, %r8d
leaq -0x48(%rbp), %rdx
callq 0x2150
cmpl $0x0, %eax
jne 0x2f26
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f6f
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x40(%rbp), %rcx
movq %rcx, -0x40(%rbp)
movq 0x18(%rax), %rdi
movq 0x18(%rbp), %rax
movq (%rax), %rsi
addq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2270
cmpl $0x0, %eax
jne 0x2f5c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f6f
movq -0x48(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x22d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x28(%rbp)
jne 0x2fda
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3087
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x2160
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x2130
cmpl $0x0, %eax
jne 0x3015
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3087
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl %eax, %r8d
leaq -0x30(%rbp), %rdx
callq 0x2050
cmpl $0x0, %eax
jne 0x3046
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3087
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
addq -0x38(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
addq -0x38(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x2340
cmpl $0x0, %eax
jne 0x307c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3087
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x22d0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x30e9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x319e
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x2160
movq -0x48(%rbp), %rdi
movq %rax, %rsi
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x20a0
cmpl $0x0, %eax
jne 0x3124
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x319e
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl %eax, %r8d
leaq -0x38(%rbp), %rdx
callq 0x2150
cmpl $0x0, %eax
jne 0x3155
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x319e
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
addq -0x30(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq 0x20(%rax), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
addq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x20d0
cmpl $0x0, %eax
jne 0x318b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x319e
movq -0x38(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0xa, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x20b0
cltq
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x22d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
jne 0x3266
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x329b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x28(%rbp), %rax
movl %eax, %edx
callq 0x2280
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rdi
callq 0x20e0
movq -0x28(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::setAesKey(unsigned char*, unsigned long)
int Crypto::setAesKey(unsigned char *aesKey, size_t aesKeyLengthgth) {
  // Ensure the new key is the proper size
  if(aesKeyLengthgth != aesKeyLength) {
    return FAILURE;
  }

  memcpy(this->aesKey, aesKey, aesKeyLength);

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq 0x38(%rcx), %rax
je 0x33cf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33eb
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rsi
movq 0x38(%rax), %rdx
callq 0x21a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: shanet[P]Crypto-Example/Crypto.cpp
// Function: Crypto::setAesIv(unsigned char*, unsigned long)
int Crypto::setAesIv(unsigned char *aesIv, size_t aesIvLengthgth) {
  // Ensure the new IV is the proper size
  if(aesIvLengthgth != aesIvLength) {
    return FAILURE;
  }

  memcpy(this->aesIv, aesIv, aesIvLength);

  return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq 0x40(%rcx), %rax
je 0x345f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x347b
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rsi
movq 0x40(%rax), %rdx
callq 0x21a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x4, %rax
ja 0x358c
movq -0x28(%rbp), %rax
leaq 0xb95(%rip), %rcx       # 0x405c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
movq 0x2d4d(%rip), %rsi      # 0x6228
xorl %eax, %eax
movl %eax, %r9d
xorl %r8d, %r8d
movq %r9, %rdx
movq %r9, %rcx
movq $0x0, (%rsp)
callq 0x2120
cmpl $0x0, %eax
jne 0x3507
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x359c
jmp 0x3595
movq -0x18(%rbp), %rdi
movq 0x2d11(%rip), %rsi      # 0x6228
callq 0x2360
cmpl $0x0, %eax
jne 0x352a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x359c
jmp 0x3595
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rdi
movq (%rax), %rsi
callq 0x2360
cmpl $0x0, %eax
jne 0x354a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x359c
jmp 0x3595
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x38(%rax), %rdx
shlq $0x3, %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %esi
callq 0x23e0
jmp 0x3595
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
movq 0x40(%rax), %rdx
shlq $0x3, %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %esi
callq 0x23e0
jmp 0x3595
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x359c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2880
movq 0x2a01(%rip), %rdi      # 0x5fe0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x23c0
movb %al, -0x5d(%rbp)
jmp 0x35f3
movb -0x5d(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x35fe
jmp 0x362d
leaq -0x50(%rbp), %rdi
callq 0x3650
jmp 0x3609
leaq -0x50(%rbp), %rdi
callq 0x3840
jmp 0x3614
jmp 0x35d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2b50
jmp 0x3646
movl $0x0, -0x4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2b50
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x23b0
nop
// File: 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 %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x887(%rip), %rsi       # 0x40dd
leaq -0x28(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x39d0
movq -0x78(%rbp), %rdi
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x2100
movq -0x78(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x2190
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq %rax, %rdx
incq %rdx
leaq -0x30(%rbp), %rcx
callq 0x2f80
movl %eax, -0x60(%rbp)
jmp 0x38a5
movl -0x60(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jne 0x38ef
movq 0x2718(%rip), %rax      # 0x5fd0
movq (%rax), %rdi
leaq 0x7c7(%rip), %rsi       # 0x4089
movb $0x0, %al
callq 0x2300
movl $0x1, -0x48(%rbp)
jmp 0x39a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2140
jmp 0x39bb
movq -0x30(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x2580
movq %rax, -0x80(%rbp)
jmp 0x3902
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
leaq 0x787(%rip), %rdi       # 0x409c
xorl %eax, %eax
callq 0x2030
jmp 0x391e
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movslq -0x34(%rbp), %rdx
leaq -0x58(%rbp), %rcx
callq 0x3090
movl %eax, -0x84(%rbp)
jmp 0x3943
movl -0x84(%rbp), %eax
movl %eax, -0x5c(%rbp)
cmpl $-0x1, -0x5c(%rbp)
jne 0x3973
movq 0x2677(%rip), %rax      # 0x5fd0
movq (%rax), %rdi
leaq 0x750(%rip), %rsi       # 0x40b3
movb $0x0, %al
callq 0x2300
movl $0x1, -0x48(%rbp)
jmp 0x39a9
movq -0x58(%rbp), %rsi
leaq 0x748(%rip), %rdi       # 0x40c6
xorl %eax, %eax
callq 0x2030
jmp 0x3987
movq -0x30(%rbp), %rdi
callq 0x22a0
movq -0x58(%rbp), %rdi
callq 0x22a0
movq -0x50(%rbp), %rdi
callq 0x22a0
movl $0x0, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x2140
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x23b0
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x22f0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
callq 0x2030
jmp 0x3a01
movq 0x25b0(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
callq 0x2290
jmp 0x3a12
movq -0x38(%rbp), %rsi
movq 0x25c3(%rip), %rdi      # 0x5fe0
callq 0x2080
jmp 0x3a24
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x3a50
jmp 0x3a47
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x2140
jmp 0x3a5a
movq -0x38(%rbp), %rdi
callq 0x2140
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x23b0
nopw %cs:(%rax,%rax)
// File: 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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq 0x2531(%rip), %rax      # 0x5fb8
movq (%rax), %rsi
xorl %edx, %edx
callq 0x3490
movq -0x8(%rbp), %rdi
movq 0x251c(%rip), %rax      # 0x5fb8
movq (%rax), %rsi
movl $0x1, %edx
callq 0x3490
movq -0x8(%rbp), %rdi
movq 0x2504(%rip), %rax      # 0x5fb8
movq (%rax), %rsi
movl $0x2, %edx
callq 0x3490
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3370
cltq
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq 0x613(%rip), %rdx       # 0x40f6
callq 0x3b20
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3400
cltq
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq 0x5f4(%rip), %rdx       # 0x40fe
callq 0x3b20
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x5c6(%rip), %rdi       # 0x4105
movb $0x0, %al
callq 0x2030
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpq -0x10(%rbp), %rax
jae 0x3b7a
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movzbl (%rax,%rcx), %esi
leaq 0x5a2(%rip), %rdi       # 0x410a
movb $0x0, %al
callq 0x2030
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3b4d
leaq 0x544(%rip), %rdi       # 0x40c5
callq 0x2330
addq $0x20, %rsp
popq %rbp
retq
// File: 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:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x3140
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x57(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x2350
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x58(%rsp), %rdi
callq 0x2280
jmp 0x251e
leaq 0x88(%rsp), %rdi
leaq 0x84(%rsp), %rsi
leaq 0x80(%rsp), %rdx
leaq 0x58(%rsp), %rcx
movl $0x6, %r8d
movl $0x8, %r9d
callq 0x11b00
movl %eax, 0x2c(%rsp)
jmp 0x2552
leaq 0x58(%rsp), %rdi
callq 0x2120
leaq 0x57(%rsp), %rdi
callq 0x21d0
movl 0x2c(%rsp), %eax
movl %eax, 0x7c(%rsp)
cmpl $0x0, 0x7c(%rsp)
je 0x263d
movq 0x21a58(%rip), %rdi     # 0x23fd8
leaq 0x19a81(%rip), %rsi     # 0x1c008
callq 0x2170
movq %rax, 0x20(%rsp)
jmp 0x2593
movq 0x20(%rsp), %rdi
movl 0x7c(%rsp), %esi
callq 0x2260
movq %rax, 0x18(%rsp)
jmp 0x25a8
movq 0x18(%rsp), %rdi
leaq 0x19a63(%rip), %rsi     # 0x1c017
callq 0x2170
movq %rax, 0x10(%rsp)
jmp 0x25c0
movl 0x7c(%rsp), %edi
callq 0x10900
movq %rax, 0x8(%rsp)
jmp 0x25d0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x2170
movq %rax, (%rsp)
jmp 0x25e5
movq (%rsp), %rdi
movq 0x219d8(%rip), %rsi     # 0x23fc8
callq 0x21c0
jmp 0x25f7
jmp 0x263d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x2621
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x2120
leaq 0x57(%rsp), %rdi
callq 0x21d0
jmp 0x2652
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x2652
leaq 0x88(%rsp), %rdi
callq 0x3150
addq $0xa8, %rsp
retq
leaq 0x88(%rsp), %rdi
callq 0x3150
movq 0x48(%rsp), %rdi
callq 0x2340
nopl (%rax)
// File: 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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movl %edx, 0x64(%rsp)
movl %ecx, 0x60(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x37(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x2350
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x2280
jmp 0x26b5
movq 0x68(%rsp), %rsi
movl 0x64(%rsp), %edx
movl 0x60(%rsp), %ecx
leaq 0x38(%rsp), %rdi
movl $0x6, %r8d
movl $0x8, %r9d
callq 0x11fa0
movl %eax, 0xc(%rsp)
jmp 0x26de
leaq 0x38(%rsp), %rdi
callq 0x2120
leaq 0x37(%rsp), %rdi
callq 0x21d0
movl 0xc(%rsp), %eax
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
je 0x2791
movq 0x218cc(%rip), %rdi     # 0x23fd8
leaq 0x19907(%rip), %rsi     # 0x1c01a
callq 0x2170
movq %rax, %rdi
movl 0x5c(%rsp), %esi
callq 0x2260
movq %rax, %rdi
leaq 0x198e9(%rip), %rsi     # 0x1c017
callq 0x2170
movq %rax, (%rsp)
movl 0x5c(%rsp), %edi
callq 0x10900
movq (%rsp), %rdi
movq %rax, %rsi
callq 0x2170
movq %rax, %rdi
movq 0x21872(%rip), %rsi     # 0x23fc8
callq 0x21c0
jmp 0x2791
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
jmp 0x2785
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x2120
leaq 0x37(%rsp), %rdi
callq 0x21d0
jmp 0x2796
addq $0x78, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x2340
// File: 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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x8, 0x4c(%rsp)
movl $0x0, 0x48(%rsp)
movq 0x20(%rsp), %rcx
movl 0x48(%rsp), %eax
movl 0x20(%rcx), %ecx
subl 0x4c(%rsp), %ecx
cmpl %ecx, %eax
jae 0x3575
movl $0x0, 0x44(%rsp)
movq 0x20(%rsp), %rcx
movl 0x44(%rsp), %eax
movl 0x24(%rcx), %ecx
subl 0x4c(%rsp), %ecx
cmpl %ecx, %eax
jae 0x3563
movq $0x0, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0x351a
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jge 0x350b
movq 0x20(%rsp), %rdi
imulq $0x167, 0x38(%rsp), %rax # imm = 0x167
movq %rax, 0x18(%rsp)
movl 0x48(%rsp), %esi
addl 0x34(%rsp), %esi
movl 0x44(%rsp), %edx
addl 0x30(%rsp), %edx
callq 0x4290
movl %eax, %ecx
movq 0x18(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq $-0x59235eb5, %rcx      # imm = 0xA6DCA14B
cqto
idivq %rcx
movq %rdx, 0x38(%rsp)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x34ae
jmp 0x350d
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x349c
movq 0x20(%rsp), %rdi
addq $0x40, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4350
movq %rax, 0x10(%rsp)
movl 0x48(%rsp), %esi
movl 0x44(%rsp), %edx
leaq 0x28(%rsp), %rdi
callq 0x43b0
movq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4380
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x3473
jmp 0x3565
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x3453
movq 0x20(%rsp), %rax
movl 0x20(%rax), %esi
subl 0x4c(%rsp), %esi
movl 0x24(%rax), %eax
subl 0x4c(%rsp), %eax
imull %eax, %esi
movq 0x20a46(%rip), %rdi     # 0x23fd8
callq 0x2260
movq %rax, %rdi
leaq 0x18a77(%rip), %rsi     # 0x1c018
callq 0x2170
movq 0x20(%rsp), %rdi
movq %rax, 0x8(%rsp)
addq $0x40, %rdi
callq 0x43d0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x2060
movq %rax, %rdi
movq 0x209f8(%rip), %rsi     # 0x23fc8
callq 0x21c0
addq $0x58, %rsp
retq
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rsp)
movq -0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rsp)
movl -0x1c(%rsp), %eax
cmpl -0x20(%rsp), %eax
jge 0x7864
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0x789b
movl -0x1c(%rsp), %eax
cmpl -0x20(%rsp), %eax
jle 0x7878
movl $0x1, -0x4(%rsp)
jmp 0x789b
movq -0x10(%rsp), %rax
movl 0x4(%rax), %edx
movq -0x18(%rsp), %rax
movl 0x4(%rax), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpl %esi, %edx
cmovbl %ecx, %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
// File: 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:
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdi, 0x2a8(%rsp)
movq %rsi, 0x2a0(%rsp)
movq 0x2a0(%rsp), %rdi
callq 0x20c0
movq %rax, 0x50(%rsp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x1a300
movl %eax, %edi
movl $0x2, %esi
callq 0x1a300
movq 0x50(%rsp), %rsi
movl %eax, %edx
leaq 0x98(%rsp), %rdi
callq 0x2360
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x98(%rsp,%rax), %rdi
callq 0x20f0
movb %al, 0x5f(%rsp)
jmp 0x10ef7
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x10f01
jmp 0x10f42
movl $0x4e, 0x2b4(%rsp)
movl $0x1, 0x88(%rsp)
jmp 0x110cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x90(%rsp)
movl %eax, 0x8c(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x2070
jmp 0x110eb
movq $0x0, 0x80(%rsp)
xorl %eax, %eax
movl %eax, %esi
leaq 0x98(%rsp), %rdi
movl $0x2, %edx
callq 0x2270
movq %rax, 0x48(%rsp)
jmp 0x10f6b
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2320
movb %al, 0x47(%rsp)
jmp 0x10f85
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x10f8f
jmp 0x10fda
leaq 0x98(%rsp), %rdi
callq 0x2330
movq %rdx, 0x30(%rsp)
movq %rax, 0x38(%rsp)
jmp 0x10fa8
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1a320
movq %rax, 0x28(%rsp)
jmp 0x10fcd
movq 0x28(%rsp), %rax
movq %rax, 0x80(%rsp)
xorl %edx, %edx
movl %edx, %esi
leaq 0x98(%rsp), %rdi
callq 0x2270
movq %rax, 0x20(%rsp)
jmp 0x10ff2
movq 0x20(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2320
movb %al, 0x1f(%rsp)
jmp 0x1100c
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x11016
jmp 0x1106a
leaq 0x98(%rsp), %rdi
callq 0x2330
movq %rdx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x1102f
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x1a320
movq %rax, (%rsp)
jmp 0x11053
movq (%rsp), %rcx
movq 0x80(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x80(%rsp)
movq 0x2a8(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x1a330
jmp 0x11081
cmpq $0x0, 0x80(%rsp)
jle 0x110b9
movq 0x2a8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x43e0
movq %rax, %rsi
movq 0x80(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x2220
jmp 0x110b7
jmp 0x110b9
movl $0x0, 0x2b4(%rsp)
movl $0x1, 0x88(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x2070
movl 0x2b4(%rsp), %eax
addq $0x2b8, %rsp            # imm = 0x2B8
retq
movq 0x90(%rsp), %rdi
callq 0x2340
nopl (%rax,%rax)
// File: 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:
subq $0x248, %rsp            # imm = 0x248
movq %rdi, 0x238(%rsp)
movq %rsi, 0x230(%rsp)
movq 0x230(%rsp), %rdi
callq 0x20c0
movq %rax, 0x10(%rsp)
movl $0x10, %edi
movl $0x4, %esi
callq 0x1a300
movq 0x10(%rsp), %rsi
movl %eax, %edx
leaq 0x30(%rsp), %rdi
callq 0x21e0
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x30(%rsp,%rax), %rdi
callq 0x20f0
movb %al, 0x1f(%rsp)
jmp 0x11162
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x1116c
jmp 0x111a1
movl $0x4f, 0x244(%rsp)
movl $0x1, 0x20(%rsp)
jmp 0x1120f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x22c0
jmp 0x11228
movq 0x238(%rsp), %rdi
callq 0x1a3d0
testb $0x1, %al
jne 0x111b4
jmp 0x111bd
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x111d3
movq 0x238(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1a420
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq 0x238(%rsp), %rdi
callq 0x6000
movq (%rsp), %rsi
movq %rax, %rdx
leaq 0x30(%rsp), %rdi
callq 0x2230
jmp 0x111fc
movl $0x0, 0x244(%rsp)
movl $0x1, 0x20(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x22c0
movl 0x244(%rsp), %eax
addq $0x248, %rsp            # imm = 0x248
retq
movq 0x28(%rsp), %rdi
callq 0x2340
nopw %cs:(%rax,%rax)
// File: attractivechaos[P]udb2/verstable/test.c
// Function: test_int
uint32_t test_int(uint32_t n, uint32_t x0)
{
	uint32_t i, x, z = 0;
	intmap_t h;
	intmap_t_init(&h);
	for (i = 0, x = x0; i < n; ++i) {
		uint32_t key;
		x = hash32(x);
		key = get_key(n, x);
		size_t ori_size = intmap_t_size(&h);
		intmap_t_itr itr = intmap_t_get_or_insert(&h, key, 0);
#ifndef UDB2_TEST_DEL
		z += ++itr.data->val;
#else
		if (intmap_t_size(&h) == ori_size)
			intmap_t_erase_itr(&h, itr);
		else ++z;
#endif
	}
	fprintf(stderr, "# unique keys: %ld; checksum: %u; capacity: %lu\n",
			intmap_t_size(&h), z, intmap_t_bucket_count(&h));
	x = intmap_t_size(&h);
	intmap_t_cleanup(&h);
	return x;
}

// Assembly:
subq $0xe8, %rsp
movl %edi, 0xbc(%rsp)
movl %esi, 0xb8(%rsp)
movl $0x0, 0xac(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1800
movl $0x0, 0xb4(%rsp)
movl 0xb8(%rsp), %eax
movl %eax, 0xb0(%rsp)
movl 0xb4(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jae 0x1772
movl 0xb0(%rsp), %edi
callq 0x1230
movl %eax, 0xb0(%rsp)
movl 0xbc(%rsp), %edi
movl 0xb0(%rsp), %esi
callq 0x12a0
movl %eax, 0x84(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1840
movq %rax, 0x78(%rsp)
movl 0x84(%rsp), %edx
leaq 0x58(%rsp), %rdi
leaq 0x88(%rsp), %rsi
xorl %ecx, %ecx
callq 0x1850
leaq 0x88(%rsp), %rdi
callq 0x1840
cmpq 0x78(%rsp), %rax
jne 0x1749
movq 0x58(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0xd8(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x2560
testb $0x1, %al
jne 0x16dd
jmp 0x1713
leaq 0x38(%rsp), %rdi
leaq 0xc0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x28d0
jmp 0x1747
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x50(%rsp)
jmp 0x175a
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x175c
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x15d6
movq 0x387f(%rip), %rax      # 0x4ff8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1840
movq %rax, 0x28(%rsp)
movl 0xac(%rsp), %eax
movl %eax, 0x34(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1920
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
movl 0x34(%rsp), %ecx
movq %rax, %r8
leaq 0x18e2(%rip), %rsi      # 0x30a5
movb $0x0, %al
callq 0x1060
leaq 0x88(%rsp), %rdi
callq 0x1840
movl %eax, 0xb0(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1930
movl 0xb0(%rsp), %eax
addq $0xe8, %rsp
retq
nopw (%rax,%rax)
// File: attractivechaos[P]udb2/verstable/./verstable.h
// Function: intmap_t_init
VT_API_FN_QUALIFIERS void VT_CAT( NAME, _init )( NAME *table )
{
  table->key_count = 0;
  table->bucket_count = 0;
  table->metadata = (uint16_t *)vt_placeholder_metadata_buffer;
  table->buckets = NULL;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq $0x0, (%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rsp), %rax
leaq 0x18ac(%rip), %rcx      # 0x30d6
movq %rcx, 0x10(%rax)
movq -0x8(%rsp), %rax
movq $0x0, 0x18(%rax)
retq
nopl (%rax)
// File: attractivechaos[P]udb2/verstable/./verstable.h
// Function: intmap_t_get_or_insert
VT_CAT( NAME, _get_or_insert )(
  NAME *table,
  KEY_TY key
  #ifdef VAL_TY
  , VAL_TY val
  #endif
)
{
  while( true )
  {
    VT_CAT( NAME, _itr ) itr = VT_CAT( NAME, _insert_raw )(
      table,
      key,
      #ifdef VAL_TY
      val,
      #endif
      false,
      false
    );

    if(
      !VT_CAT( NAME, _is_end )( itr ) ||
      !VT_CAT( NAME, _rehash )( table, table->bucket_count ? table->bucket_count * 2 : VT_MIN_NONZERO_BUCKET_COUNT )
    )
      return itr;
  }
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x38(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movl %ecx, 0x48(%rsp)
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rsi
movl 0x4c(%rsp), %edx
movl 0x48(%rsp), %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x1970
movq 0x38(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq 0x18(%rax), %rax
movq %rax, 0x18(%rsp)
callq 0x1f70
testb $0x1, %al
jne 0x18ba
jmp 0x1902
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x18e3
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, 0x28(%rsp)
jmp 0x18ef
movl $0x8, %eax
movq %rax, 0x28(%rsp)
jmp 0x18ef
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x1f90
testb $0x1, %al
jne 0x190c
movq 0x40(%rsp), %rax
addq $0x58, %rsp
retq
jmp 0x186b
nopw %cs:(%rax,%rax)
// File: attractivechaos[P]udb2/verstable/./verstable.h
// Function: intmap_t_cleanup
VT_API_FN_QUALIFIERS void VT_CAT( NAME, _cleanup )( NAME *table )
{
  if( !table->bucket_count )
    return;

  #if defined( KEY_DTOR_FN ) || defined( VAL_DTOR_FN )
  VT_CAT( NAME, _clear )( table );
  #endif

  FREE_FN( table->metadata );
  FREE_FN( table->buckets );
  VT_CAT( NAME, _init )( table );
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1942
jmp 0x1965
movq (%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq (%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x1030
movq (%rsp), %rdi
callq 0x1800
popq %rax
retq
nopw (%rax,%rax)
// File: 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:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movq %rcx, -0x28(%rsp)
movq -0x28(%rsp), %rax
movw $0x1, (%rax)
movq $0x1, -0x30(%rsp)
movq -0x18(%rsp), %rcx
addq -0x30(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
subq $0x1, %rax
andq %rax, %rcx
movq -0x20(%rsp), %rax
movq %rcx, (%rax)
movq -0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rsp), %rcx
movq (%rcx), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x247a
movb $0x1, -0x1(%rsp)
jmp 0x24ae
movq -0x28(%rsp), %rcx
movw (%rcx), %ax
addw $0x1, %ax
movw %ax, (%rcx)
movzwl %ax, %eax
cmpl $0x7ff, %eax            # imm = 0x7FF
jne 0x249a
movb $0x0, -0x1(%rsp)
jmp 0x24ae
movq -0x28(%rsp), %rax
movzwl (%rax), %eax
addq -0x30(%rsp), %rax
movq %rax, -0x30(%rsp)
jmp 0x2437
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopw %cs:(%rax,%rax)