// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]ramulator/src/SALP.cpp
// Function: ramulator::SALP::init_rowopen()
void SALP::init_rowopen()
{
    switch(int(type)) {
        case int(Type::SALP_1):
            // RD
            rowopen[int(Level::Bank)][int(Command::RD)] = [] (DRAM<SALP>* node, Command cmd, int id) {
                switch (int(node->state)){
                    case int(State::Closed): return false;
                    case int(State::Opened): return true;
                    default: assert(false);
                }};
            // WR
            rowopen[int(Level::Bank)][int(Command::WR)] = rowopen[int(Level::Bank)][int(Command::RD)];
            break;
        case int(Type::SALP_2):
            // RD
            rowopen[int(Level::SubArray)][int(Command::RD)] = [] (DRAM<SALP>* node, Command cmd, int id) {
                switch (int(node->state)){
                    case int(State::Closed): return false;
                    case int(State::Opened): return true;
                    default: assert(false);
                }};
            // WR
            rowopen[int(Level::SubArray)][int(Command::WR)] = rowopen[int(Level::SubArray)][int(Command::RD)];
            break;
        case int(Type::MASA):
            // RD
            rowopen[int(Level::SubArray)][int(Command::RD)] = [] (DRAM<SALP>* node, Command cmd, int id) {
                switch (int(node->state)){
                    case int(State::Closed): return false;
                    case int(State::Opened): return true;
                    case int(State::Selected): return true;
                    default: assert(false);
                }};
            // WR
            rowopen[int(Level::SubArray)][int(Command::WR)] = rowopen[int(Level::SubArray)][int(Command::RD)];
            break;
        default: assert(false);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x20(%rdi), %eax
cmpl $0x2, %eax
je 0xbe803
cmpl $0x1, %eax
je 0xbe7c3
testl %eax, %eax
jne 0xbe868
leaq 0x1b50(%rbx), %r14
movups 0x1b50(%rbx), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1b50(%rbx)
movups 0x1b60(%rbx), %xmm0
leaq 0x22f3(%rip), %rax      # 0xc0a8e
movq %rax, 0x1b60(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x22a9(%rip), %rax      # 0xc0a56
movq %rax, 0x1b68(%rbx)
callq 0x96b6a
movl $0x1b70, %eax           # imm = 0x1B70
jmp 0xbe852
leaq 0x1d10(%rbx), %r14
movups 0x1d10(%rbx), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1d10(%rbx)
movups 0x1d20(%rbx), %xmm0
leaq 0x22ef(%rip), %rax      # 0xc0ade
movq %rax, 0x1d20(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x22a5(%rip), %rax      # 0xc0aa6
jmp 0xbe841
leaq 0x1d10(%rbx), %r14
movups 0x1d10(%rbx), %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1d10(%rbx)
movups 0x1d20(%rbx), %xmm0
leaq 0x22fb(%rip), %rax      # 0xc0b2a
movq %rax, 0x1d20(%rbx)
movaps %xmm0, 0x10(%rdi)
leaq 0x22b5(%rip), %rax      # 0xc0af6
movq %rax, 0x1d28(%rbx)
callq 0x96b6a
movl $0x1d30, %eax           # imm = 0x1D30
addq %rax, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc150a
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x12aea(%rip), %rdi     # 0xd1359
leaq 0x23cd4(%rip), %rsi     # 0xe254a
leaq 0x23d72(%rip), %rcx     # 0xe25ef
movl $0x138, %edx            # imm = 0x138
callq 0xb210
nop