// File: CMU-SAFARI[P]ramulator/src/LPDDR3.cpp
// Function: ramulator::LPDDR3::LPDDR3(ramulator::LPDDR3::Org, ramulator::LPDDR3::Speed)
LPDDR3::LPDDR3(Org org, Speed speed)
    : org_entry(org_table[int(org)]),
    speed_entry(speed_table[int(speed)]),
    read_latency(speed_entry.nCL + speed_entry.nDQSCK + speed_entry.nBL)
{
    init_speed();
    init_prereq();
    init_rowhit(); // SAUGATA: added row hit function
    init_rowopen();
    init_lambda();
    init_timing();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %rax, %rcx
movq %rcx, -0x58(%rbp)
movb $0x1, -0x39(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x19(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0xc5e0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0x8c14a(%rip), %rsi     # 0x25abb2
callq 0x17a40
jmp 0x1cea6f
movq -0x50(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x68(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xc5e0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
leaq 0x8c11b(%rip), %rsi     # 0x25abb6
callq 0x17a40
jmp 0x1ceaa2
movq -0x50(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x78(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2e(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0xc5e0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0x90aff(%rip), %rsi     # 0x25f5cd
callq 0x17a40
jmp 0x1cead5
movq -0x50(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x88(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2f(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0xc5e0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x8c0b3(%rip), %rsi     # 0x25abba
callq 0x17a40
jmp 0x1ceb0e
movq -0x50(%rbp), %rax
subq $-0x80, %rax
movq %rax, -0x98(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0xc5e0
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0x81864(%rip), %rsi     # 0x2503aa
callq 0x17a40
jmp 0x1ceb4d
movq -0x50(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0xa8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0xc5e0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rdx
leaq 0x8c036(%rip), %rsi     # 0x25abbd
callq 0x17a40
jmp 0x1ceb8e
movq -0x50(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0xb8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x32(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0xc5e0
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rdx
leaq 0x8bff9(%rip), %rsi     # 0x25abc1
callq 0x17a40
jmp 0x1cebcf
movq -0x50(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xc8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x33(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xc5e0
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
leaq 0x95f57(%rip), %rsi     # 0x264b60
callq 0x17a40
jmp 0x1cec10
movq -0x50(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0xd8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x34(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0xc5e0
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rdx
leaq 0x8e93b(%rip), %rsi     # 0x25d585
callq 0x17a40
jmp 0x1cec51
movq -0x50(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, -0xe8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x35(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0xc5e0
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rdx
leaq 0x90946(%rip), %rsi     # 0x25f5d1
callq 0x17a40
jmp 0x1cec92
movq -0x50(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq %rax, -0xf8(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x36(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xc5e0
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rdx
leaq 0x8befd(%rip), %rsi     # 0x25abc9
callq 0x17a40
jmp 0x1cecd3
movq -0x50(%rbp), %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, -0x108(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x37(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0xc5e0
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rdx
leaq 0x908c7(%rip), %rsi     # 0x25f5d4
callq 0x17a40
jmp 0x1ced14
movq -0x50(%rbp), %rax
addq $0x180, %rax            # imm = 0x180
movq %rax, -0x118(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xc5e0
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rdx
leaq 0x9088b(%rip), %rsi     # 0x25f5d9
callq 0x17a40
jmp 0x1ced55
movb $0x0, -0x39(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc3c0
leaq -0x37(%rbp), %rdi
callq 0xc3c0
leaq -0x36(%rbp), %rdi
callq 0xc3c0
leaq -0x35(%rbp), %rdi
callq 0xc3c0
leaq -0x34(%rbp), %rdi
callq 0xc3c0
leaq -0x33(%rbp), %rdi
callq 0xc3c0
leaq -0x32(%rbp), %rdi
callq 0xc3c0
leaq -0x31(%rbp), %rdi
callq 0xc3c0
leaq -0x30(%rbp), %rdi
callq 0xc3c0
leaq -0x2f(%rbp), %rdi
callq 0xc3c0
leaq -0x2e(%rbp), %rdi
callq 0xc3c0
leaq -0x2d(%rbp), %rdi
callq 0xc3c0
leaq -0x19(%rbp), %rdi
callq 0xc3c0
movq -0x58(%rbp), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
leaq 0x90010(%rip), %rsi     # 0x25edf0
movl $0x34, %edx
callq 0xc300
movq -0x58(%rbp), %rax
movq 0x9002f(%rip), %rcx     # 0x25ee24
movq %rcx, 0x1d4(%rax)
movq 0x90029(%rip), %rcx     # 0x25ee2c
movq %rcx, 0x1dc(%rax)
movl 0x90024(%rip), %ecx     # 0x25ee34
movl %ecx, 0x1e4(%rax)
movq 0x9001b(%rip), %rcx     # 0x25ee38
movq %rcx, 0x1e8(%rax)
movq 0x90015(%rip), %rcx     # 0x25ee40
movq %rcx, 0x1f0(%rax)
movq 0x9000f(%rip), %rcx     # 0x25ee48
movq %rcx, 0x1f8(%rax)
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x130(%rbp)
movq %rax, %rcx
addq $0x820, %rcx            # imm = 0x820
movq %rcx, -0x128(%rbp)
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x1d6fc0
movq -0x138(%rbp), %rax
movq -0x128(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x120(%rbp)
jne 0x1cee65
movq -0x58(%rbp), %rax
addq $0xa20, %rax            # imm = 0xA20
movq %rax, -0x150(%rbp)
movq %rax, %rcx
addq $0x820, %rcx            # imm = 0x820
movq %rcx, -0x148(%rbp)
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x1d7000
movq -0x158(%rbp), %rax
movq -0x148(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x140(%rbp)
jne 0x1ceebf
movq -0x58(%rbp), %rax
addq $0x1240, %rax           # imm = 0x1240
movq %rax, -0x170(%rbp)
movq %rax, %rcx
addq $0x820, %rcx            # imm = 0x820
movq %rcx, -0x168(%rbp)
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x1d7000
movq -0x178(%rbp), %rax
movq -0x168(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x160(%rbp)
jne 0x1cef19
movq -0x58(%rbp), %rax
addq $0x1a60, %rax           # imm = 0x1A60
movq %rax, -0x190(%rbp)
movq %rax, %rcx
addq $0x618, %rcx            # imm = 0x618
movq %rcx, -0x188(%rbp)
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x1d7040
movq -0x198(%rbp), %rax
movq -0x188(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x180(%rbp)
jne 0x1cef73
movq -0x58(%rbp), %rax
addq $0x2078, %rax           # imm = 0x2078
movq %rax, -0x1b0(%rbp)
movq %rax, %rcx
addq $0x820, %rcx            # imm = 0x820
movq %rcx, -0x1a8(%rbp)
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x1d7060
movq -0x1b8(%rbp), %rax
movq -0x1a8(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x1a0(%rbp)
jne 0x1cefcd
movq -0x58(%rbp), %rdi
addq $0x2898, %rdi           # imm = 0x2898
leaq 0x8fe40(%rip), %rsi     # 0x25ee50
movl $0x118, %edx            # imm = 0x118
callq 0xc300
movq -0x58(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movups 0x2898(%rdi,%rax), %xmm0
movups 0x28a4(%rdi,%rax), %xmm1
movups %xmm1, 0x29bc(%rdi)
movups %xmm0, 0x29b0(%rdi)
movl $0x8, 0x29cc(%rdi)
movl $0x40, 0x29d0(%rdi)
addq $0x29d8, %rdi           # imm = 0x29D8
leaq 0x8fefb(%rip), %rsi     # 0x25ef68
movl $0x1e0, %edx            # imm = 0x1E0
callq 0xc300
movq -0x58(%rbp), %rdi
movslq -0x10(%rbp), %rax
imulq $0x78, %rax, %rax
movq %rax, -0x1c0(%rbp)
movq 0x2a48(%rdi,%rax), %rcx
movq %rcx, 0x2c28(%rdi)
movups 0x2a38(%rdi,%rax), %xmm0
movups %xmm0, 0x2c18(%rdi)
movups 0x2a28(%rdi,%rax), %xmm0
movups %xmm0, 0x2c08(%rdi)
movups 0x2a18(%rdi,%rax), %xmm0
movups %xmm0, 0x2bf8(%rdi)
movups 0x29d8(%rdi,%rax), %xmm0
movups 0x29e8(%rdi,%rax), %xmm1
movups 0x29f8(%rdi,%rax), %xmm2
movups 0x2a08(%rdi,%rax), %xmm3
movups %xmm3, 0x2be8(%rdi)
movups %xmm2, 0x2bd8(%rdi)
movups %xmm1, 0x2bc8(%rdi)
movups %xmm0, 0x2bb8(%rdi)
movl 0x2be0(%rdi), %eax
movl 0x2bd0(%rdi), %ecx
movl 0x2bdc(%rdi), %edx
addl %edx, %eax
addl %ecx, %eax
movl %eax, 0x2c30(%rdi)
callq 0x1cf4b0
jmp 0x1cf125
movq -0x58(%rbp), %rdi
callq 0x1cf620
jmp 0x1cf130
movq -0x58(%rbp), %rdi
callq 0x1cf770
jmp 0x1cf13b
movq -0x58(%rbp), %rdi
callq 0x1cf7e0
jmp 0x1cf146
movq -0x58(%rbp), %rdi
callq 0x1cf850
jmp 0x1cf151
movq -0x58(%rbp), %rdi
callq 0x1cf9f0
jmp 0x1cf15c
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf29a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf291
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf27f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf26d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf264
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf25b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf252
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf249
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf240
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1cf237
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc3c0
leaq -0x37(%rbp), %rdi
callq 0xc3c0
leaq -0x36(%rbp), %rdi
callq 0xc3c0
leaq -0x35(%rbp), %rdi
callq 0xc3c0
leaq -0x34(%rbp), %rdi
callq 0xc3c0
leaq -0x33(%rbp), %rdi
callq 0xc3c0
leaq -0x32(%rbp), %rdi
callq 0xc3c0
leaq -0x31(%rbp), %rdi
callq 0xc3c0
leaq -0x30(%rbp), %rdi
callq 0xc3c0
leaq -0x2f(%rbp), %rdi
callq 0xc3c0
leaq -0x2e(%rbp), %rdi
callq 0xc3c0
leaq -0x2d(%rbp), %rdi
callq 0xc3c0
leaq -0x19(%rbp), %rdi
callq 0xc3c0
testb $0x1, -0x39(%rbp)
jne 0x1cf2ab
jmp 0x1cf2ef
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq %rax, %rcx
movq %rax, -0x1c8(%rbp)
je 0x1cf2ed
movq -0x1c8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1d0(%rbp)
callq 0xc6b8
movq -0x50(%rbp), %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1c8(%rbp)
jne 0x1cf2bf
jmp 0x1cf2ef
jmp 0x1cf49b
movq %rdx, %rcx
movq %rax, %rdx
movq -0x1b0(%rbp), %rax
movq %rdx, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
addq $0x820, %rax            # imm = 0x820
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x92160
movq -0x1b0(%rbp), %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1d8(%rbp)
jne 0x1cf315
movq -0x190(%rbp), %rax
addq $0x618, %rax            # imm = 0x618
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x92180
movq -0x190(%rbp), %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1e8(%rbp)
jne 0x1cf35a
movq -0x170(%rbp), %rax
addq $0x820, %rax            # imm = 0x820
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x200(%rbp)
callq 0x921e0
movq -0x170(%rbp), %rcx
movq -0x200(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1f8(%rbp)
jne 0x1cf39f
movq -0x150(%rbp), %rax
addq $0x820, %rax            # imm = 0x820
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x210(%rbp)
callq 0x921e0
movq -0x150(%rbp), %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x208(%rbp)
jne 0x1cf3e4
movq -0x130(%rbp), %rax
addq $0x820, %rax            # imm = 0x820
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x220(%rbp)
callq 0x92200
movq -0x130(%rbp), %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x218(%rbp)
jne 0x1cf429
movq -0x50(%rbp), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x230(%rbp)
callq 0xc6b8
movq -0x50(%rbp), %rcx
movq -0x230(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x228(%rbp)
jne 0x1cf46b
jmp 0x1cf49b
movq -0x28(%rbp), %rdi
callq 0xc5d0
nopw %cs:(%rax,%rax)