// File: CMU-SAFARI[P]SMLA/src/SMLA_CIO.cpp
// Function: ramulator::SMLA_CIO::SMLA_CIO(ramulator::SMLA_CIO::Org, ramulator::SMLA_CIO::Speed)
SMLA_CIO::SMLA_CIO(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();
		read_latency_smla[0] = speed_entry.nBL - 6;
		read_latency_smla[1] = speed_entry.nBL - 4;
		read_latency_smla[2] = speed_entry.nBL - 2;
		read_latency_smla[3] = speed_entry.nBL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rax, %rcx
movq %rcx, -0x50(%rbp)
movb $0x1, -0x38(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x19(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x65c0
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x2ac97(%rip), %rsi     # 0x9e72f
callq 0x8760
jmp 0x73a9f
movq -0x48(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2d(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x65c0
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x2ac68(%rip), %rsi     # 0x9e733
callq 0x8760
jmp 0x73ad2
movq -0x48(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x70(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2e(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x65c0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0x2ac39(%rip), %rsi     # 0x9e737
callq 0x8760
jmp 0x73b05
movq -0x48(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x80(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x2f(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x65c0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x2ac0a(%rip), %rsi     # 0x9e73b
callq 0x8760
jmp 0x73b38
movq -0x48(%rbp), %rax
subq $-0x80, %rax
movq %rax, -0x90(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x65c0
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x2abce(%rip), %rsi     # 0x9e73e
callq 0x8760
jmp 0x73b77
movq -0x48(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0xa0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x65c0
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0x2ab90(%rip), %rsi     # 0x9e741
callq 0x8760
jmp 0x73bb8
movq -0x48(%rbp), %rax
addq $0xc0, %rax
movq %rax, -0xb0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x32(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x65c0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rdx
leaq 0x2ab53(%rip), %rsi     # 0x9e745
callq 0x8760
jmp 0x73bf9
movq -0x48(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0xc0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x33(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x65c0
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rdx
leaq 0x2ab1e(%rip), %rsi     # 0x9e751
callq 0x8760
jmp 0x73c3a
movq -0x48(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0xd0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x34(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x65c0
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x2aad5(%rip), %rsi     # 0x9e749
callq 0x8760
jmp 0x73c7b
movq -0x48(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, -0xe0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x35(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x65c0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
leaq 0x2aa97(%rip), %rsi     # 0x9e74c
callq 0x8760
jmp 0x73cbc
movq -0x48(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq %rax, -0xf0(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x36(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x65c0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rdx
leaq 0x2aa5a(%rip), %rsi     # 0x9e750
callq 0x8760
jmp 0x73cfd
movq -0x48(%rbp), %rax
addq $0x160, %rax            # imm = 0x160
movq %rax, -0x100(%rbp)
movq %rax, -0x18(%rbp)
leaq -0x37(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x65c0
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rdx
leaq 0x2aa1e(%rip), %rsi     # 0x9e755
callq 0x8760
jmp 0x73d3e
movb $0x0, -0x38(%rbp)
leaq -0x37(%rbp), %rdi
callq 0x63b0
leaq -0x36(%rbp), %rdi
callq 0x63b0
leaq -0x35(%rbp), %rdi
callq 0x63b0
leaq -0x34(%rbp), %rdi
callq 0x63b0
leaq -0x33(%rbp), %rdi
callq 0x63b0
leaq -0x32(%rbp), %rdi
callq 0x63b0
leaq -0x31(%rbp), %rdi
callq 0x63b0
leaq -0x30(%rbp), %rdi
callq 0x63b0
leaq -0x2f(%rbp), %rdi
callq 0x63b0
leaq -0x2e(%rbp), %rdi
callq 0x63b0
leaq -0x2d(%rbp), %rdi
callq 0x63b0
leaq -0x19(%rbp), %rdi
callq 0x63b0
movq -0x50(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
leaq 0x2a410(%rip), %rsi     # 0x9e1d0
movl $0x30, %edx
callq 0x62f0
movq -0x50(%rbp), %rax
movq 0x2a42b(%rip), %rcx     # 0x9e200
movq %rcx, 0x1b0(%rax)
movq 0x2a425(%rip), %rcx     # 0x9e208
movq %rcx, 0x1b8(%rax)
movl 0x2a420(%rip), %ecx     # 0x9e210
movl %ecx, 0x1c0(%rax)
movq 0x2a417(%rip), %rcx     # 0x9e214
movq %rcx, 0x1c4(%rax)
movq 0x2a411(%rip), %rcx     # 0x9e21c
movq %rcx, 0x1cc(%rax)
movq 0x2a40b(%rip), %rcx     # 0x9e224
movq %rcx, 0x1d4(%rax)
addq $0x1e0, %rax            # imm = 0x1E0
movq %rax, -0x118(%rbp)
movq %rax, %rcx
addq $0x780, %rcx            # imm = 0x780
movq %rcx, -0x110(%rbp)
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x7b3a0
movq -0x120(%rbp), %rax
movq -0x110(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x108(%rbp)
jne 0x73e45
movq -0x50(%rbp), %rax
addq $0x960, %rax            # imm = 0x960
movq %rax, -0x138(%rbp)
movq %rax, %rcx
addq $0x780, %rcx            # imm = 0x780
movq %rcx, -0x130(%rbp)
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x7b3e0
movq -0x140(%rbp), %rax
movq -0x130(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x128(%rbp)
jne 0x73e9f
movq -0x50(%rbp), %rax
addq $0x10e0, %rax           # imm = 0x10E0
movq %rax, -0x158(%rbp)
movq %rax, %rcx
addq $0x780, %rcx            # imm = 0x780
movq %rcx, -0x150(%rbp)
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x7b3e0
movq -0x160(%rbp), %rax
movq -0x150(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x148(%rbp)
jne 0x73ef9
movq -0x50(%rbp), %rax
addq $0x1860, %rax           # imm = 0x1860
movq %rax, -0x178(%rbp)
movq %rax, %rcx
addq $0x5a0, %rcx            # imm = 0x5A0
movq %rcx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x7b420
movq -0x180(%rbp), %rax
movq -0x170(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x168(%rbp)
jne 0x73f53
movq -0x50(%rbp), %rax
addq $0x1e00, %rax           # imm = 0x1E00
movq %rax, -0x198(%rbp)
movq %rax, %rcx
addq $0x780, %rcx            # imm = 0x780
movq %rcx, -0x190(%rbp)
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x7b440
movq -0x1a0(%rbp), %rax
movq -0x190(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x188(%rbp)
jne 0x73fad
movq -0x50(%rbp), %rdi
movups 0x2a2a3(%rip), %xmm0    # 0x9e28c
movups %xmm0, 0x25e0(%rdi)
movups 0x2a285(%rip), %xmm0    # 0x9e27c
movups %xmm0, 0x25d0(%rdi)
movups 0x2a267(%rip), %xmm0    # 0x9e26c
movups %xmm0, 0x25c0(%rdi)
movups 0x2a249(%rip), %xmm0    # 0x9e25c
movups %xmm0, 0x25b0(%rdi)
movups 0x2a22b(%rip), %xmm0    # 0x9e24c
movups %xmm0, 0x25a0(%rdi)
movups 0x2a20d(%rip), %xmm0    # 0x9e23c
movups %xmm0, 0x2590(%rdi)
movups 0x2a1ef(%rip), %xmm0    # 0x9e22c
movups %xmm0, 0x2580(%rdi)
movslq -0xc(%rbp), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
movups 0x2580(%rdi,%rax), %xmm0
movups 0x258c(%rdi,%rax), %xmm1
movups %xmm1, 0x25fc(%rdi)
movups %xmm0, 0x25f0(%rdi)
movl $0x4, 0x260c(%rdi)
movl $0x80, 0x2610(%rdi)
addq $0x2618, %rdi           # imm = 0x2618
leaq 0x2a20d(%rip), %rsi     # 0x9e2a0
movl $0xe0, %edx
callq 0x62f0
movq -0x50(%rbp), %rdi
movslq -0x10(%rbp), %rax
imulq $0x70, %rax, %rax
movups 0x2678(%rdi,%rax), %xmm0
movups %xmm0, 0x2758(%rdi)
movups 0x2668(%rdi,%rax), %xmm0
movups %xmm0, 0x2748(%rdi)
movups 0x2658(%rdi,%rax), %xmm0
movups %xmm0, 0x2738(%rdi)
movups 0x2618(%rdi,%rax), %xmm0
movups 0x2628(%rdi,%rax), %xmm1
movups 0x2638(%rdi,%rax), %xmm2
movups 0x2648(%rdi,%rax), %xmm3
movups %xmm3, 0x2728(%rdi)
movups %xmm2, 0x2718(%rdi)
movups %xmm1, 0x2708(%rdi)
movups %xmm0, 0x26f8(%rdi)
movl 0x271c(%rdi), %eax
movl 0x2710(%rdi), %ecx
movl 0x2718(%rdi), %edx
addl %edx, %eax
addl %ecx, %eax
movl %eax, 0x2768(%rdi)
callq 0x744e0
jmp 0x74135
movq -0x50(%rbp), %rdi
callq 0x74610
jmp 0x74140
movq -0x50(%rbp), %rdi
callq 0x74730
jmp 0x7414b
movq -0x50(%rbp), %rdi
callq 0x747a0
jmp 0x74156
movq -0x50(%rbp), %rdi
callq 0x74810
jmp 0x74161
movq -0x50(%rbp), %rdi
callq 0x749b0
jmp 0x7416c
movq -0x50(%rbp), %rax
movl 0x2710(%rax), %ecx
subl $0x6, %ecx
movl %ecx, 0x276c(%rax)
movl 0x2710(%rax), %ecx
subl $0x4, %ecx
movl %ecx, 0x2770(%rax)
movl 0x2710(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x2774(%rax)
movl 0x2710(%rax), %ecx
movl %ecx, 0x2778(%rax)
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x742a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x74297
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x7428e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x74285
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x7427c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x74273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x37(%rbp), %rdi
callq 0x63b0
leaq -0x36(%rbp), %rdi
callq 0x63b0
leaq -0x35(%rbp), %rdi
callq 0x63b0
leaq -0x34(%rbp), %rdi
callq 0x63b0
leaq -0x33(%rbp), %rdi
callq 0x63b0
leaq -0x32(%rbp), %rdi
callq 0x63b0
leaq -0x31(%rbp), %rdi
callq 0x63b0
leaq -0x30(%rbp), %rdi
callq 0x63b0
leaq -0x2f(%rbp), %rdi
callq 0x63b0
leaq -0x2e(%rbp), %rdi
callq 0x63b0
leaq -0x2d(%rbp), %rdi
callq 0x63b0
leaq -0x19(%rbp), %rdi
callq 0x63b0
testb $0x1, -0x38(%rbp)
jne 0x742de
jmp 0x74322
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq %rax, %rcx
movq %rax, -0x1a8(%rbp)
je 0x74320
movq -0x1a8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x6668
movq -0x48(%rbp), %rcx
movq -0x1b0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1a8(%rbp)
jne 0x742f2
jmp 0x74322
jmp 0x744ce
movq %rdx, %rcx
movq %rax, %rdx
movq -0x198(%rbp), %rax
movq %rdx, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
addq $0x780, %rax            # imm = 0x780
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x4b580
movq -0x198(%rbp), %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1b8(%rbp)
jne 0x74348
movq -0x178(%rbp), %rax
addq $0x5a0, %rax            # imm = 0x5A0
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x4b5a0
movq -0x178(%rbp), %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1c8(%rbp)
jne 0x7438d
movq -0x158(%rbp), %rax
addq $0x780, %rax            # imm = 0x780
movq %rax, -0x1d8(%rbp)
movq -0x1d8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x4b600
movq -0x158(%rbp), %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1d8(%rbp)
jne 0x743d2
movq -0x138(%rbp), %rax
addq $0x780, %rax            # imm = 0x780
movq %rax, -0x1e8(%rbp)
movq -0x1e8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x4b600
movq -0x138(%rbp), %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1e8(%rbp)
jne 0x74417
movq -0x118(%rbp), %rax
addq $0x780, %rax            # imm = 0x780
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x200(%rbp)
callq 0x4b620
movq -0x118(%rbp), %rcx
movq -0x200(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1f8(%rbp)
jne 0x7445c
movq -0x48(%rbp), %rax
addq $0x180, %rax            # imm = 0x180
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x210(%rbp)
callq 0x6668
movq -0x48(%rbp), %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x208(%rbp)
jne 0x7449e
jmp 0x744ce
movq -0x28(%rbp), %rdi
callq 0x65b0
nopw (%rax,%rax)