// File: DCTewi[P]Truthtable-Calculator/functions.cpp
// Function: solve()
int solve()
{
    std::cout << "Support: (, ), +(||, |), *(&&, &), ->(-), ==(=);\n\n";
    std::cout << "Please input the expression:\n";

    std::string s;
    std::cin >> s;

    prepareWork(s);
    // Try to get a reverse polish notation from s
    try
    {
        s = toReverseNotation(s);
        #ifdef DEBUG
            std::cout << s << "\n";
        #endif
    }
    catch(const std::exception& e)
    {
        // Illegal expression
        std::cerr << e.what() << '\n';
        return -1;
    }

    // For every permutation of variables
    std::map<char, int> varlist;
    // Variable list
    std::vector<char> var;

    // Get every char of s
    for (int i = 0; i < static_cast<int>(s.size()); i++)
    {
        if (isalpha(s[i]) && !varlist.count(s[i]))
        {
            var.emplace_back(s[i]);
            varlist[s[i]] = 0;
        }
    }

    // Cache the number of variables
    int numofvar = static_cast<int>(var.size());
    // Result of main DNF and main CNF
    std::vector<std::vector<int>> dnf, cnf;

    // Title of truth table
    std::cout << std::endl;
    for (int i = 0; i < numofvar; i++)
    {
        std::cout << std::left << std::setw(4) << var[i];
    }
    std::cout << std::left << std::setw(4) << "Res\n";
    // For every line of truth table
    for (int numof1 = 0; numof1 <= numofvar; numof1++)
    {
        std::vector<int> buffer(numofvar, 0);
        for (int i = 0; i < numof1; i++)
        {
            buffer[numofvar - 1 - i] = 1;
        }

        do
        {
            for (int i = 0; i < numofvar; i++)
            {
                varlist[var[i]] = buffer[i];
                std::cout << std::left << std::setw(4) << varlist[var[i]];
            }
            try
            {
                // Get result of current form
                int res = getResultOf(s, varlist);

                std::vector<int> truth(numofvar);
                for (int i = 0; i < numofvar; i++)
                {
                    truth[i] = varlist[var[i]];
                }
                // CNF
                if (res == 0)
                {
                    cnf.emplace_back(truth);
                }
                // DNF
                else if (res == 1)
                {
                    dnf.emplace_back(truth);
                }
                std::cout << " " << std::left << std::setw(4) << res << '\n';
            }
            catch(const std::exception& e)
            {
                std::cerr << e.what() << '\n';
                return 0;
            }
        }
        while (next_permutation(buffer.begin(), buffer.end()));
    }

    // Print DNF
    std::cout << "Disjunctive normal form:\n";
    int dnflen = static_cast<int>(dnf.size());
    if (dnflen == 0)
    {
        std::cout << "None\n";
    }
    for (int i = 0; i < dnflen; i++)
    {
        std::cout << "(";
        for (int j = 0; j < numofvar; j++)
        {
            std::cout << (dnf[i][j] ? " " : "!") << var[j] << (j != numofvar - 1 ? " & " : i < dnflen - 1 ? ") | " : ") \n");
        }
    }

    // Print CNF
    std::cout << "Canonical normal form:\n";
    int cnflen = static_cast<int>(cnf.size());
    if (cnflen == 0)
    {
        std::cout << "None\n";
    }
    for (int i = 0; i < cnflen; i++)
    {
        std::cout << "(";
        for (int j = 0; j < numofvar; j++)
        {
            std::cout << (cnf[i][j] ? "!" : " ") << var[j] << (j != numofvar - 1 ? " | " : i < cnflen - 1 ? ") & " : ") \n");
        }
    }

    return 0;
}

// Assembly:
subq $0x2e8, %rsp            # imm = 0x2E8
movq 0xf61a(%rip), %rdi      # 0x12fc8
movq %rdi, 0x158(%rsp)
leaq 0x9669(%rip), %rsi      # 0xd026
callq 0x21b0
movq 0x158(%rsp), %rdi
leaq 0x9688(%rip), %rsi      # 0xd059
callq 0x21b0
leaq 0x2c0(%rsp), %rdi
movq %rdi, 0x160(%rsp)
callq 0x2270
movq 0x160(%rsp), %rsi
movq 0xf5de(%rip), %rdi      # 0x12fd8
callq 0x2260
jmp 0x3a01
leaq 0x2c0(%rsp), %rdi
callq 0x25b0
jmp 0x3a10
leaq 0x290(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x2b60
jmp 0x3a27
leaq 0x2c0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x2250
leaq 0x290(%rsp), %rdi
callq 0x2130
jmp 0x3b24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0x482e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
movl 0x2b4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x482e
movq 0x2b8(%rsp), %rdi
callq 0x20b0
movq %rax, 0x288(%rsp)
movq 0x288(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0xf531(%rip), %rdi      # 0x12ff0
callq 0x21b0
movq %rax, 0x150(%rsp)
jmp 0x3ace
movq 0x150(%rsp), %rdi
movl $0xa, %esi
callq 0x2240
jmp 0x3ae2
movl $0xffffffff, 0x2e4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x284(%rsp)
callq 0x22d0
jmp 0x3b1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
callq 0x22d0
jmp 0x3b1f
jmp 0x4812
jmp 0x482e
leaq 0x250(%rsp), %rdi
callq 0x4d70
leaq 0x238(%rsp), %rdi
callq 0x4d80
movl $0x0, 0x234(%rsp)
movl 0x234(%rsp), %eax
movl %eax, 0x14c(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0x2160
movq %rax, %rcx
movl 0x14c(%rsp), %eax
cmpl %ecx, %eax
jge 0x3cb3
movslq 0x234(%rsp), %rsi
leaq 0x2c0(%rsp), %rdi
callq 0x2350
movq %rax, 0x140(%rsp)
jmp 0x3b95
movq 0x140(%rsp), %rax
movsbl (%rax), %edi
callq 0x22b0
cmpl $0x0, %eax
je 0x3c9b
movslq 0x234(%rsp), %rsi
leaq 0x2c0(%rsp), %rdi
callq 0x2350
movq %rax, 0x138(%rsp)
jmp 0x3bcd
movq 0x138(%rsp), %rsi
leaq 0x250(%rsp), %rdi
callq 0x4d90
movq %rax, 0x130(%rsp)
jmp 0x3bec
movq 0x130(%rsp), %rax
cmpq $0x0, %rax
jne 0x3c9b
movslq 0x234(%rsp), %rsi
leaq 0x2c0(%rsp), %rdi
callq 0x2350
movq %rax, 0x128(%rsp)
jmp 0x3c1d
movq 0x128(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4df0
jmp 0x3c34
movslq 0x234(%rsp), %rsi
leaq 0x2c0(%rsp), %rdi
callq 0x2350
movq %rax, 0x120(%rsp)
jmp 0x3c53
movq 0x120(%rsp), %rsi
leaq 0x250(%rsp), %rdi
callq 0x4c30
movq %rax, 0x118(%rsp)
jmp 0x3c72
movq 0x118(%rsp), %rax
movl $0x0, (%rax)
jmp 0x3c9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0x47f6
jmp 0x3c9d
movl 0x234(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x234(%rsp)
jmp 0x3b49
leaq 0x238(%rsp), %rdi
callq 0x4e70
movl %eax, 0x230(%rsp)
leaq 0x218(%rsp), %rdi
callq 0x4e90
leaq 0x200(%rsp), %rdi
callq 0x4e90
movq 0xf2e0(%rip), %rdi      # 0x12fc8
movq 0xf2b9(%rip), %rsi      # 0x12fa8
callq 0x2200
jmp 0x3cf6
movl $0x0, 0x1fc(%rsp)
movl 0x1fc(%rsp), %eax
cmpl 0x230(%rsp), %eax
jge 0x3dc9
movq 0xf2ac(%rip), %rdi      # 0x12fc8
leaq 0x117d(%rip), %rsi      # 0x4ea0
callq 0x2090
movq %rax, 0x110(%rsp)
jmp 0x3d32
movl $0x4, %edi
callq 0x4ec0
movl %eax, 0x10c(%rsp)
jmp 0x3d45
movq 0x110(%rsp), %rdi
movl 0x10c(%rsp), %eax
movl %eax, 0x1f8(%rsp)
movl 0x1f8(%rsp), %esi
callq 0x2230
movq %rax, 0x100(%rsp)
jmp 0x3d71
movslq 0x1fc(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq 0x100(%rsp), %rdi
movsbl (%rax), %esi
callq 0x2240
jmp 0x3d98
jmp 0x3d9a
movl 0x1fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1fc(%rsp)
jmp 0x3d01
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0x47dc
movq 0xf1f8(%rip), %rdi      # 0x12fc8
leaq 0x10c9(%rip), %rsi      # 0x4ea0
callq 0x2090
movq %rax, 0xf8(%rsp)
jmp 0x3de6
movl $0x4, %edi
callq 0x4ec0
movl %eax, 0xf4(%rsp)
jmp 0x3df9
movq 0xf8(%rsp), %rdi
movl 0xf4(%rsp), %eax
movl %eax, 0x1f4(%rsp)
movl 0x1f4(%rsp), %esi
callq 0x2230
movq %rax, 0xe8(%rsp)
jmp 0x3e25
movq 0xe8(%rsp), %rdi
leaq 0x9243(%rip), %rsi      # 0xd077
callq 0x21b0
jmp 0x3e3b
movl $0x0, 0x1f0(%rsp)
movl 0x1f0(%rsp), %eax
cmpl 0x230(%rsp), %eax
jg 0x442f
movslq 0x230(%rsp), %rax
movq %rax, 0xd8(%rsp)
movl $0x0, 0x1d4(%rsp)
leaq 0x1d3(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x4f00
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rcx
leaq 0x1d8(%rsp), %rdi
leaq 0x1d4(%rsp), %rdx
callq 0x4f10
jmp 0x3eb1
leaq 0x1d3(%rsp), %rdi
callq 0x4f90
movl $0x0, 0x1cc(%rsp)
movl 0x1cc(%rsp), %eax
cmpl 0x1f0(%rsp), %eax
jge 0x3f39
movl 0x230(%rsp), %eax
subl $0x1, %eax
subl 0x1cc(%rsp), %eax
movslq %eax, %rsi
leaq 0x1d8(%rsp), %rdi
callq 0x4fa0
movl $0x1, (%rax)
movl 0x1cc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1cc(%rsp)
jmp 0x3ec9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0x1d3(%rsp), %rdi
callq 0x4f90
jmp 0x47dc
jmp 0x3f3b
movl $0x0, 0x1c8(%rsp)
movl 0x1c8(%rsp), %eax
cmpl 0x230(%rsp), %eax
jge 0x408d
movslq 0x1c8(%rsp), %rsi
leaq 0x1d8(%rsp), %rdi
callq 0x4fa0
movl (%rax), %eax
movl %eax, 0xcc(%rsp)
movslq 0x1c8(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq %rax, %rsi
leaq 0x250(%rsp), %rdi
callq 0x4c30
movq %rax, 0xd0(%rsp)
jmp 0x3fa7
movq 0xd0(%rsp), %rax
movl 0xcc(%rsp), %ecx
movl %ecx, (%rax)
movq 0xf009(%rip), %rdi      # 0x12fc8
leaq 0xeda(%rip), %rsi       # 0x4ea0
callq 0x2090
movq %rax, 0xc0(%rsp)
jmp 0x3fd5
movl $0x4, %edi
callq 0x4ec0
movl %eax, 0xbc(%rsp)
jmp 0x3fe8
movq 0xc0(%rsp), %rdi
movl 0xbc(%rsp), %eax
movl %eax, 0x1c4(%rsp)
movl 0x1c4(%rsp), %esi
callq 0x2230
movq %rax, 0xb0(%rsp)
jmp 0x4014
movslq 0x1c8(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq %rax, %rsi
leaq 0x250(%rsp), %rdi
callq 0x4c30
movq %rax, 0xa8(%rsp)
jmp 0x4043
movq 0xb0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movl (%rax), %esi
callq 0x2300
jmp 0x405c
jmp 0x405e
movl 0x1c8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c8(%rsp)
jmp 0x3f46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0x441d
leaq 0x2c0(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x3160
movb %al, 0xa7(%rsp)
jmp 0x40ab
movb 0xa7(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x1c0(%rsp)
movslq 0x230(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x1a7(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x4f00
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
leaq 0x1a8(%rsp), %rdi
callq 0x4fc0
jmp 0x4103
leaq 0x1a7(%rsp), %rdi
callq 0x4f90
movl $0x0, 0x1a0(%rsp)
movl 0x1a0(%rsp), %eax
cmpl 0x230(%rsp), %eax
jge 0x427e
movslq 0x1a0(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq %rax, %rsi
leaq 0x250(%rsp), %rdi
callq 0x4c30
movq %rax, 0x88(%rsp)
jmp 0x415e
movq 0x88(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x84(%rsp)
movslq 0x1a0(%rsp), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x4fa0
movl 0x84(%rsp), %ecx
movl %ecx, (%rax)
movl 0x1a0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1a0(%rsp)
jmp 0x411b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
jmp 0x41fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0x1a7(%rsp), %rdi
callq 0x4f90
jmp 0x41fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x50c0
movl 0x2b4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x441d
movq 0x2b8(%rsp), %rdi
callq 0x20b0
movq %rax, 0x190(%rsp)
movq 0x190(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq %rax, %rsi
movq 0xedaf(%rip), %rdi      # 0x12ff0
callq 0x21b0
movq %rax, 0x78(%rsp)
jmp 0x424d
movq 0x78(%rsp), %rdi
movl $0xa, %esi
callq 0x2240
jmp 0x425e
movl $0x0, 0x2e4(%rsp)
movl $0x1, 0x284(%rsp)
callq 0x22d0
jmp 0x437e
cmpl $0x0, 0x1c0(%rsp)
jne 0x42a1
leaq 0x200(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x5040
jmp 0x429f
jmp 0x42c6
cmpl $0x1, 0x1c0(%rsp)
jne 0x42c4
leaq 0x218(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x5040
jmp 0x42c2
jmp 0x42c4
jmp 0x42c6
movq 0xecfb(%rip), %rdi      # 0x12fc8
leaq 0x8dee(%rip), %rsi      # 0xd0c2
callq 0x21b0
movq %rax, 0x70(%rsp)
jmp 0x42e0
movq 0x70(%rsp), %rdi
leaq 0xbb4(%rip), %rsi       # 0x4ea0
callq 0x2090
movq %rax, 0x68(%rsp)
jmp 0x42f8
movl $0x4, %edi
callq 0x4ec0
movl %eax, 0x64(%rsp)
jmp 0x4308
movq 0x68(%rsp), %rdi
movl 0x64(%rsp), %eax
movl %eax, 0x19c(%rsp)
movl 0x19c(%rsp), %esi
callq 0x2230
movq %rax, 0x58(%rsp)
jmp 0x432b
movq 0x58(%rsp), %rdi
movl 0x1c0(%rsp), %esi
callq 0x2300
movq %rax, 0x50(%rsp)
jmp 0x4343
movq 0x50(%rsp), %rdi
movl $0xa, %esi
callq 0x2240
jmp 0x4354
leaq 0x1a8(%rsp), %rdi
callq 0x50c0
jmp 0x4385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2b8(%rsp)
movl %eax, 0x2b4(%rsp)
callq 0x22d0
jmp 0x4380
jmp 0x43e7
jmp 0x441d
jmp 0x4387
leaq 0x1d8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x5160
movq 0x40(%rsp), %rdi
movq %rax, 0x188(%rsp)
callq 0x5190
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rdi
movq 0x180(%rsp), %rsi
callq 0x5120
movb %al, 0x4f(%rsp)
jmp 0x43ce
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x3f3b
jmp 0x43dc
movl $0x0, 0x284(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x50c0
movl 0x284(%rsp), %eax
testl %eax, %eax
jne 0x47a6
jmp 0x4405
jmp 0x4407
movl 0x1f0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1f0(%rsp)
jmp 0x3e46
leaq 0x1d8(%rsp), %rdi
callq 0x50c0
jmp 0x47dc
movq 0xeb92(%rip), %rdi      # 0x12fc8
leaq 0x8c3f(%rip), %rsi      # 0xd07c
callq 0x21b0
jmp 0x4444
leaq 0x218(%rsp), %rdi
callq 0x51c0
movl %eax, 0x17c(%rsp)
cmpl $0x0, 0x17c(%rsp)
jne 0x4479
movq 0xeb5f(%rip), %rdi      # 0x12fc8
leaq 0x8c26(%rip), %rsi      # 0xd096
callq 0x21b0
jmp 0x4477
jmp 0x4479
movl $0x0, 0x178(%rsp)
movl 0x178(%rsp), %eax
cmpl 0x17c(%rsp), %eax
jge 0x45e1
movq 0xeb29(%rip), %rdi      # 0x12fc8
leaq 0x8bf6(%rip), %rsi      # 0xd09c
callq 0x21b0
jmp 0x44ad
movl $0x0, 0x174(%rsp)
movl 0x174(%rsp), %eax
cmpl 0x230(%rsp), %eax
jge 0x45c9
movslq 0x178(%rsp), %rsi
leaq 0x218(%rsp), %rdi
callq 0x51e0
movq %rax, %rdi
movslq 0x174(%rsp), %rsi
callq 0x4fa0
cmpl $0x0, (%rax)
je 0x4504
leaq 0x8bc5(%rip), %rax      # 0xd0c2
movq %rax, 0x38(%rsp)
jmp 0x4512
leaq 0x8b19(%rip), %rax      # 0xd024
movq %rax, 0x38(%rsp)
jmp 0x4512
movq 0x38(%rsp), %rsi
movq 0xeaaa(%rip), %rdi      # 0x12fc8
callq 0x21b0
movq %rax, 0x30(%rsp)
jmp 0x452a
movslq 0x174(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq 0x30(%rsp), %rdi
movsbl (%rax), %esi
callq 0x2240
movq %rax, 0x28(%rsp)
jmp 0x4553
movl 0x174(%rsp), %eax
movl 0x230(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x4576
leaq 0x8b51(%rip), %rax      # 0xd0c0
movq %rax, 0x20(%rsp)
jmp 0x45a0
movl 0x178(%rsp), %edx
movl 0x17c(%rsp), %esi
subl $0x1, %esi
leaq 0x8b15(%rip), %rax      # 0xd0a3
leaq 0x8b09(%rip), %rcx      # 0xd09e
cmpl %esi, %edx
cmovlq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x21b0
jmp 0x45b1
jmp 0x45b3
movl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
jmp 0x44b8
jmp 0x45cb
movl 0x178(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x178(%rsp)
jmp 0x4484
movq 0xe9e0(%rip), %rdi      # 0x12fc8
leaq 0x8ab8(%rip), %rsi      # 0xd0a7
callq 0x21b0
jmp 0x45f6
leaq 0x200(%rsp), %rdi
callq 0x51c0
movl %eax, 0x170(%rsp)
cmpl $0x0, 0x170(%rsp)
jne 0x462b
movq 0xe9ad(%rip), %rdi      # 0x12fc8
leaq 0x8a74(%rip), %rsi      # 0xd096
callq 0x21b0
jmp 0x4629
jmp 0x462b
movl $0x0, 0x16c(%rsp)
movl 0x16c(%rsp), %eax
cmpl 0x170(%rsp), %eax
jge 0x4790
movq 0xe977(%rip), %rdi      # 0x12fc8
leaq 0x8a44(%rip), %rsi      # 0xd09c
callq 0x21b0
jmp 0x465f
movl $0x0, 0x168(%rsp)
movl 0x168(%rsp), %eax
cmpl 0x230(%rsp), %eax
jge 0x4778
movslq 0x16c(%rsp), %rsi
leaq 0x200(%rsp), %rdi
callq 0x51e0
movq %rax, %rdi
movslq 0x168(%rsp), %rsi
callq 0x4fa0
cmpl $0x0, (%rax)
je 0x46b6
leaq 0x8975(%rip), %rax      # 0xd024
movq %rax, 0x18(%rsp)
jmp 0x46c4
leaq 0x8a05(%rip), %rax      # 0xd0c2
movq %rax, 0x18(%rsp)
jmp 0x46c4
movq 0x18(%rsp), %rsi
movq 0xe8f8(%rip), %rdi      # 0x12fc8
callq 0x21b0
movq %rax, 0x10(%rsp)
jmp 0x46dc
movslq 0x168(%rsp), %rsi
leaq 0x238(%rsp), %rdi
callq 0x4ee0
movq 0x10(%rsp), %rdi
movsbl (%rax), %esi
callq 0x2240
movq %rax, 0x8(%rsp)
jmp 0x4705
movl 0x168(%rsp), %eax
movl 0x230(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x4727
leaq 0x897e(%rip), %rax      # 0xd09f
movq %rax, (%rsp)
jmp 0x4750
movl 0x16c(%rsp), %edx
movl 0x170(%rsp), %esi
subl $0x1, %esi
leaq 0x8964(%rip), %rax      # 0xd0a3
leaq 0x8979(%rip), %rcx      # 0xd0bf
cmpl %esi, %edx
cmovlq %rcx, %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq (%rsp), %rsi
callq 0x21b0
jmp 0x4760
jmp 0x4762
movl 0x168(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x168(%rsp)
jmp 0x466a
jmp 0x477a
movl 0x16c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x16c(%rsp)
jmp 0x4636
movl $0x0, 0x2e4(%rsp)
movl $0x1, 0x284(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x5200
leaq 0x218(%rsp), %rdi
callq 0x5200
leaq 0x238(%rsp), %rdi
callq 0x5260
leaq 0x250(%rsp), %rdi
callq 0x52c0
jmp 0x4812
leaq 0x200(%rsp), %rdi
callq 0x5200
leaq 0x218(%rsp), %rdi
callq 0x5200
leaq 0x238(%rsp), %rdi
callq 0x5260
leaq 0x250(%rsp), %rdi
callq 0x52c0
jmp 0x482e
leaq 0x2c0(%rsp), %rdi
callq 0x2130
movl 0x2e4(%rsp), %eax
addq $0x2e8, %rsp            # imm = 0x2E8
retq
leaq 0x2c0(%rsp), %rdi
callq 0x2130
movq 0x2b8(%rsp), %rdi
callq 0x2310
movq %rax, %rdi
callq 0x4d60