// File: 4shadoww[P]xwinter/xwinter.cpp
// Function: main
int main(int argc, char** argv){
    // Settings
    unsigned int count = 200;
    float speed_x = 30.f;
    float speed_y = 30.f;
    std::string particle_color = "white";
    float random_x = 20.f;
    float random_y = 20.f;
    int x_spawn = 1;
    unsigned int size = 2;
    unsigned int random_size = 2;
    unsigned int fps = 144;

    // Chech is help asked to be printed
    if(argc > 1 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)){
        print_usage(argv[0]);
        return 0;
    }
    // Chech is version asked to be printed
    if(argc > 1 && (strcmp(argv[1], "-v") == 0 || strcmp(argv[1], "--version") == 0)){
        print_version();
        return 0;
    }

    // Check is argument count correct
    if(argc % 2 == 0 || argc == 2){
        std::cerr << "error: invalid argument count" << std::endl;
        return 1;
    }
    // Parse arguments
    for(int i = 1; i < argc - 1; i++){
        // Particle count
        if(strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--count") == 0){
            i++;
            count = std::stoul(argv[i]);
            continue;
        // Speed x
        }else if(strcmp(argv[i], "-sx") == 0 || strcmp(argv[i], "--speed-x") == 0){
            i++;
            speed_x = std::atof(argv[i]);
            continue;
        // Speed y
        }else if(strcmp(argv[i], "-sy") == 0 || strcmp(argv[i], "--speed-y") == 0){
            i++;
            speed_y = std::atof(argv[i]);
            continue;
        // Color
        }else if(strcmp(argv[i], "-cl") == 0 || strcmp(argv[i], "--color") == 0){
            i++;
            particle_color = argv[i];
            continue;
        // Random x
        }else if(strcmp(argv[i], "-rx") == 0 || strcmp(argv[i], "--random-x") == 0){
            i++;
            random_x = std::atof(argv[i]);
            continue;
        // Random y
        }else if(strcmp(argv[i], "-ry") == 0 || strcmp(argv[i], "--random-y") == 0){
            i++;
            random_y = std::atof(argv[i]);
            continue;
        // Spawn y
        }else if(strcmp(argv[i], "-xs") == 0 || strcmp(argv[i], "--x-spawn") == 0){
            i++;
            x_spawn = std::atoi(argv[i]);
            continue;
        // Size
        }else if(strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "--size") == 0){
            i++;
            size = std::stoul(argv[i]);
            continue;
        // Random size
        }else if(strcmp(argv[i], "-rs") == 0 || strcmp(argv[i], "--random-size") == 0){
            i++;
            random_size = std::stoul(argv[i]);
            continue;
        // Framerate
        }else if(strcmp(argv[i], "-fps") == 0 || strcmp(argv[i], "--frame-rate") == 0){
            i++;
            fps = std::stoul(argv[i]);
            continue;
        }else{
            std::cerr << "error: unknown argument \"" << argv[i] << "\"" << std::endl;
            return 1;
        }
    }

    // Tick
    float tick = 1000 / fps;

    // Print license
    print_copyright();

    // Init xorg
    Display* display = XOpenDisplay (NULL);
    Window defaultroot = DefaultRootWindow(display);
    XVisualInfo vinfo;
    XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &vinfo);
    Screen* screen = XDefaultScreenOfDisplay(display);
    int screen_num = DefaultScreen(display);
    GC gc;
    XColor xcolor;

    // Get screen width and heigth
    int width = XWidthOfScreen(screen);
    int height = XHeightOfScreen(screen);
    // Set window attributes
    XSetWindowAttributes attr;
    attr.override_redirect = 1;
    attr.colormap = XCreateColormap(display, defaultroot, vinfo.visual, AllocNone);
    attr.border_pixel = 0;
    attr.background_pixel = 0;
    // Create window
    Window window = XCreateWindow(display, defaultroot, 0, 0, width, height, 0, vinfo.depth, InputOutput, vinfo.visual, CWColormap | CWBorderPixel | CWBackPixel | CWOverrideRedirect, &attr);

    // Event listener
    XSelectInput(display, defaultroot, ExposureMask | StructureNotifyMask);

    // Move window to background
    XLowerWindow(display, window);

    XMapWindow(display, window);
    XMapWindow(display, defaultroot);
    // Graphics context
    gc = XCreateGC(display, window, 0, 0);

    // Create the color
    if(particle_color == "red"){
        xcolor.red = 65535; xcolor.green = 0; xcolor.blue = 0;
    }else if(particle_color == "blue"){
        xcolor.red = 0; xcolor.green = 0; xcolor.blue = 65535;
    }else if(particle_color == "green"){
        xcolor.red = 0; xcolor.green = 65535; xcolor.blue = 0;
    }else{
        xcolor.red = 65535; xcolor.green = 65535; xcolor.blue = 65535;
    }
    xcolor.flags = DoRed | DoGreen | DoBlue;
    XAllocColor(display, DefaultColormap(display, screen_num), &xcolor);

    // Set snow color
    XSetForeground(display, gc, xcolor.pixel);
    // Flush
    XFlush(display);

    // Create sky
    sky skyen(width, height);
    skyen.set_count(count);
    skyen.set_speed(speed_x, speed_x + random_x, speed_y, speed_y + random_y);
    skyen.set_x_spawn_intensity(x_spawn);
    skyen.set_size(size, size + random_size);
    skyen.create_sky();

    while(true){
        // Events
        XEvent e;
        XCheckMaskEvent(display, ExposureMask | StructureNotifyMask, &e);
        // Resize window
        if (e.type == ConfigureNotify){
            XConfigureEvent xce = e.xconfigure;

            if(width != xce.width || height != xce.height){
                width = xce.width;
                height = xce.height;

                skyen.set_screen_size(width, height);
                XResizeWindow(display, window, width, height);
            }
        }
        // Draw
        XFillRectangles(display, window, gc, skyen.snowflakes, count);
        XFlush(display);
        XClearWindow(display, window);
        // Update sky
        skyen.update(tick);
        usleep(1000000 / fps);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2bb0, %rsp           # imm = 0x2BB0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0xc8, -0x14(%rbp)
movl $0x41f00000, -0x18(%rbp) # imm = 0x41F00000
movl $0x41f00000, -0x1c(%rbp) # imm = 0x41F00000
leaq -0x41(%rbp), %rdi
movq %rdi, -0x2aa8(%rbp)
callq 0x3410
movq -0x2aa8(%rbp), %rdx
leaq 0x320e(%rip), %rsi      # 0x746a
leaq -0x40(%rbp), %rdi
callq 0x51b0
jmp 0x4267
leaq -0x41(%rbp), %rdi
callq 0x3240
movss 0x2d94(%rip), %xmm0     # 0x700c
movss %xmm0, -0x58(%rbp)
movss 0x2d87(%rip), %xmm0     # 0x700c
movss %xmm0, -0x5c(%rbp)
movl $0x1, -0x60(%rbp)
movl $0x2, -0x64(%rbp)
movl $0x2, -0x68(%rbp)
movl $0x90, -0x6c(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x43b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x31b1(%rip), %rsi      # 0x7470
callq 0x3320
cmpl $0x0, %eax
je 0x42e6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x319b(%rip), %rsi      # 0x7473
callq 0x3320
cmpl $0x0, %eax
jne 0x43b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x2ab8(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x2ab0(%rbp)
callq 0x3410
movq -0x2ab8(%rbp), %rsi
movq -0x2ab0(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x51b0
jmp 0x4323
leaq -0x90(%rbp), %rdi
callq 0x4140
jmp 0x4331
leaq -0x90(%rbp), %rdi
callq 0x3488
leaq -0x91(%rbp), %rdi
callq 0x3240
movl $0x0, -0x4(%rbp)
movl $0x1, -0x98(%rbp)
jmp 0x5181
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x3240
jmp 0x519f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x439f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3488
leaq -0x91(%rbp), %rdi
callq 0x3240
jmp 0x5196
cmpl $0x1, -0x8(%rbp)
jle 0x4416
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x30b5(%rip), %rsi      # 0x747a
callq 0x3320
cmpl $0x0, %eax
je 0x43e8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x309f(%rip), %rsi      # 0x747d
callq 0x3320
cmpl $0x0, %eax
jne 0x4416
callq 0x4100
jmp 0x43ef
movl $0x0, -0x4(%rbp)
movl $0x1, -0x98(%rbp)
jmp 0x5181
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x5196
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x442c
cmpl $0x2, -0x8(%rbp)
jne 0x4473
movq 0x5bbd(%rip), %rdi      # 0x9ff0
leaq 0x304d(%rip), %rsi      # 0x7487
callq 0x3210
movq %rax, -0x2ac0(%rbp)
jmp 0x4448
movq -0x2ac0(%rbp), %rdi
movq 0x5b62(%rip), %rsi      # 0x9fb8
callq 0x3220
jmp 0x445d
movl $0x1, -0x4(%rbp)
movl $0x1, -0x98(%rbp)
jmp 0x5181
movl $0x1, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4c14
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2ffe(%rip), %rsi      # 0x74a5
callq 0x3320
cmpl $0x0, %eax
je 0x44d5
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2fe1(%rip), %rsi      # 0x74a8
callq 0x3320
cmpl $0x0, %eax
jne 0x45a4
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2ad0(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x2ac8(%rbp)
callq 0x3410
movq -0x2ad0(%rbp), %rsi
movq -0x2ac8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x51b0
jmp 0x4528
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
movl $0xa, %edx
callq 0x5700
movq %rax, -0x2ad8(%rbp)
jmp 0x4546
movq -0x2ad8(%rbp), %rax
movl %eax, -0x14(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3488
leaq -0xc1(%rbp), %rdi
callq 0x3240
jmp 0x4c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x4593
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3488
leaq -0xc1(%rbp), %rdi
callq 0x3240
jmp 0x5196
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2ef6(%rip), %rsi      # 0x74b0
callq 0x3320
cmpl $0x0, %eax
je 0x45e4
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2eda(%rip), %rsi      # 0x74b4
callq 0x3320
cmpl $0x0, %eax
jne 0x4615
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x32a0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2e93(%rip), %rsi      # 0x74be
callq 0x3320
cmpl $0x0, %eax
je 0x4655
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2e77(%rip), %rsi      # 0x74c2
callq 0x3320
cmpl $0x0, %eax
jne 0x4686
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x32a0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2e30(%rip), %rsi      # 0x74cc
callq 0x3320
cmpl $0x0, %eax
je 0x46c6
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2e14(%rip), %rsi      # 0x74d0
callq 0x3320
cmpl $0x0, %eax
jne 0x46f3
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x40(%rbp), %rdi
callq 0x32e0
jmp 0x46ee
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2dcf(%rip), %rsi      # 0x74d8
callq 0x3320
cmpl $0x0, %eax
je 0x4733
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2db3(%rip), %rsi      # 0x74dc
callq 0x3320
cmpl $0x0, %eax
jne 0x4764
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x32a0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2d6d(%rip), %rsi      # 0x74e7
callq 0x3320
cmpl $0x0, %eax
je 0x47a4
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2d51(%rip), %rsi      # 0x74eb
callq 0x3320
cmpl $0x0, %eax
jne 0x47d5
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x32a0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x5c(%rbp)
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2d0b(%rip), %rsi      # 0x74f6
callq 0x3320
cmpl $0x0, %eax
je 0x4815
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2cef(%rip), %rsi      # 0x74fa
callq 0x3320
cmpl $0x0, %eax
jne 0x4840
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x33a0
movl %eax, -0x60(%rbp)
jmp 0x4c00
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2cae(%rip), %rsi      # 0x7504
callq 0x3320
cmpl $0x0, %eax
je 0x4884
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c91(%rip), %rsi      # 0x7507
callq 0x3320
cmpl $0x0, %eax
jne 0x4953
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2ae8(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x2ae0(%rbp)
callq 0x3410
movq -0x2ae8(%rbp), %rsi
movq -0x2ae0(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0x51b0
jmp 0x48d7
xorl %eax, %eax
movl %eax, %esi
leaq -0xe8(%rbp), %rdi
movl $0xa, %edx
callq 0x5700
movq %rax, -0x2af0(%rbp)
jmp 0x48f5
movq -0x2af0(%rbp), %rax
movl %eax, -0x64(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3488
leaq -0xe9(%rbp), %rdi
callq 0x3240
jmp 0x4c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x4942
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3488
leaq -0xe9(%rbp), %rdi
callq 0x3240
jmp 0x5196
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2ba5(%rip), %rsi      # 0x750e
callq 0x3320
cmpl $0x0, %eax
je 0x4997
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2b89(%rip), %rsi      # 0x7512
callq 0x3320
cmpl $0x0, %eax
jne 0x4a66
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2b00(%rbp)
leaq -0x111(%rbp), %rdi
movq %rdi, -0x2af8(%rbp)
callq 0x3410
movq -0x2b00(%rbp), %rsi
movq -0x2af8(%rbp), %rdx
leaq -0x110(%rbp), %rdi
callq 0x51b0
jmp 0x49ea
xorl %eax, %eax
movl %eax, %esi
leaq -0x110(%rbp), %rdi
movl $0xa, %edx
callq 0x5700
movq %rax, -0x2b08(%rbp)
jmp 0x4a08
movq -0x2b08(%rbp), %rax
movl %eax, -0x68(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3488
leaq -0x111(%rbp), %rdi
callq 0x3240
jmp 0x4c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x4a55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x3488
leaq -0x111(%rbp), %rdi
callq 0x3240
jmp 0x5196
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2aa4(%rip), %rsi      # 0x7520
callq 0x3320
cmpl $0x0, %eax
je 0x4aaa
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2a89(%rip), %rsi      # 0x7525
callq 0x3320
cmpl $0x0, %eax
jne 0x4b79
movl -0x9c(%rbp), %eax
incl %eax
movl %eax, -0x9c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2b18(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x2b10(%rbp)
callq 0x3410
movq -0x2b18(%rbp), %rsi
movq -0x2b10(%rbp), %rdx
leaq -0x138(%rbp), %rdi
callq 0x51b0
jmp 0x4afd
xorl %eax, %eax
movl %eax, %esi
leaq -0x138(%rbp), %rdi
movl $0xa, %edx
callq 0x5700
movq %rax, -0x2b20(%rbp)
jmp 0x4b1b
movq -0x2b20(%rbp), %rax
movl %eax, -0x6c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x3488
leaq -0x139(%rbp), %rdi
callq 0x3240
jmp 0x4c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x4b68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x3488
leaq -0x139(%rbp), %rdi
callq 0x3240
jmp 0x5196
movq 0x5470(%rip), %rdi      # 0x9ff0
leaq 0x29ab(%rip), %rsi      # 0x7532
callq 0x3210
movq %rax, -0x2b28(%rbp)
jmp 0x4b95
movq -0x2b28(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3210
movq %rax, -0x2b30(%rbp)
jmp 0x4bb9
movq -0x2b30(%rbp), %rdi
leaq 0x2983(%rip), %rsi      # 0x754a
callq 0x3210
movq %rax, -0x2b38(%rbp)
jmp 0x4bd5
movq -0x2b38(%rbp), %rdi
movq 0x53d5(%rip), %rsi      # 0x9fb8
callq 0x3220
jmp 0x4bea
movl $0x1, -0x4(%rbp)
movl $0x1, -0x98(%rbp)
jmp 0x5181
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x447d
movl -0x6c(%rbp), %ecx
xorl %edx, %edx
movl $0x3e8, %eax            # imm = 0x3E8
divl %ecx
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x140(%rbp)
callq 0x40a0
jmp 0x4c33
xorl %eax, %eax
movl %eax, %edi
callq 0x32f0
movq %rax, -0x2b40(%rbp)
jmp 0x4c45
movq -0x2b40(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rcx
movq 0xe8(%rcx), %rax
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rax
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
movl 0xe0(%rdi), %esi
movl $0x20, %edx
movl $0x4, %ecx
leaq -0x190(%rbp), %r8
callq 0x32c0
jmp 0x4c9d
movq -0x148(%rbp), %rdi
callq 0x3300
movq %rax, -0x2b48(%rbp)
jmp 0x4cb2
movq -0x2b48(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x148(%rbp), %rax
movl 0xe0(%rax), %eax
movl %eax, -0x19c(%rbp)
movq -0x198(%rbp), %rdi
callq 0x3430
movl %eax, -0x2b4c(%rbp)
jmp 0x4ce7
movl -0x2b4c(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movq -0x198(%rbp), %rdi
callq 0x3280
movl %eax, -0x2b50(%rbp)
jmp 0x4d07
movl -0x2b50(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movl $0x1, -0x1d8(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
movq -0x190(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3150
movq %rax, -0x2b58(%rbp)
jmp 0x4d42
movq -0x2b58(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq $0x0, -0x218(%rbp)
movq $0x0, -0x228(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
movl -0x1bc(%rbp), %r8d
movl -0x1c0(%rbp), %r9d
movl -0x17c(%rbp), %ecx
movq -0x190(%rbp), %rdx
movq %rsp, %rax
leaq -0x230(%rbp), %r10
movq %r10, 0x28(%rax)
movq %rdx, 0x18(%rax)
movl %ecx, 0x8(%rax)
movq $0x220a, 0x20(%rax)     # imm = 0x220A
movl $0x1, 0x10(%rax)
movl $0x0, (%rax)
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x3390
movq %rax, -0x2b60(%rbp)
jmp 0x4dcb
movq -0x2b60(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
movl $0x28000, %edx          # imm = 0x28000
callq 0x3140
jmp 0x4df3
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
callq 0x33c0
jmp 0x4e08
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
callq 0x3270
jmp 0x4e1d
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x3270
jmp 0x4e32
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x3100
movq %rax, -0x2b68(%rbp)
jmp 0x4e55
movq -0x2b68(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq 0x26e2(%rip), %rsi      # 0x754c
leaq -0x40(%rbp), %rdi
callq 0x5740
movb %al, -0x2b69(%rbp)
jmp 0x4e7b
movb -0x2b69(%rbp), %al
testb $0x1, %al
jne 0x4e87
jmp 0x4ea7
movw $0xffff, -0x1b0(%rbp)   # imm = 0xFFFF
movw $0x0, -0x1ae(%rbp)
movw $0x0, -0x1ac(%rbp)
jmp 0x4f48
leaq 0x26a2(%rip), %rsi      # 0x7550
leaq -0x40(%rbp), %rdi
callq 0x5740
movb %al, -0x2b6a(%rbp)
jmp 0x4ebf
movb -0x2b6a(%rbp), %al
testb $0x1, %al
jne 0x4ecb
jmp 0x4ee8
movw $0x0, -0x1b0(%rbp)
movw $0x0, -0x1ae(%rbp)
movw $0xffff, -0x1ac(%rbp)   # imm = 0xFFFF
jmp 0x4f46
leaq 0x2666(%rip), %rsi      # 0x7555
leaq -0x40(%rbp), %rdi
callq 0x5740
movb %al, -0x2b6b(%rbp)
jmp 0x4f00
movb -0x2b6b(%rbp), %al
testb $0x1, %al
jne 0x4f0c
jmp 0x4f29
movw $0x0, -0x1b0(%rbp)
movw $0xffff, -0x1ae(%rbp)   # imm = 0xFFFF
movw $0x0, -0x1ac(%rbp)
jmp 0x4f44
movw $0xffff, -0x1b0(%rbp)   # imm = 0xFFFF
movw $0xffff, -0x1ae(%rbp)   # imm = 0xFFFF
movw $0xffff, -0x1ac(%rbp)   # imm = 0xFFFF
jmp 0x4f46
jmp 0x4f48
movb $0x7, -0x1aa(%rbp)
movq -0x148(%rbp), %rdi
movq 0xe8(%rdi), %rax
movslq -0x19c(%rbp), %rcx
shlq $0x7, %rcx
movq 0x50(%rax,%rcx), %rsi
leaq -0x1b8(%rbp), %rdx
callq 0x31b0
jmp 0x4f7b
movq -0x148(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
movq -0x1b8(%rbp), %rdx
callq 0x30b0
jmp 0x4f97
movq -0x148(%rbp), %rdi
callq 0x3380
jmp 0x4fa5
movl -0x1bc(%rbp), %esi
movl -0x1c0(%rbp), %edx
leaq -0x2988(%rbp), %rdi
callq 0x3640
jmp 0x4fbf
movl -0x14(%rbp), %esi
leaq -0x2988(%rbp), %rdi
movq %rdi, -0x2b78(%rbp)
callq 0x38a0
movq -0x2b78(%rbp), %rdi
movss -0x18(%rbp), %xmm0
movss -0x58(%rbp), %xmm2
movaps %xmm0, %xmm1
addss %xmm2, %xmm1
movss -0x1c(%rbp), %xmm2
movss -0x5c(%rbp), %xmm4
movaps %xmm2, %xmm3
addss %xmm4, %xmm3
callq 0x38c0
movq -0x2b78(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x3910
movq -0x2b78(%rbp), %rdi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %eax
movl %esi, %edx
addl %eax, %edx
callq 0x3930
movq -0x2b78(%rbp), %rdi
callq 0x3af0
jmp 0x5036
jmp 0x5038
jmp 0x503a
movq -0x148(%rbp), %rdi
movl $0x28000, %esi          # imm = 0x28000
leaq -0x2a48(%rbp), %rdx
callq 0x32d0
jmp 0x5054
cmpl $0x16, -0x2a48(%rbp)
jne 0x5107
leaq -0x2aa0(%rbp), %rdi
leaq -0x2a48(%rbp), %rsi
movl $0x58, %edx
callq 0x31a0
movl -0x1bc(%rbp), %eax
cmpl -0x2a68(%rbp), %eax
jne 0x5095
movl -0x1c0(%rbp), %eax
cmpl -0x2a64(%rbp), %eax
je 0x5105
movl -0x2a68(%rbp), %eax
movl %eax, -0x1bc(%rbp)
movl -0x2a64(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movl -0x1bc(%rbp), %esi
movl -0x1c0(%rbp), %edx
leaq -0x2988(%rbp), %rdi
callq 0x3750
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
movl -0x1bc(%rbp), %edx
movl -0x1c0(%rbp), %ecx
callq 0x3360
jmp 0x50e6
jmp 0x5105
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2988(%rbp), %rdi
callq 0x3770
jmp 0x5196
jmp 0x5107
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
movq -0x1a8(%rbp), %rdx
movq -0x250(%rbp), %rcx
movl -0x14(%rbp), %r8d
callq 0x3070
jmp 0x512e
movq -0x148(%rbp), %rdi
callq 0x3380
jmp 0x513c
movq -0x148(%rbp), %rdi
movq -0x238(%rbp), %rsi
callq 0x3200
jmp 0x5151
movss -0x140(%rbp), %xmm0
leaq -0x2988(%rbp), %rdi
callq 0x3da0
jmp 0x5167
movl -0x6c(%rbp), %ecx
xorl %edx, %edx
movl $0xf4240, %eax          # imm = 0xF4240
divl %ecx
movl %eax, %edi
callq 0x3330
jmp 0x517c
jmp 0x5038
leaq -0x40(%rbp), %rdi
callq 0x3488
movl -0x4(%rbp), %eax
addq $0x2bb0, %rsp           # imm = 0x2BB0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x3488
movq -0x50(%rbp), %rdi
callq 0x3400
nopl (%rax,%rax)