// File: /workspace/github_cpp_makefile_star2_O2/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, 0x18(%rsp)
movq %rsi, %r15
movl 0x30(%rdi), %ebp
movq %rdi, 0x10(%rsp)
movl 0x34(%rdi), %ebx
movq %rsi, %rdi
movl %ebp, %esi
callq 0xa02e8
movq %r15, %rdi
movl %ebx, %esi
callq 0xa02f0
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
andq $0x0, 0x10(%rax)
xorl %ebx, %ebx
testl %ebp, %ebp
cmovlel %ebx, %ebp
movaps %xmm0, (%rax)
leaq 0x90(%rsp), %r14
cmpl %ebx, %ebp
je 0x111d0
movl $0x898, %edi            # imm = 0x898
callq 0xb2d0
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x13d42
movl %ebx, 0x39c(%r12)
movq %r14, %rdi
leaq 0xc63de(%rip), %rsi     # 0xd7558
leaq 0x70(%rsp), %rdx
callq 0x10eea
movq %r12, %rdi
movq %r14, %rsi
callq 0x140e6
movq %r14, %rdi
callq 0xb568
movl $0x11e0, %edi           # imm = 0x11E0
callq 0xb2d0
movq %rax, %r13
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x14bb2
movq %r13, 0x90(%rsp)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x16aba
incl %ebx
jmp 0x11146
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x16ad8
leaq 0x90(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0x16b26
leaq 0x58(%rsp), %rdi
callq 0x1ce5e
movq 0x18(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x1131f
leaq 0xc0114(%rip), %rsi     # 0xd132d
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x70(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0x10f26
leaq 0xc00f5(%rip), %rsi     # 0xd1338
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x110e2
movl %eax, %ebp
movq %rbx, %rdi
callq 0xb568
leaq 0x20(%rsp), %rdi
callq 0xb568
testb %bpl, %bpl
je 0x11282
leaq 0x90(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
callq 0x17ff9
jmp 0x112f6
leaq 0xc00a4(%rip), %rsi     # 0xd132d
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x10eea
leaq 0x70(%rsp), %rdi
leaq 0x20(%rsp), %rdx
movq 0x10(%rsp), %rsi
callq 0x10f26
leaq 0xc1041(%rip), %rsi     # 0xd22f4
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x110e2
movl %eax, %ebp
movq %rbx, %rdi
callq 0xb568
leaq 0x20(%rsp), %rdi
callq 0xb568
testb %bpl, %bpl
je 0x112f6
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq 0x90(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x182db
leaq 0x90(%rsp), %rdi
callq 0x184b6
leaq 0x40(%rsp), %rdi
callq 0x1ce5e
addq $0xcf8, %rsp            # imm = 0xCF8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc01cb(%rip), %rdi     # 0xd14f1
leaq 0xbffd0(%rip), %rsi     # 0xd12fd
leaq 0xc01cf(%rip), %rcx     # 0xd1503
movl $0xaa, %edx
callq 0xb210
jmp 0x11344
jmp 0x11353
jmp 0x11353
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xb568
jmp 0x11356
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x184b6
jmp 0x113ae
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1ce5e
jmp 0x113ae
jmp 0x113ab
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xb568
jmp 0x113ae
movq %rax, %rbx
movl $0x11e0, %esi           # imm = 0x11E0
movq %r13, %rdi
jmp 0x113a2
jmp 0x113ab
movq %rax, %rbx
movl $0x898, %esi            # imm = 0x898
movq %r12, %rdi
callq 0xb2e0
jmp 0x113ae
jmp 0x113ab
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x1ce5e
movq %rbx, %rdi
callq 0xb4d0