// File: devinsmith[P]qvdreader/QvdField.cpp
// Function: QvdField::ParseXml(_xmlNode const*)
void QvdField::ParseXml(const xmlNode *node)
{
  for (const xmlNode *child = node->children; child; child = child->next) {
    if (child->type == XML_ELEMENT_NODE) {
      xmlChar *nodeContent = xmlNodeGetContent(child);
      if (nodeContent == NULL)
        continue;

      if (strlen((char *)nodeContent) == 0) {
        xmlFree(nodeContent);
        continue;
      }

      if (strcmp((char *)child->name, "FieldName") == 0) {
        FieldName = (char *)nodeContent;
      } else if (strcmp((char *)child->name, "BitOffset") == 0) {
        BitOffset = atoi((char *)nodeContent);
      } else if (strcmp((char *)child->name, "BitWidth") == 0) {
        BitWidth = atoi((char *)nodeContent);
      } else if (strcmp((char *)child->name, "Bias") == 0) {
        Bias = atoi((char *)nodeContent);
      } else if (strcmp((char *)child->name, "NoOfSymbols") == 0) {
        NoOfSymbols = atoi((char *)nodeContent);

        if (NoOfSymbols > 0) {
          Symbols.reserve(NoOfSymbols);
        }
      } else if (strcmp((char *)child->name, "Offset") == 0) {
        Offset = atoi((char *)nodeContent);
      } else if (strcmp((char *)child->name, "Length") == 0) {
        Length = atoi((char *)nodeContent);
      } else if (strcmp((char *)child->name, "NumberFormat") == 0) {
        ParseNumberFormat(child);
      } else {
        printf("Unprocessed QvdFieldHeader tag: %s\n", child->name);
      }
      xmlFree(nodeContent);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xcaeb
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0xcad8
movq -0x18(%rbp), %rdi
callq 0xabb0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xc8e6
jmp 0xcada
movq -0x20(%rbp), %rdi
callq 0xa4c0
cmpq $0x0, %rax
jne 0xc90a
movq 0xb6e4(%rip), %rax      # 0x17fe0
movq (%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
jmp 0xcada
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x678f(%rip), %rsi      # 0x130a8
callq 0xaf40
cmpl $0x0, %eax
jne 0xc935
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xae60
jmp 0xcac8
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x676e(%rip), %rsi      # 0x130b2
callq 0xaf40
cmpl $0x0, %eax
jne 0xc965
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0xcac6
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x6748(%rip), %rsi      # 0x130bc
callq 0xaf40
cmpl $0x0, %eax
jne 0xc995
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0xcac4
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x6721(%rip), %rsi      # 0x130c5
callq 0xaf40
cmpl $0x0, %eax
jne 0xc9c5
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0xcac2
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x66f6(%rip), %rsi      # 0x130ca
callq 0xaf40
cmpl $0x0, %eax
jne 0xca1c
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x98(%rax)
cmpl $0x0, 0x98(%rax)
jbe 0xca17
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0xa8, %rdi
movl 0x98(%rax), %eax
movl %eax, %esi
callq 0xa790
jmp 0xcac0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x668a(%rip), %rsi      # 0x130b5
callq 0xaf40
cmpl $0x0, %eax
jne 0xca4c
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x9c(%rax)
jmp 0xcabe
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x667b(%rip), %rsi      # 0x130d6
callq 0xaf40
cmpl $0x0, %eax
jne 0xca7c
movq -0x20(%rbp), %rdi
callq 0xb0b0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xa0(%rax)
jmp 0xcabc
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x6652(%rip), %rsi      # 0x130dd
callq 0xaf40
cmpl $0x0, %eax
jne 0xcaa4
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb170
jmp 0xcaba
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x6637(%rip), %rdi      # 0x130ea
movb $0x0, %al
callq 0xa070
jmp 0xcabc
jmp 0xcabe
jmp 0xcac0
jmp 0xcac2
jmp 0xcac4
jmp 0xcac6
jmp 0xcac8
movq 0xb511(%rip), %rax      # 0x17fe0
movq (%rax), %rax
movq -0x20(%rbp), %rdi
callq *%rax
jmp 0xcada
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xc8b4
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)