// File: /workspace/github_cpp_makefile_star2_O3/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 0x10b1bc
movq %r14, 0x50(%rsp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x10b1c4
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testl %ebp, %ebp
jle 0x13e19
xorl %r15d, %r15d
leaq 0x13c890(%rip), %r12    # 0x1505dc
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 0x176d0
movl %r15d, 0x39c(%r14)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq %r12, %rdx
callq 0x175a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x17bce
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x13dc5
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 0x19eb4
movq %rbx, 0x90(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x13e00
movq %rbx, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x13e0d
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x25d5a
incl %r15d
cmpl %r15d, %ebp
jne 0x13d54
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1e5d0
leaq 0x90(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq (%rsp), %rsi
callq 0x1e650
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x13e55
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rax
cmpq (%rcx), %rax
je 0x13fd1
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1364f6(%rip), %rsi    # 0x14a36d
leaq 0x1364f9(%rip), %rdx    # 0x14a377
leaq 0x30(%rsp), %rdi
callq 0x175a0
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq (%rsp), %rsi
callq 0x13b46
leaq 0x1364d6(%rip), %rsi    # 0x14a378
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xb100
movl %eax, %ebp
movq (%rbx), %rdi
leaq 0x80(%rsp), %r15
cmpq %r15, %rdi
je 0x13ed1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x13ee8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
testl %ebp, %ebp
je 0x13f85
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x13646e(%rip), %rsi    # 0x14a36d
leaq 0x136471(%rip), %rdx    # 0x14a377
callq 0x175a0
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq (%rsp), %rsi
callq 0x13b46
leaq 0x13740f(%rip), %rsi    # 0x14b334
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xb100
movl %eax, %ebp
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x13f4c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb2f0
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x13f63
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
testl %ebp, %ebp
jne 0x13f9b
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdx
leaq 0x90(%rsp), %rsi
movq (%rsp), %rdi
callq 0x20a90
jmp 0x13f9b
leaq 0x90(%rsp), %rsi
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
callq 0x20762
leaq 0x90(%rsp), %rdi
callq 0x20d7e
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x13fbf
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 0x136559(%rip), %rdi    # 0x14a531
leaq 0x13635e(%rip), %rsi    # 0x14a33d
leaq 0x13655d(%rip), %rcx    # 0x14a543
movl $0xaa, %edx
callq 0xb200
jmp 0x14012
jmp 0x13ff6
jmp 0x14012
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x14015
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xb2f0
jmp 0x14015
movq %rax, %r15
leaq 0x90(%rsp), %rdi
callq 0x20d7e
jmp 0x14088
movq %rax, %r15
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x14088
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
jmp 0x1407e
jmp 0x14085
jmp 0x14085
movq %rax, %r15
movl $0x898, %esi            # imm = 0x898
movq %r14, %rdi
jmp 0x1407e
jmp 0x14085
movq %rax, %r15
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x14088
movq 0xa0(%rsp), %rsi
incq %rsi
jmp 0x1407e
movq %rax, %r15
movl $0x11e0, %esi           # imm = 0x11E0
movq %rbx, %rdi
callq 0xb2f0
jmp 0x14088
movq %rax, %r15
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1409f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0xb2f0
movq %r15, %rdi
callq 0xb510