// File: /workspace/github_c_makefile_star2_O1/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 0x5bcf
movl %esi, %ebp
movq %rdi, %r15
movl (%rdi), %eax
decl %eax
cmpl %esi, %eax
jae 0x5bd4
cmpl $0x0, 0x8(%r15)
jne 0x5bca
cmpl $-0x1, 0x10(%r15)
jne 0x5bca
movl 0xc(%r15), %r12d
movl %r12d, %eax
shrl $0x2, %eax
cmpl $0x3ffffffa, %eax       # imm = 0x3FFFFFFA
ja 0x5bd9
leal 0x14(%r12), %eax
cmpl %ebp, %eax
ja 0x5bd9
movq %rdx, %r14
movl 0x4(%r15), %r13d
addq $0x14, %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x5cbb
movq %rax, %rbx
cmpl $0x3, %r13d
je 0x5b20
cmpl $0x8, %r13d
jne 0x5b54
addq %r12, %r15
subl %r12d, %ebp
addl $-0x14, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x5cbb
movq %rax, %r15
leaq 0x1ae8(%rip), %rsi      # 0x75cd
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x5b49
leaq 0x1add(%rip), %rsi      # 0x75d5
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x5b4e
leaq 0x1ad6(%rip), %rsi      # 0x75e1
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x5b91
movq %r15, 0x10(%r14)
jmp 0x5bb4
subl %r12d, %ebp
cmpl $0x18, %ebp
jne 0x5bde
leaq 0x1ae4(%rip), %rsi      # 0x7617
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x5b74
movl (%r15,%r12), %eax
movl %eax, 0x18(%r14)
jmp 0x5bb4
movq %r15, (%r14)
jmp 0x5bb4
movq %r15, 0x8(%r14)
jmp 0x5bb4
movq 0x549d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1abf(%rip), %rsi      # 0x7624
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1100
jmp 0x5bb4
movq 0x547d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1a69(%rip), %rsi      # 0x75ee
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x5bb4
movq 0x5460(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1a4c(%rip), %rsi      # 0x75ee
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
callq 0x2778
callq 0x2817
callq 0x2743
callq 0x27e2
callq 0x27ad