// File: /workspace/github_cpp_makefile_star2_O1/jmfenner92[P]Log-Parser/src/log_parser.cpp
// Function: dataCollection(CmdRecord*, std::basic_ifstream<char, std::char_traits<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void dataCollection(CmdRecord* curr_record, ifstream& log_file, std::string temp_data) {
	// find the length in words of the command data
	int length = (curr_record->HexToDec(temp_data) / 4);
	int field_counter = 0;
	int indexer = 0;
	std::string curr_field;

	for (int i = 0; i < (length*NUM_FIELDS); i++)  {
		log_file >> curr_field;
		field_counter++;

		if (field_counter == DATA) {
			// we have the Data field value (this is special if it's in the address of
			// a command we want, so set it aside for later)
			//curr_node->curr_record.Set_Data(i, curr_field.substr(0,4);
			//curr_node->curr_record.Set_Data(i+1, curr_field.substr(4,4));
			curr_record->Set_Data(indexer, curr_field.substr(0,4));
			curr_record->Set_Data(indexer+1, curr_field.substr(4,4));
			indexer += 2;

		} else if (field_counter == ENDLINE) {
			field_counter = 0;
			line_count++;
		}
	}

	curr_record->Set_Total_Words(length);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0xa8(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r15
movq %r15, %rdi
callq 0x34ce
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3a0e
movl %eax, %r15d
leal 0x3(%r15), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2d4e
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2170
sarl $0x2, %ebx
movq %rbx, -0x38(%rbp)
leaq -0x88(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpl $0x4, %r15d
jl 0x2e54
movq -0x38(%rbp), %rcx
leal (%rcx,%rcx), %eax
shll $0x4, %ecx
subl %eax, %ecx
cmpl $0x2, %ecx
movl $0x1, %r15d
cmovgel %ecx, %r15d
xorl %r12d, %r12d
leaq -0x98(%rbp), %r13
xorl %ebx, %ebx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2200
cmpl $0xd, %ebx
je 0x2e3f
cmpl $0x7, %ebx
jne 0x2e49
movl $0x4, %ecx
leaq -0x78(%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2190
movq -0x30(%rbp), %rdi
movl %r12d, %esi
leaq -0x78(%rbp), %rdx
callq 0x3860
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x2df3
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x2170
movl $0x4, %edx
movl $0x4, %ecx
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x2190
leal 0x1(%r12), %esi
movq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x3860
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2e34
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2170
addl $0x2, %r12d
movl $0x8, %ebx
jmp 0x2e4b
incl 0x6343(%rip)            # 0x9188
xorl %ebx, %ebx
jmp 0x2e4b
incl %ebx
decl %r15d
jne 0x2d9a
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x394e
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2e83
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2170
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2ee3
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2f08
movq -0xa8(%rbp), %rsi
jmp 0x2f00
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x2ee6
movq -0x68(%rbp), %rsi
jmp 0x2ed9
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2ee6
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x2170
jmp 0x2ee6
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0x2f08
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x22b0