// File: CMU-SAFARI[P]ramulator/src/MemoryFactory.cpp
// Function: ramulator::MemoryFactory<ramulator::SALP>::create(ramulator::Config const&, int)
MemoryBase *MemoryFactory<SALP>::create(const Config& configs, int cacheline) {
    int channels = stoi(configs["channels"], NULL, 0);
    int ranks = stoi(configs["ranks"], NULL, 0);
    int subarrays = stoi(configs["subarrays"], NULL, 0);
    validate(channels, ranks, configs);

    const string& std_name = configs["standard"];
    const string& org_name = configs["org"];
    const string& speed_name = configs["speed"];

    SALP *spec = new SALP(org_name, speed_name, std_name, subarrays);

    extend_channel_width(spec, cacheline);

    return (MemoryBase *)populate_memory(configs, spec, channels, ranks);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0xc5e0
movq -0x1f8(%rbp), %rdx
leaq 0x77191(%rip), %rsi     # 0x26008c
leaq -0x50(%rbp), %rdi
callq 0x17a40
jmp 0x1e8f06
movq -0x200(%rbp), %rsi
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x17af0
jmp 0x1e8f1c
xorl %edx, %edx
movl %edx, %esi
leaq -0x30(%rbp), %rdi
callq 0x3a920
movl %eax, -0x204(%rbp)
jmp 0x1e8f31
leaq -0x30(%rbp), %rdi
callq 0xc6b8
leaq -0x50(%rbp), %rdi
callq 0xc6b8
leaq -0x51(%rbp), %rdi
callq 0xc3c0
movl -0x204(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x210(%rbp)
callq 0xc5e0
movq -0x210(%rbp), %rdx
leaq 0x77393(%rip), %rsi     # 0x260314
leaq -0xa8(%rbp), %rdi
callq 0x17a40
jmp 0x1e8f8f
movq -0x218(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x17af0
jmp 0x1e8fab
xorl %edx, %edx
movl %edx, %esi
leaq -0x88(%rbp), %rdi
callq 0x3a920
movl %eax, -0x21c(%rbp)
jmp 0x1e8fc3
leaq -0x88(%rbp), %rdi
callq 0xc6b8
leaq -0xa8(%rbp), %rdi
callq 0xc6b8
leaq -0xa9(%rbp), %rdi
callq 0xc3c0
movl -0x21c(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xc5e0
movq -0x228(%rbp), %rdx
leaq 0x722ba(%rip), %rsi     # 0x25b2d6
leaq -0xf0(%rbp), %rdi
callq 0x17a40
jmp 0x1e902a
movq -0x230(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x17af0
jmp 0x1e9046
xorl %edx, %edx
movl %edx, %esi
leaq -0xd0(%rbp), %rdi
callq 0x3a920
movl %eax, -0x234(%rbp)
jmp 0x1e905e
leaq -0xd0(%rbp), %rdi
callq 0xc6b8
leaq -0xf0(%rbp), %rdi
callq 0xc6b8
leaq -0xf1(%rbp), %rdi
callq 0xc3c0
movl -0x234(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x10(%rbp), %edi
movl -0x68(%rbp), %esi
movq -0x8(%rbp), %rdx
callq 0x1e9880
movq -0x8(%rbp), %rax
movq %rax, -0x248(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xc5e0
movq -0x240(%rbp), %rdx
leaq 0x669db(%rip), %rsi     # 0x24faa4
leaq -0x140(%rbp), %rdi
callq 0x17a40
jmp 0x1e90d7
movq -0x248(%rbp), %rsi
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rdx
callq 0x17af0
jmp 0x1e90f3
leaq -0x140(%rbp), %rdi
callq 0xc6b8
leaq -0x141(%rbp), %rdi
callq 0xc3c0
leaq -0x120(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x258(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0xc5e0
movq -0x250(%rbp), %rdx
leaq 0x66a4a(%rip), %rsi     # 0x24fb8f
leaq -0x190(%rbp), %rdi
callq 0x17a40
jmp 0x1e9153
movq -0x258(%rbp), %rsi
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rdx
callq 0x17af0
jmp 0x1e916f
leaq -0x190(%rbp), %rdi
callq 0xc6b8
leaq -0x191(%rbp), %rdi
callq 0xc3c0
leaq -0x170(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x268(%rbp)
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0xc5e0
movq -0x260(%rbp), %rdx
leaq 0x669d2(%rip), %rsi     # 0x24fb93
leaq -0x1e0(%rbp), %rdi
callq 0x17a40
jmp 0x1e91cf
movq -0x268(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rdx
callq 0x17af0
jmp 0x1e91eb
leaq -0x1e0(%rbp), %rdi
callq 0xc6b8
leaq -0x1e1(%rbp), %rdi
callq 0xc3c0
leaq -0x1c0(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movl $0x3dc8, %edi           # imm = 0x3DC8
callq 0xc360
movq %rax, -0x270(%rbp)
jmp 0x1e9224
movq -0x270(%rbp), %rdi
movq -0x150(%rbp), %rsi
movq -0x1a0(%rbp), %rdx
movq -0x100(%rbp), %rcx
movl -0xb0(%rbp), %r8d
callq 0x2066a0
jmp 0x1e924e
movq -0x270(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f0(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1e98e0
jmp 0x1e926d
movq -0x8(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
movl -0x10(%rbp), %edx
movl -0x68(%rbp), %ecx
callq 0x1e99c0
movq %rax, -0x278(%rbp)
jmp 0x1e928c
leaq -0x1c0(%rbp), %rdi
callq 0xc6b8
leaq -0x170(%rbp), %rdi
callq 0xc6b8
leaq -0x120(%rbp), %rdi
callq 0xc6b8
movq -0x278(%rbp), %rax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e92fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e92f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xc6b8
leaq -0x50(%rbp), %rdi
callq 0xc6b8
leaq -0x51(%rbp), %rdi
callq 0xc3c0
jmp 0x1e9498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e9348
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e933c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xc6b8
leaq -0xa8(%rbp), %rdi
callq 0xc6b8
leaq -0xa9(%rbp), %rdi
callq 0xc3c0
jmp 0x1e9498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e9399
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e938d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0xc6b8
leaq -0xf0(%rbp), %rdi
callq 0xc6b8
leaq -0xf1(%rbp), %rdi
callq 0xc3c0
jmp 0x1e9498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e93d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x140(%rbp), %rdi
callq 0xc6b8
leaq -0x141(%rbp), %rdi
callq 0xc3c0
jmp 0x1e9498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e9407
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xc6b8
leaq -0x191(%rbp), %rdi
callq 0xc3c0
jmp 0x1e948c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e943b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xc6b8
leaq -0x1e1(%rbp), %rdi
callq 0xc3c0
jmp 0x1e9480
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e9474
movq -0x270(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x3dc8, %esi           # imm = 0x3DC8
callq 0xc370
leaq -0x1c0(%rbp), %rdi
callq 0xc6b8
leaq -0x170(%rbp), %rdi
callq 0xc6b8
leaq -0x120(%rbp), %rdi
callq 0xc6b8
movq -0x60(%rbp), %rdi
callq 0xc5d0
nopw %cs:(%rax,%rax)