// File: /workspace/github_cpp_makefile_star2_O3/jovermann[P]streplace/src/streplace.cpp
// Function: main
int main(int argc, char* argv[])
{
    // Run unit tests and exit if enabled at compile time.
    UNIT_TEST_RUN();

    // Command line options.
    ut1::CommandLineParser cl("streplace", "Replace strings in files, filenames and symbolic links, in place, recursively.\n"
                                           "\n"
                                           "Usage: $programName [OPTIONS, FILES, DIRS and RULES] [--] [FILES and DIRS]\n"
                                           "\n"
                                           "This program substitutes strings in files, filenames and symbolic links according to rules:\n"
                                           "- A rule is of the from FOO=BAR which replaces FOO by BAR. FOO is a regular expression by default (unless -x is specified).\n"
                                           "- Use C escape sequences like \\n \\t \\xff. Use \\\\ to get a verbatim backslash. Note that you will need to protect backslashes from the shell by using single quotes or by duplicating backslashes.\n"
                                           "- Use \\= to get a verbatim =.\n"
                                           "- Use 'IMG([0-9]*).jpeg=pic$1.jpg' to reuse subexpressions of regular expressions ($& for the whole match, $n for subexpressions)."
                                           "\n",
        "\n"
        "$programName version $version *** Copyright (c) 2021-2022 Johannes Overmann *** https://github.com/jovermann/streplace",
        "0.10.2");

    cl.addHeader("\nFile options:\n");
    cl.addOption('r', "recursive", "Recursively process directories.");
    cl.addOption('l', "follow-links", "Follow symbolic links.");
    cl.addOption(' ', "all", "Process all files and directories. By default '.git' directories are skipped.");

    cl.addHeader("\nMatching options:\n");
    cl.addOption('i', "ignore-case", "Ignore case.");
    cl.addOption('x', "no-regex", "Match the left side of each rule as a simple string, not as a regex (substring search, useful with binary files).");
    cl.addOption('w', "whole-words", "Match only whole words. A word is an alphanumeric seuqnece with underscores. If the match begins/ends with a non-word char then this is always considered to be a word boundary, e.g. 'foo;' matches '::foo;' but not 'barfoo;'.");
    cl.addOption(' ', "equals", "Use STR instead of \"=\" as the rule lhs/rhs-separator, e.g. fooSTRbar. This may be one or more chars long. Example: --equals==== allows rules to have the form \"int a = 0;===unsigned a = 0;\"", "STR", "=");
    cl.addOption(' ', "dollar", "Use STR instead of \"$\" in substring references in the replacement string, e.g. STR&, STR1, STR12. This may be one or more chars long. Example: --dollar=SUB for \"0x([0-9A-Za-z]+)=$SUB1\"", "STR", "$");

    cl.addHeader("\nRenaming options:\n");
    cl.addOption('N', "rename-only", "Rename files and dirs. Do not modify files contents.");
    cl.addOption('A', "rename", "Rename files and dirs and modify files contents.");
    cl.addOption('s', "modify-symlinks", "Modify the path symlinks point to. Do not modify files contents. Do not rename. -N, -A and -s are mutually exclusive.");

    cl.addHeader("\nVerbose / common options:\n");
    cl.addOption('v', "verbose", "Increase verbosity. Specify multiple times to be more verbose.");
    cl.addOption('d', "dummy-mode", "Do not write/change anything.").addAlias('0');
    cl.addOption('P', "preview", "Do not write/change anything, but print matching lines of matching files with context to stdout and highlight replacements.");
    cl.addOption(' ', "context", "set number of context lines for --preview to N (use +N to hide line separator, use -1 to display the whole file) (range=[-1..], default=1).", "N", "1");

    // Parse command line options.
    cl.parse(argc, argv);

    try
    {
        // Steplace instance.
        Streplace streplace(cl);

        // Parse non-option arguments (paths and rules).
        std::vector<std::filesystem::directory_entry> paths;
        bool                                          allowRules = true;
        for (const std::string& arg: cl.getArgs())
        {
            if (arg.empty())
            {
                cl.printMessage("Ignoring empty argument.");
                continue;
            }
            if (allowRules && ut1::contains(arg, cl.getStr("equals")))
            {
                streplace.addRule(arg);
            }
            else if (allowRules && (arg == "--"))
            {
                allowRules = false;
            }
            else if (std::filesystem::exists(arg))
            {
                paths.emplace_back(arg);
            }
            else
            {
                cl.error("'" + arg + "': No such file or directory.");
            }
        }

        // Print rules.
        if (cl.getCount("verbose") >= 2)
        {
            streplace.printRules();
        }

        // Process files and directories.
        for (std::filesystem::directory_entry path: paths)
        {
            streplace.processDirectoryEntry(path);
        }

        // Print stats.
        if (cl("verbose"))
        {
            streplace.printStats();
        }
    }
    catch (const std::exception& e)
    {
        cl.error(e.what());
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x88(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1596f(%rip), %rsi     # 0x2197e
leaq 0x15971(%rip), %rdx     # 0x21987
leaq 0x78(%rsp), %rdi
callq 0x9172
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x15608(%rip), %rsi     # 0x21638
leaq 0x158d8(%rip), %rdx     # 0x2190f
movq %rsp, %rdi
callq 0x9172
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x158c1(%rip), %rsi     # 0x21910
leaq 0x15931(%rip), %rdx     # 0x21987
leaq 0x30(%rsp), %rdi
callq 0x9172
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x15918(%rip), %rsi     # 0x21988
leaq 0x15917(%rip), %rdx     # 0x2198e
leaq 0x50(%rsp), %rdi
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
movq %rsp, %rdx
leaq 0x30(%rsp), %rcx
leaq 0x50(%rsp), %r8
callq 0x5c6e
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc0b7
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc0ce
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc0e9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc103
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1587d(%rip), %rsi     # 0x2198f
leaq 0x15885(%rip), %rdx     # 0x2199e
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x661c
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc14a
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x15846(%rip), %rsi     # 0x2199f
leaq 0x15848(%rip), %rdx     # 0x219a8
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15832(%rip), %rsi     # 0x219a9
leaq 0x1584b(%rip), %rdx     # 0x219c9
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x72, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc1d6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc1ed
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc208
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc222
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x15799(%rip), %rsi     # 0x219ca
leaq 0x1579e(%rip), %rdx     # 0x219d6
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15788(%rip), %rsi     # 0x219d7
leaq 0x15797(%rip), %rdx     # 0x219ed
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x6c, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc2ae
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc2c5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc2e0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc2fa
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x156e5(%rip), %rsi     # 0x219ee
leaq 0x156e1(%rip), %rdx     # 0x219f1
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x156cb(%rip), %rsi     # 0x219f2
leaq 0x15711(%rip), %rdx     # 0x21a3f
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x20, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc386
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc39d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc3b8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc3d2
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1565f(%rip), %rsi     # 0x21a40
leaq 0x1566b(%rip), %rdx     # 0x21a53
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x661c
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc419
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1562c(%rip), %rsi     # 0x21a54
leaq 0x15630(%rip), %rdx     # 0x21a5f
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1561a(%rip), %rsi     # 0x21a60
leaq 0x1561f(%rip), %rdx     # 0x21a6c
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x69, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc4a5
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc4bc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc4d7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc4f1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1556d(%rip), %rsi     # 0x21a6d
leaq 0x1556e(%rip), %rdx     # 0x21a75
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15558(%rip), %rsi     # 0x21a76
leaq 0x155c2(%rip), %rdx     # 0x21ae7
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x78, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc57d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc594
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc5af
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc5c9
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x15510(%rip), %rsi     # 0x21ae8
leaq 0x15514(%rip), %rdx     # 0x21af3
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x154fe(%rip), %rsi     # 0x21af4
leaq 0x155d7(%rip), %rdx     # 0x21bd4
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x77, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc655
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc66c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc687
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc6a1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x15525(%rip), %rsi     # 0x21bd5
leaq 0x15524(%rip), %rdx     # 0x21bdb
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1550e(%rip), %rsi     # 0x21bdc
leaq 0x155c3(%rip), %rdx     # 0x21c98
callq 0x9172
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x155b0(%rip), %rsi     # 0x21c99
leaq 0x155ac(%rip), %rdx     # 0x21c9c
callq 0x9172
leaq 0x50(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x14a95(%rip), %rsi     # 0x21199
leaq 0x14a8f(%rip), %rdx     # 0x2119a
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
leaq 0x30(%rsp), %r8
leaq 0x50(%rsp), %r9
movl $0x20, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc74b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc762
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc77d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc797
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x154f7(%rip), %rsi     # 0x21c9d
leaq 0x154f6(%rip), %rdx     # 0x21ca3
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x154e0(%rip), %rsi     # 0x21ca4
leaq 0x15591(%rip), %rdx     # 0x21d5c
callq 0x9172
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x154ba(%rip), %rsi     # 0x21c99
leaq 0x154b6(%rip), %rdx     # 0x21c9c
callq 0x9172
leaq 0x50(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x15a6d(%rip), %rsi     # 0x22267
leaq 0x15a67(%rip), %rdx     # 0x22268
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
leaq 0x30(%rsp), %r8
leaq 0x50(%rsp), %r9
movl $0x20, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc841
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc858
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc873
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc88d
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x154c1(%rip), %rsi     # 0x21d5d
leaq 0x154cd(%rip), %rdx     # 0x21d70
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x661c
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc8d4
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x157c5(%rip), %rsi     # 0x220a8
leaq 0x157c9(%rip), %rdx     # 0x220b3
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15470(%rip), %rsi     # 0x21d71
leaq 0x1549d(%rip), %rdx     # 0x21da5
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x4e, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xc960
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xc977
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xc992
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xc9ac
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x153eb(%rip), %rsi     # 0x21da6
leaq 0x153ea(%rip), %rdx     # 0x21dac
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x153d4(%rip), %rsi     # 0x21dad
leaq 0x153fd(%rip), %rdx     # 0x21ddd
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x41, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xca38
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xca4f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xca6a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xca84
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1534b(%rip), %rsi     # 0x21dde
leaq 0x15353(%rip), %rdx     # 0x21ded
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1533d(%rip), %rsi     # 0x21dee
leaq 0x153ab(%rip), %rdx     # 0x21e63
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x73, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xcb10
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xcb27
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xcb42
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xcb5c
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x152f9(%rip), %rsi     # 0x21e64
leaq 0x1530d(%rip), %rdx     # 0x21e7f
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x661c
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xcba3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x152ce(%rip), %rsi     # 0x21e80
leaq 0x152ce(%rip), %rdx     # 0x21e87
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x152b8(%rip), %rsi     # 0x21e88
leaq 0x152ef(%rip), %rdx     # 0x21ec6
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x76, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xcc2f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xcc46
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xcc61
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xcc7b
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1523d(%rip), %rsi     # 0x21ec7
leaq 0x15240(%rip), %rdx     # 0x21ed1
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x1522a(%rip), %rsi     # 0x21ed2
leaq 0x15240(%rip), %rdx     # 0x21eef
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x64, %esi
callq 0x60d4
movq %rax, %r14
leaq 0x1(%rax), %rsi
movb $0x30, 0x1(%rax)
movq 0xb8(%rax), %rdi
addq $0x48, %rdi
callq 0x8b40
addq $0x8, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x5220
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xcd31
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %r14
cmpq %r14, %rdi
je 0xcd4d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xcd68
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xcd82
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1515f(%rip), %rsi     # 0x21ef0
leaq 0x1515f(%rip), %rdx     # 0x21ef7
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15149(%rip), %rsi     # 0x21ef8
leaq 0x151bd(%rip), %rdx     # 0x21f73
callq 0x9172
leaq 0x30(%rsp), %r8
movq %r14, (%r8)
xorl %eax, %eax
movq %rax, 0x8(%r8)
movb %al, 0x10(%r8)
leaq 0x50(%rsp), %r9
movq %r15, (%r9)
movq %rax, 0x8(%r9)
movb %al, 0x10(%r9)
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
movl $0x50, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xce0e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xce25
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xce40
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xce5a
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x78(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1510b(%rip), %rsi     # 0x21f74
leaq 0x1510b(%rip), %rdx     # 0x21f7b
callq 0x9172
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x150f5(%rip), %rsi     # 0x21f7c
leaq 0x15179(%rip), %rdx     # 0x22007
callq 0x9172
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x158b2(%rip), %rsi     # 0x22754
leaq 0x158ac(%rip), %rdx     # 0x22755
callq 0x9172
leaq 0x50(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1587b(%rip), %rsi     # 0x22738
leaq 0x15875(%rip), %rdx     # 0x22739
callq 0x9172
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rdx
movq %rsp, %rcx
leaq 0x30(%rsp), %r8
leaq 0x50(%rsp), %r9
movl $0x20, %esi
callq 0x60d4
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xcf04
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xcf1b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xcf36
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xcf50
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
leaq 0x190(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x671e
leaq 0x78(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0xd5fe
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x208(%rsp), %rbx
movq 0x210(%rsp), %rbp
cmpq %rbp, %rbx
je 0xd0f7
movb $0x1, %r12b
movq %rsp, %r14
leaq 0x190(%rsp), %r15
cmpq $0x0, 0x8(%rbx)
je 0xd041
testb $0x1, %r12b
je 0xd09b
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x14c01(%rip), %rsi     # 0x21bd5
leaq 0x14c00(%rip), %rdx     # 0x21bdb
callq 0x9172
movq %r15, %rdi
movq %r14, %rsi
callq 0x83be
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa3b0
movl %eax, %r13d
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd014
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
testb %r13b, %r13b
je 0xd088
movb $0x1, %r12b
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
leaq 0xb0(%rsp), %rdx
leaq 0xad(%rsp), %rcx
callq 0x106e2
jmp 0xd0e3
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x14fb4(%rip), %rsi     # 0x22008
leaq 0x14fc5(%rip), %rdx     # 0x22020
callq 0x9172
movq %r15, %rdi
movq %r14, %rsi
callq 0x745e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd0e3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd0e3
movq %rbx, %rdi
leaq 0x14161(%rip), %rsi     # 0x211f3
callq 0x50f0
testl %eax, %eax
je 0xd0f2
movq %r14, %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq 0xdf6a
movq %r14, %rdi
callq 0x5180
movq %rax, %r13
movq %r14, %rdi
callq 0xdfea
testb %r13b, %r13b
je 0xd224
movzbl %r13b, %eax
cmpl $0xff, %eax
je 0xd224
leaq 0x50(%rsp), %rdi
movq %rbx, %rsi
callq 0xe022
addq $0x20, %rbx
cmpq %rbp, %rbx
jne 0xcfac
jmp 0xd0f7
xorl %r12d, %r12d
jmp 0xd0e3
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x14d77(%rip), %rsi     # 0x21e80
leaq 0x14d77(%rip), %rdx     # 0x21e87
callq 0x9172
leaq 0x190(%rsp), %rdi
movq %rsp, %rsi
callq 0x8260
movl %eax, %ebx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd142
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
cmpl $0x2, %ebx
jb 0xd151
leaq 0x78(%rsp), %rdi
callq 0xe05c
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r12
cmpq %r12, %rbx
je 0xd196
movq %rsp, %r14
leaq 0x78(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11082
movb 0x28(%rbx), %al
movb %al, 0x28(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0xe0ca
movq %r14, %rdi
callq 0xdfea
addq $0x30, %rbx
cmpq %r12, %rbx
jne 0xd168
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x14cd8(%rip), %rsi     # 0x21e80
leaq 0x14cd8(%rip), %rdx     # 0x21e87
callq 0x9172
leaq 0x190(%rsp), %rdi
movq %rsp, %rsi
callq 0x8260
movl %eax, %ebx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd1e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
testl %ebx, %ebx
je 0xd1ef
leaq 0x78(%rsp), %rdi
callq 0xe562
leaq 0x50(%rsp), %rdi
callq 0x10488
leaq 0x78(%rsp), %rdi
callq 0x104d0
leaq 0x190(%rsp), %rdi
callq 0x1056c
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13f42(%rip), %rsi     # 0x2116d
leaq 0x30(%rsp), %rdi
movq %rbx, %rdx
callq 0x89cc
leaq 0x14de2(%rip), %rsi     # 0x22021
leaq 0x30(%rsp), %rdi
callq 0x57c0
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xd26e
movups (%rcx), %xmm0
leaq 0x10(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0xd27a
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x190(%rsp), %rdi
movl $0x1, %edx
callq 0x8890
jmp 0xd51d
jmp 0xd54a
jmp 0xd51d
jmp 0xd54a
movq %rdx, %r14
movq %rax, %rbx
jmp 0xd574
jmp 0xd415
jmp 0xd4a8
movq %rax, %rbx
jmp 0xd4c2
jmp 0xd360
jmp 0xd3ef
jmp 0xd415
jmp 0xd4a8
jmp 0xd3ef
jmp 0xd415
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd35b
jmp 0xd360
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
movq %rax, %rbx
jmp 0xd3b7
movq %rax, %rbx
jmp 0xd3ce
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
jmp 0xd39d
jmp 0xd3ef
jmp 0xd415
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xd3b7
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xd3ce
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd3f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd3f2
jmp 0xd3ef
jmp 0xd415
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xd5e1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd5e1
movq %rax, %rbx
jmp 0xd5e1
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xd43c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd43c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xd458
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd458
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd478
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd478
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r12, %rdi
je 0xd5ee
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd5ee
movq %rax, %rbx
jmp 0xd5ee
jmp 0xd54a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xd4c2
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5410
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
jne 0xd3c1
jmp 0xd3ce
movq %rdx, %r14
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd503
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd503
movq %rdx, %r14
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xd560
movq 0x40(%rsp), %rsi
jmp 0xd536
jmp 0xd51d
jmp 0xd54a
movq %rdx, %r14
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xd560
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd560
jmp 0xd54a
jmp 0xd552
jmp 0xd54a
jmp 0xd54a
jmp 0xd54a
movq %rdx, %r14
movq %rax, %rbx
jmp 0xd560
movq %rdx, %r14
movq %rax, %rbx
movq %rsp, %rdi
callq 0xdfea
leaq 0x50(%rsp), %rdi
callq 0x10488
leaq 0x78(%rsp), %rdi
callq 0x104d0
cmpl $0x1, %r14d
jne 0xd5e1
movq %rbx, %rdi
callq 0x5190
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x78(%rsp), %rdi
movq %rsp, %rdx
movq %rax, %rsi
callq 0x8930
leaq 0x190(%rsp), %rdi
leaq 0x78(%rsp), %rsi
movl $0x1, %edx
callq 0x8890
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xd5dc
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x5410
jmp 0xd5dc
movq %rax, %rbx
callq 0x56b0
leaq 0x190(%rsp), %rdi
callq 0x1056c
movq %rbx, %rdi
callq 0x5720
movq %rax, %rdi
callq 0x8f5e