// File: auton1[P]viterbi/entry.cpp
// Function: entry::make_typed_int_vector(std::vector<char, std::allocator<char>>&, std::vector<int, std::allocator<int>> const&)
void entry::make_typed_int_vector(vector<char> &out, const vector<int> &in )
{
	vector<char> tmp_char;
	int type;
	int8_t size_type;
	unsigned int max = 0;
	out.resize(0);

	for (unsigned int ui=0; ui<in.size(); ui++)
	{
		if ((abs(in[ui]) > (int)max) and ( (int8_t)in[ui] != (int8_t)0x80))
			max = abs(in[ui]);
	}

	if (max < 127)
		type = 1;
	else if (max < 32767)
		type = 2;
	else
		type = 3;

	if (in.size() < 15)
	{
		size_type = (int8_t)in.size();
		size_type = size_type << 4;
		size_type = size_type | (int8_t)type;

		out.push_back( size_type );
	}
	else
	{
		size_type = (int8_t)15;
		size_type = size_type << 4;
		size_type = size_type | (int8_t)type;

		out.push_back( size_type );

		make_typed_int(tmp_char, in.size(), true);
		out.insert( out.end(), tmp_char.begin(), tmp_char.begin() );
	}

	for (unsigned int ui=0; ui<in.size(); ui++)
	{
		make_int(tmp_char, in[ui], type);
		out.insert( out.end(), tmp_char.begin(), tmp_char.end() );
	}
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq %rdx, 0xe0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x2a300
movl $0x0, 0xbc(%rsp)
movq 0xe8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x20910
jmp 0x47707
movl $0x0, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
movq %rax, 0x38(%rsp)
movq 0xe0(%rsp), %rdi
callq 0x10be0
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x477ea
movq 0xe0(%rsp), %rdi
movl 0xa8(%rsp), %eax
movl %eax, %esi
callq 0xf130
movl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl 0xbc(%rsp), %eax
jle 0x477d2
movq 0xe0(%rsp), %rdi
movl 0xa8(%rsp), %eax
movl %eax, %esi
callq 0xf130
movl (%rax), %eax
movsbl %al, %eax
cmpl $-0x80, %eax
je 0x477d2
movq 0xe0(%rsp), %rdi
movl 0xa8(%rsp), %eax
movl %eax, %esi
callq 0xf130
movl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0xbc(%rsp)
jmp 0x477d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x267c0
jmp 0x47ab4
jmp 0x477d4
movl 0xa8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa8(%rsp)
jmp 0x47712
cmpl $0x7f, 0xbc(%rsp)
jae 0x47801
movl $0x1, 0xc4(%rsp)
jmp 0x47828
cmpl $0x7fff, 0xbc(%rsp) # imm = 0x7FFF
jae 0x4781b
movl $0x2, 0xc4(%rsp)
jmp 0x47826
movl $0x3, 0xc4(%rsp)
jmp 0x47828
movq 0xe0(%rsp), %rdi
callq 0x10be0
cmpq $0xf, %rax
jae 0x478a2
movq 0xe0(%rsp), %rdi
callq 0x10be0
movb %al, 0xc3(%rsp)
movb 0xc3(%rsp), %al
shlb $0x4, %al
movb %al, 0xc3(%rsp)
movzbl 0xc3(%rsp), %eax
movl 0xc4(%rsp), %ecx
orl %ecx, %eax
movb %al, 0xc3(%rsp)
movq 0xe8(%rsp), %rdi
movb 0xc3(%rsp), %al
movb %al, 0xa7(%rsp)
leaq 0xa7(%rsp), %rsi
callq 0x49620
jmp 0x4789d
jmp 0x479bb
movb $0xf, 0xc3(%rsp)
movb 0xc3(%rsp), %al
shlb $0x4, %al
movb %al, 0xc3(%rsp)
movzbl 0xc3(%rsp), %eax
movl 0xc4(%rsp), %ecx
orl %ecx, %eax
movb %al, 0xc3(%rsp)
movq 0xe8(%rsp), %rdi
movb 0xc3(%rsp), %al
movb %al, 0xa6(%rsp)
leaq 0xa6(%rsp), %rsi
callq 0x49620
jmp 0x478f8
movq 0xe0(%rsp), %rdi
callq 0x10be0
movq 0x40(%rsp), %rdi
movl %eax, 0xa0(%rsp)
leaq 0xc8(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movl $0x1, %ecx
callq 0x45d20
jmp 0x4792d
movq 0xe8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x27020
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x39b20
leaq 0xc8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x26ff0
movq 0x20(%rsp), %rdi
movq %rax, 0x88(%rsp)
callq 0x26ff0
movq 0x28(%rsp), %rdi
movq %rax, 0x80(%rsp)
movq 0x98(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq 0x80(%rsp), %rcx
callq 0x39a60
movq %rax, 0x30(%rsp)
jmp 0x479b1
movq 0x30(%rsp), %rax
movq %rax, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
movq %rax, 0x18(%rsp)
movq 0xe0(%rsp), %rdi
callq 0x10be0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x47a9f
movq 0xe0(%rsp), %rdi
movl 0x74(%rsp), %eax
movl %eax, %esi
callq 0xf130
movq 0x40(%rsp), %rdi
movq %rax, %rdx
movl 0xc4(%rsp), %ecx
leaq 0xc8(%rsp), %rsi
callq 0x45ee0
jmp 0x47a1b
movq 0xe8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x27020
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x39b20
leaq 0xc8(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x26ff0
movq (%rsp), %rdi
movq %rax, 0x58(%rsp)
callq 0x27020
movq 0x8(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
callq 0x39a60
movq %rax, 0x10(%rsp)
jmp 0x47a85
movq 0x10(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x479c3
leaq 0xc8(%rsp), %rdi
callq 0x267c0
addq $0xf8, %rsp
retq
movq 0xb0(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)