// File: /workspace/github_cpp_makefile_star2_O3/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 0x7b04(%rip), %rdx      # 0x31aed
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x17994
leaq 0x7af1(%rip), %rsi      # 0x31aec
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x4420
movq %rax, %rbp
cmpl $-0x1, %ebp
jne 0x2a0d3
movq 0x10fd3(%rip), %rdi     # 0x3aff0
leaq 0x5ffe(%rip), %rsi      # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x10fbb(%rip), %rdi     # 0x3aff0
leaq 0x9599(%rip), %rsi      # 0x335d5
movl $0x12, %edx
callq 0x4340
movq 0x10fa3(%rip), %rdi     # 0x3aff0
leaq 0x6843(%rip), %rsi      # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x10f8b(%rip), %rdi     # 0x3aff0
movl $0x52, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x5fc8(%rip), %rsi      # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x955b(%rip), %rsi      # 0x335e8
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 0x2a11e
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 0x79a2(%rip), %rsi      # 0x31aec
movl $0x1, %ecx
movq %r14, %rdi
movq %rbp, %rdx
callq 0x44d0
movq %rax, %r13
cmpl $-0x1, %r13d
jne 0x2a224
movq 0x10e82(%rip), %rdi     # 0x3aff0
leaq 0x5ead(%rip), %rsi      # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x10e6a(%rip), %rdi     # 0x3aff0
leaq 0x9448(%rip), %rsi      # 0x335d5
movl $0x12, %edx
callq 0x4340
movq 0x10e52(%rip), %rdi     # 0x3aff0
leaq 0x66f2(%rip), %rsi      # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x10e3a(%rip), %rdi     # 0x3aff0
movl $0x59, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x5e77(%rip), %rsi      # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x940a(%rip), %rsi      # 0x335e8
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 0x78be(%rip), %rsi      # 0x31aec
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 0x2a28a
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 0x2a2d5
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 0x77e5(%rip), %rbx      # 0x31aec
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 0x2a3f7
movq 0x10caf(%rip), %rdi     # 0x3aff0
leaq 0x5cda(%rip), %rsi      # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x10c97(%rip), %rdi     # 0x3aff0
leaq 0x9275(%rip), %rsi      # 0x335d5
movl $0x12, %edx
callq 0x4340
movq 0x10c7f(%rip), %rdi     # 0x3aff0
leaq 0x651f(%rip), %rsi      # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x10c67(%rip), %rdi     # 0x3aff0
movl $0x60, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x5ca4(%rip), %rsi      # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x9237(%rip), %rsi      # 0x335e8
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 0x76eb(%rip), %rsi      # 0x31aec
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 0x2a44c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
leaq 0x91bf(%rip), %rsi      # 0x33612
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a75b
leaq 0x91ad(%rip), %rsi      # 0x33617
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a762
leaq 0x919e(%rip), %rsi      # 0x3361f
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a76c
leaq 0x918f(%rip), %rsi      # 0x33627
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a776
leaq 0x916e(%rip), %rsi      # 0x3361d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a780
leaq 0x915f(%rip), %rsi      # 0x33625
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a78a
leaq 0x9150(%rip), %rsi      # 0x3362d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a794
leaq 0x9141(%rip), %rsi      # 0x33635
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a79e
leaq 0x9134(%rip), %rsi      # 0x3363f
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7a8
leaq 0x911b(%rip), %rsi      # 0x3363d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7af
leaq 0x910b(%rip), %rsi      # 0x33644
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7b6
leaq 0x90fb(%rip), %rsi      # 0x3364b
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7bd
leaq 0x90e3(%rip), %rsi      # 0x3364a
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7c4
leaq 0x90d3(%rip), %rsi      # 0x33651
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7cb
leaq 0x90bb(%rip), %rsi      # 0x33650
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7d2
leaq 0x90ab(%rip), %rsi      # 0x33657
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7d9
leaq 0x909b(%rip), %rsi      # 0x3365e
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7e0
leaq 0x908b(%rip), %rsi      # 0x33665
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7e7
leaq 0x907c(%rip), %rsi      # 0x3366d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7ee
leaq 0x906d(%rip), %rsi      # 0x33675
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7f5
leaq 0x905d(%rip), %rsi      # 0x3367c
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a7fc
leaq 0x9050(%rip), %rsi      # 0x33686
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a803
leaq 0x902b(%rip), %rsi      # 0x33678
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a80a
leaq 0x9029(%rip), %rsi      # 0x3368d
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a811
leaq 0x9010(%rip), %rsi      # 0x3368b
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a818
leaq 0x8fff(%rip), %rsi      # 0x33691
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a81f
leaq 0x8fee(%rip), %rsi      # 0x33697
movq %rsp, %rdi
callq 0x4100
testl %eax, %eax
je 0x2a826
movq 0x10930(%rip), %rdi     # 0x3aff0
leaq 0x595b(%rip), %rsi      # 0x30022
movl $0x8, %edx
callq 0x4340
movq 0x10918(%rip), %rdi     # 0x3aff0
leaq 0x8ef6(%rip), %rsi      # 0x335d5
movl $0x12, %edx
callq 0x4340
movq 0x10900(%rip), %rdi     # 0x3aff0
leaq 0x61a0(%rip), %rsi      # 0x30897
movl $0x1, %edx
callq 0x4340
movq 0x108e8(%rip), %rdi     # 0x3aff0
movl $0x83, %esi
callq 0x4500
movq %rax, %rbx
leaq 0x5925(%rip), %rsi      # 0x30041
movl $0x4, %edx
movq %rax, %rdi
callq 0x4340
leaq 0x8f6e(%rip), %rsi      # 0x3369e
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 0x2a82e
xorl %eax, %eax
jmp 0x2a82b
movl $0x1, %eax
jmp 0x2a82b
movl $0x3, %eax
jmp 0x2a82b
movl $0x4, %eax
jmp 0x2a82b
movl $0x5, %eax
jmp 0x2a82b
movl $0x6, %eax
jmp 0x2a82b
movl $0x7, %eax
jmp 0x2a82b
movl $0x8, %eax
jmp 0x2a82b
movl $0x9, %eax
jmp 0x2a82b
movl $0xa, %eax
jmp 0x2a82b
movl $0xb, %eax
jmp 0x2a82b
movl $0xc, %eax
jmp 0x2a82b
movl $0xd, %eax
jmp 0x2a82b
movl $0xe, %eax
jmp 0x2a82b
movl $0xf, %eax
jmp 0x2a82b
movl $0x10, %eax
jmp 0x2a82b
movl $0x11, %eax
jmp 0x2a82b
movl $0x12, %eax
jmp 0x2a82b
movl $0x13, %eax
jmp 0x2a82b
movl $0x14, %eax
jmp 0x2a82b
movl $0x15, %eax
jmp 0x2a82b
movl $0x16, %eax
jmp 0x2a82b
movl $0x17, %eax
jmp 0x2a82b
movl $0x18, %eax
jmp 0x2a82b
movl $0x19, %eax
jmp 0x2a82b
movl $0x1a, %eax
jmp 0x2a82b
movl $0x1b, %eax
movl %eax, (%r15)
leaq 0x72b7(%rip), %rbx      # 0x31aec
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 0x2a875
leaq 0x10c39(%rip), %rax     # 0x3b4a0
movl (%rax), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x2a909
movslq %eax, %rbx
leaq 0x726d(%rip), %rsi      # 0x31aec
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 0x2a8ca
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 0x106d6(%rip), %rsi     # 0x3afc8
leaq 0x28(%rsp), %rdi
callq 0x43d0
leaq 0xa0(%rsp), %rdi
callq 0x4120
movq 0x106b8(%rip), %rbx     # 0x3afc8
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 0x2a965
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 0x10647(%rip), %rsi     # 0x3afc8
leaq 0x28(%rsp), %rdi
callq 0x43d0
leaq 0xa0(%rsp), %rdi
callq 0x4120
jmp 0x2a9d0
jmp 0x2a9cd
jmp 0x2a9cd
jmp 0x2a9cd
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a9f6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x2a9f6
jmp 0x2a9f3
jmp 0x2a9f3
jmp 0x2a9c8
jmp 0x2a9c8
movq %rax, %rbx
jmp 0x2aa17
movq %rax, %rbx
movq 0x105f1(%rip), %rsi     # 0x3afc8
leaq 0x1a8(%rsp), %rdi
callq 0x43d0
leaq 0x220(%rsp), %rdi
callq 0x4120
jmp 0x2a9f6
movq %rax, %rbx
movq 0x105cb(%rip), %rsi     # 0x3afc8
leaq 0x328(%rsp), %rdi
callq 0x43d0
leaq 0x3a0(%rsp), %rdi
callq 0x4120
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2aa32
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x4540