// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./src/tags.h
// Function: HTMLTemplate::build(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, bool>>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>>&)
string build(map<string, string> &vars, map<string, bool> &stats, map<string, queue<string>> &loops) {
		int var_pointer = 0;
		string ret = "", tmp = "";

		for (auto i = 0; i < vec.size(); ++i) {
			// std::cout  << vec[i].second << "  =" << vec[i].second.size() << std::endl;

			switch (vec[i].first) {
			case VARIABLE:
				ret.append(vars[vec[i].second]);
				break;
			case PLAIN:
				ret.append(vec[i].second);
				break;
			case IF:
				tmp = vec[i].second;

				if (tmp[0] == '!') {
					if (stats[tmp.substr(1)]) i = fi_pos[i];
				}
				else
					if (!stats[tmp]) i = fi_pos[i];
				break;
			case IFTEST:
				tmp = if_test[i].first;

				if (tmp[0] == '!') {
					if (vars[tmp.substr(1)] == if_test[i].second) i = fi_pos[i];
				}
				else
					if (vars[tmp] != if_test[i].second) i = fi_pos[i];
				break;
			case LOOP:
				if (loops[vec[i].second].empty())
					i = loop_pos[i];
				else {
					vars[vec[i].second] = loops[vec[i].second].front();
					loops[vec[i].second].pop();
				}
				break;
			case ENDLOOP:
				if (!loops[vec[i].second].empty())
					i = loop_pos_rev[i] - 1;
				break;
			case ENDIF:
			default:
				break;
			}
		}
		return ret;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, 0x38(%rsp)
movq %rcx, 0x78(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, %r13
leaq 0x10(%rdi), %rax
movq %rax, 0x80(%rsp)
movq %rax, (%rdi)
leaq 0x5ca2c(%rip), %r15     # 0x79667
movq %rdi, 0x48(%rsp)
movq %r15, %rsi
movq %r15, %rdx
callq 0xedfa
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xedfa
movq 0x20(%r13), %rax
cmpq %rax, 0x28(%r13)
je 0x1cfee
leaq 0x138(%r13), %rcx
movq %rcx, 0x90(%rsp)
leaq 0x108(%r13), %rcx
movq %rcx, 0x88(%rsp)
leaq 0x168(%r13), %rcx
movq %rcx, 0x40(%rsp)
leaq 0xd8(%r13), %rcx
movq %rcx, 0x28(%rsp)
xorl %ecx, %ecx
movabsq $-0x3333333333333333, %r12 # imm = 0xCCCCCCCCCCCCCCCD
leaq 0x56a6d(%rip), %rbx     # 0x73728
xorl %r15d, %r15d
leaq (%rcx,%rcx,4), %r14
movl (%rax,%r14,8), %ecx
cmpq $0x6, %rcx
ja 0x1cfcc
leaq (%rax,%r14,8), %rsi
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
jmpq *%rax
leaq 0x8(%rsi), %rax
addq $0x10, %rsi
jmp 0x1cdbd
addq $0x8, %rsi
leaq 0x58(%rsp), %rdi
callq 0xcc40
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x1ceef
movl $0x1, %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
movq $-0x1, %rcx
callq 0xcb00
movq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x1d086
movb (%rax), %bpl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1cd48
callq 0xc640
testb %bpl, %bpl
je 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
jmp 0x1cfc9
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1d246
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
movl (%rax), %r15d
decl %r15d
jmp 0x1cfcc
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x183b2
movq %rax, %rsi
addq $0x8, %rsi
movq (%rax), %rax
movq (%rsi), %rdx
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0xc830
jmp 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d166
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0xcc40
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x1cf20
movl $0x1, %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
movq $-0x1, %rcx
callq 0xcb00
movq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x1d1ca
movq %rax, %rbp
movl %r15d, 0x54(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x54(%rsp), %rsi
callq 0x1d166
movq 0x8(%rbp), %rdx
cmpq 0x28(%rax), %rdx
jne 0x1cf95
testq %rdx, %rdx
je 0x1cf99
movq 0x20(%rax), %rsi
movq (%rbp), %rdi
callq 0xc7c0
testl %eax, %eax
sete %bpl
jmp 0x1cf9c
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1d246
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x1cf7c
movq 0x20(%r13), %rax
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1d246
movq 0x10(%rax), %rbp
movq 0x20(%r13), %rax
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x183b2
movq %rax, %rdi
movq %rbp, %rsi
callq 0xcc40
movq 0x20(%r13), %rax
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1d246
movq %rax, %rdi
callq 0x1dec2
jmp 0x1cfcc
movq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1c82a
cmpb $0x0, (%rax)
jne 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
jmp 0x1cfc9
movq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x183b2
movq %rax, %rbp
movl %r15d, 0x8(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d166
movq 0x8(%rbp), %rdx
cmpq 0x28(%rax), %rdx
jne 0x1cf66
testq %rdx, %rdx
je 0x1cfcc
movq 0x20(%rax), %rsi
movq (%rbp), %rdi
callq 0xc7c0
testl %eax, %eax
je 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
jmp 0x1cfc9
movl %r15d, 0x8(%rsp)
movq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
jmp 0x1cfc9
xorl %ebp, %ebp
jmp 0x1cf9c
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1cfb0
callq 0xc640
testb %bpl, %bpl
je 0x1cfcc
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1d102
movl (%rax), %r15d
incl %r15d
movslq %r15d, %rcx
movq 0x20(%r13), %rax
movq 0x28(%r13), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %r12, %rdx
cmpq %rcx, %rdx
ja 0x1ccbe
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1d002
callq 0xc640
movq 0x48(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1d04f
jmp 0x1d04f
jmp 0x1d04f
jmp 0x1d04f
movq %rax, %r14
jmp 0x1d066
jmp 0x1d04f
jmp 0x1d02e
jmp 0x1d04f
jmp 0x1d02e
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1d052
callq 0xc640
jmp 0x1d052
jmp 0x1d04f
jmp 0x1d04f
jmp 0x1d04f
jmp 0x1d04f
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1d066
callq 0xc640
movq 0x48(%rsp), %rax
movq (%rax), %rdi
cmpq 0x80(%rsp), %rdi
je 0x1d07d
callq 0xc640
movq %r14, %rdi
callq 0xc760
nop