// File: /workspace/github_cpp_makefile_star2_O1/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 0x1f2ec
movq %rbp, %rdi
callq 0x1f3a2
movq %r13, 0x80(%rsp)
leal (%rax,%r13), %esi
movq %r15, %rdi
callq 0x1f39e
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 0x1f3ba
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %r15, %rdi
callq 0x1f3ae
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %r15, %rdi
callq 0x1f3fe
movq %rbp, %rdi
movq %rbp, %r13
callq 0x1f452
leal -0x1(%rax), %esi
movq %r15, %rdi
callq 0x1f44a
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 0x1f43a
movq 0x199b2(%rip), %rbx     # 0x3ffb8
leaq 0xbd5c(%rip), %rsi      # 0x32369
movl $0x40, %edx
movq %rbx, %rdi
callq 0x4400
leaq 0xbd89(%rip), %rsi      # 0x323aa
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 0x1c27c
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %rbx, %rdi
callq 0x4400
movq %rax, %rbx
leaq 0xbc56(%rip), %rsi      # 0x322c3
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movq %rbx, %rdi
movl 0x1c(%rsp), %esi
callq 0x46d0
movq %rax, %rbp
leaq 0xbd21(%rip), %rsi      # 0x323b1
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 0x1c27c
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %rbp, %rdi
callq 0x4400
movl 0x48(%rsp), %ebp
movq %rax, %rbx
leaq 0xbbe4(%rip), %rsi      # 0x322c3
movl $0x2, %edx
movq %rax, %rdi
callq 0x4400
movq %rbx, %rdi
movl %ebp, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0x812e(%rip), %rsi      # 0x2e82e
movl $0x1, %edx
movq %rax, %rdi
callq 0x4400
leaq 0xbca6(%rip), %rsi      # 0x323ba
movl $0xe, %edx
movq %rbx, %rdi
callq 0x4400
fldt 0x4c(%rsp)
fstpt (%rsp)
movq %rbx, %rdi
callq 0x41f0
movq %rax, %rbx
leaq 0xbc8f(%rip), %rsi      # 0x323c9
movl $0x10, %edx
movq %rax, %rdi
callq 0x4400
movq %r13, %rdi
callq 0x1f3a2
addl 0x80(%rsp), %eax
movq %rbx, %rdi
movl %eax, %esi
callq 0x46d0
movq %rax, %rbx
leaq 0xbc70(%rip), %rsi      # 0x323da
movl $0x8, %edx
movq %rax, %rdi
callq 0x4400
movq %r12, %rdi
callq 0x1f452
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 0x267d4
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0xd0(%rsp), %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x267f8
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 0x2683a
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x20, 0x8(%rbx)
jmp 0x26847
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x29c38
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2686a
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
jmp 0x268a5
movq %rax, %rbx
jmp 0x2688e
movq %rax, %rbx
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x2688e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x268aa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq %rbx, %rdi
callq 0x4700