// File: /workspace/github_cpp_makefile_star2_O3/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 $0x428, %rsp            # imm = 0x428
movq %rsi, %rbx
movzbl 0x200df4(%rip), %r14d   # 0x60b5e4
leal (,%r14,8), %edi
callq 0x418d20
movq %rax, 0x200e04(%rip)    # 0x60b608
testl %r14d, %r14d
je 0x40a832
xorl %r15d, %r15d
movq 0x200ddd(%rip), %rax    # 0x60b5f0
movzwl (%rax,%r15,2), %edi
addl %edi, %edi
callq 0x418d20
movq 0x200de2(%rip), %rcx    # 0x60b608
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x40a80c
movq (%rbx), %rsi
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x461750
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xc0(%rsp,%rax)
jne 0x40abf1
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x70(%rsp), %rbx
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x80(%rsp), %r13
leaq 0x2a8(%rsp), %rbp
movl $0x0, 0x1c(%rsp)
movq 0xa0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x465f00
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x41aa00
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40aafb
cmpw $0x1, 0x1c(%rsp)
jbe 0x40aaf2
movq %rbp, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x48cfb0
movq %rbx, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x68(%rsp)
movb %al, 0x70(%rsp)
movq %r15, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movb %al, 0x50(%rsp)
movq %r12, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movb %al, 0x30(%rsp)
movq %rbp, %rdi
leaq 0x60(%rsp), %rsi
callq 0x41a680
movq %rax, %rdi
leaq 0x40(%rsp), %rsi
callq 0x41a680
movq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x41a680
movq %r13, %r12
movq 0x60(%rsp), %r14
callq 0x4c85e0
movq %rax, %rbx
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r14, 0x10(%rsp)
je 0x40ab96
movq %rax, %rbp
movl (%rbx), %r13d
testl %r13d, %r13d
je 0x40a991
cmpl $0x22, %r13d
jne 0x40a997
jmp 0x40abcd
movl %r15d, (%rbx)
movl %r15d, %r13d
movq 0x40(%rsp), %r15
movl $0x0, (%rbx)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r15, 0x10(%rsp)
je 0x40aba2
movq %rax, %r14
movl (%rbx), %eax
testl %eax, %eax
je 0x40a9d6
movl %eax, 0xc(%rsp)
cmpl $0x22, %eax
jne 0x40a9de
jmp 0x40abe5
movl %r13d, (%rbx)
movl %r13d, 0xc(%rsp)
movq 0x20(%rsp), %r15
movl $0x0, (%rbx)
movq %r15, %rdi
leaq 0x10(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r15, 0x10(%rsp)
je 0x40ab6b
movl (%rbx), %ecx
testl %ecx, %ecx
movq %r12, %r13
je 0x40aa19
cmpl $0x22, %ecx
jne 0x40aa1f
jmp 0x40abd9
movl 0xc(%rsp), %ecx
movl %ecx, (%rbx)
movzbl %bpl, %ecx
movzbl 0x200bba(%rip), %edx    # 0x60b5e4
cmpl %edx, %ecx
jae 0x40abae
movzwl %r14w, %esi
movq 0x200bb3(%rip), %rdx    # 0x60b5f0
movzbl %bpl, %ecx
movl %ecx, %edi
movzwl (%rdx,%rdi,2), %edx
cmpl %edx, %esi
jae 0x40ab4c
movzwl %ax, %esi
cmpl %edx, %esi
leaq 0x70(%rsp), %rbx
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x2a8(%rsp), %rbp
jae 0x40ab77
movq 0x200b90(%rip), %rdx    # 0x60b608
movq (%rdx,%rcx,8), %rcx
movzwl %r14w, %edx
movw %ax, (%rcx,%rdx,2)
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x40aa9b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
leaq 0xa0(%rsp), %r14
je 0x40aaba
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x60(%rsp), %rdi
cmpq %rbx, %rdi
je 0x40aad1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq %rbp, %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48d260
leaq 0x320(%rsp), %rdi
callq 0x467320
jmp 0x40a89d
incl 0x1c(%rsp)
jmp 0x40a89d
leaq 0xa0(%rsp), %rdi
callq 0x461d00
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x40ab2d
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0xa0(%rsp), %rdi
callq 0x4620b0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18a62c(%rip), %rdi    # 0x59517f
leaq 0x18951f(%rip), %rsi    # 0x594079
leaq 0x18a5e2(%rip), %rcx    # 0x595143
movl $0x269, %edx            # imm = 0x269
callq 0x4d8100
leaq 0x18ae59(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a692(%rip), %rdi    # 0x595210
leaq 0x1894f4(%rip), %rsi    # 0x594079
leaq 0x18a5b7(%rip), %rcx    # 0x595143
movl $0x26b, %edx            # imm = 0x26B
callq 0x4d8100
leaq 0x18ae2e(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18ae22(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a52c(%rip), %rdi    # 0x5950e1
leaq 0x1894bd(%rip), %rsi    # 0x594079
leaq 0x18a580(%rip), %rcx    # 0x595143
movl $0x267, %edx            # imm = 0x267
callq 0x4d8100
leaq 0x18adf7(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18adeb(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18addf(%rip), %rdi    # 0x5959cb
callq 0x402c01
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x189421(%rip), %rsi    # 0x594020
movl $0x1b, %edx
callq 0x484db0
movq (%rbx), %rsi
movq $0x60c900, %rdi         # imm = 0x60C900
callq 0x4852e0
movq %rax, %rdi
callq 0x484bc0
movl $0x1, %edi
callq 0x4def10
movq %rax, %r14
jmp 0x40ad02
jmp 0x40ac6f
jmp 0x40ac6f
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40ac5e
movl %r13d, (%rbx)
jmp 0x40ac5e
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40ac5e
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
jmp 0x40ac5e
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40ac5e
movl %r15d, (%rbx)
leaq 0x70(%rsp), %rbx
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %r12
jmp 0x40ac77
movq %rax, %r14
jmp 0x40acdd
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x40ac8e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x40aca5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x60(%rsp), %rdi
cmpq %rbx, %rdi
je 0x40acbc
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x2a8(%rsp), %rdi
callq 0x48d260
leaq 0x320(%rsp), %rdi
callq 0x467320
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x40ad02
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0xa0(%rsp), %rdi
callq 0x4620b0
movq %r14, %rdi
callq 0x4c34a0
nop