// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]ramulator/src/Main.cpp
// Function: void start_run<ramulator::DDR3>(ramulator::Config const&, ramulator::DDR3*, std::vector<char const*, std::allocator<char const*>> const&)
void start_run(const Config& configs, T* spec, const vector<const char*>& files) {
  // initiate controller and memory
  int C = configs.get_channels(), R = configs.get_ranks();
  // Check and Set channel, rank number
  spec->set_channel_number(C);
  spec->set_rank_number(R);
  std::vector<Controller<T>*> ctrls;
  for (int c = 0 ; c < C ; c++) {
    DRAM<T>* channel = new DRAM<T>(spec, T::Level::Channel);
    channel->id = c;
    channel->regStats("");
    Controller<T>* ctrl = new Controller<T>(configs, channel);
    ctrls.push_back(ctrl);
  }
  Memory<T, Controller> memory(configs, ctrls);

  assert(files.size() != 0);
  if (configs["trace_type"] == "CPU") {
    run_cputrace(configs, memory, files);
  } else if (configs["trace_type"] == "DRAM") {
    run_dramtrace(configs, memory, files[0]);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xcf8, %rsp            # imm = 0xCF8
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movl 0x30(%rdi), %ebp
movq %rdi, (%rsp)
movl 0x34(%rdi), %ebx
movq %rsi, %rdi
movl %ebp, %esi
callq 0x10e062
movq %r14, 0x50(%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x10e06a
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %ebp, %ebp
jle 0x13e05
xorl %r15d, %r15d
leaq 0x13f864(%rip), %r12    # 0x15359c
leaq 0x90(%rsp), %r13
movl $0x898, %edi            # imm = 0x898
callq 0xb2e0
movq %rax, %r14
movq %rax, %rdi
movq 0x50(%rsp), %rsi
xorl %edx, %edx
callq 0x176bc
movl %r15d, 0x39c(%r14)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x17586
movq %r14, %rdi
movq %r13, %rsi
callq 0x17bc0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x13db1
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0xb2f0
movl $0x11e0, %edi           # imm = 0x11E0
callq 0xb2e0
movq %rax, %rbx
movq %rax, %rdi
movq (%rsp), %rsi
movq %r14, %rdx
callq 0x19eae
movq %rbx, 0x90(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x13dec
movq %rbx, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x13df9
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x25c98
incl %r15d
cmpl %r15d, %ebp
jne 0x13d40
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1e5e8
leaq 0x90(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq (%rsp), %rsi
callq 0x1e668
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x13e41
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x13fbd
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1394ca(%rip), %rsi    # 0x14d32d
leaq 0x1394cd(%rip), %rdx    # 0x14d337
leaq 0x30(%rsp), %rdi
callq 0x17586
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq (%rsp), %rsi
callq 0x13b32
leaq 0x1394aa(%rip), %rsi    # 0x14d338
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xb100
movl %eax, %ebp
movq (%rbx), %rdi
leaq 0x80(%rsp), %r15
cmpq %r15, %rdi
je 0x13ebd
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x13ed4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
testl %ebp, %ebp
je 0x13f71
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x139442(%rip), %rsi    # 0x14d32d
leaq 0x139445(%rip), %rdx    # 0x14d337
callq 0x17586
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq (%rsp), %rsi
callq 0x13b32
leaq 0x13a3e3(%rip), %rsi    # 0x14e2f4
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xb100
movl %eax, %ebp
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x13f38
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x13f4f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
testl %ebp, %ebp
jne 0x13f87
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq 0x90(%rsp), %rsi
movq (%rsp), %rdi
callq 0x20b16
jmp 0x13f87
leaq 0x90(%rsp), %rsi
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
callq 0x207da
leaq 0x90(%rsp), %rdi
callq 0x20e08
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13fab
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
addq $0xcf8, %rsp            # imm = 0xCF8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13952d(%rip), %rdi    # 0x14d4f1
leaq 0x139332(%rip), %rsi    # 0x14d2fd
leaq 0x139531(%rip), %rcx    # 0x14d503
movl $0xaa, %edx
callq 0xb200
jmp 0x13ffe
jmp 0x13fe2
jmp 0x13ffe
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x14001
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x14001
movq %rax, %r15
leaq 0x90(%rsp), %rdi
callq 0x20e08
jmp 0x14074
movq %rax, %r15
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x14074
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
jmp 0x1406a
jmp 0x14071
jmp 0x14071
movq %rax, %r15
movl $0x898, %esi            # imm = 0x898
movq %r14, %rdi
jmp 0x1406a
jmp 0x14071
movq %rax, %r15
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x14074
movq 0xa0(%rsp), %rsi
incq %rsi
jmp 0x1406a
movq %rax, %r15
movl $0x11e0, %esi           # imm = 0x11E0
movq %rbx, %rdi
callq 0xb2f0
jmp 0x14074
movq %rax, %r15
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1408b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %r15, %rdi
callq 0xb510