// File: /workspace/github_cpp_makefile_star2_O1/ynilu[P]elastic/traffic.cpp
// Function: Traffic::Traffic(Traffic_info&)
Traffic::Traffic(Traffic_info& t_info)
{
    num_nodes = t_info.num_nodes;
    num_requests = t_info.num_requests;
    total_OCx_share =
        t_info.OC1_share +
        t_info.OC3_share +
        t_info.OC9_share +
        t_info.OC12_share +
        t_info.OC18_share +
        t_info.OC24_share +
        t_info.OC36_share +
        t_info.OC48_share +
        t_info.OC192_share +
        t_info.OC768_share +
        t_info.OC3072_share;
    OC1_ratio = 1.0 * t_info.OC1_share / total_OCx_share;
    OC3_ratio = OC1_ratio + 1.0 * t_info.OC3_share / total_OCx_share;
    OC9_ratio = OC3_ratio + 1.0 * t_info.OC9_share / total_OCx_share;
    OC12_ratio = OC9_ratio + 1.0 * t_info.OC12_share / total_OCx_share;
    OC18_ratio = OC12_ratio + 1.0 * t_info.OC18_share / total_OCx_share;
    OC24_ratio = OC18_ratio + 1.0 * t_info.OC24_share / total_OCx_share;
    OC36_ratio = OC24_ratio + 1.0 * t_info.OC36_share / total_OCx_share;
    OC48_ratio = OC36_ratio + 1.0 * t_info.OC48_share / total_OCx_share;
    OC192_ratio = OC48_ratio + 1.0 * t_info.OC192_share / total_OCx_share;
    OC768_ratio = OC192_ratio + 1.0 * t_info.OC768_share / total_OCx_share;
    OC3072_ratio = OC768_ratio + 1.0 * t_info.OC3072_share / total_OCx_share;


    traffic_lambda = t_info.traffic_lambda;
    traffic_mu = t_info.traffic_mu;
    unicast_percentage = t_info.unicast_percentage;
    aTime_seed = t_info.aTime_seed;
    hTime_seed = t_info.hTime_seed;
    s_seed = t_info.s_seed;
    d_seed = t_info.d_seed;
    numD_seed = t_info.numD_seed;
    b_seed = t_info.b_seed;

    // resize the containers for the data read from file
    source_matrix.resize(num_nodes);
    num_dest_matrix.resize(num_nodes);
    traffic_matrix.resize(num_nodes);
    for(auto &element : traffic_matrix)
    {
        element.resize(num_nodes);
    }

    total_dest_count.resize(num_nodes);
    for(auto &element : total_dest_count)
    {
        element.resize(num_nodes);
    }

    read_source_file(t_info.source_file);
    read_traffic_file(t_info.traffic_file);

    generate_traffic();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x9dd5(%rip), %rax      # 0x17c60
movq %rax, (%rdi)
leaq 0x68(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x58(%rdi)
movq %rax, 0x70(%rdi)
movq %rax, 0x18(%rsp)
movq %rax, 0x68(%rdi)
movq $0x0, 0x78(%rdi)
movups %xmm0, 0xe8(%rdi)
movups %xmm0, 0xf8(%rdi)
movups %xmm0, 0x104(%rdi)
movslq 0x10(%rsi), %rax
movq %rax, 0x20(%rsp)
movl %eax, 0x80(%rdi)
movl 0x14(%rsi), %eax
movl %eax, 0x84(%rdi)
movl 0x58(%rsi), %ebp
movl 0x5c(%rsi), %r13d
movl 0x60(%rsi), %r12d
movl 0x64(%rsi), %r10d
leal (%r12,%r10), %ecx
addl %r13d, %ecx
addl %ebp, %ecx
movl 0x68(%rsi), %r11d
movl 0x6c(%rsi), %r9d
leal (%r11,%r9), %r14d
movl 0x70(%rsi), %r8d
addl %r8d, %r14d
addl %ecx, %r14d
movl 0x74(%rsi), %edi
movl 0x78(%rsi), %edx
leal (%rdi,%rdx), %eax
movl 0x7c(%rsi), %ecx
addl %ecx, %eax
movl 0x80(%rsi), %esi
addl %esi, %eax
addl %r14d, %eax
cvtsi2sd %ebp, %xmm1
movl %eax, 0x88(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
cvtsi2sd %r13d, %xmm2
cvtsi2sd %r12d, %xmm3
cvtsi2sd %r10d, %xmm4
cvtsi2sd %r11d, %xmm5
cvtsi2sd %r9d, %xmm6
cvtsi2sd %r8d, %xmm7
divsd %xmm0, %xmm1
movsd %xmm1, 0x90(%rbx)
divsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0x98(%rbx)
divsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, 0xa0(%rbx)
divsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, 0xa8(%rbx)
divsd %xmm0, %xmm5
addsd %xmm4, %xmm5
movsd %xmm5, 0xb0(%rbx)
divsd %xmm0, %xmm6
addsd %xmm5, %xmm6
movsd %xmm6, 0xb8(%rbx)
divsd %xmm0, %xmm7
addsd %xmm6, %xmm7
movsd %xmm7, 0xc0(%rbx)
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
divsd %xmm0, %xmm1
addsd %xmm7, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
movsd %xmm1, 0xc8(%rbx)
divsd %xmm0, %xmm2
addsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
leaq 0x38(%rbx), %rbp
movsd %xmm2, 0xd0(%rbx)
divsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, 0xd8(%rbx)
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
divsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0xe0(%rbx)
movl 0x18(%r15), %eax
movl %eax, 0x114(%rbx)
movl 0x1c(%r15), %eax
movl %eax, 0x118(%rbx)
movss 0x20(%r15), %xmm0
movss %xmm0, 0x11c(%rbx)
movq 0x28(%r15), %rax
movq %rax, 0x120(%rbx)
movq 0x30(%r15), %rax
movq %rax, 0x128(%rbx)
movq 0x38(%r15), %rax
movq %rax, 0x130(%rbx)
movq 0x40(%r15), %rax
movq %rax, 0x138(%rbx)
movq 0x48(%r15), %rax
movq %rax, 0x140(%rbx)
movq 0x50(%r15), %rax
movq %rax, 0x148(%rbx)
leaq 0x50(%rbx), %r12
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0xed8a
movslq 0x80(%rbx), %rsi
movq %r12, %rdi
callq 0xedbc
movslq 0x80(%rbx), %rsi
movq 0x10(%rsp), %rdi
callq 0xedee
movq 0x20(%rbx), %r13
movq 0x28(%rbx), %r14
cmpq %r14, %r13
je 0xe0fa
movslq 0x80(%rbx), %rsi
movq %r13, %rdi
callq 0xed8a
addq $0x18, %r13
jmp 0xe0e0
movslq 0x80(%rbx), %rsi
movq 0x8(%rsp), %rdi
callq 0xb98a
movq 0x8(%rbx), %r13
movq 0x10(%rbx), %r14
cmpq %r14, %r13
je 0xe12d
movslq 0x80(%rbx), %rsi
movq %r13, %rdi
callq 0xedbc
addq $0x18, %r13
jmp 0xe113
movq (%r15), %rsi
movq %rbx, %rdi
callq 0xe1b2
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0xe2fa
movq %rbx, %rdi
callq 0xe44a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe15f
jmp 0xe15f
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x91e6
movq (%r12), %rdi
testq %rdi, %rdi
je 0xe181
movq 0x60(%rbx), %rsi
subq %rdi, %rsi
callq 0x3230
movq (%rbp), %rdi
testq %rdi, %rdi
je 0xe196
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x10(%rsp), %rdi
callq 0x8cf6
movq 0x8(%rsp), %rdi
callq 0x8d44
movq %r15, %rdi
callq 0x3370