LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/main.cpp
// Function: decode_BYTE(char*, char*)
void decode_BYTE(char* szInputName, char* szOutputName)
{
  file_map<bit> map_comp_input(szInputName);
  file_writer<BYTE> file_out;
  file_out.create(szOutputName);
  
  arithmetic_decoder dec(&map_comp_input);
  adaptive_model<BYTE> mdl(&dec);

  DWORD* dwBuffer = (DWORD*)map_comp_input.get_header();
  
  DWORD dwExpSize = dwBuffer[1];

  if (dwBuffer[0] == g_dwMagic)
  {
    for(DWORD i = 0; i < (dwExpSize / sizeof(BYTE)); ++i)
    {
      BYTE b = mdl.decode_symbol();
      file_out.send(b);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x2940
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movl $0x1000, %edi           # imm = 0x1000
callq 0x2150
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x2529
movabsq $0x100000000000, %rax   # imm = 0x100000000000
movq %rax, 0x18(%rsp)
movq %r14, %rdi
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x20c0
movl %eax, 0x8(%rsp)
movaps 0x1acf(%rip), %xmm0     # 0x4010
movups %xmm0, 0x58(%rsp)
movq %rbx, 0x50(%rsp)
movl 0x40(%rsp), %edi
movb 0x44(%rsp), %r8b
movl 0x3c(%rsp), %esi
xorl %eax, %eax
movl $0x20, %ecx
movq 0x28(%rsp), %rdx
addl %eax, %eax
movl %eax, 0x64(%rsp)
testl %edi, %edi
jne 0x258c
movl %esi, %edi
incl %esi
movl %esi, 0x3c(%rsp)
movb (%rdx,%rdi), %r8b
movb %r8b, 0x44(%rsp)
movl $0x8, 0x40(%rsp)
movl $0x8, %edi
leal (%r8,%r8), %r9d
movb %r9b, 0x44(%rsp)
decl %edi
movl %edi, 0x40(%rsp)
shrb $0x7, %r8b
movzbl %r8b, %r8d
orl %r8d, %eax
movl %eax, 0x64(%rsp)
movl %r9d, %r8d
decq %rcx
jne 0x2564
leaq 0x68(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x29b2
movq 0x30(%rsp), %rax
movl 0x4(%rax), %ebp
cmpl $0x68746542, (%rax)     # imm = 0x68746542
sete %al
testl %ebp, %ebp
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2623
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0x2a18
movq 0x10(%rsp), %rcx
movl 0x18(%rsp), %edx
movb %al, (%rcx,%rdx)
movl 0x18(%rsp), %eax
movl 0x1c(%rsp), %edx
incl %eax
movl %eax, 0x18(%rsp)
cmpl %edx, %eax
jne 0x261f
movl 0x8(%rsp), %edi
movq 0x10(%rsp), %rsi
callq 0x2040
movl $0x0, 0x18(%rsp)
decl %ebp
jne 0x25e3
leaq 0x373e(%rip), %rax      # 0x5d68
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x263e
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x2aa8
leaq 0x20(%rsp), %rdi
callq 0x2ad4
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x2660
movq %rax, %rbx
jmp 0x2683
movq %rax, %rbx
leaq 0x36f9(%rip), %rax      # 0x5d68
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x2683
callq 0x2110
leaq 0x8(%rsp), %rdi
callq 0x2aa8
leaq 0x20(%rsp), %rdi
callq 0x2ad4
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/main.cpp
// Function: main
int main(int argc, char** argv)
{
	if (argc < 4) {
		cout << "Usage: "<<argv[0]<<" <input path> <compression path> <decompression path>\n";
		return -1;
	}

	enc_szInputName = argv[1];
	enc_szOutputName = argv[2];
	dec_szInputName = argv[2];
	dec_szOutputName = argv[3];

	encode_BYTE(enc_szInputName, enc_szOutputName);
	decode_BYTE(dec_szInputName, dec_szOutputName);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x3, %edi
jg 0x26ea
movq 0x3926(%rip), %r14      # 0x5fd8
leaq 0x1967(%rip), %rsi      # 0x4020
movl $0x7, %edx
movq %r14, %rdi
callq 0x2130
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x272e
movq %rbx, %rdi
callq 0x2070
movq 0x38fb(%rip), %rdi      # 0x5fd8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2130
jmp 0x2746
movq 0x8(%rbx), %rdi
movq %rdi, 0x3a2b(%rip)      # 0x6120
movq 0x10(%rbx), %rsi
movq %rsi, 0x3a28(%rip)      # 0x6128
movq %rsi, 0x3a29(%rip)      # 0x6130
movq 0x18(%rbx), %rax
movq %rax, 0x3a26(%rip)      # 0x6138
callq 0x232c
movq 0x3a12(%rip), %rdi      # 0x6130
movq 0x3a13(%rip), %rsi      # 0x6138
callq 0x24d9
xorl %eax, %eax
jmp 0x2763
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2190
movq 0x388b(%rip), %rdi      # 0x5fd8
leaq 0x18d4(%rip), %rsi      # 0x4028
movl $0x36, %edx
callq 0x2130
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/adaptive_model.h
// Function: adaptive_model<unsigned char>::encode_symbol(unsigned char)
void adaptive_model<symbolT>::encode_symbol(symbolT symbol)
{
  if (m_encoder)
  {
    m_encoder->encode(cum_count(idx<symbolT>::from_symbol(symbol) - 1),
                      cum_count(idx<symbolT>::from_symbol(symbol)), //symbol_to_index(symbol)),
                      total_count());
    update(symbol);    
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x287e
movq 0x10(%rbx), %rax
movzbl %sil, %r14d
movl (%rax,%r14,4), %esi
movl 0x4(%rax,%r14,4), %edx
movl 0x8(%rbx), %ecx
decl %ecx
movl (%rax,%rcx,4), %ecx
callq 0x2d26
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2ed6
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/u_file_writer.h
// Function: file_writer<bool>::~file_writer()
~file_writer()
      {        
        DWORD nBytesWritten;
        
        nBytesWritten = write(m_fdFile, m_Buffer, m_dwCurrentByte);       
        ASSERT(nBytesWritten == m_dwCurrentByte);

        while(m_dwBitsInByte)
        {
          m_bitBuffer <<= 1;
          --m_dwBitsInByte;
        }

        nBytesWritten = write(m_fdFile, &m_bitBuffer, sizeof(BYTE));
        ASSERT(nBytesWritten == sizeof(BYTE));
    
        close(m_fdFile);
        free(m_Buffer);
      }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movq 0x8(%rbx), %rsi
movl 0x14(%rbx), %edx
callq 0x2040
movl 0x1c(%rbx), %eax
testl %eax, %eax
je 0x28d4
movb 0x10(%rbx), %cl
addb %cl, %cl
decl %eax
jne 0x28c4
movb %cl, 0x10(%rbx)
movl $0x0, 0x1c(%rbx)
movl (%rbx), %edi
leaq 0x10(%rbx), %rsi
movl $0x1, %edx
callq 0x2040
movl (%rbx), %edi
callq 0x21e0
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x2140
movq %rax, %rdi
callq 0x2af5
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/u_file_map.h
// Function: file_map<unsigned char>::~file_map()
~file_map()
    {     
      if (m_bHand)
      {
        lseek(m_fdFile, 0, SEEK_SET);
        write(m_fdFile, m_FileMap, m_dwFileSize);
        //free(m_FileMap);
      }
      else
      {      
        munmap(m_FileMap, m_dwFileSize);
      }
      close(m_fdFile);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x1, 0x25(%rdi)
jne 0x2923
movl (%rbx), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21d0
movl (%rbx), %edi
movq 0x10(%rbx), %rsi
movl 0x18(%rbx), %edx
callq 0x2040
jmp 0x292f
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %esi
callq 0x20b0
movl (%rbx), %edi
callq 0x21e0
popq %rbx
retq
movq %rax, %rdi
callq 0x2af5
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/adaptive_model.h
// Function: adaptive_model<unsigned char>::decode_symbol()
symbolT adaptive_model<symbolT>::decode_symbol()
{
  symbolT symbol;
  if (m_decoder)
  {  
    DWORD target = m_decoder->decode_target(total_count());    
    DWORD index = search_index(target);

    m_decoder->decode(cum_count(index - 1),
                      cum_count(index),
                      total_count());

    symbol = idx<symbolT>::to_symbol(index);
    update(symbol);
  }

  return symbol;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movl 0x8(%rbx), %esi
leal -0x1(%rsi), %eax
movq 0x10(%rbx), %r8
movl (%r8,%rax,4), %ecx
movl 0x14(%rdi), %eax
movl 0xc(%rdi), %edx
movl 0x10(%rdi), %r9d
subl %edx, %eax
incq %rax
imulq %rcx, %rax
decq %rax
subq %rdx, %r9
incq %r9
xorl %edx, %edx
divq %r9
movl $0x1, %r14d
cmpq $0x2, %rsi
jb 0x2a7c
movl $0x1, %r14d
cmpl %eax, -0x4(%r8,%r14,4)
ja 0x2a71
cmpl %eax, (%r8,%r14,4)
ja 0x2a7c
incq %r14
cmpq %r14, %rsi
jne 0x2a64
movl %esi, %r14d
leal -0x1(%r14), %eax
movl (%r8,%rax,4), %esi
movl %r14d, %eax
movl (%r8,%rax,4), %edx
callq 0x3040
decb %r14b
movzbl %r14b, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2ed6
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/u_file_writer.h
// Function: file_writer<unsigned char>::~file_writer()
~file_writer()
      {
        DWORD nBytesWritten = write(m_fdFile, m_tBuffer, m_dwCurrentElem * sizeof(T));
        
        ASSERT(nBytesWritten == (m_dwCurrentElem * sizeof(T)));    
        close(m_fdFile);
        free(m_tBuffer);
      }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %edi
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
callq 0x2040
movl (%rbx), %edi
callq 0x21e0
movq 0x8(%rbx), %rdi
popq %rbx
jmp 0x2140
movq %rax, %rdi
callq 0x2af5
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/u_file_map.h
// Function: file_map<bool>::create(char*, unsigned int)
bool create(char* szFileName, DWORD dwFileSize = 0)
    {
      m_fdFile = open(szFileName, O_RDWR);
      
      ASSERT(m_fdFile != -1);
      if (m_fdFile != -1)
      {
        if (dwFileSize == 0)
        {
          struct stat stFile;
        
          fstat(m_fdFile, &stFile);     
          m_dwFileSize = stFile.st_size;
        }
        else
        {
          m_dwFileSize = dwFileSize;
        }
        
              m_FileMap = (BYTE*)mmap(0, m_dwFileSize, PROT_READ | PROT_WRITE, 
                                      MAP_PRIVATE, m_fdFile, 0);
        m_DataMap = m_FileMap + m_dwSizeOfHeader;
          
        ASSERT(m_FileMap != MAP_FAILED);
        if (m_FileMap != MAP_FAILED)
        {
          m_iCurrentByte = 0;
          m_nBitsInCurrentByte = 0;
          m_CurrentByte = 0;
          return true;
        }               
      }
      return false;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movl %edx, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsi, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x20e0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0x2b86
testl %ebp, %ebp
je 0x2b32
movl %ebp, 0x18(%rbx)
jmp 0x2b46
movq %rsp, %r14
movl %eax, %edi
movq %r14, %rsi
callq 0x2180
movl 0x30(%r14), %eax
movl %eax, 0x18(%rbx)
movl (%rbx), %r8d
movl 0x18(%rbx), %esi
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x3, %edx
movl $0x2, %ecx
xorl %r9d, %r9d
callq 0x21c0
movq %rax, 0x10(%rbx)
movl 0x28(%rbx), %ecx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
cmpq $-0x1, %rax
je 0x2b86
movb $0x0, 0x24(%rbx)
movq $0x0, 0x1c(%rbx)
movb $0x1, %r14b
movl %r14d, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/u_file_map.h
// Function: file_map<unsigned char>::create(char*, unsigned int)
bool create(char* szFileName, DWORD dwFileSize = 0)
    {
      m_fdFile = open(szFileName, O_RDWR);
      
      ASSERT(m_fdFile != -1);
      if (m_fdFile != -1)
      {
        struct stat stFile;     
        fstat(m_fdFile, &stFile);       
        
        if (dwFileSize == 0)
        {
          m_dwFileSize = stFile.st_size;          
          m_FileMap = (BYTE*)mmap(0, m_dwFileSize, PROT_READ | PROT_WRITE, 
                                  MAP_SHARED, m_fdFile, 0);                               
          m_bHand = false;
        }
        else
        {
          m_dwFileSize = dwFileSize;
          
          m_FileMap = (BYTE*)malloc(m_dwFileSize);
          
          ASSERT(m_FileMap != NULL);  
          if (m_FileMap == NULL)
            m_FileMap = (BYTE*)MAP_FAILED;
          
          /*m_FileMap = (BYTE*)mmap(0, m_dwFileSize, PROT_READ | PROT_WRITE, 
                                  MAP_ANON, -1, 0);*/
                                  
          read(m_fdFile, m_FileMap, stFile.st_size);
          m_bHand = true;
        }
        
        m_DataMap = (T*)(m_FileMap + m_dwSizeOfHeader);
          
        ASSERT(m_FileMap != MAP_FAILED);
        if (m_FileMap == MAP_FAILED)
        {
          //throw new bad_alloc();
        }
        else
        {
          m_iCurrentElem = 0;          
          return true;
        }        
      }
      return false;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movl %edx, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsi, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x20e0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0x2c4b
movq %rsp, %rsi
movl %eax, %edi
callq 0x2180
testl %ebp, %ebp
je 0x2bfc
movl %ebp, 0x18(%rbx)
movl %ebp, %edi
callq 0x2150
xorl %esi, %esi
cmpq $0x1, %rax
sbbq %rsi, %rsi
orq %rax, %rsi
movq %rsi, 0x10(%rbx)
movl (%rbx), %edi
movq 0x30(%rsp), %rdx
callq 0x2160
movb $0x1, %r14b
jmp 0x2c24
movq 0x30(%rsp), %rax
movl %eax, %esi
movl %eax, 0x18(%rbx)
movl (%rbx), %r8d
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x21c0
movq %rax, 0x10(%rbx)
movb %r14b, 0x25(%rbx)
movq 0x10(%rbx), %rax
movl 0x20(%rbx), %ecx
addq %rax, %rcx
movq %rcx, 0x8(%rbx)
cmpq $-0x1, %rax
je 0x2c48
movl $0x0, 0x1c(%rbx)
movb $0x1, %r14b
jmp 0x2c4b
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/adaptive_model.h
// Function: adaptive_model<unsigned char>::update(unsigned char)
void adaptive_model<symbolT>::update(symbolT new_symbol)
{
  for (DWORD j = idx<symbolT>::from_symbol(new_symbol); j < dwSize; ++j)
  {
    ++(m_cum_count[j]);
    
  } 

  if (m_cum_count[dwSize - 1] >= ((DWORD)UPPER_LIMIT >> 2) )
  {
    for (DWORD i = 1; i < dwSize; ++i)
    {
      m_cum_count[i] >>= 1;
      while (m_cum_count[i] <= m_cum_count[i - 1])
        ++m_cum_count[i];
    }
  }
}

// Assembly:
leal 0x1(%rsi), %eax
movl 0x8(%rdi), %ecx
cmpl %ecx, %eax
jae 0x2ef9
movq 0x10(%rdi), %rax
movzbl %sil, %edx
incq %rdx
incl (%rax,%rdx,4)
incq %rdx
movl 0x8(%rdi), %ecx
cmpq %rcx, %rdx
jb 0x2eeb
decl %ecx
movq 0x10(%rdi), %rax
cmpl $0x3fffffff, (%rax,%rcx,4) # imm = 0x3FFFFFFF
jb 0x2f2f
cmpl $0x2, 0x8(%rdi)
jb 0x2f2f
movl (%rax), %ecx
movl $0x1, %edx
incl %ecx
movl (%rax,%rdx,4), %esi
shrl %esi
cmpl %ecx, %esi
cmoval %esi, %ecx
movl %ecx, (%rax,%rdx,4)
incq %rdx
movl 0x8(%rdi), %esi
cmpq %rsi, %rdx
jb 0x2f15
retq
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/arithmetic_encoder.h
// Function: arithmetic_encoder::encode_eof()
inline void encode_eof()
  {
    for (size_t i = 0; i < sizeof(DWORD) * 8; ++i)
    {
      bit bit_to_send = ((MSB(l) == 0) ? 0 : 1);
      m_output->send(bit_to_send);
        
      l <<= 1;
      while (scale3 > 0)
      {
        m_output->send(!bit_to_send);
        --scale3;
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movl 0xc(%rbx), %ebp
movq (%rbx), %r15
cmpl $0x0, 0x1c(%r15)
jne 0x2f92
movb 0x10(%r15), %al
movq 0x8(%r15), %rcx
movl 0x14(%r15), %edx
movb %al, (%rcx,%rdx)
movl 0x14(%r15), %eax
movl 0x18(%r15), %edx
incl %eax
movl %eax, 0x14(%r15)
cmpl %edx, %eax
jne 0x2f85
movl (%r15), %edi
movq 0x8(%r15), %rsi
callq 0x2040
movl $0x0, 0x14(%r15)
cmpl %eax, 0x18(%r15)
jne 0x2fa7
movl $0x8, 0x1c(%r15)
movb $0x0, 0x10(%r15)
decl 0x1c(%r15)
movb 0x10(%r15), %al
addb %al, %al
movl %ebp, %ecx
shrl $0x1f, %ecx
orb %al, %cl
movb %cl, 0x10(%r15)
shll 0xc(%rbx)
cmpl $0x0, 0x14(%rbx)
jle 0x3027
testl %ebp, %ebp
setns %bpl
movq (%rbx), %r15
cmpl $0x0, 0x1c(%r15)
jne 0x3008
movb 0x10(%r15), %al
movq 0x8(%r15), %rcx
movl 0x14(%r15), %edx
movb %al, (%rcx,%rdx)
movl 0x14(%r15), %eax
movl 0x18(%r15), %edx
incl %eax
movl %eax, 0x14(%r15)
cmpl %edx, %eax
jne 0x2ffb
movl (%r15), %edi
movq 0x8(%r15), %rsi
callq 0x2040
movl $0x0, 0x14(%r15)
cmpl %eax, 0x18(%r15)
jne 0x3019
movl $0x8, 0x1c(%r15)
movb $0x0, 0x10(%r15)
decl 0x1c(%r15)
movb 0x10(%r15), %al
addb %al, %al
orb %bpl, %al
movb %al, 0x10(%r15)
movl 0x14(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x14(%rbx)
cmpl $0x1, %eax
jg 0x2fb6
incq %r14
cmpq $0x20, %r14
jne 0x2f3d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ijleesw[P]data-compression/src/arithmetic/arithmetic_decoder.h
// Function: arithmetic_decoder::decode(unsigned int, unsigned int, unsigned int)
inline void decode(DWORD lower_bound, DWORD upper_bound, DWORD total)
  {
    bool eql_cond, e3_cond;
    QWORD range = (QWORD)u - l + 1;

    ASSERT(l < u);   
    ASSERT((lower_bound <= upper_bound) && (upper_bound <= total));
    
    u = l + (DWORD)(((range * upper_bound) / total) - 1);
    l = l + (DWORD)((range * lower_bound) / total);

    while( (eql_cond = (MSB(u) == MSB(l))) ||
           (e3_cond  = ((M2SB(l) == 1) && (M2SB(u) == 0))) )
    {  
      if(eql_cond)
      {
        l <<= 1;
        u <<= 1;
        tag <<= 1;
        
        u += 1;
        
        bit b = m_input->read_next();        
        ASSERT (((tag + b)  == tag + 1) || ((tag + b) == tag));        
        tag += b;
      }
      else if (e3_cond)
      {
        l <<= 1;
        u <<= 1;
        tag <<= 1;
        u += 1;
        
        bit b = m_input->read_next();
        ASSERT (((tag + b) == tag + 1) || ((tag + b) == tag));
        tag += b;
        
        l += MSB_MASK; 
        u += MSB_MASK;
        tag += MSB_MASK;
      }
    }
    ASSERT(l < u);
  }

// Assembly:
pushq %rbx
movl 0x10(%rdi), %r9d
movl 0xc(%rdi), %r8d
subq %r8, %r9
incq %r9
movl %edx, %eax
imulq %r9, %rax
movl %ecx, %r10d
xorl %edx, %edx
divq %r10
leal (%r8,%rax), %ecx
decl %ecx
movl %ecx, 0x10(%rdi)
movl %esi, %eax
imulq %r9, %rax
xorl %edx, %edx
divq %r10
addl %r8d, %eax
movl %eax, 0xc(%rdi)
movq (%rdi), %rdx
movl 0x14(%rdi), %esi
movl $0x80000000, %r8d       # imm = 0x80000000
movl %eax, %r10d
xorl %ecx, %r10d
btl $0x1e, %ecx
setae %r11b
testl %r10d, %r10d
jns 0x30b1
btl $0x1e, %eax
jae 0x3180
movl %ecx, %ebx
movl %r11d, %r9d
andl $0x40000000, %ebx       # imm = 0x40000000
jne 0x3180
testl %r10d, %r10d
jns 0x3129
testb $0x1, %r9b
je 0x3091
addl %eax, %eax
movl %eax, 0xc(%rdi)
addl %esi, %esi
movl %esi, 0x14(%rdi)
leal 0x1(,%rcx,2), %r10d
movl %r10d, 0x10(%rdi)
cmpl $0x0, 0x20(%rdx)
jne 0x30f6
movq 0x8(%rdx), %r10
movl 0x1c(%rdx), %r11d
leal 0x1(%r11), %ebx
movl %ebx, 0x1c(%rdx)
movb (%r10,%r11), %r10b
movb %r10b, 0x24(%rdx)
movl $0x8, 0x20(%rdx)
addl %ecx, %ecx
movzbl 0x24(%rdx), %r10d
leal (%r10,%r10), %r11d
movb %r11b, 0x24(%rdx)
decl 0x20(%rdx)
shrl $0x7, %r10d
orl %r10d, %esi
xorl %r8d, %eax
movl %eax, 0xc(%rdi)
xorl $0x80000001, %ecx       # imm = 0x80000001
movl %ecx, 0x10(%rdi)
xorl %r8d, %esi
movl %esi, 0x14(%rdi)
jmp 0x3083
addl %eax, %eax
movl %eax, 0xc(%rdi)
addl %esi, %esi
movl %esi, 0x14(%rdi)
leal 0x1(,%rcx,2), %ecx
movl %ecx, 0x10(%rdi)
cmpl $0x0, 0x20(%rdx)
jne 0x3161
movq 0x8(%rdx), %r10
movl 0x1c(%rdx), %r11d
leal 0x1(%r11), %ebx
movl %ebx, 0x1c(%rdx)
movb (%r10,%r11), %r10b
movb %r10b, 0x24(%rdx)
movl $0x8, 0x20(%rdx)
movzbl 0x24(%rdx), %r10d
leal (%r10,%r10), %r11d
movb %r11b, 0x24(%rdx)
decl 0x20(%rdx)
shrl $0x7, %r10d
orl %r10d, %esi
movl %esi, 0x14(%rdi)
jmp 0x3083
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perf/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(int s, struct wire_requestqueue * Q, struct perfstats * P)
{
	struct dispatch_state * D;

	/* Bake a cookie. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->readq = NULL;
	D->writeq = NULL;
	D->read_cookie = NULL;
	D->Q = Q;
	D->nrequests = 0;
	D->P = P;

	/* Accept a connection. */
	if ((D->accept_cookie = network_accept(s, callback_accept, D)) == NULL)
		goto err1;

	/* Success! */
	return (D);

err1:
	free(D);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movl $0x40, %edi
callq 0x22a0
testq %rax, %rax
je 0x3468
movq %rax, %rbx
xorl %eax, %eax
movq %rax, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq %r15, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq %r14, 0x38(%rbx)
leaq 0x2b(%rip), %rsi        # 0x3478
movl %ebp, %edi
movq %rbx, %rdx
callq 0x63c0
movq %rax, 0x18(%rbx)
testq %rax, %rax
jne 0x346a
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perf/dispatch.c
// Function: dispatch_done
void
dispatch_done(struct dispatch_state * D)
{

	/* Sanity-check. */
	assert(D->accept_cookie == NULL);
	assert(D->read_cookie == NULL);
	assert(D->nrequests == 0);

	/* Free the buffered reader and writer. */
	netbuf_read_free(D->readq);
	netbuf_write_free(D->writeq);

	/* Close the socket. */
	if (close(D->s))
		warnp("close");

	/* Free memory. */
	free(D);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x18(%rdi)
jne 0x36d8
movq %rdi, %rbx
cmpq $0x0, 0x20(%rdi)
jne 0x36f7
cmpq $0x0, 0x30(%rbx)
jne 0x3716
movq 0x8(%rbx), %rdi
callq 0x5e54
movq 0x10(%rbx), %rdi
callq 0x623f
movl (%rbx), %edi
callq 0x21d0
testl %eax, %eax
je 0x36c9
callq 0x20a0
cmpl $0x0, (%rax)
je 0x36bb
movq %rax, %r14
leaq 0x96ff(%rip), %rdi      # 0xcdaa
xorl %eax, %eax
callq 0x8ecc
movl $0x0, (%r14)
jmp 0x36c9
leaq 0x96e8(%rip), %rdi      # 0xcdaa
xorl %eax, %eax
callq 0x8feb
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2040
leaq 0x8bf1(%rip), %rdi      # 0xc2d0
leaq 0x8c03(%rip), %rsi      # 0xc2e9
leaq 0x8c07(%rip), %rcx      # 0xc2f4
movl $0x12d, %edx            # imm = 0x12D
callq 0x21b0
leaq 0x8c22(%rip), %rdi      # 0xc320
leaq 0x8be4(%rip), %rsi      # 0xc2e9
leaq 0x8be8(%rip), %rcx      # 0xc2f4
movl $0x12e, %edx            # imm = 0x12E
callq 0x21b0
leaq 0x8c1a(%rip), %rdi      # 0xc337
leaq 0x8bc5(%rip), %rsi      # 0xc2e9
leaq 0x8bc9(%rip), %rcx      # 0xc2f4
movl $0x12f, %edx            # imm = 0x12F
callq 0x21b0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perf/perfstats.c
// Function: perfstats_init
struct perfstats *
perfstats_init(struct logging_file * L, long w)
{
	struct perfstats * P;

	/* Bake a cookie. */
	if ((P = malloc(sizeof(struct perfstats))) == NULL)
		goto err0;
	P->L = L;
	P->secsperreport = w;
	if ((P->stats = reqstatslist_init(0)) == NULL)
		goto err1;

	/* Statistics prior to now have been reported. */
	if (timetrunc(&P->lastreport, P->secsperreport))
		goto err2;

	/* Start a timer. */
	if ((P->timer_cookie = events_timer_register_double(callback_timer,
	    P, 0.5)) == NULL)
		goto err2;

	/* Success! */
	return (P);

err2:
	reqstatslist_free(P->stats);
err1:
	free(P);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x28, %edi
callq 0x22a0
testq %rax, %rax
je 0x3c6f
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl $0x8, %esi
xorl %edi, %edi
callq 0x4394
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x3c67
movq %rbx, %rdi
addq $0x10, %rdi
movq 0x8(%rbx), %r14
callq 0x2290
cmpq $-0x1, %rax
je 0x3c5e
movq 0x10(%rbx), %rcx
movq %rcx, %rax
cqto
idivq %r14
subq %rdx, %rcx
movq %rcx, 0x10(%rbx)
leaq 0x35(%rip), %rdi        # 0x3c7a
movsd 0x880b(%rip), %xmm0     # 0xc458
movq %rbx, %rsi
callq 0x5984
movq %rax, 0x18(%rbx)
testq %rax, %rax
jne 0x3c71
movq 0x20(%rbx), %rdi
callq 0x4445
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perf/perfstats.c
// Function: poke
static int
poke(struct perfstats * P)
{
	time_t t_now;

	/* Get the current time. */
	if (timetrunc(&t_now, P->secsperreport))
		goto err0;

	/* Is it time to flush statistics? */
	if (t_now != P->lastreport) {
		if (flush(P))
			goto err0;
		P->lastreport = t_now;
	}

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
leaq 0x8(%rsp), %rdi
callq 0x2290
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $-0x1, %rax
je 0x3eff
movq 0x8(%rsp), %rcx
movq %rcx, %rax
cqto
idivq %r14
subq %rdx, %rcx
movq %rcx, 0x8(%rsp)
cmpq 0x10(%rbx), %rcx
je 0x3efd
movq %rbx, %rdi
callq 0x3f47
testl %eax, %eax
jne 0x3eff
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/perf/perfstats.c
// Function: perfstats_done
int
perfstats_done(struct perfstats * P)
{
	int rc;

	/* Flush any unreported statistics. */
	rc = flush(P);

	/* Cancel the timer if we're waiting for a callback. */
	if (P->timer_cookie) {
		events_timer_cancel(P->timer_cookie);
		P->timer_cookie = NULL;
	}

	/* Free our state. */
	reqstatslist_free(P->stats);
	free(P);

	/* Return code from flush(). */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3f47
movl %eax, %ebp
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3f2d
callq 0x59b9
movq $0x0, 0x18(%rbx)
movq 0x20(%rbx), %rdi
callq 0x4445
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/innerlist.c
// Function: SH_InnerList__init
SH_InnerList*
SH_InnerList__init(int* err) {
	SH_InnerList* obj;

	__cascade(err, (SH_InnerList*)0);

	obj = (SH_InnerList*)malloc(sizeof(SH_InnerList));
	if ((SH_InnerList*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_InnerList*)0;
	}

	obj->count = 0;

	__clear(err);
	return obj;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x117e
cmpl $0x0, (%rbx)
je 0x117e
xorl %eax, %eax
jmp 0x11aa
movl $0x808, %edi            # imm = 0x808
callq 0x1080
testq %rax, %rax
je 0x119c
xorl %ecx, %ecx
movq $0x0, 0x800(%rax)
jmp 0x11a3
movl $0x80000001, %ecx       # imm = 0x80000001
xorl %eax, %eax
testq %rbx, %rbx
je 0x11aa
movl %ecx, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/innerlist.c
// Function: SH_InnerList__add
void
SH_InnerList__add(SH_InnerList* obj, SH_Item* item, int* err) {
	__cascade(err,);
	if (obj->count >= SH_INNERLIST_CAPACITY) {
		__raise(err, SH_E_LIST_OVERFLOW);
		return;
	}
	obj->_list[obj->count++] = item;
	__clear(err);
}

// Assembly:
testq %rdx, %rdx
je 0x1254
cmpl $0x0, (%rdx)
je 0x1254
retq
movq 0x800(%rdi), %rcx
cmpq $0x100, %rcx            # imm = 0x100
jb 0x126b
movl $0x300001, %eax         # imm = 0x300001
jmp 0x127c
leaq 0x1(%rcx), %r8
xorl %eax, %eax
movq %r8, 0x800(%rdi)
movq %rsi, (%rdi,%rcx,8)
testq %rdx, %rdx
je 0x1253
movl %eax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/innerlist.c
// Function: SH_InnerList__to_s
sh_char_t*
SH_InnerList__to_s(SH_InnerList* obj, int* err) {
	sh_char_t* tmp_s;
	sh_char_t* s;
	sh_char_t* ptr;

	size_t i;
	size_t n;
	size_t total;

	__SH_InnerList__string str;
	str.length = (size_t)0;
	str.n = (size_t)0;

	SH_InnerList__each(obj, &__SH_InnerList__to_s_item, (void*)(&str), err);
	if (__catch(err)) {
		for (i = 0; i < str.n; i++) {
			free(str.a[i]);
		}
		__cascade(err, (sh_char_t*)0);
	}

	total = 2; /* '(' and ')' */
	total += str.length;
	if (str.n > 1)
		total += (str.n - 1); /* ' ' between items */
	total += 1; /* NULL */

	s = (sh_char_t*)malloc(sizeof(sh_char_t) * total);
	if ((sh_char_t*)0 == s) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (sh_char_t*)0;
	}

	ptr = s;

	*ptr = '(';
	ptr ++;

	for (i = 0; i < str.n; i++) {
		if (i > 0) {
			*ptr = ' ';
			ptr ++;
		}

		tmp_s = str.a[i];
		n = strlen((const char*)tmp_s);
		memcpy((void*)ptr, (const void*)tmp_s, n);
		free(str.a[i]);
		ptr += n;
	}

	*ptr = ')';
	ptr ++;

	*ptr = SH_CHAR_C(0);

	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x810, %rsp            # imm = 0x810
movq %rsi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq 0x2c1a(%rip), %rsi      # 0x3fe0
movq %r14, %rcx
callq 0x1050
testq %r14, %r14
je 0x1401
cmpl $0x0, (%r14)
je 0x1401
cmpq $0x0, 0x8(%rsp)
je 0x13f7
xorl %ebx, %ebx
movq 0x10(%rsp,%rbx,8), %rdi
callq 0x1030
incq %rbx
cmpq 0x8(%rsp), %rbx
jb 0x13e3
cmpl $0x0, (%r14)
jne 0x1492
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
xorl %edx, %edx
subq $0x1, %rcx
cmovaeq %rcx, %rdx
leaq (%rax,%rdx), %rdi
addq $0x3, %rdi
callq 0x1080
testq %rax, %rax
je 0x1486
movq %rax, %rbx
movb $0x28, (%rax)
movq %rax, %r14
incq %r14
cmpq $0x0, 0x8(%rsp)
je 0x147e
xorl %r13d, %r13d
testq %r13, %r13
je 0x1449
movb $0x20, (%r14)
incq %r14
movq 0x10(%rsp,%r13,8), %r15
movq %r15, %rdi
callq 0x1060
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1070
movq 0x10(%rsp,%r13,8), %rdi
callq 0x1030
addq %r12, %r14
incq %r13
cmpq 0x8(%rsp), %r13
jb 0x143d
movw $0x29, (%r14)
jmp 0x1494
testq %r14, %r14
je 0x1492
movl $0x80000001, (%r14)     # imm = 0x80000001
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x810, %rsp            # imm = 0x810
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/netpipe.c
// Function: usage
void usage(void)
{
	fprintf(stderr, "Usage: netpipe <mode> [options]\n");
	fprintf(stderr, "Supported modes:\n");
	fprintf(stderr, "  aa - accept connection from both source and destination\n");
	fprintf(stderr, "  ac - accept connection from the source, make connection to the target\n");
	fprintf(stderr, "  ca - make connection to the source, accept connection from the target\n");
	fprintf(stderr, "  cc - connect to both source and target\n");
	fprintf(stderr, "The connection to the target is established only after the source connection\n");
	fprintf(stderr, "Options:\n");
	for (const COMMAND_LINE_OPTION *c = _cmdOptions; c->Type != otUnknown; c++) {
		fprintf(stderr, "  %s", c->Names[0]);
		for (int i = 1 ; i < c->NameCount; i++)
			fprintf(stderr, ", %s", c->Names[i]);

		if (c->ArgumentType != NULL)
			fprintf(stderr, " <%s>", c->ArgumentType);

		if (c->Description)
			fprintf(stderr, " - %s", c->Description);

		fputc('\n', stderr);
	}

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0xdd76(%rip), %r13      # 0xfff8
movq (%r13), %rcx
leaq 0xb5db(%rip), %rdi      # 0xd868
pushq $0x20
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb5e3(%rip), %rdi      # 0xd889
pushq $0x11
popq %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb5df(%rip), %rdi      # 0xd89b
pushq $0x3a
popq %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb604(%rip), %rdi      # 0xd8d6
pushq $0x48
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb633(%rip), %rdi      # 0xd91f
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb666(%rip), %rdi      # 0xd968
pushq $0x29
popq %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb67a(%rip), %rdi      # 0xd992
pushq $0x4d
popq %rsi
movq %rbx, %rdx
callq 0x2200
movq (%r13), %rcx
leaq 0xb6b2(%rip), %rdi      # 0xd9e0
pushq $0x9
popq %rsi
movq %rbx, %rdx
callq 0x2200
cmpl $0x0, 0xde10(%rip)      # 0x10150
je 0x23f1
leaq 0xde03(%rip), %r15      # 0x10150
leaq 0xb696(%rip), %rbx      # 0xd9ea
leaq 0xb694(%rip), %r14      # 0xd9ef
pushq $0xa
popq %rbp
movq (%r13), %rdi
movq 0x18(%r15), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2150
cmpq $0x2, 0x10(%r15)
jb 0x239f
pushq $0x4
popq %r12
movq (%r13), %rdi
movq (%r15,%r12,8), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2150
leaq 0x1(%r12), %rax
addq $-0x2, %r12
cmpq %r12, 0x10(%r15)
movq %rax, %r12
ja 0x237b
movq 0x28(%r15), %rdx
testq %rdx, %rdx
jne 0x23c9
movq 0x30(%r15), %rdx
testq %rdx, %rdx
jne 0x23dd
movq (%r13), %rsi
movl %ebp, %edi
callq 0x2120
cmpl $0x0, 0x38(%r15)
leaq 0x38(%r15), %r15
jne 0x235e
jmp 0x23f1
movq (%r13), %rdi
leaq 0xb620(%rip), %rsi      # 0xd9f4
xorl %eax, %eax
callq 0x2150
jmp 0x23a8
movq (%r13), %rdi
leaq 0xb612(%rip), %rsi      # 0xd9fa
xorl %eax, %eax
callq 0x2150
jmp 0x23b1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/aes.c
// Function: AES_Encrypt
void AES_Encrypt(const AES_Ctx *Ctx, const unsigned char *Pt, size_t Length, unsigned char *Ct)
{
	const size_t blockCount = Length / 0x10;

	for (size_t i = 0; i < blockCount; ++i) {
		rijndaelEncrypt(Ctx->RoundKeys, Ctx->Rounds, Pt, Ct);
		Pt += 0x10;
		Ct += 0x10;
	}

	return;
}

// Assembly:
cmpq $0x10, %rdx
jb 0x4ad7
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
shrq $0x4, %r14
movl 0x1f0(%r12), %esi
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x2a86
addq $0x10, %r15
addq $0x10, %rbx
decq %r14
jne 0x4aa9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/aes.c
// Function: AES_Decrypt
void AES_Decrypt(const AES_Ctx *Ctx, const unsigned char *Ct, size_t Length, unsigned char *Pt)
{
	const size_t blockCount = Length / 0x10;

	for (size_t i = 0; i < blockCount; ++i) {
		rijndaelDecrypt(Ctx->RoundKeys, Ctx->Rounds, Ct, Pt);
		Pt += 16;
		Ct += 16;
	}

	return;
}

// Assembly:
cmpq $0x10, %rdx
jb 0x4b24
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
shrq $0x4, %r14
movl 0x1f0(%r12), %esi
movq %r12, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x3a9f
addq $0x10, %rbx
addq $0x10, %r15
decq %r14
jne 0x4af6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/aes.c
// Function: AES_EncryptCBC
void AES_EncryptCBC(const AES_Ctx *Ctx, const unsigned char *Pt, size_t Length, unsigned char *Ct)
{
	unsigned char oneBlock[16];
	const size_t blockCount = Length / 16;

	memcpy(oneBlock, Pt, sizeof(oneBlock));
	_XOR16B(oneBlock, Ctx->IV);
	rijndaelEncrypt(Ctx->RoundKeys, Ctx->Rounds, oneBlock, Ct);
	Pt += 0x10;
	Ct += 0x10;
	for (size_t i = 1; i < blockCount; ++i) {
		memcpy(oneBlock, Pt, sizeof(oneBlock));
		_XOR16B(oneBlock, Ct - 0x10);
		rijndaelEncrypt(Ctx->RoundKeys, Ctx->Rounds, oneBlock, Ct);
		Pt += 0x10;
		Ct += 0x10;
	}

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movups (%rsi), %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
movb 0x1e0(%r12,%rax), %cl
xorb %cl, (%rsp,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4b48
movl 0x1f0(%r12), %esi
movq %rsp, %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x2a86
cmpq $0x20, %r14
jb 0x4bc4
shrq $0x4, %r14
movl $0x1, %ebp
movq %rsp, %r13
movups 0x10(%r15), %xmm0
addq $0x10, %r15
movaps %xmm0, (%rsp)
xorl %eax, %eax
movb (%rbx,%rax), %cl
xorb %cl, (%rsp,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4b93
addq $0x10, %rbx
movl 0x1f0(%r12), %esi
movq %r12, %rdi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x2a86
incq %rbp
cmpq %r14, %rbp
jne 0x4b84
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/aes.c
// Function: AES_DecryptCBC
void AES_DecryptCBC(const AES_Ctx *Ctx, const unsigned char *Ct, size_t Length, unsigned char *Pt)
{
	const size_t blockCount = Length / 0x10;

	for (size_t i = 0; i < blockCount; ++i)
		rijndaelDecrypt(Ctx->RoundKeys, Ctx->Rounds, Ct + i*0x10, Pt + i*0x10);

	_XOR16B(Pt, Ctx->IV);
	for (size_t i = 1; i < blockCount; ++i)
		_XOR16B(Pt + i * 0x10, Ct + (i - 1) * 0x10);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, %rax
shrq $0x4, %rax
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
cmpq $0x10, %rdx
jb 0x4c2f
movq %rbx, %r13
movq %r14, %rbp
movq 0x8(%rsp), %r15
movl 0x1f0(%r12), %esi
movq %r12, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x3a9f
addq $0x10, %rbp
addq $0x10, %r13
decq %r15
jne 0x4c0c
xorl %eax, %eax
movb 0x1e0(%r12,%rax), %cl
xorb %cl, (%rbx,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4c31
cmpq $0x20, 0x10(%rsp)
movq 0x8(%rsp), %rsi
jb 0x4c7d
addq $0x10, %rbx
movl $0x1, %eax
xorl %ecx, %ecx
movb (%r14,%rcx), %dl
xorb %dl, (%rbx,%rcx)
incq %rcx
cmpq $0x10, %rcx
jne 0x4c5d
incq %rax
addq $0x10, %rbx
addq $0x10, %r14
cmpq %rsi, %rax
jne 0x4c5b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/aes.c
// Function: AESDecryptCTS
void AESDecryptCTS(const AES_Ctx *Ctx, const unsigned char *Ct, size_t Length, unsigned char *Pt)
{
	const size_t blockCount = (Length + 15) / 16;
	const size_t lastLen = (Length % 16) ? (Length % 16) : 16;
	unsigned char buffer[32];
	unsigned char buffer2[32];

	if (blockCount > 2)
		AES_DecryptCBC(Ctx, Ct, (blockCount - 2)*16, Pt);

	Pt += (blockCount - 2) * 16;
	memset(buffer, 0, sizeof(buffer));
	memcpy(buffer, Pt, lastLen + 16);
	AES_Decrypt(Ctx, buffer, 16, buffer2);
	memcpy(buffer, buffer2, 16);
	_XOR16B(buffer, buffer + 16);
	memcpy(buffer + 16 + lastLen, buffer + lastLen, 16 - lastLen);
	AES_Decrypt(Ctx, buffer + 16, 16, buffer2);
	_XOR16B(buffer2, Ct + 16*(blockCount - 2));
	memcpy(Pt, buffer2, 16);
	memcpy(Pt + 16, buffer, lastLen);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
leaq 0xf(%rdx), %r12
cmpq $0x30, %r12
jb 0x4d63
movq %r12, %rdx
andq $-0x10, %rdx
addq $-0x20, %rdx
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x4bd3
andq $-0x10, %r12
andl $0xf, %ebx
movl $0x10, %eax
cmoveq %rax, %rbx
leaq (%r15,%r12), %rax
addq $-0x20, %rax
movq %rax, 0x8(%rsp)
addq $-0x20, %r12
leaq 0x10(%rbx), %rax
movq %rax, (%rsp)
movl $0x10, %edx
subq %rbx, %rdx
leaq (%rsp,%rbx), %rdi
addq $0x20, %rdi
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x2100
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq (%rsp), %rdx
callq 0x2160
movl 0x1f0(%r13), %eax
leaq 0x30(%rsp), %rcx
movq %r13, (%rsp)
movq %r13, %rdi
movl %eax, %r13d
movl %eax, %esi
movq %r15, %rdx
callq 0x3a9f
leaq 0x30(%rsp), %rax
movaps (%rax), %xmm0
movaps %xmm0, (%r15)
movl $0x10, %eax
addq %rax, %r15
movb 0x20(%rsp,%rbp), %al
xorb %al, 0x10(%rsp,%rbp)
incq %rbp
cmpq $0x10, %rbp
jne 0x4def
leaq (%r15,%rbx), %rdi
leaq (%rsp,%rbx), %rsi
addq $0x10, %rsi
movl $0x10, %edx
subq %rbx, %rdx
callq 0x2160
leaq 0x30(%rsp), %rcx
movq (%rsp), %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x3a9f
addq %r12, %r14
xorl %eax, %eax
movb (%r14,%rax), %cl
xorb %cl, 0x30(%rsp,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x4e32
movaps 0x30(%rsp), %xmm0
movq 0x8(%rsp), %rdi
movups %xmm0, (%rdi)
addq $0x10, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x2160
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/auth.c
// Function: AuthKeyGen
void AuthKeyGen(const char *Password, unsigned char *Salt, unsigned int SaltLen, uint32_t IterationCount, unsigned char Key[16])
{
	sha256_ctx ctx;
	unsigned char digest[256/8];

	sha256_init(&ctx);
	sha256_update(&ctx, Salt, SaltLen);
	sha256_update(&ctx, (unsigned char *)Password, (unsigned int)strlen(Password));
	for (size_t i = 0; i < IterationCount - 1; ++i) {
		sha256_final(&ctx, digest);
		sha256_init(&ctx);
		sha256_update(&ctx, Salt, SaltLen);
		sha256_update(&ctx, digest, sizeof(digest));
	}

	sha256_final(&ctx, digest);
	memcpy(Key, digest, 0x10);

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x6afc
movq %r13, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x6b21
movq %r12, %rdi
callq 0x20c0
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x6b21
decl %r14d
je 0x4f00
leaq 0x20(%rsp), %r12
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6bcb
movq %r12, %rdi
callq 0x6afc
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x6b21
movq %r12, %rdi
movq %r13, %rsi
movl $0x20, %edx
callq 0x6b21
decq %r14
jne 0x4ecb
leaq 0x20(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x6bcb
movaps (%r14), %xmm0
movups %xmm0, (%rbx)
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/logging.c
// Function: LogMsg
void LogMsg(uint32_t Level, const char *Format, ...)
{
	va_list vs;
	char msg[4096];

	if (_loggingFlags & Level) {
		if (_logStream == NULL)
			_logStream = stderr;

		memset(msg, 0, sizeof(msg));
		va_start(vs, Format);
		vsnprintf(msg, sizeof(msg), Format, vs);
		fputs(msg, _logStream);
		fflush(_logStream);
		va_end(vs);
	}

	return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x5365
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testl %edi, 0xadd5(%rip)      # 0x10140
je 0x53f6
movq %rsi, %rbx
cmpq $0x0, 0xb72c(%rip)      # 0x10aa8
jne 0x538f
movq 0xac73(%rip), %rax      # 0xfff8
movq (%rax), %rax
movq %rax, 0xb719(%rip)      # 0x10aa8
leaq 0xd0(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x2100
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rcx
movq %rax, (%rcx)
leaq 0x10f0(%rsp), %rax
movq %rax, 0x8(%rcx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rcx)
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2070
movq 0xb6c6(%rip), %rsi      # 0x10aa8
movq %r14, %rdi
callq 0x20f0
movq 0xb6b7(%rip), %rdi      # 0x10aa8
callq 0x2180
addq $0x10d8, %rsp           # imm = 0x10D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/logging.c
// Function: LogSetFile
int LogSetFile(const char *FileName)
{
	int ret = 0;

	_logStream = fopen(FileName, "wb");
	if (_logStream == NULL)
		ret = errno;

	return ret;
}

// Assembly:
pushq %rax
leaq 0x7e41(%rip), %rsi      # 0xd24a
callq 0x21d0
movq %rax, %rcx
movq %rax, 0xb690(%rip)      # 0x10aa8
xorl %eax, %eax
testq %rcx, %rcx
jne 0x5426
callq 0x2050
movl (%rax), %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/netpipe.c
// Function: sockaddrstr
char *sockaddrstr(const struct sockaddr *Addr)
{
	size_t len = 0;
	char *ret = NULL;
	const struct sockaddr_in *in4 = NULL;
	const struct sockaddr_in6 *in6 = NULL;
	const unsigned char *bytes = NULL;
	const unsigned short *words = NULL;

	len = 128;
	ret = (char *)malloc(len);
	if (ret == NULL)
		return ret;

	memset(ret, 0, len);
	switch (Addr->sa_family) {
		case AF_INET:
			in4 = (struct sockaddr_in *)Addr;
			bytes = (unsigned char *)&in4->sin_addr;
			snprintf(ret, len, "%u.%u.%u.%u:%u", bytes[0], bytes[1], bytes[2], bytes[3], ntohs(in4->sin_port));
			break;
		case AF_INET6:
			in6 = (struct sockaddr_in6 *)Addr;
			words = (unsigned short *)&in6->sin6_addr;
			snprintf(ret, len, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%u", words[0], words[1], words[2], words[3], words[4], words[5], words[6], words[7], ntohs(in6->sin6_port));
			break;
		default:
			free(ret);
			ret = NULL;
			break;
	}

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x80, %edi
callq 0x2170
testq %rax, %rax
je 0x5524
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movzwl (%r14), %eax
cmpl $0xa, %eax
je 0x54bf
cmpl $0x2, %eax
jne 0x551c
movzbl 0x4(%r14), %ecx
movzbl 0x5(%r14), %r8d
movzbl 0x6(%r14), %r9d
movzbl 0x7(%r14), %r10d
movzwl 0x2(%r14), %eax
rolw $0x8, %ax
movzwl %ax, %r11d
leaq 0x7e06(%rip), %rdx      # 0xd2ac
movl $0x80, %esi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x20e0
addq $0x10, %rsp
jmp 0x5526
movzwl 0x8(%r14), %ecx
movzwl 0xa(%r14), %r8d
movzwl 0xc(%r14), %r9d
movzwl 0xe(%r14), %r10d
movzwl 0x10(%r14), %r11d
movzwl 0x12(%r14), %r15d
movzwl 0x14(%r14), %r12d
movzwl 0x16(%r14), %r13d
movzwl 0x2(%r14), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
leaq 0x7dc0(%rip), %rdx      # 0xd2bb
movl $0x80, %esi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r14
pushq %r13
pushq %r12
pushq %r15
pushq %r11
pushq %r10
callq 0x20e0
addq $0x30, %rsp
jmp 0x5526
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/netpipe.c
// Function: recv_fixed
static int _recv_fixed(SOCKET Socket, void *Buffer, size_t Length, int Flags)
{
	int ret = 0;

	if ((size_t)recv(Socket, Buffer, Length, Flags) != Length) {
		ret = errno;
		if (ret == 0)
			ret = EINTR;
	}

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
xorl %ebx, %ebx
xorl %ecx, %ecx
callq 0x2040
cmpq %r14, %rax
je 0x6791
callq 0x2050
movl (%rax), %eax
testl %eax, %eax
movl $0x4, %ebx
cmovnel %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/netpipe.c
// Function: StreamData
static int _StreamData(SOCKET Source, SOCKET Dest, uint32_t Flags)
{
	int ret = 0;
	ssize_t len = 0;
	char dataBuffer[4096];

	do {
		len = recv(Source, dataBuffer, sizeof(dataBuffer), 0);
		if (len > 0) {
			LogPacket("<<< %zu bytes received", len);
			len = send(Dest, dataBuffer, len, 0);
			if (len >= 0)
				LogPacket(">>> %zu bytes sent", len);
		}

		if (len == -1)
			ret = -1;
	} while (len > 0);

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movl %esi, %ebx
movl %edi, %ebp
movq %rsp, %r14
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
movl $0x1000, %edx           # imm = 0x1000
movl %ebp, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x2040
movq %rax, %r12
testq %rax, %rax
jle 0x6826
callq 0x2090
movl $0x8, %edi
leaq 0x7793(%rip), %rsi      # 0xdf79
movl %eax, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x530c
movl %ebx, %edi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x20d0
movq %rax, %r12
testq %rax, %rax
js 0x6826
callq 0x2090
movl $0x8, %edi
leaq 0x777d(%rip), %rsi      # 0xdf97
movl %eax, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x530c
cmpq $-0x1, %r12
cmovel %r15d, %r13d
testq %r12, %r12
jg 0x67bc
movl %r13d, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/MartinDrab[P]netpipe/randomness.c
// Function: RandomBuffer
int RandomBuffer(void *Buffer, uint32_t Size)
{
	int ret = 0;
#ifdef _WIN32
	HCRYPTPROV hCryptProv = 0;

	if (CryptAcquireContextW(&hCryptProv, NULL, L"Microsoft Base Cryptographic Provider v1.0", PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
		if (!CryptGenRandom(hCryptProv, Size, Buffer))
			ret = GetLastError();

		CryptReleaseContext(hCryptProv, 0);
	} else ret = GetLastError();
#else
	FILE *f = NULL;

	f = fopen("/dev/urandom", "r");
	if (f == NULL) {
		ret = errno;
		goto Exit;
	}

	if (fread(Buffer, 1, Size, f) != Size)
		ret = errno;

	fclose(f);
Exit:
#endif
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
leaq 0x774e(%rip), %rdi      # 0xdfb1
leaq 0x6e82(%rip), %rsi      # 0xd6ec
callq 0x21d0
testq %rax, %rax
je 0x68a5
movq %rax, %rbx
movl %ebp, %r15d
movl $0x1, %esi
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
callq 0x2060
xorl %ebp, %ebp
cmpq %r15, %rax
je 0x689b
callq 0x2050
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x20a0
jmp 0x68ac
callq 0x2050
movl (%rax), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)