// File: /workspace/github_c_makefile_star2_O2/pali[P]bmfdec/./bmfparse.c
// Function: parse_class_property
static void parse_class_property(char *buf, uint32_t size, struct mof_class *out) {
  uint32_t *buf2 = (uint32_t *)buf;
  if (size < 20) error("Invalid size");
  uint32_t len = buf2[0];
  if (len == 0 || size < len) error("Invalid size");
  if (buf2[2] != 0x0 || buf2[4] != 0xFFFFFFFF) error("Invalid unknown");
  uint32_t type = buf2[1];
  uint32_t slen = buf2[3];
  if (!check_sum(20, slen, size)) error("Invalid size");
  char *name = parse_string(buf+20, slen);
  if (type == 0x08) {
    char *value = parse_string(buf+20+slen, size-slen-20);
    if (strcmp(name, "__CLASS") == 0) {
      out->name = value;
    } else if (strcmp(name, "__NAMESPACE") == 0) {
      out->namespace = value;
    } else if (strcmp(name, "__SUPERCLASS") == 0) {
      out->superclassname = value;
    } else {
      fprintf(stderr, "Warning: Unknown class property name %s\n", name);
      free(value);
    }
  } else if (type == 0x03) {
    if (size-slen-20 != 4) error("Invalid size");
    int32_t value = *((int32_t *)(buf+20+slen));
    if (strcmp(name, "__CLASSFLAGS") == 0) {
      out->classflags = value;
    } else {
      fprintf(stderr, "Warning: Unknown class property name %s\n", name);
    }
  } else {
    fprintf(stderr, "Warning: Unknown class property type 0x%x for name %s\n", type, name);
  }
  free(name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x13, %esi
jbe 0x4e72
movl %esi, %ebp
movq %rdi, %r15
movl (%rdi), %eax
decl %eax
cmpl %esi, %eax
jae 0x4e99
cmpl $0x0, 0x8(%r15)
jne 0x4e48
cmpl $-0x1, 0x10(%r15)
jne 0x4e48
movl 0xc(%r15), %r12d
movl %r12d, %eax
shrl $0x2, %eax
cmpl $0x3ffffffa, %eax       # imm = 0x3FFFFFFA
ja 0x4ec0
leal 0x14(%r12), %eax
cmpl %ebp, %eax
ja 0x4ec0
movq %rdx, %r14
movl 0x4(%r15), %r13d
addq $0x14, %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x5023
movq %rax, %rbx
cmpl $0x3, %r13d
je 0x4d9e
cmpl $0x8, %r13d
jne 0x4dd2
addq %r12, %r15
subl %r12d, %ebp
addl $-0x14, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x5023
movq %rax, %r15
leaq 0x1867(%rip), %rsi      # 0x65ca
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x4dc7
leaq 0x185c(%rip), %rsi      # 0x65d2
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x4dcc
leaq 0x1855(%rip), %rsi      # 0x65de
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x4e0f
movq %r15, 0x10(%r14)
jmp 0x4e32
subl %r12d, %ebp
cmpl $0x18, %ebp
jne 0x4ee7
leaq 0x1863(%rip), %rsi      # 0x6614
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x4df2
movl (%r15,%r12), %eax
movl %eax, 0x18(%r14)
jmp 0x4e32
movq %r15, (%r14)
jmp 0x4e32
movq %r15, 0x8(%r14)
jmp 0x4e32
movq 0x421f(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x183e(%rip), %rsi      # 0x6621
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1100
jmp 0x4e32
movq 0x41ff(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x17e8(%rip), %rsi      # 0x65eb
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x4e32
movq 0x41e2(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x17cb(%rip), %rsi      # 0x65eb
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
movq 0x41a9(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x149f(%rip), %rsi      # 0x62f8
leaq 0x1569(%rip), %rdx      # 0x63c9
leaq 0x174e(%rip), %rcx      # 0x65b5
movl $0x29d, %r8d            # imm = 0x29D
jmp 0x4f0c
movq 0x417f(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x1475(%rip), %rsi      # 0x62f8
leaq 0x14b2(%rip), %rdx      # 0x633c
leaq 0x1724(%rip), %rcx      # 0x65b5
movl $0x29a, %r8d            # imm = 0x29A
jmp 0x4f0c
movq 0x4158(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x144e(%rip), %rsi      # 0x62f8
leaq 0x148b(%rip), %rdx      # 0x633c
leaq 0x16fd(%rip), %rcx      # 0x65b5
movl $0x29c, %r8d            # imm = 0x29C
jmp 0x4f0c
movq 0x4131(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x1427(%rip), %rsi      # 0x62f8
leaq 0x1464(%rip), %rdx      # 0x633c
leaq 0x16d6(%rip), %rcx      # 0x65b5
movl $0x2a0, %r8d            # imm = 0x2A0
jmp 0x4f0c
movq 0x410a(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x1400(%rip), %rsi      # 0x62f8
leaq 0x143d(%rip), %rdx      # 0x633c
leaq 0x16af(%rip), %rcx      # 0x65b5
movl $0x2af, %r8d            # imm = 0x2AF
xorl %eax, %eax
callq 0x1100
pushq $0x1
popq %rdi
callq 0x1170