// File: /workspace/github_cpp_makefile_star2_O1/estwings57[P]CasHMC/sources/RunSim.cpp
// Function: ParseTraceFileLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long&, unsigned long&, CasHMC::TransactionType&, unsigned int&)
void ParseTraceFileLine(string &line, uint64_t &clockCycle, uint64_t &addr, TransactionType &tranType, unsigned &dataSize)
{
	int previousIndex=0;
	int spaceIndex=0;
	string  tempStr="";

	spaceIndex = line.find_first_of(" ", 0);
	if(spaceIndex==-1)	ERROR("  == Error - tracefile format is wrong : "<<line);
	tempStr = line.substr(0, spaceIndex);
	istringstream clock(tempStr);
	clock>>clockCycle;
	previousIndex = spaceIndex;

	spaceIndex = line.find_first_not_of(" ", previousIndex);
	if(spaceIndex==-1)	ERROR("  == Error - tracefile format is wrong : "<<line);
	tempStr = line.substr(spaceIndex, line.find_first_of(" ", spaceIndex) - spaceIndex);
	istringstream add(tempStr.substr(2));
	add>>hex>>addr;
	previousIndex = line.find_first_of(" ", spaceIndex);

	spaceIndex = line.find_first_not_of(" ", previousIndex);
	if(spaceIndex==-1)	ERROR("  == Error - tracefile format is wrong : "<<line);
	
	tempStr = line.substr(spaceIndex, line.find_first_of(" ", spaceIndex) - spaceIndex);
	if(tempStr.compare("READ")==0)			tranType = DATA_READ;
	else if(tempStr.compare("WRITE")==0)	tranType = DATA_WRITE;
	//Arithmetic atomic
	else if(tempStr.compare("2ADD8")==0)	tranType = ATM_2ADD8;
	else if(tempStr.compare("ADD16")==0)	tranType = ATM_ADD16;
	else if(tempStr.compare("P_2ADD8")==0)	tranType = ATM_P_2ADD8;
	else if(tempStr.compare("P_ADD16")==0)	tranType = ATM_P_ADD16;
	else if(tempStr.compare("2ADDS8R")==0)	tranType = ATM_2ADDS8R;
	else if(tempStr.compare("ADDS16R")==0)	tranType = ATM_ADDS16R;
	else if(tempStr.compare("INC8")==0)		tranType = ATM_INC8;
	else if(tempStr.compare("P_INC8")==0)	tranType = ATM_P_INC8;
	//Boolean atomic
	else if(tempStr.compare("XOR16")==0)	tranType = ATM_XOR16;
	else if(tempStr.compare("OR16")==0)		tranType = ATM_OR16;
	else if(tempStr.compare("NOR16")==0)	tranType = ATM_NOR16;
	else if(tempStr.compare("AND16")==0)	tranType = ATM_AND16;
	else if(tempStr.compare("NAND16")==0)	tranType = ATM_NAND16;
	//Comparison atomic
	else if(tempStr.compare("CASGT8")==0)	tranType = ATM_CASGT8;
	else if(tempStr.compare("CASLT8")==0)	tranType = ATM_CASLT8;
	else if(tempStr.compare("CASGT16")==0)	tranType = ATM_CASGT16;
	else if(tempStr.compare("CASLT16")==0)	tranType = ATM_CASLT16;
	else if(tempStr.compare("CASEQ8")==0)	tranType = ATM_CASEQ8;
	else if(tempStr.compare("CASZERO16")==0)tranType = ATM_CASZERO16;
	else if(tempStr.compare("EQ16")==0)		tranType = ATM_EQ16;
	else if(tempStr.compare("EQ8")==0)		tranType = ATM_EQ8;
	//Bitwise atomic
	else if(tempStr.compare("BWR")==0)		tranType = ATM_BWR;
	else if(tempStr.compare("P_BWR")==0)	tranType = ATM_P_BWR;
	else if(tempStr.compare("BWR8R")==0)	tranType = ATM_BWR8R;
	else if(tempStr.compare("SWAP16")==0)	tranType = ATM_SWAP16;
	else {
		ERROR("  == Error - Unknown command in tracefile : "<<tempStr);
	}
	previousIndex = line.find_first_of(" ", spaceIndex);

	spaceIndex = line.find_first_not_of(" ", previousIndex);
	if(spaceIndex==-1) {
		dataSize = TRANSACTION_SIZE;
		return;
	}
	tempStr = line.substr(spaceIndex, line.find_first_of(" ", spaceIndex) - spaceIndex);
	istringstream size(tempStr);
	size>>dataSize;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %r8, 0x20(%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x8144(%rip), %rdx      # 0x32a7d
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x18176
leaq 0x8131(%rip), %rsi      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4420
movq %rax, %rbp
cmpl $-0x1, %ebp
jne 0x2aa23
movq 0x11683(%rip), %rdi     # 0x3bff0
leaq 0x66ae(%rip), %rsi      # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x1166b(%rip), %rdi     # 0x3bff0
leaq 0x9bc9(%rip), %rsi      # 0x34555
movl $0x12, %edx
callq 0x4340
movq 0x11653(%rip), %rdi     # 0x3bff0
leaq 0x6e93(%rip), %rsi      # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x1163b(%rip), %rdi     # 0x3bff0
movl $0x52, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x6678(%rip), %rsi      # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x9b8b(%rip), %rsi      # 0x34568
movl $0x29, %edx
movq %rbx, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movslq %ebp, %rbp
leaq 0x328(%rsp), %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rbp, %rcx
callq 0x4310
movq %rsp, %rdi
leaq 0x328(%rsp), %rbx
movq %rbx, %rsi
callq 0x4370
movq (%rbx), %rdi
leaq 0x338(%rsp), %rax
cmpq %rax, %rdi
je 0x2aa6e
movq 0x338(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x328(%rsp), %rdi
movq %rsp, %rsi
movl $0x8, %edx
callq 0x44c0
leaq 0x328(%rsp), %rdi
movq %r13, %rsi
callq 0x4190
leaq 0x7fe2(%rip), %rsi      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %rbp, %rdx
callq 0x44d0
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x2ab74
movq 0x11532(%rip), %rdi     # 0x3bff0
leaq 0x655d(%rip), %rsi      # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x1151a(%rip), %rdi     # 0x3bff0
leaq 0x9a78(%rip), %rsi      # 0x34555
movl $0x12, %edx
callq 0x4340
movq 0x11502(%rip), %rdi     # 0x3bff0
leaq 0x6d42(%rip), %rsi      # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x114ea(%rip), %rdi     # 0x3bff0
movl $0x59, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x6527(%rip), %rsi      # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x9a3a(%rip), %rsi      # 0x34568
movl $0x29, %edx
movq %rbx, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movslq %r13d, %r13
leaq 0x7efe(%rip), %rsi      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %r13, %rdx
callq 0x4420
subq %r13, %rax
leaq 0x1a8(%rsp), %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %rax, %rcx
callq 0x4310
movq %rsp, %rdi
leaq 0x1a8(%rsp), %rbx
movq %rbx, %rsi
callq 0x4370
movq (%rbx), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x2abda
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
movl $0x2, %edx
movq $-0x1, %rcx
callq 0x4310
leaq 0x1a8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x8, %edx
callq 0x44c0
leaq 0x38(%rsp), %rbp
movq -0x10(%rbp), %rdi
cmpq %rbp, %rdi
je 0x2ac25
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x1a8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x1c0(%rsp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x1c0(%rsp,%rax)
movq %r12, %rsi
callq 0x4190
leaq 0x7e25(%rip), %rbx      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x4420
movslq %eax, %rdx
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44d0
movq %rax, %r12
cmpl $-0x1, %r12d
jne 0x2ad47
movq 0x1135f(%rip), %rdi     # 0x3bff0
leaq 0x638a(%rip), %rsi      # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x11347(%rip), %rdi     # 0x3bff0
leaq 0x98a5(%rip), %rsi      # 0x34555
movl $0x12, %edx
callq 0x4340
movq 0x1132f(%rip), %rdi     # 0x3bff0
leaq 0x6b6f(%rip), %rsi      # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x11317(%rip), %rdi     # 0x3bff0
movl $0x60, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x6354(%rip), %rsi      # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x9867(%rip), %rsi      # 0x34568
movl $0x29, %edx
movq %rbx, %rdi
callq 0x4340
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41f0
movslq %r12d, %r12
leaq 0x7d2b(%rip), %rsi      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %r12, %rdx
callq 0x4420
subq %r12, %rax
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq 0x4310
movq %rsp, %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x4370
movq (%rbx), %rdi
cmpq %rbp, %rdi
je 0x2ad9c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x97ef(%rip), %rsi      # 0x34592
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0ab
leaq 0x97dd(%rip), %rsi      # 0x34597
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0b2
leaq 0x97ce(%rip), %rsi      # 0x3459f
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0bc
leaq 0x97bf(%rip), %rsi      # 0x345a7
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0c6
leaq 0x979e(%rip), %rsi      # 0x3459d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0d0
leaq 0x978f(%rip), %rsi      # 0x345a5
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0da
leaq 0x9780(%rip), %rsi      # 0x345ad
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0e4
leaq 0x9771(%rip), %rsi      # 0x345b5
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0ee
leaq 0x9764(%rip), %rsi      # 0x345bf
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0f8
leaq 0x974b(%rip), %rsi      # 0x345bd
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b0ff
leaq 0x973b(%rip), %rsi      # 0x345c4
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b106
leaq 0x972b(%rip), %rsi      # 0x345cb
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b10d
leaq 0x9713(%rip), %rsi      # 0x345ca
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b114
leaq 0x9703(%rip), %rsi      # 0x345d1
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b11b
leaq 0x96eb(%rip), %rsi      # 0x345d0
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b122
leaq 0x96db(%rip), %rsi      # 0x345d7
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b129
leaq 0x96cb(%rip), %rsi      # 0x345de
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b130
leaq 0x96bb(%rip), %rsi      # 0x345e5
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b137
leaq 0x96ac(%rip), %rsi      # 0x345ed
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b13e
leaq 0x969d(%rip), %rsi      # 0x345f5
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b145
leaq 0x968d(%rip), %rsi      # 0x345fc
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b14c
leaq 0x9680(%rip), %rsi      # 0x34606
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b153
leaq 0x965b(%rip), %rsi      # 0x345f8
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b15a
leaq 0x9659(%rip), %rsi      # 0x3460d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b161
leaq 0x9640(%rip), %rsi      # 0x3460b
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b168
leaq 0x962f(%rip), %rsi      # 0x34611
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b16f
leaq 0x961e(%rip), %rsi      # 0x34617
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2b176
movq 0x10fe0(%rip), %rdi     # 0x3bff0
leaq 0x600b(%rip), %rsi      # 0x31022
movl $0x8, %edx
callq 0x4340
movq 0x10fc8(%rip), %rdi     # 0x3bff0
leaq 0x9526(%rip), %rsi      # 0x34555
movl $0x12, %edx
callq 0x4340
movq 0x10fb0(%rip), %rdi     # 0x3bff0
leaq 0x67f0(%rip), %rsi      # 0x31837
movl $0x1, %edx
callq 0x4340
movq 0x10f98(%rip), %rdi     # 0x3bff0
movl $0x83, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x5fd5(%rip), %rsi      # 0x31041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x959e(%rip), %rsi      # 0x3461e
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x4340
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x4340
movq %rax, %rdi
callq 0x4170
jmp 0x2b17e
xorl %eax, %eax
jmp 0x2b17b
movl $0x1, %eax
jmp 0x2b17b
movl $0x3, %eax
jmp 0x2b17b
movl $0x4, %eax
jmp 0x2b17b
movl $0x5, %eax
jmp 0x2b17b
movl $0x6, %eax
jmp 0x2b17b
movl $0x7, %eax
jmp 0x2b17b
movl $0x8, %eax
jmp 0x2b17b
movl $0x9, %eax
jmp 0x2b17b
movl $0xa, %eax
jmp 0x2b17b
movl $0xb, %eax
jmp 0x2b17b
movl $0xc, %eax
jmp 0x2b17b
movl $0xd, %eax
jmp 0x2b17b
movl $0xe, %eax
jmp 0x2b17b
movl $0xf, %eax
jmp 0x2b17b
movl $0x10, %eax
jmp 0x2b17b
movl $0x11, %eax
jmp 0x2b17b
movl $0x12, %eax
jmp 0x2b17b
movl $0x13, %eax
jmp 0x2b17b
movl $0x14, %eax
jmp 0x2b17b
movl $0x15, %eax
jmp 0x2b17b
movl $0x16, %eax
jmp 0x2b17b
movl $0x17, %eax
jmp 0x2b17b
movl $0x18, %eax
jmp 0x2b17b
movl $0x19, %eax
jmp 0x2b17b
movl $0x1a, %eax
jmp 0x2b17b
movl $0x1b, %eax
movl %eax, (%r15)
leaq 0x78f7(%rip), %rbx      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4420
movslq %eax, %rdx
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44d0
cmpl $-0x1, %eax
jne 0x2b1c5
leaq 0x112e9(%rip), %rax     # 0x3c4a0
movl (%rax), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2b259
movslq %eax, %rbx
leaq 0x78ad(%rip), %rsi      # 0x32a7c
movl $0x1, %ecx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4420
subq %rbx, %rax
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x4310
movq %rsp, %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x4370
movq (%rbx), %rdi
cmpq %rbp, %rdi
je 0x2b21a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
movl $0x8, %edx
callq 0x44c0
leaq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x4530
movq 0x10d86(%rip), %rsi     # 0x3bfc8
leaq 0x28(%rsp), %rdi
callq 0x43d0
leaq 0xa0(%rsp), %rdi
callq 0x4120
movq 0x10d68(%rip), %rbx     # 0x3bfc8
leaq 0x1a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x43d0
leaq 0x220(%rsp), %rdi
callq 0x4120
leaq 0x328(%rsp), %rdi
movq %rbx, %rsi
callq 0x43d0
leaq 0x3a0(%rsp), %rdi
callq 0x4120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2b2b5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4300
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10cf7(%rip), %rsi     # 0x3bfc8
leaq 0x28(%rsp), %rdi
callq 0x43d0
leaq 0xa0(%rsp), %rdi
callq 0x4120
jmp 0x2b320
jmp 0x2b31d
jmp 0x2b31d
jmp 0x2b31d
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b346
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2b346
jmp 0x2b343
jmp 0x2b343
jmp 0x2b318
jmp 0x2b318
movq %rax, %rbx
jmp 0x2b367
movq %rax, %rbx
movq 0x10ca1(%rip), %rsi     # 0x3bfc8
leaq 0x1a8(%rsp), %rdi
callq 0x43d0
leaq 0x220(%rsp), %rdi
callq 0x4120
jmp 0x2b346
movq %rax, %rbx
movq 0x10c7b(%rip), %rsi     # 0x3bfc8
leaq 0x328(%rsp), %rdi
callq 0x43d0
leaq 0x3a0(%rsp), %rdi
callq 0x4120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2b382
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540