// File: /workspace/github_c_makefile_star2_O0/pali[P]bmfdec/./bmfparse.c
// Function: parse_class_method
static struct mof_method parse_class_method(char *buf, uint32_t size, uint32_t offset) {
  struct mof_method out;
  memset(&out, 0, sizeof(out));
  uint32_t *buf2 = (uint32_t *)buf;
  if (size < 20) error("Invalid size");
  if (buf2[1] != 0x00 && buf2[1] != 0x200D) {
    fprintf(stderr, "Warning: unknown method type 0x%x\n", ((uint32_t *)buf)[1]);
    fprintf(stderr, "Hexdump:\n");
    dump_bytes(buf, size);
    return out;
  }
  if (buf2[2] != 0x0) error("Invalid unknown");
  uint32_t len = buf2[3];
  if (len == 0xFFFFFFFF)
    len = buf2[4];
  else {
    if (!check_sum(20, buf2[4], size) || buf2[4] < len) error("Invalid size");
    parse_class_method_parameters(buf+20+len, buf2[4]-len, &out, offset ? offset+20+len : 0);
  }
  if (!check_sum(20, len, size)) error("Invalid size");
  out.name = parse_string(buf+20, len);
  len = buf2[4];
  buf2 = (uint32_t *)(buf+20+len);
  uint32_t len1 = buf2[0];
  if (size < 20 || !check_sum(len, len1, size-20)) error("Invalid size");
  uint32_t count = buf2[1];
  uint32_t i;
  char *tmp = buf+20+len+8;
  out.qualifiers_count = count;
  out.qualifiers = calloc(count, sizeof(*out.qualifiers));
  if (!out.qualifiers) error("calloc failed");
  for (i=0; i<count; ++i) {
    if (tmp-buf >= UINT32_MAX || !check_sum(20+8, len+len1, UINT32_MAX) || !check_sum(tmp-buf, 4, 20+len+8+len1)) error("Invalid size"); /* if (tmp+4 > buf+20+len+8+len1) */
    uint32_t len2 = ((uint32_t *)tmp)[0];
    if (len2 == 0 || !check_sum(tmp-buf, len2, 20+len+8+len1)) error("Invalid size"); /* if (tmp+len2 > buf+20+len+8+len1) */
    out.qualifiers[i] = parse_qualifier(tmp, len2, offset ? offset+tmp-buf : 0);
    tmp += len2;
  }
  if (tmp != buf+size) error("Buffer not processed");
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
xorl %esi, %esi
movl $0x60, %edx
callq 0x10c0
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x14, -0xc(%rbp)
jae 0x3b82
jmp 0x3b4c
movq 0x74a5(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x491e(%rip), %rsi      # 0x847b
leaq 0x495b(%rip), %rdx      # 0x84bf
leaq 0x4d98(%rip), %rcx      # 0x8903
movl $0x272, %r8d            # imm = 0x272
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x3be1
movq -0x18(%rbp), %rax
cmpl $0x200d, 0x4(%rax)      # imm = 0x200D
je 0x3be1
movq 0x7458(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x4d65(%rip), %rsi      # 0x8916
movb $0x0, %al
callq 0x1100
movq 0x7439(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4abb(%rip), %rsi      # 0x8684
movb $0x0, %al
callq 0x1100
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x5790
jmp 0x4090
movq -0x18(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x3c23
jmp 0x3bed
movq 0x7404(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x487d(%rip), %rsi      # 0x847b
leaq 0x4947(%rip), %rdx      # 0x854c
leaq 0x4cf7(%rip), %rcx      # 0x8903
movl $0x279, %r8d            # imm = 0x279
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $-0x1, -0x1c(%rbp)
jne 0x3c42
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1c(%rbp)
jmp 0x3cf0
movq -0x18(%rbp), %rcx
movl $0xffffffeb, %eax       # imm = 0xFFFFFFEB
cmpl 0x10(%rcx), %eax
jb 0x3c6b
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x14, %eax
cmpl -0xc(%rbp), %eax
ja 0x3c6b
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x1c(%rbp), %eax
jae 0x3ca3
jmp 0x3c6d
movq 0x7384(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x47fd(%rip), %rsi      # 0x847b
leaq 0x483a(%rip), %rdx      # 0x84bf
leaq 0x4c77(%rip), %rcx      # 0x8903
movl $0x27e, %r8d            # imm = 0x27E
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x8(%rbp), %rax
addq $0x14, %rax
movl -0x1c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x3cd6
movl -0x10(%rbp), %eax
addl $0x14, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x3cdd
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0x3cdd
movq -0x68(%rbp), %rdx
movl -0x6c(%rbp), %esi
movq -0x78(%rbp), %rdi
movl -0x7c(%rbp), %ecx
callq 0x5ca0
movl $0xffffffeb, %eax       # imm = 0xFFFFFFEB
cmpl -0x1c(%rbp), %eax
jb 0x3d05
movl -0x1c(%rbp), %eax
addl $0x14, %eax
cmpl -0xc(%rbp), %eax
jbe 0x3d3d
jmp 0x3d07
movq 0x72ea(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4763(%rip), %rsi      # 0x847b
leaq 0x47a0(%rip), %rdx      # 0x84bf
leaq 0x4bdd(%rip), %rcx      # 0x8903
movl $0x281, %r8d            # imm = 0x281
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x8(%rbp), %rdi
addq $0x14, %rdi
movl -0x1c(%rbp), %esi
callq 0x5900
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
addq $0x14, %rax
movl -0x1c(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x14, -0xc(%rbp)
jb 0x3da0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jb 0x3da0
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x14, %ecx
cmpl %ecx, %eax
jbe 0x3dd8
jmp 0x3da2
movq 0x724f(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x46c8(%rip), %rsi      # 0x847b
leaq 0x4705(%rip), %rdx      # 0x84bf
leaq 0x4b42(%rip), %rcx      # 0x8903
movl $0x286, %r8d            # imm = 0x286
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x68(%rbp), %rax
movq -0x18(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, -0x24(%rbp)
movq -0x8(%rbp), %rcx
addq $0x14, %rcx
movl -0x1c(%rbp), %edx
addq %rdx, %rcx
addq $0x8, %rcx
movq %rcx, -0x30(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
movl %eax, %edi
movl $0x20, %esi
callq 0x10e0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
jne 0x3e5a
jmp 0x3e24
movq 0x71cd(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4646(%rip), %rsi      # 0x847b
leaq 0x4720(%rip), %rdx      # 0x855c
leaq 0x4ac0(%rip), %rcx      # 0x8903
movl $0x28c, %r8d            # imm = 0x28C
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x4043
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jge 0x3ed6
movl -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movl $0xffffffe3, %eax       # imm = 0xFFFFFFE3
cmpl %ecx, %eax
jb 0x3ed6
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
addl $0x1c, %eax
cmpl $-0x1, %eax
ja 0x3ed6
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subl %ecx, %eax
cmpl $0x4, %eax
jb 0x3ed6
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
addl $0x4, %eax
movl -0x1c(%rbp), %ecx
addl $0x14, %ecx
addl $0x8, %ecx
addl -0x20(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x3f0e
jmp 0x3ed8
movq 0x7119(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4592(%rip), %rsi      # 0x847b
leaq 0x45cf(%rip), %rdx      # 0x84bf
leaq 0x4a0c(%rip), %rcx      # 0x8903
movl $0x28e, %r8d            # imm = 0x28E
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3f54
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subl %ecx, %eax
cmpl -0x34(%rbp), %eax
jb 0x3f54
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
addl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl $0x14, %ecx
addl $0x8, %ecx
addl -0x20(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x3f8c
jmp 0x3f56
movq 0x709b(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4514(%rip), %rsi      # 0x847b
leaq 0x4551(%rip), %rdx      # 0x84bf
leaq 0x498e(%rip), %rcx      # 0x8903
movl $0x290, %r8d            # imm = 0x290
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x3fd8
movl -0x10(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x98(%rbp)
jmp 0x3fe3
xorl %eax, %eax
movq %rax, -0x98(%rbp)
jmp 0x3fe3
movl -0x80(%rbp), %edx
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rax
movl %eax, %ecx
leaq -0x58(%rbp), %rdi
callq 0x40a0
movq -0x90(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3e61
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x408e
jmp 0x4058
movq 0x6f99(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x4412(%rip), %rsi      # 0x847b
leaq 0x44fa(%rip), %rdx      # 0x856a
leaq 0x488c(%rip), %rcx      # 0x8903
movl $0x294, %r8d            # imm = 0x294
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
jmp 0x4090
movq -0x60(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)