// File: MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_input_network_packets(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_input_network_packets(string inputNetworkPacketsFileName)
{
	packetArr = new Packet*[total_operands];
	for(uint8_t i=0; i < total_operands; i++)
    packetArr[i] = new Packet[size_packetArr[i]];

	uint16_t it=0;
	ifstream inFile(inputNetworkPacketsFileName.c_str());
	if(!inFile)
	{
		cout << "Cannot open and read file: " << inputNetworkPacketsFileName.c_str() << endl;
		exit (EXIT_FAILURE);
	}

	string line;
 	while (getline(inFile, line)) {
		istringstream tokenStream(line);
		string token1, token2, token3, token4;
		tokenStream >> token1 >> token2 >> token3 >> token4;
		uint8_t		operand 	= stoul(token1);
		uint16_t 	idx				= stoul(token2);
		uint8_t 	rowTag 		= stoul(token3);
		uint8_t		colTag 		= stoul(token4);

		packetArr[operand][idx].setData(0);
		packetArr[operand][idx].setRowTag(rowTag);
		packetArr[operand][idx].setColTag(colTag);
	}
	inFile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x510, %rsp            # imm = 0x510
movq %rsi, -0x460(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movzbl 0x2140d5(%rip), %eax    # 0x61e556
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x425dd0
movq %rax, 0x21414f(%rip)    # 0x61e5f8
movb $0x0, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
movzbl 0x21409e(%rip), %ecx    # 0x61e556
cmpl %ecx, %eax
jge 0x40a615
movq 0x214121(%rip), %rax    # 0x61e5e8
movzbl -0x11(%rbp), %ecx
movzwl (%rax,%rcx,2), %eax
movq %rax, -0x478(%rbp)
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x480(%rbp)
callq 0x425dd0
movq %rax, %rcx
movq -0x478(%rbp), %rax
movq %rcx, -0x470(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x468(%rbp)
cmpq $0x0, %rax
je 0x40a585
movq -0x468(%rbp), %rax
movq -0x478(%rbp), %rdx
shlq $0x2, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x490(%rbp)
movq %rax, -0x488(%rbp)
movq -0x488(%rbp), %rdi
movq %rdi, -0x498(%rbp)
callq 0x40f580
jmp 0x40a567
movq -0x490(%rbp), %rcx
movq -0x498(%rbp), %rax
addq $0x4, %rax
cmpq %rcx, %rax
movq %rax, -0x488(%rbp)
jne 0x40a552
movq -0x468(%rbp), %rdx
movq 0x214065(%rip), %rax    # 0x61e5f8
movzbl -0x11(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movb -0x11(%rbp), %al
addb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x40a4ad
movq -0x468(%rbp), %rcx
movq %rax, %rsi
movq -0x498(%rbp), %rax
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
cmpq %rax, %rcx
movq %rax, -0x4a0(%rbp)
je 0x40a5fd
movq -0x4a0(%rbp), %rdi
addq $-0x4, %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x40f5a0
movq -0x468(%rbp), %rcx
movq -0x4a8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4a0(%rbp)
jne 0x40a5cc
movq -0x480(%rbp), %rsi
movq -0x470(%rbp), %rdi
callq 0x4248b0
jmp 0x40a9ef
movq -0x460(%rbp), %rdi
movw $0x0, -0x26(%rbp)
callq 0x4a4170
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x46e8c0
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x472d80
movb %al, -0x4a9(%rbp)
jmp 0x40a65b
movb -0x4a9(%rbp), %al
testb $0x1, %al
jne 0x40a667
jmp 0x40a6d7
movq $0x61f900, %rdi         # imm = 0x61F900
leaq 0x19699b(%rip), %rsi    # 0x5a1010
callq 0x492450
movq %rax, -0x4b8(%rbp)
jmp 0x40a683
movq -0x460(%rbp), %rdi
callq 0x4a4170
movq -0x4b8(%rbp), %rdi
movq %rax, %rsi
callq 0x492450
movq %rax, -0x4c0(%rbp)
jmp 0x40a6a7
movq -0x4c0(%rbp), %rdi
movq $0x491d30, %rsi         # imm = 0x491D30
callq 0x490f40
jmp 0x40a6bc
movl $0x1, %edi
callq 0x4ec1e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a9e3
leaq -0x250(%rbp), %rdi
callq 0x4a2620
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x4a5170
movq %rax, -0x4c8(%rbp)
jmp 0x40a6ff
movq -0x4c8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x472d70
movb %al, -0x4c9(%rbp)
jmp 0x40a71d
movb -0x4c9(%rbp), %al
testb $0x1, %al
jne 0x40a72c
jmp 0x40a9a8
leaq -0x3d0(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x8, %edx
callq 0x49a120
jmp 0x40a746
leaq -0x3f0(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x4a2620
leaq -0x410(%rbp), %rdi
callq 0x4a2620
leaq -0x430(%rbp), %rdi
callq 0x4a2620
leaq -0x450(%rbp), %rdi
callq 0x4a2620
movq -0x4e0(%rbp), %rsi
leaq -0x3d0(%rbp), %rdi
callq 0x4277f0
movq %rax, -0x4d8(%rbp)
jmp 0x40a799
movq -0x4d8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x4e8(%rbp)
jmp 0x40a7b5
movq -0x4e8(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x4277f0
movq %rax, -0x4f0(%rbp)
jmp 0x40a7d1
movq -0x4f0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
callq 0x4277f0
jmp 0x40a7e6
xorl %eax, %eax
movl %eax, %esi
leaq -0x3f0(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x4f8(%rbp)
jmp 0x40a804
movq -0x4f8(%rbp), %rax
movb %al, -0x451(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x410(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x500(%rbp)
jmp 0x40a82f
movq -0x500(%rbp), %rax
movw %ax, -0x454(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x430(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x508(%rbp)
jmp 0x40a85b
movq -0x508(%rbp), %rax
movb %al, -0x455(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x450(%rbp), %rdi
movl $0xa, %edx
callq 0x40f200
movq %rax, -0x510(%rbp)
jmp 0x40a886
movq -0x510(%rbp), %rax
movb %al, -0x456(%rbp)
movq 0x213d5e(%rip), %rax    # 0x61e5f8
movzbl -0x451(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x454(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
xorl %esi, %esi
callq 0x40f5b0
jmp 0x40a8b9
movq 0x213d38(%rip), %rax    # 0x61e5f8
movzbl -0x451(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x454(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
movzbl -0x455(%rbp), %esi
callq 0x40f5d0
jmp 0x40a8e4
movq 0x213d0d(%rip), %rax    # 0x61e5f8
movzbl -0x451(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl -0x454(%rbp), %ecx
leaq (%rax,%rcx,4), %rdi
movzbl -0x456(%rbp), %esi
callq 0x40f5f0
jmp 0x40a90f
leaq -0x450(%rbp), %rdi
callq 0x4a2730
leaq -0x430(%rbp), %rdi
callq 0x4a2730
leaq -0x410(%rbp), %rdi
callq 0x4a2730
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x40a6e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x40a9d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x4a2730
leaq -0x430(%rbp), %rdi
callq 0x4a2730
leaq -0x410(%rbp), %rdi
callq 0x4a2730
leaq -0x3f0(%rbp), %rdi
callq 0x4a2730
leaq -0x3d0(%rbp), %rdi
callq 0x497a10
jmp 0x40a9d7
leaq -0x230(%rbp), %rdi
callq 0x46ee70
jmp 0x40a9b6
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x230(%rbp), %rdi
callq 0x46f220
addq $0x510, %rsp            # imm = 0x510
popq %rbp
retq
leaq -0x250(%rbp), %rdi
callq 0x4a2730
leaq -0x230(%rbp), %rdi
callq 0x46f220
movq -0x20(%rbp), %rdi
callq 0x4d0770
nopl (%rax,%rax)