// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/RayTracer.cpp
// Function: main
int main(int argc, char** argv) {
    std::string filename, scenename, temppath;
    unsigned int screen_width, screen_height, number_of_rays, n_threads, batch_size, vfov, fps, n_frames;
    bool show_progressbar, correct_gamma, dynamic_writing;
    double aperture;

    Options arguments("RayTracer", "Renders images using a custom-written RayTracer.");
    arguments.add_options()
        ("f,filename", "The name of the output picture (relative to the run directory). If more than one frames are rendered, this will be an .mp4.", value<string>())
        ("s,scene", "Path to the JSON file that will be used to create a RenderWorld", value<string>())
        ("T,temppath", "Path to a folder where all the frames will be saved before creating an .mp4", value<string>())
        ("W,width", "The width (in pixels) of the output image", value<unsigned int>())
        ("H,height", "The height (in pixels) of the output image", value<unsigned int>())
        ("r,rays", "The number of rays shot per pixel", value<unsigned int>())
        ("v,vfov", "Specifies the field of view for the camera.", value<unsigned int>())
        ("a,aperture", "Determines the aperture of the camera. Determines the amount of blur.", value<double>())
        ("n,n_frames", "The number of frames that will be rendered. If this is higher than one, then a .mp4 is created.", value<unsigned int>())
        ("F,framerate", "The framerate of the output video.", value<unsigned int>())
        ("d,dynamic_write", "If given, writes the frame immediately to disk when rendered.")
        ("p,progressbar", "If given, shows a progressbar to indice the render process")
        ("g,gamma", "If given, corrects the gamma before saving")
        #ifdef THREADED
        ("t,threads", "The number of threads this program runs", value<unsigned int>())
        ("b,batch_size", "The batch size for the ThreadPool", value<unsigned int>())
        #endif
        ;
    
    auto result = arguments.parse(argc, argv);
    
    if (result.count("filename")) {
        filename = result["filename"].as<string>();
    } else {
        filename = "output/out1.";
    }
    if (result.count("scene")) {
        scenename = result["scene"].as<string>();
    } else {
        scenename = "";
    }
    if (result.count("temppath")) {
        temppath = result["temppath"].as<string>();
    } else {
        temppath = "output/animation";
    }

    try {
        screen_width = result["width"].as<unsigned int>();
    } catch (domain_error&) {
        screen_width = 1000;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse image width: " << opt.what() << endl;
        exit(-1);
    }
    try {
        screen_height = result["height"].as<unsigned int>();
    } catch (domain_error&) {
        screen_height = 500;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse image height: " << opt.what() << endl;
        exit(-1);
    }
    try {
        number_of_rays = result["rays"].as<unsigned int>();
    } catch (domain_error&) {
        number_of_rays = 500;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse number of rays: " << opt.what() << endl;
        exit(-1);
    }
    try {
        vfov = result["vfov"].as<unsigned int>();
    } catch (domain_error&) {
        vfov = 90;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse field of view: " << opt.what() << endl;
        exit(-1);
    }
    try {
        fps = result["framerate"].as<unsigned int>();
    } catch (domain_error&) {
        fps = 30;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse framerate: " << opt.what() << endl;
        exit(-1);
    }
    try {
        n_frames = result["n_frames"].as<unsigned int>();
    } catch (domain_error&) {
        n_frames = 1;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse number of frames: " << opt.what() << endl;
        exit(-1);
    }
    try {
        aperture = result["aperture"].as<double>();
    } catch (domain_error&) {
        aperture = 0.1;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse aperture: " << opt.what() << endl;
        exit(-1);
    }
    show_progressbar = result.count("progressbar") != 0;
    correct_gamma = result.count("gamma") != 0;
    dynamic_writing = result.count("dynamic_write") != 0;
    #ifdef THREADED
    try {
        n_threads = result["threads"].as<unsigned int>();
    } catch (domain_error&) {
        n_threads = 16;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse number of threads: " << opt.what() << endl;
        exit(-1);
    }
    try {
        batch_size = result["batch_size"].as<unsigned int>();
    } catch (domain_error&) {
        batch_size = 1000;
    } catch (OptionParseException& opt) {
        cerr << "Could not parse batch size: " << opt.what() << endl;
        exit(-1);
    }
    #else
    n_threads = 16;
    batch_size = 1000;
    #endif

    // Fix the output file if needed
    if (filename[filename.length() - 1] == '.') {
        if (n_frames == 1) {
            filename += "png";
        } else {
            filename += "mp4";
        }
    }

    cout << endl << "*** RayTracer Renderer ***" << endl << endl;
    cout << "Using options:" << endl;
    cout << "  Output file         : " << filename << endl;
    if (scenename != "") {
        cout << "  Scene used          : " << scenename << endl;
    }
    if (n_frames > 1) {
        cout << "  Temp output dict    : " << temppath << endl;
    }
    cout << "  Image dimensions    : " << screen_width << "x" << screen_height << "px" << endl;
    cout << "  Number of frames    : " << n_frames << endl;
    if (n_frames > 1) {
        cout << "  Framerate           : " << fps << endl;
    }
    cout << "  Number of rays      : " << number_of_rays << endl;
    #ifdef THREADED
    cout << "  Number of threads   : " << n_threads << endl;
    cout << "  Batch size          : " << batch_size << endl;
    #endif
    cout << "  Field of view       : " << vfov << endl;
    cout << "  Aperture            : " << aperture << endl;
    cout << "  Correct for gamma   ? ";
    if (correct_gamma) {
        cout << "yes" << endl;
    } else {
        cout << "no" << endl;
    }
    if (n_frames > 1) {
        cout << "  Write frames dynamic? ";
        if (dynamic_writing) {
            cout << "yes" << endl;
        } else {
            cout << "no" << endl;
        }
    }

    RenderWorld* world;
    Camera *cam = NULL;
    if (scenename.empty()) {
        cout << endl << "Creating default scene..." << endl;
        cout << "  Generating world..." << endl;
        world = create_default_renderworld();
        cout << "  Done, counting " << world->get_object_count() << " objects" << endl;

        cout << "  Generating camera..." << endl;
        cam = create_default_camera(vfov, aperture, screen_width, screen_height, number_of_rays, correct_gamma);
        cout << "  Done" << endl;

        cout << "Done" << endl;
    } else {
        // Open a filestream to the input scene
        cout << endl << "Loading JSON..." << endl;
        ifstream scene_file(scenename);
        if (!scene_file.is_open()) {
            cerr << "Could not open file: " << string_error(errno) << endl;
            exit(-1);
        }

        // Load a JSON from it
        nlohmann::json j;
        scene_file >> j;
        scene_file.close();

        // Check if the j is an object
        if (!j.is_object()) {
            cerr << "JSON in file \"" << scenename << "\" is not a JSON object" << endl;
            exit(-1);
        }

        // Load all the objects (if present)
        if (!j["world"].is_null()) {
            cout << "  Loading world..." << endl;
            try {
                world = RenderWorld::from_json(j["world"]);
            } catch (JSONException& e) {
                cerr << e.what() << endl;
                exit(-1);
            }
        } else {
            cout << "  Generating world..." << endl;
            world = create_default_renderworld();
        }
        cout << "  Done, counting " << world->get_object_count() << " objects" << endl;

        // Load any camera
        if (!j["camera"].is_null()) {
            cout << "  Loading camera..." << endl;

            // Load the actual object
            cam = Camera::from_json(j["camera"]);

            // Update it to make sure it has some meta variables
            update_camera(cam, screen_width, screen_height, number_of_rays, correct_gamma);
            
            // Let the camera compute some initial variables
            cam->recompute();

            // Print some nice stuff
            if (cam->vfov != vfov) {
                cout << "    Camera: overriding field of view to " << cam->vfov << endl;
            }
            if (cam->aperture != aperture) {
                cout << "    Camera: overriding aperture to " << cam->aperture << endl;
            }
        } else {
            cam = create_default_camera(vfov, aperture, screen_width, screen_height, number_of_rays, correct_gamma);
        }
        cout << "  Done" << endl;

        cout << "Done" << endl;
    }


    // Render one picture
    cout << endl << "Rendering..." << endl;
    Renderer renderer(n_threads, batch_size, show_progressbar);

    auto start = chrono::system_clock::now();
    auto stop = start;

    if (n_frames == 1) {
        Image out = renderer.render(world, cam);

        stop = chrono::system_clock::now();

        cout << "Writing output..." << endl;
        out.to_png(filename);
    } else {
        Frames out(cam->width, cam->height, n_frames, fps, temppath, dynamic_writing);
        renderer.render_animation(world, cam, out);

        stop = chrono::system_clock::now();

        cout << "Creating .mp4..." << endl;
        out.to_mp4(filename);
    }
    auto duration = stop - start;
    auto duration_ms = chrono::duration_cast<chrono::milliseconds>(duration);

    cout << "Done, rendering took " << ((double) duration_ms.count()) / 1000.0 << " seconds" << endl;

    // Delete the allocated objects
    delete world;
    delete cam;

    cout << endl <<  "Done." << endl << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc08, %rsp            # imm = 0xC08
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl %edi, 0x74(%rsp)
movq %rsi, 0x240(%rsp)
xorl %ecx, %ecx
leaq 0xb0(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq 0x258(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x3794d(%rip), %rsi     # 0x8b81e
leaq 0xac8(%rsp), %rdi
leaq 0x268(%rsp), %rdx
callq 0x56548
leaq 0x3793b(%rip), %rsi     # 0x8b828
leaq 0xaa8(%rsp), %rdi
leaq 0x528(%rsp), %rdx
callq 0x56548
leaq 0xae8(%rsp), %rdi
leaq 0xac8(%rsp), %rsi
leaq 0xaa8(%rsp), %rdx
callq 0x56604
leaq 0xaa8(%rsp), %rdi
callq 0x52888
leaq 0xac8(%rsp), %rdi
callq 0x52888
leaq 0x38458(%rip), %rsi     # 0x8c398
leaq 0xa88(%rsp), %rdi
leaq 0x67(%rsp), %rdx
callq 0x56548
leaq 0x268(%rsp), %rdi
leaq 0xae8(%rsp), %rsi
leaq 0xa88(%rsp), %rdx
callq 0x56720
leaq 0x378e3(%rip), %rsi     # 0x8b859
leaq 0x528(%rsp), %rdi
leaq 0x66(%rsp), %rdx
callq 0x56548
leaq 0x378d5(%rip), %rsi     # 0x8b864
leaq 0x18(%rsp), %rdi
leaq 0x65(%rsp), %rdx
callq 0x56548
leaq 0x1f0(%rsp), %rdi
callq 0x569b3
leaq 0x208(%rsp), %rcx
leaq 0x1f8(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x383c3(%rip), %rsi     # 0x8c398
leaq 0xa68(%rsp), %rdi
leaq 0x64(%rsp), %rdx
callq 0x56548
leaq 0x268(%rsp), %rdi
leaq 0x528(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x200(%rsp), %rcx
leaq 0xa68(%rsp), %r8
callq 0x56794
movq %rax, %rbx
leaq 0x378c5(%rip), %rsi     # 0x8b8e0
leaq 0xa48(%rsp), %rdi
leaq 0x63(%rsp), %rdx
callq 0x56548
leaq 0x378b4(%rip), %rsi     # 0x8b8e8
leaq 0xa28(%rsp), %rdi
leaq 0x62(%rsp), %rdx
callq 0x56548
leaq 0x1d0(%rsp), %rdi
callq 0x569b3
leaq 0x1e8(%rsp), %rcx
leaq 0x1d8(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x3831b(%rip), %rsi     # 0x8c398
leaq 0xa08(%rsp), %rdi
leaq 0x61(%rsp), %rdx
callq 0x56548
leaq 0xa48(%rsp), %rsi
leaq 0xa28(%rsp), %rdx
leaq 0x1e0(%rsp), %rcx
leaq 0xa08(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x37867(%rip), %rsi     # 0x8b928
leaq 0x9e8(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x56548
leaq 0x37859(%rip), %rsi     # 0x8b933
leaq 0x9c8(%rsp), %rdi
leaq 0x5f(%rsp), %rdx
callq 0x56548
leaq 0x1b0(%rsp), %rdi
callq 0x569b3
leaq 0x1c8(%rsp), %rcx
leaq 0x1b8(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x38275(%rip), %rsi     # 0x8c398
leaq 0x9a8(%rsp), %rdi
leaq 0x5e(%rsp), %rdx
callq 0x56548
leaq 0x9e8(%rsp), %rsi
leaq 0x9c8(%rsp), %rdx
leaq 0x1c0(%rsp), %rcx
leaq 0x9a8(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x37818(%rip), %rsi     # 0x8b97f
leaq 0x988(%rsp), %rdi
leaq 0x5d(%rsp), %rdx
callq 0x56548
leaq 0x37807(%rip), %rsi     # 0x8b987
leaq 0x968(%rsp), %rdi
leaq 0x5c(%rsp), %rdx
callq 0x56548
leaq 0x190(%rsp), %rdi
callq 0x569e6
leaq 0x1a8(%rsp), %rcx
leaq 0x198(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x381cf(%rip), %rsi     # 0x8c398
leaq 0x948(%rsp), %rdi
leaq 0x5b(%rsp), %rdx
callq 0x56548
leaq 0x988(%rsp), %rsi
leaq 0x968(%rsp), %rdx
leaq 0x1a0(%rsp), %rcx
leaq 0x948(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x377a4(%rip), %rsi     # 0x8b9b1
leaq 0x928(%rsp), %rdi
leaq 0x5a(%rsp), %rdx
callq 0x56548
leaq 0x37794(%rip), %rsi     # 0x8b9ba
leaq 0x908(%rsp), %rdi
leaq 0x59(%rsp), %rdx
callq 0x56548
leaq 0x170(%rsp), %rdi
callq 0x569e6
leaq 0x188(%rsp), %rcx
leaq 0x178(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x38129(%rip), %rsi     # 0x8c398
leaq 0x8e8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x56548
leaq 0x928(%rsp), %rsi
leaq 0x908(%rsp), %rdx
leaq 0x180(%rsp), %rcx
leaq 0x8e8(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x37732(%rip), %rsi     # 0x8b9e5
leaq 0x8c8(%rsp), %rdi
leaq 0x57(%rsp), %rdx
callq 0x56548
leaq 0x37720(%rip), %rsi     # 0x8b9ec
leaq 0x8a8(%rsp), %rdi
leaq 0x56(%rsp), %rdx
callq 0x56548
leaq 0x150(%rsp), %rdi
callq 0x569e6
leaq 0x168(%rsp), %rcx
leaq 0x158(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x38083(%rip), %rsi     # 0x8c398
leaq 0x888(%rsp), %rdi
leaq 0x55(%rsp), %rdx
callq 0x56548
leaq 0x8c8(%rsp), %rsi
leaq 0x8a8(%rsp), %rdx
leaq 0x160(%rsp), %rcx
leaq 0x888(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x376b5(%rip), %rsi     # 0x8ba0e
leaq 0x868(%rsp), %rdi
leaq 0x54(%rsp), %rdx
callq 0x56548
leaq 0x376a3(%rip), %rsi     # 0x8ba15
leaq 0x848(%rsp), %rdi
leaq 0x53(%rsp), %rdx
callq 0x56548
leaq 0x130(%rsp), %rdi
callq 0x569e6
leaq 0x148(%rsp), %rcx
leaq 0x138(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x37fdd(%rip), %rsi     # 0x8c398
leaq 0x828(%rsp), %rdi
leaq 0x52(%rsp), %rdx
callq 0x56548
leaq 0x868(%rsp), %rsi
leaq 0x848(%rsp), %rdx
leaq 0x140(%rsp), %rcx
leaq 0x828(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x37642(%rip), %rsi     # 0x8ba41
leaq 0x808(%rsp), %rdi
leaq 0x51(%rsp), %rdx
callq 0x56548
leaq 0x37634(%rip), %rsi     # 0x8ba4c
leaq 0x7e8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x56548
leaq 0x110(%rsp), %rdi
callq 0x56a19
leaq 0x128(%rsp), %rcx
leaq 0x118(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x37f37(%rip), %rsi     # 0x8c398
leaq 0x7c8(%rsp), %rdi
leaq 0x4f(%rsp), %rdx
callq 0x56548
leaq 0x808(%rsp), %rsi
leaq 0x7e8(%rsp), %rdx
leaq 0x120(%rsp), %rcx
leaq 0x7c8(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x375ed(%rip), %rsi     # 0x8ba92
leaq 0x7a8(%rsp), %rdi
leaq 0x4e(%rsp), %rdx
callq 0x56548
leaq 0x375df(%rip), %rsi     # 0x8ba9d
leaq 0x788(%rsp), %rdi
leaq 0x4d(%rsp), %rdx
callq 0x56548
leaq 0xf0(%rsp), %rdi
callq 0x569e6
leaq 0x108(%rsp), %rcx
leaq 0xf8(%rsp), %rax
movapd -0x8(%rax), %xmm0
movapd %xmm0, -0x8(%rcx)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rax)
leaq 0x37e91(%rip), %rsi     # 0x8c398
leaq 0x768(%rsp), %rdi
leaq 0x4c(%rsp), %rdx
callq 0x56548
leaq 0x7a8(%rsp), %rsi
leaq 0x788(%rsp), %rdx
leaq 0x100(%rsp), %rcx
leaq 0x768(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
movq %rax, %r14
leaq 0x375b2(%rip), %rsi     # 0x8bafd
leaq 0x748(%rsp), %rdi
leaq 0x4b(%rsp), %rdx
callq 0x56548
leaq 0x375a5(%rip), %rsi     # 0x8bb09
leaq 0x728(%rsp), %rdi
leaq 0x4a(%rsp), %rdx
callq 0x56548
leaq 0x4b0(%rsp), %rdi
callq 0x569e6
leaq 0xe8(%rsp), %rax
leaq 0x4b8(%rsp), %r12
movapd -0x8(%r12), %xmm0
movapd %xmm0, -0x8(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%r12)
leaq 0x37de7(%rip), %rsi     # 0x8c398
leaq 0x708(%rsp), %rdi
leaq 0x49(%rsp), %rdx
callq 0x56548
leaq 0x748(%rsp), %rsi
leaq 0x728(%rsp), %rdx
leaq 0xe0(%rsp), %rcx
leaq 0x708(%rsp), %r8
movq %r14, %rdi
callq 0x56794
movq %rax, %r14
leaq 0x37537(%rip), %rsi     # 0x8bb2c
leaq 0x6e8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x56548
leaq 0x3752e(%rip), %rsi     # 0x8bb3c
leaq 0x6c8(%rsp), %rdi
leaq 0x47(%rsp), %rdx
callq 0x56548
leaq 0x4a0(%rsp), %rdi
callq 0x56a4c
leaq 0xd8(%rsp), %rax
leaq 0x4a8(%rsp), %rbp
movapd -0x8(%rbp), %xmm0
movapd %xmm0, -0x8(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%rbp)
leaq 0x37d41(%rip), %rsi     # 0x8c398
leaq 0x6a8(%rsp), %rdi
leaq 0x46(%rsp), %rdx
callq 0x56548
leaq 0x6e8(%rsp), %rsi
leaq 0x6c8(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
leaq 0x6a8(%rsp), %r8
movq %r14, %rdi
callq 0x56794
movq %rax, %r13
leaq 0x374df(%rip), %rsi     # 0x8bb7a
leaq 0x688(%rsp), %rdi
leaq 0x45(%rsp), %rdx
callq 0x56548
leaq 0x374d4(%rip), %rsi     # 0x8bb88
leaq 0x668(%rsp), %rdi
leaq 0x44(%rsp), %rdx
callq 0x56548
leaq 0x490(%rsp), %rdi
callq 0x56a4c
leaq 0xc8(%rsp), %rax
leaq 0x498(%rsp), %r15
movapd -0x8(%r15), %xmm0
movapd %xmm0, -0x8(%rax)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%r15)
leaq 0x37c99(%rip), %rsi     # 0x8c398
leaq 0x648(%rsp), %rdi
leaq 0x43(%rsp), %rdx
callq 0x56548
leaq 0x688(%rsp), %rsi
leaq 0x668(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
leaq 0x648(%rsp), %r8
movq %r13, %rdi
callq 0x56794
movq %rax, %rbx
leaq 0x37480(%rip), %rsi     # 0x8bbc3
leaq 0x628(%rsp), %rdi
leaq 0x42(%rsp), %rdx
callq 0x56548
leaq 0x3746f(%rip), %rsi     # 0x8bbcb
leaq 0x608(%rsp), %rdi
leaq 0x41(%rsp), %rdx
callq 0x56548
movq %rbp, %r14
leaq 0x470(%rsp), %rdi
callq 0x56a4c
leaq 0x488(%rsp), %rbp
leaq 0x478(%rsp), %r13
movapd -0x8(%r13), %xmm0
movapd %xmm0, -0x8(%rbp)
xorpd %xmm0, %xmm0
movapd %xmm0, -0x8(%r13)
leaq 0x37bee(%rip), %rsi     # 0x8c398
leaq 0x5e8(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x56548
leaq 0x628(%rsp), %rsi
leaq 0x608(%rsp), %rdx
leaq 0x480(%rsp), %rcx
leaq 0x5e8(%rsp), %r8
movq %rbx, %rdi
callq 0x56794
leaq 0x5e8(%rsp), %rdi
callq 0x52888
movq %rbp, %rdi
callq 0x572b8
movq %r13, %rdi
callq 0x572b8
leaq 0x608(%rsp), %rdi
callq 0x52888
leaq 0x628(%rsp), %rdi
callq 0x52888
leaq 0x648(%rsp), %rdi
callq 0x52888
leaq 0xc8(%rsp), %rdi
callq 0x572b8
movq %r15, %rdi
callq 0x572b8
leaq 0x668(%rsp), %rdi
callq 0x52888
leaq 0x688(%rsp), %rdi
callq 0x52888
leaq 0x6a8(%rsp), %rdi
callq 0x52888
leaq 0xd8(%rsp), %rdi
callq 0x572b8
movq %r14, %rdi
callq 0x572b8
leaq 0x6c8(%rsp), %rdi
callq 0x52888
leaq 0x6e8(%rsp), %rdi
callq 0x52888
leaq 0x708(%rsp), %rdi
callq 0x52888
leaq 0xe8(%rsp), %rdi
callq 0x572b8
movq %r12, %rdi
callq 0x572b8
leaq 0x728(%rsp), %rdi
callq 0x52888
leaq 0x748(%rsp), %rdi
callq 0x52888
leaq 0x768(%rsp), %rdi
callq 0x52888
leaq 0x108(%rsp), %rdi
callq 0x572b8
leaq 0xf8(%rsp), %rdi
callq 0x572b8
leaq 0x788(%rsp), %rdi
callq 0x52888
leaq 0x7a8(%rsp), %rdi
callq 0x52888
leaq 0x7c8(%rsp), %rdi
callq 0x52888
leaq 0x128(%rsp), %rdi
callq 0x572b8
leaq 0x118(%rsp), %rdi
callq 0x572b8
leaq 0x7e8(%rsp), %rdi
callq 0x52888
leaq 0x808(%rsp), %rdi
callq 0x52888
leaq 0x828(%rsp), %rdi
callq 0x52888
leaq 0x148(%rsp), %rdi
callq 0x572b8
leaq 0x138(%rsp), %rdi
callq 0x572b8
leaq 0x848(%rsp), %rdi
callq 0x52888
leaq 0x868(%rsp), %rdi
callq 0x52888
leaq 0x888(%rsp), %rdi
callq 0x52888
leaq 0x168(%rsp), %rdi
callq 0x572b8
leaq 0x158(%rsp), %rdi
callq 0x572b8
leaq 0x8a8(%rsp), %rdi
callq 0x52888
leaq 0x8c8(%rsp), %rdi
callq 0x52888
leaq 0x8e8(%rsp), %rdi
callq 0x52888
leaq 0x188(%rsp), %rdi
callq 0x572b8
leaq 0x178(%rsp), %rdi
callq 0x572b8
leaq 0x908(%rsp), %rdi
callq 0x52888
leaq 0x928(%rsp), %rdi
callq 0x52888
leaq 0x948(%rsp), %rdi
callq 0x52888
leaq 0x1a8(%rsp), %rdi
callq 0x572b8
leaq 0x198(%rsp), %rdi
callq 0x572b8
leaq 0x968(%rsp), %rdi
callq 0x52888
leaq 0x988(%rsp), %rdi
callq 0x52888
leaq 0x9a8(%rsp), %rdi
callq 0x52888
leaq 0x1c8(%rsp), %rdi
callq 0x572b8
leaq 0x1b8(%rsp), %rdi
callq 0x572b8
leaq 0x9c8(%rsp), %rdi
callq 0x52888
leaq 0x9e8(%rsp), %rdi
callq 0x52888
leaq 0xa08(%rsp), %rdi
callq 0x52888
leaq 0x1e8(%rsp), %rdi
callq 0x572b8
leaq 0x1d8(%rsp), %rdi
callq 0x572b8
leaq 0xa28(%rsp), %rdi
callq 0x52888
leaq 0xa48(%rsp), %rdi
callq 0x52888
leaq 0xa68(%rsp), %rdi
callq 0x52888
leaq 0x208(%rsp), %rdi
callq 0x572b8
leaq 0x1f8(%rsp), %rdi
callq 0x572b8
leaq 0x18(%rsp), %rdi
callq 0x52888
leaq 0x528(%rsp), %rdi
callq 0x52888
leaq 0x270(%rsp), %rdi
callq 0x52888
leaq 0xa88(%rsp), %rdi
callq 0x52888
leaq 0x528(%rsp), %rdi
leaq 0xae8(%rsp), %rsi
leaq 0x74(%rsp), %rdx
leaq 0x240(%rsp), %rcx
callq 0x56a80
leaq 0x36d03(%rip), %rsi     # 0x8b85b
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x52888
testq %rbx, %rbx
je 0x54be9
leaq 0x36cc0(%rip), %rsi     # 0x8b85b
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56b8c
leaq 0x80(%rsp), %rdi
movq %rax, %rsi
callq 0x52270
leaq 0x268(%rsp), %rdi
callq 0x52888
jmp 0x54bfd
leaq 0x37006(%rip), %rsi     # 0x8bbf6
leaq 0x80(%rsp), %rdi
callq 0x52820
leaq 0x36cde(%rip), %rsi     # 0x8b8e2
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x52888
testq %rbx, %rbx
je 0x54c95
leaq 0x36c9b(%rip), %rsi     # 0x8b8e2
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56b8c
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x52270
leaq 0x268(%rsp), %rdi
callq 0x52888
jmp 0x54ca9
leaq 0x376fc(%rip), %rsi     # 0x8c398
leaq 0xa0(%rsp), %rdi
callq 0x52820
leaq 0x36c7a(%rip), %rsi     # 0x8b92a
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x52888
testq %rbx, %rbx
je 0x54d41
leaq 0x36c37(%rip), %rsi     # 0x8b92a
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56b8c
leaq 0x248(%rsp), %rdi
movq %rax, %rsi
callq 0x52270
leaq 0x268(%rsp), %rdi
callq 0x52888
jmp 0x54d55
leaq 0x36ebb(%rip), %rsi     # 0x8bc03
leaq 0x248(%rsp), %rdi
callq 0x52820
leaq 0x36c25(%rip), %rsi     # 0x8b981
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36c0e(%rip), %rsi     # 0x8b9b3
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %eax
movl %eax, 0x10(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36bf9(%rip), %rsi     # 0x8b9e7
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %r12d
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36bdc(%rip), %rsi     # 0x8ba10
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %ebp
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36c86(%rip), %rsi     # 0x8baff
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %eax
movl %eax, 0x3c(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36bd2(%rip), %rsi     # 0x8ba94
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56c18
movl (%rax), %r15d
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x3db2a(%rip), %rsi     # 0x92a32
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b4c
movq %rax, %rdi
callq 0x56cb0
movsd (%rax), %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36c27(%rip), %rsi     # 0x8bb7c
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, 0x218(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36c2d(%rip), %rsi     # 0x8bbc5
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, %r13
leaq 0x268(%rsp), %rdi
callq 0x52888
leaq 0x36b58(%rip), %rsi     # 0x8bb2e
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x528(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x56b1e
movq %rax, 0x78(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x52888
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
cmpb $0x2e, -0x1(%rax,%rcx)
jne 0x55049
cmpl $0x1, %r15d
leaq 0x3b277(%rip), %rax     # 0x902a8
leaq 0x36943(%rip), %rsi     # 0x8b97b
cmoveq %rax, %rsi
leaq 0x80(%rsp), %rdi
callq 0x52810
movq 0x5cf38(%rip), %rdi     # 0xb1f88
callq 0x52210
leaq 0x36c90(%rip), %rsi     # 0x8bcec
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq %rax, %rdi
callq 0x52210
movq 0x5cf0d(%rip), %rdi     # 0xb1f88
leaq 0x36c85(%rip), %rsi     # 0x8bd07
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5cef2(%rip), %rdi     # 0xb1f88
leaq 0x36c79(%rip), %rsi     # 0x8bd16
callq 0x52450
leaq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x52400
movq %rax, %rdi
callq 0x52210
leaq 0x372d7(%rip), %rsi     # 0x8c398
leaq 0xa0(%rsp), %rdi
callq 0x56d3c
testb %al, %al
je 0x550fd
movq 0x5ceaf(%rip), %rdi     # 0xb1f88
leaq 0x36c4f(%rip), %rsi     # 0x8bd2f
callq 0x52450
leaq 0xa0(%rsp), %rsi
movq %rax, %rdi
callq 0x52400
movq %rax, %rdi
callq 0x52210
cmpl $0x2, %r15d
jb 0x5512e
movq 0x5ce7e(%rip), %rdi     # 0xb1f88
leaq 0x36c37(%rip), %rsi     # 0x8bd48
callq 0x52450
leaq 0x248(%rsp), %rsi
movq %rax, %rdi
callq 0x52400
movq %rax, %rdi
callq 0x52210
movq 0x5ce53(%rip), %rdi     # 0xb1f88
leaq 0x36c25(%rip), %rsi     # 0x8bd61
callq 0x52450
movl 0x14(%rsp), %esi
movq %rax, %rdi
callq 0x52310
leaq 0x36fa1(%rip), %rsi     # 0x8c0f5
movq %rax, %rdi
callq 0x52450
movl 0x10(%rsp), %esi
movq %rax, %rdi
callq 0x52310
leaq 0x36c0b(%rip), %rsi     # 0x8bd7a
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5ce02(%rip), %rdi     # 0xb1f88
leaq 0x36bf0(%rip), %rsi     # 0x8bd7d
callq 0x52450
movl %r15d, %esi
movq %rax, %rdi
callq 0x52310
movq %rax, %rdi
callq 0x52210
cmpl $0x2, %r15d
jb 0x551d2
movq 0x5cdd6(%rip), %rdi     # 0xb1f88
leaq 0x36bdd(%rip), %rsi     # 0x8bd96
callq 0x52450
movl 0x3c(%rsp), %esi
movq %rax, %rdi
callq 0x52310
movq %rax, %rdi
callq 0x52210
movq 0x5cdaf(%rip), %rdi     # 0xb1f88
leaq 0x36bcf(%rip), %rsi     # 0x8bdaf
callq 0x52450
movl %r12d, %esi
movq %rax, %rdi
callq 0x52310
movq %rax, %rdi
callq 0x52210
movq 0x5cd89(%rip), %rdi     # 0xb1f88
leaq 0x36bc2(%rip), %rsi     # 0x8bdc8
callq 0x52450
movl %ebp, %ebx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x52310
movq %rax, %rdi
callq 0x52210
movq 0x5cd61(%rip), %rdi     # 0xb1f88
leaq 0x36bb3(%rip), %rsi     # 0x8bde1
callq 0x52450
movq %rax, %rdi
movsd 0x68(%rsp), %xmm0
callq 0x526e0
movq %rax, %rdi
callq 0x52210
movq 0x5cd38(%rip), %rdi     # 0xb1f88
leaq 0x36ba3(%rip), %rsi     # 0x8bdfa
callq 0x52450
testq %r13, %r13
leaq 0x36bad(%rip), %rbp     # 0x8be13
leaq 0x36baa(%rip), %r14     # 0x8be17
movq %r14, %rsi
cmovneq %rbp, %rsi
movq 0x5cd0d(%rip), %rdi     # 0xb1f88
callq 0x52450
movq %rax, %rdi
callq 0x52210
cmpl $0x2, %r15d
jb 0x552c2
movq 0x5ccf3(%rip), %rdi     # 0xb1f88
leaq 0x36b7e(%rip), %rsi     # 0x8be1a
callq 0x52450
cmpq $0x0, 0x78(%rsp)
cmovneq %rbp, %r14
movq 0x5ccd6(%rip), %rdi     # 0xb1f88
movq %r14, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
cmpq $0x0, 0xa8(%rsp)
je 0x553d0
movq 0x5ccb0(%rip), %rdi     # 0xb1f88
callq 0x52210
leaq 0x36bb8(%rip), %rsi     # 0x8be9c
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x268(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x526f0
leaq 0x2e0(%rsp), %rdi
callq 0x520e0
testb %al, %al
je 0x55957
leaq 0x18(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x56d46
leaq 0x268(%rsp), %rdi
movq %r14, %rsi
callq 0x56d62
leaq 0x268(%rsp), %rdi
callq 0x520c0
cmpb $0x1, 0x18(%rsp)
jne 0x559a2
leaq 0x36b89(%rip), %rsi     # 0x8bee8
leaq 0x18(%rsp), %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x554d2
movq 0x5cc0f(%rip), %rdi     # 0xb1f88
leaq 0x36b6e(%rip), %rsi     # 0x8beee
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x36b54(%rip), %rsi     # 0x8bee8
leaq 0x18(%rsp), %rdi
callq 0x56e34
leaq 0x230(%rsp), %rdi
movq %rax, %rsi
callq 0x56f56
leaq 0x230(%rsp), %rdi
callq 0x848a6
movq %rax, %rbp
leaq 0x230(%rsp), %rdi
callq 0x56fca
jmp 0x554f5
movq 0x5cbb1(%rip), %rdi     # 0xb1f88
callq 0x52210
leaq 0x36a50(%rip), %rsi     # 0x8be33
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5cb8e(%rip), %rdi     # 0xb1f88
leaq 0x36a4c(%rip), %rsi     # 0x8be4d
callq 0x52450
movq %rax, %rdi
callq 0x52210
callq 0x53afc
movq %rax, %rbp
movq 0x5cb6b(%rip), %rdi     # 0xb1f88
leaq 0x36a3f(%rip), %rsi     # 0x8be63
callq 0x52450
movq %rax, %r14
movq %rbp, %rdi
callq 0x8447a
movq %r14, %rdi
movq %rax, %rsi
callq 0x52310
leaq 0x36a2f(%rip), %rsi     # 0x8be75
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5cb2b(%rip), %rdi     # 0xb1f88
leaq 0x36a1a(%rip), %rsi     # 0x8be7e
callq 0x52450
movq %rax, %rdi
callq 0x52210
xorl %ecx, %ecx
testq %r13, %r13
setne %cl
cvtsi2sd %rbx, %xmm0
movsd 0x68(%rsp), %xmm1
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl %r12d, %edx
callq 0x53d94
movq %rax, %r14
movq 0x5caea(%rip), %rdi     # 0xb1f88
leaq 0x369f0(%rip), %rsi     # 0x8be95
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5cacf(%rip), %rdi     # 0xb1f88
leaq 0x369d7(%rip), %rsi     # 0x8be97
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x556c2
movq 0x5caaf(%rip), %rdi     # 0xb1f88
leaq 0x3696d(%rip), %rsi     # 0x8be4d
callq 0x52450
movq %rax, %rdi
callq 0x52210
callq 0x53afc
movq %rax, %rbp
movq 0x5ca8c(%rip), %rdi     # 0xb1f88
leaq 0x36960(%rip), %rsi     # 0x8be63
callq 0x52450
movq %rax, %r14
movq %rbp, %rdi
callq 0x8447a
movq %r14, %rdi
movq %rax, %rsi
callq 0x52310
leaq 0x36950(%rip), %rsi     # 0x8be75
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x369c5(%rip), %rsi     # 0x8bf01
leaq 0x18(%rsp), %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x5564f
movq 0x5ca32(%rip), %rdi     # 0xb1f88
leaq 0x369ab(%rip), %rsi     # 0x8bf08
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x36990(%rip), %rsi     # 0x8bf01
leaq 0x18(%rsp), %rdi
callq 0x56e34
leaq 0x220(%rsp), %rdi
movq %rax, %rsi
callq 0x56f56
leaq 0x220(%rsp), %rdi
callq 0x83b50
movq %rax, %r14
leaq 0x220(%rsp), %rdi
callq 0x56fca
testq %r13, %r13
movl 0x14(%rsp), %eax
movl %eax, 0x8(%r14)
movl 0x10(%rsp), %eax
movl %eax, 0xc(%r14)
movl %r12d, 0x10(%r14)
setne 0x14(%r14)
movq %r14, %rdi
callq 0x83462
movsd 0x80(%r14), %xmm0
cvtsi2sd %rbx, %xmm1
ucomisd %xmm1, %xmm0
jne 0x555e2
jnp 0x5560e
movq 0x5c99f(%rip), %rdi     # 0xb1f88
leaq 0x3692c(%rip), %rsi     # 0x8bf1c
callq 0x52450
movsd 0x80(%r14), %xmm0
movq %rax, %rdi
callq 0x526e0
movq %rax, %rdi
callq 0x52210
movsd 0x88(%r14), %xmm0
ucomisd 0x68(%rsp), %xmm0
jne 0x55621
jnp 0x55675
movq 0x5c960(%rip), %rdi     # 0xb1f88
leaq 0x36916(%rip), %rsi     # 0x8bf45
callq 0x52450
movsd 0x88(%r14), %xmm0
movq %rax, %rdi
callq 0x526e0
movq %rax, %rdi
callq 0x52210
jmp 0x55675
xorl %ecx, %ecx
testq %r13, %r13
setne %cl
cvtsi2sd %rbx, %xmm0
movsd 0x68(%rsp), %xmm1
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl %r12d, %edx
callq 0x53d94
movq %rax, %r14
movq 0x5c90c(%rip), %rdi     # 0xb1f88
leaq 0x36812(%rip), %rsi     # 0x8be95
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq 0x5c8f1(%rip), %rdi     # 0xb1f88
leaq 0x367f9(%rip), %rsi     # 0x8be97
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x18(%rsp), %rdi
callq 0x56fca
leaq 0x268(%rsp), %rdi
callq 0x52100
movq 0x5c8bf(%rip), %rdi     # 0xb1f88
callq 0x52210
leaq 0x36894(%rip), %rsi     # 0x8bf69
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
xorl %ecx, %ecx
cmpq $0x0, 0x218(%rsp)
setne %cl
leaq 0x18(%rsp), %rdi
pushq $0x10
popq %rsi
movl $0x3e8, %edx            # imm = 0x3E8
callq 0x72050
callq 0x52070
movq %rax, %rbx
cmpl $0x1, %r15d
jne 0x5579b
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x7205a
callq 0x52070
movq %rax, %r15
movq 0x5c84a(%rip), %rdi     # 0xb1f88
leaq 0x36831(%rip), %rsi     # 0x8bf76
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x508(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x525e0
leaq 0x268(%rsp), %rdi
leaq 0x508(%rsp), %rsi
callq 0x735c4
leaq 0x508(%rsp), %rdi
callq 0x52888
leaq 0x268(%rsp), %rdi
callq 0x731be
jmp 0x55875
movl 0x8(%r14), %r12d
movl 0xc(%r14), %r13d
leaq 0x4e8(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x525e0
xorl %eax, %eax
cmpq $0x0, 0x78(%rsp)
setne %al
movl %eax, (%rsp)
leaq 0x268(%rsp), %rdi
leaq 0x4e8(%rsp), %r9
movl %r12d, %esi
movl %r13d, %edx
movl %r15d, %ecx
movl 0x3c(%rsp), %r8d
callq 0x72544
leaq 0x4e8(%rsp), %rdi
callq 0x52888
leaq 0x18(%rsp), %rdi
leaq 0x268(%rsp), %rcx
movq %rbp, %rsi
movq %r14, %rdx
callq 0x7215e
callq 0x52070
movq %rax, %r15
movq 0x5c76b(%rip), %rdi     # 0xb1f88
leaq 0x36764(%rip), %rsi     # 0x8bf88
callq 0x52450
movq %rax, %rdi
callq 0x52210
leaq 0x4c8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x525e0
leaq 0x268(%rsp), %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x72a78
leaq 0x4c8(%rsp), %rdi
callq 0x52888
leaq 0x268(%rsp), %rdi
callq 0x7288c
movq 0x5c70c(%rip), %rdi     # 0xb1f88
leaq 0x36716(%rip), %rsi     # 0x8bf99
callq 0x52450
movq %rax, %rdi
subq %rbx, %r15
movl $0xf4240, %ecx          # imm = 0xF4240
movq %r15, %rax
cqto
idivq %rcx
cvtsi2sd %rax, %xmm0
divsd 0x357c0(%rip), %xmm0    # 0x8b068
callq 0x526e0
leaq 0x366fb(%rip), %rsi     # 0x8bfaf
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq (%rbp), %rax
movq %rbp, %rdi
callq *0x8(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq 0x5c6aa(%rip), %rdi     # 0xb1f88
callq 0x52210
leaq 0x366ce(%rip), %rsi     # 0x8bfb8
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
movq %rax, %rdi
callq 0x52210
leaq 0x528(%rsp), %rdi
callq 0x56fe4
leaq 0xae8(%rsp), %rdi
callq 0x5701c
leaq 0x248(%rsp), %rdi
callq 0x52888
leaq 0xa0(%rsp), %rdi
callq 0x52888
leaq 0x80(%rsp), %rdi
callq 0x52888
xorl %eax, %eax
addq $0xc08, %rsp            # imm = 0xC08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5c682(%rip), %rdi     # 0xb1fe0
leaq 0x36547(%rip), %rsi     # 0x8beac
callq 0x52450
movq %rax, %rbx
callq 0x52060
movl (%rax), %esi
leaq 0x18(%rsp), %rdi
callq 0x88570
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x52400
movq %rax, %rdi
callq 0x52210
leaq 0x18(%rsp), %rdi
callq 0x52888
jmp 0x55ab6
movq 0x5c637(%rip), %rdi     # 0xb1fe0
leaq 0x36512(%rip), %rsi     # 0x8bec2
callq 0x52450
leaq 0xa0(%rsp), %rsi
movq %rax, %rdi
callq 0x52400
leaq 0x36505(%rip), %rsi     # 0x8bed1
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x52888
jmp 0x564ec
jmp 0x559f5
movq %rax, %r14
jmp 0x564ec
movq %rax, %r14
leaq 0x220(%rsp), %rdi
callq 0x56fca
jmp 0x564e2
movq %rdx, %rbx
movq %rax, %r14
leaq 0x230(%rsp), %rdi
callq 0x56fca
jmp 0x55a85
movq %rax, %r14
leaq 0x4c8(%rsp), %rdi
callq 0x52888
jmp 0x560e8
movq %rax, %r14
leaq 0x508(%rsp), %rdi
callq 0x52888
jmp 0x560ba
movq %rax, %r14
leaq 0x4e8(%rsp), %rdi
jmp 0x560db
jmp 0x564fb
jmp 0x564fb
jmp 0x564fb
jmp 0x564fb
jmp 0x564fb
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
cmpl $0x3, %ebx
jne 0x564e2
movq %r14, %rdi
callq 0x521b0
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x5c53a(%rip), %rdi     # 0xb1fe0
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
pushq $-0x1
popq %rdi
callq 0x52550
movq %rax, %r14
callq 0x52720
jmp 0x564e2
jmp 0x564fb
jmp 0x560d0
jmp 0x564fb
jmp 0x560d0
jmp 0x564fb
jmp 0x560d0
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
jmp 0x5610d
movq %rdx, %rbx
movq %rax, %r14
jmp 0x561a2
movq %rdx, %rbx
movq %rax, %r14
jmp 0x5622d
movq %rdx, %rbx
movq %rax, %r14
jmp 0x562bb
movq %rdx, %rbx
movq %rax, %r14
jmp 0x56345
movq %rdx, %rbx
movq %rax, %r14
jmp 0x563d2
movq %rdx, %rbx
movq %rax, %r14
jmp 0x56461
jmp 0x560d0
jmp 0x564fb
jmp 0x560d0
jmp 0x564fb
jmp 0x560d0
jmp 0x564fb
movq %rax, %r14
jmp 0x5650b
movq %rax, %rbx
leaq 0x5e8(%rsp), %rdi
callq 0x52888
jmp 0x55b76
movq %rax, %rbx
movq %rbp, %rdi
callq 0x572b8
movq %r13, %rdi
callq 0x572b8
jmp 0x55b8b
movq %rax, %rbx
leaq 0x608(%rsp), %rdi
callq 0x52888
jmp 0x55ba0
movq %rbp, %r14
movq %rax, %rbx
leaq 0x628(%rsp), %rdi
callq 0x52888
jmp 0x55bb7
jmp 0x55bb1
movq %rbp, %r14
movq %rax, %rbx
leaq 0x648(%rsp), %rdi
callq 0x52888
leaq 0xc8(%rsp), %rdi
callq 0x572b8
movq %r15, %rdi
callq 0x572b8
leaq 0x668(%rsp), %rdi
callq 0x52888
leaq 0x688(%rsp), %rdi
callq 0x52888
leaq 0x6a8(%rsp), %rdi
callq 0x52888
leaq 0xd8(%rsp), %rdi
callq 0x572b8
movq %r14, %rdi
callq 0x572b8
leaq 0x6c8(%rsp), %rdi
callq 0x52888
leaq 0x6e8(%rsp), %rdi
callq 0x52888
leaq 0x708(%rsp), %rdi
callq 0x52888
leaq 0xe8(%rsp), %rdi
callq 0x572b8
movq %r12, %rdi
callq 0x572b8
leaq 0x728(%rsp), %rdi
callq 0x52888
leaq 0x748(%rsp), %rdi
callq 0x52888
leaq 0x768(%rsp), %rdi
callq 0x52888
leaq 0x108(%rsp), %rdi
callq 0x572b8
leaq 0xf8(%rsp), %rdi
callq 0x572b8
leaq 0x788(%rsp), %rdi
callq 0x52888
leaq 0x7a8(%rsp), %rdi
callq 0x52888
leaq 0x7c8(%rsp), %rdi
callq 0x52888
leaq 0x128(%rsp), %rdi
callq 0x572b8
leaq 0x118(%rsp), %rdi
callq 0x572b8
leaq 0x7e8(%rsp), %rdi
callq 0x52888
leaq 0x808(%rsp), %rdi
callq 0x52888
leaq 0x828(%rsp), %rdi
callq 0x52888
leaq 0x148(%rsp), %rdi
callq 0x572b8
leaq 0x138(%rsp), %rdi
callq 0x572b8
leaq 0x848(%rsp), %rdi
callq 0x52888
leaq 0x868(%rsp), %rdi
callq 0x52888
leaq 0x888(%rsp), %rdi
callq 0x52888
leaq 0x168(%rsp), %rdi
callq 0x572b8
leaq 0x158(%rsp), %rdi
callq 0x572b8
leaq 0x8a8(%rsp), %rdi
callq 0x52888
leaq 0x8c8(%rsp), %rdi
callq 0x52888
leaq 0x8e8(%rsp), %rdi
callq 0x52888
leaq 0x188(%rsp), %rdi
callq 0x572b8
leaq 0x178(%rsp), %rdi
callq 0x572b8
leaq 0x908(%rsp), %rdi
callq 0x52888
leaq 0x928(%rsp), %rdi
callq 0x52888
leaq 0x948(%rsp), %rdi
callq 0x52888
leaq 0x1a8(%rsp), %rdi
callq 0x572b8
leaq 0x198(%rsp), %rdi
callq 0x572b8
leaq 0x968(%rsp), %rdi
callq 0x52888
leaq 0x988(%rsp), %rdi
callq 0x52888
leaq 0x9a8(%rsp), %rdi
callq 0x52888
leaq 0x1c8(%rsp), %rdi
callq 0x572b8
leaq 0x1b8(%rsp), %rdi
callq 0x572b8
leaq 0x9c8(%rsp), %rdi
callq 0x52888
leaq 0x9e8(%rsp), %rdi
callq 0x52888
leaq 0xa08(%rsp), %rdi
callq 0x52888
leaq 0x1e8(%rsp), %rdi
callq 0x572b8
leaq 0x1d8(%rsp), %rdi
callq 0x572b8
leaq 0xa28(%rsp), %rdi
callq 0x52888
leaq 0xa48(%rsp), %rdi
callq 0x52888
leaq 0xa68(%rsp), %rdi
callq 0x52888
leaq 0x208(%rsp), %rdi
callq 0x572b8
leaq 0x1f8(%rsp), %rdi
callq 0x572b8
leaq 0x18(%rsp), %rdi
callq 0x52888
leaq 0x528(%rsp), %rdi
callq 0x52888
leaq 0x270(%rsp), %rdi
callq 0x52888
leaq 0xa88(%rsp), %rdi
callq 0x52888
movq %rbx, %r14
jmp 0x5650b
movq %rbp, %r14
movq %rax, %rbx
jmp 0x55bc4
movq %rbp, %r14
movq %rax, %rbx
jmp 0x55bd9
movq %rbp, %r14
movq %rax, %rbx
jmp 0x55be6
jmp 0x55ef6
movq %rbp, %r14
movq %rax, %rbx
jmp 0x55bf3
movq %rbp, %r14
movq %rax, %rbx
jmp 0x55c00
movq %rax, %rbx
jmp 0x55c15
movq %rax, %rbx
jmp 0x55c22
jmp 0x55f1e
movq %rax, %rbx
jmp 0x55c2f
movq %rax, %rbx
jmp 0x55c3c
movq %rax, %rbx
jmp 0x55c51
movq %rax, %rbx
jmp 0x55c5e
jmp 0x55f40
movq %rax, %rbx
jmp 0x55c6b
movq %rax, %rbx
jmp 0x55c78
movq %rax, %rbx
jmp 0x55c92
movq %rax, %rbx
jmp 0x55c9f
jmp 0x55f62
movq %rax, %rbx
jmp 0x55cac
movq %rax, %rbx
jmp 0x55cb9
movq %rax, %rbx
jmp 0x55cd3
movq %rax, %rbx
jmp 0x55ce0
jmp 0x55f84
movq %rax, %rbx
jmp 0x55ced
movq %rax, %rbx
jmp 0x55cfa
movq %rax, %rbx
jmp 0x55d14
movq %rax, %rbx
jmp 0x55d21
jmp 0x55fa6
movq %rax, %rbx
jmp 0x55d2e
movq %rax, %rbx
jmp 0x55d3b
movq %rax, %rbx
jmp 0x55d55
movq %rax, %rbx
jmp 0x55d62
jmp 0x55fc8
movq %rax, %rbx
jmp 0x55d6f
movq %rax, %rbx
jmp 0x55d7c
movq %rax, %rbx
jmp 0x55d96
movq %rax, %rbx
jmp 0x55da3
jmp 0x55fea
movq %rax, %rbx
jmp 0x55db0
movq %rax, %rbx
jmp 0x55dbd
movq %rax, %rbx
jmp 0x55dd7
movq %rax, %rbx
jmp 0x55de4
jmp 0x5600c
movq %rax, %rbx
jmp 0x55df1
movq %rax, %rbx
jmp 0x55dfe
movq %rax, %rbx
jmp 0x55e18
movq %rax, %rbx
jmp 0x55e25
jmp 0x5602e
movq %rax, %rbx
jmp 0x55e32
movq %rax, %rbx
jmp 0x55e3f
movq %rax, %rbx
jmp 0x55e59
movq %rax, %rbx
jmp 0x55e66
jmp 0x56050
movq %rax, %rbx
jmp 0x55e73
movq %rax, %rbx
jmp 0x55e80
movq %rax, %rbx
jmp 0x55e9a
movq %rax, %rbx
jmp 0x55ea4
movq %rax, %rbx
jmp 0x55eb1
movq %rax, %rbx
jmp 0x55ebe
movq %rax, %rbx
jmp 0x55ecb
movq %rax, %r14
leaq 0xaa8(%rsp), %rdi
callq 0x52888
jmp 0x5609d
movq %rax, %r14
leaq 0xac8(%rsp), %rdi
callq 0x52888
jmp 0x56518
movq %rax, %r14
jmp 0x56518
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x731be
jmp 0x564fe
jmp 0x560d0
jmp 0x560d0
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
jmp 0x564fe
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x7288c
jmp 0x564fe
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x56132
movq %r14, %rdi
callq 0x521b0
callq 0x52720
movsd 0x34ee9(%rip), %xmm0    # 0x8b010
movsd %xmm0, 0x68(%rsp)
jmp 0x54f4e
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5be93(%rip), %rdi     # 0xb1fe0
leaq 0x35b7d(%rip), %rsi     # 0x8bcd1
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x561bd
movq %r14, %rdi
callq 0x521b0
callq 0x52720
pushq $0x1
popq %r15
jmp 0x54f01
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5be08(%rip), %rdi     # 0xb1fe0
leaq 0x35acf(%rip), %rsi     # 0x8bcae
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x5624b
movq %r14, %rdi
callq 0x521b0
callq 0x52720
pushq $0x1e
popq %rax
movl %eax, 0x3c(%rsp)
jmp 0x54ebb
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5bd7a(%rip), %rdi     # 0xb1fe0
leaq 0x35a25(%rip), %rsi     # 0x8bc92
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x562d5
movq %r14, %rdi
callq 0x521b0
callq 0x52720
pushq $0x5a
popq %rbp
jmp 0x54e72
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5bcf0(%rip), %rdi     # 0xb1fe0
leaq 0x3597b(%rip), %rsi     # 0x8bc72
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x56362
movq %r14, %rdi
callq 0x521b0
movl $0x1f4, %r12d           # imm = 0x1F4
callq 0x52720
jmp 0x54e2d
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5bc63(%rip), %rdi     # 0xb1fe0
leaq 0x358cd(%rip), %rsi     # 0x8bc51
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x563f1
movq %r14, %rdi
callq 0x521b0
movl $0x1f4, 0x10(%rsp)      # imm = 0x1F4
callq 0x52720
jmp 0x54de7
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5bbd4(%rip), %rdi     # 0xb1fe0
leaq 0x3581f(%rip), %rsi     # 0x8bc32
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rdx, %rbx
movq %rax, %r14
leaq 0x268(%rsp), %rdi
callq 0x52888
cmpl $0x2, %ebx
jne 0x56480
movq %r14, %rdi
callq 0x521b0
movl $0x3e8, 0x14(%rsp)      # imm = 0x3E8
callq 0x52720
jmp 0x54d9e
cmpl $0x1, %ebx
jne 0x564fe
movq %r14, %rdi
callq 0x521b0
movq %rax, %rbx
movq 0x5bb49(%rip), %rdi     # 0xb1fe0
leaq 0x35776(%rip), %rsi     # 0x8bc14
callq 0x52450
movq %rax, %r14
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq %r14, %rdi
movq %rax, %rsi
callq 0x52450
movq %rax, %rdi
callq 0x52210
jmp 0x55ab6
movq %rax, %r14
callq 0x52720
jmp 0x564fe
jmp 0x564fb
movq %rax, %rdi
callq 0x56ca4
jmp 0x564fb
jmp 0x564fb
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x56fca
leaq 0x268(%rsp), %rdi
callq 0x52100
jmp 0x564fe
movq %rax, %r14
leaq 0x528(%rsp), %rdi
callq 0x56fe4
leaq 0xae8(%rsp), %rdi
callq 0x5701c
leaq 0x248(%rsp), %rdi
callq 0x52888
leaq 0xa0(%rsp), %rdi
callq 0x52888
leaq 0x80(%rsp), %rdi
callq 0x52888
movq %r14, %rdi
callq 0x527a0
nop