// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7b23
movq $0x0, -0x8(%rbp)
jmp 0x7cc5
jmp 0x7b25
movl $0x30, %edi
callq 0x4750
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x44f0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x4910
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
setne %cl
movq -0x20(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x20(%rbp), %rax
testb $0x1, (%rax)
je 0x7b8a
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7cc5
jmp 0x7b8c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x38(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x38(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x41c0
cmpl $0x0, %eax
je 0x7be7
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x48(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x41c0
movl %eax, %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x4750
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x7bf3
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x7bf5
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x58(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x58(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0x45e0
movl %eax, %ecx
movl -0x6c(%rbp), %eax
movl %ecx, %edx
negl %edx
cmovnsl %edx, %ecx
cmpl %ecx, %eax
jge 0x7c5e
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x4580
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x7bfc
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x68(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x45e0
cmpl $0x0, %eax
jg 0x7c98
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x20, %rsi
callq 0x4910
orl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movb $0x1, %al
cmpl $0x0, -0x24(%rbp)
movb %al, -0x6d(%rbp)
jne 0x7cb1
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %cl
movq -0x20(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop