LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: SubWord
WORD SubWord(WORD word)
{
	unsigned int result;

	result = (int)aes_sbox[(word >> 4) & 0x0000000F][word & 0x0000000F];
	result += (int)aes_sbox[(word >> 12) & 0x0000000F][(word >> 8) & 0x0000000F] << 8;
	result += (int)aes_sbox[(word >> 20) & 0x0000000F][(word >> 16) & 0x0000000F] << 16;
	result += (int)aes_sbox[(word >> 28) & 0x0000000F][(word >> 24) & 0x0000000F] << 24;
	return(result);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
shrl $0x4, %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x44b5(%rip), %rax      # 0x8010
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x4(%rbp), %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
shrl $0xc, %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x448b(%rip), %rax      # 0x8010
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x4(%rbp), %ecx
shrl $0x8, %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
shll $0x8, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
shrl $0x14, %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x4458(%rip), %rax      # 0x8010
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x4(%rbp), %ecx
shrl $0x10, %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
shll $0x10, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
shrl $0x1c, %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x4425(%rip), %rax      # 0x8010
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x4(%rbp), %ecx
shrl $0x18, %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
shll $0x18, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nop
// File: DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: ShiftRows
void ShiftRows(BYTE state[][4])
{
	int t;

	// Shift left by 1
	t = state[1][0];
	state[1][0] = state[1][1];
	state[1][1] = state[1][2];
	state[1][2] = state[1][3];
	state[1][3] = t;
	// Shift left by 2
	t = state[2][0];
	state[2][0] = state[2][2];
	state[2][2] = t;
	t = state[2][1];
	state[2][1] = state[2][3];
	state[2][3] = t;
	// Shift left by 3
	t = state[3][0];
	state[3][0] = state[3][3];
	state[3][3] = state[3][2];
	state[3][2] = state[3][1];
	state[3][1] = t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x5(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x5(%rax)
movq -0x8(%rbp), %rax
movb 0x7(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x6(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0xa(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x8(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xa(%rax)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0xb(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x9(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x8(%rbp), %rax
movzbl 0xc(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0xf(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x8(%rbp), %rax
movb 0xe(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xf(%rax)
movq -0x8(%rbp), %rax
movb 0xd(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xe(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/./aes/aes.c
// Function: InvShiftRows
void InvShiftRows(BYTE state[][4])
{
	int t;

	// Shift right by 1
	t = state[1][3];
	state[1][3] = state[1][2];
	state[1][2] = state[1][1];
	state[1][1] = state[1][0];
	state[1][0] = t;
	// Shift right by 2
	t = state[2][3];
	state[2][3] = state[2][1];
	state[2][1] = t;
	t = state[2][2];
	state[2][2] = state[2][0];
	state[2][0] = t;
	// Shift right by 3
	t = state[3][3];
	state[3][3] = state[3][0];
	state[3][0] = state[3][1];
	state[3][1] = state[3][2];
	state[3][2] = t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rax
movb 0x5(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
movb 0x4(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x5(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x8(%rbp), %rax
movzbl 0xb(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x9(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x9(%rax)
movq -0x8(%rbp), %rax
movzbl 0xa(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x8(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xa(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
movzbl 0xf(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0xc(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xf(%rax)
movq -0x8(%rbp), %rax
movb 0xd(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xc(%rax)
movq -0x8(%rbp), %rax
movb 0xe(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0xd(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xe(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/SampleAndTesting.cpp
// Function: main
int main()
{
   char plaintext[32];  

   strcpy(plaintext,"1123456789012345678901234567890");

   uint8_t hash[16];   
   DM_Hash::hash((uint8_t*) plaintext,32,hash);

   Util::dumpHex(hash,16); 

   char testInput[100];
   strcpy(testInput,"helloWorld");


   uint8_t* authPlaintext(NULL);
   uint32_t length(0);
   Util::dumpHex((uint8_t*)testInput,strlen(testInput));
   MST_Hash mstHash;
   if(mstHash.createAuthPlaintext( (uint8_t*)testInput,strlen(testInput)+1,&authPlaintext,&length) )
   {
      Util::dumpHex(authPlaintext,length);
   }
   else cout << "failure" << endl;

   uint8_t* plaintextBack;  
   uint32_t lengthPT;
   if( mstHash.checkAndExtractPlaintext(authPlaintext, length,&plaintextBack,&lengthPT) )
   {
      cout << ((char*)plaintext) << endl; 
   }
   else cout << "failure check" << endl;

   unitTestSuite(); 
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl $0x0, -0x4(%rbp)
leaq 0x3177(%rip), %rsi      # 0x8850
leaq -0x30(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x2160
movq -0x110(%rbp), %rdi
movl $0x20, %esi
leaq -0x40(%rbp), %rdx
movq %rdx, -0x108(%rbp)
callq 0x58f0
movq -0x108(%rbp), %rdi
movl $0x10, %esi
callq 0x5a10
leaq 0x3153(%rip), %rsi      # 0x8870
leaq -0xb0(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x2160
movq -0xf8(%rbp), %rdi
movq $0x0, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
callq 0x20a0
movq -0xf8(%rbp), %rdi
movl %eax, %esi
callq 0x5a10
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x5a90
movq -0xf8(%rbp), %rdi
callq 0x20a0
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movl %eax, %edx
incl %edx
leaq -0xb8(%rbp), %rcx
leaq -0xbc(%rbp), %r8
callq 0x5ab0
movb %al, -0xed(%rbp)
jmp 0x57ab
movb -0xed(%rbp), %al
testb $0x1, %al
jne 0x57b7
jmp 0x57f0
movq -0xb8(%rbp), %rdi
movl -0xbc(%rbp), %esi
callq 0x5a10
jmp 0x57cb
jmp 0x5823
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x5ce0
jmp 0x58e0
movq 0x57e1(%rip), %rdi      # 0xafd8
leaq 0x307d(%rip), %rsi      # 0x887b
callq 0x2180
movq %rax, -0x118(%rbp)
jmp 0x580c
movq -0x118(%rbp), %rdi
movq 0x57ae(%rip), %rsi      # 0xafc8
callq 0x21a0
jmp 0x5821
jmp 0x5823
movq -0xb8(%rbp), %rsi
movl -0xbc(%rbp), %edx
leaq -0xd0(%rbp), %rdi
leaq -0xe8(%rbp), %rcx
leaq -0xec(%rbp), %r8
callq 0x5c10
movb %al, -0x119(%rbp)
jmp 0x5852
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x585e
jmp 0x588e
movq 0x5773(%rip), %rdi      # 0xafd8
leaq -0x30(%rbp), %rsi
callq 0x2180
movq %rax, -0x128(%rbp)
jmp 0x5877
movq -0x128(%rbp), %rdi
movq 0x5743(%rip), %rsi      # 0xafc8
callq 0x21a0
jmp 0x588c
jmp 0x58c1
movq 0x5743(%rip), %rdi      # 0xafd8
leaq 0x2fe7(%rip), %rsi      # 0x8883
callq 0x2180
movq %rax, -0x130(%rbp)
jmp 0x58aa
movq -0x130(%rbp), %rdi
movq 0x5710(%rip), %rsi      # 0xafc8
callq 0x21a0
jmp 0x58bf
jmp 0x58c1
callq 0x6fe0
jmp 0x58c8
leaq -0xd0(%rbp), %rdi
callq 0x5ce0
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0xd8(%rbp), %rdi
callq 0x22a0
nopl (%rax)
// File: DiplIngFrankGerlach[P]MST/./DaviesMeyerHash.h
// Function: DM_Hash::hash(unsigned char const*, unsigned int, unsigned char*)
static bool hash(const uint8_t* input, uint32_t length, uint8_t* output)
   {
      if( (length == 0) || ((length & (HashWordSize-1)) != 0) )
      {
         return false;
      }
      unsigned int schedule[60];
      uint8_t state1[HashWordSize];
      uint8_t state2[HashWordSize];
      uint8_t* stateInPtr  = state1;
      uint8_t* stateOutPtr = state2;
      memset(stateInPtr,0,HashWordSize);
      for(uint32_t i=0; i < length;i += 16)
      {
          aes_key_setup(input+i,
                        schedule, 
                        HashWordSizeBits);

          aes_encrypt(stateInPtr, 
                      stateOutPtr,
                      schedule,  
                      HashWordSizeBits) ;
          uint8_t* temp = stateInPtr;
          stateInPtr = stateOutPtr;
          stateOutPtr = temp;
      }
      memcpy(output,stateInPtr,HashWordSize);//stateInPtr is in fact the output here
      return true;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x5917
movl -0x14(%rbp), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x5920
movb $0x0, -0x1(%rbp)
jmp 0x59fc
leaq -0x120(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0x130(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x59df
movq -0x10(%rbp), %rdi
movl -0x144(%rbp), %eax
addq %rax, %rdi
leaq -0x110(%rbp), %rsi
movl $0x80, %edx
callq 0x3450
movq -0x138(%rbp), %rdi
movq -0x140(%rbp), %rsi
leaq -0x110(%rbp), %rdx
movl $0x80, %ecx
callq 0x25d0
movq -0x138(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x140(%rbp)
movl -0x144(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x144(%rbp)
jmp 0x5959
movq -0x20(%rbp), %rax
movq -0x138(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/./Util.h
// Function: Util::dumpHex(unsigned char const*, unsigned int)
static void dumpHex(const uint8_t* buffer,uint32_t length)
  {
     for(uint32_t i=0; i < length; i++)
     {
         uint8_t octet = buffer[i];

         uint8_t nibbleUpper = octet >> 4;
         uint8_t nibbleLower = octet & 0xF;
         printNibble(nibbleUpper);
         printNibble(nibbleLower);
     }
     cout << endl;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x5a6c
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
sarl $0x4, %eax
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
andl $0xf, %eax
movb %al, -0x13(%rbp)
movzbl -0x12(%rbp), %edi
callq 0x5d40
movzbl -0x13(%rbp), %edi
callq 0x5d40
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5a26
movq 0x5565(%rip), %rdi      # 0xafd8
movq 0x554e(%rip), %rsi      # 0xafc8
callq 0x21a0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Hash::checkAndExtractPlaintext(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool checkAndExtractPlaintext(uint8_t*   authPlaintext,   //AuthPlainText PDU
                                 uint32_t   length,          //length of PDU
                                 uint8_t**  plaintext,       //typically a reference to a pointer
                                 uint32_t*  lengthPlaintext )//typically a reference to a uint32_t
   {
      *plaintext = NULL;
      if( length < 32 )
      {
        return false;
      }
      uint8_t computedHash[16];
      if(DM_Hash::hash(authPlaintext,length-16,computedHash) )
      {
         if( memcmp(computedHash,authPlaintext+length-16,16) == 0 )
         {
            Util::octets2Int(authPlaintext,lengthPlaintext);
            if( (*lengthPlaintext) < (length-16) )
            {
               *plaintext = authPlaintext+4;
               return true;
            }            
         }
      } 
      return false;
   }

// 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 %r8, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
cmpl $0x20, -0x1c(%rbp)
jae 0x5c45
movb $0x0, -0x1(%rbp)
jmp 0x5cc8
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
subl $0x10, %esi
leaq -0x40(%rbp), %rdx
callq 0x58f0
testb $0x1, %al
jne 0x5c5e
jmp 0x5cc4
leaq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %edx
addq %rdx, %rcx
addq $-0x10, %rcx
movups (%rcx), %xmm1
movups (%rax), %xmm0
pcmpeqb %xmm1, %xmm0
pmovmskb %xmm0, %eax
subl $0xffff, %eax           # imm = 0xFFFF
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5cc2
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x5de0
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl -0x1c(%rbp), %ecx
subl $0x10, %ecx
cmpl %ecx, %eax
jae 0x5cc0
movq -0x18(%rbp), %rcx
addq $0x4, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x5cc8
jmp 0x5cc2
jmp 0x5cc4
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Hash::~MST_Hash()
~MST_Hash()
   {
      memset(_outputBuffer,0,_outputBufferSize);
      delete[] _outputBuffer;
      _outputBuffer = NULL;
      _outputBufferSize = 0;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq (%rax), %rdi
movl 0x8(%rax), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x20c0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x5d1d
movq -0x10(%rbp), %rdi
callq 0x2220
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: DiplIngFrankGerlach[P]MST/./Util.h
// Function: Util::octets2Int(unsigned char*, unsigned int*)
static void octets2Int(uint8_t* source,uint32_t* destination)
  {
     *destination = 0;
     for(int8_t i=3; i >= 0; i--)
     {
       (*destination) += source[i];
       if( i > 0 )
       {
         (*destination) <<= 8;
       }
     }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movb $0x3, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jl 0x5e38
movq -0x8(%rbp), %rax
movsbq -0x11(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jle 0x5e2c
movq -0x10(%rbp), %rax
movl (%rax), %ecx
shll $0x8, %ecx
movl %ecx, (%rax)
jmp 0x5e2e
movb -0x11(%rbp), %al
addb $-0x1, %al
movb %al, -0x11(%rbp)
jmp 0x5dfa
popq %rbp
retq
nopw (%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/UnitTest.cpp
// Function: testProc(unsigned int)
void testProc(uint32_t testSize)
{
   cout << "testProc size=" << testSize << endl;
   uint8_t* testData = new uint8_t[testSize];

   for(uint32_t i=0; i < testSize; i++)
   {
       testData[i] = uint8_t(i & 0xFF);
   }


   uint8_t* authPlaintext(NULL);
   uint32_t lengthAuth;
    
   MST_Hash mstHash;
   assert(mstHash.createAuthPlaintext( testData,testSize,&authPlaintext,&lengthAuth) );

   uint8_t* plaintextBack;  
   uint32_t lengthPT;

   //test:authPlaintext[6] ^= 1;

   assert( mstHash.checkAndExtractPlaintext(authPlaintext, lengthAuth,&plaintextBack,&lengthPT) );
   assert(testSize == lengthPT);
   assert(memcmp(testData,plaintextBack,testSize) == 0 );

   delete[] testData;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movq 0x5186(%rip), %rdi      # 0xafd8
leaq 0x2a38(%rip), %rsi      # 0x8891
callq 0x2180
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x2240
movq %rax, %rdi
movq 0x5155(%rip), %rsi      # 0xafc8
callq 0x21a0
movl -0x4(%rbp), %eax
movl %eax, %edi
callq 0x2030
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jae 0x5eb4
movl -0x14(%rbp), %eax
andl $0xff, %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5e8d
movq $0x0, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x5a90
movq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x4(%rbp), %edx
leaq -0x20(%rbp), %rcx
leaq -0x24(%rbp), %r8
callq 0x5ab0
movb %al, -0x55(%rbp)
jmp 0x5ee6
movb -0x55(%rbp), %al
testb $0x1, %al
jne 0x5eef
jmp 0x5ef1
jmp 0x5f2a
leaq 0x29a8(%rip), %rdi      # 0x88a0
leaq 0x29ec(%rip), %rsi      # 0x88eb
movl $0x1f, %edx
leaq 0x29ed(%rip), %rcx      # 0x88f8
callq 0x20e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5ce0
jmp 0x5ff8
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rcx
leaq -0x54(%rbp), %r8
callq 0x5c10
movb %al, -0x61(%rbp)
jmp 0x5f47
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x5f50
jmp 0x5f52
jmp 0x5f71
leaq 0x29b7(%rip), %rdi      # 0x8910
leaq 0x298b(%rip), %rsi      # 0x88eb
movl $0x26, %edx
leaq 0x298c(%rip), %rcx      # 0x88f8
callq 0x20e0
movl -0x4(%rbp), %eax
cmpl -0x54(%rbp), %eax
jne 0x5f7b
jmp 0x5f9a
leaq 0x29e3(%rip), %rdi      # 0x8965
leaq 0x2962(%rip), %rsi      # 0x88eb
movl $0x27, %edx
leaq 0x2963(%rip), %rcx      # 0x88f8
callq 0x20e0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x4(%rbp), %eax
movl %eax, %edx
callq 0x20b0
cmpl $0x0, %eax
jne 0x5fb3
jmp 0x5fd2
leaq 0x29c0(%rip), %rdi      # 0x897a
leaq 0x292a(%rip), %rsi      # 0x88eb
movl $0x28, %edx
leaq 0x292b(%rip), %rcx      # 0x88f8
callq 0x20e0
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x5fe9
movq -0x70(%rbp), %rdi
callq 0x2220
leaq -0x38(%rbp), %rdi
callq 0x5ce0
addq $0x70, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/UnitTest.cpp
// Function: encryptedCommunicationFailTest()
void encryptedCommunicationFailTest()
{
   uint8_t sharedKey[16] = {11,55,11,33,67,89,91,11,55,11,33,67,89,91,0,0};

   MST_Endpoint endpointA(sharedKey);
   MST_Endpoint endpointB(sharedKey);

   uint8_t mcA[16];
   endpointA.generateMaskCounterExchange(mcA);

   uint8_t mcB[16];
   endpointB.generateMaskCounterExchange(mcB);

   //exchange of masking counters
   endpointA.decryptMaskCounterExchange(mcB);
   endpointB.decryptMaskCounterExchange(mcA);
 
   
   //now we can securely encrypt with all assurances of the protocol
   const char* plaintext = "Schiller, Goethe, Von der Vogelweide";
   uint8_t* secureMessage;
   uint32_t lengthSM;
   uint32_t lp = strlen(plaintext)+1;
   assert( endpointA.encryptToSecureMessage((uint8_t*)plaintext,lp,&secureMessage,&lengthSM) );
   
   //flip a bit
   secureMessage[0] ^= 1;   

   uint8_t* plaintextDec;
   uint32_t lengthPT;
   assert( endpointB.decryptSecureMessage(secureMessage,lengthSM,&plaintextDec,&lengthPT) == false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movaps 0x26de(%rip), %xmm0     # 0x8f00
movaps %xmm0, -0x10(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x10(%rbp), %rsi
movq %rsi, -0x300(%rbp)
callq 0x7250
movq -0x300(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x7250
jmp 0x6852
leaq -0x158(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x72f0
jmp 0x6867
leaq -0x2a0(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x72f0
jmp 0x687c
leaq -0x158(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x7350
jmp 0x6891
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x7350
jmp 0x68a6
leaq 0x20fa(%rip), %rax      # 0x89a7
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rdi
callq 0x20a0
incl %eax
movl %eax, -0x2e8(%rbp)
movq -0x2d8(%rbp), %rsi
movl -0x2e8(%rbp), %edx
leaq -0x158(%rbp), %rdi
leaq -0x2e0(%rbp), %rcx
leaq -0x2e4(%rbp), %r8
callq 0x73a0
movb %al, -0x301(%rbp)
jmp 0x68f7
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x6903
jmp 0x6905
jmp 0x695e
leaq 0x20c0(%rip), %rdi      # 0x89cc
leaq 0x1fd8(%rip), %rsi      # 0x88eb
movl $0xac, %edx
leaq 0x237e(%rip), %rcx      # 0x8c9d
callq 0x20e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
jmp 0x69ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2a8(%rbp)
movl %eax, -0x2ac(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x7610
jmp 0x69ed
movq -0x2e0(%rbp), %rax
movb (%rax), %cl
xorb $0x1, %cl
movb %cl, (%rax)
movq -0x2e0(%rbp), %rsi
movl -0x2e4(%rbp), %edx
leaq -0x2a0(%rbp), %rdi
leaq -0x2f0(%rbp), %rcx
leaq -0x2f4(%rbp), %r8
callq 0x74c0
movb %al, -0x302(%rbp)
jmp 0x699b
movb -0x302(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x69ad
jmp 0x69cc
leaq 0x230f(%rip), %rdi      # 0x8cc3
leaq 0x1f30(%rip), %rsi      # 0x88eb
movl $0xb3, %edx
leaq 0x22d6(%rip), %rcx      # 0x8c9d
callq 0x20e0
leaq -0x2a0(%rbp), %rdi
callq 0x7610
leaq -0x158(%rbp), %rdi
callq 0x7610
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
leaq -0x158(%rbp), %rdi
callq 0x7610
movq -0x2a8(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::MST_Endpoint(unsigned char const*)
MST_Endpoint(const uint8_t* sharedSecret):_buffer(NULL),_bufferSize(0)
   {
        memcpy(_sharedSecret,sharedSecret,16);
   
        aes_key_setup(_sharedSecret,_aesSchedule,128);
        _maskCounterExchangeGenerated = false;
        _partnerMaskCounterExchangeDecrypted = false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movq $0x0, 0x128(%rdi)
movl $0x0, 0x130(%rdi)
addq $0x138, %rdi            # imm = 0x138
movq %rdi, -0x30(%rbp)
callq 0x5a90
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movups (%rax), %xmm0
movups %xmm0, (%rdi)
movq %rdi, %rsi
addq $0x30, %rsi
movl $0x80, %edx
callq 0x3450
jmp 0x72ae
movq -0x28(%rbp), %rax
movb $0x0, 0x120(%rax)
movb $0x0, 0x121(%rax)
addq $0x30, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x5ce0
movq -0x18(%rbp), %rdi
callq 0x22a0
nopw %cs:(%rax,%rax)
nop
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::encryptToSecureMessage(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool encryptToSecureMessage(uint8_t* plaintext,
                               uint32_t length,
                               uint8_t** securedMessage,
                               uint32_t* lengthSM)
   {
       if( !_maskCounterExchangeGenerated )  
       {
          return false;
       }
        
       if( _mstHash.createAuthPlaintext(plaintext,length,securedMessage,lengthSM) )
       {
	      for(uint32_t i=0; i < (*lengthSM); i+=16)
	      {
		 //apply masking
		 uint8_t encrypted[16];
		 uint8_t* masked = (*securedMessage)+i;
		 for(uint8_t j=0; j < 16; j++)
		 {
		    masked[j] ^= _maskCounterOwn[j];
		 }
		 incrementMC(_maskCounterOwn);
		 aes_encrypt(masked,encrypted,_aesSchedule,128);
		 memcpy((*securedMessage)+i,encrypted,16);
		 
	      }
              return true; 
       }
       return false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
testb $0x1, 0x120(%rax)
jne 0x73d5
movb $0x0, -0x1(%rbp)
jmp 0x74b3
movq -0x68(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x5ab0
testb $0x1, %al
jne 0x73fd
jmp 0x74af
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x74a9
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movb $0x0, -0x59(%rbp)
movzbl -0x59(%rbp), %eax
cmpl $0x10, %eax
jge 0x7459
movq -0x68(%rbp), %rax
movzbl -0x59(%rbp), %ecx
movzbl 0x10(%rax,%rcx), %esi
movq -0x58(%rbp), %rax
movzbl -0x59(%rbp), %ecx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movb -0x59(%rbp), %al
addb $0x1, %al
movb %al, -0x59(%rbp)
jmp 0x7428
movq -0x68(%rbp), %rdi
addq $0x10, %rdi
callq 0x7760
movq -0x68(%rbp), %rdx
movq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
addq $0x30, %rdx
movl $0x80, %ecx
callq 0x25d0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
movq -0x50(%rbp), %rdx
movq %rdx, (%rax,%rcx)
movq -0x48(%rbp), %rdx
movq %rdx, 0x8(%rax,%rcx)
movl -0x34(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x34(%rbp)
jmp 0x7404
movb $0x1, -0x1(%rbp)
jmp 0x74b3
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nop
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::decryptSecureMessage(unsigned char*, unsigned int, unsigned char**, unsigned int*)
bool decryptSecureMessage(uint8_t* securedMessage, //SecuredMessage PDU
                             uint32_t lengthSM,       
                             uint8_t** plaintext,  //plaintext output, typically a reference to a pointer
                             uint32_t* lengthPlaintext) //plaintext length, typically a refrence to a uint32_t
   {
      if( !_partnerMaskCounterExchangeDecrypted )  
      {
         return false;
      }
      if( (lengthSM < 32) || ((lengthSM & 0xF) != 0 ) )
      {
         return false;
      }
      if( !ensureBufferSize(lengthSM) )
      {
         return false;
      }
      for(uint32_t i=0; i < lengthSM; i+=16)
      {
         aes_decrypt(securedMessage+i,_buffer+i,_aesSchedule,128);
         //remove masking
         uint8_t* masked = _buffer+i;
         for(uint8_t j=0; j < 16; j++)
         {
            masked[j] ^= _maskCounterPartner[j];
         }
         incrementMC(_maskCounterPartner);
      } 
      if( _mstHash.checkAndExtractPlaintext(_buffer,lengthSM,plaintext,lengthPlaintext) )
      {
         return true;
      }
      return false;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
testb $0x1, 0x121(%rax)
jne 0x74f5
movb $0x0, -0x1(%rbp)
jmp 0x75fe
cmpl $0x20, -0x1c(%rbp)
jb 0x7506
movl -0x1c(%rbp), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x750f
movb $0x0, -0x1(%rbp)
jmp 0x75fe
movq -0x50(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x7840
testb $0x1, %al
jne 0x7528
movb $0x0, -0x1(%rbp)
jmp 0x75fe
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x75c9
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %eax
addq %rax, %rdi
movq 0x128(%rdx), %rsi
movl -0x34(%rbp), %eax
addq %rax, %rsi
addq $0x30, %rdx
movl $0x80, %ecx
callq 0x2c20
movq -0x50(%rbp), %rax
movq 0x128(%rax), %rax
movl -0x34(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
cmpl $0x10, %eax
jge 0x75ae
movq -0x50(%rbp), %rax
movzbl -0x41(%rbp), %ecx
movzbl 0x20(%rax,%rcx), %esi
movq -0x40(%rbp), %rax
movzbl -0x41(%rbp), %ecx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movb -0x41(%rbp), %al
addb $0x1, %al
movb %al, -0x41(%rbp)
jmp 0x757d
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
callq 0x7760
movl -0x34(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x34(%rbp)
jmp 0x752f
movq -0x50(%rbp), %rax
movq %rax, %rdi
addq $0x138, %rdi            # imm = 0x138
movq 0x128(%rax), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x5c10
testb $0x1, %al
jne 0x75f4
jmp 0x75fa
movb $0x1, -0x1(%rbp)
jmp 0x75fe
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::~MST_Endpoint()
~MST_Endpoint()
   {
      memset(_buffer,0,_bufferSize);
      delete[] _buffer;
      //wipe cipher secrets
      memset(_sharedSecret,0,16);
      memset(_maskCounterOwn,0,16);
      memset(_maskCounterPartner,0,16);
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x128(%rax), %rdi
movl 0x130(%rax), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x20c0
movq -0x18(%rbp), %rax
movq 0x128(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x7658
movq -0x10(%rbp), %rdi
callq 0x2220
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20c0
movq -0x18(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
callq 0x5ce0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::incrementMC(unsigned char*)
static void incrementMC(uint8_t* counter)
   {
       bool carry(false);
       uint8_t i=0;
       do
       {
          carry = counter[i] == 255;
          counter[i++]++;
       }
       while(carry && (i < 16));
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movb $0x0, -0xa(%rbp)
movq -0x8(%rbp), %rax
movzbl -0xa(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpl $0xff, %eax
sete %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movb -0xa(%rbp), %cl
movb %cl, %dl
addb $0x1, %dl
movb %dl, -0xa(%rbp)
movzbl %cl, %ecx
movb (%rax,%rcx), %dl
addb $0x1, %dl
movb %dl, (%rax,%rcx)
xorl %eax, %eax
testb $0x1, -0x9(%rbp)
movb %al, -0xb(%rbp)
je 0x77bc
movzbl -0xa(%rbp), %eax
cmpl $0x10, %eax
setl %al
movb %al, -0xb(%rbp)
movb -0xb(%rbp), %al
testb $0x1, %al
jne 0x7770
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: DiplIngFrankGerlach[P]MST/./RandomSource.h
// Function: RandomSource::getRandomNumber128(unsigned char*)
bool getRandomNumber128(uint8_t* destination)
    {
        int randomFH = open("/dev/urandom", O_RDONLY);
	if (randomFH >= 0)
	{
	    ssize_t result = read(randomFH, destination, 16);
            close(randomFH);
	    if (result == 16)
	    {
		return true;
	    }
	}
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x16d9(%rip), %rdi      # 0x8ec0
xorl %esi, %esi
movb $0x0, %al
callq 0x2110
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x7825
movl -0x1c(%rbp), %edi
movq -0x18(%rbp), %rsi
movl $0x10, %edx
callq 0x2250
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %edi
callq 0x22d0
cmpq $0x10, -0x28(%rbp)
jne 0x7823
movb $0x1, -0x1(%rbp)
jmp 0x7829
jmp 0x7825
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: DiplIngFrankGerlach[P]MST/./Protocol.h
// Function: MST_Endpoint::ensureBufferSize(unsigned int)
bool ensureBufferSize(uint32_t sz)
   {
      if(_bufferSize < sz )
      {
         memset(_buffer,0,_bufferSize);
         _bufferSize = sz;
         delete[] _buffer;
         _buffer = new uint8_t[_bufferSize];
         if( _buffer == NULL )
         {
            return false;
         }
      }
      return true;
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl 0x130(%rax), %eax
cmpl -0x14(%rbp), %eax
jae 0x78d4
movq -0x20(%rbp), %rax
movq 0x128(%rax), %rdi
movl 0x130(%rax), %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x20c0
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x130(%rax)
movq 0x128(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x78a3
movq -0x28(%rbp), %rdi
callq 0x2220
movq -0x20(%rbp), %rax
movl 0x130(%rax), %eax
movl %eax, %edi
callq 0x2030
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x128(%rax)
cmpq $0x0, 0x128(%rax)
jne 0x78d2
movb $0x0, -0x1(%rbp)
jmp 0x78d8
jmp 0x78d4
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: xjrueda[P]fixprime/src/Acceptor.cpp
// Function: fprime::Acceptor::start()
bool Acceptor::start() {
        try {
            thread t1(std::bind(&Acceptor::startAcceptor, this, sessionSetup.getPort()));
            t1.detach();
            usleep(10000);
            return sessionRunning;
        } catch (exception& e) {
            //TODO: log error
            return false;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x80(%rbp)
movq 0x8d64a(%rip), %rax     # 0x132c78
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq %rdi, -0x50(%rbp)
addq $0x28, %rdi
callq 0xa2210
movl %eax, -0x74(%rbp)
jmp 0xa564c
movl -0x74(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x54(%rbp), %rcx
callq 0xa1500
jmp 0xa5669
leaq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9a1e0
jmp 0xa5678
leaq -0x18(%rbp), %rdi
callq 0xa3410
jmp 0xa5683
movl $0x2710, %edi           # imm = 0x2710
callq 0xa0c10
jmp 0xa568f
movq -0x80(%rbp), %rax
movb 0x1d8(%rax), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xa1aa0
jmp 0xa56ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xa56cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x18(%rbp), %rdi
callq 0xa1aa0
movl -0x64(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0xa56fc
movq -0x60(%rbp), %rdi
callq 0x99540
movq %rax, -0x70(%rbp)
movb $0x0, -0x1(%rbp)
callq 0xa2520
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0xa3520
nopw %cs:(%rax,%rax)
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::stop()
virtual void stop() {
            setConnected(false);
            setIbRunning(false);
            setObRunning(false);
            setSessionRunning(false);
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
xorl %esi, %esi
callq 0x9acd0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9e7c0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x980c0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0xa4c50
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::disconnect()
virtual void disconnect() {
            setConnected(false);
            setIbRunning(false);
            setObRunning(false);
            inboundCondition.notify_one();
            outboundCondition.notify_one();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
xorl %esi, %esi
callq 0x9acd0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9e7c0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x980c0
movq -0x10(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x99f30
movq -0x10(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x99f30
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::send(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
virtual bool send(string msg) {
            if (!connected)
                //TODO: register log entry
                return false;
            else {
                pushOutbound(msg);
                return true;
            };
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
testb $0x1, 0x1db(%rax)
jne 0xa61cb
movb $0x0, -0x1(%rbp)
jmp 0xa6211
movq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x998d0
movq -0x50(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xa3ff0
jmp 0xa61eb
leaq -0x38(%rbp), %rdi
callq 0xa4f00
movb $0x1, -0x1(%rbp)
jmp 0xa6211
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xa4f00
jmp 0xa621c
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xa3520
nopw %cs:(%rax,%rax)
nop
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::setSessionRunning(bool)
void setSessionRunning(bool val) {
            mutex lock;
            lock.lock();
            sessionRunning = val;
            lock.unlock();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9b140
leaq -0x38(%rbp), %rdi
callq 0xa4460
movq -0x40(%rbp), %rax
movb -0x9(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x1d8(%rax)
leaq -0x38(%rbp), %rdi
callq 0xa0a20
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::pushInbound(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void pushInbound(string rawMsg) {
            unique_lock<mutex> lock(inboundLock);
            inboundQueue.push(rawMsg);
            lock.unlock();
            inboundCondition.notify_one();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x40(%rbp)
addq $0x1e0, %rsi            # imm = 0x1E0
leaq -0x20(%rbp), %rdi
callq 0xa3cc0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x300, %rdi            # imm = 0x300
callq 0x9b7e0
jmp 0xa8da2
leaq -0x20(%rbp), %rdi
callq 0x970e0
jmp 0xa8dad
movq -0x40(%rbp), %rdi
addq $0x208, %rdi            # imm = 0x208
callq 0x99f30
leaq -0x20(%rbp), %rdi
callq 0x98ee0
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x98ee0
movq -0x28(%rbp), %rdi
callq 0xa3520
nopw (%rax,%rax)
// File: xjrueda[P]fixprime/include/Session.h
// Function: fprime::Session::pushOutbound(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void pushOutbound(string rawMsg) {
            unique_lock<mutex> lock(outboundLock);
            outboundQueue.push(rawMsg);
            lock.unlock();
            outboundCondition.notify_one();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x40(%rbp)
addq $0x2b8, %rsi            # imm = 0x2B8
leaq -0x20(%rbp), %rdi
callq 0xa3cc0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x268, %rdi            # imm = 0x268
callq 0x9b7e0
jmp 0xaf0b2
leaq -0x20(%rbp), %rdi
callq 0x970e0
jmp 0xaf0bd
movq -0x40(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x99f30
leaq -0x20(%rbp), %rdi
callq 0x98ee0
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x98ee0
movq -0x28(%rbp), %rdi
callq 0xa3520
nopw (%rax,%rax)
// File: xjrueda[P]fixprime/src/CallbacksManager.cpp
// Function: fprime::CallbacksManager::executeCallback(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, fprime::Message, fprime::Session*)
void CallbacksManager::executeCallback(string methodName,  fprime::Message msg, fprime::Session* sessionPtr) {
        typename std::map<string, Callback>::iterator it;
        future<void> f1;
        it = callbacksMap.find(methodName);
        if (it != callbacksMap.end()) {
            try {
                CallBackType task = it->second.getCallback();
                if (it->second.getlaunchAsync()) {
                    f1 = std::async(std::launch::async, task, msg, sessionPtr);
                } else
                    task(msg, sessionPtr);
            } catch (...) {
                
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rsi, -0xf0(%rbp)
movq %rdx, -0x100(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x9fa00
leaq -0x38(%rbp), %rdi
callq 0xa0590
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
addq $0x8, %rdi
callq 0x9ae30
movq %rax, -0xe8(%rbp)
jmp 0xafba6
movq -0xf8(%rbp), %rdi
movq -0xe8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x8, %rdi
callq 0x9f340
movq %rax, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ac50
testb $0x1, %al
jne 0xafbe3
jmp 0xafd1b
leaq -0x28(%rbp), %rdi
callq 0x98500
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x78(%rbp), %rdi
callq 0x9bb90
jmp 0xafbfe
leaq -0x28(%rbp), %rdi
callq 0x98500
movq %rax, %rdi
addq $0x20, %rdi
callq 0xa32c0
movb %al, -0x101(%rbp)
jmp 0xafc1b
movb -0x101(%rbp), %al
testb $0x1, %al
jne 0xafc27
jmp 0xafca0
movq -0x100(%rbp), %rcx
leaq -0x88(%rbp), %rdi
movl $0x1, %esi
leaq -0x78(%rbp), %rdx
leaq -0x20(%rbp), %r8
callq 0x9f110
jmp 0xafc49
leaq -0x38(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa4470
leaq -0x88(%rbp), %rdi
callq 0xa4690
jmp 0xafcf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xa4690
jmp 0xafd2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xafd07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xafcfe
movq -0x100(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x9a4f0
jmp 0xafcb5
movq -0x20(%rbp), %rdx
leaq -0x78(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x97630
jmp 0xafccb
leaq -0xe0(%rbp), %rdi
callq 0x9b5d0
jmp 0xafcf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x9b5d0
jmp 0xafcfe
leaq -0x78(%rbp), %rdi
callq 0x9d810
jmp 0xafd19
leaq -0x78(%rbp), %rdi
callq 0x9d810
movq -0x48(%rbp), %rdi
callq 0x99540
callq 0xa2520
jmp 0xafd17
jmp 0xafd19
jmp 0xafd1b
leaq -0x38(%rbp), %rdi
callq 0xa4690
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xa3520
nopw %cs:(%rax,%rax)
// File: xjrueda[P]fixprime/src/Component.cpp
// Function: fprime::Component::getControlField()
fprime::Field::FieldPtr Component::getControlField() {
        if (controlField != nullptr)
            return controlField;
        else
            throw runtime_error("at Component.getControlField: Control field for component " +  name + " is null.");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa04a0
testb $0x1, %al
jne 0xb70f9
jmp 0xb7117
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x38, %rsi
callq 0xa06b0
movq -0x70(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movb $0x1, -0x5d(%rbp)
movl $0x10, %edi
callq 0x99e80
movq -0x68(%rbp), %rdx
movq %rax, -0x80(%rbp)
addq $0x48, %rdx
leaq 0x4b86f(%rip), %rsi     # 0x1029a7
leaq -0x50(%rbp), %rdi
callq 0x9cf50
jmp 0xb7143
leaq 0x4b898(%rip), %rdx     # 0x1029e2
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x98100
jmp 0xb7159
movq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa2430
jmp 0xb7168
movq -0x80(%rbp), %rdi
movb $0x0, -0x5d(%rbp)
movq 0x7be61(%rip), %rsi     # 0x132fd8
movq 0x7bc22(%rip), %rdx     # 0x132da0
callq 0xa2fe0
jmp 0xb71db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xb71bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xb71b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa4f00
leaq -0x50(%rbp), %rdi
callq 0xa4f00
testb $0x1, -0x5d(%rbp)
jne 0xb71c7
jmp 0xb71d0
movq -0x80(%rbp), %rdi
callq 0x9b9c0
jmp 0xb71d2
movq -0x58(%rbp), %rdi
callq 0xa3520
nopl (%rax,%rax)
// File: xjrueda[P]fixprime/src/Field.cpp
// Function: fprime::Field::Field(unsigned int)
Field::Field(unsigned int id) {
        if (id)
            _id = id;
        else
            throw std::runtime_error("at Field.Constructor attribute could not be empty.");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq 0x7503a(%rip), %rax     # 0x132ba8
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x10, %rdi
movq %rdi, -0x48(%rbp)
callq 0xa0780
movq -0x30(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x40(%rbp)
callq 0xa0780
movq -0x30(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x38(%rbp)
callq 0x9d320
movq -0x30(%rbp), %rdi
addq $0x80, %rdi
movq %rdi, -0x28(%rbp)
callq 0xa4de0
cmpl $0x0, -0xc(%rbp)
je 0xbdbca
movq -0x30(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0xbdc2a
movl $0x10, %edi
callq 0x99e80
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
leaq 0x4517f(%rip), %rsi     # 0x102d64
callq 0x99380
jmp 0xbdbec
movq -0x50(%rbp), %rdi
movq 0x753e1(%rip), %rsi     # 0x132fd8
movq 0x751a2(%rip), %rdx     # 0x132da0
callq 0xa2fe0
jmp 0xbdc5d
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9b9c0
jmp 0xbdc30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0xbdc30
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x9ad70
movq -0x38(%rbp), %rdi
callq 0x9fb90
movq -0x40(%rbp), %rdi
callq 0xa4f00
movq -0x48(%rbp), %rdi
callq 0xa4f00
movq -0x18(%rbp), %rdi
callq 0xa3520
nopl (%rax)
// File: xjrueda[P]fixprime/src/Field.cpp
// Function: fprime::Field::setId(unsigned int)
void Field::setId(unsigned int id) {
        if (id)
            _id = id;
        else
            throw std::runtime_error("at Field.setId: Id attribute could not be empty.");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xbdd19
movq -0x28(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
jmp 0xbdd69
movl $0x10, %edi
callq 0x99e80
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
leaq 0x45063(%rip), %rsi     # 0x102d97
callq 0x99380
jmp 0xbdd3b
movq -0x30(%rbp), %rdi
movq 0x75292(%rip), %rsi     # 0x132fd8
movq 0x75053(%rip), %rdx     # 0x132da0
callq 0xa2fe0
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9b9c0
jmp 0xbdd6f
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0xa3520
nopl (%rax,%rax)
// File: xjrueda[P]fixprime/src/Field.cpp
// Function: fprime::Field::setName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Field::setName(string name) {
        if (!name.empty())
            _name = name;
        else
            throw std::runtime_error("at Field.setName: Name attribute could not be empty.");
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, %rax
movq -0x38(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq %rax, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0xa2940
testb $0x1, %al
jne 0xbddc3
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
callq 0x972c0
jmp 0xbde13
movl $0x10, %edi
callq 0x99e80
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
leaq 0x44fea(%rip), %rsi     # 0x102dc8
callq 0x99380
jmp 0xbdde5
movq -0x40(%rbp), %rdi
movq 0x751e8(%rip), %rsi     # 0x132fd8
movq 0x74fa9(%rip), %rdx     # 0x132da0
callq 0xa2fe0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x9b9c0
jmp 0xbde19
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0xa3520
nopw %cs:(%rax,%rax)