// File: /workspace/github_c_makefile_star2_O0/pali[P]bmfdec/./bmfparse.c
// Function: parse_class
static struct mof_class parse_class(char *buf, uint32_t size, uint32_t offset) {
  struct mof_class out;
  memset(&out, 0, sizeof(out));
  uint32_t *buf2 = (uint32_t *)buf;
  if (size < 8) error("Invalid size");
  if (buf2[1] != 0x0) error("Invalid unknown");
  if (size < 20) {
    fprintf(stderr, "Warning: no class defined\n");
    return out;
  }
  uint32_t len1 = buf2[2];
  uint32_t len = buf2[3];
  if (!check_sum(20, len, size)) error("Invalid size");
  if (len1 > len) error("Invalid size");
  if (buf2[4] == 0x1) {
    fprintf(stderr, "Warning: Instance of class is not supported yet\n");
    return out;
  } else if (buf2[4] != 0x0) {
    fprintf(stderr, "Warning: Class has unknown value 0x%x\n", buf2[4]);
    return out;
  }
  out = parse_class_data(buf+20, len, len1, 1, offset ? offset+20 : 0);
  buf += 20 + len;
  size -= 20 + len;
  if (offset)
    offset += 20 + len;
  if (size < 4) error("Invalid size");
  buf2 = (uint32_t *)buf;
  len = buf2[0];
  if (len < 8 || len > size) error("Invalid size");
  uint32_t count = buf2[1];
  uint32_t i;
  buf += 8;
  size -= 8;
  if (offset)
    offset += 8;
  out.methods_count = count;
  out.methods = calloc(count, sizeof(*out.methods));
  if (!out.methods) error("calloc failed");
  for (i=0; i<count; ++i) {
    if (size < 4) error("Invalid size");
    uint32_t len1 = ((uint32_t *)buf)[0];
    if (len1 == 0 || len1 > size) error("Invalid size");
    out.methods[i] = parse_class_method(buf, len1, offset);
    buf += len1;
    size -= len1;
    if (offset)
      offset += len1;
  }
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xe8(%rbp)
movq %rdi, %rax
movq %rax, -0xe0(%rbp)
movq %rsi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
xorl %esi, %esi
movl $0x48, %edx
callq 0x10c0
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x8, -0xc(%rbp)
jae 0x2ea8
jmp 0x2e72
movq 0x817f(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x55f8(%rip), %rsi      # 0x847b
leaq 0x5635(%rip), %rdx      # 0x84bf
leaq 0x56ee(%rip), %rcx      # 0x857f
movl $0x2f9, %r8d            # imm = 0x2F9
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x18(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x2eea
jmp 0x2eb4
movq 0x813d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x55b6(%rip), %rsi      # 0x847b
leaq 0x5680(%rip), %rdx      # 0x854c
leaq 0x56ac(%rip), %rcx      # 0x857f
movl $0x2fa, %r8d            # imm = 0x2FA
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
cmpl $0x14, -0xc(%rbp)
jae 0x2f0d
movq 0x8101(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x568a(%rip), %rsi      # 0x858b
movb $0x0, %al
callq 0x1100
jmp 0x3307
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movl $0xffffffeb, %eax       # imm = 0xFFFFFFEB
cmpl -0x20(%rbp), %eax
jb 0x2f36
movl -0x20(%rbp), %eax
addl $0x14, %eax
cmpl -0xc(%rbp), %eax
jbe 0x2f6e
jmp 0x2f38
movq 0x80b9(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5532(%rip), %rsi      # 0x847b
leaq 0x556f(%rip), %rdx      # 0x84bf
leaq 0x5628(%rip), %rcx      # 0x857f
movl $0x301, %r8d            # imm = 0x301
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jbe 0x2fae
jmp 0x2f78
movq 0x8079(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x54f2(%rip), %rsi      # 0x847b
leaq 0x552f(%rip), %rdx      # 0x84bf
leaq 0x55e8(%rip), %rcx      # 0x857f
movl $0x302, %r8d            # imm = 0x302
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x18(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x2fd5
movq 0x8039(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x55dd(%rip), %rsi      # 0x85a6
movb $0x0, %al
callq 0x1100
jmp 0x3307
movq -0x18(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x3003
movq 0x8012(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x55e0(%rip), %rsi      # 0x85d7
movb $0x0, %al
callq 0x1100
jmp 0x3307
jmp 0x3005
movq -0x8(%rbp), %rax
addq $0x14, %rax
movq %rax, -0xf8(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0xf0(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xec(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x303a
movl -0x10(%rbp), %eax
addl $0x14, %eax
movl %eax, -0xfc(%rbp)
jmp 0x3044
xorl %eax, %eax
movl %eax, -0xfc(%rbp)
jmp 0x3044
movl -0xec(%rbp), %ecx
movl -0xf0(%rbp), %edx
movq -0xf8(%rbp), %rsi
movl -0xfc(%rbp), %r9d
leaq -0x68(%rbp), %rdi
movl $0x1, %r8d
callq 0x3320
movq -0xe8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x48, %edx
callq 0x1130
movl -0x20(%rbp), %ecx
addl $0x14, %ecx
movq -0x8(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x20(%rbp), %ecx
addl $0x14, %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x30b5
movl -0x20(%rbp), %eax
addl $0x14, %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x4, -0xc(%rbp)
jae 0x30f3
jmp 0x30bd
movq 0x7f34(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x53ad(%rip), %rsi      # 0x847b
leaq 0x53ea(%rip), %rdx      # 0x84bf
leaq 0x54a3(%rip), %rcx      # 0x857f
movl $0x30f, %r8d            # imm = 0x30F
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x8, -0x20(%rbp)
jb 0x3112
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jbe 0x314a
jmp 0x3114
movq 0x7edd(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x5356(%rip), %rsi      # 0x847b
leaq 0x5393(%rip), %rdx      # 0x84bf
leaq 0x544c(%rip), %rcx      # 0x857f
movl $0x312, %r8d            # imm = 0x312
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x8, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x3178
movl -0x10(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x10(%rbp)
movq -0xe8(%rbp), %rax
movl -0x6c(%rbp), %ecx
movl %ecx, 0x38(%rax)
movl -0x6c(%rbp), %eax
movl %eax, %edi
movl $0x60, %esi
callq 0x10e0
movq %rax, %rcx
movq -0xe8(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpq $0x0, 0x40(%rax)
jne 0x31e1
jmp 0x31ab
movq 0x7e46(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x52bf(%rip), %rsi      # 0x847b
leaq 0x5399(%rip), %rdx      # 0x855c
leaq 0x53b5(%rip), %rcx      # 0x857f
movl $0x31b, %r8d            # imm = 0x31B
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x3305
cmpl $0x4, -0xc(%rbp)
jae 0x3232
jmp 0x31fc
movq 0x7df5(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x526e(%rip), %rsi      # 0x847b
leaq 0x52ab(%rip), %rdx      # 0x84bf
leaq 0x5364(%rip), %rcx      # 0x857f
movl $0x31d, %r8d            # imm = 0x31D
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x3249
movl -0x74(%rbp), %eax
cmpl -0xc(%rbp), %eax
jbe 0x3281
jmp 0x324b
movq 0x7da6(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x521f(%rip), %rsi      # 0x847b
leaq 0x525c(%rip), %rdx      # 0x84bf
leaq 0x5315(%rip), %rcx      # 0x857f
movl $0x31f, %r8d            # imm = 0x31F
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x1180
movq -0xe8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x70(%rbp), %ecx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
movq -0x8(%rbp), %rsi
movl -0x74(%rbp), %edx
movl -0x10(%rbp), %ecx
leaq -0xd8(%rbp), %rdi
callq 0x3b10
movq -0x108(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movl $0x60, %edx
callq 0x1130
movl -0x74(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl -0x74(%rbp), %ecx
movl -0xc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x32f5
movl -0x74(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0x32f7
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x31e8
jmp 0x3307
movq -0xe0(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)