// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq (%rsi), %rsi
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x461750
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x120(%rsp,%rax)
jne 0x40b78f
leaq 0xf0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0x90(%rsp), %r15
leaq 0x70(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %rbp
movl $0x0, 0x14(%rsp)
leaq (%rsp,%rax), %rdi
addq $0x100, %rdi            # imm = 0x100
movl $0xa, %esi
callq 0x465f00
movsbl %al, %edx
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x41aa00
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40b5f4
movl 0x14(%rsp), %eax
cmpw $0x1, %ax
jbe 0x40b5dd
leaq 0x308(%rsp), %rbx
movq %rbx, %rdi
leaq 0xe0(%rsp), %rsi
movl $0x8, %edx
callq 0x48cfb0
movq %r15, 0x80(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x88(%rsp)
movb %cl, 0x90(%rsp)
movq %r12, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movb %cl, 0x70(%rsp)
movq %r13, 0x40(%rsp)
movq %rcx, 0x48(%rsp)
movb %cl, 0x50(%rsp)
movq %rbp, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movb %cl, 0x30(%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)
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x41a680
movq %rax, %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 %rax, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x41a680
movq %rax, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x41a680
movq 0x80(%rsp), %r14
callq 0x4c85e0
movq %rax, %rbx
movl (%rax), %r12d
movl $0x0, (%rax)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r14, 0x8(%rsp)
je 0x40b688
movq %rax, %rbp
movl (%rbx), %r15d
testl %r15d, %r15d
je 0x40b231
cmpl $0x22, %r15d
jne 0x40b237
jmp 0x40b783
movl %r12d, (%rbx)
movl %r12d, %r15d
movq 0x60(%rsp), %r12
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r12, 0x8(%rsp)
je 0x40b694
movq %rax, %r14
movl (%rbx), %r13d
testl %r13d, %r13d
je 0x40b275
cmpl $0x22, %r13d
jne 0x40b27b
jmp 0x40b76b
movl %r15d, (%rbx)
movl %r15d, %r13d
movq 0x40(%rsp), %r12
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r12, 0x8(%rsp)
je 0x40b670
movl (%rbx), %r15d
testl %r15d, %r15d
je 0x40b2b6
cmpl $0x22, %r15d
jne 0x40b2bc
jmp 0x40b747
movl %r13d, (%rbx)
movl %r13d, %r15d
movb %al, 0x5(%rsp)
movq 0x20(%rsp), %r12
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r12, 0x8(%rsp)
je 0x40b67c
movl (%rbx), %r13d
testl %r13d, %r13d
je 0x40b2fb
cmpl $0x22, %r13d
jne 0x40b301
jmp 0x40b777
movl %r15d, (%rbx)
movl %r15d, %r13d
movw %ax, 0x6(%rsp)
movq 0xc0(%rsp), %r12
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r12, 0x8(%rsp)
je 0x40b664
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x40b341
cmpl $0x22, %ecx
jne 0x40b344
jmp 0x40b753
movl %r13d, (%rbx)
movl %eax, 0x18(%rsp)
movq 0xa0(%rsp), %r12
movl (%rbx), %r15d
movl $0x0, (%rbx)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movl $0xa, %edx
callq 0x4df260
cmpq %r12, 0x8(%rsp)
je 0x40b6de
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x40b386
cmpl $0x22, %ecx
jne 0x40b389
jmp 0x40b75f
movl %r15d, (%rbx)
movl %eax, 0x1c(%rsp)
movzwl %bp, %ecx
movzwl 0x2001bb(%rip), %edx    # 0x60b552
cmpl %edx, %ecx
jae 0x40b728
movzbl %r14b, %ecx
movzbl 0x1fdda7(%rip), %edx    # 0x609151
cmpl %edx, %ecx
jae 0x40b645
movzbl 0x5(%rsp), %ecx
cmpb 0x200199(%rip), %cl     # 0x60b556
jae 0x40b6ea
movq 0x20021e(%rip), %rdx    # 0x60b5e8
movzwl (%rdx,%rcx,2), %ecx
cmpw %cx, 0x6(%rsp)
jae 0x40b6bf
movl 0x18(%rsp), %edx
decl %edx
cmpl %ecx, %edx
jae 0x40b709
cmpl %eax, 0x2001c7(%rip)    # 0x60b5b4
jbe 0x40b6a0
movq 0x20028e(%rip), %rax    # 0x60b688
movzwl %bp, %ebx
leal (,%rbx,8), %ecx
movq (%rax,%rcx), %rax
movzbl %r14b, %edx
movb $0x1, (%rax,%rdx)
movq 0x200279(%rip), %rax    # 0x60b690
movq (%rax,%rcx), %rax
leaq (%rdx,%rdx,2), %r14
leaq (%rax,%r14,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b450
movb 0x5(%rsp), %al
movb %al, (%rsi)
incq 0x8(%rdi)
leaq 0x90(%rsp), %r15
leaq 0x70(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %rbp
jmp 0x40b471
leaq 0x5(%rsp), %rdx
leaq 0x90(%rsp), %r15
leaq 0x70(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %rbp
callq 0x40ecd0
movq 0x200220(%rip), %rax    # 0x60b698
movq (%rax,%rbx,8), %rax
leaq (%rax,%r14,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b49c
movzwl 0x6(%rsp), %eax
movw %ax, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b4a6
leaq 0x6(%rsp), %rdx
callq 0x40edc2
movq 0x2001f3(%rip), %rax    # 0x60b6a0
movq (%rax,%rbx,8), %rax
leaq (%rax,%r14,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b4cf
movl 0x18(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b4d9
leaq 0x18(%rsp), %rdx
callq 0x40ea5c
movq 0x2001c8(%rip), %rax    # 0x60b6a8
movq (%rax,%rbx,8), %rax
leaq (%rax,%r14,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x40b502
movl 0x1c(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x40b50c
leaq 0x1c(%rsp), %rdx
callq 0x40ea5c
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b531
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b556
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40b56d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x40b584
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x40b59b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x40b5b8
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0x308(%rsp), %rdi
movq $0x606328, %rsi         # imm = 0x606328
callq 0x48d260
leaq 0x380(%rsp), %rdi
callq 0x467320
movl 0x14(%rsp), %eax
incl %eax
movl %eax, 0x14(%rsp)
movq 0x100(%rsp), %rax
movq -0x18(%rax), %rax
jmp 0x40b0a3
leaq 0x100(%rsp), %rdi
callq 0x461d00
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b626
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0x100(%rsp), %rdi
callq 0x4620b0
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x189cf2(%rip), %rdi    # 0x59533e
leaq 0x188a26(%rip), %rsi    # 0x594079
leaq 0x189cab(%rip), %rcx    # 0x595305
movl $0x2af, %edx            # imm = 0x2AF
callq 0x4d8100
leaq 0x18a360(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a354(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a348(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a33c(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x18a330(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x189e70(%rip), %rdi    # 0x595517
leaq 0x1889cb(%rip), %rsi    # 0x594079
leaq 0x189c50(%rip), %rcx    # 0x595305
movl $0x2b6, %edx            # imm = 0x2B6
callq 0x4d8100
leaq 0x189ce1(%rip), %rdi    # 0x5953a7
leaq 0x1889ac(%rip), %rsi    # 0x594079
leaq 0x189c31(%rip), %rcx    # 0x595305
movl $0x2b2, %edx            # imm = 0x2B2
callq 0x4d8100
leaq 0x18a2e6(%rip), %rdi    # 0x5959cb
callq 0x402b51
leaq 0x189374(%rip), %rdi    # 0x594a65
leaq 0x188981(%rip), %rsi    # 0x594079
leaq 0x189c06(%rip), %rcx    # 0x595305
movl $0x2b0, %edx            # imm = 0x2B0
callq 0x4d8100
leaq 0x189d54(%rip), %rdi    # 0x595464
leaq 0x188962(%rip), %rsi    # 0x594079
leaq 0x189be7(%rip), %rcx    # 0x595305
movl $0x2b4, %edx            # imm = 0x2B4
callq 0x4d8100
leaq 0x189b7e(%rip), %rdi    # 0x5952ad
leaq 0x188943(%rip), %rsi    # 0x594079
leaq 0x189bc8(%rip), %rcx    # 0x595305
movl $0x2ae, %edx            # imm = 0x2AE
callq 0x4d8100
leaq 0x18a27d(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18a271(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18a265(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18a259(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18a24d(%rip), %rdi    # 0x5959cb
callq 0x402c01
leaq 0x18a241(%rip), %rdi    # 0x5959cb
callq 0x402c01
movq $0x60c900, %rdi         # imm = 0x60C900
leaq 0x188883(%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 0x40b915
jmp 0x40b818
jmp 0x40b818
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40b7ff
movl %r12d, (%rbx)
jmp 0x40b7ff
jmp 0x40b7e5
jmp 0x40b7e5
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40b7ff
movl %r15d, (%rbx)
jmp 0x40b7ff
jmp 0x40b7f4
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x40b7ff
movl %r13d, (%rbx)
leaq 0x90(%rsp), %r15
leaq 0x70(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %rbp
jmp 0x40b823
movq %rax, %r14
jmp 0x40b8f0
movq %rax, %r14
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b848
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b86d
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x40b884
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x40b89b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x40b8b2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x40b8cf
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4177e0
movq $0x606328, %rsi         # imm = 0x606328
leaq 0x308(%rsp), %rdi
callq 0x48d260
leaq 0x380(%rsp), %rdi
callq 0x467320
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40b915
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4177e0
leaq 0x100(%rsp), %rdi
callq 0x4620b0
movq %r14, %rdi
callq 0x4c34a0