// File: adamiaonr[P]rid-analytics/src/rid-analytics.cpp
// Function: RID_Analytics::RID_Analytics(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned char, unsigned short, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
RID_Analytics::RID_Analytics(
    std::string nw_filename,
    uint8_t request_size,
    uint16_t bf_size,
    std::string origin_server_id,
    int mode,
    std::string output_dir,
    std::string output_label) {

    // initialize the scenario parameters set at runtime
    this->request_size = request_size;
    this->bf_size = bf_size;
    this->mode = mode;
    std::cout << "RID_Analytics::RID_Analytics() [INFO] : mode = " 
        << std::bitset<(sizeof(int) * 8)>(this->mode) << std::endl;

    // ... and build the network
    build_network(nw_filename);
    read_scn(nw_filename);

    // after building the network, save the origin server pointer
    this->origin_server = this->routers[origin_server_id];
    std::cout << "RID_Analytics::RID_Analytics() [INFO] : origin_server_id = " 
        << this->routers[origin_server_id]->get_id() << std::endl;

    // init output files
    init_output(output_label, output_dir);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %r8, -0x130(%rbp)
movq %rsi, -0x128(%rbp)
movw %cx, %ax
movb %dl, %cl
movq 0x18(%rbp), %rdx
movq %rdx, -0x120(%rbp)
movq 0x10(%rbp), %rdx
movq %rdx, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %cl, -0x11(%rbp)
movw %ax, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
addq $0x8, %rdi
movq %rdi, -0x110(%rbp)
callq 0x38e40
movq -0xf0(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x108(%rbp)
callq 0x518b0
movq -0xf0(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0x100(%rbp)
callq 0x518d0
movq -0xf0(%rbp), %rdi
addq $0x98, %rdi
movq %rdi, -0xf8(%rbp)
callq 0x518f0
movq -0xf0(%rbp), %rax
movb -0x11(%rbp), %cl
movb %cl, (%rax)
movw -0x14(%rbp), %cx
movw %cx, 0x2(%rax)
movl -0x24(%rbp), %ecx
movl %ecx, 0x4(%rax)
movq 0x36b49(%rip), %rdi     # 0x81fb8
leaq 0x189fa(%rip), %rsi     # 0x63e70
callq 0x5480
movq %rax, -0xe8(%rbp)
jmp 0x4b484
movq -0xf0(%rbp), %rax
movslq 0x4(%rax), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x51a10
movq -0xe8(%rbp), %rdi
movq -0x140(%rbp), %rsi
callq 0x51910
movq %rax, -0x138(%rbp)
jmp 0x4b4bb
movq -0x138(%rbp), %rdi
movq 0x36ac7(%rip), %rsi     # 0x81f90
callq 0x54f0
jmp 0x4b4d0
movq -0x128(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x51f0
jmp 0x4b4e2
movq -0xf0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b720
jmp 0x4b4f4
leaq -0x60(%rbp), %rdi
callq 0x52f0
movq -0x128(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x51f0
jmp 0x4b50f
movq -0xf0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4cf40
jmp 0x4b521
leaq -0x80(%rbp), %rdi
callq 0x52f0
movq -0xf0(%rbp), %rdi
movq -0x130(%rbp), %rsi
addq $0x50, %rdi
callq 0x51a60
movq %rax, -0x148(%rbp)
jmp 0x4b54a
movq -0xf0(%rbp), %rax
movq -0x148(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x80(%rax)
movq 0x36a4f(%rip), %rdi     # 0x81fb8
leaq 0x18930(%rip), %rsi     # 0x63ea0
callq 0x5480
movq %rax, -0x150(%rbp)
jmp 0x4b57e
movq -0x130(%rbp), %rsi
movq -0xf0(%rbp), %rdi
addq $0x50, %rdi
callq 0x51a60
movq %rax, -0x158(%rbp)
jmp 0x4b59e
movq -0x158(%rbp), %rax
movq (%rax), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x35650
jmp 0x4b5b6
movq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5430
movq %rax, -0x160(%rbp)
jmp 0x4b5d2
movq -0x160(%rbp), %rdi
movq 0x369b0(%rip), %rsi     # 0x81f90
callq 0x54f0
jmp 0x4b5e7
leaq -0xa0(%rbp), %rdi
callq 0x52f0
movq -0x120(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x51f0
jmp 0x4b608
movq -0x118(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x51f0
jmp 0x4b61d
movq -0xf0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x4d780
jmp 0x4b639
leaq -0xe0(%rbp), %rdi
callq 0x52f0
leaq -0xc0(%rbp), %rdi
callq 0x52f0
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4b6e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x52f0
jmp 0x4b6e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x52f0
jmp 0x4b6e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x52f0
jmp 0x4b6e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4b6d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x52f0
leaq -0xc0(%rbp), %rdi
callq 0x52f0
movq -0xf8(%rbp), %rdi
callq 0x51b40
movq -0x100(%rbp), %rdi
callq 0x51ba0
movq -0x108(%rbp), %rdi
callq 0x51bc0
movq -0x110(%rbp), %rdi
callq 0x34b10
movq -0x30(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)