// File: ivan-tkatchev[P]makerpm/makerpm.cc
// Function: make_index2[abi:cxx11](rpmprops_t const&)
std::string make_index2(const rpmprops_t& props) {

    Store store;

    // Add package fields.

    uint32_t totsize = 0;
    uint64_t totlongsize = 0;

    //store.add(rpm::TAG_HEADERI18NTABLE, props.locale);

    store.add(rpm::TAG_NAME, props.name, false);
    store.add(rpm::TAG_VERSION, props.version, false);
    store.add(rpm::TAG_RELEASE, props.release, false);

    store.add(rpm::TAG_SUMMARY, props.summary, true);
    store.add(rpm::TAG_DESCRIPTION, props.description, true);
    store.add(rpm::TAG_BUILDHOST, props.buildhost, false);
    store.add(rpm::TAG_BUILDTIME, props.buildtime);
    store.add(rpm::TAG_LICENSE, props.license, false);
    store.add(rpm::TAG_PACKAGER, props.packager, false);
    store.add(rpm::TAG_GROUP, props.group, true);
    store.add(rpm::TAG_URL, props.url, false);
    store.add(rpm::TAG_OS, props.os, false);
    store.add(rpm::TAG_ARCH, props.arch, false);
    store.add(rpm::TAG_RHNPLATFORM, props.arch, false);
    store.add(rpm::TAG_PAYLOADFORMAT, props.payload_format, false);
    store.add(rpm::TAG_PAYLOADCOMPRESSOR, props.payload_compressor, false);
    store.add(rpm::TAG_PLATFORM, props.platform, false);

    // for details, see yum's rpmUtils/miscutils.py, function pkgTupleFromHeader(),
    // or createrepo's createrepo/yumbased.py, method CreateRepoPackage.isSrpm()
    if (!props.sourcerpm.empty()) {
        store.add(rpm::TAG_SOURCERPM, props.sourcerpm, false);
    }
    // unlike yum or createrepo, rpm itself relies on the SOURCEPACKAGE tag existence[1]
    // [1] rpm's lib/rpminstall.c, function rpmInstall()
    if(props.arch == "src")
        store.add(rpm::TAG_SOURCEPACKAGE, (uint32_t)1);

    store.add(rpm::TAG_OPTFLAGS, props.optflags, false);
    store.add(rpm::TAG_RPMVERSION, props.rpmversion, false);

    store.add(rpm::TAG_PREIN, props.prein.code, false);
    store.add(rpm::TAG_PREINPROG, props.prein.prog, false);
    store.add(rpm::TAG_POSTIN, props.postin.code, false);
    store.add(rpm::TAG_POSTINPROG, props.postin.prog, false);
    store.add(rpm::TAG_PREUN, props.preun.code, false);
    store.add(rpm::TAG_PREUNPROG, props.preun.prog, false);
    store.add(rpm::TAG_POSTUN, props.postun.code, false);
    store.add(rpm::TAG_POSTUNPROG, props.postun.prog, false);

    std::vector<std::string> providename;
    std::vector<uint32_t> provideflags;
    std::vector<std::string> provideversion;

    for (const auto& v : props.provide) {
        providename.push_back(v.name);
        provideflags.push_back(v.flags);
        provideversion.push_back(v.version);
    }

    store.add(rpm::TAG_PROVIDENAME, providename);
    store.add(rpm::TAG_PROVIDEVERSION, provideversion);
    store.add(rpm::TAG_PROVIDEFLAGS, provideflags);

    std::vector<std::string> requirename;
    std::vector<uint32_t> requireflags;
    std::vector<std::string> requireversion;

    for (const auto& v : props.require) {
        requirename.push_back(v.name);
        requireflags.push_back(v.flags);
        requireversion.push_back(v.version);
    }

    store.add(rpm::TAG_REQUIRENAME, requirename);
    store.add(rpm::TAG_REQUIREVERSION, requireversion);
    store.add(rpm::TAG_REQUIREFLAGS, requireflags);

    std::vector<std::string> conflictname;
    std::vector<uint32_t> conflictflags;
    std::vector<std::string> conflictversion;

    for (const auto& v : props.conflict) {
        conflictname.push_back(v.name);
        conflictflags.push_back(v.flags);
        conflictversion.push_back(v.version);
    }

    store.add(rpm::TAG_CONFLICTNAME, conflictname);
    store.add(rpm::TAG_CONFLICTVERSION, conflictversion);
    store.add(rpm::TAG_CONFLICTFLAGS, conflictflags);

    std::vector<std::string> obsoletename;
    std::vector<uint32_t> obsoleteflags;
    std::vector<std::string> obsoleteversion;

    for (const auto& v : props.obsolete) {
        obsoletename.push_back(v.name);
        obsoleteflags.push_back(v.flags);
        obsoleteversion.push_back(v.version);
    }

    store.add(rpm::TAG_OBSOLETENAME, obsoletename);
    store.add(rpm::TAG_OBSOLETEVERSION, obsoleteversion);
    store.add(rpm::TAG_OBSOLETEFLAGS, obsoleteflags);


    bool files_longsize = false;

    for (const auto& f : props.files) {

        if (f.longsize > 0) {
            files_longsize = true;
        }
    }

    std::vector<uint32_t> size;
    std::vector<uint64_t> longsize;
    std::vector<uint16_t> mode;
    std::vector<uint16_t> rdev;
    std::vector<uint32_t> mtime;
    std::vector<std::string> digest;
    std::vector<std::string> linkto;
    std::vector<uint32_t> flags;
    std::vector<std::string> user;
    std::vector<std::string> group;
    std::vector<uint32_t> verifyflags;
    std::vector<uint32_t> device;
    std::vector<uint32_t> inode;

    std::vector<std::string> basename;
    std::vector<uint32_t> dirindex;

    std::map<std::string, uint32_t> dirindex_map;

    std::vector<std::string> dirname;

    for (const auto& f : props.files) {

        if (files_longsize) {
            longsize.push_back(f.longsize);
            totlongsize += f.longsize;

        } else {
            size.push_back(f.size);
            totsize += f.size;
        }

        mode.push_back(f.mode);
        rdev.push_back(f.rdev);
        mtime.push_back(f.mtime);
        
        digest.push_back(f.digest);

        linkto.push_back(f.linkto);
        flags.push_back(f.flags);
        user.push_back(f.username);
        group.push_back(f.groupname);
        verifyflags.push_back(f.verifyflags);
        device.push_back(f.device);
        inode.push_back(f.inode);

        const std::string& fname = f.fname;
        size_t slash = fname.find_last_of('/');

        std::string base = fname;
        std::string dir;

        if (slash != std::string::npos) {
            base = fname.substr(slash+1);
            dir = fname.substr(1, slash);
        }

        auto dim = dirindex_map.find(dir);

        if (dim == dirindex_map.end()) {
            dim = dirindex_map.insert(dirindex_map.end(), std::make_pair(dir, dirindex_map.size()));
            dirname.push_back(dir);
        }

        basename.push_back(base);
        dirindex.push_back(dim->second);
    }

    store.add(rpm::TAG_BASENAMES, basename);
    store.add(rpm::TAG_DIRINDEXES, dirindex);
    store.add(rpm::TAG_DIRNAMES, dirname);
    store.add(rpm::TAG_LONGFILESIZES, longsize);
    store.add(rpm::TAG_FILESIZES, size);
    store.add(rpm::TAG_FILEMODES, mode);
    store.add(rpm::TAG_FILERDEVS, rdev);
    store.add(rpm::TAG_FILEMTIMES, mtime);
    store.add(rpm::TAG_FILEDIGESTS, digest);
    store.add(rpm::TAG_FILELINKTOS, linkto);
    store.add(rpm::TAG_FILEFLAGS, flags);
    store.add(rpm::TAG_FILEUSERNAME, user);
    store.add(rpm::TAG_FILEGROUPNAME, group);
    store.add(rpm::TAG_FILEVERIFYFLAGS, verifyflags);
    store.add(rpm::TAG_FILEDEVICES, device);
    store.add(rpm::TAG_FILEINODES, inode);

    if (totlongsize > 0) {
        store.add(rpm::TAG_LONGSIZE, totlongsize);
    } else {
        store.add(rpm::TAG_SIZE, totsize);
    }

    return store.str(rpm::TAG_HEADERIMMUTABLE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x540, %rsp            # imm = 0x540
movq %rdi, -0x510(%rbp)
movq %rdi, %rax
movq %rax, -0x508(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x500(%rbp)
callq 0x21c60
movq -0x500(%rbp), %rdi
movl $0x0, -0x5c(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rdx
movl $0x3e8, %esi            # imm = 0x3E8
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dbdc
movq -0x10(%rbp), %rdx
addq $0x20, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3e9, %esi            # imm = 0x3E9
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dbf6
movq -0x10(%rbp), %rdx
addq $0x40, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3ea, %esi            # imm = 0x3EA
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dc10
movq -0x10(%rbp), %rdx
addq $0x60, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3ec, %esi            # imm = 0x3EC
movl $0x1, %ecx
callq 0x21ca0
jmp 0x1dc2d
movq -0x10(%rbp), %rdx
subq $-0x80, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3ed, %esi            # imm = 0x3ED
movl $0x1, %ecx
callq 0x21ca0
jmp 0x1dc4a
movq -0x10(%rbp), %rdx
addq $0xa8, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3ef, %esi            # imm = 0x3EF
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dc67
movq -0x10(%rbp), %rax
movl 0xa0(%rax), %edx
leaq -0x58(%rbp), %rdi
movl $0x3ee, %esi            # imm = 0x3EE
callq 0x21d50
jmp 0x1dc81
movq -0x10(%rbp), %rdx
addq $0xc8, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3f6, %esi            # imm = 0x3F6
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dc9e
movq -0x10(%rbp), %rdx
addq $0xe8, %rdx
leaq -0x58(%rbp), %rdi
movl $0x3f7, %esi            # imm = 0x3F7
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dcbb
movq -0x10(%rbp), %rdx
addq $0x108, %rdx            # imm = 0x108
leaq -0x58(%rbp), %rdi
movl $0x3f8, %esi            # imm = 0x3F8
movl $0x1, %ecx
callq 0x21ca0
jmp 0x1dcdb
movq -0x10(%rbp), %rdx
addq $0x128, %rdx            # imm = 0x128
leaq -0x58(%rbp), %rdi
movl $0x3fc, %esi            # imm = 0x3FC
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dcf8
movq -0x10(%rbp), %rdx
addq $0x148, %rdx            # imm = 0x148
leaq -0x58(%rbp), %rdi
movl $0x3fd, %esi            # imm = 0x3FD
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dd15
movq -0x10(%rbp), %rdx
addq $0x168, %rdx            # imm = 0x168
leaq -0x58(%rbp), %rdi
movl $0x3fe, %esi            # imm = 0x3FE
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dd32
movq -0x10(%rbp), %rdx
addq $0x168, %rdx            # imm = 0x168
leaq -0x58(%rbp), %rdi
movl $0x46b, %esi            # imm = 0x46B
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dd4f
movq -0x10(%rbp), %rdx
addq $0x188, %rdx            # imm = 0x188
leaq -0x58(%rbp), %rdi
movl $0x464, %esi            # imm = 0x464
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dd6c
movq -0x10(%rbp), %rdx
addq $0x1a8, %rdx            # imm = 0x1A8
leaq -0x58(%rbp), %rdi
movl $0x465, %esi            # imm = 0x465
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dd89
movq -0x10(%rbp), %rdx
addq $0x1e8, %rdx            # imm = 0x1E8
leaq -0x58(%rbp), %rdi
movl $0x46c, %esi            # imm = 0x46C
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dda6
movq -0x10(%rbp), %rdi
addq $0x228, %rdi            # imm = 0x228
callq 0x4250
testb $0x1, %al
jne 0x1ddea
movq -0x10(%rbp), %rdx
addq $0x228, %rdx            # imm = 0x228
leaq -0x58(%rbp), %rdi
movl $0x414, %esi            # imm = 0x414
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1ddd7
jmp 0x1ddea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1eeab
movq -0x10(%rbp), %rdi
addq $0x168, %rdi            # imm = 0x168
leaq 0x136ae(%rip), %rsi     # 0x314aa
callq 0x21e20
movb %al, -0x511(%rbp)
jmp 0x1de09
movb -0x511(%rbp), %al
testb $0x1, %al
jne 0x1de15
jmp 0x1de2c
leaq -0x58(%rbp), %rdi
movl $0x452, %esi            # imm = 0x452
movl $0x1, %edx
callq 0x21d50
jmp 0x1de2a
jmp 0x1de2c
movq -0x10(%rbp), %rdx
addq $0x208, %rdx            # imm = 0x208
leaq -0x58(%rbp), %rdi
movl $0x462, %esi            # imm = 0x462
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1de49
movq -0x10(%rbp), %rdx
addq $0x248, %rdx            # imm = 0x248
leaq -0x58(%rbp), %rdi
movl $0x428, %esi            # imm = 0x428
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1de66
movq -0x10(%rbp), %rdx
addq $0x2c8, %rdx            # imm = 0x2C8
leaq -0x58(%rbp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1de83
movq -0x10(%rbp), %rdx
addq $0x2a8, %rdx            # imm = 0x2A8
leaq -0x58(%rbp), %rdi
movl $0x43d, %esi            # imm = 0x43D
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1dea0
movq -0x10(%rbp), %rdx
addq $0x308, %rdx            # imm = 0x308
leaq -0x58(%rbp), %rdi
movl $0x400, %esi            # imm = 0x400
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1debd
movq -0x10(%rbp), %rdx
addq $0x2e8, %rdx            # imm = 0x2E8
leaq -0x58(%rbp), %rdi
movl $0x43e, %esi            # imm = 0x43E
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1deda
movq -0x10(%rbp), %rdx
addq $0x348, %rdx            # imm = 0x348
leaq -0x58(%rbp), %rdi
movl $0x401, %esi            # imm = 0x401
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1def7
movq -0x10(%rbp), %rdx
addq $0x328, %rdx            # imm = 0x328
leaq -0x58(%rbp), %rdi
movl $0x43f, %esi            # imm = 0x43F
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1df14
movq -0x10(%rbp), %rdx
addq $0x388, %rdx            # imm = 0x388
leaq -0x58(%rbp), %rdi
movl $0x402, %esi            # imm = 0x402
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1df31
movq -0x10(%rbp), %rdx
addq $0x368, %rdx            # imm = 0x368
leaq -0x58(%rbp), %rdi
movl $0x440, %esi            # imm = 0x440
xorl %ecx, %ecx
callq 0x21ca0
jmp 0x1df4e
leaq -0x90(%rbp), %rdi
callq 0x21e50
leaq -0xa8(%rbp), %rdi
callq 0x21e70
leaq -0xc0(%rbp), %rdi
callq 0x21e50
movq -0x10(%rbp), %rax
addq $0x3a8, %rax            # imm = 0x3A8
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x21e90
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x21ec0
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21ef0
testb $0x1, %al
jne 0x1dfc2
jmp 0x1e040
leaq -0xd0(%rbp), %rdi
callq 0x21f30
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x21f50
jmp 0x1dfea
movq -0xe0(%rbp), %rsi
addq $0x20, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x21fc0
jmp 0x1e003
movq -0xe0(%rbp), %rsi
addq $0x28, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x21f50
jmp 0x1e01c
jmp 0x1e01e
leaq -0xd0(%rbp), %rdi
callq 0x22030
jmp 0x1dfa9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ee87
leaq -0x58(%rbp), %rdi
movl $0x417, %esi            # imm = 0x417
leaq -0x90(%rbp), %rdx
callq 0x22050
jmp 0x1e057
leaq -0x58(%rbp), %rdi
movl $0x459, %esi            # imm = 0x459
leaq -0xc0(%rbp), %rdx
callq 0x22050
jmp 0x1e06e
leaq -0x58(%rbp), %rdi
movl $0x458, %esi            # imm = 0x458
leaq -0xa8(%rbp), %rdx
callq 0x22150
jmp 0x1e085
leaq -0xf8(%rbp), %rdi
callq 0x21e50
leaq -0x110(%rbp), %rdi
callq 0x21e70
leaq -0x128(%rbp), %rdi
callq 0x21e50
movq -0x10(%rbp), %rax
addq $0x3c0, %rax            # imm = 0x3C0
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x21e90
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
callq 0x21ec0
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x21ef0
testb $0x1, %al
jne 0x1e0f9
jmp 0x1e177
leaq -0x138(%rbp), %rdi
callq 0x21f30
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x21f50
jmp 0x1e121
movq -0x148(%rbp), %rsi
addq $0x20, %rsi
leaq -0x110(%rbp), %rdi
callq 0x21fc0
jmp 0x1e13a
movq -0x148(%rbp), %rsi
addq $0x28, %rsi
leaq -0x128(%rbp), %rdi
callq 0x21f50
jmp 0x1e153
jmp 0x1e155
leaq -0x138(%rbp), %rdi
callq 0x22030
jmp 0x1e0e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ee63
leaq -0x58(%rbp), %rdi
movl $0x419, %esi            # imm = 0x419
leaq -0xf8(%rbp), %rdx
callq 0x22050
jmp 0x1e18e
leaq -0x58(%rbp), %rdi
movl $0x41a, %esi            # imm = 0x41A
leaq -0x128(%rbp), %rdx
callq 0x22050
jmp 0x1e1a5
leaq -0x58(%rbp), %rdi
movl $0x418, %esi            # imm = 0x418
leaq -0x110(%rbp), %rdx
callq 0x22150
jmp 0x1e1bc
leaq -0x160(%rbp), %rdi
callq 0x21e50
leaq -0x178(%rbp), %rdi
callq 0x21e70
leaq -0x190(%rbp), %rdi
callq 0x21e50
movq -0x10(%rbp), %rax
addq $0x3d8, %rax            # imm = 0x3D8
movq %rax, -0x198(%rbp)
movq -0x198(%rbp), %rdi
callq 0x21e90
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rdi
callq 0x21ec0
movq %rax, -0x1a8(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x21ef0
testb $0x1, %al
jne 0x1e230
jmp 0x1e2ae
leaq -0x1a0(%rbp), %rdi
callq 0x21f30
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x21f50
jmp 0x1e258
movq -0x1b0(%rbp), %rsi
addq $0x20, %rsi
leaq -0x178(%rbp), %rdi
callq 0x21fc0
jmp 0x1e271
movq -0x1b0(%rbp), %rsi
addq $0x28, %rsi
leaq -0x190(%rbp), %rdi
callq 0x21f50
jmp 0x1e28a
jmp 0x1e28c
leaq -0x1a0(%rbp), %rdi
callq 0x22030
jmp 0x1e217
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ee3f
leaq -0x58(%rbp), %rdi
movl $0x41e, %esi            # imm = 0x41E
leaq -0x160(%rbp), %rdx
callq 0x22050
jmp 0x1e2c5
leaq -0x58(%rbp), %rdi
movl $0x41f, %esi            # imm = 0x41F
leaq -0x190(%rbp), %rdx
callq 0x22050
jmp 0x1e2dc
leaq -0x58(%rbp), %rdi
movl $0x41d, %esi            # imm = 0x41D
leaq -0x178(%rbp), %rdx
callq 0x22150
jmp 0x1e2f3
leaq -0x1c8(%rbp), %rdi
callq 0x21e50
leaq -0x1e0(%rbp), %rdi
callq 0x21e70
leaq -0x1f8(%rbp), %rdi
callq 0x21e50
movq -0x10(%rbp), %rax
addq $0x3f0, %rax            # imm = 0x3F0
movq %rax, -0x200(%rbp)
movq -0x200(%rbp), %rdi
callq 0x21e90
movq %rax, -0x208(%rbp)
movq -0x200(%rbp), %rdi
callq 0x21ec0
movq %rax, -0x210(%rbp)
leaq -0x208(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x21ef0
testb $0x1, %al
jne 0x1e367
jmp 0x1e3e5
leaq -0x208(%rbp), %rdi
callq 0x21f30
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0x21f50
jmp 0x1e38f
movq -0x218(%rbp), %rsi
addq $0x20, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x21fc0
jmp 0x1e3a8
movq -0x218(%rbp), %rsi
addq $0x28, %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x21f50
jmp 0x1e3c1
jmp 0x1e3c3
leaq -0x208(%rbp), %rdi
callq 0x22030
jmp 0x1e34e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ee1b
leaq -0x58(%rbp), %rdi
movl $0x442, %esi            # imm = 0x442
leaq -0x1c8(%rbp), %rdx
callq 0x22050
jmp 0x1e3fc
leaq -0x58(%rbp), %rdi
movl $0x45b, %esi            # imm = 0x45B
leaq -0x1f8(%rbp), %rdx
callq 0x22050
jmp 0x1e413
leaq -0x58(%rbp), %rdi
movl $0x45a, %esi            # imm = 0x45A
leaq -0x1e0(%rbp), %rdx
callq 0x22150
jmp 0x1e42a
movb $0x0, -0x219(%rbp)
movq -0x10(%rbp), %rax
addq $0x408, %rax            # imm = 0x408
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
callq 0x22290
movq %rax, -0x230(%rbp)
movq -0x228(%rbp), %rdi
callq 0x222c0
movq %rax, -0x238(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x222f0
testb $0x1, %al
jne 0x1e481
jmp 0x1e4b9
leaq -0x230(%rbp), %rdi
callq 0x22330
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0x1e4a9
movb $0x1, -0x219(%rbp)
jmp 0x1e4ab
leaq -0x230(%rbp), %rdi
callq 0x22350
jmp 0x1e468
leaq -0x258(%rbp), %rdi
callq 0x21e70
leaq -0x270(%rbp), %rdi
callq 0x22370
leaq -0x288(%rbp), %rdi
callq 0x22390
leaq -0x2a0(%rbp), %rdi
callq 0x22390
leaq -0x2b8(%rbp), %rdi
callq 0x21e70
leaq -0x2d0(%rbp), %rdi
callq 0x21e50
leaq -0x2e8(%rbp), %rdi
callq 0x21e50
leaq -0x300(%rbp), %rdi
callq 0x21e70
leaq -0x318(%rbp), %rdi
callq 0x21e50
leaq -0x330(%rbp), %rdi
callq 0x21e50
leaq -0x348(%rbp), %rdi
callq 0x21e70
leaq -0x360(%rbp), %rdi
callq 0x21e70
leaq -0x378(%rbp), %rdi
callq 0x21e70
leaq -0x390(%rbp), %rdi
callq 0x21e50
leaq -0x3a8(%rbp), %rdi
callq 0x21e70
leaq -0x3d8(%rbp), %rdi
callq 0x223b0
leaq -0x3f0(%rbp), %rdi
callq 0x21e50
movq -0x10(%rbp), %rax
addq $0x408, %rax            # imm = 0x408
movq %rax, -0x3f8(%rbp)
movq -0x3f8(%rbp), %rdi
callq 0x22290
movq %rax, -0x400(%rbp)
movq -0x3f8(%rbp), %rdi
callq 0x222c0
movq %rax, -0x408(%rbp)
leaq -0x400(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x222f0
testb $0x1, %al
jne 0x1e5d8
jmp 0x1ea21
leaq -0x400(%rbp), %rdi
callq 0x22330
movq %rax, -0x410(%rbp)
testb $0x1, -0x219(%rbp)
je 0x1e633
movq -0x410(%rbp), %rsi
addq $0x8, %rsi
leaq -0x270(%rbp), %rdi
callq 0x223d0
jmp 0x1e60d
movq -0x410(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x1e657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ed4f
movq -0x410(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x21fc0
jmp 0x1e648
movq -0x410(%rbp), %rax
movl (%rax), %eax
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x410(%rbp), %rsi
addq $0x10, %rsi
leaq -0x288(%rbp), %rdi
callq 0x22440
jmp 0x1e670
movq -0x410(%rbp), %rsi
addq $0x12, %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x22440
jmp 0x1e689
movq -0x410(%rbp), %rsi
addq $0x14, %rsi
leaq -0x2b8(%rbp), %rdi
callq 0x21fc0
jmp 0x1e6a2
movq -0x410(%rbp), %rsi
addq $0x18, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x21f50
jmp 0x1e6bb
movq -0x410(%rbp), %rsi
addq $0x38, %rsi
leaq -0x2e8(%rbp), %rdi
callq 0x21f50
jmp 0x1e6d4
movq -0x410(%rbp), %rsi
addq $0x58, %rsi
leaq -0x300(%rbp), %rdi
callq 0x21fc0
jmp 0x1e6ed
movq -0x410(%rbp), %rsi
addq $0x60, %rsi
leaq -0x318(%rbp), %rdi
callq 0x21f50
jmp 0x1e706
movq -0x410(%rbp), %rsi
subq $-0x80, %rsi
leaq -0x330(%rbp), %rdi
callq 0x21f50
jmp 0x1e71f
movq -0x410(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x348(%rbp), %rdi
callq 0x21fc0
jmp 0x1e73b
movq -0x410(%rbp), %rsi
addq $0xa4, %rsi
leaq -0x360(%rbp), %rdi
callq 0x21fc0
jmp 0x1e757
movq -0x410(%rbp), %rsi
addq $0xa8, %rsi
leaq -0x378(%rbp), %rdi
callq 0x21fc0
jmp 0x1e773
movq -0x410(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
movl $0x2f, %esi
movq $-0x1, %rdx
callq 0x4200
movq %rax, -0x420(%rbp)
movq -0x418(%rbp), %rsi
leaq -0x440(%rbp), %rdi
callq 0x4110
jmp 0x1e7bb
leaq -0x460(%rbp), %rdi
callq 0x42a0
cmpq $-0x1, -0x420(%rbp)
je 0x1e874
movq -0x418(%rbp), %rsi
movq -0x420(%rbp), %rdx
incq %rdx
leaq -0x480(%rbp), %rdi
movq $-0x1, %rcx
callq 0x46f0
jmp 0x1e7fb
leaq -0x440(%rbp), %rdi
leaq -0x480(%rbp), %rsi
movq %rsi, -0x520(%rbp)
callq 0x43a0
movq -0x520(%rbp), %rdi
callq 0x4540
movq -0x418(%rbp), %rsi
movq -0x420(%rbp), %rcx
leaq -0x4a0(%rbp), %rdi
movl $0x1, %edx
callq 0x46f0
jmp 0x1e842
leaq -0x460(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x43a0
leaq -0x4a0(%rbp), %rdi
callq 0x4540
jmp 0x1e874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1ea04
leaq -0x3d8(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x224b0
movq %rax, -0x528(%rbp)
jmp 0x1e890
movq -0x528(%rbp), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x22510
movq %rax, -0x4b0(%rbp)
leaq -0x4a8(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x224e0
testb $0x1, %al
jne 0x1e8cd
jmp 0x1e9a5
leaq -0x3d8(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0x22510
movq %rax, -0x4c8(%rbp)
leaq -0x4c0(%rbp), %rdi
leaq -0x4c8(%rbp), %rsi
callq 0x22580
movq -0x530(%rbp), %rdi
callq 0x225e0
movq %rax, -0x4f8(%rbp)
leaq -0x4f0(%rbp), %rdi
leaq -0x460(%rbp), %rsi
leaq -0x4f8(%rbp), %rdx
callq 0x225a0
jmp 0x1e929
movq -0x4c0(%rbp), %rsi
leaq -0x3d8(%rbp), %rdi
leaq -0x4f0(%rbp), %rdx
callq 0x22540
movq %rax, -0x538(%rbp)
jmp 0x1e94c
movq -0x538(%rbp), %rax
movq %rax, -0x4b8(%rbp)
movq -0x4b8(%rbp), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x22600
leaq -0x3f0(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x21f50
jmp 0x1e989
jmp 0x1e9a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x4f0(%rbp), %rdi
callq 0x22600
jmp 0x1ea04
leaq -0x390(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x21f50
jmp 0x1e9ba
leaq -0x4a8(%rbp), %rdi
callq 0x22620
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x3a8(%rbp), %rdi
callq 0x21fc0
jmp 0x1e9db
leaq -0x460(%rbp), %rdi
callq 0x4540
leaq -0x440(%rbp), %rdi
callq 0x4540
leaq -0x400(%rbp), %rdi
callq 0x22350
jmp 0x1e5bc
leaq -0x460(%rbp), %rdi
callq 0x4540
leaq -0x440(%rbp), %rdi
callq 0x4540
jmp 0x1ed4f
leaq -0x58(%rbp), %rdi
movl $0x45d, %esi            # imm = 0x45D
leaq -0x390(%rbp), %rdx
callq 0x22050
jmp 0x1ea38
leaq -0x58(%rbp), %rdi
movl $0x45c, %esi            # imm = 0x45C
leaq -0x3a8(%rbp), %rdx
callq 0x22150
jmp 0x1ea4f
leaq -0x58(%rbp), %rdi
movl $0x45e, %esi            # imm = 0x45E
leaq -0x3f0(%rbp), %rdx
callq 0x22050
jmp 0x1ea66
leaq -0x58(%rbp), %rdi
movl $0x1390, %esi           # imm = 0x1390
leaq -0x270(%rbp), %rdx
callq 0x22640
jmp 0x1ea7d
leaq -0x58(%rbp), %rdi
movl $0x404, %esi            # imm = 0x404
leaq -0x258(%rbp), %rdx
callq 0x22150
jmp 0x1ea94
leaq -0x58(%rbp), %rdi
movl $0x406, %esi            # imm = 0x406
leaq -0x288(%rbp), %rdx
callq 0x22780
jmp 0x1eaab
leaq -0x58(%rbp), %rdi
movl $0x409, %esi            # imm = 0x409
leaq -0x2a0(%rbp), %rdx
callq 0x22780
jmp 0x1eac2
leaq -0x58(%rbp), %rdi
movl $0x40a, %esi            # imm = 0x40A
leaq -0x2b8(%rbp), %rdx
callq 0x22150
jmp 0x1ead9
leaq -0x58(%rbp), %rdi
movl $0x40b, %esi            # imm = 0x40B
leaq -0x2d0(%rbp), %rdx
callq 0x22050
jmp 0x1eaf0
leaq -0x58(%rbp), %rdi
movl $0x40c, %esi            # imm = 0x40C
leaq -0x2e8(%rbp), %rdx
callq 0x22050
jmp 0x1eb07
leaq -0x58(%rbp), %rdi
movl $0x40d, %esi            # imm = 0x40D
leaq -0x300(%rbp), %rdx
callq 0x22150
jmp 0x1eb1e
leaq -0x58(%rbp), %rdi
movl $0x40f, %esi            # imm = 0x40F
leaq -0x318(%rbp), %rdx
callq 0x22050
jmp 0x1eb35
leaq -0x58(%rbp), %rdi
movl $0x410, %esi            # imm = 0x410
leaq -0x330(%rbp), %rdx
callq 0x22050
jmp 0x1eb4c
leaq -0x58(%rbp), %rdi
movl $0x415, %esi            # imm = 0x415
leaq -0x348(%rbp), %rdx
callq 0x22150
jmp 0x1eb63
leaq -0x58(%rbp), %rdi
movl $0x447, %esi            # imm = 0x447
leaq -0x360(%rbp), %rdx
callq 0x22150
jmp 0x1eb7a
leaq -0x58(%rbp), %rdi
movl $0x448, %esi            # imm = 0x448
leaq -0x378(%rbp), %rdx
callq 0x22150
jmp 0x1eb91
cmpq $0x0, -0x68(%rbp)
jbe 0x1ebae
movq -0x68(%rbp), %rdx
leaq -0x58(%rbp), %rdi
movl $0x1391, %esi           # imm = 0x1391
callq 0x228a0
jmp 0x1ebac
jmp 0x1ebc3
movl -0x5c(%rbp), %edx
leaq -0x58(%rbp), %rdi
movl $0x3f1, %esi            # imm = 0x3F1
callq 0x21d50
jmp 0x1ebc1
jmp 0x1ebc3
movq -0x510(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movl $0x3f, %edx
callq 0x22970
jmp 0x1ebda
leaq -0x3f0(%rbp), %rdi
callq 0x22bf0
leaq -0x3d8(%rbp), %rdi
callq 0x22c50
leaq -0x3a8(%rbp), %rdi
callq 0x22c70
leaq -0x390(%rbp), %rdi
callq 0x22bf0
leaq -0x378(%rbp), %rdi
callq 0x22c70
leaq -0x360(%rbp), %rdi
callq 0x22c70
leaq -0x348(%rbp), %rdi
callq 0x22c70
leaq -0x330(%rbp), %rdi
callq 0x22bf0
leaq -0x318(%rbp), %rdi
callq 0x22bf0
leaq -0x300(%rbp), %rdi
callq 0x22c70
leaq -0x2e8(%rbp), %rdi
callq 0x22bf0
leaq -0x2d0(%rbp), %rdi
callq 0x22bf0
leaq -0x2b8(%rbp), %rdi
callq 0x22c70
leaq -0x2a0(%rbp), %rdi
callq 0x22cd0
leaq -0x288(%rbp), %rdi
callq 0x22cd0
leaq -0x270(%rbp), %rdi
callq 0x22d30
leaq -0x258(%rbp), %rdi
callq 0x22c70
leaq -0x1f8(%rbp), %rdi
callq 0x22bf0
leaq -0x1e0(%rbp), %rdi
callq 0x22c70
leaq -0x1c8(%rbp), %rdi
callq 0x22bf0
leaq -0x190(%rbp), %rdi
callq 0x22bf0
leaq -0x178(%rbp), %rdi
callq 0x22c70
leaq -0x160(%rbp), %rdi
callq 0x22bf0
leaq -0x128(%rbp), %rdi
callq 0x22bf0
leaq -0x110(%rbp), %rdi
callq 0x22c70
leaq -0xf8(%rbp), %rdi
callq 0x22bf0
leaq -0xc0(%rbp), %rdi
callq 0x22bf0
leaq -0xa8(%rbp), %rdi
callq 0x22c70
leaq -0x90(%rbp), %rdi
callq 0x22bf0
leaq -0x58(%rbp), %rdi
callq 0x22d90
movq -0x508(%rbp), %rax
addq $0x540, %rsp            # imm = 0x540
popq %rbp
retq
leaq -0x3f0(%rbp), %rdi
callq 0x22bf0
leaq -0x3d8(%rbp), %rdi
callq 0x22c50
leaq -0x3a8(%rbp), %rdi
callq 0x22c70
leaq -0x390(%rbp), %rdi
callq 0x22bf0
leaq -0x378(%rbp), %rdi
callq 0x22c70
leaq -0x360(%rbp), %rdi
callq 0x22c70
leaq -0x348(%rbp), %rdi
callq 0x22c70
leaq -0x330(%rbp), %rdi
callq 0x22bf0
leaq -0x318(%rbp), %rdi
callq 0x22bf0
leaq -0x300(%rbp), %rdi
callq 0x22c70
leaq -0x2e8(%rbp), %rdi
callq 0x22bf0
leaq -0x2d0(%rbp), %rdi
callq 0x22bf0
leaq -0x2b8(%rbp), %rdi
callq 0x22c70
leaq -0x2a0(%rbp), %rdi
callq 0x22cd0
leaq -0x288(%rbp), %rdi
callq 0x22cd0
leaq -0x270(%rbp), %rdi
callq 0x22d30
leaq -0x258(%rbp), %rdi
callq 0x22c70
leaq -0x1f8(%rbp), %rdi
callq 0x22bf0
leaq -0x1e0(%rbp), %rdi
callq 0x22c70
leaq -0x1c8(%rbp), %rdi
callq 0x22bf0
leaq -0x190(%rbp), %rdi
callq 0x22bf0
leaq -0x178(%rbp), %rdi
callq 0x22c70
leaq -0x160(%rbp), %rdi
callq 0x22bf0
leaq -0x128(%rbp), %rdi
callq 0x22bf0
leaq -0x110(%rbp), %rdi
callq 0x22c70
leaq -0xf8(%rbp), %rdi
callq 0x22bf0
leaq -0xc0(%rbp), %rdi
callq 0x22bf0
leaq -0xa8(%rbp), %rdi
callq 0x22c70
leaq -0x90(%rbp), %rdi
callq 0x22bf0
leaq -0x58(%rbp), %rdi
callq 0x22d90
movq -0x70(%rbp), %rdi
callq 0x4440
nopl (%rax)