// File: CMU-SAFARI[P]SMLA/src/SMLA_DIO.cpp
// Function: ramulator::SMLA_DIO::SMLA_DIO(ramulator::SMLA_DIO::Org, ramulator::SMLA_DIO::Speed)
SMLA_DIO::SMLA_DIO(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;
		read_latency_smla[1] = speed_entry.nBL;
		read_latency_smla[2] = speed_entry.nBL;
		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 0x1e5f7(%rip), %rsi     # 0x9e72f
callq 0x8760
jmp 0x8013f
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 0x1e5c8(%rip), %rsi     # 0x9e733
callq 0x8760
jmp 0x80172
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 0x1e599(%rip), %rsi     # 0x9e737
callq 0x8760
jmp 0x801a5
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 0x1e56a(%rip), %rsi     # 0x9e73b
callq 0x8760
jmp 0x801d8
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 0x1e52e(%rip), %rsi     # 0x9e73e
callq 0x8760
jmp 0x80217
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 0x1e4f0(%rip), %rsi     # 0x9e741
callq 0x8760
jmp 0x80258
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 0x1e4b3(%rip), %rsi     # 0x9e745
callq 0x8760
jmp 0x80299
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 0x1e47e(%rip), %rsi     # 0x9e751
callq 0x8760
jmp 0x802da
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 0x1e435(%rip), %rsi     # 0x9e749
callq 0x8760
jmp 0x8031b
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 0x1e3f7(%rip), %rsi     # 0x9e74c
callq 0x8760
jmp 0x8035c
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 0x1e3ba(%rip), %rsi     # 0x9e750
callq 0x8760
jmp 0x8039d
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 0x1e37e(%rip), %rsi     # 0x9e755
callq 0x8760
jmp 0x803de
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 0x1e750(%rip), %rsi     # 0x9ebb0
movl $0x30, %edx
callq 0x62f0
movq -0x50(%rbp), %rax
movq 0x1e76b(%rip), %rcx     # 0x9ebe0
movq %rcx, 0x1b0(%rax)
movq 0x1e765(%rip), %rcx     # 0x9ebe8
movq %rcx, 0x1b8(%rax)
movl 0x1e760(%rip), %ecx     # 0x9ebf0
movl %ecx, 0x1c0(%rax)
movq 0x1e757(%rip), %rcx     # 0x9ebf4
movq %rcx, 0x1c4(%rax)
movq 0x1e751(%rip), %rcx     # 0x9ebfc
movq %rcx, 0x1cc(%rax)
movq 0x1e74b(%rip), %rcx     # 0x9ec04
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 0x87a30
movq -0x120(%rbp), %rax
movq -0x110(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x108(%rbp)
jne 0x804e5
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 0x87a70
movq -0x140(%rbp), %rax
movq -0x130(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x128(%rbp)
jne 0x8053f
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 0x87a70
movq -0x160(%rbp), %rax
movq -0x150(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x148(%rbp)
jne 0x80599
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 0x87ab0
movq -0x180(%rbp), %rax
movq -0x170(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x168(%rbp)
jne 0x805f3
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 0x87ad0
movq -0x1a0(%rbp), %rax
movq -0x190(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x188(%rbp)
jne 0x8064d
movq -0x50(%rbp), %rdi
movups 0x1e5e3(%rip), %xmm0    # 0x9ec6c
movups %xmm0, 0x25e0(%rdi)
movups 0x1e5c5(%rip), %xmm0    # 0x9ec5c
movups %xmm0, 0x25d0(%rdi)
movups 0x1e5a7(%rip), %xmm0    # 0x9ec4c
movups %xmm0, 0x25c0(%rdi)
movups 0x1e589(%rip), %xmm0    # 0x9ec3c
movups %xmm0, 0x25b0(%rdi)
movups 0x1e56b(%rip), %xmm0    # 0x9ec2c
movups %xmm0, 0x25a0(%rdi)
movups 0x1e54d(%rip), %xmm0    # 0x9ec1c
movups %xmm0, 0x2590(%rdi)
movups 0x1e52f(%rip), %xmm0    # 0x9ec0c
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 0x1e54d(%rip), %rsi     # 0x9ec80
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 0x80b70
jmp 0x807d5
movq -0x50(%rbp), %rdi
callq 0x80ca0
jmp 0x807e0
movq -0x50(%rbp), %rdi
callq 0x80dc0
jmp 0x807eb
movq -0x50(%rbp), %rdi
callq 0x80e30
jmp 0x807f6
movq -0x50(%rbp), %rdi
callq 0x80ea0
jmp 0x80801
movq -0x50(%rbp), %rdi
callq 0x81040
jmp 0x8080c
movq -0x50(%rbp), %rax
movl 0x2710(%rax), %ecx
movl %ecx, 0x276c(%rax)
movl 0x2710(%rax), %ecx
movl %ecx, 0x2770(%rax)
movl 0x2710(%rax), %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 0x80964
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x8095b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80952
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80949
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80940
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80937
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x8092e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80925
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x8091c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x80913
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x8090a
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 0x80975
jmp 0x809b9
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq %rax, %rcx
movq %rax, -0x1a8(%rbp)
je 0x809b7
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 0x80989
jmp 0x809b9
jmp 0x80b65
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 0x604b0
movq -0x198(%rbp), %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1b8(%rbp)
jne 0x809df
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 0x604d0
movq -0x178(%rbp), %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1c8(%rbp)
jne 0x80a24
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 0x60530
movq -0x158(%rbp), %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1d8(%rbp)
jne 0x80a69
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 0x60530
movq -0x138(%rbp), %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1e8(%rbp)
jne 0x80aae
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 0x60550
movq -0x118(%rbp), %rcx
movq -0x200(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1f8(%rbp)
jne 0x80af3
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 0x80b35
jmp 0x80b65
movq -0x28(%rbp), %rdi
callq 0x65b0
nop