// File: /workspace/github_cpp_makefile_star2_O3/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 0x95c5(%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)
movq 0x10(%rsi), %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x80(%rdi)
movl 0x58(%rsi), %r14d
movl 0x5c(%rsi), %ebp
movl 0x60(%rsi), %r13d
movl 0x64(%rsi), %r11d
leal (%r13,%r11), %edx
addl %ebp, %edx
addl %r14d, %edx
movl 0x68(%rsi), %r12d
movl 0x6c(%rsi), %r9d
leal (%r12,%r9), %eax
movl 0x70(%rsi), %r8d
addl %r8d, %eax
addl %edx, %eax
movl 0x74(%rsi), %edi
movl 0x78(%rsi), %esi
leal (%rdi,%rsi), %r10d
movl 0x7c(%r15), %edx
addl %edx, %r10d
movl 0x80(%r15), %ecx
addl %ecx, %r10d
addl %eax, %r10d
cvtsi2sd %r14d, %xmm1
cvtsi2sd %ebp, %xmm2
cvtsi2sd %r13d, %xmm3
cvtsi2sd %r11d, %xmm4
cvtsi2sd %r12d, %xmm5
cvtsi2sd %r9d, %xmm6
cvtsi2sd %r8d, %xmm7
xorps %xmm0, %xmm0
cvtsi2sd %r10d, %xmm0
movl %r10d, 0x88(%rbx)
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
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
movsd %xmm7, 0xc0(%rbx)
divsd %xmm0, %xmm1
addsd %xmm7, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %esi, %xmm2
leaq 0x20(%rbx), %rax
movq %rax, 0x10(%rsp)
movsd %xmm1, 0xc8(%rbx)
divsd %xmm0, %xmm2
addsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
leaq 0x38(%rbx), %rbp
movsd %xmm2, 0xd0(%rbx)
divsd %xmm0, %xmm1
addsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
movsd %xmm1, 0xd8(%rbx)
divsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd %xmm2, 0xe0(%rbx)
movq 0x18(%r15), %rax
movq %rax, 0x114(%rbx)
leaq 0x50(%rbx), %r12
movss 0x20(%r15), %xmm0
movss %xmm0, 0x11c(%rbx)
movups 0x28(%r15), %xmm0
movups %xmm0, 0x120(%rbx)
movups 0x38(%r15), %xmm0
movups %xmm0, 0x130(%rbx)
movups 0x48(%r15), %xmm0
movups %xmm0, 0x140(%rbx)
movslq 0x20(%rsp), %rsi
movq %rbp, %rdi
callq 0xf574
movslq 0x80(%rbx), %rsi
movq %r12, %rdi
callq 0xf5a6
movslq 0x80(%rbx), %rsi
movq 0x10(%rsp), %rdi
callq 0xf5d8
movq 0x20(%rbx), %r13
movq 0x28(%rbx), %r14
cmpq %r14, %r13
je 0xe8e2
movslq 0x80(%rbx), %rsi
movq %r13, %rdi
callq 0xf574
addq $0x18, %r13
jmp 0xe8c8
movslq 0x80(%rbx), %rsi
movq 0x8(%rsp), %rdi
callq 0xc094
movq 0x8(%rbx), %r13
movq 0x10(%rbx), %r14
cmpq %r14, %r13
je 0xe915
movslq 0x80(%rbx), %rsi
movq %r13, %rdi
callq 0xf5a6
addq $0x18, %r13
jmp 0xe8fb
movq (%r15), %rsi
movq %rbx, %rdi
callq 0xe99a
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0xeae2
movq %rbx, %rdi
callq 0xec32
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe947
jmp 0xe947
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x95a8
movq (%r12), %rdi
testq %rdi, %rdi
je 0xe969
movq 0x60(%rbx), %rsi
subq %rdi, %rsi
callq 0x3230
movq (%rbp), %rdi
testq %rdi, %rdi
je 0xe97e
movq 0x48(%rbx), %rsi
subq %rdi, %rsi
callq 0x3230
movq 0x10(%rsp), %rdi
callq 0x90ac
movq 0x8(%rsp), %rdi
callq 0x9100
movq %r15, %rdi
callq 0x3370