// File: /workspace/github_cpp_makefile_star2_O1/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 0x135346
cmpl $0x1, %eax
je 0x1352db
testl %eax, %eax
jne 0x1353cc
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x362d(%rip), %rcx      # 0x13889c
movq %rcx, 0x18(%rsp)
leaq 0x3659(%rip), %rdx      # 0x1388d4
movq %rdx, 0x10(%rsp)
movups 0x1b50(%rbx), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1b50(%rbx)
movq 0x1b60(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1b60(%rbx)
movq 0x1b68(%rbx), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1b68(%rbx)
testq %rax, %rax
je 0x1352ca
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x1b50(%rbx), %rsi
movl $0x1b70, %eax           # imm = 0x1B70
jmp 0x1353bb
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x3603(%rip), %rcx      # 0x1388ec
movq %rcx, 0x18(%rsp)
leaq 0x362f(%rip), %rdx      # 0x138924
movq %rdx, 0x10(%rsp)
movups 0x1d10(%rbx), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1d10(%rbx)
movq 0x1d20(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1d20(%rbx)
movq 0x1d28(%rbx), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1d28(%rbx)
testq %rax, %rax
je 0x1353af
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x1353af
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x35e8(%rip), %rcx      # 0x13893c
movq %rcx, 0x18(%rsp)
leaq 0x3610(%rip), %rdx      # 0x138970
movq %rdx, 0x10(%rsp)
movups 0x1d10(%rbx), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, 0x1d10(%rbx)
movq 0x1d20(%rbx), %rax
movq %rax, 0x10(%rsp)
movq %rdx, 0x1d20(%rbx)
movq 0x1d28(%rbx), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, 0x1d28(%rbx)
testq %rax, %rax
je 0x1353af
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 0x1393e8
addq $0x20, %rsp
popq %rbx
retq
leaq 0x17f86(%rip), %rdi     # 0x14d359
leaq 0x29139(%rip), %rsi     # 0x15e513
leaq 0x291d7(%rip), %rcx     # 0x15e5b8
movl $0x138, %edx            # imm = 0x138
callq 0xb200
jmp 0x1353ef
jmp 0x1353ef
movq %rax, %rdi
callq 0x1718f
nop