// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rsi, %rbx
movzbl 0x2009f2(%rip), %r12d   # 0x608556
movl %r12d, %edi
shll $0x3, %edi
callq 0x414190
movq %rax, 0x200a82(%rip)    # 0x6085f8
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x407bc3
movq 0x200a63(%rip), %rax    # 0x6085e8
movzwl (%rax,%r13,2), %ebp
leal (,%rbp,4), %r14d
leaq 0x8(%r14), %rdi
callq 0x414190
leaq 0x8(%rax), %r15
movq %rbp, (%rax)
testl %ebp, %ebp
je 0x407bb3
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401080
movq 0x200a3e(%rip), %rax    # 0x6085f8
movq %r15, (%rax,%r13,8)
incq %r13
jmp 0x407b79
movq (%rbx), %rsi
leaq 0xa0(%rsp), %r14
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x45cbc0
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xc0(%rsp,%rax)
jne 0x407dad
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %r12
leaq 0x40(%rsp), %r13
pushq $0xa
popq %r14
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x493470
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x407d74
leaq 0x2a8(%rsp), %r15
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x488420
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
andq $0x0, 0x68(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
andq $0x0, 0x48(%rsp)
xorl %ecx, %ecx
movb %cl, 0x30(%rsp)
movb %cl, 0x70(%rsp)
movb %cl, 0x50(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movb %cl, 0x10(%rsp)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x415af0
movq %rax, %rdi
movq %r12, %rsi
callq 0x415af0
movq %rax, %rdi
movq %r13, %rsi
callq 0x415af0
movq %rax, %rdi
movq %rsp, %rsi
callq 0x415af0
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x40a485
movq %rax, %r15
movq %r12, %rbx
movq %r12, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x40a485
movq %rax, %r12
movq %r13, %rbp
movq %r13, %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x40a485
movl %r14d, %edx
movq %rax, %r13
movq %rsp, %rdi
xorl %esi, %esi
movl %edx, %r14d
callq 0x40a485
movq 0x2008d8(%rip), %rcx    # 0x6085f8
movzbl %r15b, %edx
movq (%rcx,%rdx,8), %rcx
movzwl %r12w, %edx
andw $0x0, 0x2(%rcx,%rdx,4)
movb %r13b, (%rcx,%rdx,4)
movb %al, 0x1(%rcx,%rdx,4)
movq %rsp, %rdi
callq 0x490a30
movq %rbp, %r13
movq %rbp, %rdi
callq 0x490a30
movq %rbx, %r12
movq %rbx, %rdi
callq 0x490a30
leaq 0x20(%rsp), %rdi
callq 0x490a30
leaq 0x2a8(%rsp), %rdi
callq 0x485d10
jmp 0x407c10
leaq 0xa0(%rsp), %rdi
callq 0x45d170
leaq 0x80(%rsp), %rdi
callq 0x490a30
leaq 0xa0(%rsp), %rdi
callq 0x45d520
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x609900, %rdi         # imm = 0x609900
leaq 0x188265(%rip), %rsi    # 0x590020
callq 0x480750
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x480750
movq %rax, %rdi
callq 0x480030
pushq $0x1
popq %rdi
callq 0x4da4e0
movq %rax, %rbx
jmp 0x407e34
jmp 0x407dec
jmp 0x407dec
jmp 0x407df1
jmp 0x407df1
jmp 0x407df1
jmp 0x407df1
movq %rax, %rbx
jmp 0x407e27
movq %rax, %rbx
movq %rsp, %rdi
callq 0x490a30
leaq 0x40(%rsp), %rdi
callq 0x490a30
leaq 0x60(%rsp), %rdi
callq 0x490a30
leaq 0x20(%rsp), %rdi
callq 0x490a30
leaq 0x2a8(%rsp), %rdi
callq 0x485d10
leaq 0x80(%rsp), %rdi
callq 0x490a30
leaq 0xa0(%rsp), %rdi
callq 0x45d520
movq %rbx, %rdi
callq 0x4bea70
nop