LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: luigix25[P]SSLP/library/RSAVerifyManager.cpp
// Function: RSAVerifyManager::RSAUpdate(char const*, int)
bool RSAVerifyManager::RSAUpdate(const char* data,int32_t len){
   
  if(!EVP_VerifyUpdate(this->mdctx, (unsigned char*) data,len)){
    perror("Error in RSA_VerifyUpdate");
    return false;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x49c0
cmpl $0x0, %eax
jne 0xaece
leaq 0x3743(%rip), %rdi      # 0xe606
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xaed2
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: luigix25[P]SSLP/library/RSAVerifyManager.cpp
// Function: RSAVerifyManager::RSAUpdate(Chunk&)
bool RSAVerifyManager::RSAUpdate(Chunk &ec){

    if(!EVP_VerifyUpdate(this->mdctx, (unsigned char*) ec.getPlainText(),ec.size)){
      perror("Error in RSA_VerifyUpdate");
    	return false;
    }

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd7e0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rdx
callq 0x49c0
cmpl $0x0, %eax
jne 0xaf2f
leaq 0x36e2(%rip), %rdi      # 0xe606
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xaf33
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: luigix25[P]SSLP/library/RSAVerifyManager.cpp
// Function: RSAVerifyManager::RSAFinal(char*)
int RSAVerifyManager::RSAFinal(char *signature){
	//int hash_size = EVP_MD_size(EVP_sha256());
  uint32_t len = EVP_PKEY_size(this->pubkey);

	//char *signature = new char [len];
  //unsigned int signature_len;
  int ret;

	ret = EVP_VerifyFinal(this->mdctx,(unsigned char*)signature, len, this->pubkey);

  //distruggere chiave pubblica
	//EVP_MD_CTX_free(mdctx);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x8(%rax), %rdi
callq 0x48f0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, -0x14(%rbp)
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq 0x8(%rax), %rcx
callq 0x41a0
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: luigix25[P]SSLP/library/RSAVerifyManager.cpp
// Function: RSAVerifyManager::~RSAVerifyManager()
RSAVerifyManager::~RSAVerifyManager(){
  EVP_MD_CTX_free(mdctx);
  CRYPTO_cleanup_all_ex_data();
  if(shouldFree)
    EVP_PKEY_free(this->pubkey);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq (%rax), %rdi
callq 0x4940
jmp 0xafae
jmp 0xafb0
xorl %eax, %eax
testb $0x1, %al
jne 0xafb8
jmp 0xafba
jmp 0xafb0
movq -0x10(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xafd5
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x42d0
jmp 0xafd3
jmp 0xafd5
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x7b80
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: luigix25[P]SSLP/library/RSASignManager.cpp
// Function: RSASignManager::RSASignManager(char const*)
RSASignManager::RSASignManager(const char *key_path){
	
  this->mdctx = NULL;
  this->prvkey = NULL;

	this->mdctx = EVP_MD_CTX_new();
	//size_t key_hmac_size = sizeof(KEY_HMAC);
  this->privkeyPath = string(key_path);
  
  if(!EVP_SignInit(mdctx,EVP_sha256())){
  		perror("Error In RSA_Init_ex");
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
addq $0x10, %rdi
movq %rdi, -0x60(%rbp)
callq 0x4780
movq -0x58(%rbp), %rax
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
callq 0x45b0
movq %rax, -0x50(%rbp)
jmp 0xb036
movq -0x58(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x4910
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x76e0
jmp 0xb069
movq -0x58(%rbp), %rdi
addq $0x10, %rdi
leaq -0x40(%rbp), %rsi
movq %rsi, -0x88(%rbp)
callq 0x4650
movq -0x88(%rbp), %rdi
callq 0x42b0
leaq -0x41(%rbp), %rdi
callq 0x4530
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
callq 0x48b0
movq %rax, -0x78(%rbp)
jmp 0xb0ac
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %rdi
callq 0x49b0
movl %eax, -0x8c(%rbp)
jmp 0xb0c1
movl -0x8c(%rbp), %eax
cmpl $0x0, %eax
jne 0xb101
leaq 0x351e(%rip), %rdi      # 0xe5f1
callq 0x4430
jmp 0xb0da
jmp 0xb101
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xb10a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x4530
jmp 0xb10a
addq $0x90, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x42b0
movq -0x18(%rbp), %rdi
callq 0x4900
nopl (%rax)
// File: luigix25[P]SSLP/library/RSASignManager.cpp
// Function: RSASignManager::RSAUpdate(char const*, int)
bool RSASignManager::RSAUpdate(const char* data, int32_t len){

  if(!EVP_SignUpdate(mdctx, (unsigned char*) data,len)){
      perror("Error in RSA_SignUpdate");
      return false;
    }

  return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x49c0
cmpl $0x0, %eax
jne 0xb15e
leaq 0x34cd(%rip), %rdi      # 0xe620
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xb162
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: luigix25[P]SSLP/library/RSASignManager.cpp
// Function: RSASignManager::RSAFinal(unsigned int&)
char* RSASignManager::RSAFinal(uint32_t& len){

  FILE* prvkey_file = fopen(this->privkeyPath.c_str(), "r");
  cout<<this->privkeyPath.c_str()<<endl;


  if(!prvkey_file){ cerr << "Error: cannot open file '" << this->privkeyPath << "' (missing?)\n"; exit(1); }
  this->prvkey = PEM_read_PrivateKey(prvkey_file, NULL, NULL, NULL);
  fclose(prvkey_file);
  if(!this->prvkey){ cerr << "Error: PEM_read_PrivateKey returned NULL\n"; exit(1); }
  

	char *signature = new char [EVP_PKEY_size(this->prvkey)];
  unsigned int signature_len;


	if(!EVP_SignFinal(mdctx,(unsigned char*)signature, &signature_len, this->prvkey)){
		perror("Error in RSA_Final");
		return NULL;
	}

  len = signature_len;

  //distruggere chiave privata
  EVP_PKEY_free(this->prvkey);
  this->prvkey = NULL;

	return signature;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x10, %rdi
callq 0x41e0
movq %rax, %rdi
leaq 0x310e(%rip), %rsi      # 0xe329
callq 0x45f0
movq -0x38(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x10, %rdi
callq 0x41e0
movq %rax, %rsi
movq 0x7d7d(%rip), %rdi      # 0x12fb8
callq 0x44a0
movq %rax, %rdi
movq 0x7d5e(%rip), %rsi      # 0x12fa8
callq 0x4500
cmpq $0x0, -0x20(%rbp)
jne 0xb292
movq 0x7d8b(%rip), %rdi      # 0x12fe8
leaq 0x2fe7(%rip), %rsi      # 0xe24b
callq 0x44a0
movq -0x38(%rbp), %rsi
movq %rax, %rdi
addq $0x10, %rsi
callq 0x4470
movq %rax, %rdi
leaq 0x2fe2(%rip), %rsi      # 0xe265
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x4370
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x44b0
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xb2e1
movq 0x7d1d(%rip), %rdi      # 0x12fe8
leaq 0x3366(%rip), %rsi      # 0xe638
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x48f0
movslq %eax, %rdi
callq 0x4040
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq 0x8(%rax), %rcx
leaq -0x2c(%rbp), %rdx
callq 0x40c0
cmpl $0x0, %eax
jne 0xb330
leaq 0x3341(%rip), %rdi      # 0xe662
callq 0x4430
movq $0x0, -0x8(%rbp)
jmp 0xb35a
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %edx
movq -0x18(%rbp), %rcx
movl %edx, (%rcx)
movq 0x8(%rax), %rdi
callq 0x42d0
movq -0x38(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/RSASignManager.cpp
// Function: RSASignManager::~RSASignManager()
RSASignManager::~RSASignManager(){
  if(this->prvkey != NULL){
    EVP_PKEY_free(this->prvkey);
  }

  if(this->mdctx != NULL){
    EVP_MD_CTX_free(this->mdctx);
  }

  CRYPTO_cleanup_all_ex_data();
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x8(%rax)
je 0xb39c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x42d0
jmp 0xb39a
jmp 0xb39c
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xb3b6
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4940
jmp 0xb3b4
jmp 0xb3b6
jmp 0xb3b8
xorl %eax, %eax
testb $0x1, %al
jne 0xb3c0
jmp 0xb3c2
jmp 0xb3b8
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x42b0
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x7b80
nopl (%rax)
// File: luigix25[P]SSLP/library/SendReceiveFile.cpp
// Function: checkValidityFilename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool checkValidityFilename(string filename){
	if(filename.find('/') != string::npos){
		cout << "filename not correct " << endl;
		return false;
	}
	else{
		cout << "filename correct " << endl;
		return true;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movl $0x2f, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x46f0
cmpq $-0x1, %rax
je 0xb428
movq 0x7bb1(%rip), %rdi      # 0x12fb8
leaq 0x327a(%rip), %rsi      # 0xe688
callq 0x44a0
movq %rax, %rdi
movq 0x7b8b(%rip), %rsi      # 0x12fa8
callq 0x4500
movb $0x0, -0x1(%rbp)
jmp 0xb44e
movq 0x7b89(%rip), %rdi      # 0x12fb8
leaq 0x3268(%rip), %rsi      # 0xe69e
callq 0x44a0
movq %rax, %rdi
movq 0x7b63(%rip), %rsi      # 0x12fa8
callq 0x4500
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: luigix25[P]SSLP/library/CertificateManager.cpp
// Function: CertificateManager::verifyCertificate(x509_st*)
bool CertificateManager::verifyCertificate(X509* certificate){

	if(!certificate)
		return false;

	int ret;

	X509_STORE_CTX* certvfy_ctx = X509_STORE_CTX_new();
	if(!certvfy_ctx) { cerr << "Error: X509_STORE_CTX_new returned NULL\n" << ERR_error_string(ERR_get_error(), NULL) << "\n"; exit(1); }
	ret = X509_STORE_CTX_init(certvfy_ctx, store, certificate, NULL);
	if(ret != 1) { cerr << "Error: X509_STORE_CTX_init returned " << ret << "\n" << ERR_error_string(ERR_get_error(), NULL) << "\n"; exit(1); }
	ret = X509_verify_cert(certvfy_ctx);
	
	X509_STORE_CTX_free(certvfy_ctx);

	if(ret != 1) { 
		cerr << "Error: X509_verify_cert returned " << ret << "\n" << ERR_error_string(ERR_get_error(), NULL) << endl; 
		return false;
	} else {
		return true;
	}


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xc868
movb $0x0, -0x1(%rbp)
jmp 0xc9cf
callq 0x4400
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc8c5
movq 0x6769(%rip), %rdi      # 0x12fe8
leaq 0x2010(%rip), %rsi      # 0xe896
callq 0x44a0
movq %rax, -0x38(%rbp)
callq 0x4710
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4180
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x44a0
movq %rax, %rdi
leaq 0x19bb(%rip), %rsi      # 0xe271
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rdi
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x42f0
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
je 0xc94d
movq 0x66fb(%rip), %rdi      # 0x12fe8
leaq 0x1fcb(%rip), %rsi      # 0xe8bf
callq 0x44a0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x48d0
movq %rax, %rdi
leaq 0x1963(%rip), %rsi      # 0xe271
callq 0x44a0
movq %rax, -0x40(%rbp)
callq 0x4710
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4180
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x44a0
movq %rax, %rdi
leaq 0x1933(%rip), %rsi      # 0xe271
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x28(%rbp), %rdi
callq 0x43b0
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4820
cmpl $0x1, -0x1c(%rbp)
je 0xc9cb
movq 0x6679(%rip), %rdi      # 0x12fe8
leaq 0x1f6e(%rip), %rsi      # 0xe8e4
callq 0x44a0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x48d0
movq %rax, %rdi
leaq 0x18e1(%rip), %rsi      # 0xe271
callq 0x44a0
movq %rax, -0x48(%rbp)
callq 0x4710
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4180
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x44a0
movq %rax, %rdi
movq 0x65e8(%rip), %rsi      # 0x12fa8
callq 0x4500
movb $0x0, -0x1(%rbp)
jmp 0xc9cf
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: luigix25[P]SSLP/library/CertificateManager.cpp
// Function: CertificateManager::extractCommonName(x509_st*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool CertificateManager::extractCommonName(X509* certificate,string &string_name){

	if(!certificate)
		return false;

	X509_NAME* name = X509_get_subject_name(certificate);
	int len;
	
	len = X509_NAME_get_text_by_NID(name,NID_commonName,NULL,0);				//i get the length of the commonname
	if(len == -1)
		return false;

	len++;																		//terminator char

	char *tmp = new char[len];

	if(X509_NAME_get_text_by_NID(name,NID_commonName,tmp,len) == -1)
		return false;

	string_name = (string)tmp;
	delete[] tmp;

	return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xca07
movb $0x0, -0x1(%rbp)
jmp 0xcaf4
movq -0x18(%rbp), %rdi
callq 0x4520
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0xd, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x4600
movl %eax, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xca3a
movb $0x0, -0x1(%rbp)
jmp 0xcaf4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rdi
callq 0x4040
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl $0xd, %esi
callq 0x4600
cmpl $-0x1, %eax
jne 0xca73
movb $0x0, -0x1(%rbp)
jmp 0xcaf4
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x4910
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x76e0
jmp 0xca9b
movq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4650
leaq -0x58(%rbp), %rdi
callq 0x42b0
leaq -0x59(%rbp), %rdi
callq 0x4530
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0xcad7
movq -0x88(%rbp), %rdi
callq 0x46d0
movb $0x1, -0x1(%rbp)
jmp 0xcaf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x4530
jmp 0xcb02
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x4900
nopl (%rax,%rax)
// File: luigix25[P]SSLP/library/RSAEncryptManager.cpp
// Function: RSAEncryptManager::RSAEncryptManager(evp_pkey_st*)
RSAEncryptManager::RSAEncryptManager(EVP_PKEY *pubkey){
  
  this->mdctx = NULL;

  this->mdctx = EVP_CIPHER_CTX_new();
  //size_t key_hmac_size = sizeof(KEY_HMAC);
  this->pubkey = pubkey;
  
  unsigned char* key = new unsigned char[EVP_PKEY_size(pubkey)];
  unsigned char *iv = new unsigned char[EVP_CIPHER_iv_length(EVP_aes_128_cbc())];

  int key_len;


  if(!EVP_SealInit(mdctx,EVP_aes_128_cbc(),&key,&key_len,iv,&pubkey,1)){
      perror("Error In RSA_Init_ex");
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x10, %rdi
movq %rdi, -0x50(%rbp)
callq 0x4780
movq -0x48(%rbp), %rax
movq $0x0, (%rax)
callq 0x42e0
movq %rax, -0x40(%rbp)
jmp 0xcb6e
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x48f0
movl %eax, -0x54(%rbp)
jmp 0xcb8f
movl -0x54(%rbp), %eax
movslq %eax, %rdi
callq 0x4040
movq %rax, -0x60(%rbp)
jmp 0xcba0
movq -0x60(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x4260
movq %rax, -0x68(%rbp)
jmp 0xcbb3
movq -0x68(%rbp), %rdi
callq 0x4980
movl %eax, -0x6c(%rbp)
jmp 0xcbc1
movl -0x6c(%rbp), %eax
movslq %eax, %rdi
callq 0x4040
movq %rax, -0x78(%rbp)
jmp 0xcbd2
movq -0x48(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x4260
movq %rax, -0x80(%rbp)
jmp 0xcbf3
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdi
movq -0x30(%rbp), %r8
movq %rsp, %rax
movl $0x1, (%rax)
leaq -0x28(%rbp), %rdx
leaq -0x34(%rbp), %rcx
leaq -0x10(%rbp), %r9
callq 0x49e0
movl %eax, -0x8c(%rbp)
jmp 0xcc24
movl -0x8c(%rbp), %eax
cmpl $0x0, %eax
jne 0xcc56
leaq 0x19bb(%rip), %rdi      # 0xe5f1
callq 0x4430
jmp 0xcc3d
jmp 0xcc56
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x42b0
jmp 0xcc5f
addq $0xa0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x4900
nopl (%rax,%rax)
// File: luigix25[P]SSLP/library/RSAEncryptManager.cpp
// Function: RSAEncryptManager::RSAUpdate(EncryptedChunk&, Chunk&)
bool RSAEncryptManager::RSAUpdate(EncryptedChunk &ec,Chunk& c){

    if(!EVP_SealUpdate(this->mdctx, (unsigned char*)ec.getCipherText(), &ec.size, (unsigned char*)c.getPlainText(), c.size)){
      perror("Error in RSA_Update");
      return false;
    }

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd970
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd7e0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq %rax, %rcx
movq -0x20(%rbp), %rax
movl 0x10(%rax), %r8d
callq 0x40b0
cmpl $0x0, %eax
jne 0xcce4
leaq 0x1c2d(%rip), %rdi      # 0xe906
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xcce8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/RSAEncryptManager.cpp
// Function: RSAEncryptManager::RSAFinal(EncryptedChunk&)
bool RSAEncryptManager::RSAFinal(EncryptedChunk& ec){

  int len;

  if(!EVP_SealFinal(this->mdctx, (unsigned char*)ec.getCipherText() + ec.size, &len)){
    perror("Error in RSA_Final");
    return false;
  }

  ec.size += len;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd970
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rax
addq %rax, %rsi
leaq -0x1c(%rbp), %rdx
callq 0x4580
cmpl $0x0, %eax
jne 0xcd56
leaq 0x1917(%rip), %rdi      # 0xe662
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xcd67
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/RSADecryptManager.cpp
// Function: RSADecryptManager::RSADecryptManager(char const*, unsigned int)
RSADecryptManager::RSADecryptManager(const char *privkey_path,uint32_t key_len){
  
  this->mdctx = NULL;

  this->mdctx = EVP_CIPHER_CTX_new();
  //size_t key_hmac_size = sizeof(KEY_HMAC);
  
  FILE* privkey_file = fopen(privkey_path, "r");
  if(!privkey_file){ 
    cerr << "Error: cannot open file '" << privkey_path << "' (missing?)\n"; 
    exit(1); 
  }

  this->privkey = PEM_read_PrivateKey(privkey_file, NULL, NULL, NULL);
  fclose(privkey_file);

  if(!this->privkey){ 
    cerr << "Error: PEM_read_PUBKEY returned NULL\n"; 
    exit(1); 
  }

  this->key = new unsigned char[key_len];
  this->iv = new unsigned char[EVP_CIPHER_iv_length(EVP_aes_128_cbc())];

  if(!EVP_OpenInit(this->mdctx,EVP_aes_128_cbc(),key,key_len,iv,this->privkey)){
      perror("Error In RSA_Init_ex");
  }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, (%rax)
callq 0x42e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
leaq 0x152d(%rip), %rsi      # 0xe329
callq 0x45f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xce44
movq 0x61d5(%rip), %rdi      # 0x12fe8
leaq 0x1431(%rip), %rsi      # 0xe24b
callq 0x44a0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44a0
movq %rax, %rdi
leaq 0x1430(%rip), %rsi      # 0xe265
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x4370
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x44b0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xce93
movq 0x616b(%rip), %rdi      # 0x12fe8
leaq 0x1747(%rip), %rsi      # 0xe5cb
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movl -0x14(%rbp), %eax
movl %eax, %edi
callq 0x4040
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
callq 0x4260
movq %rax, %rdi
callq 0x4980
movslq %eax, %rdi
callq 0x4040
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x4260
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movl -0x14(%rbp), %ecx
movq 0x10(%rax), %r8
movq 0x8(%rax), %r9
callq 0x4480
cmpl $0x0, %eax
jne 0xcf04
leaq 0x16f2(%rip), %rdi      # 0xe5f1
callq 0x4430
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: luigix25[P]SSLP/library/RSADecryptManager.cpp
// Function: RSADecryptManager::RSAUpdate(Chunk&, EncryptedChunk&)
bool RSADecryptManager::RSAUpdate(Chunk &c, EncryptedChunk &ec){

    if(!EVP_OpenUpdate(this->mdctx, (unsigned char*)ec.getCipherText(), &ec.size, (unsigned char*)c.getPlainText(), c.size)){
      perror("Error in RSA_Update");
      return false;
    }

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd970
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd7e0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
callq 0x42c0
cmpl $0x0, %eax
jne 0xcf84
leaq 0x198d(%rip), %rdi      # 0xe906
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xcf88
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/RSADecryptManager.cpp
// Function: RSADecryptManager::RSAFinal(Chunk&)
bool RSADecryptManager::RSAFinal(Chunk& c){

  int len;

  if(!EVP_OpenFinal(this->mdctx, (unsigned char*)c.getPlainText() + c.size, &len)){
    perror("Error in RSA_Final");
    return false;
  }

  c.size += len;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd7e0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rax
addq %rax, %rsi
leaq -0x1c(%rbp), %rdx
callq 0x45a0
cmpl $0x0, %eax
jne 0xcff6
leaq 0x1677(%rip), %rdi      # 0xe662
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xd007
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/DHManager.cpp
// Function: DHManager::DHManager(char const*)
DHManager::DHManager(const char *path){

	FILE* dh_params = fopen(path, "r");
	if(!dh_params){ cerr << "Error: cannot open file '" << path << "' (missing?)\n"; exit(1); }
	this->session = PEM_read_DHparams(dh_params, NULL, NULL, NULL);
	fclose(dh_params);
	if(!this->session){ cerr << "Error: PEM_read_DHparams returned NULL\n"; exit(1); }

	int res;

	if(DH_check(this->session,&res) != 1){
		cout<<"Errore"<<endl;
	} 

	if(res != 0){
		cerr<<"Error in DH params"<<endl;
		exit(-1);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x12b6(%rip), %rsi      # 0xe329
callq 0x45f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xd0bb
movq 0x5f5e(%rip), %rdi      # 0x12fe8
leaq 0x11ba(%rip), %rsi      # 0xe24b
callq 0x44a0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x44a0
movq %rax, %rdi
leaq 0x11b9(%rip), %rsi      # 0xe265
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x41c0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x44b0
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xd108
movq 0x5ef6(%rip), %rdi      # 0x12fe8
leaq 0x1821(%rip), %rsi      # 0xe91a
callq 0x44a0
movl $0x1, %edi
callq 0x4640
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x4300
cmpl $0x1, %eax
je 0xd13f
movq 0x5e94(%rip), %rdi      # 0x12fb8
leaq 0x1817(%rip), %rsi      # 0xe942
callq 0x44a0
movq %rax, %rdi
movq 0x5e6e(%rip), %rsi      # 0x12fa8
callq 0x4500
cmpl $0x0, -0x1c(%rbp)
je 0xd171
movq 0x5e9c(%rip), %rdi      # 0x12fe8
leaq 0x17f6(%rip), %rsi      # 0xe949
callq 0x44a0
movq %rax, %rdi
movq 0x5e46(%rip), %rsi      # 0x12fa8
callq 0x4500
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4640
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: luigix25[P]SSLP/library/DHManager.cpp
// Function: DHManager::generatePublicKey(int&)
char * DHManager::generatePublicKey(int &len){
	if(DH_generate_key(this->session) != 1){
		cerr<<"Error in DH_generate_key"<<endl;
		return NULL;
	}

	BIGNUM *pub_key;
	DH_get0_key(this->session,(const BIGNUM**)&pub_key,NULL);

	unsigned char *return_value = new unsigned char[BN_num_bytes(pub_key)];


	len = BN_bn2bin(pub_key,return_value);
	if(len <= 0){
		delete[] return_value;
		return NULL;
	}

	return (char*)return_value;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq (%rax), %rdi
callq 0x4170
cmpl $0x1, %eax
je 0xd1d1
movq 0x5e3c(%rip), %rdi      # 0x12fe8
leaq 0x17a9(%rip), %rsi      # 0xe95c
callq 0x44a0
movq %rax, %rdi
movq 0x5de6(%rip), %rsi      # 0x12fa8
callq 0x4500
movq $0x0, -0x8(%rbp)
jmp 0xd24c
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4320
movq -0x20(%rbp), %rdi
callq 0x45c0
addl $0x7, %eax
movl $0x8, %ecx
cltd
idivl %ecx
movslq %eax, %rdi
callq 0x4040
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4670
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jg 0xd244
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xd23a
movq -0x38(%rbp), %rdi
callq 0x46d0
movq $0x0, -0x8(%rbp)
jmp 0xd24c
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/DHManager.cpp
// Function: DHManager::computeSimmetricKey(char const*, unsigned int, int&)
char * DHManager::computeSimmetricKey(const char *received_data,uint32_t len,int &key_len){

	BIGNUM *opponent_pubkey = BN_bin2bn((const unsigned char*)received_data,len,NULL);
	unsigned char* key = new unsigned char[DH_size(this->session)];
	key_len = DH_compute_key(key,opponent_pubkey,this->session);

	BN_free(opponent_pubkey);

	if(key_len <=0)
		return NULL;

	return (char*)key;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x4160
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x4380
movslq %eax, %rdi
callq 0x4040
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq (%rax), %rdx
callq 0x4590
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rdi
callq 0x4760
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jg 0xd2e9
movq $0x0, -0x8(%rbp)
jmp 0xd2f1
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: luigix25[P]SSLP/library/HashManager.cpp
// Function: HashManager::HashUpdate(char*, int)
bool HashManager::HashUpdate(char* plaintext,int len){

    if(!EVP_DigestUpdate(mdctx, (unsigned char*) plaintext,len)){
    	perror("Error in EVP_DigestUpdate");
    	return false;
    }

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x49c0
cmpl $0x0, %eax
jne 0xd4de
leaq 0x14ba(%rip), %rdi      # 0xe98d
callq 0x4430
movb $0x0, -0x1(%rbp)
jmp 0xd4e2
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: luigix25[P]SSLP/library/HashManager.cpp
// Function: HashManager::HashFinal()
char* HashManager::HashFinal(){
  unsigned int hash_size = EVP_MD_size(EVP_sha256());
  char *digest = new char [HASH_SIZE];

  if(!EVP_DigestFinal(mdctx, (unsigned char*) digest,&hash_size)){
    perror("Error in EVP_DigestFinal");
    return NULL;
  }

  return digest;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x48b0
movq %rax, %rdi
callq 0x41b0
movl %eax, -0x14(%rbp)
movl $0x20, %edi
callq 0x4040
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x47a0
cmpl $0x0, %eax
jne 0xd554
leaq 0x1462(%rip), %rdi      # 0xe9a7
callq 0x4430
movq $0x0, -0x8(%rbp)
jmp 0xd55c
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/Chunk.cpp
// Function: Chunk::clean()
void Chunk::clean(){
	if(plaintext != NULL && shouldFree){
		delete[] plaintext;
		plaintext = NULL;
		shouldFree = false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x8(%rax)
je 0xd74e
movq -0x10(%rbp), %rax
testb $0x1, (%rax)
je 0xd74e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xd73f
movq -0x18(%rbp), %rdi
callq 0x46d0
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: luigix25[P]SSLP/library/Chunk.cpp
// Function: EncryptedChunk::clean()
void EncryptedChunk::clean(){
	if(ciphertext != NULL && shouldFree){
		delete[] ciphertext;
		ciphertext = NULL;
		shouldFree = false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x8(%rax)
je 0xd91e
movq -0x10(%rbp), %rax
testb $0x1, (%rax)
je 0xd91e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0xd90f
movq -0x18(%rbp), %rdi
callq 0x46d0
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movb $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_10.cc
// Function: main
int main(int argc, char const *argv[])
{
	shared_ptr<int> p(new int(42));

	cout << p.use_count() << endl;
	process(shared_ptr<int>(p));
	cout << p.use_count() << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x4, %edi
callq 0x1070
movq %rax, %rsi
movl $0x2a, (%rsi)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x13c0
movq -0x50(%rbp), %rdi
callq 0x13a0
movq %rax, %rsi
movq 0x2cff(%rip), %rdi      # 0x3fd8
callq 0x10e0
movq %rax, -0x48(%rbp)
jmp 0x12e4
movq -0x48(%rbp), %rdi
movq 0x2cd1(%rip), %rsi      # 0x3fc0
callq 0x1090
jmp 0x12f6
leaq -0x40(%rbp), %rdi
movq %rdi, -0x58(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x13f0
movq -0x58(%rbp), %rdi
callq 0x1230
jmp 0x1312
leaq -0x40(%rbp), %rdi
callq 0x1420
leaq -0x20(%rbp), %rdi
callq 0x13a0
movq %rax, %rsi
movq 0x2caa(%rip), %rdi      # 0x3fd8
callq 0x10e0
movq %rax, -0x60(%rbp)
jmp 0x1339
movq -0x60(%rbp), %rdi
movq 0x2c7c(%rip), %rsi      # 0x3fc0
callq 0x1090
jmp 0x134b
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1420
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1387
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1420
leaq -0x20(%rbp), %rdi
callq 0x1420
movq -0x28(%rbp), %rdi
callq 0x10d0
nopl (%rax)
// File: aempirei[P]Chat-Art/include/ansi.hh
// Function: ansi::esc(std::__cxx11::list<int, std::allocator<int>> const&, char)
std::string esc(const std::list<int>& args, char mode) {

		std::stringstream ss;
		auto iter = args.begin();

		ss << start;

		if(iter != args.end()) {
			ss << *iter;

			for(iter++; iter != args.end(); iter++) {
				ss << ';' << *iter;

			}
		}

		ss << mode;

		return ss.str();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x1e8(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x1e0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x2130
movq -0x10(%rbp), %rdi
callq 0x4c30
movq %rax, -0x1a8(%rbp)
leaq -0x190(%rbp), %rdi
leaq 0xcb15(%rip), %rsi      # 0xf238
callq 0x21c0
jmp 0x272a
movq -0x10(%rbp), %rdi
callq 0x4c90
movq %rax, -0x1c0(%rbp)
leaq -0x1a8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x4c60
testb $0x1, %al
jne 0x2756
jmp 0x282f
leaq -0x190(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x4cc0
movq -0x1f0(%rbp), %rdi
movl (%rax), %esi
callq 0x2340
jmp 0x2780
leaq -0x1a8(%rbp), %rdi
xorl %esi, %esi
callq 0x4cf0
movq %rax, -0x1c8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4c90
movq %rax, -0x1d0(%rbp)
leaq -0x1a8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x4c60
testb $0x1, %al
jne 0x27be
jmp 0x282d
leaq -0x190(%rbp), %rdi
movl $0x3b, %esi
callq 0x2270
movq %rax, -0x1f8(%rbp)
jmp 0x27d8
leaq -0x1a8(%rbp), %rdi
callq 0x4cc0
movq -0x1f8(%rbp), %rdi
movl (%rax), %esi
callq 0x2340
jmp 0x27f4
jmp 0x27f6
leaq -0x1a8(%rbp), %rdi
xorl %esi, %esi
callq 0x4cf0
movq %rax, -0x1d8(%rbp)
jmp 0x2795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x2150
jmp 0x2872
jmp 0x282f
leaq -0x190(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x2270
jmp 0x2841
movq -0x1e8(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x21d0
jmp 0x2856
leaq -0x1a0(%rbp), %rdi
callq 0x2150
movq -0x1e0(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
movq -0x1b0(%rbp), %rdi
callq 0x2350
nop
// File: aempirei[P]Chat-Art/include/geometry.hh
// Function: geometry::to_string[abi:cxx11]() const
std::string geometry::to_string() const {

	char buf[128];
	char modebuf[128];

	switch(mode) {

		case geometry::BGCOLOR: 
		case geometry::FGCOLOR: 

			snprintf(modebuf, sizeof(modebuf), " color %3d %3d %3d   # %s%s", color[0], color[1], color[2],
					base ? "bold " : "", ansi::color_name[code]
					);
			break;

		case geometry::SYMBOL:

			snprintf(modebuf, sizeof(modebuf), " ratio %2d %2d size %d %d   # (%c)",
					ratio, ratio_max - ratio,
					(int)size[1], (int)size[0], base + code
				);
			break;

		case geometry::NOP:
		default:
			*modebuf = '\0';
	}



	snprintf(buf, sizeof(buf), "mcb %2d %2d %2d%s", mode, code, base, modebuf);

	return std::string(buf);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x140(%rbp)
movq %rdi, %rax
movq %rax, -0x138(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movl 0x18(%rax), %eax
movl %eax, -0x128(%rbp)
testl %eax, %eax
je 0x29e4
jmp 0x2922
movl -0x128(%rbp), %eax
decl %eax
subl $0x2, %eax
jb 0x2941
jmp 0x2931
movl -0x128(%rbp), %eax
subl $0x3, %eax
je 0x299f
jmp 0x29e6
movq -0x130(%rbp), %rax
leaq -0x110(%rbp), %rdi
movl 0x8(%rax), %ecx
movl 0xc(%rax), %r8d
movl 0x10(%rax), %r9d
movl 0x20(%rax), %esi
leaq 0x7a75(%rip), %r10      # 0xa3d9
leaq 0x7723(%rip), %rdx      # 0xa08e
cmpl $0x0, %esi
cmovneq %rdx, %r10
movslq 0x1c(%rax), %rdx
leaq 0xc863(%rip), %rax      # 0xf1e0
movq (%rax,%rdx,8), %rax
movl $0x80, %esi
leaq 0x76e5(%rip), %rdx      # 0xa072
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x2310
jmp 0x29ed
movq -0x130(%rbp), %rdx
leaq -0x110(%rbp), %rdi
movl 0x14(%rdx), %ecx
movl $0x3f, %r8d
subl 0x14(%rdx), %r8d
movl 0x4(%rdx), %r9d
movl (%rdx), %r10d
movl 0x20(%rdx), %eax
addl 0x1c(%rdx), %eax
movl $0x80, %esi
leaq 0x76c1(%rip), %rdx      # 0xa094
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x2310
jmp 0x29ed
jmp 0x29e6
movb $0x0, -0x110(%rbp)
movq -0x130(%rbp), %rax
movl 0x18(%rax), %ecx
movl 0x1c(%rax), %r8d
movl 0x20(%rax), %r9d
movq %rsp, %rax
leaq -0x110(%rbp), %rdx
movq %rdx, (%rax)
leaq 0x76a4(%rip), %rdx      # 0xa0b7
xorl %eax, %eax
leaq -0x90(%rbp), %rdi
movq %rdi, -0x150(%rbp)
movl $0x80, %esi
callq 0x2310
leaq -0x111(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x2360
movq -0x140(%rbp), %rdi
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
callq 0x4b80
jmp 0x2a5c
leaq -0x111(%rbp), %rdi
callq 0x2240
movq -0x138(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x111(%rbp), %rdi
callq 0x2240
movq -0x120(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)
// File: aempirei[P]Chat-Art/include/pnm.hh
// Function: pnm::pnm(_IO_FILE*)
pnm::pnm(FILE *fp) {

	const unsigned int expected_mv = 255;

	unsigned int w;
	unsigned int h;
	unsigned int mv;

	if(fscanf(fp, "P6 %u %u %u", &w, &h, &mv) == 3) {

		int ch = fgetc(fp);

		if(isspace(ch) && mv == expected_mv) {

			data = new rgb_t[w * h];

			if(fread(data, sizeof(rgb_t), w * h, fp) == w * h) {
				width = w;
				height = h;
			} else {
				free();
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0xff, -0x14(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x75d8(%rip), %rsi      # 0xa0c9
leaq -0x18(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
leaq -0x20(%rbp), %r8
movb $0x0, %al
callq 0x2380
cmpl $0x3, %eax
jne 0x2bb3
movq -0x10(%rbp), %rdi
callq 0x2300
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
callq 0x2060
cmpl $0x0, %eax
je 0x2bb1
cmpl $0xff, -0x20(%rbp)
jne 0x2bb1
movl -0x18(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, %eax
movl $0x3, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rax), %rdi
movl -0x18(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
movq -0x10(%rbp), %rcx
movl $0x3, %esi
callq 0x22e0
movl -0x18(%rbp), %ecx
imull -0x1c(%rbp), %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x2ba6
movq -0x30(%rbp), %rax
movl -0x18(%rbp), %ecx
movq %rcx, (%rax)
movl -0x1c(%rbp), %ecx
movq %rcx, 0x8(%rax)
jmp 0x2baf
movq -0x30(%rbp), %rdi
callq 0x2bc0
jmp 0x2bb1
jmp 0x2bb3
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: aempirei[P]Chat-Art/include/pnm.hh
// Function: pnm::free()
bool pnm::free() {
	if(data != NULL) {
		delete data;
		data = NULL;
		return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, 0x10(%rax)
je 0x2c08
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x2bf6
movq -0x20(%rbp), %rdi
callq 0x22a0
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x2c0c
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: aempirei[P]Chat-Art/include/tile.hh
// Function: tile::set_status(geometry::mode_type, int, int)
tile& tile::set_status(geometry::mode_type my_mode, int my_code, int my_base) {
	geo.mode = my_mode;
	geo.code = my_code;
	geo.base = my_base;
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x20(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0x24(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x28(%rax)
popq %rbp
retq
nopl (%rax)
// File: aempirei[P]Chat-Art/include/tile.hh
// Function: tile::move(long, long)
const pos_t& tile::move(ssize_t lines, ssize_t columns) {

	pos[1] += lines * geo.size[1];
	pos[0] += columns * geo.size[0];

	sum(rgb_sum);
	mean(rgb_mean);
	stdev(rgb_stdev);

	set_color_lum();

	return pos;
}

// 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 -0x10(%rbp), %rcx
movslq 0xc(%rdi), %rax
imulq %rax, %rcx
movslq 0x30(%rdi), %rax
addq %rcx, %rax
movl %eax, 0x30(%rdi)
movq -0x18(%rbp), %rcx
movslq 0x8(%rdi), %rax
imulq %rax, %rcx
movslq 0x2c(%rdi), %rax
addq %rcx, %rax
movl %eax, 0x2c(%rdi)
movq %rdi, %rsi
addq $0x40, %rsi
callq 0x2eb0
movq -0x20(%rbp), %rdi
movq %rdi, %rsi
addq $0x34, %rsi
callq 0x2f80
movq -0x20(%rbp), %rdi
movq %rdi, %rsi
addq $0x4c, %rsi
callq 0x3000
movq -0x20(%rbp), %rdi
callq 0x3170
movq -0x20(%rbp), %rax
addq $0x2c, %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: aempirei[P]Chat-Art/include/tile.hh
// Function: tile::sum(int (&) [3]) const
const rgb_sum_t& tile::sum(rgb_sum_t& v) const {

	v[0] = v[1] = v[2] = 0;

	for(int y = 0; y < geo.size[1]; y++) {
		for(int x = 0; x < geo.size[0]; x++) {

			const rgb_t& w = *pixel(y,x);

			for(int i = 0; i < 3; i++)
				v[i] += w[i];
		}
	}

	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x2f6f
movl $0x0, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x2f62
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rsi
movslq -0x18(%rbp), %rdx
callq 0x3230
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jge 0x2f55
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2f2a
jmp 0x2f57
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2f02
jmp 0x2f64
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2eef
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: aempirei[P]Chat-Art/include/tile.hh
// Function: tile::stdev(int (&) [3]) const
const rgb_sum_t& tile::stdev(rgb_sum_t& v) const {

	v[0] = v[1] = v[2] = 0;

	for(int y = 0; y < geo.size[1]; y++) {
		for(int x = 0; x < geo.size[0]; x++) {

			const rgb_t& w = *pixel(y,x);

			for(int i = 0; i < 3; i++) {
				int32_t xx = w[i] - rgb_mean[i];
				v[i] += xx * xx;
			}
		}
	}

	for(int i = 0; i < 3; i++)
		v[i] = (int32_t)rint(sqrt((double)v[i] / n()));

	return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x14(%rbp)
movq -0x38(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %eax
jge 0x30dc
movl $0x0, -0x18(%rbp)
movq -0x38(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x30cc
movq -0x38(%rbp), %rdi
movslq -0x14(%rbp), %rsi
movslq -0x18(%rbp), %rdx
callq 0x3230
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jge 0x30bf
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rdx
movzbl (%rax,%rdx), %eax
movslq -0x24(%rbp), %rdx
subl 0x34(%rcx,%rdx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %edx
imull -0x28(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x307e
jmp 0x30c1
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3056
jmp 0x30ce
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x303f
movl $0x0, -0x2c(%rbp)
cmpl $0x3, -0x2c(%rbp)
jge 0x3158
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x3210
movsd -0x40(%rbp), %xmm0
movq %rax, %xmm1
movaps 0x6efb(%rip), %xmm2     # 0xa010
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x6eff(%rip), %xmm2     # 0xa020
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x2170
callq 0x22b0
cvttsd2si %xmm0, %edx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x30e3
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: aempirei[P]Chat-Art/include/tile.hh
// Function: tile::set_color_lum()
void tile::set_color_lum() {
	geo.ratio = 0;
	for(int i = 0; i < 3; i++) {
		uint8_t level = (uint8_t)(rgb_sum[i] / n()) >> geometry::ratio_shift;
		geo.color[i] = rgb_mean[i] & mean_mask;
		if(level > geo.ratio)
			geo.ratio = level;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, 0x1c(%rax)
movl $0x0, -0xc(%rbp)
cmpl $0x3, -0xc(%rbp)
jge 0x31fb
movq -0x18(%rbp), %rdi
movslq -0xc(%rbp), %rax
movslq 0x40(%rdi,%rax,4), %rax
movq %rax, -0x20(%rbp)
callq 0x3210
movq -0x18(%rbp), %rcx
movq %rax, %rsi
movq -0x20(%rbp), %rax
xorl %edx, %edx
divq %rsi
movzbl %al, %eax
sarl $0x2, %eax
movb %al, -0xd(%rbp)
movslq -0xc(%rbp), %rax
movl 0x34(%rcx,%rax,4), %edx
andl $-0x2, %edx
movslq -0xc(%rbp), %rax
movl %edx, 0x10(%rcx,%rax,4)
movzbl -0xd(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jle 0x31ee
movq -0x18(%rbp), %rax
movzbl -0xd(%rbp), %ecx
movl %ecx, 0x1c(%rax)
jmp 0x31f0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3192
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)