// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/header.cpp
// Function: header::add_FORMAT_descriptor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
int header::add_FORMAT_descriptor(const string &in, int index)
{
	size_t found_end=in.find_last_of(">");
	string details = in.substr(0, found_end);

	vector<string> tokens;
	tokenize(details, ',', tokens);
	Field_description I;
	I.Field = "FORMAT";

	if (tokens.size() < 4)
		LOG.error("Expected at least 4 parts in FORMAT definition: " + in);

	vector<string> entry;
	for (unsigned int ui=0; ui<tokens.size(); ui++)
	{
		tokenize(tokens[ui], '=', entry);
		if (entry[0] == "ID") I.ID = entry[1];
		else if (entry[0] == "Number")
		{
			if ((entry[1] == "A") || (entry[1] == "G"))
				I.N_entries = -1;
			else
				I.N_entries = str2int(entry[1]);
			I.N_entries_str = entry[1];
		}
		else if (entry[0] == "Type")
		{
			if (entry[1] == "Integer") {I.Type_str = "Integer"; I.Type = Integer;}
			else if ((entry[1] == "Float") || (entry[1] == "Numeric")) {I.Type_str = "Float"; I.Type = Float;}
			else if (entry[1] == "Character") {I.Type_str = "Character"; I.Type = Character;}
			else if (entry[1] == "String") {I.Type_str = "String"; I.Type = String;}
			else if (entry[1] == "Flag")
			{
				I.Type = Flag;
				I.Type_str = "Flag";
				if (I.N_entries != 0) LOG.error("Flag Type must have 0 entries: " + in);
			}
			else LOG.error("Unknown Type in FORMAT meta-information: " + in);
		}
		else if (entry[0] == "Description")	I.Description = entry[1];
		else if (entry[0] == "IDX")
		{
			has_idx = true;
			I.idx = str2int(entry[1]);
		}
		else
		{
			if (I.Other != "")
				I.Other += ",";
			I.Other += tokens[ui];
		}
	}

	if (I.ID == "") LOG.error("ID required in FORMAT field description: " + in);
	if (I.N_entries_str == "") LOG.error("Number required in FORMAT field description: " + in);
	if (I.Type_str == "") LOG.error("Type required in FORMAT field description: " + in);
	if (I.Description == "") LOG.error("Description required in FORMAT field description: " + in);
	if ((I.idx == -1) && (has_idx)) LOG.error("Missing index in FORMAT field description: " + in);
	parsed_lines.push_back(I);

	if (I.idx != -1)
	{
		FORMAT_map[I.idx] = I;
		FORMAT_reverse_map[I.ID] = I.idx;
		return 0;
	}
	else
	{
		if ( FILTER_reverse_map.find( I.ID ) != FILTER_reverse_map.end() )
		{
			FORMAT_map[ FILTER_reverse_map[ I.ID ] ] = I;
			FORMAT_reverse_map[I.ID] = FILTER_reverse_map[ I.ID ];
			return 0;
		}
		else if ( INFO_reverse_map.find( I.ID ) != INFO_reverse_map.end() )
		{
			FORMAT_map[ INFO_reverse_map[ I.ID ] ] = I;
			FORMAT_reverse_map[I.ID] = INFO_reverse_map[ I.ID ];
			return 0;
		}
		else if ( FORMAT_reverse_map.find( I.ID ) != FORMAT_reverse_map.end() )
			return 0;
		else
		{
			FORMAT_map[ index ] = I;
			FORMAT_reverse_map[I.ID] = index;
			return 1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rsi, %r15
movq %rdi, %r14
movl %edx, 0xc(%rsp)
leaq 0x1c430(%rip), %rsi     # 0x2daf8
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x5450
leaq 0x2a8(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x54c0
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
pushq $0x2c
popq %rsi
movq %rbx, %rdi
callq 0x126cc
leaq 0x58(%rsp), %rdi
callq 0x12f22
leaq 0x1c394(%rip), %rsi     # 0x2daab
leaq 0x58(%rsp), %rdi
callq 0x58b0
movq 0x48(%rsp), %rax
subq 0x40(%rsp), %rax
cmpq $0x7f, %rax
ja 0x1176c
leaq 0x1c56f(%rip), %rsi     # 0x2dca7
leaq 0x248(%rsp), %rdi
movq %r15, %rdx
callq 0x967d
leaq 0x2fd81(%rip), %rdi     # 0x414d0
leaq 0x248(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x248(%rsp), %rdi
callq 0x5908
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
leaq 0x10(%rsp), %r13
andq $0x0, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
xorl %r12d, %r12d
pushq $0x3d
popq %rbp
leaq 0x1c225(%rip), %r15     # 0x2d9ba
leaq 0x1c38d(%rip), %rbx     # 0x2db29
movl %r12d, %r12d
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x11adf
movq %r12, %r14
shlq $0x5, %r14
addq %r14, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x126cc
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x96f3
movq 0x10(%rsp), %rsi
testb %al, %al
je 0x117ea
leaq 0x78(%rsp), %rdi
jmp 0x1185e
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x96f3
movq 0x10(%rsp), %rdi
testb %al, %al
je 0x1186f
addq $0x20, %rdi
leaq 0x1c327(%rip), %rsi     # 0x2db30
callq 0x96f3
movl %eax, %ecx
pushq $-0x1
popq %r14
movl %r14d, %eax
testb %cl, %cl
jne 0x1184a
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c307(%rip), %rsi     # 0x2db32
callq 0x96f3
movl %eax, %ecx
movl %r14d, %eax
testb %cl, %cl
jne 0x1184a
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
movl %r14d, %esi
callq 0x12782
movl %eax, 0x9c(%rsp)
movq 0x10(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
addq $0x20, %rsi
callq 0x5210
incl %r12d
jmp 0x1179c
leaq 0x1c2be(%rip), %rsi     # 0x2db34
callq 0x96f3
movq 0x10(%rsp), %rdi
testb %al, %al
je 0x118b5
addq $0x20, %rdi
leaq 0x1c2aa(%rip), %r14     # 0x2db39
movq %r14, %rsi
callq 0x96f3
testb %al, %al
je 0x118d4
leaq 0xc0(%rsp), %rdi
movq %r14, %rsi
callq 0x58b0
andl $0x0, 0xe0(%rsp)
jmp 0x11867
leaq 0x1c2f1(%rip), %rsi     # 0x2dbad
callq 0x96f3
movq 0x10(%rsp), %rsi
testb %al, %al
je 0x1192e
leaq 0xe8(%rsp), %rdi
jmp 0x1185e
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c25d(%rip), %rsi     # 0x2db41
callq 0x96f3
testb %al, %al
jne 0x1190a
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c24a(%rip), %rsi     # 0x2db47
callq 0x96f3
testb %al, %al
je 0x119ad
leaq 0xc0(%rsp), %rdi
leaq 0x1c228(%rip), %rsi     # 0x2db41
callq 0x58b0
movl $0x1, 0xe0(%rsp)
jmp 0x11867
movq %rsi, %rdi
leaq 0x1c290(%rip), %rsi     # 0x2dbc8
callq 0x96f3
testb %al, %al
je 0x11967
movq 0x38(%rsp), %rax
movb $0x1, 0x8(%rax)
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
pushq $-0x1
popq %rsi
callq 0x12782
movl %eax, 0x98(%rsp)
jmp 0x11867
leaq 0x188(%rsp), %rdi
leaq 0x1d4c1(%rip), %rsi     # 0x2ee37
callq 0x12f17
testb %al, %al
je 0x11993
leaq 0x188(%rsp), %rdi
leaq 0x1c23e(%rip), %rsi     # 0x2dbcc
callq 0x58a0
addq 0x40(%rsp), %r14
leaq 0x188(%rsp), %rdi
movq %r14, %rsi
callq 0x58d0
jmp 0x11867
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c192(%rip), %r14     # 0x2db4f
movq %r14, %rsi
callq 0x96f3
testb %al, %al
je 0x119e9
leaq 0xc0(%rsp), %rdi
movq %r14, %rsi
callq 0x58b0
movl $0x2, 0xe0(%rsp)
jmp 0x11867
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c160(%rip), %r14     # 0x2db59
movq %r14, %rsi
callq 0x96f3
testb %al, %al
je 0x11a25
leaq 0xc0(%rsp), %rdi
movq %r14, %rsi
callq 0x58b0
movl $0x3, 0xe0(%rsp)
jmp 0x11867
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
leaq 0x1c12b(%rip), %r14     # 0x2db60
movq %r14, %rsi
callq 0x96f3
testb %al, %al
je 0x11a9f
movl $0x4, 0xe0(%rsp)
leaq 0xc0(%rsp), %rdi
movq %r14, %rsi
callq 0x58b0
cmpl $0x0, 0x9c(%rsp)
je 0x11867
leaq 0x288(%rsp), %rdi
leaq 0x1c0ec(%rip), %rsi     # 0x2db65
movq 0x30(%rsp), %rdx
callq 0x967d
leaq 0x2fa46(%rip), %rdi     # 0x414d0
leaq 0x288(%rsp), %r14
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
jmp 0x11ad2
leaq 0x268(%rsp), %rdi
leaq 0x1c22a(%rip), %rsi     # 0x2dcd8
movq 0x30(%rsp), %rdx
callq 0x967d
leaq 0x2fa11(%rip), %rdi     # 0x414d0
leaq 0x268(%rsp), %r14
movq %r14, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %r14, %rdi
callq 0x5908
jmp 0x11867
leaq 0x1d351(%rip), %rsi     # 0x2ee37
leaq 0x78(%rsp), %rdi
callq 0x96f3
testb %al, %al
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %rbx
je 0x11b39
leaq 0x1c1fd(%rip), %rsi     # 0x2dd02
leaq 0x228(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x2f9b4(%rip), %rdi     # 0x414d0
leaq 0x228(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x228(%rsp), %rdi
callq 0x5908
leaq 0x1d2f7(%rip), %rsi     # 0x2ee37
leaq 0xa0(%rsp), %rdi
callq 0x96f3
testb %al, %al
je 0x11b8c
leaq 0x1c1d4(%rip), %rsi     # 0x2dd2c
leaq 0x208(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x2f961(%rip), %rdi     # 0x414d0
leaq 0x208(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x208(%rsp), %rdi
callq 0x5908
leaq 0x1d2a4(%rip), %rsi     # 0x2ee37
leaq 0xc0(%rsp), %rdi
callq 0x96f3
testb %al, %al
je 0x11bdf
leaq 0x1c1af(%rip), %rsi     # 0x2dd5a
leaq 0x1e8(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x2f90e(%rip), %rdi     # 0x414d0
leaq 0x1e8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x1e8(%rsp), %rdi
callq 0x5908
leaq 0x1d251(%rip), %rsi     # 0x2ee37
leaq 0xe8(%rsp), %rdi
callq 0x96f3
testb %al, %al
je 0x11c32
leaq 0x1c188(%rip), %rsi     # 0x2dd86
leaq 0x1c8(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x2f8bb(%rip), %rdi     # 0x414d0
leaq 0x1c8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x1c8(%rsp), %rdi
callq 0x5908
cmpl $-0x1, 0x98(%rsp)
jne 0x11c7e
cmpb $0x1, 0x8(%r14)
jne 0x11c7e
leaq 0x1c16f(%rip), %rsi     # 0x2ddb9
leaq 0x1a8(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x2f86f(%rip), %rdi     # 0x414d0
leaq 0x1a8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x1a8(%rsp), %rdi
callq 0x5908
leaq 0x40(%r14), %rdi
leaq 0x58(%rsp), %rsi
callq 0x130ee
cmpl $-0x1, 0x98(%rsp)
je 0x11cd7
leaq 0xc0(%r14), %rdi
leaq 0x98(%rsp), %rsi
callq 0x1311e
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movl 0x98(%rsp), %ebx
addq $0x1b0, %r14            # imm = 0x1B0
movq %r14, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
jmp 0x11db5
leaq 0x150(%r14), %rbx
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x13a1a
leaq 0x158(%r14), %rcx
cmpq %rcx, %rax
je 0x11d45
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
leaq 0xc0(%r14), %rdi
movq %rax, %rsi
callq 0x1311e
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
movl (%rax), %ebx
addq $0x1b0, %r14            # imm = 0x1B0
movq %r14, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
jmp 0x11db5
leaq 0x180(%r14), %rbx
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x13a1a
leaq 0x188(%r14), %rcx
cmpq %rcx, %rax
je 0x11df8
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
leaq 0xc0(%r14), %rdi
movq %rax, %rsi
callq 0x1311e
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
movl (%rax), %ebx
addq $0x1b0, %r14            # imm = 0x1B0
movq %r14, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
movl %ebx, (%rax)
xorl %ebp, %ebp
leaq 0x10(%rsp), %rdi
callq 0x9f1c
leaq 0x58(%rsp), %rdi
callq 0xd306
leaq 0x40(%rsp), %rdi
callq 0x9f1c
leaq 0x2a8(%rsp), %rdi
callq 0x5908
movl %ebp, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b0(%r14), %rbx
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x13a1a
leaq 0x1b8(%r14), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
jne 0x11db9
addq $0xc0, %r14
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x1311e
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movl 0xc(%rsp), %ebp
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x1316c
movl %ebp, (%rax)
pushq $0x1
popq %rbp
jmp 0x11db9
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
jmp 0x11eb5
jmp 0x11edc
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
jmp 0x11eb5
jmp 0x11edc
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x11eb5
jmp 0x11edc
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
jmp 0x11eb5
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
jmp 0x11eb5
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x11eb5
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x5908
jmp 0x11edf
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
callq 0x5908
jmp 0x11ee9
jmp 0x11ed0
movq %rax, %rbx
jmp 0x11ef3
movq %rax, %rbx
jmp 0x11ee9
jmp 0x11edc
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9f1c
leaq 0x58(%rsp), %rdi
callq 0xd306
leaq 0x40(%rsp), %rdi
callq 0x9f1c
leaq 0x2a8(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800