// File: /workspace/github_c_makefile_star2_O3/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 0x5ad99(%rip), %r15     # 0x77672
movq %rdi, 0x48(%rsp)
movq %r15, %rsi
movq %r15, %rdx
callq 0xedf0
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0xedf0
movq 0x20(%r13), %rax
cmpq %rax, 0x28(%r13)
je 0x1cc8c
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 0x54dcf(%rip), %rbx     # 0x71728
xorl %r15d, %r15d
leaq (%rcx,%rcx,4), %r14
movl (%rax,%r14,8), %ecx
cmpq $0x6, %rcx
ja 0x1cc6a
leaq (%rax,%r14,8), %rsi
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
jmpq *%rax
leaq 0x8(%rsi), %rax
addq $0x10, %rsi
jmp 0x1ca5b
addq $0x8, %rsi
leaq 0x58(%rsp), %rdi
callq 0xcc40
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x1cb8d
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 0x1cd24
movb (%rax), %bpl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1c9e6
callq 0xc640
testb %bpl, %bpl
je 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
jmp 0x1cc67
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1cee8
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
movl (%rax), %r15d
decl %r15d
jmp 0x1cc6a
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x18044
movq %rax, %rsi
addq $0x8, %rsi
movq (%rax), %rax
movq (%rsi), %rdx
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0xc830
jmp 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1ce06
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0xcc40
movq 0x58(%rsp), %rax
cmpb $0x21, (%rax)
jne 0x1cbbe
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 0x1ce6c
movq %rax, %rbp
movl %r15d, 0x54(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x54(%rsp), %rsi
callq 0x1ce06
movq 0x8(%rbp), %rdx
cmpq 0x28(%rax), %rdx
jne 0x1cc33
testq %rdx, %rdx
je 0x1cc37
movq 0x20(%rax), %rsi
movq (%rbp), %rdi
callq 0xc7c0
testl %eax, %eax
sete %bpl
jmp 0x1cc3a
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1cee8
movq 0x30(%rax), %rcx
cmpq 0x10(%rax), %rcx
je 0x1cc1a
movq 0x20(%r13), %rax
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
movq 0x38(%rsp), %rdi
callq 0x1cee8
movq 0x10(%rax), %rbp
movq 0x20(%r13), %rax
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x18044
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 0x1cee8
movq %rax, %rdi
callq 0x1db60
jmp 0x1cc6a
movq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x1c4c8
cmpb $0x0, (%rax)
jne 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
jmp 0x1cc67
movq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x18044
movq %rax, %rbp
movl %r15d, 0x8(%rsp)
movq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1ce06
movq 0x8(%rbp), %rdx
cmpq 0x28(%rax), %rdx
jne 0x1cc04
testq %rdx, %rdx
je 0x1cc6a
movq 0x20(%rax), %rsi
movq (%rbp), %rdi
callq 0xc7c0
testl %eax, %eax
je 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
jmp 0x1cc67
movl %r15d, 0x8(%rsp)
movq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
jmp 0x1cc67
xorl %ebp, %ebp
jmp 0x1cc3a
movb $0x1, %bpl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1cc4e
callq 0xc640
testb %bpl, %bpl
je 0x1cc6a
movl %r15d, 0x8(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cda0
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 0x1c95c
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1cca0
callq 0xc640
movq 0x48(%rsp), %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1cced
jmp 0x1cced
jmp 0x1cced
jmp 0x1cced
movq %rax, %r14
jmp 0x1cd04
jmp 0x1cced
jmp 0x1cccc
jmp 0x1cced
jmp 0x1cccc
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1ccf0
callq 0xc640
jmp 0x1ccf0
jmp 0x1cced
jmp 0x1cced
jmp 0x1cced
jmp 0x1cced
movq %rax, %r14
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1cd04
callq 0xc640
movq 0x48(%rsp), %rax
movq (%rax), %rdi
cmpq 0x80(%rsp), %rdi
je 0x1cd1b
callq 0xc640
movq %r14, %rdi
callq 0xc760
nop