// File: auton1[P]viterbi/entry.cpp
// Function: entry::get_typed_string[abi:cxx11](unsigned int*, std::vector<char, std::allocator<char>> const&)
string entry::get_typed_string(unsigned int * line_position, const vector<char>& line)
{
	unsigned int size, type;
	string out;

	get_type( line_position, line, type, size );
	if (type != 7)
	{
		LOG.printLOG("Error: Expected type 7 for string. Found type " + header::int2str(type) + ".\n");
	}

	char * tmp = new char[size];
	memcpy(tmp, &line[*line_position], size*sizeof(char));
	*line_position += size;
	out = string( tmp, size );

	if (out == "" or out == " ")
		out = ".";

	return out;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x40(%rsp)
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdx, 0x110(%rsp)
movq %rcx, 0x108(%rsp)
movq 0x118(%rsp), %rax
movq %rax, 0x50(%rsp)
movb $0x0, 0xff(%rsp)
callq 0x67e0
movq 0x50(%rsp), %rdi
movq 0x110(%rsp), %rsi
movq 0x108(%rsp), %rdx
leaq 0x100(%rsp), %rcx
leaq 0x104(%rsp), %r8
callq 0x489f0
jmp 0x4872a
cmpl $0x7, 0x100(%rsp)
je 0x48856
movl 0x100(%rsp), %esi
leaq 0x88(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30500
jmp 0x48753
leaq 0x2caaf(%rip), %rsi     # 0x75209
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0xf4f0
jmp 0x48771
leaq 0x2c879(%rip), %rdx     # 0x74ff1
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xf4a0
jmp 0x4878f
leaq 0x4ae6a(%rip), %rdi     # 0x93600
leaq 0xc8(%rsp), %rsi
callq 0x71280
jmp 0x487a5
leaq 0xc8(%rsp), %rdi
callq 0x6b50
leaq 0xa8(%rsp), %rdi
callq 0x6b50
leaq 0x88(%rsp), %rdi
callq 0x6b50
jmp 0x48856
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x489d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x48844
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x48837
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x6b50
leaq 0xa8(%rsp), %rdi
callq 0x6b50
leaq 0x88(%rsp), %rdi
callq 0x6b50
jmp 0x489d4
movl 0x104(%rsp), %eax
movl %eax, %edi
callq 0x6030
movq %rax, 0x38(%rsp)
jmp 0x4886b
movq 0x38(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x108(%rsp), %rdi
movq 0x110(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x49920
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movl 0x104(%rsp), %eax
movl %eax, %edx
callq 0x6430
movl 0x104(%rsp), %edx
movq 0x110(%rsp), %rax
movl (%rax), %ecx
addl %edx, %ecx
movl %ecx, (%rax)
movq 0x80(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0x104(%rsp), %eax
movq %rax, 0x28(%rsp)
leaq 0x5f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x69f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
leaq 0x60(%rsp), %rdi
callq 0x6620
jmp 0x4890c
movq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0x66c0
movq 0x8(%rsp), %rdi
callq 0x6b50
leaq 0x5f(%rsp), %rdi
callq 0x65f0
movq 0x40(%rsp), %rdi
leaq 0x2d3e9(%rip), %rsi     # 0x75d29
callq 0xea20
movb %al, 0x17(%rsp)
jmp 0x4894b
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x48976
jmp 0x48955
movq 0x40(%rsp), %rdi
leaq 0x2b743(%rip), %rsi     # 0x740a4
callq 0xea20
movb %al, 0x7(%rsp)
jmp 0x4896c
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x48976
jmp 0x489ab
movq 0x40(%rsp), %rdi
leaq 0x2c75c(%rip), %rsi     # 0x750de
callq 0x67b0
jmp 0x48989
jmp 0x489ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
leaq 0x5f(%rsp), %rdi
callq 0x65f0
jmp 0x489d4
movb $0x1, 0xff(%rsp)
testb $0x1, 0xff(%rsp)
jne 0x489c7
movq 0x40(%rsp), %rdi
callq 0x6b50
movq 0x48(%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
retq
movq 0x40(%rsp), %rdi
callq 0x6b50
movq 0xf0(%rsp), %rdi
callq 0x69e0
nopl (%rax,%rax)