LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: Adam7_getpassvalues(unsigned int*, unsigned int*, unsigned long*, unsigned long*, unsigned long*, unsigned int, unsigned int, unsigned int)
static void Adam7_getpassvalues(unsigned passw[7], unsigned passh[7], size_t filter_passstart[8],
                                size_t padded_passstart[8], size_t passstart[8], unsigned w, unsigned h, unsigned bpp)
{
  /*the passstart values have 8 values: the 8th one indicates the byte after the end of the 7th (= last) pass*/
  unsigned i;

  /*calculate width and height in pixels of each pass*/
  for(i = 0; i != 7; ++i)
  {
    passw[i] = (w + ADAM7_DX[i] - ADAM7_IX[i] - 1) / ADAM7_DX[i];
    passh[i] = (h + ADAM7_DY[i] - ADAM7_IY[i] - 1) / ADAM7_DY[i];
    if(passw[i] == 0) passh[i] = 0;
    if(passh[i] == 0) passw[i] = 0;
  }

  filter_passstart[0] = padded_passstart[0] = passstart[0] = 0;
  for(i = 0; i != 7; ++i)
  {
    /*if passw[i] is 0, it's 0 bytes, not 1 (no filtertype-byte)*/
    filter_passstart[i + 1] = filter_passstart[i]
                            + ((passw[i] && passh[i]) ? passh[i] * (1 + (passw[i] * bpp + 7) / 8) : 0);
    /*bits padded if needed to fill full byte at end of each scanline*/
    padded_passstart[i + 1] = padded_passstart[i] + passh[i] * ((passw[i] * bpp + 7) / 8);
    /*only padded at end of reduced image*/
    passstart[i + 1] = passstart[i] + (passh[i] * passw[i] * bpp + 7) / 8;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl 0x38(%rsp), %ebx
leaq 0x28a9(%rip), %r15      # 0xeb30
leaq 0x28c2(%rip), %r12      # 0xeb50
leaq 0x28db(%rip), %r13      # 0xeb70
leaq 0x28f4(%rip), %rbp      # 0xeb90
movq %rdx, %r10
xorl %r14d, %r14d
cmpq $0x1c, %r14
je 0xc2f5
movl (%r14,%r12), %eax
movl (%r14,%r15), %r11d
notl %eax
addl %r11d, %eax
addl %r9d, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rdi,%r14)
movl (%r14,%rbp), %eax
movl (%r14,%r13), %r11d
notl %eax
addl %r11d, %eax
addl %ebx, %eax
xorl %edx, %edx
divl %r11d
movl %eax, (%rsi,%r14)
movl (%rdi,%r14), %edx
testl %edx, %edx
cmovel %edx, %eax
movl %eax, (%rsi,%r14)
testl %eax, %eax
jne 0xc2ef
andl $0x0, (%rdi,%r14)
addq $0x4, %r14
jmp 0xc2a2
andq $0x0, (%r8)
andq $0x0, (%rcx)
andq $0x0, (%r10)
movl 0x40(%rsp), %ebp
xorl %eax, %eax
cmpq $0x1c, %rax
je 0xc36f
movl (%rdi,%rax), %edx
movl (%rsi,%rax), %r9d
testl %edx, %edx
je 0xc333
testl %r9d, %r9d
je 0xc330
movl %edx, %ebx
imull %ebp, %ebx
addl $0x7, %ebx
shrl $0x3, %ebx
incl %ebx
imull %r9d, %ebx
jmp 0xc335
xorl %r9d, %r9d
xorl %ebx, %ebx
addq (%r10,%rax,2), %rbx
imull %ebp, %edx
leal 0x7(%rdx), %r11d
imull %r9d, %edx
shrl $0x3, %r11d
movq %rbx, 0x8(%r10,%rax,2)
imull %r9d, %r11d
addq (%rcx,%rax,2), %r11
addl $0x7, %edx
shrl $0x3, %edx
movq %r11, 0x8(%rcx,%rax,2)
addq (%r8,%rax,2), %rdx
movq %rdx, 0x8(%r8,%rax,2)
addq $0x4, %rax
jmp 0xc307
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: paethPredictor(short, short, short)
static unsigned char paethPredictor(short a, short b, short c)
{
  short pa = abs(b - c);
  short pb = abs(a - c);
  short pc = abs(a + b - c - c);

  if(pc < pa && pc < pb) return (unsigned char)c;
  else if(pb < pa) return (unsigned char)b;
  else return (unsigned char)a;
}

// Assembly:
movl $0xffff, %ecx           # imm = 0xFFFF
movl %edx, %r9d
movl %esi, %r8d
movl %edx, %eax
leal (%rsi,%rdi), %r11d
leal (%rax,%rax), %r10d
andl %ecx, %r8d
andl %ecx, %r9d
subl %r9d, %r8d
movl %r8d, %edx
negl %edx
cmovsl %r8d, %edx
movl %edi, %r8d
andl %ecx, %r8d
subl %r9d, %r8d
andl %ecx, %edx
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
subl %r10d, %r11d
andl %ecx, %r9d
movl %r11d, %r10d
negl %r10d
cmovsl %r11d, %r10d
andl %ecx, %r10d
cmpl %edx, %r9d
cmovbl %esi, %edi
cmpl %r9d, %r10d
cmovael %edi, %eax
cmpl %edx, %r10d
cmovael %edi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: setBitOfReversedStream(unsigned long*, unsigned char*, unsigned char)
static void setBitOfReversedStream(size_t* bitpointer, unsigned char* bitstream, unsigned char bit)
{
  /*the current bit in bitstream may be 0 or 1 for this to work*/
  if(bit == 0) bitstream[(*bitpointer) >> 3] &=  (unsigned char)(~(1 << (7 - ((*bitpointer) & 0x7))));
  else         bitstream[(*bitpointer) >> 3] |=  (1 << (7 - ((*bitpointer) & 0x7)));
  ++(*bitpointer);
}

// Assembly:
movq (%rdi), %rax
movb $0x1, %r8b
movl %eax, %ecx
notb %cl
andb $0x7, %cl
shlb %cl, %r8b
testl %edx, %edx
je 0xc3fa
shrq $0x3, %rax
orb %r8b, (%rsi,%rax)
jmp 0xc405
notb %r8b
shrq $0x3, %rax
andb %r8b, (%rsi,%rax)
incq (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]fractal-gen/lodepng.cpp
// Function: addPaddingBits(unsigned char*, unsigned char const*, unsigned long, unsigned long, unsigned int)
static void addPaddingBits(unsigned char* out, const unsigned char* in,
                           size_t olinebits, size_t ilinebits, unsigned h)
{
  /*The opposite of the removePaddingBits function
  olinebits must be >= ilinebits*/
  unsigned y;
  size_t diff = olinebits - ilinebits;
  size_t obp = 0, ibp = 0; /*bit pointers*/
  for(y = 0; y != h; ++y)
  {
    size_t x;
    for(x = 0; x < ilinebits; ++x)
    {
      unsigned char bit = readBitFromReversedStream(&ibp, in);
      setBitOfReversedStream(&obp, out, bit);
    }
    /*obp += diff; --> no, fill in some value in the padding bits too, to avoid
    "Use of uninitialised value of size ###" warning from valgrind*/
    for(x = 0; x != diff; ++x) setBitOfReversedStream(&obp, out, 0);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x8(%rsp), %rbp
subq %rcx, %rdx
movl %r8d, 0x4(%rsp)
movq %rsi, %r12
movq %rdi, %r13
movq %rcx, 0x18(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
andq $0x0, (%rbp)
movq %rdx, 0x10(%rsp)
cmpl 0x4(%rsp), %ebx
je 0xc4c3
movq 0x18(%rsp), %r14
leaq (%r15,%r14), %rax
movq %rax, 0x20(%rsp)
subq $0x1, %r14
jb 0xc487
movq %r15, %rax
shrq $0x3, %rax
movl %r15d, %ecx
xorl %edx, %edx
movq %rbp, %rdi
movq %r13, %rsi
movzbl (%r12,%rax), %eax
notb %cl
movzbl %cl, %ecx
andl $0x7, %ecx
btl %ecx, %eax
setb %dl
incq %r15
callq 0xc3dc
jmp 0xc452
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rdx
subq $0x1, %rdx
jb 0xc4b2
movl %eax, %ecx
movb $-0x2, %sil
notb %cl
rolb %cl, %sil
movq %rax, %rcx
shrq $0x3, %rcx
incq %rax
andb %sil, (%r13,%rcx)
jmp 0xc491
movq 0x20(%rsp), %r15
movq %rax, 0x8(%rsp)
incl %ebx
jmp 0xc43e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/AlgoLab[P]bwt-lcp-parallel/decode_bwt.c
// Function: main
int main(int argc, char **argv) {

  if(argc != 2) {
    fprintf(stderr, "Usage: %s <bwtfile>\n", argv[0]);
    return 1;
  }

  FILE* pFile;
  int c;
  char c1, c2;

  pFile = fopen(argv[1], "r");
  if(pFile == NULL) {
    fprintf(stderr, "Error while opening the file\n");
    return 1;
  }
  else {
    while((c = fgetc(pFile)) != EOF) {
      c1 = codeToChar((c >> 4));
      printf("%c", c1);
      if((c & 0b1111) != 0b1111) {
        c2 = codeToChar((c & 0b1111));
        printf("%c", c2);
      }
    }
  }
  printf("\n");
  fclose(pFile);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x2, %edi
jne 0x1210
movq 0x8(%rsi), %rdi
leaq 0xe73(%rip), %rsi       # 0x2021
callq 0x1070
testq %rax, %rax
je 0x122d
movq %rax, %rbx
leaq 0xe42(%rip), %r15       # 0x2004
movq %rbx, %rdi
callq 0x1050
cmpl $-0x1, %eax
je 0x11f8
movl %eax, %r14d
shrl $0x4, %eax
movzbl %al, %eax
movsbl (%rax,%r15), %edi
callq 0x1030
andl $0xf, %r14d
cmpl $0xf, %r14d
je 0x11c2
movsbl (%r14,%r15), %edi
callq 0x1030
jmp 0x11c2
pushq $0xa
popq %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1040
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x2de1(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rsi), %rdx
leaq 0xde8(%rip), %rsi       # 0x200c
xorl %eax, %eax
callq 0x1060
jmp 0x1249
movq 0x2dc4(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xde5(%rip), %rdi       # 0x2023
pushq $0x1d
popq %rsi
pushq $0x1
popq %rdx
callq 0x1080
pushq $0x1
popq %rax
jmp 0x120a
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./generator.hh
// Function: MPHF::Generator::save(std::basic_ofstream<char, std::char_traits<char>>&) const
void save(std::ofstream& out) const {
      out.write(reinterpret_cast<const char*>(&key_count), sizeof(unsigned));
      out.write(reinterpret_cast<const char*>(&hash_value_limit), sizeof(unsigned));
      
      out.write(reinterpret_cast<const char*>(&h[0].param), sizeof(HashImpl::Param));
      out.write(reinterpret_cast<const char*>(&h[1].param), sizeof(HashImpl::Param));

      out.write(reinterpret_cast<const char*>(&rank_bv->bit_length), sizeof(unsigned));      
      out.write(reinterpret_cast<const char*>(rank_bv->blocks), sizeof(unsigned)*rank_bv->block_size()); 
      out.write(reinterpret_cast<const char*>(rank_bv->rank_index), sizeof(unsigned)*rank_bv->rank_index_size()); 

      out.write(reinterpret_cast<const char*>(&hash_assign_bv->bit_length), sizeof(unsigned));      
      out.write(reinterpret_cast<const char*>(hash_assign_bv->blocks), sizeof(unsigned)*hash_assign_bv->block_size()); 
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28(%rdi), %rsi
pushq $0x4
popq %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x21c0
leaq 0x2c(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x21c0
movq 0x8(%r14), %rsi
pushq $0x8
popq %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x21c0
movq 0x8(%r14), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x21c0
movq 0x18(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x21c0
movq 0x18(%r14), %rax
movq 0x8(%rax), %rsi
movl (%rax), %edx
addl $0x1f, %edx
shrl $0x3, %edx
andl $-0x4, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0x18(%r14), %rax
movq 0x10(%rax), %rsi
movl $0xff, %edx
addl (%rax), %edx
shrl $0x6, %edx
andl $-0x4, %edx
movq %rbx, %rdi
callq 0x21c0
movq 0x20(%r14), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x21c0
movq 0x20(%r14), %rax
movq 0x8(%rax), %rsi
movl (%rax), %edx
addl $0x1f, %edx
shrl $0x3, %edx
andl $-0x4, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./generator.hh
// Function: MPHF::Generator::~Generator()
~Generator() {
      delete [] h;
      delete [] graph;
      BitVector::free(rank_bv);
      BitVector::free(hash_assign_bv);
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x2af8
callq 0x21b0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2b06
callq 0x21b0
movq 0x18(%rbx), %rdi
callq 0x3752
movq 0x20(%rbx), %rdi
popq %rbx
jmp 0x3752
nop
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./generator.hh
// Function: MPHF::Generator::count_line(char const*) const
unsigned count_line(const char* filepath) const {
      unsigned count=0;
      std::ifstream in(filepath);
      if(!in)
	return 0;
      
      std::string line;
      while(std::getline(in, line))
	count++;
      
      return count;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
leaq 0x28(%rsp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
callq 0x2230
movq (%rbx), %rax
movq -0x18(%rax), %rax
xorl %ebx, %ebx
testb $0x5, 0x48(%rsp,%rax)
jne 0x2b8a
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %ebx, %ebx
leaq 0x28(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2b80
incl %ebx
jmp 0x2b63
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0x28(%rsp), %rdi
callq 0x2050
movl %ebx, %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x20b0
leaq 0x28(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./generator.hh
// Function: MPHF::Generator::generate_graph()
void generate_graph() {
      const unsigned middle = hash_value_limit/2;
      std::ifstream in(keyset_filepath);
      std::string key;
      for(unsigned i=0; std::getline(in,key); i++) {
	graph[i][0] = h[0].hash(key.c_str()) % middle;
	graph[i][1] = h[1].hash(key.c_str()) % middle + middle;
      }
      
      // sentinel value
      graph[key_count][0] = hash_value_limit+1;
      graph[key_count][1] = hash_value_limit+1;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movl 0x2c(%rdi), %ebp
shrl %ebp
movq (%rdi), %rsi
leaq 0x20(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x2230
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r12d, %r12d
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2cad
movq 0x8(%rbx), %rdi
movq (%rsp), %rsi
callq 0x2dd2
xorl %edx, %edx
divl %ebp
movq 0x10(%rbx), %rax
movl %r12d, %r13d
movl %edx, (%rax,%r13,8)
movq 0x8(%rbx), %rdi
addq $0x8, %rdi
movq (%rsp), %rsi
callq 0x2dd2
xorl %edx, %edx
divl %ebp
addl %ebp, %edx
movq 0x10(%rbx), %rax
movl %edx, 0x4(%rax,%r13,8)
incl %r12d
jmp 0x2c53
movl 0x2c(%rbx), %eax
incl %eax
movq 0x10(%rbx), %rcx
movl 0x28(%rbx), %edx
movl %eax, (%rcx,%rdx,8)
movl 0x28(%rbx), %eax
movl 0x2c(%rbx), %edx
incl %edx
movl %edx, 0x4(%rcx,%rax,8)
movq %rsp, %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x2050
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20b0
leaq 0x20(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2220
nop
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./generator.hh
// Function: MPHF::Generator::check_and_sort_graph()
bool check_and_sort_graph() {
      unsigned beg=0;
      unsigned prev=0;
      unsigned side=0;
      for(; beg < key_count; side=(side+1)%2) {
	VertexLessThan vtl(side);
	std::sort(graph+beg, graph+key_count, vtl);
	
	for(unsigned i=beg; i < key_count; i++)
	  if(graph[i][side] != graph[i+1][side])
	    std::swap(graph[beg++], graph[i]);   // leaf vertex
	  else
	    for(i++; graph[i][side] == graph[i+1][side]; i++);
	
	if(prev==beg)
	  return false;
	prev=beg;
      }
      std::reverse(graph, graph+key_count);
      return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x28(%rdi), %r14d
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x10(%rbx), %rdi
movl %r14d, %ecx
cmpl %r14d, %r15d
jae 0x2d97
movl %r15d, %eax
leaq (%rdi,%rax,8), %rax
leaq (%rdi,%rcx,8), %rsi
movq %rax, %rdi
movl %ebp, %edx
callq 0x2e44
movl %ebp, %ecx
movl %r15d, %eax
movl %r15d, %edx
movl 0x28(%rbx), %esi
cmpl %esi, %edx
jae 0x2d85
movq 0x10(%rbx), %rsi
movl %edx, %edi
leaq (%rsi,%rdi,8), %r8
movl (%r8,%rcx,4), %edi
incl %edx
cmpl 0x8(%r8,%rcx,4), %edi
jne 0x2d71
leaq (%rsi,%rcx,4), %rsi
incl %edx
cmpl (%rsi,%rdx,8), %edi
je 0x2d68
jmp 0x2d46
movl %eax, %edi
incl %eax
movq (%rsi,%rdi,8), %r9
movq (%r8), %r10
movq %r10, (%rsi,%rdi,8)
movq %r9, (%r8)
jmp 0x2d46
cmpl %eax, %r15d
je 0x2da0
notl %ebp
andl $0x1, %ebp
movl %esi, %r14d
movl %eax, %r15d
jmp 0x2d1d
leaq (%rdi,%rcx,8), %rsi
callq 0x3336
cmpl %r14d, %r15d
setae %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./hash_impl.hh
// Function: MPHF::HashImpl::hash(char const*, unsigned int) const
unsigned hash(const char* key, unsigned size) const {
      const unsigned* u = (const unsigned*)(key);
      unsigned h = param.ini;
      unsigned i = sizeof(unsigned);
      for(; i <= size; i += sizeof(unsigned), u++) 
	h = h*param.mul ^ *u + (h>>ui_size_minus8);
      
      if((i-=sizeof(unsigned)) != size)
	for(; i < size; i++)
	  h = h*param.mul ^ key[i] + (h>>ui_size_minus8);
      
      return h;
    }

// Assembly:
movl (%rdi), %eax
movl 0x4(%rdi), %ecx
xorl %edi, %edi
leal 0x4(%rdi), %r8d
cmpl %edx, %r8d
ja 0x2e1e
movl %ecx, %r8d
imull %eax, %r8d
shrl $0x18, %eax
addl (%rsi,%rdi), %eax
xorl %r8d, %eax
addq $0x4, %rdi
jmp 0x2dff
cmpl %edi, %edx
jne 0x2e23
retq
movl %edx, %edx
cmpq %rdx, %rdi
jae 0x2e22
movl %ecx, %r8d
imull %eax, %r8d
movsbl (%rsi,%rdi), %r9d
shrl $0x18, %eax
addl %r9d, %eax
xorl %r8d, %eax
incq %rdi
jmp 0x2e25
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./bit_vector.hh
// Function: MPHF::BitVector::build_rank_index()
void build_rank_index() {
      unsigned* ri = const_cast<unsigned*>(rank_index);
      unsigned limit = rank_index_size();
      unsigned acc_1bit_count=0;
      for(unsigned i=0; i < limit; i++) {
	ri[i] = acc_1bit_count;
	if(i != limit-1)
	  for(unsigned j=0; j < BR_TIMES; j++)
	    acc_1bit_count += log_count(blocks[i*BR_TIMES+j]);
      }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movl $0xff, %ecx
addl (%rdi), %ecx
shrl $0x8, %ecx
leal -0x1(%rcx), %edx
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r14d, %r14d
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
cmpq %rcx, %rbp
je 0x3704
movl %r14d, (%r15,%rbp,4)
cmpq %rdx, %rbp
je 0x36fb
xorl %r12d, %r12d
cmpq $0x8, %r12
je 0x36f1
movq 0x8(%rbx), %rax
addq %r13, %rax
movl (%rax,%r12,4), %edi
callq 0x3714
addl %eax, %r14d
incq %r12
jmp 0x36d3
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdx
incq %rbp
addq $0x20, %r13
jmp 0x36c2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sile[P]mphf/./bit_vector.hh
// Function: MPHF::BitVector::log_count(unsigned int)
static unsigned log_count(unsigned n) {
      n = ((n & 0xAAAAAAAA) >> 1) + (n & 0x55555555);
      n = ((n & 0xCCCCCCCC) >> 2) + (n & 0x33333333);
      n = ((n >> 4) + n) & 0x0F0F0F0F;
      n = (n>>8) + n;
      return ((n>>16) + n) & 0x3F;
    }

// Assembly:
movl %edi, %eax
shrl %eax
movl $0x55555555, %ecx       # imm = 0x55555555
andl %ecx, %eax
andl %ecx, %edi
addl %eax, %edi
movl %edi, %eax
shrl $0x2, %eax
movl $0x33333333, %ecx       # imm = 0x33333333
andl %ecx, %eax
andl %ecx, %edi
addl %eax, %edi
movl %edi, %eax
shrl $0x4, %eax
addl %edi, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
movl %eax, %ecx
shrl $0x8, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
addl %ecx, %eax
movzbl %al, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/lib/dag.cpp
// Function: Graph::get_sources_and_sinks(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&) const
void Graph::get_sources_and_sinks(ivec& sources, ivec& sinks) const {
    for(int u=0; u<n; ++u) {
        if(_preds[u].empty()) {
            sources.push_back(u);
        }
        if(_succs[u].empty()) {
            sinks.push_back(u);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
leaq 0x4(%rsp), %r12
movl %eax, 0x4(%rsp)
cmpl (%r15), %eax
jge 0x12fb
movslq %eax, %rcx
movq 0x8(%r15), %rdx
imulq $0x18, %rcx, %rsi
movq (%rdx,%rsi), %rdi
cmpq 0x8(%rdx,%rsi), %rdi
jne 0x12d5
movq %r14, %rdi
movq %r12, %rsi
callq 0x14be
movl 0x4(%rsp), %eax
movslq %eax, %rcx
movq 0x20(%r15), %rdx
imulq $0x18, %rcx, %rcx
movq (%rdx,%rcx), %rsi
cmpq 0x8(%rdx,%rcx), %rsi
jne 0x12f7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x14be
movl 0x4(%rsp), %eax
incl %eax
jmp 0x12a4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/lib/dag.cpp
// Function: Graph::print(_IO_FILE*) const
void Graph::print(FILE* fp) const {
    for(int u=0; u<n; ++u) {
        fprintf(fp, "%d: ", u);
        print_icont(fp, _succs[u], ", ", "[", "] ");
        print_icont(fp, _preds[u], ", ", "[", "]\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xce9(%rip), %r12       # 0x2009
leaq 0xce5(%rip), %r13       # 0x200c
xorl %r15d, %r15d
xorl %ebp, %ebp
movslq (%r14), %rax
cmpq %rax, %rbp
jge 0x1388
movq %rbx, %rdi
leaq 0xcc6(%rip), %rsi       # 0x2004
movl %ebp, %edx
xorl %eax, %eax
callq 0x1100
movq 0x20(%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
leaq 0xcb0(%rip), %r8        # 0x200e
callq 0x14dc
movq 0x8(%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %r13, %rcx
leaq 0xc97(%rip), %r8        # 0x2011
callq 0x14dc
incq %rbp
addq $0x18, %r15
jmp 0x132c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/lib/dag.cpp
// Function: DFSHelper::do_dfs(int)
void DFSHelper::do_dfs(int u) {
    if(visited[u]) {
        return;
    }
    visited[u] = true;
    for(int v: graph.succs(u)) {
        if(!visited[v]) {
            do_dfs(v);
        }
    }
    topolist.push_back(u);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
leaq 0x8(%rdi), %r14
movslq %esi, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x156a
testq %rdx, (%rax)
jne 0x141a
movq %r14, %rdi
movq %r15, %rsi
callq 0x156a
orq %rdx, (%rax)
movq (%rbx), %rax
movq 0x20(%rax), %rax
imulq $0x18, %r15, %rcx
movq (%rax,%rcx), %r15
movq 0x8(%rax,%rcx), %r12
cmpq %r12, %r15
je 0x140c
movl (%r15), %ebp
movslq %ebp, %rsi
movq %r14, %rdi
callq 0x156a
testq %rdx, (%rax)
jne 0x1406
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1398
addq $0x4, %r15
jmp 0x13e4
movq 0x30(%rbx), %rdi
leaq 0xc(%rsp), %rsi
callq 0x14be
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/lib/dag.cpp
// Function: rtoposort(Graph const&, std::vector<int, std::allocator<int>>&)
void rtoposort(const Graph& graph, ivec& output) {
    int n = graph.order();
    output.reserve(n);
    DFSHelper dfs_helper(graph, output);
    for(int u=0; u<n; ++u) {
        dfs_helper.do_dfs(u);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %r15
movslq (%rdi), %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x1588
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1618
xorl %ebp, %ebp
testl %r12d, %r12d
movl $0x0, %r14d
cmovgl %r12d, %r14d
cmpl %ebp, %r14d
je 0x147c
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1398
incl %ebp
jmp 0x1469
leaq 0x10(%rsp), %rdi
callq 0x17d4
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x17d4
movq %rbx, %rdi
callq 0x1130
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/lib/util.hpp
// Function: void print_icont<std::vector<int, std::allocator<int>>>(_IO_FILE*, std::vector<int, std::allocator<int>> const&, char const*, char const*, char const*)
void print_icont(FILE* fp, const C& c, const char* sep, const char* begs, const char* ends) {
    fprintf(fp, "%s", begs);
    int n = c.size();
    if(n > 0) {
        typename C::const_iterator it = c.begin();
        fprintf(fp, "%d", *(it++));
        while(it != c.end()) {
            fprintf(fp, "%s%d", sep, *(it++));
        }
    }
    fprintf(fp, "%s", ends);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rcx, %rdi
movq %r14, %rsi
callq 0x10d0
movq (%r12), %rbp
movq 0x8(%r12), %rax
subq %rbp, %rax
shrq $0x2, %rax
testl %eax, %eax
jle 0x1551
movl (%rbp), %edx
leaq 0xb2d(%rip), %rsi       # 0x2049
movq %r14, %rdi
xorl %eax, %eax
callq 0x1100
addq $0x4, %rbp
leaq 0xafd(%rip), %r13       # 0x202e
cmpq 0x8(%r12), %rbp
je 0x1551
movl (%rbp), %ecx
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1100
addq $0x4, %rbp
jmp 0x1531
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
// File: /workspace/github_cpp_makefile_star2_O2/sharmaeklavya2[P]ddos-on-anycast/src/dag.cpp
// Function: main
int main() {
    int n, m;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
    scanf("%d%d", &n, &m);
#pragma GCC diagnostic pop
    Graph graph(n);
    for(int i=0; i<m; ++i) {
        int u, v;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
        scanf("%d%d", &u, &v);
#pragma GCC diagnostic pop
        graph.add_edge(u, v);
    }
    ivec topolist;
    toposort(graph, topolist);
    printf("%d", topolist[0]);
    for(int i=1; i<n; ++i) {
        printf(" %d", topolist[i]);
    }
    printf("\n");
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
leaq 0x6dc(%rip), %rbx       # 0x2043
leaq 0xc(%rsp), %r14
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x10e0
movl (%r14), %esi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x1a70
leaq 0x10(%rsp), %r15
leaq 0x4(%rsp), %r12
xorl %ebp, %ebp
cmpl 0x8(%rsp), %ebp
jge 0x19c4
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10e0
movl 0x10(%rsp), %esi
movl 0x4(%rsp), %edx
movq %r14, %rdi
callq 0x1ac6
incl %ebp
jmp 0x199a
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
leaq 0x28(%rsp), %rdi
callq 0x14a8
movq 0x10(%rsp), %rax
movl (%rax), %esi
leaq 0x65d(%rip), %rdi       # 0x2049
xorl %eax, %eax
callq 0x1030
pushq $0x1
popq %r14
leaq 0x64a(%rip), %rbx       # 0x2048
movslq 0xc(%rsp), %rax
cmpq %rax, %r14
jge 0x1a20
movq 0x10(%rsp), %rax
movl (%rax,%r14,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
incq %r14
jmp 0x19fe
pushq $0xa
popq %rdi
callq 0x10f0
leaq 0x10(%rsp), %rdi
callq 0x1c94
leaq 0x28(%rsp), %rdi
callq 0x1b12
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1c94
jmp 0x1a5d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1b12
movq %rbx, %rdi
callq 0x1130
nop
// File: /workspace/github_cpp_makefile_star2_O2/thuydx55[P]C-Number-to-Word/main.cpp
// Function: main
int main(int argc, char const *argv[])
{
    if ( argc != 2 ) // argc should be 2 for correct execution
        // We print argv[0] assuming it is the program name
        cout << "usage: "<< argv[0] <<" <number string>\n";
    else {
        string numStr = argv[1];

        Number num(numStr);
        if (!num.isValid()) {
            cout << "'" << numStr << "' is not a number!" << endl;
            return 1;
        }

        cout << num.getTextRepresentation() << endl;
    }

    return 0;
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
cmpl $0x2, %edi
jne 0x31c6
movq 0x8(%rbx), %rsi
leaq 0x60(%rsp), %rbx
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x3294
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x2170
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
callq 0x3368
leaq 0x40(%rsp), %rdi
callq 0x2218
movq %rsp, %rdi
callq 0x33a6
movl %eax, %ebx
testb %al, %al
je 0x31f5
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x33d8
movq 0x4e30(%rip), %rdi      # 0x7fd8
leaq 0x20(%rsp), %rsi
callq 0x20f0
movq %rax, %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x2218
jmp 0x322c
movq 0x4e0b(%rip), %rdi      # 0x7fd8
leaq 0x1e30(%rip), %rsi      # 0x5004
callq 0x2100
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2100
leaq 0x1e21(%rip), %rsi      # 0x500c
movq %rax, %rdi
callq 0x2100
jmp 0x3242
movq 0x4ddc(%rip), %rdi      # 0x7fd8
leaq 0x1e1b(%rip), %rsi      # 0x501e
callq 0x2100
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x1e04(%rip), %rsi      # 0x5020
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2080
movq %rsp, %rdi
callq 0x33a0
leaq 0x60(%rsp), %rdi
callq 0x2218
testb %bl, %bl
je 0x3246
xorl %eax, %eax
jmp 0x3249
pushq $0x1
popq %rax
addq $0x80, %rsp
popq %rbx
retq
jmp 0x3277
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2218
jmp 0x327a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2218
jmp 0x3282
movq %rax, %rbx
jmp 0x3282
movq %rax, %rbx
movq %rsp, %rdi
callq 0x33a0
leaq 0x60(%rsp), %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/thuydx55[P]C-Number-to-Word/NumberRepresentation/Number.cpp
// Function: Number::divideStringToBigGroup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
stack<string> Number::divideStringToBigGroup(const string &numStr) {
    stack<string> groups;

    short length = 12;
    for (short i = numStr.length()-1; i >= 0;) {
        string str = "";
        if (i >= length-1) {
            str = numStr.substr(i-(length-1), length);
            i -= length;
            length = 9;
        }
        else {
            str = numStr.substr(0, i+1);
            i -= length;
        }

        if (str.length() < 12 && groups.size() > 0)
            str = str + "000";
        groups.push(str);
    }

    return groups;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3d56
movq %r14, (%rsp)
movl 0x8(%r14), %r15d
decl %r15d
movw $0xc, %r14w
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
movswl %r15w, %r15d
testl %r15d, %r15d
js 0x3a74
movq %r12, %rdi
leaq 0x1665(%rip), %rsi      # 0x501d
movq %r13, %rdx
callq 0x3294
movzwl %r14w, %ebp
leal -0x1(%rbp), %ecx
movl %r15d, %eax
subl %ecx, %eax
jge 0x39f5
leal 0x1(%r15), %ecx
movq %r13, %rdi
movq (%rsp), %rsi
xorl %edx, %edx
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
movq %r13, %rdi
callq 0x2218
jmp 0x3a1f
movslq %eax, %rdx
movq %r13, %rdi
movq (%rsp), %rsi
movq %rbp, %rcx
callq 0x2130
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
movq %r13, %rdi
callq 0x2218
movw $0x9, %r14w
cmpq $0xb, 0x10(%rsp)
ja 0x3a59
movq %rbx, %rdi
callq 0x42cc
testq %rax, %rax
je 0x3a59
movq %r13, %rdi
movq %r12, %rsi
leaq 0x161c(%rip), %rdx      # 0x505d
callq 0x3d1e
movq %r12, %rdi
movq %r13, %rsi
callq 0x2150
movq %r13, %rdi
callq 0x2218
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4546
subl %ebp, %r15d
movq %r12, %rdi
callq 0x2218
jmp 0x39a1
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a91
jmp 0x3a91
jmp 0x3a91
movq %rax, %r14
jmp 0x3a9e
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x3d72
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/thuydx55[P]C-Number-to-Word/NumberRepresentation/Number.cpp
// Function: Number::divideStringToSmallGroup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
stack<string> Number::divideStringToSmallGroup(const string &numStr) {
    stack<string> groups;

    for (short i = numStr.length()-1; i >= 0; i -= 3) {
        if (i >= 2)
            groups.push(numStr.substr(i-2, 3));
        else
            groups.push(numStr.substr(0, i+1));
    }

    return groups;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3d56
movl 0x8(%r14), %r13d
decl %r13d
movq %rsp, %r15
pushq $0x3
popq %r12
movswl %r13w, %r13d
testl %r13d, %r13d
js 0x3b2c
cmpl $0x2, %r13d
jb 0x3b02
leal -0x2(%r13), %edx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x2130
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4774
jmp 0x3b1e
leal 0x1(%r13), %ecx
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2130
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4774
movq %r15, %rdi
callq 0x2218
addl $-0x3, %r13d
jmp 0x3ad4
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x3b46
jmp 0x3b41
movq %rax, %r14
jmp 0x3b51
movq %rax, %r14
movq %rsp, %rdi
callq 0x2218
movq %rbx, %rdi
callq 0x3d72
movq %r14, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/mpegts_demux.cpp
// Function: main
int main(int argc, char *argv[])
{
    print_banner(cout);

    /// CMD LINE OPTIONS
    const char  *filename = NULL;
    bool info = false;
    switch(argc) {
        case 2:
            filename = argv[1];
            break;
        case 3:
            if (strncmp(argv[1], "-i", 3) == 0) {
                info = true;
                filename = argv[2];
                break;
            }
            // fall through
        default:
            print_usage(cerr);
            return -1;
    }

    MpegTsBitStream bitStream(filename);
    MpegTsDemuxer demuxer(info);
    Packet packet;

    while (bitStream.good() && bitStream.GetPacket(packet)) {
        if (!demuxer.DecodePacket(packet))
            break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rsi, %rbx
movl %edi, %ebp
movq 0x5c3b(%rip), %rdi      # 0x7fd0
leaq 0x2c68(%rip), %rsi      # 0x5004
callq 0x2110
movq %rax, %rdi
callq 0x2080
cmpl $0x2, %ebp
je 0x2466
cmpl $0x3, %ebp
jne 0x23d0
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x23d0
cmpb $0x69, 0x1(%rax)
jne 0x23d0
cmpb $0x0, 0x2(%rax)
je 0x24e9
movq 0x5c19(%rip), %rbx      # 0x7ff0
leaq 0x2c38(%rip), %rsi      # 0x5016
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x2c45(%rip), %rsi      # 0x503a
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x2c6f(%rip), %rsi      # 0x507b
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x2c9d(%rip), %rsi      # 0x50c0
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x2c8f(%rip), %rsi      # 0x50c9
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x2ca4(%rip), %rsi      # 0x50f5
movq %rbx, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
pushq $-0x1
popq %rax
jmp 0x24db
pushq $0x8
popq %rax
xorl %ebp, %ebp
movq (%rbx,%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x2518
movzbl %bpl, %esi
leaq 0x18(%rsp), %rdi
callq 0x2822
leaq 0x8(%rsp), %rbx
leaq 0xbc(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpb $0x0, 0x10(%rsp)
jne 0x24c5
testb $0x1, 0x11(%rsp)
jne 0x24c5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25bc
testb %al, %al
je 0x24c5
movq %r15, %rdi
movq %r14, %rsi
callq 0x295e
testb %al, %al
jne 0x2499
leaq 0x18(%rsp), %rdi
callq 0x28f8
leaq 0x8(%rsp), %rdi
callq 0x25ae
xorl %eax, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %bpl
pushq $0x10
popq %rax
jmp 0x246b
movq %rax, %rbx
jmp 0x2506
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x28f8
leaq 0x8(%rsp), %rdi
callq 0x25ae
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsBitStream.cpp
// Function: MpegTsBitStream::MpegTsBitStream(char const*)
MpegTsBitStream::MpegTsBitStream(const char * filename) : m_file(NULL), m_eof(false), m_bad(true)
{
    assert(filename != NULL);

    m_file = fopen(filename, "rb");
    if (!m_file) {
        cerr << "[ERROR]: can't open file \'" << filename << "\'" << endl;
    } else {
        m_bad = false;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, (%rdi)
movw $0x100, 0x8(%rdi)       # imm = 0x100
testq %rsi, %rsi
je 0x2591
movq %rdi, %r14
movq %rsi, %rbx
leaq 0x2c32(%rip), %rsi      # 0x516a
movq %rbx, %rdi
callq 0x2160
movq %rax, (%r14)
testq %rax, %rax
je 0x2555
movb $0x0, 0x9(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x5a94(%rip), %rdi      # 0x7ff0
leaq 0x2c0a(%rip), %rsi      # 0x516d
callq 0x2110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2110
leaq 0x2cbc(%rip), %rsi      # 0x5236
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2080
leaq 0x2b7e(%rip), %rdi      # 0x5116
leaq 0x2b88(%rip), %rsi      # 0x5127
leaq 0x2b95(%rip), %rcx      # 0x513b
pushq $0x9
popq %rdx
callq 0x2090
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsBitStream.cpp
// Function: MpegTsBitStream::GetPacket(Packet&)
bool MpegTsBitStream::GetPacket(Packet& packet)
{
    // Fast exit
    if (!m_file || !good()) return false;

    Packet::iterator p = packet.begin();

    size_t count = 1;
    int C = fgetc(m_file);

    if (C == EOF) {
        /// No More packets in stream
        m_eof = true;
        return false;
    }

    uint8_t c = static_cast<uint8_t> (C);
    if (c != MPEGTS_SYNC_BYTE) {
        cerr << "[ERROR]: Sync byte not found." << endl;
        m_bad = true;
        return false;
    }

    *p++ = c;
    while (p != packet.end()) {
        C = fgetc(m_file);
        if (C == EOF) {
            m_eof = true;
            break;
        }
        c = static_cast<uint8_t> (C);
        *p++ = c;
        ++count;
    }

    if (count != PACKET_SIZE) {
        cerr << "[ERROR]: Expected " << PACKET_SIZE << " bytes, found " << count << endl;
        m_bad = true;
        return false;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x263c
xorl %ebp, %ebp
cmpb $0x0, 0x8(%rbx)
jne 0x263e
testb $0x1, 0x9(%rbx)
jne 0x263e
movq %rsi, %r14
callq 0x21a0
cmpl $-0x1, %eax
je 0x2617
cmpb $0x47, %al
jne 0x261d
movb $0x47, (%r14)
pushq $0x1
popq %r15
movb $0x1, %bpl
cmpq $0xbc, %r15
je 0x263e
movq (%rbx), %rdi
callq 0x21a0
cmpl $-0x1, %eax
je 0x264b
movb %al, (%r14,%r15)
incq %r15
jmp 0x25f5
movb $0x1, 0x8(%rbx)
jmp 0x263c
movq 0x59cc(%rip), %rdi      # 0x7ff0
leaq 0x2b5d(%rip), %rsi      # 0x5188
callq 0x2110
movq %rax, %rdi
callq 0x2080
movb $0x1, 0x9(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x8(%rbx)
cmpq $0xbc, %r15
je 0x263e
movq 0x5991(%rip), %rdi      # 0x7ff0
leaq 0x2b40(%rip), %rsi      # 0x51a6
callq 0x2110
movq %rax, %rdi
movl $0xbc, %esi
callq 0x21e0
leaq 0x2b3a(%rip), %rsi      # 0x51b9
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
movq %r15, %rsi
callq 0x20a0
jmp 0x2630
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsDemux.cpp
// Function: Stream::Stream(char const*, unsigned short, unsigned short)
Stream::Stream(const char *filename, PID id, PID pid)
    : m_file(NULL), m_id(id), m_pid(pid)
{
    assert(filename != NULL);
    m_file = fopen(filename, "wb");
    if (!m_file) {
        cerr << "[ERROR]: STREAM=" << m_id << " PID=" << m_pid << " : can't open file \'" << filename << "\'" << endl;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, (%rdi)
movw %dx, 0x8(%rdi)
movw %cx, 0xa(%rdi)
testq %rsi, %rsi
je 0x2746
movq %rdi, %r14
movq %rsi, %rbx
leaq 0x2b55(%rip), %rsi      # 0x520f
movq %rbx, %rdi
callq 0x2160
movq %rax, (%r14)
testq %rax, %rax
je 0x26d2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x5917(%rip), %rdi      # 0x7ff0
leaq 0x2b32(%rip), %rsi      # 0x5212
callq 0x2110
movzwl 0x8(%r14), %esi
movq %rax, %rdi
callq 0x21d0
leaq 0x2b58(%rip), %rsi      # 0x5251
movq %rax, %rdi
callq 0x2110
movzwl 0xa(%r14), %esi
movq %rax, %rdi
callq 0x21d0
leaq 0x2b0e(%rip), %rsi      # 0x5223
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2110
leaq 0x2b07(%rip), %rsi      # 0x5236
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2080
leaq 0x29c9(%rip), %rdi      # 0x5116
leaq 0x2a84(%rip), %rsi      # 0x51d8
leaq 0x2a8d(%rip), %rcx      # 0x51e8
pushq $0x1d
popq %rdx
callq 0x2090
nop
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsDemux.cpp
// Function: Stream::Write(unsigned char const*, unsigned char const*)
void Stream::Write(Packet::const_iterator b, Packet::const_iterator e)
{
    if (!m_file) return; // Failed to create stream. Exit quietly

    while (b != e) {
        int r = fputc(*b++, m_file);
        if (r == EOF) {
            cerr << "[ERROR]: STREAM=" << m_id << " PID=" << m_pid << " Write failed." << endl;
            fclose(m_file);
            m_file = NULL;
        }
    }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x2821
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2a7b(%rip), %r13      # 0x5212
leaq 0x2ab3(%rip), %rbp      # 0x5251
leaq 0x2a93(%rip), %r12      # 0x5238
cmpq %rbx, %r14
je 0x2813
movzbl (%r14), %edi
incq %r14
movq (%r15), %rsi
callq 0x2170
cmpl $-0x1, %eax
jne 0x27a5
movq 0x582b(%rip), %rdi      # 0x7ff0
movq %r13, %rsi
callq 0x2110
movzwl 0x8(%r15), %esi
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2110
movzwl 0xa(%r15), %esi
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movq (%r15), %rdi
callq 0x2120
andq $0x0, (%r15)
jmp 0x27a5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsDemux.cpp
// Function: MpegTsDemuxer::DecodePacket(Packet const&)
bool MpegTsDemuxer::DecodePacket(const Packet& packet)
{
    ++m_pnum;

    Packet::const_iterator p = packet.begin(), e = packet.end();
    PacketHeader header;
    if (!ReadHeader(p, e, header))
        return false;

    PID &id = header.id;
    //cout << "DecodePacket: PID=" << id << endl;

    // Lookup this ID in our filters
    Filters::iterator f = m_filters.find(id);
    if (f != m_filters.end()) {
        DemuxerEvents E = (*f).second;
        switch (E) {
        case DEMUXER_EVENT_NIL:
            // NULL PACKET
            //cout << "[INFO]: PKT#" << m_pnum << " Null packet." << endl;
            return true;
        case DEMUXER_EVENT_PAT:
            if (!ReadPAT(p, e))
                return false;
            break;
        case DEMUXER_EVENT_PMT:
            if (!ReadPMT(p, e))
                return false;
            break;
        case DEMUXER_EVENT_PES:
            if (!ReadPES(p, e, header, id))
                return false;
            break;
        default:
            cout << "[WARNING]: PID=" << id << " filtered but not handled." << endl;
            break;
        }
    } else {
        // Check if orphaned PES with no program.
        if (CheckPES(p, e, header)) {
            if (!ReadPES(p, e, header, id))
                return false;
        }
    }
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
incq 0x90(%rdi)
movq %rsi, %rbx
movq %rsp, %rsi
movq %rbx, (%rsi)
leaq 0xe(%rsp), %rcx
callq 0x2a60
testb %al, %al
je 0x2a1a
addq $0xbc, %rbx
leaq 0x12(%rsp), %rsi
leaq 0x60(%r14), %rdi
callq 0x3e16
leaq 0x68(%r14), %rcx
cmpq %rcx, %rax
je 0x29d2
movl 0x24(%rax), %eax
decl %eax
cmpl $0x3, %eax
ja 0x2a1e
leaq 0x280f(%rip), %rcx      # 0x51c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2dd8
jmp 0x2a16
cmpb $0x1, 0xf(%rsp)
jne 0x2a55
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x2a55
cmpb $0x0, 0x1(%rax)
jne 0x2a55
cmpb $0x1, 0x2(%rax)
jne 0x2a55
leaq 0xe(%rsp), %rcx
movzwl 0x4(%rcx), %r8d
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x31bc
jmp 0x2a16
movq %rsp, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2b4e
testb %al, %al
jne 0x2a55
xorl %eax, %eax
jmp 0x2a57
movq 0x55ab(%rip), %rdi      # 0x7fd0
leaq 0x281b(%rip), %rsi      # 0x5247
callq 0x2110
movzwl 0x12(%rsp), %esi
movq %rax, %rdi
callq 0x21d0
leaq 0x2812(%rip), %rsi      # 0x5257
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsDemux.cpp
// Function: MpegTsDemuxer::ReadHeader(unsigned char const*&, unsigned char const*, PacketHeader&)
bool MpegTsDemuxer::ReadHeader(Packet::const_iterator &p, Packet::const_iterator e, PacketHeader& header)
{
    if (*p != MPEGTS_SYNC_BYTE) {
        cerr << "[ERROR]: PKT#" << m_pnum << " Sync byte not found." << endl;
        return false;
    }
    p++;

    header.tei = static_cast<bool> (*p&0x80);
    header.pusi = static_cast<bool> (*p&0x40);
    header.tp = static_cast<bool> (*p&0x20);

    header.id = PID((p[0]&0x1F)<<8) | PID(p[1]);
    p += 2;

    header.afc = (((*p&0x30)>>4) == 0x2) || (((*p&0x30)>>4) == 0x3);
    header.payload = (((*p&0x30)>>4) == 0x1) || (((*p&0x30)>>4) == 0x3);
    header.cc = *p&0xF;
    p++;

    // Greedy, just escape the adaptation control field
    if (header.afc) {
        const uint8_t l = *p++;
        p += l;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq (%rsi), %rax
movb (%rax), %bpl
cmpb $0x47, %bpl
jne 0x2b04
leaq 0x1(%rax), %rdx
movq %rdx, (%rsi)
movb 0x1(%rax), %dl
shrb $0x7, %dl
movb %dl, (%rcx)
movb 0x1(%rax), %dl
shrb $0x6, %dl
andb $0x1, %dl
movb %dl, 0x1(%rcx)
movb 0x1(%rax), %dl
shrb $0x5, %dl
andb $0x1, %dl
movb %dl, 0x2(%rcx)
movzbl 0x1(%rax), %edx
andl $0x1f, %edx
shll $0x8, %edx
movzbl 0x2(%rax), %edi
orl %edx, %edi
movw %di, 0x4(%rcx)
leaq 0x3(%rax), %rdx
movq %rdx, (%rsi)
movb 0x3(%rax), %dl
shrb $0x5, %dl
movl %edx, %edi
andb $0x1, %dil
movb %dil, 0x6(%rcx)
movb 0x3(%rax), %dil
shrb $0x4, %dil
andb $0x1, %dil
movb %dil, 0x7(%rcx)
movb 0x3(%rax), %dil
andb $0xf, %dil
leaq 0x4(%rax), %r8
movb %dil, 0x8(%rcx)
movq %r8, (%rsi)
andb $0x1, %dl
je 0x2b40
leaq 0x5(%rax), %rcx
movq %rcx, (%rsi)
movzbl 0x4(%rax), %ecx
addq %rcx, %rax
addq $0x5, %rax
movq %rax, (%rsi)
jmp 0x2b40
movq %rdi, %rbx
movq 0x54e2(%rip), %rdi      # 0x7ff0
leaq 0x275d(%rip), %rsi      # 0x5272
callq 0x2110
movq 0x90(%rbx), %rsi
movq %rax, %rdi
callq 0x20a0
leaq 0x2660(%rip), %rsi      # 0x5190
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
cmpb $0x47, %bpl
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mmoanis[P]mpegts_demux/MpegTsDemux.cpp
// Function: MpegTsDemuxer::ReadSection(unsigned char const*&, unsigned char const*, PacketSection&)
bool MpegTsDemuxer::ReadSection(Packet::const_iterator &p, Packet::const_iterator e, PacketSection& section)
{
    if (p + 4 >= e) {
        cerr << "[ERROR]: PKT#" << m_pnum << " not enough data in PSI section." << endl;
        return false;
    }

    section.id = uint16_t(p[0]<<8) | uint16_t(p[1]);
    p+= 2;

    if (((*p&0xC0)>>6) != 0x03) {
        cerr << "[ERROR]: PKT#" << m_pnum <<" Section reserved bits not set." << endl;
        return false;
    }
    section.version = (*p&0x3E)>>1;
    section.cni = static_cast<bool> (*p++&0x1);

    section.sn = *p++;
    section.lsn = *p++;
    return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rax
leaq 0x4(%rax), %rdi
cmpq %rdx, %rdi
jae 0x3485
movzwl (%rax), %edx
rolw $0x8, %dx
movw %dx, (%rcx)
leaq 0x2(%rax), %rdx
movq %rdx, (%rsi)
movb 0x2(%rax), %dl
cmpb $-0x41, %dl
jbe 0x34b0
shrb %dl
andb $0x1f, %dl
movb %dl, 0x2(%rcx)
leaq 0x3(%rax), %rdx
movq %rdx, (%rsi)
movb 0x2(%rax), %dl
andb $0x1, %dl
movb %dl, 0x3(%rcx)
movq %rdi, (%rsi)
movb 0x3(%rax), %dl
movb %dl, 0x4(%rcx)
leaq 0x5(%rax), %rdx
movq %rdx, (%rsi)
movb 0x4(%rax), %al
movb %al, 0x5(%rcx)
movb $0x1, %al
jmp 0x34eb
movq 0x4b64(%rip), %rdi      # 0x7ff0
leaq 0x1ddf(%rip), %rsi      # 0x5272
callq 0x2110
movq 0x90(%rbx), %rsi
movq %rax, %rdi
callq 0x20a0
leaq 0x208c(%rip), %rsi      # 0x553a
jmp 0x34d9
movq 0x4b39(%rip), %rdi      # 0x7ff0
leaq 0x1db4(%rip), %rsi      # 0x5272
callq 0x2110
movq 0x90(%rbx), %rsi
movq %rax, %rdi
callq 0x20a0
leaq 0x2082(%rip), %rsi      # 0x555b
movq %rax, %rdi
callq 0x2110
movq %rax, %rdi
callq 0x2080
xorl %eax, %eax
popq %rbx
retq
nop