// File: /workspace/github_c_makefile_star2_O2/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 $0x88, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x50(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r13
leaq 0x4e898(%rip), %rbx     # 0x67652
leaq 0x58(%rsp), %rdx
movq %rdi, 0x40(%rsp)
movq %rbx, %rsi
callq 0xcb10
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %rbx, %rsi
callq 0xcb10
leaq 0x138(%r13), %rax
movq %rax, 0x80(%rsp)
leaq 0x108(%r13), %rax
movq %rax, 0x78(%rsp)
leaq 0x168(%r13), %rax
movq %rax, 0x38(%rsp)
leaq 0xd8(%r13), %rax
movq %rax, (%rsp)
xorl %r14d, %r14d
pushq $0x28
popq %rbp
leaq 0x488db(%rip), %r12     # 0x616f8
movslq %r14d, %rcx
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rax
subq %rsi, %rax
cqto
idivq %rbp
cmpq %rcx, %rax
jbe 0x190e0
imulq $0x28, %rcx, %rbx
movl (%rsi,%rbx), %eax
cmpq $0x6, %rax
ja 0x190d8
addq %rbx, %rsi
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
addq $0x8, %rsi
jmp 0x18f18
addq $0x8, %rsi
leaq 0x58(%rsp), %rdi
callq 0xcc70
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x1904a
leaq 0x18(%rsp), %r15
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0xcb30
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x1914c
movb (%rax), %bl
movq %r15, %rdi
callq 0xcd88
cmpb $0x1, %bl
jne 0x190d8
movl %r14d, 0x18(%rsp)
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x191b2
jmp 0x190d5
addq $0x8, %rsi
movq 0x10(%rsp), %rdi
callq 0x192be
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x190d8
movl %r14d, 0x18(%rsp)
movq 0x80(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x191b2
movl (%rax), %r14d
decl %r14d
jmp 0x190d8
addq $0x8, %rsi
movq 0x8(%rsp), %rdi
callq 0x14e40
movq %rax, %rsi
movq 0x40(%rsp), %rdi
callq 0xc9c0
jmp 0x190d8
movl %r14d, 0x18(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x19200
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0xcc70
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x19073
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
leaq 0x58(%rsp), %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0xcb30
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1924e
movq %rax, %r15
movl %r14d, 0x4c(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x4c(%rsp), %rsi
callq 0x19200
addq $0x20, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x1000c
movl %eax, %r15d
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xcd88
testb %r15b, %r15b
je 0x190d8
movl %r14d, 0x18(%rsp)
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x191b2
jmp 0x190d5
addq $0x8, %rsi
movq 0x10(%rsp), %rdi
callq 0x192be
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x190c1
movq 0x20(%r13), %rax
leaq (%rax,%rbx), %rsi
addq $0x8, %rsi
movq 0x10(%rsp), %rdi
callq 0x192be
movq 0x10(%rax), %r15
movq 0x20(%r13), %rax
leaq (%rax,%rbx), %rsi
addq $0x8, %rsi
movq 0x8(%rsp), %rdi
callq 0x14e40
movq %rax, %rdi
movq %r15, %rsi
callq 0xcc70
movq 0x20(%r13), %rax
leaq (%rax,%rbx), %rsi
addq $0x8, %rsi
movq 0x10(%rsp), %rdi
callq 0x192be
movq %rax, %rdi
callq 0x19fee
jmp 0x190d8
movq 0x50(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x189cc
cmpb $0x0, (%rax)
jne 0x190d8
movl %r14d, 0x18(%rsp)
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x191b2
jmp 0x190d5
movq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x14e40
movq %rax, %r15
movl %r14d, 0x18(%rsp)
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x19200
addq $0x20, %rax
movq %r15, %rdi
movq %rax, %rsi
callq 0x192b4
testb %al, %al
je 0x190d8
movl %r14d, 0x18(%rsp)
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x191b2
jmp 0x190d5
movl %r14d, 0x18(%rsp)
movq 0x78(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x191b2
movl (%rax), %r14d
incl %r14d
jmp 0x18e1d
leaq 0x58(%rsp), %rdi
callq 0xcd88
movq 0x40(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1913a
jmp 0x1912d
jmp 0x1912d
jmp 0x1912d
jmp 0x1912d
jmp 0x1912d
jmp 0x1912d
jmp 0x19118
jmp 0x19118
jmp 0x1912d
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xcd88
jmp 0x19130
jmp 0x1912d
jmp 0x1912d
jmp 0x1912d
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xcd88
movq 0x40(%rsp), %rdi
callq 0xcd88
movq %rbx, %rdi
callq 0xc790