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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl %ecx, (%rdi)
addq $0x8, %rdi
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
leaq 0x180b5(%rip), %rsi     # 0x157161
leaq 0x180b1(%rip), %rdx     # 0x157164
callq 0x17586
leaq 0x28(%rbx), %rdi
leaq 0x38(%rbx), %rax
movq %rax, 0x28(%rbx)
leaq 0x1809a(%rip), %rsi     # 0x157165
leaq 0x18096(%rip), %rdx     # 0x157168
callq 0x17586
leaq 0x48(%rbx), %rdi
leaq 0x58(%rbx), %rax
movq %rax, 0x48(%rbx)
leaq 0xfa29(%rip), %rsi      # 0x14eb13
leaq 0xfa26(%rip), %rdx      # 0x14eb17
callq 0x17586
leaq 0x68(%rbx), %rdi
leaq 0x78(%rbx), %rax
movq %rax, 0x68(%rbx)
leaq 0x18060(%rip), %rsi     # 0x157169
leaq 0x1805b(%rip), %rdx     # 0x15716b
callq 0x17586
leaq 0x88(%rbx), %rdi
leaq 0x98(%rbx), %rax
movq %rax, 0x88(%rbx)
leaq 0xea71(%rip), %rsi      # 0x14dba2
leaq 0xea6c(%rip), %rdx      # 0x14dba4
callq 0x17586
leaq 0xa8(%rbx), %rdi
leaq 0xb8(%rbx), %rax
movq %rax, 0xa8(%rbx)
leaq 0x21129(%rip), %rsi     # 0x160282
leaq 0x21125(%rip), %rdx     # 0x160285
callq 0x17586
leaq 0xc8(%rbx), %rdi
leaq 0xd8(%rbx), %rax
movq %rax, 0xc8(%rbx)
leaq 0x17ff3(%rip), %rsi     # 0x157174
leaq 0x17fef(%rip), %rdx     # 0x157177
callq 0x17586
leaq 0xe8(%rbx), %rdi
leaq 0xf8(%rbx), %rax
movq %rax, 0xe8(%rbx)
leaq 0x17fcf(%rip), %rsi     # 0x157178
leaq 0x17fcb(%rip), %rdx     # 0x15717b
callq 0x17586
leaq 0x108(%rbx), %rdi
leaq 0x118(%rbx), %rax
movq %rax, 0x108(%rbx)
leaq 0x17fab(%rip), %rsi     # 0x15717c
leaq 0x17fa7(%rip), %rdx     # 0x15717f
callq 0x17586
leaq 0x128(%rbx), %rdi
leaq 0x138(%rbx), %rax
movq %rax, 0x128(%rbx)
leaq 0x17f87(%rip), %rsi     # 0x157180
leaq 0x17f83(%rip), %rdx     # 0x157183
callq 0x17586
leaq 0x148(%rbx), %rdi
leaq 0x158(%rbx), %rax
movq %rax, 0x148(%rbx)
leaq 0x2105b(%rip), %rsi     # 0x16027c
leaq 0x21058(%rip), %rdx     # 0x160280
callq 0x17586
leaq 0x168(%rbx), %rdi
leaq 0x178(%rbx), %rax
movq %rax, 0x168(%rbx)
leaq 0x21038(%rip), %rsi     # 0x160281
leaq 0x21035(%rip), %rdx     # 0x160285
callq 0x17586
leaq 0x188(%rbx), %rdi
leaq 0x198(%rbx), %rax
movq %rax, 0x188(%rbx)
leaq 0x21015(%rip), %rsi     # 0x160286
leaq 0x21013(%rip), %rdx     # 0x16028b
callq 0x17586
leaq 0x1a8(%rbx), %rdi
leaq 0x1b8(%rbx), %rax
movq %rax, 0x1a8(%rbx)
leaq 0x20ff3(%rip), %rsi     # 0x16028c
leaq 0x20fef(%rip), %rdx     # 0x16028f
callq 0x17586
leaq 0x1c8(%rbx), %rdi
leaq 0x1d8(%rbx), %rax
movq %rax, 0x1c8(%rbx)
leaq 0x20fcf(%rip), %rsi     # 0x160290
leaq 0x20fcc(%rip), %rdx     # 0x160294
callq 0x17586
leaq 0x1e8(%rbx), %rdi
leaq 0x1f8(%rbx), %rax
movq %rax, 0x1e8(%rbx)
leaq 0x20fac(%rip), %rsi     # 0x160295
leaq 0x20fa9(%rip), %rdx     # 0x160299
callq 0x17586
leaq 0x208(%rbx), %rdi
leaq 0x218(%rbx), %rax
movq %rax, 0x208(%rbx)
leaq 0x20f89(%rip), %rsi     # 0x16029a
leaq 0x20f87(%rip), %rdx     # 0x16029f
callq 0x17586
leaq 0x228(%rbx), %rdi
leaq 0x210e5(%rip), %rsi     # 0x160410
movl $0x11, %ecx
rep  movsl (%rsi), %es:(%rdi)
movups 0x2111b(%rip), %xmm0    # 0x160454
movups %xmm0, 0x26c(%rbx)
movl $0x6, 0x27c(%rbx)
movabsq $0xd00000008, %rax      # imm = 0xD00000008
movq %rax, 0x290(%rbx)
movups 0x21106(%rip), %xmm0    # 0x160468
movups %xmm0, 0x280(%rbx)
leaq 0x298(%rbx), %rdi
movl $0xaa0, %edx            # imm = 0xAA0
xorl %esi, %esi
callq 0xb1d0
leaq 0xd38(%rbx), %rdi
movl $0xaa0, %edx            # imm = 0xAA0
xorl %esi, %esi
callq 0xb1d0
leaq 0x17d8(%rbx), %rdi
movl $0xaa0, %edx            # imm = 0xAA0
xorl %esi, %esi
callq 0xb1d0
leaq 0x2278(%rbx), %rdi
movl $0x7f8, %edx            # imm = 0x7F8
xorl %esi, %esi
callq 0xb1d0
leaq 0x2a70(%rbx), %rdi
movl $0xaa0, %edx            # imm = 0xAA0
xorl %esi, %esi
callq 0xb1d0
leaq 0x3510(%rbx), %rdi
leaq 0x210aa(%rip), %rsi     # 0x160480
movl $0x1a4, %edx            # imm = 0x1A4
callq 0xb270
movslq %r15d, %rax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
movups 0x3510(%rbx,%rcx), %xmm0
movups 0x351c(%rbx,%rcx), %xmm1
movups %xmm0, 0x36b4(%rbx)
movups %xmm1, 0x36c0(%rbx)
movabsq $0x4000000008, %rax     # imm = 0x4000000008
movq %rax, 0x36d0(%rbx)
leaq 0x36d8(%rbx), %rdi
leaq 0x211fd(%rip), %rsi     # 0x160628
movl $0x7e0, %edx            # imm = 0x7E0
callq 0xb270
leaq 0x3eb8(%rbx), %rdi
movslq %r14d, %rax
leaq (%rax,%rax,8), %rax
shlq $0x4, %rax
leaq (%rbx,%rax), %rsi
addq $0x36d8, %rsi           # imm = 0x36D8
movl $0x90, %edx
callq 0xb270
movl 0x3ed0(%rbx), %eax
addl 0x3edc(%rbx), %eax
movl %eax, 0x3f48(%rbx)
movl %ebp, (%rbx)
movq %rbx, %rdi
callq 0x13f6b8
movq %rbx, %rdi
callq 0x13fc76
movq %rbx, %rdi
callq 0x13ff50
movq %rbx, %rdi
callq 0x13ffe6
movq %rbx, %rdi
callq 0x14007c
movq %rbx, %rdi
callq 0x140816
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x208, %r15d           # imm = 0x208
jmp 0x13f563
movq %rax, %r14
movl $0x1e8, %r15d           # imm = 0x1E8
jmp 0x13f563
movq %rax, %r14
movl $0x1c8, %r15d           # imm = 0x1C8
jmp 0x13f563
movq %rax, %r14
movl $0x1a8, %r15d           # imm = 0x1A8
jmp 0x13f563
movq %rax, %r14
movl $0x188, %r15d           # imm = 0x188
jmp 0x13f563
movq %rax, %r14
movl $0x168, %r15d           # imm = 0x168
jmp 0x13f563
movq %rax, %r14
movl $0x148, %r15d           # imm = 0x148
jmp 0x13f563
movq %rax, %r14
movl $0x128, %r15d           # imm = 0x128
jmp 0x13f563
movq %rax, %r14
movl $0x108, %r15d           # imm = 0x108
jmp 0x13f563
movq %rax, %r14
movl $0xe8, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0xc8, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0xa8, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0x88, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0x68, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0x48, %r15d
jmp 0x13f563
movq %rax, %r14
movl $0x28, %r15d
xorl %eax, %eax
testb %al, %al
jne 0x13f6a2
addq $-0x10, %rbx
leaq (%rbx,%r15), %rax
movq -0x10(%rbx,%r15), %rdi
cmpq %rdi, %rax
je 0x13f58a
movq (%rax), %rsi
incq %rsi
callq 0xb2f0
addq $-0x20, %r15
cmpq $0x8, %r15
jne 0x13f571
jmp 0x13f6a2
movq %rax, %r14
movl $0x8, %r15d
movb $0x1, %al
jmp 0x13f565
movq %rax, %r14
leaq 0x34f0(%rbx), %r15
xorl %r12d, %r12d
movq 0x3500(%rbx,%r12), %rax
testq %rax, %rax
je 0x13f5ce
leaq (%r15,%r12), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x20, %r12
cmpq $-0xaa0, %r12           # imm = 0xF560
jne 0x13f5b3
movl $0x2a68, %r15d          # imm = 0x2A68
movq -0x10(%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x13f5f7
movq (%rbx,%r15), %rsi
subq %rdi, %rsi
callq 0xb2f0
addq $-0x18, %r15
cmpq $0x2270, %r15           # imm = 0x2270
jne 0x13f5e1
leaq 0x2258(%rbx), %r15
xorl %r12d, %r12d
movq 0x2268(%rbx,%r12), %rax
testq %rax, %rax
je 0x13f629
leaq (%r15,%r12), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x20, %r12
cmpq $-0xaa0, %r12           # imm = 0xF560
jne 0x13f60e
leaq 0x17b8(%rbx), %r15
xorl %r12d, %r12d
movq 0x17c8(%rbx,%r12), %rax
testq %rax, %rax
je 0x13f65b
leaq (%r15,%r12), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x20, %r12
cmpq $-0xaa0, %r12           # imm = 0xF560
jne 0x13f640
leaq 0xd18(%rbx), %r15
xorl %r12d, %r12d
movq 0xd28(%rbx,%r12), %rax
testq %rax, %rax
je 0x13f68d
leaq (%r15,%r12), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x20, %r12
cmpq $-0xaa0, %r12           # imm = 0xF560
jne 0x13f672
movq %rbx, %rdi
callq 0xc388
movq %r14, %rdi
callq 0xb510
jmp 0x13f6b0
jmp 0x13f6b0
jmp 0x13f6b0
movq %rax, %rdi
callq 0x1718f