// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::make_fwd_decision(RID_Router*, Path_State*, unsigned char, std::vector<std::vector<long double, std::allocator<long double>>, std::allocator<std::vector<long double, std::allocator<long double>>>>, std::vector<std::vector<long double, std::allocator<long double>>, std::allocator<std::vector<long double, std::allocator<long double>>>>, std::vector<RID_Analytics::fwd_decision, std::allocator<RID_Analytics::fwd_decision>>&)
int RID_Analytics::make_fwd_decision(
    RID_Router * router,
    Path_State * prev_state,
    uint8_t in_iface,
    std::vector<std::vector<__float080> > iface_probs,
    std::vector<std::vector<__float080> > out_fptree_probs,
    std::vector<RID_Analytics::fwd_decision> & fwd_decisions) {

    // IMPORTANT: here's what the 3 values in iface_probs[i][] carry
    //  - iface_probs[i][0] : P(L_i >  L_{~i}), i.e. the probability of an 'exclusive'
    //                        match at iface i.
    //                        this should be used for Single Match (SM) events
    //  - iface_probs[i][1] : P(L_i >= L_{~i}), Multiple Match (MM) situations which 
    //                        *DO NOT* involve the choice of iface 0.
    //                        this is useful when evaluating the probability of 
    //                        'fallback' events, in which we want to distinguish 
    //                        MM situations which involve / not involve local 
    //                        matches.
    //  - iface_probs[i][2] : P(L_i >= L_{~i}), multiple match situations which 
    //                        consider the involvement of iface 0.
    //                        this should be the maximum value of all iface[i][].

    // array to save avg. nr of events
    std::vector<__float080> events(EVENT_NUM, 0.0);

    // handle LLM events (iface 0)
    handle_llm(router, iface_probs, events, prev_state);

    // FIXME: special vars for soft fallback handling
    __float080 max_prob[3] = {0.0, 0.0, 0.0};
    int origin_iface = 0;
    // handle other events (iface > 0)
    for (int i = 1; i < router->get_iface_num(); i++) {

        if (on_path_to_origin(router, i, std::stoi(this->origin_server->get_id())))
            origin_iface = i;

        // check if the packet's ttl goes below 0 : if it does, end the path here
        // without adding a forwarding decision
        if ((prev_state->get_ttl() - 1) < 0) { 
            if (iface_probs[i][2] > 0.0)
                handle_ttl_drop(router, iface_probs[i][2], prev_state);
            continue;
        }

        // update the path probability (P(R_n) in the paper)
        __float080 path_prob = 0.0;
        if (this->mode == MMH_FLOOD) {

            // MMH_FLOOD uses P(L_i >= L_{~i}), w/ local matches
            path_prob = iface_probs[i][2];
            // SM event only considers P(L_i > L_{~i})

            if (this->tp_sizes[router->get_id()][i] > 0) {
                events[EVENT_SLMC] += iface_probs[i][0];
            } else {
                events[EVENT_SLMI] += iface_probs[i][0];
            }

            // MM event refers to P(L_i == L_{~i}), as such we do:
            //  P(L_i >= L_{~i}) - P(L_i > L_{~i})
            // FIXME : this will be used to calculate the avg. nr. of links 
            // used in 'flood' mode
            events[EVENT_MLM] += iface_probs[i][2] - iface_probs[i][0];

        } else if (((this->mode & 0x03) == HARD_FALLBACK)
            || ((this->mode & 0x03) == SOFT_FALLBACK)) {

            // as an approximation for the MM event probability, 
            // we use the iface which outputs the max. value of iface_probs[i][1]
            // FIXME: how do we explain this?
            if (max_prob[1] < iface_probs[i][2]) {

                max_prob[0] = iface_probs[i][0];
                max_prob[1] = iface_probs[i][1];

                // FIXME: workaround to get correct value of max_prob at start router
                if ((*router->get_blocked_ifaces())[0])
                    max_prob[2] = iface_probs[i][1];
                else
                    max_prob[2] = iface_probs[i][2];
            }

            // otherwise, use iface_probs[i][0]
            path_prob = iface_probs[i][0];
            if (this->tp_sizes[router->get_id()][i] > 0)
                events[EVENT_SLMC] += iface_probs[i][0];
            else
                events[EVENT_SLMI] += iface_probs[i][0];
        }

        // if path prob = 0.0, skip the addition of a fwd decision
        if (path_prob == 0.0) continue;

        // create a new path state
        Path_State * next_state = new Path_State(router, this->request_size);
        next_state->set_length(prev_state->get_length() + 1);
        // now, we deal with probabilities:
        //
        //  -# in_fptree_probs : the prob of having the packet 
        //     bound to a prefix tree of size s (no TP info)
        //
        //  -# in_iface_probs : the prob of having a packet 
        //     flow through iface i (takes TPs into account)
        //
        next_state->set_in_fptree_prob(&out_fptree_probs[i], this->request_size);
        next_state->set_path_prob(path_prob);
        next_state->set_in_iface_prob(path_prob);
        next_state->set_ttl(prev_state->get_ttl() - 1);

        // finally, we continue with the request path get the next hop router by iface
        RID_Router::nw_address next_hop = router->get_next_hop(i);
        // set the path's tree bitmask (by extracting the bitmask from the router's iface)
        next_state->set_tree_bitmasks(router->get_tree_bitmasks(i));

        // this can still happen (or can it?)
        // FIXME: this subtle condition is the one that actually terminates the run. 
        // FIXME: this could be the source of trouble.
        if (next_hop.router == router || i == in_iface) {
            std::cout << "RID_Analytics::make_fwd_decision() : [INFO] "
                << "found magic stopping condition" << std::endl;

            delete next_state;
            continue;
        }

        // add fwd_decision to fwd decision vector
        std::cout << "RID_Analytics::make_fwd_decision() : [INFO] saving fwd decision :"
            << "\n\tout[" << router->get_id() << "][" << i << "] -> in[" << next_hop.router->get_id() << "][" << (int) next_hop.iface << "]"
            << "\n\tpath prob = " << path_prob
            << "\n\tttl = " << (int) next_state->get_ttl() << std::endl;

        RID_Analytics::fwd_decision fd = {router, next_hop.router, i, next_hop.iface, next_state};
        fwd_decisions.push_back(fd);
    }

    // FIXME: special handling of SOFT_FALLBACK case
    if (this->mode == MMH_FLOOD) {

        events[EVENT_FPD] = std::max(
            (__float080) 0.0, 
            (prev_state->get_in_iface_prob() - events[EVENT_SLMC] - events[EVENT_SLMI] - iface_probs[0][0]));

    } else if ((this->mode & 0x03) == SOFT_FALLBACK) {

        bool updated = false;
        for (unsigned int k = 0; k < fwd_decisions.size(); k++) {

            if (fwd_decisions[k].out_iface == origin_iface) {

                // update fwd_decision on fwd decision vector
                fwd_decisions[k].state->set_path_prob(max_prob[1]);
                fwd_decisions[k].state->set_in_iface_prob(max_prob[1]);
                std::cout << "RID_Analytics::make_fwd_decision() : [INFO] updating fwd decision :"
                    << "\n\tout[" << router->get_id() << "][" << origin_iface << "] -> in[" << fwd_decisions[k].next_router->get_id() << "][" << (int) fwd_decisions[k].in_iface << "]"
                    << "\n\tpath prob = " << max_prob[1]
                    << "\n\tpath length = " << fwd_decisions[k].state->get_length()
                    << "\n\tttl = " << (int) fwd_decisions[k].state->get_ttl() << std::endl;

                // mark fwd decision over origin iface as 'updated'
                updated = true;

                // add 'soft fallback fwd' outcome w/ probability P(L_i == L_{~i})
                if ((max_prob[1] - max_prob[0]) > 0.0)
                    add_outcome(
                        router, 
                        OUTCOME_SOFT_FALLBACK_FWD, 
                        (max_prob[1] - max_prob[0]), 
                        prev_state->get_length());

                events[EVENT_MLM] += (max_prob[2] - max_prob[0]);
            }
        }

        // in case a fwd decision isn't updated above, add a new fwd decision
        if ((!updated) && (max_prob[1] > 0.0)) {
            add_fwd_decision(router, prev_state, out_fptree_probs, origin_iface, max_prob[1], 1, fwd_decisions);
        }

        // handle the case of having the request incorrectly delivered and 
        // recovered w/ a soft fallback (w/ +2 latency penalty)
        if ((!(this->tp_sizes[router->get_id()][0] > 0)) && ((max_prob[2] - max_prob[1]) > 0.0) && (iface_probs[0][2] > 0.0)) {
            add_fwd_decision(router, prev_state, out_fptree_probs, origin_iface, max_prob[2] - max_prob[1], 2, fwd_decisions);
        }

    } else if ((this->mode & 0x03) == HARD_FALLBACK) {

        __float080 mm_prob = std::max(
            (__float080) 0.0, 
            (prev_state->get_in_iface_prob() - events[EVENT_SLMC] - events[EVENT_SLMI] - iface_probs[0][2]));
        
        events[EVENT_FPD] = mm_prob;

        if (mm_prob > 0.0) {

            // 1) add correct delivery 
            add_outcome(
                router, 
                OUTCOME_CORRECT_DELIVERY, 
                (mm_prob), 
                prev_state->get_length() + get_origin_distance(router));

            // 2) register hard fallback activation
            add_outcome(
                router, 
                OUTCOME_HARD_FALLBACK_DELIVERY, 
                (mm_prob), 
                get_origin_distance(router));

            events[EVENT_MLM] += mm_prob;
        }

        if ((iface_probs[0][2] > 0.0) && (router->get_id() != origin_server->get_id()) && (!(this->tp_sizes[router->get_id()][0] > 0))) {

            events[EVENT_SLMI] += iface_probs[0][2];

            // 1) add correct delivery 
            add_outcome(
                router, 
                OUTCOME_CORRECT_DELIVERY, 
                iface_probs[0][2], 
                prev_state->get_length() + 1 + get_origin_distance(router));

            // 2) register hard fallback activation
            add_outcome(
                router, 
                OUTCOME_HARD_FALLBACK_DELIVERY, 
                iface_probs[0][2], 
                get_origin_distance(router));
        }
    }

    // // add fwd record to results
    // add_fwd(router, in_iface, prev_state, fwd_decisions);
    //  - add events probs to results
    add_events(router, events);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a0, %rsp            # imm = 0x7A0
movq %r9, -0x378(%rbp)
movq %r8, -0x370(%rbp)
movb %cl, %al
movq 0x10(%rbp), %rcx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x368(%rbp)
fldz
fstpt -0x60(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x34a40
movq -0x360(%rbp), %rcx
leaq -0x48(%rbp), %rdi
movl $0x6, %esi
leaq -0x60(%rbp), %rdx
callq 0x34a60
jmp 0x4f581
leaq -0x61(%rbp), %rdi
callq 0x34b70
movq -0x368(%rbp), %rdi
movq -0x370(%rbp), %rdx
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %r8
leaq -0x48(%rbp), %rcx
callq 0x4ed60
jmp 0x4f5ab
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x5290
movl $0x0, -0xb4(%rbp)
movl $0x1, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x380(%rbp)
movq -0x10(%rbp), %rdi
callq 0x51e10
movb %al, -0x379(%rbp)
jmp 0x4f5ef
movl -0x380(%rbp), %eax
movb -0x379(%rbp), %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jge 0x500fa
movq -0x368(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x390(%rbp)
movl -0xb8(%rbp), %ecx
movl %ecx, -0x384(%rbp)
movq 0x80(%rax), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x35650
jmp 0x4f639
xorl %eax, %eax
movl %eax, %esi
leaq -0xd8(%rbp), %rdi
movl $0xa, %edx
callq 0x303d0
movl %eax, -0x394(%rbp)
jmp 0x4f656
movl -0x394(%rbp), %edx
movl -0x384(%rbp), %esi
movq -0x390(%rbp), %rdi
callq 0x4e6f0
movb %al, -0x395(%rbp)
jmp 0x4f676
leaq -0xd8(%rbp), %rdi
callq 0x52f0
movb -0x395(%rbp), %al
testb $0x1, %al
jne 0x4f68e
jmp 0x4f6e4
movl -0xb8(%rbp), %eax
movl %eax, -0xb4(%rbp)
jmp 0x4f6e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x34b70
jmp 0x50e7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x50e76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
movq -0x18(%rbp), %rdi
callq 0x3f8c0
movl %eax, -0x39c(%rbp)
jmp 0x4f6f5
movl -0x39c(%rbp), %eax
subl $0x1, %eax
cmpl $0x0, %eax
jge 0x4f787
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
fldt (%rax)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x4f782
jmp 0x4f735
movq -0x370(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
movq -0x368(%rbp), %rdi
movq -0x3a8(%rbp), %rsi
fldt (%rax)
movq -0x18(%rbp), %rdx
movq %rsp, %rax
fstpt (%rax)
callq 0x4f050
jmp 0x4f780
jmp 0x4f782
jmp 0x500af
movq -0x368(%rbp), %rax
fldz
fstpt -0xf0(%rbp)
cmpl $0x0, 0x4(%rax)
jne 0x4f955
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
movq %rax, %rcx
movq -0x368(%rbp), %rax
fldt (%rcx)
fstpt -0xf0(%rbp)
addq $0x20, %rax
movq %rax, -0x3b0(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x35650
jmp 0x4f7ef
movq -0x3b0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x52810
movq %rax, -0x3b8(%rbp)
jmp 0x4f80b
movq -0x3b8(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x34d30
movzbl (%rax), %eax
movl %eax, -0x3bc(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x52f0
movl -0x3bc(%rbp), %eax
cmpl $0x0, %eax
jle 0x4f89e
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x3c8(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x3, %esi
callq 0x34c70
fldt -0x3c8(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
jmp 0x4f8df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x3d4(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x4, %esi
callq 0x34c70
fldt -0x3d4(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
movq -0x370(%rbp), %rdi
fldt (%rax)
fstpt -0x3ec(%rbp)
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
fldt -0x3ec(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x3e0(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x34c70
fldt -0x3e0(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
jmp 0x4fc02
movq -0x368(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
je 0x4f97d
movq -0x368(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x4fc00
movq -0x370(%rbp), %rdi
fldt -0xa0(%rbp)
fstpt -0x3f8(%rbp)
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
fldt -0x3f8(%rbp)
fldt (%rax)
fucompi %st(1), %st
fstp %st(0)
jbe 0x4fac0
jmp 0x4f9bd
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
movq -0x370(%rbp), %rdi
fldt (%rax)
fstpt -0xb0(%rbp)
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x34c70
fldt (%rax)
fstpt -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x52990
movq %rax, -0x400(%rbp)
jmp 0x4fa1e
movq -0x400(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x35120
movq %rdx, -0x410(%rbp)
movq %rax, -0x408(%rbp)
jmp 0x4fa3e
movq -0x410(%rbp), %rax
movq -0x408(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movq %rax, -0x118(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x35180
testb $0x1, %al
jne 0x4fa6c
jmp 0x4fa96
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x90(%rbp)
jmp 0x4fabe
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x90(%rbp)
jmp 0x4fac0
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
movq %rax, %rcx
movq -0x368(%rbp), %rax
fldt (%rcx)
fstpt -0xf0(%rbp)
addq $0x20, %rax
movq %rax, -0x418(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x35650
jmp 0x4fb0e
movq -0x418(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x52810
movq %rax, -0x420(%rbp)
jmp 0x4fb2a
movq -0x420(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x34d30
movzbl (%rax), %eax
movl %eax, -0x424(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x52f0
movl -0x424(%rbp), %eax
cmpl $0x0, %eax
jle 0x4fbbd
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x430(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x3, %esi
callq 0x34c70
fldt -0x430(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
jmp 0x4fbfe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
movq -0x370(%rbp), %rdi
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34c70
fldt (%rax)
fstpt -0x43c(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x4, %esi
callq 0x34c70
fldt -0x43c(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
jmp 0x4fc00
jmp 0x4fc02
fldt -0xf0(%rbp)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x4fc1b
jp 0x4fc1b
jmp 0x4fc16
jmp 0x500af
movl $0x90, %edi
callq 0x54a0
movq %rax, -0x448(%rbp)
jmp 0x4fc2e
movq -0x448(%rbp), %rdi
movq -0x368(%rbp), %rax
movq -0x10(%rbp), %rsi
movzbl (%rax), %edx
callq 0x3f4b0
jmp 0x4fc4a
movq -0x448(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x458(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f5c0
movl %eax, -0x44c(%rbp)
jmp 0x4fc77
movq -0x458(%rbp), %rdi
movl -0x44c(%rbp), %esi
incl %esi
callq 0x3f5a0
jmp 0x4fc8d
movq -0x378(%rbp), %rdi
movq -0x148(%rbp), %rax
movq %rax, -0x460(%rbp)
movslq -0xb8(%rbp), %rsi
callq 0x358a0
movq -0x460(%rbp), %rdi
movq %rax, %rsi
movq -0x368(%rbp), %rax
movzbl (%rax), %edx
callq 0x3f660
jmp 0x4fcc9
movq -0x148(%rbp), %rdi
fldt -0xf0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x3f620
jmp 0x4fce2
movq -0x148(%rbp), %rdi
fldt -0xf0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x3f720
jmp 0x4fcfb
movq -0x148(%rbp), %rax
movq %rax, -0x470(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f8c0
movl %eax, -0x464(%rbp)
jmp 0x4fd1a
movq -0x470(%rbp), %rdi
movl -0x464(%rbp), %esi
decl %esi
callq 0x3f8a0
jmp 0x4fd30
movq -0x10(%rbp), %rdi
movzbl -0xb8(%rbp), %esi
callq 0x35610
movb %dl, -0x479(%rbp)
movq %rax, -0x478(%rbp)
jmp 0x4fd4f
movb -0x479(%rbp), %al
movq -0x478(%rbp), %rcx
movq %rcx, -0x158(%rbp)
movb %al, -0x150(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x490(%rbp)
movq -0x10(%rbp), %rdi
movzbl -0xb8(%rbp), %esi
callq 0x528f0
movq %rax, -0x488(%rbp)
jmp 0x4fd90
movq -0x488(%rbp), %rsi
movq -0x490(%rbp), %rdi
callq 0x3f860
jmp 0x4fda5
movq -0x158(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x4fdc4
movl -0xb8(%rbp), %eax
movzbl -0x19(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4fe69
movq 0x321ed(%rip), %rdi     # 0x81fb8
leaq 0x144f8(%rip), %rsi     # 0x642ca
callq 0x5480
movq %rax, -0x498(%rbp)
jmp 0x4fde0
movq -0x498(%rbp), %rdi
leaq 0x14509(%rip), %rsi     # 0x642f7
callq 0x5480
movq %rax, -0x4a0(%rbp)
jmp 0x4fdfc
movq -0x4a0(%rbp), %rdi
movq 0x32186(%rip), %rsi     # 0x81f90
callq 0x54f0
jmp 0x4fe11
movq -0x148(%rbp), %rax
movq %rax, -0x4a8(%rbp)
cmpq $0x0, %rax
je 0x4fe42
movq -0x4a8(%rbp), %rdi
callq 0x529b0
movq -0x4a8(%rbp), %rdi
movl $0x90, %esi
callq 0x54b0
jmp 0x500af
movq -0x448(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
movl $0x90, %esi
callq 0x54b0
jmp 0x50e76
movq 0x32148(%rip), %rdi     # 0x81fb8
leaq 0x1449f(%rip), %rsi     # 0x64316
callq 0x5480
movq %rax, -0x4b0(%rbp)
jmp 0x4fe85
movq -0x4b0(%rbp), %rdi
leaq 0x143fe(%rip), %rsi     # 0x64291
callq 0x5480
movq %rax, -0x4b8(%rbp)
jmp 0x4fea1
movq -0x10(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x35650
jmp 0x4feb3
movq -0x4b8(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x5430
movq %rax, -0x4c0(%rbp)
jmp 0x4fecf
movq -0x4c0(%rbp), %rdi
leaq 0x142cd(%rip), %rsi     # 0x641aa
callq 0x5480
movq %rax, -0x4c8(%rbp)
jmp 0x4feeb
movq -0x4c8(%rbp), %rdi
movl -0xb8(%rbp), %esi
callq 0x58f0
movq %rax, -0x4d0(%rbp)
jmp 0x4ff06
movq -0x4d0(%rbp), %rdi
leaq 0x14384(%rip), %rsi     # 0x64298
callq 0x5480
movq %rax, -0x4d8(%rbp)
jmp 0x4ff22
movq -0x158(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x35650
jmp 0x4ff37
movq -0x4d8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x5430
movq %rax, -0x4e0(%rbp)
jmp 0x4ff53
movq -0x4e0(%rbp), %rdi
leaq 0x14249(%rip), %rsi     # 0x641aa
callq 0x5480
movq %rax, -0x4e8(%rbp)
jmp 0x4ff6f
movq -0x4e8(%rbp), %rdi
movzbl -0x150(%rbp), %esi
callq 0x58f0
movq %rax, -0x4f0(%rbp)
jmp 0x4ff8b
movq -0x4f0(%rbp), %rdi
leaq 0xfd58(%rip), %rsi      # 0x5fcf1
callq 0x5480
movq %rax, -0x4f8(%rbp)
jmp 0x4ffa7
movq -0x4f8(%rbp), %rdi
leaq 0x142ec(%rip), %rsi     # 0x642a1
callq 0x5480
movq %rax, -0x500(%rbp)
jmp 0x4ffc3
movq -0x500(%rbp), %rdi
fldt -0xf0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x55b0
movq %rax, -0x508(%rbp)
jmp 0x4ffe3
movq -0x508(%rbp), %rdi
leaq 0x142d0(%rip), %rsi     # 0x642c1
callq 0x5480
movq %rax, -0x510(%rbp)
jmp 0x4ffff
movq -0x148(%rbp), %rdi
callq 0x3f8c0
movl %eax, -0x514(%rbp)
jmp 0x50013
movl -0x514(%rbp), %esi
movq -0x510(%rbp), %rdi
callq 0x58f0
movq %rax, -0x520(%rbp)
jmp 0x5002e
movq -0x520(%rbp), %rdi
movq 0x31f54(%rip), %rsi     # 0x81f90
callq 0x54f0
jmp 0x50043
leaq -0x198(%rbp), %rdi
callq 0x52f0
leaq -0x178(%rbp), %rdi
callq 0x52f0
movq -0x10(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movzbl -0x150(%rbp), %eax
movl %eax, -0x1a4(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq 0x10(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x52920
jmp 0x500ad
jmp 0x500af
movl -0xb8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x4f5d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x500e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x52f0
leaq -0x178(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
movq -0x368(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x501e6
fldz
fstpt -0x1d0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f790
fstpt -0x52c(%rbp)
jmp 0x50124
leaq -0x48(%rbp), %rdi
movq %rdi, -0x568(%rbp)
movl $0x3, %esi
callq 0x34c70
fldt -0x52c(%rbp)
movq -0x568(%rbp), %rdi
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x55c(%rbp)
movl $0x4, %esi
callq 0x34c70
fldt -0x55c(%rbp)
movq -0x370(%rbp), %rdi
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x544(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x550(%rbp)
callq 0x358a0
movq -0x550(%rbp), %rsi
movq %rax, %rdi
callq 0x34c70
fldt -0x544(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x1e0(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x529d0
movq %rax, -0x538(%rbp)
jmp 0x501bc
movq -0x538(%rbp), %rax
fldt (%rax)
fstpt -0x574(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x5, %esi
callq 0x34c70
fldt -0x574(%rbp)
fstpt (%rax)
jmp 0x50e05
movq -0x368(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x2, %eax
jne 0x5087c
movb $0x0, -0x1e1(%rbp)
movl $0x0, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movq %rax, -0x580(%rbp)
movq 0x10(%rbp), %rdi
callq 0x52590
movq %rax, %rcx
movq -0x580(%rbp), %rax
cmpq %rcx, %rax
jae 0x50624
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movl 0x10(%rax), %eax
cmpl -0xb4(%rbp), %eax
jne 0x5060e
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq 0x18(%rax), %rdi
fldt -0xa0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x3f620
jmp 0x5027d
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq 0x18(%rax), %rdi
fldt -0xa0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x3f720
jmp 0x502a4
movq 0x31d0d(%rip), %rdi     # 0x81fb8
leaq 0x140a6(%rip), %rsi     # 0x64358
callq 0x5480
movq %rax, -0x588(%rbp)
jmp 0x502c0
movq -0x588(%rbp), %rdi
leaq 0x13fc3(%rip), %rsi     # 0x64291
callq 0x5480
movq %rax, -0x590(%rbp)
jmp 0x502dc
movq -0x10(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x35650
jmp 0x502ee
movq -0x590(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x5430
movq %rax, -0x598(%rbp)
jmp 0x5030a
movq -0x598(%rbp), %rdi
leaq 0x13e92(%rip), %rsi     # 0x641aa
callq 0x5480
movq %rax, -0x5a0(%rbp)
jmp 0x50326
movq -0x5a0(%rbp), %rdi
movl -0xb4(%rbp), %esi
callq 0x58f0
movq %rax, -0x5a8(%rbp)
jmp 0x50341
movq -0x5a8(%rbp), %rdi
leaq 0x13f49(%rip), %rsi     # 0x64298
callq 0x5480
movq %rax, -0x5b0(%rbp)
jmp 0x5035d
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq 0x8(%rax), %rsi
leaq -0x228(%rbp), %rdi
callq 0x35650
jmp 0x50380
movq -0x5b0(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x5430
movq %rax, -0x5b8(%rbp)
jmp 0x5039c
movq -0x5b8(%rbp), %rdi
leaq 0x13e00(%rip), %rsi     # 0x641aa
callq 0x5480
movq %rax, -0x5c0(%rbp)
jmp 0x503b8
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq -0x5c0(%rbp), %rdi
movl 0x14(%rax), %esi
callq 0x58f0
movq %rax, -0x5c8(%rbp)
jmp 0x503e1
movq -0x5c8(%rbp), %rdi
leaq 0xf902(%rip), %rsi      # 0x5fcf1
callq 0x5480
movq %rax, -0x5d0(%rbp)
jmp 0x503fd
movq -0x5d0(%rbp), %rdi
leaq 0x13e96(%rip), %rsi     # 0x642a1
callq 0x5480
movq %rax, -0x5d8(%rbp)
jmp 0x50419
movq -0x5d8(%rbp), %rdi
fldt -0xa0(%rbp)
movq %rsp, %rax
fstpt (%rax)
callq 0x55b0
movq %rax, -0x5e0(%rbp)
jmp 0x50439
movq -0x5e0(%rbp), %rdi
leaq 0x13e69(%rip), %rsi     # 0x642b0
callq 0x5480
movq %rax, -0x5e8(%rbp)
jmp 0x50455
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq 0x18(%rax), %rdi
callq 0x3f5c0
movl %eax, -0x5ec(%rbp)
jmp 0x50477
movl -0x5ec(%rbp), %esi
movq -0x5e8(%rbp), %rdi
callq 0x58f0
movq %rax, -0x5f8(%rbp)
jmp 0x50492
movq -0x5f8(%rbp), %rdi
leaq 0x13e21(%rip), %rsi     # 0x642c1
callq 0x5480
movq %rax, -0x600(%rbp)
jmp 0x504ae
movq 0x10(%rbp), %rdi
movl -0x1e8(%rbp), %eax
movl %eax, %esi
callq 0x525b0
movq 0x18(%rax), %rdi
callq 0x3f8c0
movl %eax, -0x604(%rbp)
jmp 0x504d0
movl -0x604(%rbp), %esi
movq -0x600(%rbp), %rdi
callq 0x58f0
movq %rax, -0x610(%rbp)
jmp 0x504eb
movq -0x610(%rbp), %rdi
movq 0x31a97(%rip), %rsi     # 0x81f90
callq 0x54f0
jmp 0x50500
leaq -0x228(%rbp), %rdi
callq 0x52f0
leaq -0x208(%rbp), %rdi
callq 0x52f0
movb $0x1, -0x1e1(%rbp)
fldt -0xa0(%rbp)
fldt -0xb0(%rbp)
fsubrp %st, %st(1)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x505e0
jmp 0x5053d
movq -0x10(%rbp), %rax
movq %rax, -0x628(%rbp)
fldt -0xa0(%rbp)
fldt -0xb0(%rbp)
fsubrp %st, %st(1)
fstpt -0x620(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f5c0
movl %eax, -0x614(%rbp)
jmp 0x5056d
movq -0x628(%rbp), %rsi
movq -0x368(%rbp), %rdi
fldt -0x620(%rbp)
movl -0x614(%rbp), %eax
movl %eax, -0x354(%rbp)
fildl -0x354(%rbp)
movq %rsp, %rax
fstpt 0x10(%rax)
fstpt (%rax)
movl $0xa, %edx
callq 0x4e440
jmp 0x505a7
jmp 0x505e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x505cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x52f0
leaq -0x208(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
fldt -0x90(%rbp)
fldt -0xb0(%rbp)
fsubrp %st, %st(1)
fstpt -0x634(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x34c70
fldt -0x634(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
jmp 0x50610
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x5020d
testb $0x1, -0x1e1(%rbp)
jne 0x506e0
fldt -0xa0(%rbp)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x506e0
jmp 0x50647
movq -0x378(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x648(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x640(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x52a10
jmp 0x50672
movq -0x640(%rbp), %rdx
movq -0x648(%rbp), %rsi
movq -0x368(%rbp), %rdi
movl -0xb4(%rbp), %r8d
fldt -0xa0(%rbp)
movq 0x10(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
fstpt (%rax)
leaq -0x240(%rbp), %rcx
movl $0x1, %r9d
callq 0x4f0e0
jmp 0x506b5
leaq -0x240(%rbp), %rdi
callq 0x35ae0
jmp 0x506e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x35ae0
jmp 0x50e76
movq -0x368(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x650(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x35650
jmp 0x50704
movq -0x650(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x52810
movq %rax, -0x658(%rbp)
jmp 0x50720
movq -0x658(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34d30
movzbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x659(%rbp)
jg 0x50792
fldt -0x90(%rbp)
fldt -0xa0(%rbp)
fsubrp %st, %st(1)
xorl %eax, %eax
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
movb %al, -0x659(%rbp)
jbe 0x50792
jmp 0x50762
movq -0x370(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
fldt (%rax)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
seta %al
movb %al, -0x659(%rbp)
movb -0x659(%rbp), %al
movb %al, -0x65a(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x52f0
movb -0x65a(%rbp), %al
testb $0x1, %al
jne 0x507b9
jmp 0x50877
movq -0x378(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x670(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x668(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x52a10
jmp 0x507e4
movq -0x668(%rbp), %rdx
movq -0x670(%rbp), %rsi
movq -0x368(%rbp), %rdi
movl -0xb4(%rbp), %r8d
fldt -0x90(%rbp)
fldt -0xa0(%rbp)
fsubrp %st, %st(1)
movq 0x10(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
fstpt (%rax)
leaq -0x278(%rbp), %rcx
movl $0x2, %r9d
callq 0x4f0e0
jmp 0x5082f
leaq -0x278(%rbp), %rdi
callq 0x35ae0
jmp 0x50877
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x35ae0
jmp 0x50e76
jmp 0x50e03
movq -0x368(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x3, %eax
cmpl $0x3, %eax
jne 0x50e01
fldz
fstpt -0x2a0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f790
fstpt -0x67c(%rbp)
jmp 0x508ab
leaq -0x48(%rbp), %rdi
movq %rdi, -0x6a8(%rbp)
movl $0x3, %esi
callq 0x34c70
fldt -0x67c(%rbp)
movq -0x6a8(%rbp), %rdi
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x6a0(%rbp)
movl $0x4, %esi
callq 0x34c70
fldt -0x6a0(%rbp)
movq -0x370(%rbp), %rdi
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x694(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
fldt -0x694(%rbp)
fldt (%rax)
fsubrp %st, %st(1)
fstpt -0x2b0(%rbp)
leaq -0x2a0(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x529d0
movq %rax, -0x688(%rbp)
jmp 0x5093a
movq -0x688(%rbp), %rax
fldt (%rax)
fstpt -0x290(%rbp)
fldt -0x290(%rbp)
fstpt -0x6b4(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x5, %esi
callq 0x34c70
fldt -0x6b4(%rbp)
fstpt (%rax)
fldt -0x290(%rbp)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x50a8d
jmp 0x50981
movq -0x10(%rbp), %rax
movq %rax, -0x6d0(%rbp)
fldt -0x290(%rbp)
fstpt -0x6c4(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f5c0
movl %eax, -0x6b8(%rbp)
jmp 0x509a9
movq -0x368(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4e0e0
movl %eax, -0x6d4(%rbp)
jmp 0x509c1
movq -0x6d0(%rbp), %rsi
movq -0x368(%rbp), %rdi
fldt -0x6c4(%rbp)
movl -0x6d4(%rbp), %ecx
movl -0x6b8(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x344(%rbp)
fildl -0x344(%rbp)
movq %rsp, %rax
fxch %st(1)
fstpt (%rax)
fstpt 0x10(%rax)
xorl %edx, %edx
callq 0x4e440
jmp 0x50a02
movq -0x368(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq %rsi, -0x6f0(%rbp)
fldt -0x290(%rbp)
fstpt -0x6e4(%rbp)
callq 0x4e0e0
movl %eax, -0x6d8(%rbp)
jmp 0x50a2d
movq -0x6f0(%rbp), %rsi
movq -0x368(%rbp), %rdi
fldt -0x6e4(%rbp)
movl -0x6d8(%rbp), %eax
movl %eax, -0x348(%rbp)
fildl -0x348(%rbp)
movq %rsp, %rax
fstpt 0x10(%rax)
fstpt (%rax)
movl $0x2, %edx
callq 0x4e440
jmp 0x50a67
fldt -0x290(%rbp)
fstpt -0x6fc(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x34c70
fldt -0x6fc(%rbp)
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
movq -0x370(%rbp), %rdi
xorl %eax, %eax
movl %eax, -0x704(%rbp)
movl %eax, %esi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
movq %rax, %rcx
movl -0x704(%rbp), %eax
fldt (%rcx)
fldz
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
movb $0x0, -0x2d1(%rbp)
movb $0x0, -0x2f9(%rbp)
movb $0x0, -0x321(%rbp)
movb %al, -0x6fd(%rbp)
jbe 0x50bae
jmp 0x50ae6
movq -0x10(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x35650
jmp 0x50af8
movq -0x368(%rbp), %rax
movb $0x1, -0x2d1(%rbp)
movq 0x80(%rax), %rsi
leaq -0x2f8(%rbp), %rdi
callq 0x35650
jmp 0x50b1b
movb $0x1, -0x2f9(%rbp)
leaq -0x2d0(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x51ec0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x6fd(%rbp)
jne 0x50b46
jmp 0x50bae
movq -0x368(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x710(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x320(%rbp), %rdi
callq 0x35650
jmp 0x50b6a
movq -0x710(%rbp), %rdi
movb $0x1, -0x321(%rbp)
leaq -0x320(%rbp), %rsi
callq 0x52810
movq %rax, -0x718(%rbp)
jmp 0x50b8d
movq -0x718(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x34d30
movzbl (%rax), %eax
cmpl $0x0, %eax
setg %al
xorb $-0x1, %al
movb %al, -0x6fd(%rbp)
movb -0x6fd(%rbp), %al
movb %al, -0x719(%rbp)
testb $0x1, -0x321(%rbp)
jne 0x50bc5
jmp 0x50bd1
leaq -0x320(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x2f9(%rbp)
jne 0x50bdc
jmp 0x50be8
leaq -0x2f8(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x2d1(%rbp)
jne 0x50bf3
jmp 0x50bff
leaq -0x2d0(%rbp), %rdi
callq 0x52f0
movb -0x719(%rbp), %al
testb $0x1, %al
jne 0x50c0e
jmp 0x50dff
movq -0x370(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x748(%rbp)
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
movq %rsi, -0x738(%rbp)
callq 0x34c70
fldt (%rax)
fstpt -0x754(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x4, %esi
callq 0x34c70
fldt -0x754(%rbp)
movq -0x370(%rbp), %rdi
movq -0x748(%rbp), %rsi
fldt (%rax)
faddp %st, %st(1)
fstpt (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x740(%rbp)
callq 0x358a0
movq -0x738(%rbp), %rsi
movq %rax, %rdi
callq 0x34c70
fldt (%rax)
fstpt -0x72c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3f5c0
movl %eax, -0x720(%rbp)
jmp 0x50ca1
movq -0x368(%rbp), %rdi
movl -0x720(%rbp), %eax
incl %eax
movl %eax, -0x75c(%rbp)
movq -0x10(%rbp), %rsi
callq 0x4e0e0
movl %eax, -0x758(%rbp)
jmp 0x50cc7
movq -0x740(%rbp), %rsi
movq -0x368(%rbp), %rdi
fldt -0x72c(%rbp)
movl -0x758(%rbp), %ecx
movl -0x75c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x34c(%rbp)
fildl -0x34c(%rbp)
movq %rsp, %rax
fxch %st(1)
fstpt (%rax)
fstpt 0x10(%rax)
xorl %edx, %edx
callq 0x4e440
jmp 0x50d08
movq -0x370(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x778(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x358a0
movq %rax, %rdi
movl $0x2, %esi
callq 0x34c70
movq -0x368(%rbp), %rdi
fldt (%rax)
fstpt -0x76c(%rbp)
movq -0x10(%rbp), %rsi
callq 0x4e0e0
movl %eax, -0x760(%rbp)
jmp 0x50d50
movq -0x778(%rbp), %rsi
movq -0x368(%rbp), %rdi
fldt -0x76c(%rbp)
movl -0x760(%rbp), %eax
movl %eax, -0x350(%rbp)
fildl -0x350(%rbp)
movq %rsp, %rax
fstpt 0x10(%rax)
fstpt (%rax)
movl $0x2, %edx
callq 0x4e440
jmp 0x50d8a
jmp 0x50dff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x50de6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x50dcd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
testb $0x1, -0x321(%rbp)
jne 0x50dbf
jmp 0x50dcb
leaq -0x320(%rbp), %rdi
callq 0x52f0
jmp 0x50dcd
testb $0x1, -0x2f9(%rbp)
jne 0x50dd8
jmp 0x50de4
leaq -0x2f8(%rbp), %rdi
callq 0x52f0
jmp 0x50de6
testb $0x1, -0x2d1(%rbp)
jne 0x50df1
jmp 0x50dfd
leaq -0x2d0(%rbp), %rdi
callq 0x52f0
jmp 0x50e76
jmp 0x50e01
jmp 0x50e03
jmp 0x50e05
movq -0x10(%rbp), %rax
movq %rax, -0x780(%rbp)
leaq -0x340(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x36d30
jmp 0x50e22
movq -0x780(%rbp), %rsi
movq -0x368(%rbp), %rdi
leaq -0x340(%rbp), %rdx
callq 0x4e790
jmp 0x50e3e
leaq -0x340(%rbp), %rdi
callq 0x34b10
leaq -0x48(%rbp), %rdi
callq 0x34b10
xorl %eax, %eax
addq $0x7a0, %rsp            # imm = 0x7A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x34b10
leaq -0x48(%rbp), %rdi
callq 0x34b10
movq -0x70(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)