// File: /workspace/github_cpp_makefile_star2_O2/Cell-veto[P]postlhc/main.cpp
// Function: main
int main (int, const char **argv)
{
    buffer_cerr ();
    AbstractStorage *stor = 0;
    AbstractChainRunner *cr = 0;
    AbstractCorrelator *gofr = 0;

    string inter, prefix = "out/";
    string in_prefix;
    bool probe_test = false;
    bool skip_calib = false;
    bool recover = false;
    bool redirect_log = false;
    bool write_gofr = false;
    double snap_disp = 100;
    unsigned long random_seed = 42;
    unsigned long snap_target = 100000;
    long recover_from = -1;
    bool dont_optimize_sr_lr_split = false;

    // parse command line, initializing our tools along the way
    for (++argv; *argv; argv += 2)
    {
        string kw = *argv;

        if (kw == "load")
        {
            in_prefix = read_arg <string> (argv);
            in_prefix += '/';
        }
        else if (kw == "addprefix")
        {
            prefix += boost::str (format ("%s/") % read_arg <string> (argv));
        }
        else if (kw == "setprefix")
        {
            prefix = read_arg <string> (argv);
        }
        else if (kw == "log")
        {
            redirect_log = true;
            --argv; // no argument
        }
        else if (kw == "seed")
        {
            random_seed = read_arg <unsigned long> (argv);
        }
        else if (kw == "snap")
        {
            snap_target = read_arg <unsigned long> (argv);
        }
        else if (kw == "snap_disp")
        {
            snap_disp = read_arg <double> (argv);
        }
        else if (kw == "recover")
        {
            recover = true;
            --argv; // no argument
        }
        else if (kw == "recover_from")
        {
            recover_from = static_cast <long> (read_arg <unsigned long> (argv));
            recover = true;
        }
        else if (kw == "skip_calib")
        {
            skip_calib = true;
            --argv; // no argument
        }
        else if (kw == "probe_test")
        {
            probe_test = true;
            --argv; // no argument
        }
        else if (!stor)
        {
            // create storage
            if (kw == "stor")
                stor = make_storage (read_arg <string> (argv));
            else
                rt_error ("First set storage mechanism with keyword stor");

            prefix += boost::str (format ("%s/") % read_arg <string> (argv));
        }
        else if (kw == "gofr")
        {
            // we will write a density/density pair correlator
            write_gofr = true;
            --argv; // no argument
        }
        else if (!cr)
        {
            // as soon as we encounter 'inter', instantiate the ECMC algorithm
            if (kw == "inter")
            {
                inter = read_arg <string> (argv);
                cr = make_chainrunner (inter, stor);
                prefix += inter + '/';
            }
            else
                rt_error ("First set interaction type with keyword inter");
        }
        else if (kw == "sr_lr_split")
        {
            // we don't want a subdirectory for this parameter.
            double value = read_arg <double> (argv);
            cr->set_parameter (kw, value);
            dont_optimize_sr_lr_split = true;
        }
        else
        {
            // unrecognized argument -- assume it's an interaction parameter
            double value = read_arg <double> (argv);
            prefix += boost::str (format ("%s%f/") % kw % value);
            std::cerr << "inter_param " << kw << " " << value << "\n";
            cr->set_parameter (kw, value);
        }
    }

    if (!stor)
        rt_error ("Missing stor");
    if (!cr)
        rt_error ("Missing inter");
    if (in_prefix == "")
        rt_error ("Missing load");

    // make the output directory
    shell ("mkdir -p " + prefix);

    prefix += boost::str (format ("seed%lu_") % random_seed);

    // redirect std::cerr to logfile
    // (append if recovering)
    if (redirect_log)
        redirect_cerr (prefix + "log", recover);
    else
        dont_redirect_cerr ();

    std::cerr << "hostname " << hostname () << '\n';

    // load data
    stor->load_periods (in_prefix + "periods");
    unsigned snap = 0;
    string in_filename = in_prefix + "coords.dat";
    if (recover_from != -1)
    {
        // check if final snapshot exists already
        if (file_is_readable (format_out (prefix, snap_target)))
        {
            std::cerr << "recover: the final target snapshot already exists.  exiting.\n";
            return 0;
        }

        if (file_is_readable (format_out (prefix, recover_from)))
        {
            snap = recover_from + 1u;
            std::cerr << "recover: attempting to load snapshot " << (snap-1u) << "\n";
            in_filename = format_out (prefix, snap-1u);
        }
        else
        {
            std::cerr << "recover snapshot not found; aborting\n";
            return -1;
        }
    }
    else if (recover)
    {
        // check if final snapshot exists already
        if (file_is_readable (format_out (prefix, snap_target)))
        {
            std::cerr << "recover: the final target snapshot already exists.  exiting.\n";
            return 0;
        }

        // find the first snapshot which is _not_ on disk
        if (file_is_readable (format_out (prefix, 0)))
        {
            // bisection-style algorithm
            // loop invariant is: low is present, high is missing
            unsigned low = 0, high = snap_target;
            while (high - low > 1)
            {
                unsigned mid = (low+high) / 2;
                std::cerr << "recover: checking " << low << " "
                    << mid << " " << high << "\n";
                if (file_is_readable (format_out (prefix, mid)))
                    low = mid;
                else
                    high = mid;
            }

            snap = high;
            std::cerr << "recover: attempting to load snapshot " << (snap-1u) << "\n";
            in_filename = format_out (prefix, snap-1u);
        }
        else
        {
            std::cerr << "recover: no snapshots found, starting clean slate\n";
        }
    }
    stor->add_data (in_filename);
    stor->dump_statistics (std::cerr);

    if (write_gofr)
        gofr = make_correlator ("density", stor, 0.01, 0.);

    if (!recover)
    {
        stor->periods ().savetxt (prefix + "periods");
        stor->save_data (prefix + "init-coords.dat");
    }

    // init chainrunner
    std::cerr << "inter " << inter << '\n';
    cr->seed_random (random_seed);

    if (probe_test)
    {
        cr->probe_test_pattern (stor);
        return 0;
    }

    if (inter == "lj" && !dont_optimize_sr_lr_split)
    {
        cr->optimize_sr_lr_split (stor);
    }

    if (!skip_calib)
    {
        cr->calibrate (stor);
    }

    // warm-up
    cr->collide (stor, 1.);
    cr->dump_statistics (std::cerr);
    unsigned jmany = 1, gofr_samples = 1;
    for (; snap != snap_target; ++snap)
    {
    redo_snap:
        for (unsigned j = 0; !sigterm_caught () && j != jmany; ++j)
        {
            cr->collide (stor, 1.);
            if (gofr) gofr->sample (stor, gofr_samples);
        }

        stor->dump_statistics (std::cerr);
        cr->dump_statistics (std::cerr);
        cr->save_histograms (prefix);
        if (gofr) gofr->savetxt (format_out (prefix, snap, "gofr"));
        stor->save_data (format_out (prefix, snap));

        if (sigterm_caught ())
        {
            std::cerr << "exit caught SIGTERM, exiting\n";
            return 1;
        }

        if (jmany == 1)
        {
            // now for real
            jmany = snap_disp;
            gofr_samples = 1000;
            goto redo_snap;
        }
    }

    std::cerr << "exit number of snapshots reached\n";
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rsi, %r13
callq 0x434fa0
leaq 0x108(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1b9290(%rip), %rsi    # 0x5be13c
leaq 0x68(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x406046
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq $0x2a, 0xb8(%rsp)
addq $0x8, %r13
pushq $-0x1
popq %rax
movq %rax, 0x58(%rsp)
movl $0x186a0, %eax          # imm = 0x186A0
movq %rax, 0x60(%rsp)
movsd 0x1b910c(%rip), %xmm0   # 0x5be008
movsd %xmm0, 0x90(%rsp)
xorl %r14d, %r14d
leaq 0x10(%rsp), %rbp
leaq 0x118(%rsp), %rbx
xorl %r15d, %r15d
movq $0x0, 0x88(%rsp)
movq $0x0, 0xc8(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc0(%rsp)
movq (%r13), %rsi
testq %rsi, %rsi
je 0x4053c9
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x406046
movq %rbp, %rdi
leaq 0x1b92be(%rip), %rsi    # 0x5be23a
callq 0x406081
testb %al, %al
je 0x404fbb
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4351a9
leaq 0xd8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4b4c40
movq %rbx, %rdi
callq 0x4b4bf0
movq %r12, %rdi
pushq $0x2f
popq %rsi
callq 0x4b5280
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b917c(%rip), %rsi    # 0x5be141
callq 0x406081
testb %al, %al
je 0x40503a
movq %rbx, %rdi
leaq 0x1b9173(%rip), %rsi    # 0x5be14b
callq 0x40608e
leaq 0x98(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x4351a9
movq %rbx, %rdi
movq %r12, %rsi
callq 0x408c25
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x4099f8
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x4b6300
movq %r12, %rdi
callq 0x4b4bf0
leaq 0x98(%rsp), %rdi
callq 0x4b4bf0
movq %rbx, %rdi
callq 0x406170
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b910b(%rip), %rsi    # 0x5be14f
callq 0x406081
testb %al, %al
je 0x405072
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4351a9
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b4c40
movq %rbx, %rdi
callq 0x4b4bf0
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b90dd(%rip), %rsi    # 0x5be159
callq 0x406081
testb %al, %al
je 0x405095
addq $-0x8, %r13
movb $0x1, %al
movq %rax, 0x8(%rsp)
jmp 0x405145
movq %rbp, %rdi
leaq 0x1c3579(%rip), %rsi    # 0x5c8618
callq 0x406081
testb %al, %al
je 0x4050bd
movq %r13, %rdi
callq 0x435308
movq %rax, 0xb8(%rsp)
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b9096(%rip), %rsi    # 0x5be15d
callq 0x406081
testb %al, %al
je 0x4050df
movq %r13, %rdi
callq 0x435308
movq %rax, 0x60(%rsp)
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b9079(%rip), %rsi    # 0x5be162
callq 0x406081
testb %al, %al
je 0x405105
movq %r13, %rdi
callq 0x43545d
movsd %xmm0, 0x90(%rsp)
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b905d(%rip), %rsi    # 0x5be16c
callq 0x406081
testb %al, %al
je 0x40511e
addq $-0x8, %r13
jmp 0x40513e
movq %rbp, %rdi
leaq 0x1b904c(%rip), %rsi    # 0x5be174
callq 0x406081
testb %al, %al
je 0x405156
movq %r13, %rdi
callq 0x435308
movq %rax, 0x58(%rsp)
movb $0x1, %al
movq %rax, 0x50(%rsp)
movq %rbp, %rdi
callq 0x4b4bf0
addq $0x10, %r13
jmp 0x404f5a
movq %rbp, %rdi
leaq 0x1b9021(%rip), %rsi    # 0x5be181
callq 0x406081
testb %al, %al
je 0x405179
addq $-0x8, %r13
movb $0x1, %al
movq %rax, 0xc8(%rsp)
jmp 0x405145
movq %rbp, %rdi
leaq 0x1b9009(%rip), %rsi    # 0x5be18c
callq 0x406081
testb %al, %al
je 0x40519c
addq $-0x8, %r13
movb $0x1, %al
movq %rax, 0x88(%rsp)
jmp 0x405145
movq %rbp, %rdi
testq %r14, %r14
je 0x4051cb
leaq 0x1b901a(%rip), %rsi    # 0x5be1c5
callq 0x406081
testb %al, %al
je 0x40524c
addq $-0x8, %r13
movb $0x1, %al
movq %rax, 0xd0(%rsp)
jmp 0x405145
leaq 0x1b8fee(%rip), %rsi    # 0x5be1c0
callq 0x406081
testb %al, %al
je 0x405d36
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4351a9
movq %rbx, %rdi
callq 0x42f63a
movq %rax, %r14
movq %rbx, %rdi
callq 0x4b4bf0
movq %rbx, %rdi
leaq 0x1b8f44(%rip), %rsi    # 0x5be14b
callq 0x40608e
leaq 0x98(%rsp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x4351a9
movq %rbx, %rdi
movq %r12, %rsi
callq 0x408c25
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x4099f8
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x4b6300
jmp 0x405018
movq %rbp, %rdi
testq %r15, %r15
je 0x40528b
leaq 0x1b8f9d(%rip), %rsi    # 0x5be1f8
callq 0x406081
testb %al, %al
je 0x4052f8
movq %r13, %rdi
callq 0x43545d
movq (%r15), %rax
movb $0x1, %cl
movq %rcx, 0xc0(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq *0x18(%rax)
jmp 0x405145
leaq 0x1b8f60(%rip), %rsi    # 0x5be1f2
callq 0x406081
testb %al, %al
je 0x405d5c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4351a9
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4b4c40
movq %rbx, %rdi
callq 0x4b4bf0
movq %r15, %rdi
movq %r14, %rsi
callq 0x42f67c
movq %rax, %r15
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
pushq $0x2f
popq %rdx
callq 0x4061a4
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x4b6300
jmp 0x405065
movq %r13, %rdi
callq 0x43545d
movsd %xmm0, 0x98(%rsp)
movq %rbx, %rdi
leaq 0x1b8ef1(%rip), %rsi    # 0x5be204
callq 0x40608e
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x409dc0
movq %rax, %rdi
leaq 0x98(%rsp), %rsi
callq 0x409df3
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x4099f8
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
callq 0x4b6300
movq %r12, %rdi
callq 0x4b4bf0
movq %rbx, %rdi
callq 0x406170
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8e9a(%rip), %rsi    # 0x5be20a
callq 0x4a4910
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4b7440
movq %rax, %rdi
leaq 0x1c0523(%rip), %rsi    # 0x5c58ad
callq 0x4a4910
movsd 0x98(%rsp), %xmm0
movq %rax, %rdi
callq 0x4a5640
movq %rax, %rdi
leaq 0x1cb060(%rip), %rsi    # 0x5d040a
callq 0x4a4910
movsd 0x98(%rsp), %xmm0
movq (%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
callq *0x18(%rax)
jmp 0x405145
testq %r14, %r14
je 0x405cc4
testq %r15, %r15
je 0x405cea
leaq 0x1e2490(%rip), %rsi    # 0x5e7872
leaq 0xd8(%rsp), %rdi
callq 0x406081
testb %al, %al
jne 0x405d10
leaq 0x1b8e41(%rip), %rsi    # 0x5be23f
leaq 0x118(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x4061da
leaq 0x118(%rsp), %rdi
callq 0x434d09
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
leaq 0x1b8e18(%rip), %rsi    # 0x5be249
leaq 0x118(%rsp), %rdi
callq 0x40608e
leaq 0x118(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x409e2f
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x4099f8
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4b6300
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x118(%rsp), %rdi
callq 0x406170
testb $0x1, 0x8(%rsp)
je 0x4054ca
leaq 0x1b8cc5(%rip), %rdx    # 0x5be159
leaq 0x118(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x406250
movzbl 0x50(%rsp), %esi
andl $0x1, %esi
leaq 0x118(%rsp), %rdi
callq 0x434fe5
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
jmp 0x4054cf
callq 0x4350e8
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8d75(%rip), %rsi    # 0x5be252
callq 0x4a4910
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x434ef1
leaq 0x118(%rsp), %rsi
movq %rbx, %rdi
callq 0x4b7440
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x4a4840
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
leaq 0x1b8d3b(%rip), %rdx    # 0x5be25c
leaq 0x118(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x406250
leaq 0x118(%rsp), %rsi
movq %r14, %rdi
callq 0x42f5fc
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
leaq 0x1b8dee(%rip), %rdx    # 0x5be348
leaq 0x118(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x406250
cmpq $-0x1, 0x58(%rsp)
movq %r14, 0x8(%rsp)
je 0x40569f
leaq 0x1b8cdd(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movq 0x60(%rsp), %rdx
callq 0x405f9e
leaq 0x10(%rsp), %rdi
callq 0x434da1
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
testb %bl, %bl
jne 0x405700
leaq 0x1b8c83(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rdx
callq 0x405f9e
leaq 0x10(%rsp), %rdi
callq 0x434da1
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
testb %bl, %bl
je 0x40571a
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8c67(%rip), %rsi    # 0x5be2a9
callq 0x4a4910
movl 0x58(%rsp), %esi
movq %rax, %rdi
callq 0x4a4ce0
leaq 0x1cadb0(%rip), %rsi    # 0x5d040a
movq %rax, %rdi
callq 0x4a4910
leaq 0x1b8bfb(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movq 0x58(%rsp), %rbx
movl %ebx, %edx
callq 0x405f9e
leal 0x1(%rbx), %r14d
jmp 0x4058eb
testb $0x1, 0x50(%rsp)
je 0x405883
leaq 0x1b8bb3(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movq 0x60(%rsp), %rdx
callq 0x405f9e
leaq 0x10(%rsp), %rdi
callq 0x434da1
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
testb %bl, %bl
je 0x405734
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8b5d(%rip), %rsi    # 0x5be26b
callq 0x4a4910
xorl %ebx, %ebx
jmp 0x405c67
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8ba7(%rip), %rsi    # 0x5be2cf
callq 0x4a4910
pushq $-0x1
jmp 0x405c66
leaq 0x1b8b29(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
xorl %edx, %edx
callq 0x405f9e
leaq 0x10(%rsp), %rdi
callq 0x434da1
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
testb %bl, %bl
je 0x405870
xorl %r12d, %r12d
movq 0x60(%rsp), %rax
movl %eax, %r14d
movl %r14d, %eax
subl %r12d, %eax
cmpl $0x2, %eax
jb 0x40588b
movq %r14, %rbx
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8b3f(%rip), %rsi    # 0x5be2f5
callq 0x4a4910
movl %r12d, %esi
movq %rax, %rdi
callq 0x4a4ce0
movq %rax, %rdi
leaq 0x1c00dd(%rip), %rsi    # 0x5c58ad
callq 0x4a4910
leal (%rbx,%r12), %ebp
shrl %ebp
movl %ebp, %esi
movq %rax, %rdi
callq 0x4a4ce0
movq %rax, %rdi
leaq 0x1c00be(%rip), %rsi    # 0x5c58ad
callq 0x4a4910
movl %ebx, %esi
movq %rax, %rdi
callq 0x4a4ce0
movq %rax, %rdi
leaq 0x1cac02(%rip), %rsi    # 0x5d040a
callq 0x4a4910
leaq 0x30(%rsp), %r14
movq %r14, %rdi
leaq 0x1b8a48(%rip), %rsi    # 0x5be264
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x68(%rsp), %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x405f9e
movq %r13, %rdi
callq 0x434da1
movq %r13, %rdi
movl %eax, %r13d
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
testb %r13b, %r13b
cmovnel %ebp, %r12d
movq %rbx, %r14
cmovel %ebp, %r14d
jmp 0x405796
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8a8a(%rip), %rsi    # 0x5be308
callq 0x4a4910
xorl %r14d, %r14d
jmp 0x405912
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b8a10(%rip), %rsi    # 0x5be2a9
callq 0x4a4910
leal -0x1(%r14), %ebx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4a4ce0
leaq 0x1cab56(%rip), %rsi    # 0x5d040a
movq %rax, %rdi
callq 0x4a4910
leaq 0x1b89a1(%rip), %rsi    # 0x5be264
leaq 0x30(%rsp), %rdi
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movl %ebx, %edx
callq 0x405f9e
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x4b4c40
movq %rbx, %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
leaq 0x118(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x42f626
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
movq $0x64eaa0, %rsi         # imm = 0x64EAA0
callq *0x18(%rax)
testb $0x1, 0xd0(%rsp)
je 0x40597f
leaq 0x1b89f4(%rip), %rsi    # 0x5be33b
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rdi
movsd 0x1b86ad(%rip), %xmm0   # 0x5be010
xorps %xmm1, %xmm1
movq 0x8(%rsp), %rsi
callq 0x432a55
movq %rax, %r12
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
jmp 0x405982
xorl %r12d, %r12d
testb $0x1, 0x50(%rsp)
jne 0x4059f7
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
leaq 0x30(%rsp), %rdi
callq *0x28(%rax)
leaq 0x1b88bc(%rip), %rdx    # 0x5be25c
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x406250
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4311d6
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x1b8974(%rip), %rdx    # 0x5be343
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x406250
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x42f62c
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b894e(%rip), %rsi    # 0x5be353
callq 0x4a4910
leaq 0xf8(%rsp), %rsi
movq %rax, %rdi
callq 0x4b7440
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x4a4840
movl 0xb8(%rsp), %esi
movq (%r15), %rax
movq %r15, %rdi
callq *0x10(%rax)
testb $0x1, 0x88(%rsp)
je 0x405a56
movq (%r15), %rax
xorl %ebx, %ebx
movq %r15, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq *0x50(%rax)
jmp 0x405c67
leaq 0x1b88fd(%rip), %rsi    # 0x5be35a
leaq 0xf8(%rsp), %rdi
callq 0x406081
notb %al
orb 0xc0(%rsp), %al
testb $0x1, %al
jne 0x405a85
movq (%r15), %rax
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq *0x38(%rax)
testb $0x1, 0xc8(%rsp)
jne 0x405a9d
movq (%r15), %rax
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq *0x40(%rax)
movq (%r15), %rax
movsd 0x1b8570(%rip), %xmm0   # 0x5be018
movq %r15, %rdi
movq 0x8(%rsp), %rsi
callq *0x48(%rax)
movq (%r15), %rax
movq $0x64eaa0, %rsi         # imm = 0x64EAA0
movq %r15, %rdi
callq *0x28(%rax)
cvttsd2si 0x90(%rsp), %rax
movq %rax, 0x88(%rsp)
pushq $0x1
popq %rax
movq $0x64eaa0, %rbx         # imm = 0x64EAA0
movl %eax, %ecx
movl %r14d, %edx
cmpq %rdx, 0x60(%rsp)
je 0x405cac
movq %r14, 0x50(%rsp)
movq %rbx, %r13
movl %eax, %ebx
movl %ecx, 0x90(%rsp)
movl %ecx, %ebp
movl %eax, 0x58(%rsp)
movq 0x8(%rsp), %r14
callq 0x434ccf
subl $0x1, %ebx
setb %cl
orb %cl, %al
testb $0x1, %al
jne 0x405b47
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rsi
movsd 0x1b84eb(%rip), %xmm0   # 0x5be018
callq *0x48(%rax)
testq %r12, %r12
je 0x405b0b
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq *0x18(%rax)
jmp 0x405b0b
movq (%r14), %rax
movq %r14, %rdi
movq %r13, %rbx
movq %r13, %rsi
callq *0x18(%rax)
movq 0x50(%rsp), %r14
leaq 0x68(%rsp), %rbp
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
callq *0x28(%rax)
movq (%r15), %rax
movq %r15, %rdi
movq %rbp, %rsi
callq *0x30(%rax)
testq %r12, %r12
leaq 0x30(%rsp), %r13
je 0x405bd1
movq %r13, %rdi
leaq 0x1b8639(%rip), %rsi    # 0x5be1c5
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0x68(%rsp), %rsi
movl %r14d, %edx
movq %r13, %rcx
callq 0x405f9e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x43295c
movq %rbp, %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %r13
movq %r13, %rdi
callq 0x4b4bf0
movq %r13, %rdi
leaq 0x1b8689(%rip), %rsi    # 0x5be264
leaq 0x98(%rsp), %rdx
callq 0x406046
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0x68(%rsp), %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x405f9e
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x42f62c
movq %rbp, %rdi
callq 0x4b4bf0
movq %r13, %rdi
callq 0x4b4bf0
callq 0x434ccf
testb %al, %al
jne 0x405c51
movl $0x3e8, %ecx            # imm = 0x3E8
movq 0x88(%rsp), %rax
movl 0x58(%rsp), %edx
cmpl $0x1, %edx
je 0x405af4
incl %r14d
movl %edx, %eax
movl 0x90(%rsp), %ecx
jmp 0x405ae1
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b86fe(%rip), %rsi    # 0x5be35d
callq 0x4a4910
pushq $0x1
popq %rbx
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
leaq 0xd8(%rsp), %rdi
callq 0x4b4bf0
leaq 0x68(%rsp), %rdi
callq 0x4b4bf0
leaq 0xf8(%rsp), %rdi
callq 0x4b4bf0
movl %ebx, %eax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b86c1(%rip), %rsi    # 0x5be37b
callq 0x4a4910
jmp 0x405713
leaq 0x1b854c(%rip), %rsi    # 0x5be217
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x406046
leaq 0x118(%rsp), %rdi
callq 0x434d5b
leaq 0x1b8533(%rip), %rsi    # 0x5be224
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x406046
leaq 0x118(%rsp), %rdi
callq 0x434d5b
leaq 0x1b851b(%rip), %rsi    # 0x5be232
leaq 0x118(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x406046
leaq 0x118(%rsp), %rdi
callq 0x434d5b
leaq 0x1b845a(%rip), %rsi    # 0x5be197
leaq 0x118(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x406046
leaq 0x118(%rsp), %rdi
callq 0x434d5b
leaq 0x1b8467(%rip), %rsi    # 0x5be1ca
leaq 0x118(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x406046
leaq 0x118(%rsp), %rdi
callq 0x434d5b
jmp 0x405dc7
jmp 0x405f51
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x405f3b
jmp 0x405f51
jmp 0x405dc7
jmp 0x405f51
jmp 0x405f51
jmp 0x405dc7
jmp 0x405f51
jmp 0x405f51
jmp 0x405f27
jmp 0x405f18
jmp 0x405f27
jmp 0x405f51
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
jmp 0x405f54
jmp 0x405f51
jmp 0x405f51
jmp 0x405f30
jmp 0x405efa
jmp 0x405f62
jmp 0x405eff
jmp 0x405efa
jmp 0x405f62
jmp 0x405f62
jmp 0x405efa
jmp 0x405f62
jmp 0x405eff
jmp 0x405efa
jmp 0x405f62
jmp 0x405f62
jmp 0x405e3a
jmp 0x405f62
jmp 0x405e3a
jmp 0x405f62
jmp 0x405f62
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x405f11
jmp 0x405f62
jmp 0x405eff
jmp 0x405efa
jmp 0x405f62
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f62
jmp 0x405f5d
jmp 0x405eff
jmp 0x405efa
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f5d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
jmp 0x405edc
jmp 0x405f5d
jmp 0x405f62
jmp 0x405f5d
movq %rax, %rbx
jmp 0x405f89
jmp 0x405eff
jmp 0x405efa
jmp 0x405f62
jmp 0x405f5d
jmp 0x405f62
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x406170
jmp 0x405f72
jmp 0x405f51
jmp 0x405f62
jmp 0x405efa
jmp 0x405eff
jmp 0x405f62
jmp 0x405f62
movq %rax, %rbx
jmp 0x405f0c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4b4bf0
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
jmp 0x405f65
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4b4bf0
jmp 0x405f33
movq %rax, %rbx
jmp 0x405f40
jmp 0x405f51
jmp 0x405f62
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4b4bf0
leaq 0x118(%rsp), %rdi
callq 0x406170
jmp 0x405f54
jmp 0x405f51
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x405f6d
jmp 0x405f62
movq %rax, %rbx
jmp 0x405f72
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x4b4bf0
leaq 0xd8(%rsp), %rdi
callq 0x4b4bf0
leaq 0x68(%rsp), %rdi
callq 0x4b4bf0
leaq 0xf8(%rsp), %rdi
callq 0x4b4bf0
movq %rbx, %rdi
callq 0x4eb220