LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexMesh::AddTri(StringRef const&, LightMapVertex const&, LightMapVertex const&, LightMapVertex const&)
void VertexMesh::AddTri(const StringRef &name,const LightMapVertex &v1,const LightMapVertex &v2,const LightMapVertex &v3)
{
  VertexSection *section;

  if ( name == mLastName )
  {
    section = mLastSection;
  }
  else
  {
    VertexSectionMap::iterator found;
    found = mSections.find( name );
    if ( found != mSections.end() )
    {
      section = mLastSection = (*found).second;
      mLastName = name;
    }
    else
    {
      mLastSection = section = new VertexSection( name );
      mSections[name] = section;
      mLastName = name;
    }
  }

  assert( section );

  section->AddTri( v1, v2, v3 );

  mBound.MinMax( v1.mPos );
  mBound.MinMax( v2.mPos );
  mBound.MinMax( v3.mPos );

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, -0x40(%rbp)
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r14
movq (%rsi), %rbx
cmpq %rbx, 0x8(%rdi)
je 0xedd5
movq 0x20(%r14), %rcx
testq %rcx, %rcx
je 0xed48
leaq 0x18(%r14), %rdx
movq %rdx, %rax
xorl %edi, %edi
cmpq 0x20(%rcx), %rbx
setb %dil
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0xed21
cmpq %rdx, %rax
je 0xed48
cmpq %rbx, 0x20(%rax)
jae 0xedda
leaq 0x10(%r14), %rax
movq %rax, -0x38(%rbp)
movl $0x88, %edi
movq %rsi, -0x30(%rbp)
callq 0x2220
movq %rax, %r13
addq $0x40, %rax
movl $0x0, 0x40(%r13)
xorl %ecx, %ecx
movq %rcx, 0x48(%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movq %rcx, 0x30(%r13)
movq %rax, 0x50(%r13)
movq %rax, 0x58(%r13)
movups %xmm0, 0x60(%r13)
movups %xmm0, 0x70(%r13)
movq %rbx, (%r13)
movq %rcx, 0x80(%r13)
movaps 0x3e3d(%rip), %xmm0     # 0x12be0
movups %xmm0, 0x8(%r13)
movabsq $-0x319194d7319194d8, %rax # imm = 0xCE6E6B28CE6E6B28
movq %rax, 0x18(%r13)
movq %r13, (%r14)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x108da
movq %r13, (%rax)
movq (%rbx), %rax
movq %rax, 0x8(%r14)
jmp 0xedea
movq (%r14), %r13
jmp 0xede5
movq 0x28(%rax), %r13
movq %r13, (%r14)
movq %rbx, 0x8(%r14)
testq %r13, %r13
je 0xee5c
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq -0x40(%rbp), %rbx
movq %rbx, %rcx
callq 0xee7c
addq $0x40, %r14
movss (%r12), %xmm0
movss 0x4(%r12), %xmm1
movss 0x8(%r12), %xmm2
movq %r14, %rdi
callq 0xb75a
movss (%r15), %xmm0
movss 0x4(%r15), %xmm1
movss 0x8(%r15), %xmm2
movq %r14, %rdi
callq 0xb75a
movss (%rbx), %xmm0
movss 0x4(%rbx), %xmm1
movss 0x8(%rbx), %xmm2
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb75a
leaq 0x4968(%rip), %rdi      # 0x137cb
leaq 0x4969(%rip), %rsi      # 0x137d3
leaq 0x496e(%rip), %rcx      # 0x137df
movl $0xb8, %edx
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexSection::AddTri(LightMapVertex const&, LightMapVertex const&, LightMapVertex const&)
void VertexSection::AddTri(const LightMapVertex &v1,
            const LightMapVertex &v2,
            const LightMapVertex &v3)
{
  mBound.MinMax(v1.mPos);
  mBound.MinMax(v2.mPos);
  mBound.MinMax(v3.mPos);

  AddPoint(v1);
  AddPoint(v2);
  AddPoint(v3);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
leaq 0x8(%rdi), %r13
movss (%rsi), %xmm0
movss 0x4(%rsi), %xmm1
movss 0x8(%rsi), %xmm2
movq %r13, %rdi
callq 0xb75a
movss (%r15), %xmm0
movss 0x4(%r15), %xmm1
movss 0x8(%r15), %xmm2
movq %r13, %rdi
callq 0xb75a
movss (%rbx), %xmm0
movss 0x4(%rbx), %xmm1
movss 0x8(%rbx), %xmm2
movq %r13, %rdi
callq 0xb75a
movq %r14, %rdi
movq %r12, %rsi
callq 0xef0e
movq %r14, %rdi
movq %r15, %rsi
callq 0xef0e
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xef0e
// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexMesh::SaveVRML2(_IO_FILE*, VFormatOptions&) const
void VertexMesh::SaveVRML2(
			FILE *fph,
            VFormatOptions &options) const 
{
	if ( mSections.size() )
	{
		
		if ( fph )
		{
			//fprintf(fph,"#VRML V2.0 utf8 generated by QBSP \n");
			if (mSections.size() >0) {
				fprintf(fph,"Group {\n");
				fprintf(fph,"children [\n");
			}	
			VertexSectionMap::const_iterator i;
			
			for (i=mSections.begin(); i!=mSections.end(); ++i)
			{
				(*i).second->SaveVRML2(fph,options);
			}
			if (mSections.size() >0) {
				
				fprintf(fph,"\n]\n}\n");
			}
			
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xf00a
movq %rdi, %r15
cmpq $0x0, 0x38(%rdi)
je 0xf00a
movq %rdx, %r14
movq %rsi, %rbx
leaq 0x41d6(%rip), %rdi      # 0x1315a
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2410
leaq 0x41c6(%rip), %rdi      # 0x13163
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2410
movq 0x28(%r15), %r12
leaq 0x18(%r15), %r13
cmpq %r13, %r12
je 0xefdc
movq 0x28(%r12), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xf01a
movq %r12, %rdi
callq 0x2290
movq %rax, %r12
cmpq %r13, %rax
jne 0xefbc
cmpq $0x0, 0x38(%r15)
je 0xf00a
leaq 0x4868(%rip), %rdi      # 0x13852
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2410
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/vformat.cpp
// Function: VertexMesh::SaveVRML(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) const
void VertexMesh::SaveVRML(const String &name,  // base file name
              bool tex1) const           // texture channel 1=(true)
{
  if ( mSections.size() )
  {
    String oname = name+".wrl";
    FILE *fph = fopen(oname.c_str(),"wb");

    if ( fph )
    {
      fprintf(fph,"#VRML V1.0 ascii\n");
      fprintf(fph,"Separator {\n");
      fprintf(fph,"  ShapeHints {\n");
      fprintf(fph,"    shapeType SOLID\n");
      fprintf(fph,"    vertexOrdering COUNTERCLOCKWISE\n");
      fprintf(fph,"    faceType CONVEX\n");
      fprintf(fph,"  }\n");

      VertexSectionMap::const_iterator i;

      for (i=mSections.begin(); i!=mSections.end(); ++i)
      {
        (*i).second->SaveVRML(fph,tex1);
      }

      fprintf(fph,"}\n");

      fclose(fph);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpq $0x0, 0x38(%rdi)
je 0xfca6
movl %edx, %r14d
movq %rdi, %rbx
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x6cba
leaq 0x29d4(%rip), %rsi      # 0x12540
movq %r15, %rdi
callq 0x2400
movq -0x48(%rbp), %rdi
leaq 0x2745(%rip), %rsi      # 0x122c4
callq 0x22a0
testq %rax, %rax
je 0xfc91
movq %rax, %r15
leaq 0x3cc1(%rip), %rdi      # 0x13858
movl $0x11, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x2410
leaq 0x3d24(%rip), %rdi      # 0x138d4
movl $0xc, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
leaq 0x3ca1(%rip), %rdi      # 0x1386a
movl $0xf, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
leaq 0x3c98(%rip), %rdi      # 0x1387a
movl $0x14, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
leaq 0x3c94(%rip), %rdi      # 0x1388f
movl $0x24, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
leaq 0x3ca0(%rip), %rdi      # 0x138b4
movl $0x14, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
leaq 0x3e31(%rip), %rdi      # 0x13a5e
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
movq 0x28(%rbx), %r12
addq $0x18, %rbx
cmpq %rbx, %r12
je 0xfc70
movzbl %r14b, %r14d
movq 0x28(%r12), %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0xfcd6
movq %r12, %rdi
callq 0x2290
movq %rax, %r12
cmpq %rbx, %rax
jne 0xfc50
leaq 0x4175(%rip), %rdi      # 0x13dec
movl $0x2, %esi
movl $0x1, %edx
movq %r15, %rcx
callq 0x2410
movq %r15, %rdi
callq 0x2210
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xfca6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xfccd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_c_makefile_star2_O3/vlenhart[P]q3bsp/./vformat.h
// Function: VertexPool::GetVertex(LightMapVertex const&)
int GetVertex(const LightMapVertex& vtx)
  {
    VertexLess::SetSearch(vtx,&mVtxs);
    VertexSet::iterator found;
    found = mVertSet.find( -1 );
    if ( found != mVertSet.end() )
    {
      return *found;
    }
    int idx = mVtxs.size();
    assert( idx >= 0 && idx < 65536 );
    mVtxs.push_back( vtx );
    mVertSet.insert( idx );
    return idx;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdi), %r15
movss (%rsi), %xmm0
movss %xmm0, 0x8d52(%rip)     # 0x196b4
movss 0x4(%rsi), %xmm0
movss %xmm0, 0x8d49(%rip)     # 0x196b8
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x8d40(%rip)     # 0x196bc
movups 0xc(%rsi), %xmm0
movups %xmm0, 0x8d39(%rip)     # 0x196c0
movss 0x1c(%rsi), %xmm0
movss %xmm0, 0x8d3c(%rip)     # 0x196d0
movss 0x20(%rsi), %xmm0
movss %xmm0, 0x8d33(%rip)     # 0x196d4
movss 0x24(%rsi), %xmm0
movss %xmm0, 0x8d2a(%rip)     # 0x196d8
movq %r15, 0x8d2b(%rip)      # 0x196e0
leaq -0x20(%rbp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
callq 0x10b76
leaq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x109d2
movl 0x20(%rax), %eax
jmp 0x10a0b
movq 0x38(%rbx), %rax
subq 0x30(%rbx), %rax
shrq $0x3, %rax
imull $0xcccccccd, %eax, %eax # imm = 0xCCCCCCCD
movl %eax, -0x1c(%rbp)
cmpl $0x10000, %eax          # imm = 0x10000
jae 0x10a16
movq %r15, %rdi
movq %r14, %rsi
callq 0x10af2
leaq -0x1c(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10e60
movl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3413(%rip), %rdi      # 0x13e30
leaq 0x3424(%rip), %rsi      # 0x13e48
leaq 0x3429(%rip), %rcx      # 0x13e54
movl $0xf7, %edx
callq 0x2180
nop
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/bytestream.c
// Function: bsread
unsigned int bsread(ByteStream* bs, uint8_t* data, size_t size) {
  unsigned int* in;
  unsigned int* out;
  
  unsigned int asize;

  unsigned int isize;
  unsigned int ioffset;

  unsigned int i;

  if (bs->exhausted) return 0;

  if (bs->offset >= bs->size) return 0;

  if (bs->offset+size > bs->size) {
    size = bs->size - bs->offset;
    bs->exhausted = 1;
  }

  //align read
  asize = sizeof(unsigned int) - (bs->offset % sizeof(unsigned int)); 

  for (i=0; i<asize && i<size; i++) {
    data[i] = bs->data[bs->offset+i];
  }

  bs->offset += i;
  data += i;
  size -= i;
  asize = i;

  //optimized read
  isize = size / sizeof(unsigned int);
  ioffset = bs->offset / sizeof(unsigned int);

  in = (uint32_t*) bs->data;
  out = (uint32_t*) data;

  for (i=0; i<isize; i++) {
    out[i] = in[ioffset+i];
  }

  bs->offset += i * sizeof(unsigned int);
  data += i * sizeof(unsigned int);
  
  //trailing bytes read
  size -= isize * sizeof(unsigned int);

  for (i=0; i<size; i++) {
    data[i] = bs->data[bs->offset+i];
  }

  bs->offset += i;

  return isize * sizeof(unsigned int) + size + asize;
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0x1c(%rdi)
je 0x4ae7
retq
movl 0x18(%rdi), %ecx
movq 0x8(%rdi), %r9
movq %r9, %r8
subq %rcx, %r8
jbe 0x4ae6
leaq (%rcx,%rdx), %rax
cmpq %r9, %rax
jbe 0x4b09
movl $0x1, 0x1c(%rdi)
movq %r8, %rdx
pushq %rbp
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x4b49
andl $0x3, %ecx
movl $0x4, %r8d
subq %rcx, %r8
cmpq %rdx, %r8
cmovaeq %rdx, %r8
xorl %eax, %eax
movq 0x10(%rdi), %rcx
movl 0x18(%rdi), %r9d
addl %eax, %r9d
movb (%rcx,%r9), %cl
movb %cl, (%rsi,%rax)
incq %rax
cmpq %r8, %rax
jb 0x4b27
movl 0x18(%rdi), %ecx
movl %eax, %r8d
jmp 0x4b4e
xorl %r8d, %r8d
xorl %eax, %eax
addl %r8d, %ecx
movabsq $0x3fffffffc, %r9       # imm = 0x3FFFFFFFC
movl %ecx, 0x18(%rdi)
addq %rax, %rsi
movq %rdx, %r8
subq %rax, %r8
xorl %eax, %eax
testq %r9, %r8
je 0x4b9c
movq 0x10(%rdi), %r10
movq %r8, %r11
shrq $0x2, %r11
movl %r11d, %r11d
shrl $0x2, %ecx
xorl %ebx, %ebx
leal (%rcx,%rbx), %r14d
movl (%r10,%r14,4), %ebp
movl %ebp, (%rsi,%rbx,4)
incq %rbx
cmpq %rbx, %r11
jne 0x4b81
movl 0x18(%rdi), %ecx
andq %r8, %r9
jmp 0x4b9f
xorl %r9d, %r9d
addl %r9d, %ecx
movl %ecx, 0x18(%rdi)
movabsq $-0x3fffffffd, %r10     # imm = 0xFFFFFFFC00000003
andq %r10, %r8
je 0x4bd8
addq %r9, %rsi
xorl %eax, %eax
movq 0x10(%rdi), %rcx
movl 0x18(%rdi), %r9d
addl %eax, %r9d
movb (%rcx,%r9), %cl
movb %cl, (%rsi,%rax)
incq %rax
movl %eax, %ecx
cmpq %rcx, %r8
ja 0x4bb9
movl 0x18(%rdi), %ecx
addl %eax, %ecx
movl %ecx, 0x18(%rdi)
movl %edx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/bytestream.c
// Function: bswrite
int bswrite(ByteStream* bs, uint8_t* data, unsigned int size) {
  unsigned int* in;
  unsigned int* out;
  
  unsigned int asize;

  unsigned int isize;
  unsigned int ioffset;

  unsigned int i;

  if (bs->exhausted) return 0;

  if (bs->offset >= bs->size) return 0;

  if (bs->offset+size > bs->size) {
    size = bs->size - bs->offset;
    bs->exhausted = 1;
  }

  //align write
  asize = sizeof(unsigned int) - (bs->offset % sizeof(unsigned int)); 

  for (i=0; i<asize && i<size; i++) {
    bs->data[bs->offset+i] = data[i];
  }

  bs->offset += i;
  data += i;
  size -= i;
  asize = i;

  //optimized write
  isize = size / sizeof(unsigned int);
  ioffset = bs->offset / sizeof(unsigned int);

  in = (uint32_t*) data;
  out = (uint32_t*) bs->data;

  for (i=0; i<isize; i++) {
    out[ioffset+i] = in[i];
  }

  bs->offset += i * sizeof(unsigned int);
  data += i * sizeof(unsigned int);

  //write finishing bytes
  size -= i * sizeof(unsigned int);

  for (i=0; i<size; i++) {
    bs->data[bs->offset+i] = data[i];
  }

  bs->offset += i;

  return isize * sizeof(unsigned int) + size + asize;
}

// Assembly:
xorl %eax, %eax
cmpl $0x0, 0x1c(%rdi)
je 0x4c0e
retq
movl 0x18(%rdi), %ecx
movq 0x8(%rdi), %r8
cmpq %rcx, %r8
jbe 0x4c0d
leal (%rcx,%rdx), %eax
cmpq %rax, %r8
jae 0x4c2f
subl %ecx, %r8d
movl $0x1, 0x1c(%rdi)
movl %r8d, %edx
pushq %rbx
movl %ecx, %r8d
andl $0x3, %r8d
movl $0x4, %eax
subl %r8d, %eax
cmpl %edx, %eax
cmovael %edx, %eax
testl %edx, %edx
je 0x4c6d
movl %eax, %ecx
xorl %r8d, %r8d
movb (%rsi,%r8), %r9b
movq 0x10(%rdi), %r10
movl 0x18(%rdi), %r11d
addl %r8d, %r11d
movb %r9b, (%r10,%r11)
incq %r8
cmpq %r8, %rcx
jne 0x4c4d
movl 0x18(%rdi), %ecx
jmp 0x4c6f
xorl %eax, %eax
addl %eax, %ecx
movl %ecx, 0x18(%rdi)
movl %eax, %r8d
addq %r8, %rsi
subl %eax, %edx
xorl %r8d, %r8d
cmpl $0x4, %edx
jae 0x4c89
xorl %r10d, %r10d
jmp 0x4cb4
movl %edx, %r9d
shrl $0x2, %r9d
andl $-0x4, %ecx
addq 0x10(%rdi), %rcx
xorl %r10d, %r10d
movl (%rsi,%r10,4), %r11d
movl %r11d, (%rcx,%r10,4)
incq %r10
cmpq %r10, %r9
jne 0x4c9a
movl 0x18(%rdi), %ecx
movl %edx, %r10d
andl $-0x4, %r10d
addl %r10d, %ecx
movl %ecx, 0x18(%rdi)
movl %edx, %r9d
subl %r10d, %r9d
je 0x4cee
addq %r10, %rsi
cmpl $0x1, %r9d
movl %r9d, %r8d
adcl $0x0, %r8d
xorl %ecx, %ecx
movb (%rsi,%rcx), %r10b
movq 0x10(%rdi), %r11
movl 0x18(%rdi), %ebx
addl %ecx, %ebx
movb %r10b, (%r11,%rbx)
incq %rcx
cmpq %rcx, %r8
jne 0x4cd2
movl 0x18(%rdi), %ecx
addl %r8d, %ecx
movl %ecx, 0x18(%rdi)
andl $-0x4, %edx
addl %eax, %edx
addl %r9d, %edx
movl %edx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/bytestream.c
// Function: bssave
int bssave(ByteStream* bs, char* filename) {
  FILE* f = fopen(filename,"w");

  if (bs == NULL || f == NULL) return -1;

  fwrite(bs->data, 1, bs->size, f);

  fflush(f);
  fclose(f);    
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %r14
leaq 0x5328(%rip), %rsi      # 0xa05a
movq %rax, %rdi
callq 0x4690
movq %rax, %rbx
testq %r14, %r14
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x4d79
movq 0x8(%r14), %rdx
movq 0x10(%r14), %rdi
movl $0x1, %esi
movq %rbx, %rcx
callq 0x4710
movq %rbx, %rdi
callq 0x44c0
movq %rbx, %rdi
callq 0x4160
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_stringdata
void dxb_stringdata(ByteStream* bs, DexStringDataItem* obj) {
  uint8_t* tape;
  char end[] = "\x00";

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->size));

  tape = (uint8_t*) obj->data;

  if (ul128toui(obj->size) != 0x0) {
    while(*tape) {
      bswrite(bs,tape,sizeof(uint8_t));

      if ((*tape & 0xe0) == 0xc0 ) {
	tape += 1;
	bswrite(bs,tape,sizeof(uint8_t));
      }

      else if ((*tape & 0xf0) == 0xe0) {
	tape += 1;
	bswrite(bs,tape,sizeof(uint8_t)*2);
	tape += 1;
      }

      tape++;
    }
  }

  bswrite(bs,(uint8_t*)end,sizeof(uint8_t));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movw $0x0, 0xe(%rsp)
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x500d
movq %rsi, %r15
movq %rdi, %rbx
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x4470
movq 0x18(%r15), %r14
movq 0x8(%r15), %rdi
movl 0x10(%r15), %esi
callq 0x4170
testl %eax, %eax
je 0x4ffb
cmpb $0x0, (%r14)
je 0x4ffb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x4570
movzbl (%r14), %eax
movl %eax, %ecx
andl $-0x20, %ecx
cmpl $0xc0, %ecx
jne 0x4fd1
incq %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x4570
jmp 0x4ff0
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0x4ff0
leaq 0x1(%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
addq $0x2, %r14
cmpb $0x0, 0x1(%r14)
leaq 0x1(%r14), %r14
jne 0x4f9b
leaq 0xe(%rsp), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4570
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_classdata
void dxb_classdata(ByteStream* bs, DexClassDataItem* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->static_fields_size));
  l128write(bs,&(obj->instance_fields_size));
  l128write(bs,&(obj->direct_methods_size));
  l128write(bs,&(obj->virtual_methods_size));

  for (i=0; i<ul128toui(obj->static_fields_size); i++)
    dxb_encodedfield(bs,obj->static_fields[i]);

  for (i=0; i<ul128toui(obj->instance_fields_size); i++)
    dxb_encodedfield(bs,obj->instance_fields[i]);

  for (i=0; i<ul128toui(obj->direct_methods_size); i++)
    dxb_encodedmethod(bs,obj->direct_methods[i]);

  for (i=0; i<ul128toui(obj->virtual_methods_size); i++)
    dxb_encodedmethod(bs,obj->virtual_methods[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x51ed
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
leaq 0x14(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
leaq 0x2c(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x513d
xorl %r15d, %r15d
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4030
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x5117
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x5176
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4030
incq %r15
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x5150
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x51af
xorl %r15d, %r15d
movq 0x48(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4630
incq %r15
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x5189
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x51e8
xorl %r15d, %r15d
movq 0x50(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4630
incq %r15
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x51c2
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_typelist
void dxb_typelist(ByteStream* bs, DexTypeList* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->size),sizeof(uint32_t));

  for (i=0; i<obj->size; i++)
    dxb_typeitem(bs,obj->list[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5289
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0x8(%rbx)
je 0x5284
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4540
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x5269
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedtypeaddrpair
void dxb_encodedtypeaddrpair(ByteStream* bs, DexEncodedTypeAddrPair* obj) {
  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->type_idx));
  l128write(bs,&(obj->addr));
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x52d9
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
addq $0x14, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4470
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedcatchhandler
void dxb_encodedcatchhandler(ByteStream* bs, DexEncodedCatchHandler* obj) {
  int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->size));

  for (i=0; i<abs(sl128toi(obj->size)); i++)
    dxb_encodedtypeaddrpair(bs,obj->handlers[i]);

  if (sl128toi(obj->size) <= 0) 
    l128write(bs,&(obj->catch_all_addr));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x538a
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
testl %eax, %eax
je 0x537a
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4340
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpq %rcx, %r15
jb 0x534f
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
testl %eax, %eax
jle 0x5390
popq %rbx
popq %r14
popq %r15
retq
addq $0x20, %rbx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x4470
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedcatchhandlerlist
void dxb_encodedcatchhandlerlist(ByteStream* bs, DexEncodedCatchHandlerList* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->size));

  for (i=0; i<ul128toui(obj->size); i++)
    dxb_encodedcatchhandler(bs,obj->list[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5411
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x540c
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4400
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x53e6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_codeitem
void dxb_codeitem(ByteStream* bs, DexCodeItem* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->registers_size),sizeof(uint16_t));
  bswrite(bs,(uint8_t*) &(obj->ins_size),sizeof(uint16_t));
  bswrite(bs,(uint8_t*) &(obj->outs_size),sizeof(uint16_t));
  bswrite(bs,(uint8_t*) &(obj->tries_size),sizeof(uint16_t));
  bswrite(bs,(uint8_t*) &(obj->debug_info_off),sizeof(uint32_t));
  bswrite(bs,(uint8_t*) &(obj->insns_size),sizeof(uint32_t));

  for (i=0; i<obj->insns_size; i++)
    bswrite(bs,(uint8_t*) &(obj->insns[i]),sizeof(uint16_t));

  if (obj->tries_size > 0) {
    if (obj->insns_size % 2 != 0)
      bswrite(bs,(uint8_t*) &(obj->padding),sizeof(uint16_t));

    for (i=0; i<obj->tries_size; i++)
     dxb_tryitem(bs,obj->tries[i]);

    dxb_encodedcatchhandlerlist(bs,obj->handlers);    
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x5435
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
leaq 0xa(%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
leaq 0xc(%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
leaq 0xe(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x4570
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x4570
leaq 0x14(%r14), %rsi
movq %rbx, %rdi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0x14(%r14)
je 0x5507
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x18(%r14), %rsi
addq %r12, %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
incq %r13
movl 0x14(%r14), %eax
addq $0x2, %r12
cmpq %rax, %r13
jb 0x54b9
cmpw $0x0, (%r15)
je 0x542b
testb $0x1, %al
je 0x5512
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
movl $0x2, %edx
callq 0x4570
cmpw $0x0, 0xe(%r14)
jne 0x5512
jmp 0x5532
cmpw $0x0, (%r15)
je 0x542b
xorl %r15d, %r15d
movq 0x28(%r14), %rax
movq (%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x4770
incq %r15
movzwl 0xe(%r14), %eax
cmpq %rax, %r15
jb 0x5515
movq 0x30(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4820
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_debuginfo
void dxb_debuginfo(ByteStream* bs, DexDebugInfo* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->line_start));
  l128write(bs,&(obj->parameters_size));

  for (i=0; i<ul128toui(obj->parameters_size); i++)
    l128write(bs,&(obj->parameter_names[i]));

  dxb_debug_state_machine(bs,obj->state_machine);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x55ec
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x4470
leaq 0x14(%r14), %rsi
movq %rbx, %rdi
callq 0x4470
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x55ca
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x20(%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x4470
incq %r12
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
movl %eax, %eax
addq $0xc, %r15
cmpq %rax, %r12
jb 0x55a0
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0x55ec
movl (%rsi), %edx
addq $0x4, %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4570
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_maplist
void dxb_maplist(ByteStream* bs, DexMapList* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*)&(obj->size),sizeof(uint32_t));

  for (i=0; i<obj->size; i++)
    dxb_mapitem(bs,obj->list[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x56af
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0x8(%rbx)
je 0x56aa
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4640
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x568f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedvalue
void dxb_encodedvalue(ByteStream* bs, DexEncodedValue* obj) {
  int i;

  uint8_t value_type;
  uint8_t value_arg;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*)&(obj->argtype),sizeof(uint8_t));

  value_type = (obj->argtype & 0x1f);
  value_arg  = ((obj->argtype >> 5) & 0x7);
	       
  switch (value_type) {
  case 0x00:
    bswrite(bs,(uint8_t*) obj->value,sizeof(uint8_t));
    break;
  case 0x02:
  case 0x03:
  case 0x04:
  case 0x06:
  case 0x10:
  case 0x11:
  case 0x17:
  case 0x18:
  case 0x19:
  case 0x1a:
  case 0x1b:
    for (i=0; i<value_arg+1; i++)
      bswrite(bs,(uint8_t*) &(obj->value[i]),sizeof(uint8_t));   

    break;
  case 0x1c:
    dxb_encodedarray(bs,(DexEncodedArray*) obj->value);
    break;
  case 0x1d:
    dxb_encodedannotation(bs,(DexEncodedAnnotation*)obj->value);
    break;
  case 0x1e:
  case 0x1f:
    break;
  default:
    break;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x572d
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4570
movzbl 0x8(%r14), %r15d
movl %r15d, %eax
andl $0x1f, %eax
cmpl $0x1d, %eax
ja 0x572d
leaq 0x49c6(%rip), %rcx      # 0xa0c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x5, %r15d
incq %r15
xorl %r12d, %r12d
movq 0x10(%r14), %rsi
addq %r12, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4570
incq %r12
cmpq %r12, %r15
jne 0x5711
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x10(%r14), %rsi
movq %rbx, %rdi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4570
movq 0x10(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4810
movq 0x10(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4780
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedarray
void dxb_encodedarray(ByteStream* bs, DexEncodedArray* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->size));

  for (i=0; i<ul128toui(obj->size); i++)
    dxb_encodedvalue(bs,obj->values[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x57f0
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x57eb
xorl %r15d, %r15d
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4830
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x57c5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_encodedannotation
void dxb_encodedannotation(ByteStream* bs, DexEncodedAnnotation* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  l128write(bs,&(obj->type_idx));
  l128write(bs,&(obj->size));

  for (i=0; i<ul128toui(obj->size); i++)
    dxb_annotationelement(bs,obj->elements[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x586a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
leaq 0x14(%rbx), %rsi
movq %r14, %rdi
callq 0x4470
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x5865
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x43b0
incq %r15
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x583f
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_annotationdirectoryitem
void dxb_annotationdirectoryitem(ByteStream* bs, DexAnnotationDirectoryItem* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->class_annotations_off),sizeof(uint32_t));
  bswrite(bs,(uint8_t*) &(obj->fields_size),sizeof(uint32_t));
  bswrite(bs,(uint8_t*) &(obj->annotated_methods_size),sizeof(uint32_t));
  bswrite(bs,(uint8_t*) &(obj->annotated_parameters_size),sizeof(uint32_t));

  for (i=0; i<obj->fields_size; i++)
    dxb_fieldannotation(bs,obj->field_annotations[i]);

  for (i=0; i<obj->annotated_methods_size; i++)
    dxb_methodannotation(bs,obj->method_annotations[i]);
  
  for (i=0; i<obj->annotated_parameters_size; i++)
    dxb_parameterannotation(bs,obj->parameter_annotations[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5a52
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
leaq 0xc(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
leaq 0x10(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0x4, %edx
callq 0x4570
leaq 0x14(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0xc(%rbx)
je 0x5a00
xorl %r13d, %r13d
movq 0x18(%rbx), %rax
movq (%rax,%r13,8), %rsi
movq %r14, %rdi
callq 0x4790
incq %r13
movl 0xc(%rbx), %eax
cmpq %rax, %r13
jb 0x59e5
cmpl $0x0, (%r12)
je 0x5a25
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0x4390
incq %r12
movl 0x10(%rbx), %eax
cmpq %rax, %r12
jb 0x5a0a
cmpl $0x0, (%r15)
je 0x5a49
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4560
incq %r15
movl 0x14(%rbx), %eax
cmpq %rax, %r15
jb 0x5a2e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_annotationsetreflist
void dxb_annotationsetreflist(ByteStream* bs, DexAnnotationSetRefList* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->size),sizeof(uint32_t));

  for (i=0; i<obj->size; i++)
    dxb_annotationsetrefitem(bs,obj->list[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5aee
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0x8(%rbx)
je 0x5ae9
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4650
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x5ace
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_annotationsetitem
void dxb_annotationsetitem(ByteStream* bs, DexAnnotationSetItem* obj) {
  unsigned int i;

  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->size),sizeof(uint32_t));

  for (i=0; i<obj->size; i++)
    dxb_annotationoffitem(bs,obj->entries[i]);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5b8a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
movl $0x4, %edx
callq 0x4570
cmpl $0x0, 0x8(%rbx)
je 0x5b85
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r15,8), %rsi
movq %r14, %rdi
callq 0x4190
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x5b6a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_builder.c
// Function: dxb_annotationitem
void dxb_annotationitem(ByteStream* bs, DexAnnotationItem* obj) {
  if (bs == NULL || obj == NULL) return;

  bsseek(bs,obj->meta.offset);

  bswrite(bs,(uint8_t*) &(obj->visibility),sizeof(uint8_t));

  dxb_encodedannotation(bs,obj->annotation);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x5b9c
retq
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rsi), %esi
callq 0x4410
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x4570
movq 0x10(%r14), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4810
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_stringdata
DexStringDataItem* dx_stringdata(ByteStream* bs, uint32_t offset) {
  DexStringDataItem* res;
  int check;
  uint8_t* tape;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexStringDataItem,res);

  bsseek(bs,offset);

  check = l128read(bs,&(res->size));

  if (check || bs->exhausted) {
    res->meta.corrupted = true;
    return res;
  }

  DX_ALLOC_LIST(uint8_t,res->data,ul128toui(res->size)*3+1);

  tape = (uint8_t*) res->data;

  bsread(bs,tape,sizeof(uint8_t));
  
  while(*tape) {
    if ((*tape & 0xe0) == 0xc0 ) {
      tape++;
      bsread(bs,tape,sizeof(uint8_t));
    }

    else if ((*tape & 0xf0) == 0xe0) {
      tape++;
      bsread(bs,tape,sizeof(uint8_t)*2);      
      tape++;
    }
        
    tape++;
    bsread(bs,tape,sizeof(uint8_t));
  }
  
  res->meta.corrupted |= bs->exhausted;

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x6220
movl %esi, %ebp
movq %rdi, %r14
movl $0x20, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
movq %rbx, %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x4750
movb $0x1, %cl
testl %eax, %eax
jne 0x62c6
cmpl $0x0, 0x1c(%r14)
jne 0x62c6
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
cmpl $0x55555555, %eax       # imm = 0x55555555
jne 0x6227
xorl %r15d, %r15d
jmp 0x6240
xorl %ebx, %ebx
jmp 0x62c8
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
leal (%rax,%rax,2), %edi
incl %edi
callq 0x4600
movq %rax, %r15
movq %r15, 0x18(%rbx)
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4420
movb (%r15), %al
testb %al, %al
je 0x62bc
movzbl %al, %eax
movl %eax, %ecx
andl $-0x20, %ecx
cmpl $0xc0, %ecx
jne 0x6280
incq %r15
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4420
jmp 0x629f
andl $-0x10, %eax
cmpl $0xe0, %eax
jne 0x629f
leaq 0x1(%r15), %rsi
movl $0x2, %edx
movq %r14, %rdi
callq 0x4420
addq $0x2, %r15
leaq 0x1(%r15), %r12
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4420
movb 0x1(%r15), %al
movq %r12, %r15
jmp 0x6257
movzbl (%rbx), %eax
orl 0x1c(%r14), %eax
setne %cl
movb %cl, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_encodedmethod
DexEncodedMethodItem* dx_encodedmethod(ByteStream* bs, uint32_t offset) {
  DexEncodedMethodItem* res;
  int check;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexEncodedMethodItem,res);

  bsseek(bs,offset);

  check  = l128read(bs,&(res->method_idx_diff));
  check |= l128read(bs,&(res->access_flags));
  check |= l128read(bs,&(res->code_off));

  res->meta.corrupted = check || bs->exhausted;
  
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x63a8
movl %esi, %ebp
movq %rdi, %r14
movl $0x2c, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
movl %eax, %ebp
leaq 0x14(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
movl %eax, %r15d
orl %ebp, %r15d
movq %rbx, %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x4750
movb $0x1, %cl
orl %r15d, %eax
jne 0x63a4
cmpl $0x0, 0x1c(%r14)
setne %cl
movb %cl, (%rbx)
jmp 0x63aa
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_typelist
DexTypeList* dx_typelist(ByteStream* bs, uint32_t offset) {
  DexTypeList* res;
  int check;
  unsigned int i;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexTypeList,res);

  bsseek(bs,offset);

  check = bsread(bs,(uint8_t*) &(res->size),sizeof(uint32_t));

  res->meta.corrupted = (check != sizeof(uint32_t));
  if (res->meta.corrupted) return res;

  DX_ALLOC_LIST(DexTypeItem*,res->list,res->size);

  for (i=0; i<res->size; i++)
    res->list[i] = dx_typeitem(bs,bs->offset);

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x66e3
movl %esi, %ebp
movq %rdi, %r14
movl $0x18, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
leaq 0x8(%rbx), %r15
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x4420
cmpl $0x4, %eax
setne (%rbx)
jne 0x66ef
movl (%r15), %edi
testq %rdi, %rdi
je 0x66e7
shlq $0x3, %rdi
callq 0x4600
cmpl $0x0, 0x8(%rbx)
movq %rax, 0x10(%rbx)
je 0x66ef
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x41e0
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x8(%rbx), %eax
cmpq %rax, %r15
jb 0x66c2
jmp 0x66ef
xorl %ebx, %ebx
jmp 0x66ef
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_encodedtypeaddrpair
DexEncodedTypeAddrPair* dx_encodedtypeaddrpair(ByteStream* bs, uint32_t offset) {
  DexEncodedTypeAddrPair* res;
  int check;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexEncodedTypeAddrPair,res);

  bsseek(bs,offset);

  check  = l128read(bs,&(res->type_idx));
  check |= l128read(bs,&(res->addr));

  res->meta.corrupted = check || bs->exhausted;
  
  return res;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x67ac
movl %esi, %ebp
movq %rdi, %r14
movl $0x20, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
movl %eax, %ebp
movq %rbx, %rsi
addq $0x14, %rsi
movq %r14, %rdi
callq 0x4750
movb $0x1, %cl
orl %ebp, %eax
jne 0x67a8
cmpl $0x0, 0x1c(%r14)
setne %cl
movb %cl, (%rbx)
jmp 0x67ae
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_encodedcatchhandler
DexEncodedCatchHandler* dx_encodedcatchhandler(ByteStream* bs, uint32_t offset) {
  DexEncodedCatchHandler* res;
  int check;
  int i;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexEncodedCatchHandler,res);

  bsseek(bs,offset);

  check  = l128read(bs,&(res->size));

  res->meta.corrupted = check;
  if (res->meta.corrupted) return res;

  DX_ALLOC_LIST(DexEncodedTypeAddrPair*,res->handlers,ul128toui(res->size));

  for (i=0; i<abs(sl128toi(res->size)); i++)
    res->handlers[i] = dx_encodedtypeaddrpair(bs,bs->offset);

  if (sl128toi(res->size) <= 0) 
    check |= l128read(bs,&(res->catch_all_addr));

  res->meta.corrupted = check || bs->exhausted;
  
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6824
movl %esi, %ebp
movq %rdi, %r14
movl $0x30, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
testl %eax, %eax
setne (%rbx)
jne 0x68a1
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x6828
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x682a
xorl %ebx, %ebx
jmp 0x68a1
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
testl %eax, %eax
je 0x6870
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4480
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpq %rcx, %r15
jb 0x6841
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x44e0
testl %eax, %eax
jle 0x688a
cmpl $0x0, 0x1c(%r14)
setne %cl
jmp 0x689f
movq %rbx, %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x4750
movb $0x1, %cl
testl %eax, %eax
je 0x6880
movb %cl, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_encodedcatchhandlerlist
DexEncodedCatchHandlerList* dx_encodedcatchhandlerlist(ByteStream* bs, uint32_t offset) {
  DexEncodedCatchHandlerList* res;
  int check;
  unsigned int i;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexEncodedCatchHandlerList,res);

  bsseek(bs,offset);

  check  = l128read(bs,&(res->size));

  res->meta.corrupted = check;
  if (res->meta.corrupted) return res;

  DX_ALLOC_LIST(DexEncodedCatchHandler*,res->list,ul128toui(res->size));

  for (i=0; i<ul128toui(res->size); i++)
    res->list[i] = dx_encodedcatchhandler(bs,bs->offset);

  res->meta.corrupted = check || bs->exhausted;
  
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6919
movl %esi, %ebp
movq %rdi, %r14
movl $0x20, %edi
callq 0x4600
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4410
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
testl %eax, %eax
setne (%rbx)
jne 0x6968
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x691d
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x691f
xorl %ebx, %ebx
jmp 0x6968
xorl %eax, %eax
movq %rax, 0x18(%rbx)
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x6960
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x44d0
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x6936
cmpl $0x0, 0x1c(%r14)
setne (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq