// File: /workspace/github_c_makefile_star2_O2/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 0x62d7
movl %esi, %ebp
movq %rdi, %r14
pushq $0x58
popq %rdi
callq 0x46a0
movq %rax, %rbx
movl %ebp, 0x4(%rax)
movb $0x0, (%rax)
movq %r14, %rdi
movl %ebp, %esi
callq 0x4480
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x4820
movl %eax, %ebp
leaq 0x14(%rbx), %rsi
movq %r14, %rdi
callq 0x4820
movl %eax, %r15d
orl %ebp, %r15d
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x4820
movl %eax, %ebp
orl %r15d, %ebp
movq %rbx, %rsi
addq $0x2c, %rsi
movq %r14, %rdi
callq 0x4820
orl %ebp, %eax
je 0x62db
movb $0x1, (%rbx)
jmp 0x62e5
xorl %ebx, %ebx
jmp 0x62e5
cmpl $0x0, 0x1c(%r14)
setne (%rbx)
je 0x62f3
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4180
testl %eax, %eax
je 0x631c
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4180
movl %eax, %edi
shlq $0x3, %rdi
callq 0x46a0
jmp 0x631e
xorl %eax, %eax
movq %rax, 0x38(%rbx)
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4180
testl %eax, %eax
je 0x634b
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4180
movl %eax, %edi
shlq $0x3, %rdi
callq 0x46a0
jmp 0x634d
xorl %eax, %eax
movq %rax, 0x40(%rbx)
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4180
testl %eax, %eax
je 0x637a
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4180
movl %eax, %edi
shlq $0x3, %rdi
callq 0x46a0
jmp 0x637c
xorl %eax, %eax
movq %rax, 0x48(%rbx)
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4180
testl %eax, %eax
je 0x63a9
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4180
movl %eax, %edi
shlq $0x3, %rdi
callq 0x46a0
jmp 0x63ab
xorl %eax, %eax
movq %rax, 0x50(%rbx)
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x4180
movl %eax, %eax
cmpq %rax, %r15
jae 0x63de
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4120
movq 0x38(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x63b2
xorl %r15d, %r15d
movq 0x14(%rbx), %rdi
movl 0x1c(%rbx), %esi
callq 0x4180
movl %eax, %eax
cmpq %rax, %r15
jae 0x640d
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x4120
movq 0x40(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x63e1
xorl %r15d, %r15d
movq 0x20(%rbx), %rdi
movl 0x28(%rbx), %esi
callq 0x4180
movl %eax, %eax
cmpq %rax, %r15
jae 0x643c
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x45e0
movq 0x48(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x6410
xorl %r15d, %r15d
movq 0x2c(%rbx), %rdi
movl 0x34(%rbx), %esi
callq 0x4180
movl %eax, %eax
cmpq %rax, %r15
jae 0x62e5
movl 0x18(%r14), %esi
movq %r14, %rdi
callq 0x45e0
movq 0x50(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
jmp 0x643f