// File: FreeSlave[P]def2fgd/src/entreader.cpp
// Function: readEntFile(std::istream&)
std::vector<Entity> readEntFile(std::istream& stream)
{
    std::vector<char> input((std::istreambuf_iterator<char>(stream)), std::istreambuf_iterator<char>());
    std::vector<Entity> toReturn;

    xml_document<> doc;
    doc.parse<parse_trim_whitespace>(&input[0]);

    xml_node<>* classes = doc.first_node("classes");
    if (!classes)
        throw std::runtime_error(translate("No 'classes' entry found"));

    for (xml_node<>* entityNode = classes->first_node(); entityNode; entityNode = entityNode->next_sibling())
    {
        Entity entity;

        entity.description = descriptionLines(std::string(entityNode->value(), entityNode->value_size()));

        if (hasName(entityNode, "point"))
            entity.solid = false;
        else if (hasName(entityNode, "group"))
            entity.solid = true;

        xml_attribute<>* nameAttr = entityNode->first_attribute("name");
        if (!nameAttr)
            continue; // no name, nothing to do here

        entity.name = valueString(nameAttr);

        xml_attribute<>* colorAttr = entityNode->first_attribute("color");
        if (colorAttr)
            readColor(colorAttr->value(), colorAttr->value_size(), entity.color);

        xml_attribute<>* boxAttr = entityNode->first_attribute("box");
        if (boxAttr)
            readBox(boxAttr->value(), boxAttr->value_size(), entity.box);

        xml_attribute<>* modelAttr = entityNode->first_attribute("model");
        if (modelAttr) {
            entity.model = valueString(modelAttr);
        }

        for (xml_node<>* keyNode = entityNode->first_node(); keyNode; keyNode = keyNode->next_sibling())
        {
            if (hasName(keyNode, "flag"))
            {
                xml_attribute<>* keyAttr = keyNode->first_attribute("key");
                xml_attribute<>* bitAttr = keyNode->first_attribute("bit");

                if (keyAttr && bitAttr)
                {
                    size_t flagnum = static_cast<size_t>(strtol(bitAttr->value(), NULL, 10));
                    if (flagnum < Entity::SpawnFlagNum)
                    {
                        entity.spawnflags[flagnum] = valueString(keyAttr);
                        entity.flagsdescriptions[flagnum] = withoutQuotes(valueString(keyNode));
                    }
                }
            }
            else
            {
                xml_attribute<>* keyAttr = keyNode->first_attribute("key");
                if (keyAttr)
                {
                    entity.keys.push_back(Key(
                        valueString(keyAttr),
                        withoutQuotes(valueString(keyNode)),
                        entTypeToFgdType(keyNode->name(), keyNode->name_size())
                    ));
                }
            }
        }

        xml_node<>* lastNode = entityNode->last_node();
        if (lastNode && lastNode->name_size() == 0)
        {
            std::string val = valueString(lastNode);
            size_t pos = val.find("modeldisabled=");
            if (pos != std::string::npos && entity.model.empty())
            {
                std::string::iterator it = val.begin() + pos + strlen("modeldisabled=");
                if (*it == '"')
                {
                    it++;
                    std::string::iterator start = it;
                    while(it != val.end() && *it != '"')
                        it++;
                    std::string modelname(start, it);
                    entity.model = modelname;
                }
            }
            if (pos != std::string::npos) {
                val.resize(pos);
            }
            if (val.size()) {
                if (entity.description.size()) {
                    entity.description += "\\n\\n";
                }
                entity.description += descriptionLines(val);
            }
        }

        toReturn.push_back(entity);
    }

    return toReturn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10de0, %rsp          # imm = 0x10DE0
movq %rdi, -0x10cb8(%rbp)
movq %rdi, %rax
movq %rax, -0x10cb0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xfd90
leaq -0x48(%rbp), %rdi
callq 0xfdf0
leaq -0x49(%rbp), %rdi
movq %rdi, -0x10ca8(%rbp)
callq 0x4600
movq -0x10ca8(%rbp), %r9
movq -0x38(%rbp), %rsi
movl -0x30(%rbp), %edx
movq -0x48(%rbp), %rcx
movl -0x40(%rbp), %r8d
leaq -0x28(%rbp), %rdi
callq 0xfe20
jmp 0xeb9b
leaq -0x49(%rbp), %rdi
callq 0x4390
movq -0x10cb8(%rbp), %rdi
movb $0x0, -0x5d(%rbp)
callq 0x78d0
leaq -0x100e8(%rbp), %rdi
callq 0xfeb0
jmp 0xebc2
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x10000
movq %rax, %rsi
leaq -0x100e8(%rbp), %rdi
callq 0xfee0
jmp 0xebe0
leaq 0x6d1e(%rip), %rsi      # 0x15905
xorl %eax, %eax
movl %eax, %edx
leaq -0x100e8(%rbp), %rdi
movl $0x1, %ecx
callq 0x10020
movq %rax, -0x10cc0(%rbp)
jmp 0xec05
movq -0x10cc0(%rbp), %rax
movq %rax, -0x100f0(%rbp)
cmpq $0x0, -0x100f0(%rbp)
jne 0xed07
movb $0x1, -0x10111(%rbp)
movl $0x10, %edi
callq 0x41a0
movq %rax, -0x10cc8(%rbp)
leaq 0x6ccd(%rip), %rsi      # 0x1590d
leaq -0x10110(%rbp), %rdi
callq 0x140e0
jmp 0xec4e
movq -0x10cc8(%rbp), %rdi
leaq -0x10110(%rbp), %rsi
callq 0x4570
jmp 0xec63
movq -0x10cc8(%rbp), %rdi
movb $0x0, -0x10111(%rbp)
movq 0xe378(%rip), %rsi      # 0x1cff0
movq 0xe331(%rip), %rdx      # 0x1cfb0
callq 0x45d0
jmp 0xf958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x4390
jmp 0xf94f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf93a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf907
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xeceb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10110(%rbp), %rdi
callq 0x41f0
testb $0x1, -0x10111(%rbp)
jne 0xecf6
jmp 0xed02
movq -0x10cc8(%rbp), %rdi
callq 0x4260
jmp 0xf907
movq -0x100f0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x10020
movq %rax, -0x10cd0(%rbp)
jmp 0xed28
movq -0x10cd0(%rbp), %rax
movq %rax, -0x10120(%rbp)
cmpq $0x0, -0x10120(%rbp)
je 0xf8e5
leaq -0x109c0(%rbp), %rdi
callq 0xe010
jmp 0xed52
movq -0x10120(%rbp), %rdi
callq 0x10100
movq %rax, -0x10cd8(%rbp)
jmp 0xed67
movq -0x10120(%rbp), %rdi
callq 0x10140
movq %rax, -0x10ce0(%rbp)
jmp 0xed7c
leaq -0x10a01(%rbp), %rdi
movq %rdi, -0x10ce8(%rbp)
callq 0x4600
movq -0x10cd8(%rbp), %rsi
movq -0x10ce0(%rbp), %rdx
movq -0x10ce8(%rbp), %rcx
leaq -0x10a00(%rbp), %rdi
callq 0x43e0
jmp 0xedb2
leaq -0x109e0(%rbp), %rdi
leaq -0x10a00(%rbp), %rsi
callq 0xe800
jmp 0xedc7
leaq -0x109a0(%rbp), %rdi
leaq -0x109e0(%rbp), %rsi
movq %rsi, -0x10cf8(%rbp)
callq 0x4420
movq -0x10cf8(%rbp), %rdi
callq 0x41f0
leaq -0x10a00(%rbp), %rdi
callq 0x41f0
leaq -0x10a01(%rbp), %rdi
callq 0x4390
movq -0x10120(%rbp), %rdi
leaq 0x6ae5(%rip), %rsi      # 0x158f8
callq 0xf960
movb %al, -0x10ce9(%rbp)
jmp 0xee20
movb -0x10ce9(%rbp), %al
testb $0x1, %al
jne 0xee2c
jmp 0xee7d
movb $0x0, -0x10144(%rbp)
jmp 0xeead
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf8d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xee6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10a00(%rbp), %rdi
callq 0x41f0
leaq -0x10a01(%rbp), %rdi
callq 0x4390
jmp 0xf8d7
movq -0x10120(%rbp), %rdi
leaq 0x6a9b(%rip), %rsi      # 0x15926
callq 0xf960
movb %al, -0x10cf9(%rbp)
jmp 0xee98
movb -0x10cf9(%rbp), %al
testb $0x1, %al
jne 0xeea4
jmp 0xeeab
movb $0x1, -0x10144(%rbp)
jmp 0xeead
movq -0x10120(%rbp), %rdi
leaq 0x6bbc(%rip), %rsi      # 0x15a77
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d08(%rbp)
jmp 0xeed2
movq -0x10d08(%rbp), %rax
movq %rax, -0x10a10(%rbp)
cmpq $0x0, -0x10a10(%rbp)
jne 0xeef9
movl $0x4, -0x10a14(%rbp)
jmp 0xf887
movq -0x10a10(%rbp), %rsi
leaq -0x10a38(%rbp), %rdi
callq 0xf9b0
jmp 0xef0e
leaq -0x109c0(%rbp), %rdi
leaq -0x10a38(%rbp), %rsi
movq %rsi, -0x10d18(%rbp)
callq 0x4420
movq -0x10d18(%rbp), %rdi
callq 0x41f0
movq -0x10120(%rbp), %rdi
leaq 0x6174(%rip), %rsi      # 0x150b6
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d10(%rbp)
jmp 0xef59
movq -0x10d10(%rbp), %rax
movq %rax, -0x10a40(%rbp)
cmpq $0x0, -0x10a40(%rbp)
je 0xefb9
movq -0x10a40(%rbp), %rdi
callq 0x10100
movq %rax, -0x10d20(%rbp)
jmp 0xef86
movq -0x10a40(%rbp), %rdi
callq 0x10140
movq %rax, -0x10d28(%rbp)
jmp 0xef9b
movq -0x10d28(%rbp), %rsi
movq -0x10d20(%rbp), %rdi
leaq -0x10168(%rbp), %rdx
callq 0xfa40
jmp 0xefb7
jmp 0xefb9
movq -0x10120(%rbp), %rdi
leaq 0x6965(%rip), %rsi      # 0x1592c
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d30(%rbp)
jmp 0xefde
movq -0x10d30(%rbp), %rax
movq %rax, -0x10a48(%rbp)
cmpq $0x0, -0x10a48(%rbp)
je 0xf03e
movq -0x10a48(%rbp), %rdi
callq 0x10100
movq %rax, -0x10d38(%rbp)
jmp 0xf00b
movq -0x10a48(%rbp), %rdi
callq 0x10140
movq %rax, -0x10d40(%rbp)
jmp 0xf020
movq -0x10d40(%rbp), %rsi
movq -0x10d38(%rbp), %rdi
leaq -0x1015c(%rbp), %rdx
callq 0xfb70
jmp 0xf03c
jmp 0xf03e
movq -0x10120(%rbp), %rdi
leaq 0x60af(%rip), %rsi      # 0x150fb
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d48(%rbp)
jmp 0xf063
movq -0x10d48(%rbp), %rax
movq %rax, -0x10a50(%rbp)
cmpq $0x0, -0x10a50(%rbp)
je 0xf0b6
movq -0x10a50(%rbp), %rsi
leaq -0x10a70(%rbp), %rdi
callq 0xf9b0
jmp 0xf090
leaq -0x109c0(%rbp), %rdi
addq $0x880, %rdi            # imm = 0x880
leaq -0x10a70(%rbp), %rsi
callq 0x4420
leaq -0x10a70(%rbp), %rdi
callq 0x41f0
movq -0x10120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x10020
movq %rax, -0x10d50(%rbp)
jmp 0xf0d7
movq -0x10d50(%rbp), %rax
movq %rax, -0x10a78(%rbp)
cmpq $0x0, -0x10a78(%rbp)
je 0xf517
movq -0x10a78(%rbp), %rdi
leaq 0x682f(%rip), %rsi      # 0x15930
callq 0xf960
movb %al, -0x10d51(%rbp)
jmp 0xf10e
movb -0x10d51(%rbp), %al
testb $0x1, %al
jne 0xf11d
jmp 0xf2b5
movq -0x10a78(%rbp), %rdi
leaq 0x680a(%rip), %rsi      # 0x15935
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d60(%rbp)
jmp 0xf142
movq -0x10d60(%rbp), %rax
movq %rax, -0x10a80(%rbp)
movq -0x10a78(%rbp), %rdi
leaq 0x67db(%rip), %rsi      # 0x15939
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d68(%rbp)
jmp 0xf175
movq -0x10d68(%rbp), %rax
movq %rax, -0x10a88(%rbp)
cmpq $0x0, -0x10a80(%rbp)
je 0xf2b0
cmpq $0x0, -0x10a88(%rbp)
je 0xf2b0
movq -0x10a88(%rbp), %rdi
callq 0x10100
movq %rax, -0x10d70(%rbp)
jmp 0xf1b4
movq -0x10d70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x44e0
movq %rax, -0x10a90(%rbp)
cmpq $0x20, -0x10a90(%rbp)
jae 0xf2ae
movq -0x10a80(%rbp), %rsi
leaq -0x10ab0(%rbp), %rdi
callq 0xf9b0
jmp 0xf1f3
movq -0x10a90(%rbp), %rax
shlq $0x5, %rax
leaq -0x10968(%rbp,%rax), %rdi
leaq -0x10ab0(%rbp), %rsi
movq %rsi, -0x10d78(%rbp)
callq 0x4420
movq -0x10d78(%rbp), %rdi
callq 0x41f0
movq -0x10a78(%rbp), %rsi
leaq -0x10af0(%rbp), %rdi
callq 0xf9b0
jmp 0xf23a
leaq -0x10ad0(%rbp), %rdi
leaq -0x10af0(%rbp), %rsi
callq 0xde40
jmp 0xf24f
leaq -0x109c0(%rbp), %rdi
addq $0x458, %rdi            # imm = 0x458
movq -0x10a90(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x10ad0(%rbp), %rsi
callq 0x4420
leaq -0x10ad0(%rbp), %rdi
callq 0x41f0
leaq -0x10af0(%rbp), %rdi
callq 0x41f0
jmp 0xf2ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10af0(%rbp), %rdi
callq 0x41f0
jmp 0xf8d7
jmp 0xf2b0
jmp 0xf4e1
movq -0x10a78(%rbp), %rdi
leaq 0x6672(%rip), %rsi      # 0x15935
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x10180
movq %rax, -0x10d80(%rbp)
jmp 0xf2da
movq -0x10d80(%rbp), %rax
movq %rax, -0x10af8(%rbp)
cmpq $0x0, -0x10af8(%rbp)
je 0xf4df
leaq -0x10980(%rbp), %rax
movq %rax, -0x10d88(%rbp)
movq -0x10af8(%rbp), %rsi
leaq -0x10b78(%rbp), %rdi
callq 0xf9b0
jmp 0xf319
movq -0x10a78(%rbp), %rsi
leaq -0x10bb8(%rbp), %rdi
callq 0xf9b0
jmp 0xf32e
leaq -0x10b98(%rbp), %rdi
leaq -0x10bb8(%rbp), %rsi
callq 0xde40
jmp 0xf343
movq -0x10a78(%rbp), %rdi
callq 0x10250
movq %rax, -0x10d90(%rbp)
jmp 0xf358
movq -0x10a78(%rbp), %rdi
callq 0x10290
movq %rax, -0x10d98(%rbp)
jmp 0xf36d
movq -0x10d98(%rbp), %rsi
movq -0x10d90(%rbp), %rdi
callq 0xfca0
movq %rax, -0x10da0(%rbp)
jmp 0xf389
leaq -0x10bd9(%rbp), %rdi
movq %rdi, -0x10da8(%rbp)
callq 0x4600
movq -0x10da0(%rbp), %rsi
movq -0x10da8(%rbp), %rdx
leaq -0x10bd8(%rbp), %rdi
callq 0x74f0
jmp 0xf3b8
leaq -0x10b58(%rbp), %rdi
leaq -0x10b78(%rbp), %rsi
leaq -0x10b98(%rbp), %rdx
leaq -0x10bd8(%rbp), %rcx
callq 0xdf70
jmp 0xf3db
movq -0x10d88(%rbp), %rdi
leaq -0x10b58(%rbp), %rsi
callq 0x75a0
jmp 0xf3f0
leaq -0x10b58(%rbp), %rdi
callq 0x75d0
leaq -0x10bd8(%rbp), %rdi
callq 0x41f0
leaq -0x10bd9(%rbp), %rdi
callq 0x4390
leaq -0x10b98(%rbp), %rdi
callq 0x41f0
leaq -0x10bb8(%rbp), %rdi
callq 0x41f0
leaq -0x10b78(%rbp), %rdi
callq 0x41f0
jmp 0xf4df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf4ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf4c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf4b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf4aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf49e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10b58(%rbp), %rdi
callq 0x75d0
leaq -0x10bd8(%rbp), %rdi
callq 0x41f0
leaq -0x10bd9(%rbp), %rdi
callq 0x4390
leaq -0x10b98(%rbp), %rdi
callq 0x41f0
leaq -0x10bb8(%rbp), %rdi
callq 0x41f0
leaq -0x10b78(%rbp), %rdi
callq 0x41f0
jmp 0xf8d7
jmp 0xf4e1
jmp 0xf4e3
movq -0x10a78(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x102d0
movq %rax, -0x10db0(%rbp)
jmp 0xf504
movq -0x10db0(%rbp), %rax
movq %rax, -0x10a78(%rbp)
jmp 0xf0e5
movq -0x10120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x103c0
movq %rax, -0x10db8(%rbp)
jmp 0xf538
movq -0x10db8(%rbp), %rax
movq %rax, -0x10be8(%rbp)
cmpq $0x0, -0x10be8(%rbp)
je 0xf868
movq -0x10be8(%rbp), %rdi
callq 0x10290
movq %rax, -0x10dc0(%rbp)
jmp 0xf569
movq -0x10dc0(%rbp), %rax
cmpq $0x0, %rax
jne 0xf868
movq -0x10be8(%rbp), %rsi
leaq -0x10c08(%rbp), %rdi
callq 0xf9b0
jmp 0xf58f
leaq -0x10c08(%rbp), %rdi
leaq 0x63a0(%rip), %rsi      # 0x1593d
xorl %eax, %eax
movl %eax, %edx
callq 0x4650
movq %rax, -0x10c10(%rbp)
cmpq $-0x1, -0x10c10(%rbp)
je 0xf789
leaq -0x109c0(%rbp), %rdi
addq $0x880, %rdi            # imm = 0x880
callq 0x45a0
testb $0x1, %al
jne 0xf5d7
jmp 0xf789
leaq -0x10c08(%rbp), %rdi
callq 0x42c0
movq %rax, -0x10c28(%rbp)
movq -0x10c10(%rbp), %rsi
leaq -0x10c28(%rbp), %rdi
callq 0x104c0
movq %rax, -0x10c20(%rbp)
leaq -0x10c20(%rbp), %rdi
movl $0xe, %esi
callq 0x104c0
movq %rax, -0x10c18(%rbp)
leaq -0x10c18(%rbp), %rdi
callq 0xc670
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xf787
leaq -0x10c18(%rbp), %rdi
xorl %esi, %esi
callq 0xc690
movq %rax, -0x10c30(%rbp)
movq -0x10c18(%rbp), %rax
movq %rax, -0x10c38(%rbp)
leaq -0x10c08(%rbp), %rdi
callq 0x41d0
movq %rax, -0x10c40(%rbp)
leaq -0x10c18(%rbp), %rdi
leaq -0x10c40(%rbp), %rsi
callq 0xc630
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x10dc1(%rbp)
jne 0xf68e
jmp 0xf6a9
leaq -0x10c18(%rbp), %rdi
callq 0xc670
movsbl (%rax), %eax
cmpl $0x22, %eax
setne %al
movb %al, -0x10dc1(%rbp)
movb -0x10dc1(%rbp), %al
testb $0x1, %al
jne 0xf6b5
jmp 0xf6cc
leaq -0x10c18(%rbp), %rdi
xorl %esi, %esi
callq 0xc690
movq %rax, -0x10c48(%rbp)
jmp 0xf657
movq -0x10c38(%rbp), %rax
movq %rax, -0x10c70(%rbp)
movq -0x10c18(%rbp), %rax
movq %rax, -0x10c78(%rbp)
leaq -0x10c79(%rbp), %rdi
movq %rdi, -0x10dd0(%rbp)
callq 0x4600
movq -0x10dd0(%rbp), %rcx
movq -0x10c70(%rbp), %rsi
movq -0x10c78(%rbp), %rdx
leaq -0x10c68(%rbp), %rdi
callq 0xc770
jmp 0xf71e
leaq -0x10c79(%rbp), %rdi
callq 0x4390
leaq -0x10140(%rbp), %rdi
leaq -0x10c68(%rbp), %rsi
callq 0x4040
jmp 0xf73f
leaq -0x10c68(%rbp), %rdi
callq 0x41f0
jmp 0xf787
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10c79(%rbp), %rdi
callq 0x4390
jmp 0xf85a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10c68(%rbp), %rdi
callq 0x41f0
jmp 0xf85a
jmp 0xf789
cmpq $-0x1, -0x10c10(%rbp)
je 0xf7bb
movq -0x10c10(%rbp), %rsi
leaq -0x10c08(%rbp), %rdi
callq 0x44b0
jmp 0xf7a8
jmp 0xf7bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xf85a
leaq -0x10c08(%rbp), %rdi
callq 0x4240
cmpq $0x0, %rax
je 0xf84c
leaq -0x109c0(%rbp), %rdi
addq $0x20, %rdi
callq 0x4240
cmpq $0x0, %rax
je 0xf7fa
leaq -0x109a0(%rbp), %rdi
leaq 0x60aa(%rip), %rsi      # 0x1589b
callq 0x4300
jmp 0xf7f8
jmp 0xf7fa
leaq -0x10ca0(%rbp), %rdi
leaq -0x10c08(%rbp), %rsi
callq 0xe800
jmp 0xf80f
leaq -0x109a0(%rbp), %rdi
leaq -0x10ca0(%rbp), %rsi
callq 0x4460
jmp 0xf824
leaq -0x10ca0(%rbp), %rdi
callq 0x41f0
jmp 0xf84c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x10ca0(%rbp), %rdi
callq 0x41f0
jmp 0xf85a
leaq -0x10c08(%rbp), %rdi
callq 0x41f0
jmp 0xf868
leaq -0x10c08(%rbp), %rdi
callq 0x41f0
jmp 0xf8d7
movq -0x10cb8(%rbp), %rdi
leaq -0x109c0(%rbp), %rsi
callq 0xc490
jmp 0xf87d
movl $0x0, -0x10a14(%rbp)
leaq -0x109c0(%rbp), %rdi
callq 0x7780
movl -0x10a14(%rbp), %eax
testl %eax, %eax
je 0xf8a1
jmp 0xf89f
jmp 0xf8a3
jmp 0xf8a3
movq -0x10120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x102d0
movq %rax, -0x10dd8(%rbp)
jmp 0xf8c4
movq -0x10dd8(%rbp), %rax
movq %rax, -0x10120(%rbp)
jmp 0xed36
leaq -0x109c0(%rbp), %rdi
callq 0x7780
jmp 0xf907
movb $0x1, -0x5d(%rbp)
movl $0x1, -0x10a14(%rbp)
leaq -0x100e8(%rbp), %rdi
callq 0x10500
testb $0x1, -0x5d(%rbp)
jne 0xf921
jmp 0xf915
leaq -0x100e8(%rbp), %rdi
callq 0x10500
jmp 0xf93a
movq -0x10cb8(%rbp), %rdi
callq 0x7920
leaq -0x28(%rbp), %rdi
callq 0x10520
movq -0x10cb0(%rbp), %rax
addq $0x10de0, %rsp          # imm = 0x10DE0
popq %rbp
retq
movq -0x10cb8(%rbp), %rdi
callq 0x7920
leaq -0x28(%rbp), %rdi
callq 0x10520
movq -0x58(%rbp), %rdi
callq 0x45f0
nopl (%rax,%rax)