// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_parser.c
// Function: dx_classdata
DexClassDataItem* dx_classdata(ByteStream* bs, uint32_t offset) {
  DexClassDataItem* res;
  int check;

  unsigned int i;

  if (bs == NULL) return NULL;

  DX_ALLOC(DexClassDataItem,res);

  bsseek(bs,offset);

  check  = l128read(bs,&(res->static_fields_size));
  check |= l128read(bs,&(res->instance_fields_size));
  check |= l128read(bs,&(res->direct_methods_size));
  check |= l128read(bs,&(res->virtual_methods_size));

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

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

  DX_ALLOC_LIST(DexEncodedFieldItem*,res->static_fields,
		ul128toui(res->static_fields_size));
  DX_ALLOC_LIST(DexEncodedFieldItem*,res->instance_fields,
		ul128toui(res->instance_fields_size));
  DX_ALLOC_LIST(DexEncodedMethodItem*,res->direct_methods,
		ul128toui(res->direct_methods_size));
  DX_ALLOC_LIST(DexEncodedMethodItem*,res->virtual_methods,
		ul128toui(res->virtual_methods_size));

  for (i=0; i<ul128toui(res->static_fields_size); i++)
    res->static_fields[i] = dx_encodedfield(bs,bs->offset);

  for (i=0; i<ul128toui(res->instance_fields_size); i++)
    res->instance_fields[i] = dx_encodedfield(bs,bs->offset);

  for (i=0; i<ul128toui(res->direct_methods_size); i++)
    res->direct_methods[i] = dx_encodedmethod(bs,bs->offset);

  for (i=0; i<ul128toui(res->virtual_methods_size); i++)
    res->virtual_methods[i] = dx_encodedmethod(bs,bs->offset);

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6422
movl %esi, %ebp
movq %rdi, %r14
movl $0x58, %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
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x4750
movl %eax, %ebp
orl %r15d, %ebp
movq %rbx, %rsi
addq $0x2c, %rsi
movq %r14, %rdi
callq 0x4750
orl %ebp, %eax
je 0x6429
movb $0x1, (%rbx)
jmp 0x65e7
xorl %ebx, %ebx
jmp 0x65e7
cmpl $0x0, 0x1c(%r14)
setne (%rbx)
jne 0x65e7
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x6460
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x6462
xorl %eax, %eax
movq %rax, 0x38(%rbx)
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x648f
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x6491
xorl %eax, %eax
movq %rax, 0x40(%rbx)
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x64be
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x64c0
xorl %eax, %eax
movq %rax, 0x48(%rbx)
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x64ed
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4600
jmp 0x64ef
xorl %eax, %eax
movq %rax, 0x50(%rbx)
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x6530
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4110
movq 0x38(%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 0x6506
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x656d
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4110
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x6543
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x65aa
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4550
movq 0x48(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x6580
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
testl %eax, %eax
je 0x65e7
xorl %r15d, %r15d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4550
movq 0x50(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x65bd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq