// File: /workspace/github_cpp_makefile_star2_O3/adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::add_fwd_decision(RID_Router*, Path_State*, std::vector<std::vector<long double, std::allocator<long double>>, std::allocator<std::vector<long double, std::allocator<long double>>>>, int, long double, int, std::vector<RID_Analytics::fwd_decision, std::allocator<RID_Analytics::fwd_decision>>&)
int RID_Analytics::add_fwd_decision(
    RID_Router * router,
    Path_State * prev_state,
    std::vector<std::vector<__float080> > out_fptree_probs,
    int iface,
    __float080 path_prob,
    int latency_incr,
    std::vector<RID_Analytics::fwd_decision> & fwd_decisions) {

    Path_State * next_state = new Path_State(router, this->request_size);

    next_state->set_length(prev_state->get_length() + latency_incr);
    next_state->set_in_fptree_prob(&out_fptree_probs[iface], 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);

    RID_Router::nw_address next_hop = router->get_next_hop(iface);
    next_state->set_tree_bitmasks(router->get_tree_bitmasks(iface));

    std::cout << "RID_Analytics::add_fwd_decision() : [INFO] saving fwd decision :"
        << "\n\tout[" << router->get_id() << "][" << iface << "] -> in[" << next_hop.router->get_id() << "][" << (int) next_hop.iface << "]"
        << "\n\tpath prob = " << path_prob
        << "\n\tpath length = " << prev_state->get_length() + latency_incr
        << "\n\tttl = " << (int) next_state->get_ttl() << std::endl;

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, %r13d
movl %r8d, %r12d
movq %rcx, 0x20(%rsp)
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %rbx
fldt 0xc0(%rsp)
fstpt 0x4c(%rsp)
movl $0x90, %edi
callq 0x4390
movq %rax, %r15
movzbl (%rbx), %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1ee30
movq %rbp, %rdi
callq 0x1ef10
movq %r13, 0x80(%rsp)
leal (%rax,%r13), %esi
movq %r15, %rdi
callq 0x1ef0c
movl %r12d, 0x1c(%rsp)
movslq %r12d, %r12
leaq (%r12,%r12,2), %rsi
shlq $0x3, %rsi
movq 0x20(%rsp), %rax
addq (%rax), %rsi
movzbl (%rbx), %edx
movq %r15, %rdi
callq 0x1ef28
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %r15, %rdi
callq 0x1ef1c
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %r15, %rdi
callq 0x1ef6c
movq %rbp, %rdi
movq %rbp, %r13
callq 0x1efc0
leal -0x1(%rax), %esi
movq %r15, %rdi
callq 0x1efb8
movzbl %r12b, %eax
movq 0x30(%r14), %rcx
leaq (%rax,%rax,4), %rax
shll $0x5, %eax
leaq (%rcx,%rax), %rsi
addq $0x60, %rsi
movq 0x30(%rsi), %rax
movq %rax, 0x20(%rsp)
movzbl 0x38(%rsi), %eax
movl %eax, 0x48(%rsp)
movq %r15, %r12
movq %r15, %rdi
callq 0x1efa8
movq 0x18ec0(%rip), %rbx     # 0x3efb8
leaq 0xb04a(%rip), %rsi      # 0x31149
movl $0x40, %edx
movq %rbx, %rdi
callq 0x4400
leaq 0xb077(%rip), %rsi      # 0x3118a
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4400
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r14), %rsi
movq %r14, 0x78(%rsp)
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x1bdb4
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %rbx, %rdi
callq 0x4400
movq %rax, %rbx
leaq 0xaf44(%rip), %rsi      # 0x310a3
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movq %rbx, %rdi
movl 0x1c(%rsp), %esi
callq 0x46d0
movq %rax, %rbp
leaq 0xb00f(%rip), %rsi      # 0x31191
movl $0x8, %edx
movq %rax, %rdi
callq 0x4400
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x1bdb4
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %rbp, %rdi
callq 0x4400
movl 0x48(%rsp), %ebp
movq %rax, %rbx
leaq 0xaed2(%rip), %rsi      # 0x310a3
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movq %rbx, %rdi
movl %ebp, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0x766c(%rip), %rsi      # 0x2d85e
movl $0x1, %edx
movq %rax, %rdi
callq 0x4400
leaq 0xaf94(%rip), %rsi      # 0x3119a
movl $0xe, %edx
movq %rbx, %rdi
callq 0x4400
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %rbx, %rdi
callq 0x41f0
movq %rax, %rbx
leaq 0xaf7d(%rip), %rsi      # 0x311a9
movl $0x10, %edx
movq %rax, %rdi
callq 0x4400
movq %r13, %rdi
callq 0x1ef10
addl 0x80(%rsp), %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0xaf5e(%rip), %rsi      # 0x311ba
movl $0x8, %edx
movq %rax, %rdi
callq 0x4400
movq %r12, %rdi
callq 0x1efc0
movq %rbx, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x42a0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
movq 0x78(%rsp), %r14
je 0x262c6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0xd0(%rsp), %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x262ea
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %r14, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x38(%rsp)
movl %ebp, 0x3c(%rsp)
movq %r12, 0x40(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x2632c
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x20, 0x8(%rbx)
jmp 0x26339
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x29764
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2635c
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
jmp 0x26397
movq %rax, %rbx
jmp 0x26380
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x26380
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2639c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %rbx, %rdi
callq 0x4700