// File: CMU-SAFARI[P]ramulator/src/Memory.h
// Function: ramulator::Memory<ramulator::DDR3, ramulator::Controller>::tick()
void tick()
    {
        ++num_dram_cycles;
        int cur_que_req_num = 0;
        int cur_que_readreq_num = 0;
        int cur_que_writereq_num = 0;
        for (auto ctrl : ctrls) {
          cur_que_req_num += ctrl->readq.size() + ctrl->writeq.size() + ctrl->pending.size();
          cur_que_readreq_num += ctrl->readq.size() + ctrl->pending.size();
          cur_que_writereq_num += ctrl->writeq.size();
        }
        in_queue_req_num_sum += cur_que_req_num;
        in_queue_read_req_num_sum += cur_que_readreq_num;
        in_queue_write_req_num_sum += cur_que_writereq_num;

        bool is_active = false;
        for (auto ctrl : ctrls) {
          is_active = is_active || ctrl->is_active();
          ctrl->tick();
        }
        if (is_active) {
          ramulator_active_cycles++;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
addq $0xa0, %rdi
callq 0x3fd50
movq -0x68(%rbp), %rax
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
addq $0xc08, %rax            # imm = 0xC08
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x36f70
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x36e00
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3fd70
testb $0x1, %al
jne 0x387f6
jmp 0x388b2
leaq -0x28(%rbp), %rdi
callq 0x3fdb0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10c0, %rdi           # imm = 0x10C0
callq 0x3fdd0
movl %eax, -0x7c(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10e0, %rdi           # imm = 0x10E0
callq 0x3fdd0
movl %eax, %ecx
movl -0x7c(%rbp), %eax
addl %ecx, %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1140, %rdi           # imm = 0x1140
callq 0x3fdf0
movq -0x78(%rbp), %rcx
addq %rax, %rcx
movslq -0xc(%rbp), %rax
addq %rcx, %rax
movl %eax, -0xc(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10c0, %rdi           # imm = 0x10C0
callq 0x3fdd0
movl %eax, %eax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1140, %rdi           # imm = 0x1140
callq 0x3fdf0
movq -0x70(%rbp), %rcx
addq %rax, %rcx
movslq -0x10(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x10(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10e0, %rdi           # imm = 0x10E0
callq 0x3fdd0
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3fe20
jmp 0x387e0
movq -0x68(%rbp), %rdi
addq $0x658, %rdi            # imm = 0x658
leaq -0xc(%rbp), %rsi
callq 0x3fe40
movq -0x68(%rbp), %rdi
addq $0x6f0, %rdi            # imm = 0x6F0
leaq -0x10(%rbp), %rsi
callq 0x3fe40
movq -0x68(%rbp), %rdi
addq $0x788, %rdi            # imm = 0x788
leaq -0x14(%rbp), %rsi
callq 0x3fe40
movq -0x68(%rbp), %rax
movb $0x0, -0x39(%rbp)
addq $0xc08, %rax            # imm = 0xC08
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x36f70
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x36e00
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3fd70
testb $0x1, %al
jne 0x3892d
jmp 0x38970
leaq -0x50(%rbp), %rdi
callq 0x3fdb0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movb $0x1, %al
testb $0x1, -0x39(%rbp)
movb %al, -0x7d(%rbp)
jne 0x38954
movq -0x60(%rbp), %rdi
callq 0x3fe70
movb %al, -0x7d(%rbp)
movb -0x7d(%rbp), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
movq -0x60(%rbp), %rdi
callq 0x3fea0
leaq -0x50(%rbp), %rdi
callq 0x3fe20
jmp 0x3891a
testb $0x1, -0x39(%rbp)
je 0x38988
movq -0x68(%rbp), %rdi
addq $0x330, %rdi            # imm = 0x330
xorl %esi, %esi
callq 0x40970
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)