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

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

    WideIO2 *spec = new WideIO2(org_name, speed_name, channels);

    extend_channel_width(spec, cacheline);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0xc5e0
movq -0x160(%rbp), %rdx
leaq 0x775b1(%rip), %rsi     # 0x26008c
leaq -0x50(%rbp), %rdi
callq 0x17a40
jmp 0x1e8ae6
movq -0x168(%rbp), %rsi
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x17af0
jmp 0x1e8afc
xorl %edx, %edx
movl %edx, %esi
leaq -0x30(%rbp), %rdi
callq 0x3a920
movl %eax, -0x16c(%rbp)
jmp 0x1e8b11
leaq -0x30(%rbp), %rdi
callq 0xc6b8
leaq -0x50(%rbp), %rdi
callq 0xc6b8
leaq -0x51(%rbp), %rdi
callq 0xc3c0
movl -0x16c(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0xc5e0
movq -0x178(%rbp), %rdx
leaq 0x777b3(%rip), %rsi     # 0x260314
leaq -0xa8(%rbp), %rdi
callq 0x17a40
jmp 0x1e8b6f
movq -0x180(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x17af0
jmp 0x1e8b8b
xorl %edx, %edx
movl %edx, %esi
leaq -0x88(%rbp), %rdi
callq 0x3a920
movl %eax, -0x184(%rbp)
jmp 0x1e8ba3
leaq -0x88(%rbp), %rdi
callq 0xc6b8
leaq -0xa8(%rbp), %rdi
callq 0xc6b8
leaq -0xa9(%rbp), %rdi
callq 0xc3c0
movl -0x184(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x10(%rbp), %edi
movl -0x68(%rbp), %esi
movq -0x8(%rbp), %rdx
callq 0x1e89a0
movq -0x8(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0xc5e0
movq -0x190(%rbp), %rdx
leaq 0x66f84(%rip), %rsi     # 0x24fb8f
leaq -0xf8(%rbp), %rdi
callq 0x17a40
jmp 0x1e8c19
movq -0x198(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
callq 0x17af0
jmp 0x1e8c35
leaq -0xf8(%rbp), %rdi
callq 0xc6b8
leaq -0xf9(%rbp), %rdi
callq 0xc3c0
leaq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x149(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xc5e0
movq -0x1a0(%rbp), %rdx
leaq 0x66f0c(%rip), %rsi     # 0x24fb93
leaq -0x148(%rbp), %rdi
callq 0x17a40
jmp 0x1e8c95
movq -0x1a8(%rbp), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rdx
callq 0x17af0
jmp 0x1e8cb1
leaq -0x148(%rbp), %rdi
callq 0xc6b8
leaq -0x149(%rbp), %rdi
callq 0xc3c0
leaq -0x128(%rbp), %rax
movq %rax, -0x108(%rbp)
movl $0x2a30, %edi           # imm = 0x2A30
callq 0xc360
movq %rax, -0x1b0(%rbp)
jmp 0x1e8cea
movq -0x1b0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq -0x108(%rbp), %rdx
movl -0x10(%rbp), %ecx
callq 0x2451a0
jmp 0x1e8d09
movq -0x1b0(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1e94c0
jmp 0x1e8d28
movq -0x8(%rbp), %rdi
movq -0x158(%rbp), %rsi
movl -0x10(%rbp), %edx
movl -0x68(%rbp), %ecx
callq 0x1e95a0
movq %rax, -0x1b8(%rbp)
jmp 0x1e8d47
leaq -0x128(%rbp), %rdi
callq 0xc6b8
leaq -0xd8(%rbp), %rdi
callq 0xc6b8
movq -0x1b8(%rbp), %rax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8da9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8da0
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 0x1e8eb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8df7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8deb
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 0x1e8eb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8e2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xc6b8
leaq -0xf9(%rbp), %rdi
callq 0xc3c0
jmp 0x1e8eb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8e62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x148(%rbp), %rdi
callq 0xc6b8
leaq -0x149(%rbp), %rdi
callq 0xc3c0
jmp 0x1e8ea7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1e8e9b
movq -0x1b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
movl $0x2a30, %esi           # imm = 0x2A30
callq 0xc370
leaq -0x128(%rbp), %rdi
callq 0xc6b8
leaq -0xd8(%rbp), %rdi
callq 0xc6b8
movq -0x60(%rbp), %rdi
callq 0xc5d0
nopl (%rax)