// File: /workspace/github_cpp_makefile_star2_O1/MPSLab-ASU[P]DiRAC/./src/baseAccelSim.cc
// Function: baseAccelSim::read_file_SPM_read_management(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void baseAccelSim::read_file_SPM_read_management(string spmReadManageFileName)
{
	uint8_t operand_number, network_number;	uint16_t RF_pass_number, offset_network_packets;
	uint32_t offset_base_addr_SPM,	burst_width_elements;
	uint16_t it=0;
	ifstream inFile(spmReadManageFileName.c_str());
	if(!inFile)
	{
		cout << "Cannot open and read file: " << spmReadManageFileName.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, token4, token5, token6;
		tokenStream >> token1 >> token2 >> token3 >> token4 >> token5 >> token6;
		RF_pass_number 					= stoul(token1);
		network_number					= stoul(token2);
		operand_number 					= stoul(token3);
		offset_network_packets	= stoul(token4);
		burst_width_elements		= stoul(token5);
		offset_base_addr_SPM 		= stoul(token6);

		assert((RF_pass_number >= 0 && RF_pass_number < RF_passes) && "invalid number for an RF pass!");
		assert((network_number >= 0 && network_number < inNetworks) && "invalid number of a network for read-operands!");
		assert((operand_number >= 0 && operand_number < total_operands) && "invalid operand number!");
		assert(offset_network_packets >= 0 && offset_network_packets < size_packetArr[operand_number] &&
			"invalid start address specified for communicating data packets for a read-operand in an RF pass!");
		assert(burst_width_elements > 0 && burst_width_elements <= size_packetArr[operand_number] &&
			"invalid burst width specified for communicating data packets for read-operand via network!");
			assert(offset_base_addr_SPM >= 0 && offset_base_addr_SPM < SPM_size &&
				"invalid SPM address specified for reading an operand in an RF pass!");

		read_data_RF_pass[RF_pass_number][network_number] = true;
		RF_pass_network_read_operand[RF_pass_number][network_number].push_back(operand_number);
		RF_pass_network_read_operand_offset_network_packet[RF_pass_number][network_number].push_back(offset_network_packets);
		RF_pass_network_read_operand_burst_width_elements[RF_pass_number][network_number].push_back(burst_width_elements);
		RF_pass_network_read_operand_offset_base_addr_SPM[RF_pass_number][network_number].push_back(offset_base_addr_SPM);
		it++;
	}
	inFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rsi, %r14
movq (%rsi), %rsi
leaq 0x280(%rsp), %r13
movq %r13, %rdi
movl $0x8, %edx
callq 0x460c10
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x2a0(%rsp,%rax)
jne 0x40b76c
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x50(%rsp), %rbp
leaq 0x20(%rsp), %r12
movl $0x0, 0x14(%rsp)
movq 0x280(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x4653c0
movsbl %al, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x419ec0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40b5da
movl 0x14(%rsp), %eax
cmpw $0x1, %ax
jbe 0x40b5cf
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x48c470
movq %rbp, 0x40(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x48(%rsp)
movb %cl, 0x50(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq %rcx, 0xe8(%rsp)
movb %cl, 0xf0(%rsp)
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %rcx, 0xc8(%rsp)
movb %cl, 0xd0(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rcx, 0xa8(%rsp)
movb %cl, 0xb0(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rcx, 0x88(%rsp)
movb %cl, 0x90(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movb %cl, 0x70(%rsp)
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0xe0(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0x80(%rsp), %rsi
callq 0x419b40
movq %rax, %rdi
leaq 0x60(%rsp), %rsi
callq 0x419b40
movq 0x40(%rsp), %r12
callq 0x4c7aa0
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r12, 0x8(%rsp)
je 0x40b665
movq %rax, %rbp
movl (%r14), %eax
testl %eax, %eax
je 0x40b219
cmpl $0x22, %eax
jne 0x40b21c
jmp 0x40b760
movl %r15d, (%r14)
movq 0xe0(%rsp), %r15
movl (%r14), %ebx
movl $0x0, (%r14)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, 0x8(%rsp)
je 0x40b671
movq %rax, %r12
movl (%r14), %eax
testl %eax, %eax
je 0x40b25f
cmpl $0x22, %eax
jne 0x40b262
jmp 0x40b748
movl %ebx, (%r14)
movq 0xc0(%rsp), %r15
movl (%r14), %ebx
movl $0x0, (%r14)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, 0x8(%rsp)
je 0x40b64d
movl (%r14), %ecx
testl %ecx, %ecx
je 0x40b2a2
cmpl $0x22, %ecx
jne 0x40b2a5
jmp 0x40b724
movl %ebx, (%r14)
movb %al, 0x5(%rsp)
movq 0xa0(%rsp), %r15
movl (%r14), %ebx
movl $0x0, (%r14)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, 0x8(%rsp)
je 0x40b659
movl (%r14), %ecx
testl %ecx, %ecx
je 0x40b2e9
cmpl $0x22, %ecx
jne 0x40b2ec
jmp 0x40b754
movl %ebx, (%r14)
movw %ax, 0x6(%rsp)
movq 0x80(%rsp), %r15
movl (%r14), %ebx
movl $0x0, (%r14)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, 0x8(%rsp)
je 0x40b641
movl (%r14), %ecx
testl %ecx, %ecx
je 0x40b331
cmpl $0x22, %ecx
jne 0x40b334
jmp 0x40b730
movl %ebx, (%r14)
movl %eax, 0x18(%rsp)
movq 0x60(%rsp), %r15
movl (%r14), %ebx
movl $0x0, (%r14)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4de720
cmpq %r15, 0x8(%rsp)
je 0x40b6bb
movl (%r14), %ecx
testl %ecx, %ecx
je 0x40b375
cmpl $0x22, %ecx
jne 0x40b378
jmp 0x40b73c
movl %ebx, (%r14)
movl %eax, 0x1c(%rsp)
movzwl %bp, %ecx
movzwl 0x2001cc(%rip), %edx    # 0x60b552
cmpl %edx, %ecx
jae 0x40b705
movzbl %r12b, %ecx
movzbl 0x1fddb8(%rip), %edx    # 0x609151
cmpl %edx, %ecx
jae 0x40b622
movzbl 0x5(%rsp), %ecx
cmpb 0x2001aa(%rip), %cl     # 0x60b556
jae 0x40b6c7
movq 0x20022f(%rip), %rdx    # 0x60b5e8
movzwl (%rdx,%rcx,2), %ecx
cmpw %cx, 0x6(%rsp)
jae 0x40b69c
movl 0x18(%rsp), %edx
decl %edx
cmpl %ecx, %edx
jae 0x40b6e6
cmpl %eax, 0x2001d8(%rip)    # 0x60b5b4
jbe 0x40b67d
movq 0x20029f(%rip), %rax    # 0x60b688
movzwl %bp, %r14d
leal (,%r14,8), %ecx
movq (%rax,%rcx), %rax
movzbl %r12b, %edx
movb $0x1, (%rax,%rdx)
movq 0x200288(%rip), %rax    # 0x60b690
movq (%rax,%rcx), %rax
leaq (%rdx,%rdx,2), %r15
leaq (%rax,%r15,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b434
movb 0x5(%rsp), %al
movb %al, (%rsi)
incq 0x8(%rdi)
leaq 0x50(%rsp), %rbp
leaq 0x20(%rsp), %r12
jmp 0x40b448
leaq 0x5(%rsp), %rdx
leaq 0x50(%rsp), %rbp
callq 0x40ec6e
leaq 0x20(%rsp), %r12
movq 0x200249(%rip), %rax    # 0x60b698
movq (%rax,%r14,8), %rax
leaq (%rax,%r15,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b473
movzwl 0x6(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b47d
leaq 0x6(%rsp), %rdx
callq 0x40ed60
movq 0x20021c(%rip), %rax    # 0x60b6a0
movq (%rax,%r14,8), %rax
leaq (%rax,%r15,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b4a6
movl 0x18(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b4b0
leaq 0x18(%rsp), %rdx
callq 0x40e9fa
movq 0x2001f1(%rip), %rax    # 0x60b6a8
movq (%rax,%r14,8), %rax
leaq (%rax,%r15,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b4d9
movl 0x1c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b4e3
leaq 0x1c(%rsp), %rdx
callq 0x40e9fa
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x40b4ff
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x40b524
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b549
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b56e
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b593
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40b5aa
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x100(%rsp), %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48c720
leaq 0x178(%rsp), %rdi
callq 0x4667e0
movl 0x14(%rsp), %eax
incl %eax
movl %eax, 0x14(%rsp)
jmp 0x40b07a
leaq 0x280(%rsp), %rdi
callq 0x4611c0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x40b603
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x280(%rsp), %rdi
callq 0x461570
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x189d15(%rip), %rdi    # 0x59533e
leaq 0x188a49(%rip), %rsi    # 0x594079
leaq 0x189cce(%rip), %rcx    # 0x595305
movl $0x2af, %edx            # imm = 0x2AF
callq 0x4d75c0
leaq 0x18a383(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a377(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a36b(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a35f(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x18a353(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x189e93(%rip), %rdi    # 0x595517
leaq 0x1889ee(%rip), %rsi    # 0x594079
leaq 0x189c73(%rip), %rcx    # 0x595305
movl $0x2b6, %edx            # imm = 0x2B6
callq 0x4d75c0
leaq 0x189d04(%rip), %rdi    # 0x5953a7
leaq 0x1889cf(%rip), %rsi    # 0x594079
leaq 0x189c54(%rip), %rcx    # 0x595305
movl $0x2b2, %edx            # imm = 0x2B2
callq 0x4d75c0
leaq 0x18a309(%rip), %rdi    # 0x5959cb
callq 0x402b8d
leaq 0x189397(%rip), %rdi    # 0x594a65
leaq 0x1889a4(%rip), %rsi    # 0x594079
leaq 0x189c29(%rip), %rcx    # 0x595305
movl $0x2b0, %edx            # imm = 0x2B0
callq 0x4d75c0
leaq 0x189d77(%rip), %rdi    # 0x595464
leaq 0x188985(%rip), %rsi    # 0x594079
leaq 0x189c0a(%rip), %rcx    # 0x595305
movl $0x2b4, %edx            # imm = 0x2B4
callq 0x4d75c0
leaq 0x189ba1(%rip), %rdi    # 0x5952ad
leaq 0x188966(%rip), %rsi    # 0x594079
leaq 0x189beb(%rip), %rcx    # 0x595305
movl $0x2ae, %edx            # imm = 0x2AE
callq 0x4d75c0
leaq 0x18a2a0(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18a294(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18a288(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18a27c(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18a270(%rip), %rdi    # 0x5959cb
callq 0x402c3d
leaq 0x18a264(%rip), %rdi    # 0x5959cb
callq 0x402c3d
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x1888a6(%rip), %rsi    # 0x594020
movl $0x1b, %edx
callq 0x484270
movq (%r14), %rsi
movq $0x60c900, %rdi         # imm = 0x60C900
callq 0x4847a0
movq %rax, %rdi
callq 0x484080
movl $0x1, %edi
callq 0x4de3d0
movq %rax, %r12
jmp 0x40b8f3
jmp 0x40b7df
jmp 0x40b7df
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x40b7d3
movl %r15d, (%r14)
jmp 0x40b7d3
jmp 0x40b7c7
jmp 0x40b7c7
jmp 0x40b7c7
jmp 0x40b7c7
movq %rax, %r12
cmpl $0x0, (%r14)
jne 0x40b7d3
movl %ebx, (%r14)
leaq 0x30(%rsp), %rbx
leaq 0x50(%rsp), %rbp
jmp 0x40b7f4
movq %rax, %r12
leaq 0x30(%rsp), %rbx
jmp 0x40b8dc
movq %rax, %r12
leaq 0x30(%rsp), %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x40b810
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x40b835
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b85a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b87f
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b8a4
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40b8bb
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x416ca0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x100(%rsp), %rdi
callq 0x48c720
leaq 0x178(%rsp), %rdi
callq 0x4667e0
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x40b8f3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x416ca0
leaq 0x280(%rsp), %rdi
callq 0x461570
movq %r12, %rdi
callq 0x4c2960