// File: phillip-h[P]fractal-gen/fractalgen.cpp
// Function: main
int main(int argc, char** argv)
{
    if (argc < 4) {
        cout << "too few arguments!\n";
        cout << "usage: fractal-gen <width> <height> <scale>\n";
        cout << "                   ";
        cout << "[color A] [color B] [color C]\n";
        cout << "                   ";
        cout << "[cr+ci] [color depth] [offx] [offy]\n";
        return -1;
    }
    
    unsigned width = atoi(argv[1]);
    unsigned height = atoi(argv[2]);
    double size = atof(argv[3]); 
    unsigned color_depth = 255;
    double offx = -0.5;
    double offy = 0.0;
    bool mandel = true;
    complex c_arg(0, 0);
    auto file = "fractal.png";

    auto A_R = 0;
    auto A_G = 0;
    auto A_B = 0;

    auto B_R = 255;
    auto B_G = 255;
    auto B_B = 255;

    auto D_R = 0;
    auto D_G = 0;
    auto D_B = 0;

    if (argc > 4) {
        std::string str(argv[4]);
        if (str.at(0) == '#')
            str = str.substr(1, str.size() - 1);
        if (str.size() != 6) {
            cout << "error -- invalid color!\n";
            cout << "express colors as '#RRGGBB'.\n";
            return -1;
        }

        std::string sub_str = str.substr(0, 2);
        A_R = htoi(sub_str);

        sub_str = str.substr(2, 2);
        A_G = htoi(sub_str);
        
        sub_str = str.substr(4, 2);
        A_B = htoi(sub_str);
    }

    if (argc > 5) {
        std::string str(argv[5]);
        if (str.at(0) == '#')
            str = str.substr(1, str.size() - 1);
        if (str.size() != 6) {
            cout << "error -- invalid color!\n";
            cout << "express colors as '#RRGGBB'.\n";
            return -1;
        }

        std::string sub_str = str.substr(0, 2);
        B_R = htoi(sub_str);

        sub_str = str.substr(2, 2);
        B_G = htoi(sub_str);
        
        sub_str = str.substr(4, 2);
        B_B = htoi(sub_str);
    }
    
    if (argc > 6) {
        std::string str(argv[6]);
        if (str.at(0) == '#')
            str = str.substr(1, str.size() - 1);
        if (str.size() != 6) {
            cout << "error -- invalid color!\n";
            cout << "express colors as '#RRGGBB'.\n";
            return -1;
        }

        std::string sub_str = str.substr(0, 2);
        D_R = htoi(sub_str);

        sub_str = str.substr(2, 2);
        D_G = htoi(sub_str);
        
        sub_str = str.substr(4, 2);
        D_B = htoi(sub_str);
    }

    if (argc > 7 && std::string(argv[7]) != "mandelbrot") {
        mandel = false;
        offx = 0;
        offy = 0;
        std::string str(argv[7]);
        unsigned pos = 0;
        for (unsigned i = 0; i < str.size(); i++)
        {
            if (str.at(i) == '+') {
                pos = i + 1;
                break;
            }
        }
        if (pos == 0) {
            cout << "invalid complex argument!\n";
            return -1;
        }
        double real = atof(str.substr(0, pos - 1).c_str());
        double imag = atof(str.substr(pos, str.size() - pos).c_str());
        c_arg = complex(real, imag);
    }

    if (argc > 8)
        color_depth = atof(argv[8]);
    if (argc > 9)
        offx = atof(argv[9]);
    if (argc > 10)
        offy = atof(argv[10]);
    if (argc > 11)
        cout << "warning -- extra arguments, ignoring them.\n";

    cout << "fractal information:\n\n";
    
    if (mandel) {
        cout << "fractal type -- mandelbrot\n";
    } else {
        cout << "fractal type -- julia\n";
        cout << "complex argument -- " << c_arg.to_str() << "\n";
    }

    cout << "\n";
    cout << "width       -- " << width << "\n";
    cout << "height      -- " << height << "\n";
    cout << "pixels      -- " << (width * height * 4) << "\n";
    cout << "scale       -- " << size << "\n";
    cout << "color A     -- (";
    cout << A_R << ", " << A_G << ", " << A_B << ")\n";
    cout << "color B     -- (";
    cout << B_R << ", " << B_G << ", " << B_B << ")\n";
    cout << "color C     -- (";
    cout << D_R << ", " << D_G << ", " << D_B << ")\n";
    cout << "color depth -- " << color_depth << "\n";
    cout << "offx        -- " << offx << "\n";
    cout << "offy        -- " << offy << "\n";

    vector<unsigned char> image(width * height * 4);

    auto lerp = [&] (double x0, double y0,
                    double x1, double y1,
                    double t)
    {
        double m = (y1 - y0) / (x1 - x0);
        return y0 + t * m;
    };

    auto comp_color_r = [&] (unsigned val)
    {
        if (val == color_depth)
            return D_R;
        double rat = (double) val / color_depth;
        double dc = lerp(0, A_R, 1, B_R, rat);
        return (int) dc;
    };

    auto comp_color_g = [&] (unsigned val)
    {
        if (val == color_depth)
            return D_G;
        double rat = (double) val / color_depth;
        double dc = lerp(0, A_G, 1, B_G, rat);
        return (int) dc;
    };

    auto comp_color_b = [&] (unsigned val)
    {
        if (val == color_depth)
            return D_B;
        double rat = (double) val / color_depth;
        double dc = lerp(0, A_B, 1, B_B, rat);
        return (int) dc;
    };

    double r;
    double i;
    complex c;
    unsigned color;
    for (unsigned x = 0; x < width; x++)
    {
        for (unsigned y = 0; y < height; y++)
        {
            r = offx - size / 2 + size * x / width;
            i = offy - size / 2 + size * y / height;
            c = complex(r, i);
            if (mandel)
                color = eval(c, color_depth, c);
            else
                color = eval(c, color_depth, c_arg);
            set_pixel(comp_color_r(color),
                      comp_color_g(color),
                      comp_color_b(color), 
                      x, y, image, height);
        }
    }

    unsigned error = lodepng::encode(file, image, width, height);
    if (error)
        cout << "error -- " << lodepng_error_text(error) << std::endl;
    
    return 0;
}

// Assembly:
subq $0x7f8, %rsp            # imm = 0x7F8
movl $0x0, 0x7f4(%rsp)
movl %edi, 0x7f0(%rsp)
movq %rsi, 0x7e8(%rsp)
cmpl $0x4, 0x7f0(%rsp)
jge 0x3a01
movq 0x1e652(%rip), %rdi     # 0x21fd8
leaq 0x186a9(%rip), %rsi     # 0x1c036
callq 0x31c0
movq 0x1e63f(%rip), %rdi     # 0x21fd8
leaq 0x186aa(%rip), %rsi     # 0x1c04a
callq 0x31c0
movq 0x1e62c(%rip), %rdi     # 0x21fd8
leaq 0x186c4(%rip), %rsi     # 0x1c077
callq 0x31c0
movq 0x1e619(%rip), %rdi     # 0x21fd8
leaq 0x186c5(%rip), %rsi     # 0x1c08b
callq 0x31c0
movq 0x1e606(%rip), %rdi     # 0x21fd8
leaq 0x1869e(%rip), %rsi     # 0x1c077
callq 0x31c0
movq 0x1e5f3(%rip), %rdi     # 0x21fd8
leaq 0x186be(%rip), %rsi     # 0x1c0aa
callq 0x31c0
movl $0xffffffff, 0x7f4(%rsp) # imm = 0xFFFFFFFF
jmp 0x555b
movq 0x7e8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x3330
movl %eax, 0x7e4(%rsp)
movq 0x7e8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x3330
movl %eax, 0x7e0(%rsp)
movq 0x7e8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x3290
vmovsd %xmm0, 0x7d8(%rsp)
movl $0xff, 0x7d4(%rsp)
vmovsd 0x185b2(%rip), %xmm0    # 0x1c010
vmovsd %xmm0, 0x7c8(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0x7c0(%rsp)
movb $0x1, 0x7bf(%rsp)
leaq 0x7a8(%rsp), %rdi
vpxor %xmm1, %xmm1, %xmm1
vmovaps %xmm1, %xmm0
callq 0x5960
leaq 0x18637(%rip), %rax     # 0x1c0cf
movq %rax, 0x7a0(%rsp)
movl $0x0, 0x79c(%rsp)
movl $0x0, 0x798(%rsp)
movl $0x0, 0x794(%rsp)
movl $0xff, 0x790(%rsp)
movl $0xff, 0x78c(%rsp)
movl $0xff, 0x788(%rsp)
movl $0x0, 0x784(%rsp)
movl $0x0, 0x780(%rsp)
movl $0x0, 0x77c(%rsp)
cmpl $0x4, 0x7f0(%rsp)
jle 0x3f04
movq 0x7e8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x218(%rsp)
leaq 0x757(%rsp), %rdi
movq %rdi, 0x220(%rsp)
callq 0x33a0
movq 0x218(%rsp), %rsi
movq 0x220(%rsp), %rdx
leaq 0x758(%rsp), %rdi
callq 0x32c0
jmp 0x3b59
leaq 0x757(%rsp), %rdi
callq 0x3220
xorl %eax, %eax
movl %eax, %esi
leaq 0x758(%rsp), %rdi
callq 0x33e0
movq %rax, 0x210(%rsp)
jmp 0x3b81
movq 0x210(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x3c2f
leaq 0x758(%rsp), %rdi
movq %rdi, 0x208(%rsp)
callq 0x3120
movq 0x208(%rsp), %rsi
movq %rax, %rcx
decq %rcx
leaq 0x720(%rsp), %rdi
movl $0x1, %edx
callq 0x31f0
jmp 0x3bcc
leaq 0x758(%rsp), %rdi
leaq 0x720(%rsp), %rsi
callq 0x3270
leaq 0x720(%rsp), %rdi
callq 0x3428
jmp 0x3c2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x757(%rsp), %rdi
callq 0x3220
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x3ef2
leaq 0x758(%rsp), %rdi
callq 0x3120
cmpq $0x6, %rax
je 0x3c87
movq 0x1e38f(%rip), %rdi     # 0x21fd8
leaq 0x1848b(%rip), %rsi     # 0x1c0db
callq 0x31c0
jmp 0x3c57
movq 0x1e37a(%rip), %rdi     # 0x21fd8
leaq 0x1848f(%rip), %rsi     # 0x1c0f4
callq 0x31c0
jmp 0x3c6c
movl $0xffffffff, 0x7f4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x71c(%rsp)
jmp 0x3e44
xorl %eax, %eax
movl %eax, %edx
leaq 0x6f8(%rsp), %rdi
leaq 0x758(%rsp), %rsi
movl $0x2, %ecx
callq 0x31f0
jmp 0x3ca7
leaq 0x6d8(%rsp), %rdi
leaq 0x6f8(%rsp), %rsi
callq 0x30c0
jmp 0x3cbe
leaq 0x6d8(%rsp), %rdi
callq 0x3760
movb %al, 0x207(%rsp)
jmp 0x3cd4
movb 0x207(%rsp), %al
movzbl %al, %eax
movl %eax, 0x79c(%rsp)
leaq 0x6d8(%rsp), %rdi
callq 0x3428
leaq 0x6b8(%rsp), %rdi
leaq 0x758(%rsp), %rsi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x31f0
jmp 0x3d11
leaq 0x6f8(%rsp), %rdi
movq %rdi, 0x1f8(%rsp)
leaq 0x6b8(%rsp), %rsi
movq %rsi, 0x1f0(%rsp)
callq 0x3270
movq 0x1f0(%rsp), %rdi
callq 0x3428
movq 0x1f8(%rsp), %rsi
leaq 0x698(%rsp), %rdi
callq 0x30c0
jmp 0x3d5a
leaq 0x698(%rsp), %rdi
callq 0x3760
movb %al, 0x1ef(%rsp)
jmp 0x3d70
movb 0x1ef(%rsp), %al
movzbl %al, %eax
movl %eax, 0x798(%rsp)
leaq 0x698(%rsp), %rdi
callq 0x3428
leaq 0x678(%rsp), %rdi
leaq 0x758(%rsp), %rsi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x31f0
jmp 0x3daf
leaq 0x6f8(%rsp), %rdi
movq %rdi, 0x1e0(%rsp)
leaq 0x678(%rsp), %rsi
movq %rsi, 0x1d8(%rsp)
callq 0x3270
movq 0x1d8(%rsp), %rdi
callq 0x3428
movq 0x1e0(%rsp), %rsi
leaq 0x658(%rsp), %rdi
callq 0x30c0
jmp 0x3df8
leaq 0x658(%rsp), %rdi
callq 0x3760
movb %al, 0x1d7(%rsp)
jmp 0x3e0e
movb 0x1d7(%rsp), %al
movzbl %al, %eax
movl %eax, 0x794(%rsp)
leaq 0x658(%rsp), %rdi
callq 0x3428
leaq 0x6f8(%rsp), %rdi
callq 0x3428
movl $0x0, 0x71c(%rsp)
leaq 0x758(%rsp), %rdi
callq 0x3428
movl 0x71c(%rsp), %eax
testl %eax, %eax
je 0x3e63
jmp 0x3e5e
jmp 0x555b
jmp 0x3f04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x3ee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x6d8(%rsp), %rdi
callq 0x3428
jmp 0x3ee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x698(%rsp), %rdi
callq 0x3428
jmp 0x3ee5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x658(%rsp), %rdi
callq 0x3428
leaq 0x6f8(%rsp), %rdi
callq 0x3428
leaq 0x758(%rsp), %rdi
callq 0x3428
jmp 0x556a
cmpl $0x5, 0x7f0(%rsp)
jle 0x4305
movq 0x7e8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x1c0(%rsp)
leaq 0x637(%rsp), %rdi
movq %rdi, 0x1c8(%rsp)
callq 0x33a0
movq 0x1c0(%rsp), %rsi
movq 0x1c8(%rsp), %rdx
leaq 0x638(%rsp), %rdi
callq 0x32c0
jmp 0x3f5a
leaq 0x637(%rsp), %rdi
callq 0x3220
xorl %eax, %eax
movl %eax, %esi
leaq 0x638(%rsp), %rdi
callq 0x33e0
movq %rax, 0x1b8(%rsp)
jmp 0x3f82
movq 0x1b8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x4030
leaq 0x638(%rsp), %rdi
movq %rdi, 0x1b0(%rsp)
callq 0x3120
movq 0x1b0(%rsp), %rsi
movq %rax, %rcx
decq %rcx
leaq 0x610(%rsp), %rdi
movl $0x1, %edx
callq 0x31f0
jmp 0x3fcd
leaq 0x638(%rsp), %rdi
leaq 0x610(%rsp), %rsi
callq 0x3270
leaq 0x610(%rsp), %rdi
callq 0x3428
jmp 0x4030
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x637(%rsp), %rdi
callq 0x3220
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x42f3
leaq 0x638(%rsp), %rdi
callq 0x3120
cmpq $0x6, %rax
je 0x4088
movq 0x1df8e(%rip), %rdi     # 0x21fd8
leaq 0x1808a(%rip), %rsi     # 0x1c0db
callq 0x31c0
jmp 0x4058
movq 0x1df79(%rip), %rdi     # 0x21fd8
leaq 0x1808e(%rip), %rsi     # 0x1c0f4
callq 0x31c0
jmp 0x406d
movl $0xffffffff, 0x7f4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x71c(%rsp)
jmp 0x4245
xorl %eax, %eax
movl %eax, %edx
leaq 0x5f0(%rsp), %rdi
leaq 0x638(%rsp), %rsi
movl $0x2, %ecx
callq 0x31f0
jmp 0x40a8
leaq 0x5d0(%rsp), %rdi
leaq 0x5f0(%rsp), %rsi
callq 0x30c0
jmp 0x40bf
leaq 0x5d0(%rsp), %rdi
callq 0x3760
movb %al, 0x1af(%rsp)
jmp 0x40d5
movb 0x1af(%rsp), %al
movzbl %al, %eax
movl %eax, 0x790(%rsp)
leaq 0x5d0(%rsp), %rdi
callq 0x3428
leaq 0x5b0(%rsp), %rdi
leaq 0x638(%rsp), %rsi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x31f0
jmp 0x4112
leaq 0x5f0(%rsp), %rdi
movq %rdi, 0x1a0(%rsp)
leaq 0x5b0(%rsp), %rsi
movq %rsi, 0x198(%rsp)
callq 0x3270
movq 0x198(%rsp), %rdi
callq 0x3428
movq 0x1a0(%rsp), %rsi
leaq 0x590(%rsp), %rdi
callq 0x30c0
jmp 0x415b
leaq 0x590(%rsp), %rdi
callq 0x3760
movb %al, 0x197(%rsp)
jmp 0x4171
movb 0x197(%rsp), %al
movzbl %al, %eax
movl %eax, 0x78c(%rsp)
leaq 0x590(%rsp), %rdi
callq 0x3428
leaq 0x570(%rsp), %rdi
leaq 0x638(%rsp), %rsi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x31f0
jmp 0x41b0
leaq 0x5f0(%rsp), %rdi
movq %rdi, 0x188(%rsp)
leaq 0x570(%rsp), %rsi
movq %rsi, 0x180(%rsp)
callq 0x3270
movq 0x180(%rsp), %rdi
callq 0x3428
movq 0x188(%rsp), %rsi
leaq 0x550(%rsp), %rdi
callq 0x30c0
jmp 0x41f9
leaq 0x550(%rsp), %rdi
callq 0x3760
movb %al, 0x17f(%rsp)
jmp 0x420f
movb 0x17f(%rsp), %al
movzbl %al, %eax
movl %eax, 0x788(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x3428
leaq 0x5f0(%rsp), %rdi
callq 0x3428
movl $0x0, 0x71c(%rsp)
leaq 0x638(%rsp), %rdi
callq 0x3428
movl 0x71c(%rsp), %eax
testl %eax, %eax
je 0x4264
jmp 0x425f
jmp 0x555b
jmp 0x4305
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x42e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x5d0(%rsp), %rdi
callq 0x3428
jmp 0x42e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x590(%rsp), %rdi
callq 0x3428
jmp 0x42e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x3428
leaq 0x5f0(%rsp), %rdi
callq 0x3428
leaq 0x638(%rsp), %rdi
callq 0x3428
jmp 0x556a
cmpl $0x6, 0x7f0(%rsp)
jle 0x4706
movq 0x7e8(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x168(%rsp)
leaq 0x52f(%rsp), %rdi
movq %rdi, 0x170(%rsp)
callq 0x33a0
movq 0x168(%rsp), %rsi
movq 0x170(%rsp), %rdx
leaq 0x530(%rsp), %rdi
callq 0x32c0
jmp 0x435b
leaq 0x52f(%rsp), %rdi
callq 0x3220
xorl %eax, %eax
movl %eax, %esi
leaq 0x530(%rsp), %rdi
callq 0x33e0
movq %rax, 0x160(%rsp)
jmp 0x4383
movq 0x160(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x4431
leaq 0x530(%rsp), %rdi
movq %rdi, 0x158(%rsp)
callq 0x3120
movq 0x158(%rsp), %rsi
movq %rax, %rcx
decq %rcx
leaq 0x508(%rsp), %rdi
movl $0x1, %edx
callq 0x31f0
jmp 0x43ce
leaq 0x530(%rsp), %rdi
leaq 0x508(%rsp), %rsi
callq 0x3270
leaq 0x508(%rsp), %rdi
callq 0x3428
jmp 0x4431
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x52f(%rsp), %rdi
callq 0x3220
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x46f4
leaq 0x530(%rsp), %rdi
callq 0x3120
cmpq $0x6, %rax
je 0x4489
movq 0x1db8d(%rip), %rdi     # 0x21fd8
leaq 0x17c89(%rip), %rsi     # 0x1c0db
callq 0x31c0
jmp 0x4459
movq 0x1db78(%rip), %rdi     # 0x21fd8
leaq 0x17c8d(%rip), %rsi     # 0x1c0f4
callq 0x31c0
jmp 0x446e
movl $0xffffffff, 0x7f4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x71c(%rsp)
jmp 0x4646
xorl %eax, %eax
movl %eax, %edx
leaq 0x4e8(%rsp), %rdi
leaq 0x530(%rsp), %rsi
movl $0x2, %ecx
callq 0x31f0
jmp 0x44a9
leaq 0x4c8(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x30c0
jmp 0x44c0
leaq 0x4c8(%rsp), %rdi
callq 0x3760
movb %al, 0x157(%rsp)
jmp 0x44d6
movb 0x157(%rsp), %al
movzbl %al, %eax
movl %eax, 0x784(%rsp)
leaq 0x4c8(%rsp), %rdi
callq 0x3428
leaq 0x4a8(%rsp), %rdi
leaq 0x530(%rsp), %rsi
movl $0x2, %ecx
movq %rcx, %rdx
callq 0x31f0
jmp 0x4513
leaq 0x4e8(%rsp), %rdi
movq %rdi, 0x148(%rsp)
leaq 0x4a8(%rsp), %rsi
movq %rsi, 0x140(%rsp)
callq 0x3270
movq 0x140(%rsp), %rdi
callq 0x3428
movq 0x148(%rsp), %rsi
leaq 0x488(%rsp), %rdi
callq 0x30c0
jmp 0x455c
leaq 0x488(%rsp), %rdi
callq 0x3760
movb %al, 0x13f(%rsp)
jmp 0x4572
movb 0x13f(%rsp), %al
movzbl %al, %eax
movl %eax, 0x780(%rsp)
leaq 0x488(%rsp), %rdi
callq 0x3428
leaq 0x468(%rsp), %rdi
leaq 0x530(%rsp), %rsi
movl $0x4, %edx
movl $0x2, %ecx
callq 0x31f0
jmp 0x45b1
leaq 0x4e8(%rsp), %rdi
movq %rdi, 0x130(%rsp)
leaq 0x468(%rsp), %rsi
movq %rsi, 0x128(%rsp)
callq 0x3270
movq 0x128(%rsp), %rdi
callq 0x3428
movq 0x130(%rsp), %rsi
leaq 0x448(%rsp), %rdi
callq 0x30c0
jmp 0x45fa
leaq 0x448(%rsp), %rdi
callq 0x3760
movb %al, 0x127(%rsp)
jmp 0x4610
movb 0x127(%rsp), %al
movzbl %al, %eax
movl %eax, 0x77c(%rsp)
leaq 0x448(%rsp), %rdi
callq 0x3428
leaq 0x4e8(%rsp), %rdi
callq 0x3428
movl $0x0, 0x71c(%rsp)
leaq 0x530(%rsp), %rdi
callq 0x3428
movl 0x71c(%rsp), %eax
testl %eax, %eax
je 0x4665
jmp 0x4660
jmp 0x555b
jmp 0x4706
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x46e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x4c8(%rsp), %rdi
callq 0x3428
jmp 0x46e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x488(%rsp), %rdi
callq 0x3428
jmp 0x46e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x448(%rsp), %rdi
callq 0x3428
leaq 0x4e8(%rsp), %rdi
callq 0x3428
leaq 0x530(%rsp), %rdi
callq 0x3428
jmp 0x556a
movl 0x7f0(%rsp), %ecx
movb $0x0, 0x426(%rsp)
movb $0x0, 0x425(%rsp)
xorl %eax, %eax
cmpl $0x7, %ecx
movb %al, 0x126(%rsp)
jle 0x47b4
movq 0x7e8(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x110(%rsp)
leaq 0x427(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x33a0
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
movb $0x1, 0x426(%rsp)
leaq 0x428(%rsp), %rdi
callq 0x32c0
jmp 0x477f
movb $0x1, 0x425(%rsp)
leaq 0x17984(%rip), %rsi     # 0x1c112
leaq 0x428(%rsp), %rdi
callq 0x5990
movb %al, 0x10f(%rsp)
jmp 0x47a4
movb 0x10f(%rsp), %al
movb %al, 0x126(%rsp)
jmp 0x47b4
movb 0x126(%rsp), %al
movb %al, 0x10e(%rsp)
testb $0x1, 0x425(%rsp)
jne 0x47ce
jmp 0x47db
leaq 0x428(%rsp), %rdi
callq 0x3428
testb $0x1, 0x426(%rsp)
jne 0x47e7
jmp 0x47f4
leaq 0x427(%rsp), %rdi
callq 0x3220
movb 0x10e(%rsp), %al
testb $0x1, %al
jne 0x4804
jmp 0x4b6e
movb $0x0, 0x7bf(%rsp)
movq $0x0, 0x7c8(%rsp)
movq $0x0, 0x7c0(%rsp)
movq 0x7e8(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0xf8(%rsp)
leaq 0x3ff(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x33a0
movq 0xf8(%rsp), %rsi
movq 0x100(%rsp), %rdx
leaq 0x400(%rsp), %rdi
callq 0x32c0
jmp 0x486c
leaq 0x3ff(%rsp), %rdi
callq 0x3220
movl $0x0, 0x3f8(%rsp)
movl $0x0, 0x3f4(%rsp)
movl 0x3f4(%rsp), %eax
movq %rax, 0xf0(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x3120
movq %rax, %rcx
movq 0xf0(%rsp), %rax
cmpq %rcx, %rax
jae 0x49d0
movl 0x3f4(%rsp), %eax
movl %eax, %esi
leaq 0x400(%rsp), %rdi
callq 0x33e0
movq %rax, 0xe8(%rsp)
jmp 0x48df
movq 0xe8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x49b8
movl 0x3f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3f8(%rsp)
jmp 0x49d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x494e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
testb $0x1, 0x425(%rsp)
jne 0x493f
jmp 0x494c
leaq 0x428(%rsp), %rdi
callq 0x3428
jmp 0x494e
testb $0x1, 0x426(%rsp)
jne 0x495a
jmp 0x4967
leaq 0x427(%rsp), %rdi
callq 0x3220
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x3ff(%rsp), %rdi
callq 0x3220
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x3428
jmp 0x556a
jmp 0x49ba
movl 0x3f4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3f4(%rsp)
jmp 0x488f
cmpl $0x0, 0x3f8(%rsp)
jne 0x4a0a
movq 0x1d5f7(%rip), %rdi     # 0x21fd8
leaq 0x17735(%rip), %rsi     # 0x1c11d
callq 0x31c0
jmp 0x49ef
movl $0xffffffff, 0x7f4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0x71c(%rsp)
jmp 0x4b4d
movl 0x3f8(%rsp), %eax
decl %eax
movl %eax, %ecx
xorl %eax, %eax
movl %eax, %edx
leaq 0x3c8(%rsp), %rdi
leaq 0x400(%rsp), %rsi
callq 0x31f0
jmp 0x4a30
leaq 0x3c8(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x30b0
movq %rax, %rdi
callq 0x3290
movq 0xc8(%rsp), %rdi
vmovsd %xmm0, 0xd0(%rsp)
callq 0x3428
vmovsd 0xd0(%rsp), %xmm0
vmovsd %xmm0, 0x3e8(%rsp)
movl 0x3f8(%rsp), %eax
movq %rax, 0xe0(%rsp)
leaq 0x400(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
callq 0x3120
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq %rax, %rcx
movl 0x3f8(%rsp), %eax
subq %rax, %rcx
leaq 0x3a0(%rsp), %rdi
callq 0x31f0
jmp 0x4ac5
leaq 0x3a0(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x30b0
movq %rax, %rdi
callq 0x3290
movq 0xb8(%rsp), %rdi
vmovsd %xmm0, 0xc0(%rsp)
callq 0x3428
vmovsd 0xc0(%rsp), %xmm0
vmovsd %xmm0, 0x3c0(%rsp)
vmovsd 0x3e8(%rsp), %xmm0
vmovsd 0x3c0(%rsp), %xmm1
leaq 0x390(%rsp), %rdi
callq 0x5960
jmp 0x4b2b
leaq 0x7a8(%rsp), %rdi
leaq 0x390(%rsp), %rsi
callq 0x58c0
jmp 0x4b42
movl $0x0, 0x71c(%rsp)
leaq 0x400(%rsp), %rdi
callq 0x3428
movl 0x71c(%rsp), %eax
testl %eax, %eax
je 0x4b6c
jmp 0x4b67
jmp 0x555b
jmp 0x4b6e
cmpl $0x8, 0x7f0(%rsp)
jle 0x4b96
movq 0x7e8(%rsp), %rax
movq 0x40(%rax), %rdi
callq 0x3290
vcvttsd2usi %xmm0, %eax
movl %eax, 0x7d4(%rsp)
cmpl $0x9, 0x7f0(%rsp)
jle 0x4bba
movq 0x7e8(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0x3290
vmovsd %xmm0, 0x7c8(%rsp)
cmpl $0xa, 0x7f0(%rsp)
jle 0x4bde
movq 0x7e8(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0x3290
vmovsd %xmm0, 0x7c0(%rsp)
cmpl $0xb, 0x7f0(%rsp)
jle 0x4bfb
movq 0x1d3e9(%rip), %rdi     # 0x21fd8
leaq 0x17542(%rip), %rsi     # 0x1c138
callq 0x31c0
movq 0x1d3d6(%rip), %rdi     # 0x21fd8
leaq 0x1755b(%rip), %rsi     # 0x1c164
callq 0x31c0
testb $0x1, 0x7bf(%rsp)
je 0x4c30
movq 0x1d3b9(%rip), %rdi     # 0x21fd8
leaq 0x17555(%rip), %rsi     # 0x1c17b
callq 0x31c0
jmp 0x4cee
movq 0x1d3a1(%rip), %rdi     # 0x21fd8
movq %rdi, 0x98(%rsp)
leaq 0x17551(%rip), %rsi     # 0x1c197
callq 0x31c0
movq 0x98(%rsp), %rdi
leaq 0x17554(%rip), %rsi     # 0x1c1ae
callq 0x31c0
movq %rax, 0xa0(%rsp)
leaq 0x370(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
leaq 0x7a8(%rsp), %rsi
callq 0x59c0
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rsi
callq 0x31a0
movq %rax, 0xb0(%rsp)
jmp 0x4ca3
movq 0xb0(%rsp), %rdi
leaq 0x174c7(%rip), %rsi     # 0x1c179
callq 0x31c0
jmp 0x4cb9
leaq 0x370(%rsp), %rdi
callq 0x3428
jmp 0x4cee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x370(%rsp), %rdi
callq 0x3428
jmp 0x556a
movq 0x1d2e3(%rip), %rdi     # 0x21fd8
movq %rdi, 0x78(%rsp)
leaq 0x17478(%rip), %rsi     # 0x1c179
movq %rsi, 0x80(%rsp)
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x174a9(%rip), %rsi     # 0x1c1c3
callq 0x31c0
movq %rax, %rdi
movl 0x7e4(%rsp), %esi
callq 0x32b0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x17489(%rip), %rsi     # 0x1c1d3
callq 0x31c0
movq %rax, %rdi
movl 0x7e0(%rsp), %esi
callq 0x32b0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x17469(%rip), %rsi     # 0x1c1e3
callq 0x31c0
movq %rax, %rdi
movl 0x7e4(%rsp), %esi
movl 0x7e0(%rsp), %eax
imull %eax, %esi
shll $0x2, %esi
callq 0x32b0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x1743c(%rip), %rsi     # 0x1c1f3
callq 0x31c0
movq %rax, %rdi
vmovsd 0x7d8(%rsp), %xmm0
callq 0x33c0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x1741a(%rip), %rsi     # 0x1c203
callq 0x31c0
movq 0x78(%rsp), %rdi
movl 0x79c(%rsp), %esi
callq 0x3380
movq %rax, %rdi
leaq 0x1740b(%rip), %rsi     # 0x1c214
movq %rsi, 0x68(%rsp)
callq 0x31c0
movq %rax, %rdi
movl 0x798(%rsp), %esi
callq 0x3380
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl 0x794(%rsp), %esi
callq 0x3380
movq %rax, %rdi
leaq 0x173cf(%rip), %rsi     # 0x1c217
movq %rsi, 0x70(%rsp)
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x173bc(%rip), %rsi     # 0x1c21a
callq 0x31c0
movq 0x78(%rsp), %rdi
movl 0x790(%rsp), %esi
callq 0x3380
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl 0x78c(%rsp), %esi
callq 0x3380
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl 0x788(%rsp), %esi
callq 0x3380
movq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x17366(%rip), %rsi     # 0x1c22b
callq 0x31c0
movq 0x78(%rsp), %rdi
movl 0x784(%rsp), %esi
callq 0x3380
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl 0x780(%rsp), %esi
callq 0x3380
movq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq %rax, %rdi
movl 0x77c(%rsp), %esi
callq 0x3380
movq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x17310(%rip), %rsi     # 0x1c23c
callq 0x31c0
movq %rax, %rdi
movl 0x7d4(%rsp), %esi
callq 0x32b0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x172f0(%rip), %rsi     # 0x1c24c
callq 0x31c0
movq %rax, %rdi
vmovsd 0x7c8(%rsp), %xmm0
callq 0x33c0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movq 0x78(%rsp), %rdi
leaq 0x172ce(%rip), %rsi     # 0x1c25c
callq 0x31c0
movq %rax, %rdi
vmovsd 0x7c0(%rsp), %xmm0
callq 0x33c0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31c0
movl 0x7e4(%rsp), %eax
movl 0x7e0(%rsp), %ecx
imull %ecx, %eax
shll $0x2, %eax
movq %rax, 0x88(%rsp)
leaq 0x357(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x5b20
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x358(%rsp), %rdi
callq 0x5b30
jmp 0x5004
leaq 0x357(%rsp), %rdi
callq 0x5bb0
leaq 0x7d4(%rsp), %rcx
movq %rcx, 0x328(%rsp)
leaq 0x784(%rsp), %rax
movq %rax, 0x330(%rsp)
leaq 0x356(%rsp), %rax
movq %rax, 0x338(%rsp)
leaq 0x79c(%rsp), %rdx
movq %rdx, 0x340(%rsp)
leaq 0x790(%rsp), %rdx
movq %rdx, 0x348(%rsp)
movq %rcx, 0x300(%rsp)
leaq 0x780(%rsp), %rdx
movq %rdx, 0x308(%rsp)
movq %rax, 0x310(%rsp)
leaq 0x798(%rsp), %rdx
movq %rdx, 0x318(%rsp)
leaq 0x78c(%rsp), %rdx
movq %rdx, 0x320(%rsp)
movq %rcx, 0x2d8(%rsp)
leaq 0x77c(%rsp), %rcx
movq %rcx, 0x2e0(%rsp)
movq %rax, 0x2e8(%rsp)
leaq 0x794(%rsp), %rax
movq %rax, 0x2f0(%rsp)
leaq 0x788(%rsp), %rax
movq %rax, 0x2f8(%rsp)
leaq 0x2b8(%rsp), %rdi
vpxor %xmm1, %xmm1, %xmm1
vmovaps %xmm1, %xmm0
callq 0x5960
jmp 0x50f8
movl $0x0, 0x2b0(%rsp)
movl 0x2b0(%rsp), %eax
cmpl 0x7e4(%rsp), %eax
jae 0x53e9
movl $0x0, 0x2ac(%rsp)
movl 0x2ac(%rsp), %eax
cmpl 0x7e0(%rsp), %eax
jae 0x53d1
vmovsd 0x7c8(%rsp), %xmm0
vmovsd 0x7d8(%rsp), %xmm1
vmovsd 0x16ec0(%rip), %xmm2    # 0x1c010
vmulsd %xmm2, %xmm1, %xmm3
vaddsd %xmm3, %xmm0, %xmm0
vcvtusi2sdl 0x2b0(%rsp), %xmm3, %xmm3
vmulsd %xmm3, %xmm1, %xmm1
vcvtusi2sdl 0x7e4(%rsp), %xmm3, %xmm3
vdivsd %xmm3, %xmm1, %xmm1
vaddsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, 0x2d0(%rsp)
vmovsd 0x7c0(%rsp), %xmm0
vmovsd 0x7d8(%rsp), %xmm1
vmulsd %xmm2, %xmm1, %xmm2
vaddsd %xmm2, %xmm0, %xmm0
vcvtusi2sdl 0x2ac(%rsp), %xmm2, %xmm2
vmulsd %xmm2, %xmm1, %xmm1
vcvtusi2sdl 0x7e0(%rsp), %xmm2, %xmm2
vdivsd %xmm2, %xmm1, %xmm1
vaddsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, 0x2c8(%rsp)
vmovsd 0x2d0(%rsp), %xmm0
vmovsd 0x2c8(%rsp), %xmm1
leaq 0x298(%rsp), %rdi
callq 0x5960
jmp 0x51e9
leaq 0x2b8(%rsp), %rdi
leaq 0x298(%rsp), %rsi
callq 0x58c0
jmp 0x5200
testb $0x1, 0x7bf(%rsp)
je 0x52b5
leaq 0x288(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x57c0
jmp 0x5225
movl 0x7d4(%rsp), %eax
movl %eax, 0x64(%rsp)
leaq 0x278(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x57c0
jmp 0x5247
movl 0x64(%rsp), %esi
leaq 0x288(%rsp), %rdi
leaq 0x278(%rsp), %rdx
callq 0x35e0
movl %eax, 0x60(%rsp)
jmp 0x5266
movl 0x60(%rsp), %eax
movl %eax, 0x2b4(%rsp)
jmp 0x5318
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x357(%rsp), %rdi
callq 0x5bb0
jmp 0x556a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x554c
leaq 0x268(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x57c0
jmp 0x52cc
movl 0x7d4(%rsp), %eax
movl %eax, 0x5c(%rsp)
leaq 0x258(%rsp), %rdi
leaq 0x7a8(%rsp), %rsi
callq 0x57c0
jmp 0x52ee
movl 0x5c(%rsp), %esi
leaq 0x268(%rsp), %rdi
leaq 0x258(%rsp), %rdx
callq 0x35e0
movl %eax, 0x58(%rsp)
jmp 0x530d
movl 0x58(%rsp), %eax
movl %eax, 0x2b4(%rsp)
movl 0x2b4(%rsp), %esi
leaq 0x328(%rsp), %rdi
callq 0x5580
movl %eax, 0x54(%rsp)
jmp 0x5332
movl 0x54(%rsp), %eax
movb %al, 0x4f(%rsp)
movl 0x2b4(%rsp), %esi
leaq 0x300(%rsp), %rdi
callq 0x5620
movl %eax, 0x50(%rsp)
jmp 0x5354
movl 0x50(%rsp), %eax
movb %al, 0x47(%rsp)
movl 0x2b4(%rsp), %esi
leaq 0x2d8(%rsp), %rdi
callq 0x56c0
movl %eax, 0x48(%rsp)
jmp 0x5376
movl 0x48(%rsp), %eax
movb 0x47(%rsp), %dl
movb 0x4f(%rsp), %sil
movl 0x2b0(%rsp), %ecx
movl 0x2ac(%rsp), %r8d
movl 0x7e0(%rsp), %r9d
movq %rsp, %rdi
movl %r9d, (%rdi)
movzbl %sil, %edi
movzbl %dl, %esi
movzbl %al, %edx
leaq 0x358(%rsp), %r9
callq 0x3690
jmp 0x53b9
jmp 0x53bb
movl 0x2ac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2ac(%rsp)
jmp 0x5122
jmp 0x53d3
movl 0x2b0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2b0(%rsp)
jmp 0x5103
movq 0x7a0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x22f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x33a0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x230(%rsp), %rdi
callq 0x32c0
jmp 0x5421
movl 0x7e4(%rsp), %edx
movl 0x7e0(%rsp), %ecx
leaq 0x230(%rsp), %rdi
leaq 0x358(%rsp), %rsi
movl $0x6, %r8d
movl $0x8, %r9d
callq 0x11bc0
movl %eax, 0x2c(%rsp)
jmp 0x5456
leaq 0x230(%rsp), %rdi
callq 0x3428
leaq 0x22f(%rsp), %rdi
callq 0x3220
movl 0x2c(%rsp), %eax
movl %eax, 0x254(%rsp)
cmpl $0x0, 0x254(%rsp)
je 0x5527
movq 0x1cb48(%rip), %rdi     # 0x21fd8
leaq 0x16dd5(%rip), %rsi     # 0x1c26c
callq 0x31c0
movq %rax, 0x20(%rsp)
jmp 0x54a3
movl 0x254(%rsp), %edi
callq 0x107a0
movq %rax, 0x18(%rsp)
jmp 0x54b6
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0x31c0
movq %rax, 0x10(%rsp)
jmp 0x54cc
movq 0x10(%rsp), %rdi
movq 0x1cae0(%rip), %rsi     # 0x21fb8
callq 0x3200
jmp 0x54df
jmp 0x5527
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5518
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x3428
leaq 0x22f(%rsp), %rdi
callq 0x3220
jmp 0x554c
movl $0x0, 0x7f4(%rsp)
movl $0x1, 0x71c(%rsp)
leaq 0x358(%rsp), %rdi
callq 0x5bc0
jmp 0x555b
leaq 0x358(%rsp), %rdi
callq 0x5bc0
jmp 0x556a
movl 0x7f4(%rsp), %eax
addq $0x7f8, %rsp            # imm = 0x7F8
retq
movq 0x748(%rsp), %rdi
callq 0x3390
nopw (%rax,%rax)