// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]def2fgd/src/main.cpp
// Function: writefgd(std::ostream&, std::vector<Entity, std::allocator<Entity>> const&, FGDWriteOptions const&)
void writefgd(std::ostream& stream, const std::vector<Entity>& entities, const FGDWriteOptions& options)
{
    stream << "//generated by def2fgd " << DEF2FGD_VERSION << "\n\n";

    for (size_t i=0; i<entities.size(); ++i)
    {
        Entity entity = entities[i];
        if (entity.solid) {
            stream << "@SolidClass ";
        }
        else {
            stream << "@PointClass size(";
            stream << entity.box[0] << ' ';
            stream << entity.box[1] << ' ';
            stream << entity.box[2] << ", ";
            stream << entity.box[3] << ' ';
            stream << entity.box[4] << ' ';
            stream << entity.box[5] << ')';

            bool addOffset = options.useDefaultOffsetPatterns && needsOffset(entity.name);

            if (!addOffset) {
                for (size_t j=0; j<options.offsetPatterns.size() && !addOffset; ++j) {
                    addOffset = globMatch(entity.name.c_str(), options.offsetPatterns[j]);
                }
            }

            if (addOffset) {
                stream << " offset(0 0 " << abs(entity.box[2]) << ")";
            }

            if (entity.name == "light" || entity.name == "lightJunior") {
                stream << " iconsprite(\"sprites/light.spr\") flags(Light) ";

                if (!entity.hasKey("_color")) {
                    entity.keys.push_back(Key("_color", "weighted RGB value of light color"));
                }

            } else {
                stream << " color(" << entity.color[0] << ' ' << entity.color[1] << ' ' << entity.color[2] << ") ";

                if (options.bob) {
                    bool addBob = options.useDefaultBobPatterns && needsBob(entity.name);

                    if (!addBob) {
                        for (size_t k=0; k<options.bobPatterns.size() && !addBob; ++k) {
                            addBob = globMatch(entity.name.c_str(), options.bobPatterns[k]);
                        }
                    }

                    if (addBob) {
                        stream << "bobparms( " << options.bobparms[0] << " " << options.bobparms[1] << " " << options.bobparms[2] << " ) ";
                    }
                }

                for (std::vector<Key>::const_iterator it = entity.keys.begin(); it != entity.keys.end(); ++it)
                {
                    if (it->name == "angle" || it->name == "angles") {
                        stream << "flags(Angle) ";
                        break;
                    }
                }

                if (!entity.model.empty()) {
                    stream << "studio(\"" << entity.model << "\") ";
                } else {
                    for (size_t j=0; j<entity.keys.size(); ++j) {
                        if (entity.keys[j].name == "model" || entity.keys[j].name == "model2") {
                            stream << "studio() ";
                            break;
                        }
                    }
                }
            }
        }

        stream << "= " << entity.name;
        if (!entity.description.empty()) {
            const size_t tokenLimit = 2047;

            if (entity.description.size() > tokenLimit) {
                stream << " : \"" << entity.description.substr(0, tokenLimit) << "\"";

                size_t current = tokenLimit;
                while(current <= entity.description.size()) {
                    stream << " + \"" << entity.description.substr(current, tokenLimit) << "\"";
                    current += tokenLimit;
                }

            } else {
                stream << " : \"" << entity.description << "\"";
            }
        }
        stream << "\n";
        stream << "[\n";
        for (size_t j=0; j<entity.keys.size(); ++j)
        {
            const Key& key = entity.keys[j];
            stream << "\t" << key.name;
            if (key.name == "target") {
                stream << "(target_destination) : Target : : ";
            }
            else if (key.name == "targetname") {
                stream << "(target_source) : Name : : ";
            }
            else if (key.name == "_color") {
                stream << "(color1) : \"RGB color\" : \"1 1 0.5\" : ";
            } else if (key.name == "model" || key.name == "model2") {
                stream << "(studio) : Model : : ";
            } else {
                std::string name = key.name;
                if (!name.empty())
                    name[0] = toupper(name[0]);
                if (key.type.empty())
                    stream << "(string)";
                else
                    stream << "(" << key.type << ")";
                stream << " : " << name << " : : ";
            }

            stream << "\"" << key.description << "\"";
            stream << "\n";
        }

        bool hasspawnflags = false;
        for (size_t j=0; j<Entity::SpawnFlagNum && !hasspawnflags; ++j)
        {
            if (!entity.spawnflags[j].empty()) {
                hasspawnflags = true;
            }
        }

        if (hasspawnflags)
        {
            stream << "\tspawnflags(flags) = \n";
            stream << "\t[\n";
            for (size_t j=0; j<Entity::SpawnFlagNum; ++j)
            {
                std::string flagname = entity.spawnflags[j];
                for (size_t k=0; k<flagname.size(); ++k)
                {
                    flagname[k] = tolower(flagname[k]);
                }

                if (!flagname.empty()) {
                    stream << "\t\t" << (1 << j) << " : \"" << flagname << "\" : 0";
                    if (!entity.flagsdescriptions[j].empty()) {
                        stream << " : \"" << entity.flagsdescriptions[j] << "\"";
                    }
                    stream << '\n';
                }
            }
            stream << "\t]\n";
        }

        stream << "]\n";
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x958, %rsp            # imm = 0x958
movq %rdx, (%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x741a(%rip), %rsi      # 0xb020
movl $0x17, %edx
callq 0x32c0
leaq 0x7421(%rip), %rsi      # 0xb038
movl $0x3, %edx
movq %r15, %rdi
callq 0x32c0
leaq 0x7411(%rip), %rsi      # 0xb03c
movl $0x2, %edx
movq %r15, %rdi
callq 0x32c0
movq (%rbx), %rax
movq %rbx, 0xa8(%rsp)
cmpq %rax, 0x8(%rbx)
je 0x49b7
xorl %edx, %edx
leaq 0xb8(%rsp), %rbx
movq %rdx, 0xb0(%rsp)
imulq $0x8a0, %rdx, %rsi      # imm = 0x8A0
addq %rax, %rsi
movq %rbx, %rdi
callq 0x563e
cmpb $0x1, 0x934(%rsp)
jne 0x3c94
movl $0xc, %edx
movq %r15, %rdi
leaq 0x73b5(%rip), %rsi      # 0xb03f
callq 0x32c0
jmp 0x436a
movl $0x11, %edx
movq %r15, %rdi
leaq 0x73a9(%rip), %rsi      # 0xb04c
callq 0x32c0
movl 0x91c(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x920(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x924(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movl $0x2, %edx
movq %rax, %rdi
leaq 0x734c(%rip), %rsi      # 0xb05e
callq 0x32c0
movl 0x928(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x92c(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x930(%rsp), %esi
movq %r15, %rdi
callq 0x3400
movb $0x29, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movq (%rsp), %rax
cmpb $0x1, 0xe(%rax)
jne 0x3e2c
movl $0x5, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7a4c(%rip), %rcx      # 0xb7f9
callq 0x3300
testl %eax, %eax
je 0x3e70
movl $0x7, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7a2f(%rip), %rcx      # 0xb7ff
callq 0x3300
testl %eax, %eax
je 0x3e70
movl $0x5, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7a14(%rip), %rcx      # 0xb807
callq 0x3300
testl %eax, %eax
je 0x3e70
leaq 0xb8(%rsp), %rdi
leaq 0x7a02(%rip), %rsi      # 0xb80d
callq 0x30b0
testl %eax, %eax
je 0x3e70
leaq 0xb8(%rsp), %rdi
leaq 0x7a01(%rip), %rsi      # 0xb824
callq 0x30b0
testl %eax, %eax
je 0x3e70
movq (%rsp), %rax
movq 0x10(%rax), %r14
movq 0x18(%rax), %r12
subq %r14, %r12
je 0x3eae
sarq $0x3, %r12
movl $0x1, %r13d
movq 0xb8(%rsp), %rbx
movq -0x8(%r14,%r13,8), %rsi
movq %rbx, %rdi
callq 0x4a7e
testb %al, %al
jne 0x3e6c
leaq 0x1(%r13), %rcx
cmpq %r12, %r13
movq %rcx, %r13
jb 0x3e4f
testb %al, %al
je 0x3eae
movl $0xc, %edx
movq %r15, %rdi
leaq 0x71e2(%rip), %rsi      # 0xb061
callq 0x32c0
movl 0x924(%rsp), %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
movq %r15, %rdi
callq 0x3400
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7bea(%rip), %rsi      # 0xba93
callq 0x32c0
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x71ae(%rip), %rsi      # 0xb06e
callq 0x30b0
testl %eax, %eax
je 0x40f8
movq %rbx, %rdi
leaq 0x719d(%rip), %rsi      # 0xb074
callq 0x30b0
testl %eax, %eax
je 0x40f8
movl $0x7, %edx
movq %r15, %rdi
leaq 0x71e5(%rip), %rsi      # 0xb0d8
callq 0x32c0
movl 0x910(%rsp), %esi
movq %r15, %rdi
callq 0x31a0
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x914(%rsp), %esi
movq %rax, %rdi
callq 0x31a0
movb $0x20, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x32c0
movl 0x918(%rsp), %esi
movq %rax, %rdi
callq 0x31a0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x718a(%rip), %rsi      # 0xb0ec
callq 0x32c0
movq (%rsp), %rax
cmpb $0x1, 0xc(%rax)
jne 0x40ae
movq (%rsp), %rax
cmpb $0x1, 0xd(%rax)
jne 0x3fe0
movl $0x5, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7864(%rip), %rcx      # 0xb7f9
callq 0x3300
testl %eax, %eax
je 0x402c
movl $0x7, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7847(%rip), %rcx      # 0xb7ff
callq 0x3300
testl %eax, %eax
je 0x402c
movl $0x5, %edx
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
leaq 0x7830(%rip), %rcx      # 0xb807
callq 0x3300
testl %eax, %eax
je 0x402c
movq (%rsp), %rax
movq 0x28(%rax), %r14
movq 0x30(%rax), %r12
subq %r14, %r12
je 0x40ae
sarq $0x3, %r12
movl $0x1, %r13d
movq 0xb8(%rsp), %rbx
movq -0x8(%r14,%r13,8), %rsi
movq %rbx, %rdi
callq 0x4a7e
testb %al, %al
jne 0x4024
leaq 0x1(%r13), %rcx
cmpq %r12, %r13
movq %rcx, %r13
jb 0x4007
testb %al, %al
je 0x40ae
movl $0xa, %edx
movq %r15, %rdi
leaq 0x70a5(%rip), %rsi      # 0xb0e0
callq 0x32c0
movq (%rsp), %rax
movl (%rax), %esi
movq %r15, %rdi
callq 0x3400
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7089(%rip), %rsi      # 0xb0e9
callq 0x32c0
movq (%rsp), %rax
movl 0x4(%rax), %esi
movq %rbx, %rdi
callq 0x3400
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7063(%rip), %rsi      # 0xb0e9
callq 0x32c0
movq (%rsp), %rax
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x3400
movl $0x3, %edx
movq %rax, %rdi
leaq 0x7042(%rip), %rsi      # 0xb0eb
callq 0x32c0
movq 0xf8(%rsp), %rbx
cmpq 0x100(%rsp), %rbx
je 0x428e
movq %rbx, %rdi
leaq 0x7021(%rip), %rsi      # 0xb0ef
callq 0x30b0
testl %eax, %eax
je 0x427a
movq %rbx, %rdi
leaq 0x7010(%rip), %rsi      # 0xb0f5
callq 0x30b0
testl %eax, %eax
je 0x427a
addq $0x60, %rbx
jmp 0x40b6
movl $0x2e, %edx
movq %r15, %rdi
leaq 0x6f79(%rip), %rsi      # 0xb080
callq 0x32c0
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x6f8a(%rip), %rsi      # 0xb0af
leaq 0x6f89(%rip), %rdx      # 0xb0b5
callq 0x5cf4
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x8322
movl %eax, %ebx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x415f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
testb %bl, %bl
jne 0x436a
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x6f32(%rip), %rsi      # 0xb0af
leaq 0x6f31(%rip), %rdx      # 0xb0b5
callq 0x5cf4
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x88(%rsp), %r14
movq %r14, %rdi
leaq 0x6f0b(%rip), %rsi      # 0xb0b6
leaq 0x6f25(%rip), %rdx      # 0xb0d7
callq 0x5cf4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x68(%rsp), %rsi
movq %r14, %rdx
callq 0x8134
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5d8a
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x41f8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4214
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4230
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4255
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x436a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x436a
movl $0xd, %edx
movq %r15, %rdi
leaq 0x6e73(%rip), %rsi      # 0xb0fc
callq 0x32c0
cmpq $0x0, 0x940(%rsp)
je 0x42de
movl $0x8, %edx
movq %r15, %rdi
leaq 0x6e62(%rip), %rsi      # 0xb10a
callq 0x32c0
movq 0x938(%rsp), %rsi
movq 0x940(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x3, %edx
movq %rax, %rdi
leaq 0x6e3f(%rip), %rsi      # 0xb113
callq 0x32c0
jmp 0x436a
movq 0xf8(%rsp), %rdi
cmpq %rdi, 0x100(%rsp)
je 0x436a
xorl %ebx, %ebx
xorl %r14d, %r14d
addq %rbx, %rdi
leaq 0x6e18(%rip), %rsi      # 0xb117
callq 0x30b0
testl %eax, %eax
je 0x4356
movq 0xf8(%rsp), %rdi
addq %rbx, %rdi
leaq 0x6e03(%rip), %rsi      # 0xb11d
callq 0x30b0
testl %eax, %eax
je 0x4356
incq %r14
movq 0xf8(%rsp), %rdi
movq 0x100(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x60, %rbx
cmpq %rax, %r14
jb 0x42f5
jmp 0x436a
movl $0x9, %edx
movq %r15, %rdi
leaq 0x6dbf(%rip), %rsi      # 0xb124
callq 0x32c0
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6db5(%rip), %rsi      # 0xb12e
callq 0x32c0
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movq 0xe0(%rsp), %rax
testq %rax, %rax
leaq 0xd8(%rsp), %rbx
leaq 0x8(%rsp), %r14
je 0x44fc
cmpq $0x800, %rax            # imm = 0x800
jb 0x44bc
movl $0x4, %edx
movq %r15, %rdi
leaq 0x6d62(%rip), %rsi      # 0xb131
callq 0x32c0
movl $0x7ff, %ecx            # imm = 0x7FF
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3280
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6d32(%rip), %rsi      # 0xb139
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4428
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
cmpq $0x7ff, 0xe0(%rsp) # imm = 0x7FF
jb 0x44fc
movl $0x7ff, %r13d           # imm = 0x7FF
movl $0x4, %edx
movq %r15, %rdi
leaq 0x6ce7(%rip), %rsi      # 0xb136
callq 0x32c0
movl $0x7ff, %ecx            # imm = 0x7FF
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3280
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6cb1(%rip), %rsi      # 0xb139
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x44a9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
addq $0x7ff, %r13            # imm = 0x7FF
cmpq 0xe0(%rsp), %r13
jbe 0x4440
jmp 0x44fc
movl $0x4, %edx
movq %r15, %rdi
leaq 0x6c66(%rip), %rsi      # 0xb131
callq 0x32c0
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6c42(%rip), %rsi      # 0xb139
callq 0x32c0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6b32(%rip), %rsi      # 0xb03d
callq 0x32c0
movl $0x2, %edx
movq %r15, %rdi
leaq 0x6cca(%rip), %rsi      # 0xb1e9
callq 0x32c0
movq 0xf8(%rsp), %r14
cmpq %r14, 0x100(%rsp)
je 0x4798
xorl %r12d, %r12d
xorl %ebp, %ebp
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6c9f(%rip), %rsi      # 0xb1ed
callq 0x32c0
movq (%r14,%r12), %rsi
movq 0x8(%r14,%r12), %rdx
movq %r15, %rdi
callq 0x32c0
leaq (%r14,%r12), %r13
movq %r13, %rdi
leaq 0x6bc9(%rip), %rsi      # 0xb13b
callq 0x30b0
testl %eax, %eax
je 0x4661
movq %r13, %rdi
leaq 0x6bdc(%rip), %rsi      # 0xb165
callq 0x30b0
testl %eax, %eax
je 0x466f
movq %r13, %rdi
leaq 0x6b0f(%rip), %rsi      # 0xb0af
callq 0x30b0
testl %eax, %eax
je 0x467d
movq %r13, %rdi
leaq 0x6b60(%rip), %rsi      # 0xb117
callq 0x30b0
movl $0x15, %ebx
testl %eax, %eax
je 0x468b
movq %r13, %rdi
leaq 0x6b4a(%rip), %rsi      # 0xb11d
callq 0x30b0
leaq 0x6bd3(%rip), %rsi      # 0xb1b2
testl %eax, %eax
je 0x4692
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq (%r14,%r12), %rsi
movq 0x8(%r14,%r12), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x5c5e
cmpq $0x0, 0x10(%rsp)
je 0x461e
movq 0x8(%rsp), %rbx
movsbl (%rbx), %edi
callq 0x3450
movb %al, (%rbx)
cmpq $0x0, 0x48(%r14,%r12)
je 0x4722
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6a23(%rip), %rsi      # 0xb05c
callq 0x32c0
movq 0x40(%r14,%r12), %rsi
movq 0x48(%r14,%r12), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
leaq 0x7437(%rip), %rsi      # 0xba93
jmp 0x4731
movl $0x22, %ebx
leaq 0x6ad5(%rip), %rsi      # 0xb142
jmp 0x4692
movl $0x1b, %ebx
leaq 0x6af5(%rip), %rsi      # 0xb170
jmp 0x4692
movl $0x25, %ebx
leaq 0x6b03(%rip), %rsi      # 0xb18c
jmp 0x4692
leaq 0x6b20(%rip), %rsi      # 0xb1b2
movq %r15, %rdi
movq %rbx, %rdx
callq 0x32c0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6a8d(%rip), %rsi      # 0xb139
callq 0x32c0
movq 0x20(%r14,%r12), %rsi
movq 0x28(%r14,%r12), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6a67(%rip), %rsi      # 0xb139
callq 0x32c0
movl $0x1, %edx
movq %r15, %rdi
leaq 0x6957(%rip), %rsi      # 0xb03d
callq 0x32c0
incq %rbp
movq 0xf8(%rsp), %r14
movq 0x100(%rsp), %rax
subq %r14, %rax
sarq $0x5, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x60, %r12
cmpq %rax, %rbp
jb 0x453f
jmp 0x4798
movl $0x8, %edx
movq %r15, %rax
leaq 0x6a97(%rip), %rsi      # 0xb1c8
movq %rax, %rdi
callq 0x32c0
movl $0x3, %edx
movq %r15, %rdi
leaq 0x6a66(%rip), %rsi      # 0xb1ae
callq 0x32c0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x5, %edx
movq %rax, %rdi
leaq 0x6a18(%rip), %rsi      # 0xb186
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x469d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x469d
leaq 0x118(%rsp), %rax
xorl %ecx, %ecx
movq (%rax), %rdx
cmpq $0x1e, %rcx
ja 0x47b7
incq %rcx
addq $0x20, %rax
testq %rdx, %rdx
je 0x47a2
testq %rdx, %rdx
je 0x495b
movl $0x16, %edx
movq %r15, %rdi
leaq 0x6a02(%rip), %rsi      # 0xb1d1
callq 0x32c0
movl $0x3, %edx
movq %r15, %rdi
leaq 0x6a05(%rip), %rsi      # 0xb1e8
callq 0x32c0
xorl %r13d, %r13d
movq %r13, %r14
shlq $0x5, %r14
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xf8(%rsp), %rax
movq 0x18(%rax,%r14), %rsi
movq 0x20(%rax,%r14), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x5c5e
cmpq $0x0, 0x10(%rsp)
je 0x491e
xorl %ebx, %ebx
movq 0x8(%rsp), %r12
movsbl (%r12,%rbx), %edi
callq 0x3350
movb %al, (%r12,%rbx)
incq %rbx
movq 0x10(%rsp), %rax
cmpq %rax, %rbx
jb 0x4829
testq %rax, %rax
je 0x491e
movl $0x2, %edx
movq %r15, %rdi
leaq 0x698b(%rip), %rsi      # 0xb1ec
callq 0x32c0
movl $0x1, %esi
movl %r13d, %ecx
shll %cl, %esi
movq %r15, %rdi
callq 0x3400
movq %rax, %rbx
movl $0x4, %edx
movq %rax, %rdi
leaq 0x68a7(%rip), %rsi      # 0xb131
callq 0x32c0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x32c0
movl $0x5, %edx
movq %rax, %rdi
leaq 0x693f(%rip), %rsi      # 0xb1ef
callq 0x32c0
leaq 0x510(%rsp), %rax
cmpq $0x0, 0x8(%rax,%r14)
je 0x4907
movl $0x4, %edx
movq %r15, %rdi
leaq 0x685d(%rip), %rsi      # 0xb131
callq 0x32c0
leaq 0x510(%rsp), %rax
addq %rax, %r14
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x6837(%rip), %rsi      # 0xb139
callq 0x32c0
movb $0xa, 0x68(%rsp)
movl $0x1, %edx
movq %r15, %rdi
leaq 0x68(%rsp), %rsi
callq 0x32c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x493a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
incq %r13
cmpq $0x20, %r13
jne 0x47eb
movl $0x3, %edx
movq %r15, %rdi
leaq 0x689f(%rip), %rsi      # 0xb1f5
callq 0x32c0
movl $0x2, %edx
movq %r15, %rdi
leaq 0x688c(%rip), %rsi      # 0xb1f6
callq 0x32c0
leaq 0xb8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5894
movq 0xb0(%rsp), %rdx
incq %rdx
movq 0xa8(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movabsq $-0xed7303b5cc0ed73, %rsi # imm = 0xF128CFC4A33F128D
imulq %rsi, %rcx
cmpq %rcx, %rdx
jb 0x3c57
addq $0x958, %rsp            # imm = 0x958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a66
jmp 0x4a66
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5846
jmp 0x49e5
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x4a0f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x4a0f
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x4a69
movq 0x78(%rsp), %rsi
jmp 0x4a5c
jmp 0x4a66
jmp 0x4a45
jmp 0x4a66
jmp 0x4a66
jmp 0x4a66
jmp 0x4a45
jmp 0x4a66
jmp 0x4a66
jmp 0x4a66
jmp 0x4a66
jmp 0x4a66
jmp 0x4a66
jmp 0x4a45
jmp 0x4a45
jmp 0x4a66
jmp 0x4a66
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4a69
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0x4a69
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5894
movq %rbx, %rdi
callq 0x3420