// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/header.cpp
// Function: header::add_FILTER_descriptor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
int header::add_FILTER_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);
	if (tokens.size() < 2)
		LOG.error("Expected at least 2 parts in FILTER definition: " + in);

	string Description;
	Field_description I;
	I.Field = "FILTER";
	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] == "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 FILTER field description: " + in);
	if (I.Description == "") LOG.error("Description required in FILTER field description: " + in);
	if ((I.idx == -1) && (has_idx)) LOG.error("Missing index in FILTER field description: " + in);
	if (I.ID != "PASS") parsed_lines.push_back(I);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r15
movq %rdi, %r14
movl %edx, 0x4(%rsp)
leaq 0x1c9e0(%rip), %rsi     # 0x2daf8
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x5450
leaq 0x248(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x54c0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
pushq $0x2c
popq %rsi
movq %rbx, %rdi
callq 0x126cc
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
cmpq $0x20, %rax
ja 0x111a1
leaq 0x1ccb5(%rip), %rsi     # 0x2de22
leaq 0xb8(%rsp), %rdi
movq %r15, %rdx
callq 0x967d
leaq 0x3034c(%rip), %rdi     # 0x414d0
leaq 0xb8(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0xb8(%rsp), %rdi
callq 0x5908
leaq 0x238(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xd8(%rsp), %rdi
callq 0x12f22
movq %r15, 0x50(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x1c884(%rip), %rsi     # 0x2da57
leaq 0xd8(%rsp), %rdi
callq 0x58b0
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rbp
movaps %xmm0, (%rbp)
andq $0x0, 0x10(%rbp)
xorl %r12d, %r12d
pushq $0x3d
popq %r15
leaq 0x1c7bb(%rip), %rbx     # 0x2d9ba
leaq 0x1c9a7(%rip), %r14     # 0x2dbad
movl %r12d, %r12d
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x112fb
movq %r12, %r13
shlq $0x5, %r13
addq %r13, %rdi
movl %r15d, %esi
movq %rbp, %rdx
callq 0x126cc
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x96f3
movq 0x30(%rsp), %rsi
testb %al, %al
je 0x11258
leaq 0xf8(%rsp), %rdi
jmp 0x11274
movq %rsi, %rdi
movq %r14, %rsi
callq 0x96f3
movq 0x30(%rsp), %rsi
testb %al, %al
je 0x11282
leaq 0x168(%rsp), %rdi
addq $0x20, %rsi
callq 0x5210
incl %r12d
jmp 0x11206
movq %rsi, %rdi
leaq 0x1c93c(%rip), %rsi     # 0x2dbc8
callq 0x96f3
testb %al, %al
je 0x112b8
movq 0x8(%rsp), %rax
movb $0x1, 0x8(%rax)
movq 0x30(%rsp), %rdi
addq $0x20, %rdi
pushq $-0x1
popq %rsi
callq 0x12782
movl %eax, 0x118(%rsp)
jmp 0x1127d
leaq 0x208(%rsp), %rdi
leaq 0x1db70(%rip), %rsi     # 0x2ee37
callq 0x12f17
testb %al, %al
je 0x112e4
leaq 0x208(%rsp), %rdi
leaq 0x1c8ed(%rip), %rsi     # 0x2dbcc
callq 0x58a0
addq 0x10(%rsp), %r13
leaq 0x208(%rsp), %rdi
movq %r13, %rsi
callq 0x58d0
jmp 0x1127d
leaq 0x1db35(%rip), %rsi     # 0x2ee37
leaq 0xf8(%rsp), %rdi
callq 0x96f3
testb %al, %al
movq 0x8(%rsp), %r14
movq 0x50(%rsp), %rbx
je 0x11358
leaq 0x1cb2f(%rip), %rsi     # 0x2de53
leaq 0x98(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x30195(%rip), %rdi     # 0x414d0
leaq 0x98(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x98(%rsp), %rdi
callq 0x5908
leaq 0x1dad8(%rip), %rsi     # 0x2ee37
leaq 0x168(%rsp), %rdi
callq 0x96f3
testb %al, %al
je 0x113a2
leaq 0x1cb06(%rip), %rsi     # 0x2de7d
leaq 0x78(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x30145(%rip), %rdi     # 0x414d0
leaq 0x78(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x78(%rsp), %rdi
callq 0x5908
cmpl $-0x1, 0x118(%rsp)
jne 0x113e5
cmpb $0x1, 0x8(%r14)
jne 0x113e5
leaq 0x1caf6(%rip), %rsi     # 0x2deb0
leaq 0x58(%rsp), %rdi
movq %rbx, %rdx
callq 0x967d
leaq 0x30102(%rip), %rdi     # 0x414d0
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x58(%rsp), %rdi
callq 0x5908
leaq 0x1c158(%rip), %rsi     # 0x2d544
leaq 0xf8(%rsp), %rdi
callq 0x12f17
testb %al, %al
je 0x1140e
leaq 0x40(%r14), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x130ee
cmpl $-0x1, 0x118(%rsp)
je 0x1145f
leaq 0x90(%r14), %rdi
leaq 0x118(%rsp), %rsi
callq 0x1311e
leaq 0xd8(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movl 0x118(%rsp), %ebx
addq $0x150, %r14            # imm = 0x150
movq %r14, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
jmp 0x1155b
leaq 0x180(%r14), %rbx
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x13a1a
leaq 0x188(%r14), %rcx
cmpq %rcx, %rax
je 0x114dc
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
leaq 0x90(%r14), %rdi
movq %rax, %rsi
callq 0x1311e
leaq 0xd8(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
movl (%rax), %ebx
addq $0x150, %r14            # imm = 0x150
movq %r14, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
jmp 0x1155b
leaq 0x1b0(%r14), %rbx
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x13a1a
leaq 0x1b8(%r14), %rcx
cmpq %rcx, %rax
je 0x115ae
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
leaq 0x90(%r14), %rdi
movq %rax, %rsi
callq 0x1311e
leaq 0xd8(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
movl (%rax), %ebx
addq $0x150, %r14            # imm = 0x150
movq %r14, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
movl %ebx, (%rax)
xorl %ebp, %ebp
leaq 0x30(%rsp), %rdi
callq 0x9f1c
leaq 0xd8(%rsp), %rdi
callq 0xd306
leaq 0x228(%rsp), %rdi
callq 0x5908
leaq 0x10(%rsp), %rdi
callq 0x9f1c
leaq 0x248(%rsp), %rdi
callq 0x5908
movl %ebp, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x150(%r14), %rbx
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x13a1a
leaq 0x158(%r14), %rcx
xorl %ebp, %ebp
cmpq %rcx, %rax
jne 0x1155f
addq $0x90, %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0x1311e
leaq 0xd8(%rsp), %rsi
movq %rax, %rdi
callq 0xd3f2
movl 0x4(%rsp), %ebp
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x1316c
movl %ebp, (%rax)
pushq $0x1
popq %rbp
jmp 0x1155f
jmp 0x1165f
jmp 0x1165f
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x1163a
jmp 0x1165f
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x1163a
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x5908
jmp 0x11662
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x11681
movq %rax, %rbx
jmp 0x1166c
movq %rax, %rbx
jmp 0x11679
movq %rax, %rbx
jmp 0x11686
jmp 0x1165f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x9f1c
leaq 0xd8(%rsp), %rdi
callq 0xd306
leaq 0x228(%rsp), %rdi
callq 0x5908
leaq 0x10(%rsp), %rdi
callq 0x9f1c
leaq 0x248(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800
nop