// File: /workspace/github_c_makefile_star2_O3/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 0x5c9f
movl %esi, %ebp
movq %rdi, %r15
movl (%rdi), %eax
decl %eax
cmpl %esi, %eax
jae 0x5ca4
cmpl $0x0, 0x8(%r15)
jne 0x5c9a
cmpl $-0x1, 0x10(%r15)
jne 0x5c9a
movl 0xc(%r15), %r12d
movl %r12d, %eax
shrl $0x2, %eax
cmpl $0x3ffffffa, %eax       # imm = 0x3FFFFFFA
ja 0x5ca9
leal 0x14(%r12), %eax
cmpl %ebp, %eax
ja 0x5ca9
movq %rdx, %r14
movl 0x4(%r15), %r13d
addq $0x14, %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x5d8b
movq %rax, %rbx
cmpl $0x3, %r13d
je 0x5bf0
cmpl $0x8, %r13d
jne 0x5c24
addq %r12, %r15
subl %r12d, %ebp
addl $-0x14, %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x5d8b
movq %rax, %r15
leaq 0x1a15(%rip), %rsi      # 0x75ca
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x5c19
leaq 0x1a0a(%rip), %rsi      # 0x75d2
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
je 0x5c1e
leaq 0x1a03(%rip), %rsi      # 0x75de
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x5c61
movq %r15, 0x10(%r14)
jmp 0x5c84
subl %r12d, %ebp
cmpl $0x18, %ebp
jne 0x5cae
leaq 0x1a11(%rip), %rsi      # 0x7614
movq %rbx, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x5c44
movl (%r15,%r12), %eax
movl %eax, 0x18(%r14)
jmp 0x5c84
movq %r15, (%r14)
jmp 0x5c84
movq %r15, 0x8(%r14)
jmp 0x5c84
movq 0x53cd(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x19ec(%rip), %rsi      # 0x7621
movl %r13d, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1100
jmp 0x5c84
movq 0x53ad(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1996(%rip), %rsi      # 0x75eb
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1100
jmp 0x5c84
movq 0x5390(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x1979(%rip), %rsi      # 0x75eb
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 0x2730
callq 0x27cf
callq 0x26fb
callq 0x279a
callq 0x2765