// File: /workspace/github_cpp_makefile_star2_O1/MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_output_network_packets(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_output_network_packets(string outputNetworkPacketsFileName)
{
	config_data_collect_write_back = new uint16_t*[outNetworks];
	for(uint8_t i=0; i < outNetworks; i++)
    config_data_collect_write_back[i] = new uint16_t[size_config_data_collect_write_back[i]];

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

	string line;
 	while (getline(inFile, line)) {
		// skip reading first two lines of the file
		if(it < 2) {
			it++; continue;
		}
		istringstream tokenStream(line);
		string token1, token2, token3;
		tokenStream >> token1 >> token2 >> token3;

		uint8_t		network 	= stoul(token1);
		uint16_t 	idx				= stoul(token2);
		uint16_t 	offset 		= stoul(token3);

		assert(network < outNetworks && "network number should be less than total networks for outputting data.");
		assert(idx < size_config_data_collect_write_back[network] &&
			"packet number should be less than total data collected via network in an execution pass.");
		assert(offset < size_config_data_collect_write_back[network] &&
			"packet's offset number should be less than total data collected via network in an execution pass.");

		config_data_collect_write_back[network][idx] = offset;
	}
	inFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movzbl 0x200df0(%rip), %r14d   # 0x60b5e4
leal (,%r14,8), %edi
callq 0x4181e0
movq %rax, 0x200e00(%rip)    # 0x60b608
testl %r14d, %r14d
je 0x40a836
xorl %r15d, %r15d
movq 0x200dd9(%rip), %rax    # 0x60b5f0
movzwl (%rax,%r15,2), %edi
addl %edi, %edi
callq 0x4181e0
movq 0x200dde(%rip), %rcx    # 0x60b608
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x40a810
movq (%rbx), %rsi
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x460c10
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x230(%rsp,%rax)
jne 0x40abdd
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x80(%rsp), %r15
leaq 0x60(%rsp), %rbp
leaq 0x40(%rsp), %r13
leaq 0x10(%rsp), %rbx
leaq 0x90(%rsp), %r12
movl $0x0, 0xc(%rsp)
movq 0x210(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4653c0
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x419ec0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40aaf0
cmpw $0x1, 0xc(%rsp)
jbe 0x40aae7
movq %r12, %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x48c470
movq %r12, %rdi
movq %r14, %r12
movq %r15, 0x70(%rsp)
xorl %eax, %eax
movq %rax, 0x78(%rsp)
movb %al, 0x80(%rsp)
movq %rbp, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movb %al, 0x60(%rsp)
movq %r13, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movb %al, 0x40(%rsp)
leaq 0x70(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0x50(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0x30(%rsp), %rsi
callq 0x419b40
movq 0x70(%rsp), %rbx
callq 0x4c7aa0
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %rbx, (%rsp)
je 0x40ab82
movq %rax, %rbp
movl (%r14), %eax
testl %eax, %eax
je 0x40a990
cmpl $0x22, %eax
jne 0x40a993
jmp 0x40abb9
movl %r15d, (%r14)
movq 0x50(%rsp), %r15
movl (%r14), %r13d
movl $0x0, (%r14)
movq %r15, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, (%rsp)
je 0x40ab8e
movq %rax, %rbx
movl (%r14), %eax
testl %eax, %eax
je 0x40a9d0
cmpl $0x22, %eax
jne 0x40a9d3
jmp 0x40abd1
movl %r13d, (%r14)
movq 0x30(%rsp), %r15
movl (%r14), %r13d
movl $0x0, (%r14)
movq %r15, %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, (%rsp)
je 0x40ab57
movl (%r14), %ecx
testl %ecx, %ecx
je 0x40aa0d
cmpl $0x22, %ecx
jne 0x40aa10
jmp 0x40abc5
movl %r13d, (%r14)
movzbl %bpl, %ecx
movzbl 0x200bc9(%rip), %edx    # 0x60b5e4
cmpl %edx, %ecx
jae 0x40ab9a
movzwl %bx, %esi
movq 0x200bc3(%rip), %rdx    # 0x60b5f0
movzbl %bpl, %ecx
movl %ecx, %edi
movzwl (%rdx,%rdi,2), %edx
cmpl %edx, %esi
jae 0x40ab38
movzwl %ax, %esi
cmpl %edx, %esi
leaq 0x80(%rsp), %r15
leaq 0x40(%rsp), %r13
jae 0x40ab63
movq %r12, %r14
movq 0x200ba7(%rip), %rdx    # 0x60b608
movq (%rdx,%rcx,8), %rcx
movzwl %bx, %edx
movw %ax, (%rcx,%rdx,2)
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x60(%rsp), %rbp
je 0x40aa88
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x10(%rsp), %rbx
leaq 0x90(%rsp), %r12
je 0x40aaac
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x40aac6
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq %r12, %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48c720
leaq 0x108(%rsp), %rdi
callq 0x4667e0
jmp 0x40a89e
incl 0xc(%rsp)
jmp 0x40a89e
leaq 0x210(%rsp), %rdi
callq 0x4611c0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x40ab19
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x210(%rsp), %rdi
callq 0x461570
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18a640(%rip), %rdi    # 0x59517f
leaq 0x189533(%rip), %rsi    # 0x594079
leaq 0x18a5f6(%rip), %rcx    # 0x595143
movl $0x269, %edx            # imm = 0x269
callq 0x4d75c0
leaq 0x18ae6d(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a6a6(%rip), %rdi    # 0x595210
leaq 0x189508(%rip), %rsi    # 0x594079
leaq 0x18a5cb(%rip), %rcx    # 0x595143
movl $0x26b, %edx            # imm = 0x26B
callq 0x4d75c0
leaq 0x18ae42(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18ae36(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a540(%rip), %rdi    # 0x5950e1
leaq 0x1894d1(%rip), %rsi    # 0x594079
leaq 0x18a594(%rip), %rcx    # 0x595143
movl $0x267, %edx            # imm = 0x267
callq 0x4d75c0
leaq 0x18ae0b(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18adff(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18adf3(%rip), %rdi    # 0x5959cb
callq 0x402c3d
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x189435(%rip), %rsi    # 0x594020
movl $0x1b, %edx
callq 0x484270
movq (%rbx), %rsi
movq $0x60c900, %rdi         # imm = 0x60C900
callq 0x4847a0
movq %rax, %rdi
callq 0x484080
movl $0x1, %edi
callq 0x4de3d0
movq %rax, %rbx
jmp 0x40ace9
jmp 0x40ac57
jmp 0x40ac57
jmp 0x40ac24
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x40ac3e
movl %r13d, (%r14)
jmp 0x40ac3e
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x40ac3e
movl %r15d, (%r14)
leaq 0x20(%rsp), %r14
leaq 0x80(%rsp), %r15
leaq 0x60(%rsp), %rbp
leaq 0x40(%rsp), %r13
jmp 0x40ac69
movq %rax, %rbx
leaq 0x20(%rsp), %r14
jmp 0x40acd2
movq %rax, %rbx
leaq 0x20(%rsp), %r14
movq 0x30(%rsp), %rdi
cmpq %r13, %rdi
je 0x40ac80
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40ac97
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x40acb1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x90(%rsp), %rdi
callq 0x48c720
leaq 0x108(%rsp), %rdi
callq 0x4667e0
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x40ace9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x210(%rsp), %rdi
callq 0x461570
movq %rbx, %rdi
callq 0x4c2960