// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl 0x20(%rdi), %eax
cmpl $0x2, %eax
je 0x131f4c
cmpl $0x1, %eax
je 0x131eef
testl %eax, %eax
jne 0x131fc4
movups 0x1b50(%rbx), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1b50(%rbx)
movq 0x1b60(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x362d(%rip), %rcx      # 0x1354d8
movq %rcx, 0x1b60(%rbx)
movq 0x1b68(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x35db(%rip), %rcx      # 0x1354a0
movq %rcx, 0x1b68(%rbx)
testq %rax, %rax
je 0x131ede
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1b50(%rbx), %rsi
movl $0x1b70, %eax           # imm = 0x1B70
jmp 0x131fb3
movups 0x1d10(%rbx), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1d10(%rbx)
movq 0x1d20(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x3611(%rip), %rcx      # 0x135528
movq %rcx, 0x1d20(%rbx)
movq 0x1d28(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x35bf(%rip), %rcx      # 0x1354f0
movq %rcx, 0x1d28(%rbx)
testq %rax, %rax
je 0x131fa7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x131fa7
movups 0x1d10(%rbx), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x1d10(%rbx)
movq 0x1d20(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x3600(%rip), %rcx      # 0x135574
movq %rcx, 0x1d20(%rbx)
movq 0x1d28(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x35b2(%rip), %rcx      # 0x135540
movq %rcx, 0x1d28(%rbx)
testq %rax, %rax
je 0x131fa7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1d10(%rbx), %rsi
movl $0x1d30, %eax           # imm = 0x1D30
addq %rax, %rbx
movq %rbx, %rdi
callq 0x135f7a
addq $0x20, %rsp
popq %rbx
retq
leaq 0x183ce(%rip), %rdi     # 0x14a399
leaq 0x295b8(%rip), %rsi     # 0x15b58a
leaq 0x29656(%rip), %rcx     # 0x15b62f
movl $0x138, %edx            # imm = 0x138
callq 0xb200
jmp 0x131fe7
jmp 0x131fe7
movq %rax, %rdi
callq 0x171a3
nop