// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]SMLA/src/Main.cpp
// Function: void run_cputrace<ramulator::WideIO>(ramulator::Config const&, ramulator::Memory<ramulator::WideIO, ramulator::Controller>&, std::vector<char const*, std::allocator<char const*>> const&)
void run_cputrace(const Config& configs, Memory<T, Controller>& memory, const std::vector<const char *>& files)
{
    int cpu_tick = configs.get_cpu_tick();
    int mem_tick = configs.get_mem_tick();
    auto send = bind(&Memory<T, Controller>::send, &memory, placeholders::_1);
    Processor proc(configs, files, send, memory);
    for (long i = 0; ; i++) {
        proc.tick();
        Stats::curTick++; // processor clock, global, for Statistics
        if (i % cpu_tick == (cpu_tick - 1))
            for (int j = 0; j < mem_tick; j++)
                memory.tick();
      if (configs.calc_weighted_speedup()) {
        if (proc.has_reached_limit()) {
          break;
        }
      } else {
        if (configs.is_early_exit()) {
          if (proc.finished())
              break;
        } else {
          if (proc.finished() && (memory.pending_requests() == 0))
              break;
        }
      }
    }
    // This a workaround for statistics set only initially lost in the end
    memory.finish();
    Stats::statlist.printall();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rsi, %rbx
movq %rdi, %r13
movslq 0x3c(%rdi), %rax
movq %rax, 0x8(%rsp)
movl 0x40(%rdi), %r14d
leaq 0x18(%rsp), %rdi
movq %rdx, %rsi
callq 0x1a6d4
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movl $0x18, %edi
callq 0x52c0
movq $0x21, (%rax)
movq $0x0, 0x8(%rax)
movq %rbx, 0x10(%rax)
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x9b75(%rip), %rax      # 0x1a9a0
movq %rax, 0x18(%rcx)
leaq 0x9b7a(%rip), %rax      # 0x1a9b0
movq %rax, 0x10(%rcx)
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %r13, %rsi
movq %rbx, %r8
callq 0x3ea5c
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x10e68
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x10e7f
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x52d0
movq 0x8(%rsp), %rax
decl %eax
cltq
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x3f294
testl %r14d, %r14d
setle %cl
leaq 0x5573e(%rip), %rax     # 0x665e8
incq (%rax)
movq %r15, %rax
cqto
idivq 0x8(%rsp)
cmpq 0x10(%rsp), %rdx
setne %al
orb %cl, %al
movl %r14d, %ebp
jne 0x10ed3
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
decl %ebp
jne 0x10ec6
cmpq $0x0, 0x48(%r13)
je 0x10ee4
movq %r12, %rdi
callq 0x3fb68
jmp 0x10ef8
movq %r13, %rdi
callq 0x1a754
testb %al, %al
je 0x10f01
movq %r12, %rdi
callq 0x3f95a
testb %al, %al
jne 0x10f1a
incq %r15
jmp 0x10e95
movq %r12, %rdi
callq 0x3f95a
testb %al, %al
je 0x10efc
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x10efc
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
leaq 0x554a6(%rip), %rdi     # 0x663d0
callq 0x1a848
leaq 0x58(%rsp), %rdi
callq 0x1a8e0
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10f6b
movq %rax, %rbx
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x10f76
leaq 0x30(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x10f76
movq %rax, %rdi
callq 0x7ce9
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x10fa0
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x52d0
jmp 0x10fa0
jmp 0x10f93
jmp 0x10f93
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1a8e0
movq %rbx, %rdi
callq 0x54c0