// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./src/helper.cpp
// Function: cc_htmlify(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool)
string cc_htmlify(string& s, bool strict) {
    s.append("\n");
    string ret;

    int last_pos = 0;
    int i = 0, j;
    while (i < s.size()) {
        if (s[i] == '>' && s[i + 1] == '>' && s[i + 2] == 'N' && s[i + 3] == 'o' && s[i + 4] == '.') {
            ret.append(s.substr(last_pos, i - last_pos));
            for (j = i + 5; j < s.size(); ++j) if (s[j] == '\n') break;
            string label = s.substr(i, j - i);
            string thread_no = label.substr(5);
            ret.append("<div class=div-thread-");
            ret.append(thread_no);
            ret.append("><a href='javascript:ajst(");
            ret.append(thread_no);
            ret.append(")'>");
            ret.append(label);
            ret.append("</a></div>");
            last_pos = j + 1;
            i = j + 1;
        }
        else if (s[i] == 'h' && s[i + 1] == 't' && s[i + 2] == 't' && s[i + 3] == 'p' && !strict) {
            ret.append(s.substr(last_pos, i - last_pos));
            for (j = i + 4; j < s.size(); ++j) {
                if (isalnum(s[j]) || string("/:.?#=~-_!@$%^&*()+[]{}';|\\").find(s[j]) != string::npos) {}
                else
                    break;
            }
            string tmp = s.substr(i, j - i);
            ret.append("<a href='" + tmp + "' target=_blank>" + tmp + "</a>");
            last_pos = j;
            i = j;
        }
        else if (s[i] == '>' && s[i + 1] != '>' && (i == 0 || s[i - 1] == '\n')) {
            for (j = i + 1; j < s.size(); ++j) if (s[j] == '\n') break;
            ret.append("<ttt>" + s.substr(i, j - i) + "</ttt>");
            last_pos = j;
            i = j;
        }
        else if (s[i] == '#' && (i == 0 || s[i - 1] == '\n') && !strict) {
            int h_ = 1;
            if(s[i + 1] == '#') h_ = 2;
            if(s[i + 2] == '#') h_ = 3;

            for (j = i + h_; j < s.size(); ++j) if (s[j] == '\n') break;
            ret.append("<h" + to_string(h_ + 1) + ">" + s.substr(i + h_, j - i - h_ + 1) + "</h" + to_string(h_ + 1) + ">");
            last_pos = j + 1;
            i = j + 1;
        }
        else if (s[i] == '(' && s[i + 1] == '#' && s[i + 8] == ' ' && !strict) {
            string clr = s.substr(i + 2, 6);
            for (j = i + 8; j < s.size(); ++j) if (s[j] == ')') break;
            ret.append("<span style='color:#" + clr + "'>");
            ret.append(s.substr(i + 9, j - i - 9));
            ret.append("</span>");
            last_pos = j + 1;
            i = j + 1;
        }
        else if (s[i] == '\n' || s[i] == '<' || s[i] == '>') {
            string dem = s[i] == '\n' ? "<br>" : (s[i] == '<' ? "&lt;" : "&gt;");
            ret.append(s.substr(last_pos, i - last_pos) + dem);
            last_pos = i + 1;
            i++;
        }
        else
            i++;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %edx, 0x14(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x594ae(%rip), %rsi     # 0x682c1
movq %r15, %rdi
callq 0xc7d0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movq %rbx, 0x8(%rsp)
movb $0x0, 0x10(%rbx)
xorl %ebx, %ebx
movq %r15, (%rsp)
movq (%r15), %rax
movq 0x8(%r15), %rcx
movl %ebx, %esi
negl %esi
movl %ebx, %r14d
movslq %ebx, %r13
leaq (%rax,%r13), %rdx
leal 0x5(%r13), %ebp
xorl %r15d, %r15d
leaq (%r15,%r13), %r12
cmpq %r12, %rcx
jbe 0xf5d2
movzbl (%rdx,%r15), %edi
cmpl $0x23, %edi
je 0xeeb2
cmpl $0x28, %edi
je 0xeec3
cmpl $0x68, %edi
je 0xee8c
cmpl $0xa, %edi
je 0xf04f
cmpl $0x3c, %edi
je 0xf04f
cmpl $0x3e, %edi
jne 0xeeff
jmp 0xef09
cmpb $0x74, 0x1(%rdx,%r15)
jne 0xeeff
cmpb $0x74, 0x2(%rdx,%r15)
jne 0xeeff
cmpb $0x70, 0x3(%rdx,%r15)
setne %dil
orb 0x14(%rsp), %dil
jne 0xeeff
jmp 0xf29f
cmpl %r15d, %esi
jne 0xeeea
cmpb $0x0, 0x14(%rsp)
jne 0xeeff
jmp 0xefb7
cmpb $0x23, 0x1(%rdx,%r15)
jne 0xeeff
leal (%r14,%r15), %edi
addl $0x8, %edi
movslq %edi, %r12
cmpb $0x20, (%rax,%r12)
setne %dil
orb 0x14(%rsp), %dil
jne 0xeeff
jmp 0xf0ea
cmpb $0xa, -0x1(%rdx,%r15)
setne %dil
orb 0x14(%rsp), %dil
je 0xefb7
incq %r15
incl %ebp
jmp 0xee52
movslq %r14d, %r8
addq %rax, %r8
cmpb $0x3e, 0x1(%r15,%r8)
jne 0xf00c
cmpb $0x4e, 0x2(%r15,%rdx)
jne 0xf04f
movslq %r14d, %rcx
addq %rcx, %rax
cmpb $0x6f, 0x3(%r15,%rax)
jne 0xf04f
cmpb $0x2e, 0x4(%r15,%rdx)
jne 0xf04f
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq (%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xcb30
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xc9c0
movq %rbx, %rdi
callq 0xcd88
leal (%r14,%r15), %ecx
addl $0x5, %ecx
movq (%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rsi
movslq %ecx, %rcx
cmpq %rcx, %rsi
movq %rcx, %rbx
cmovaq %rsi, %rbx
movslq %ebp, %rdx
cmpq %rdx, %rsi
cmovaq %rsi, %rdx
movq 0x8(%rsp), %r14
cmpq %rcx, %rdx
je 0xf521
cmpb $0xa, (%rax,%rcx)
je 0xf51e
incq %rcx
jmp 0xef9f
xorl %ebp, %ebp
cmpb $0x23, 0x1(%r15,%rdx)
sete %bpl
incl %ebp
movslq %r14d, %rdx
addq %rax, %rdx
cmpb $0x23, 0x2(%r15,%rdx)
pushq $0x3
popq %rdx
cmovel %edx, %ebp
addl %r15d, %ebx
addl %ebp, %ebx
movslq %ebx, %rsi
cmpq %rsi, %rcx
movq %rsi, %rbx
cmovaq %rcx, %rbx
movq %rsi, %rdx
movq %rsi, 0x80(%rsp)
cmpq %rdx, %rcx
jbe 0xf136
cmpb $0xa, (%rax,%rdx)
je 0xf133
incq %rdx
jmp 0xeff4
cmpl %r15d, %esi
je 0xf01f
movslq %r14d, %rdx
addq %rax, %rdx
cmpb $0xa, -0x1(%r15,%rdx)
jne 0xf04f
leal (%rbx,%r15), %edx
incl %edx
movslq %edx, %rdx
cmpq %rdx, %rcx
movq %rdx, %rbx
cmovaq %rcx, %rbx
movq 0x8(%rsp), %r13
cmpq %rdx, %rcx
jbe 0xf4a1
cmpb $0xa, (%rax,%rdx)
je 0xf49e
incq %rdx
jmp 0xf037
cmpb $0x3c, %dil
leaq 0x523f8(%rip), %rsi     # 0x61452
leaq 0x523ec(%rip), %rax     # 0x6144d
cmoveq %rax, %rsi
cmpb $0xa, %dil
leaq 0x523d8(%rip), %rax     # 0x61448
cmoveq %rax, %rsi
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0xcb10
movslq %r14d, %rdx
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq (%rsp), %rsi
movq %r15, %rcx
movq 0x8(%rsp), %rbx
callq 0xcb30
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
leaq 0x18(%rsp), %rdx
callq 0x10177
movq %rbx, %rdi
movq %r13, %rsi
callq 0xc9c0
movq %r13, %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
callq 0xcd88
leal (%r14,%r15), %ebx
incl %ebx
leaq 0x18(%rsp), %rdi
callq 0xcd88
movq (%rsp), %r15
jmp 0xee36
leal (%r14,%r15), %eax
addl $0x2, %eax
movslq %eax, %rdx
leaq 0x18(%rsp), %rdi
movq (%rsp), %r13
movq %r13, %rsi
pushq $0x6
popq %rcx
callq 0xcb30
movq (%r13), %rax
movq 0x8(%r13), %rcx
cmpq %r12, %rcx
movq %r12, %r13
cmovaq %rcx, %r13
cmpq %r12, %rcx
jbe 0xf3e8
cmpb $0x29, (%rax,%r12)
je 0xf3e5
incq %r12
jmp 0xf11a
movq %rdx, %rbx
leal 0x1(%rbp), %esi
leaq 0x108(%rsp), %r12
movq %r12, %rdi
movl %esi, 0x7c(%rsp)
callq 0x10273
leaq 0x128(%rsp), %r13
movq %r13, %rdi
leaq 0x522c5(%rip), %rsi     # 0x61424
movq %r12, %rdx
callq 0x10111
leaq 0x88(%rsp), %rdi
movq %r13, %rsi
leaq 0x52255(%rip), %rdx     # 0x613ce
callq 0x100f2
movl %ebx, %eax
subl %ebp, %eax
subl %r14d, %eax
subl %r15d, %eax
incl %eax
movslq %eax, %rcx
leaq 0xe8(%rsp), %r12
movq %r12, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq 0x80(%rsp), %rdx
callq 0xcb30
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
leaq 0x88(%rsp), %rsi
movq %r12, %rdx
movq 0x8(%rsp), %rbp
callq 0x1020c
leaq 0x128(%rsp), %r12
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
leaq 0x52244(%rip), %rdx     # 0x61427
callq 0x100f2
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
movl 0x7c(%rsp), %esi
callq 0x10273
leaq 0x38(%rsp), %r13
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
movq %r14, %rdx
callq 0x1020c
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
leaq 0x521ab(%rip), %rdx     # 0x613ce
callq 0x100f2
movq %rbp, %rdi
movq %r14, %rsi
callq 0xc9c0
movq %r14, %rdi
callq 0xcd88
leaq 0x38(%rsp), %rdi
callq 0xcd88
leaq 0xc8(%rsp), %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
callq 0xcd88
leaq 0xa8(%rsp), %rdi
callq 0xcd88
leaq 0xe8(%rsp), %rdi
callq 0xcd88
leaq 0x88(%rsp), %rdi
callq 0xcd88
movq %r12, %rdi
callq 0xcd88
leaq 0x108(%rsp), %rdi
callq 0xcd88
incl %ebx
jmp 0xee36
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq (%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xcb30
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xc9c0
movq %r14, %rdi
callq 0xcd88
leal (%rbx,%r15), %eax
addl $0x4, %eax
movslq %eax, %rbx
pushq $0x4
popq %rbp
movq (%rsp), %r15
cmpq %rbx, 0x8(%r15)
jbe 0xf338
movq (%r15), %rax
movsbl (%rax,%rbx), %edi
callq 0xc500
testl %eax, %eax
jne 0xf331
leaq 0x18(%rsp), %r14
movq %r14, %rdi
leaq 0x520da(%rip), %rsi     # 0x613db
leaq 0x38(%rsp), %rdx
callq 0xcb10
movq (%r15), %rax
movsbl (%rax,%rbx), %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0xcc20
movq %rax, %r15
movq %r14, %rdi
callq 0xcd88
cmpq $-0x1, %r15
movq (%rsp), %r15
je 0xf338
incq %rbx
incl %ebp
jmp 0xf2dc
movslq %ebp, %rcx
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xcb30
leaq 0x88(%rsp), %r12
movq %r12, %rdi
leaq 0x52097(%rip), %rsi     # 0x613f7
movq %r14, %rdx
movq 0x8(%rsp), %r14
callq 0x10196
leaq 0xa8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
leaq 0x5207f(%rip), %rdx     # 0x61401
callq 0x100f2
leaq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %rdx
callq 0x10177
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
leaq 0x52064(%rip), %rdx     # 0x61412
callq 0x100f2
movq %r14, %rdi
movq %r12, %rsi
callq 0xc9c0
movq %r12, %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
callq 0xcd88
movq %r13, %rdi
callq 0xcd88
leaq 0x88(%rsp), %rdi
jmp 0xf5be
movq %r12, %r13
leaq 0x58(%rsp), %r12
movq %r12, %rdi
leaq 0x52034(%rip), %rsi     # 0x6142b
leaq 0x18(%rsp), %rdx
callq 0x10196
leaq 0x38(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x51fba(%rip), %rdx     # 0x613cd
callq 0x100f2
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0xc9c0
movq %rbp, %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
callq 0xcd88
leal (%rbx,%r15), %eax
addl $0x9, %eax
movslq %eax, %rdx
movl %r13d, %eax
subl %r14d, %eax
subl %r15d, %eax
addl $-0x9, %eax
movslq %eax, %rcx
movq %rbp, %rdi
movq (%rsp), %r15
movq %r15, %rsi
callq 0xcb30
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
callq 0xc9c0
leaq 0x18(%rsp), %rbx
movq %rbp, %rdi
callq 0xcd88
movq %r14, %rdi
leaq 0x51fba(%rip), %rsi     # 0x61440
callq 0xc7d0
incl %r13d
movq %rbx, %rdi
callq 0xcd88
movl %r13d, %ebx
jmp 0xee36
movq %rdx, %rbx
movslq %ebx, %rcx
movslq %r14d, %rax
subq %rax, %rcx
subq %r15, %rcx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq %r12, %rdx
callq 0xcb30
leaq 0x38(%rsp), %r12
movq %r12, %rdi
leaq 0x51f44(%rip), %rsi     # 0x61417
movq %r14, %rdx
callq 0x10111
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
leaq 0x51f30(%rip), %rdx     # 0x6141d
callq 0x100f2
movq %r13, %rdi
movq %r14, %rsi
callq 0xc9c0
movq %r14, %rdi
callq 0xcd88
leaq 0x38(%rsp), %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
callq 0xcd88
jmp 0xee36
movq %rcx, %rbx
movslq %ebx, %rcx
subq %r13, %rcx
subq %r15, %rcx
leaq 0x18(%rsp), %r13
movq %r13, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq %r12, %rdx
callq 0xcb30
leaq 0x38(%rsp), %rdi
movq %r13, %rsi
pushq $0x5
popq %rdx
pushq $-0x1
popq %rcx
callq 0xcb30
movq %r14, %rdi
leaq 0x51e3c(%rip), %rsi     # 0x6139a
callq 0xc7d0
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
callq 0xc9c0
movq %r14, %rdi
leaq 0x51e37(%rip), %rsi     # 0x613b1
callq 0xc7d0
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
callq 0xc9c0
movq %r14, %rdi
leaq 0x51e36(%rip), %rsi     # 0x613cc
callq 0xc7d0
movq %r14, %rdi
leaq 0x18(%rsp), %rsi
callq 0xc9c0
movq %r14, %rdi
leaq 0x51e1e(%rip), %rsi     # 0x613d0
callq 0xc7d0
incl %ebx
leaq 0x38(%rsp), %rdi
callq 0xcd88
leaq 0x18(%rsp), %rdi
callq 0xcd88
jmp 0xee36
movq 0x8(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf746
jmp 0xf74b
jmp 0xf746
jmp 0xf74b
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xcd88
jmp 0xf60f
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0xcd88
jmp 0xf61e
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0xcd88
jmp 0xf630
movq %rax, %r14
leaq 0x88(%rsp), %rdi
jmp 0xf767
jmp 0xf746
jmp 0xf74b
jmp 0xf746
jmp 0xf74b
movq %rax, %r14
jmp 0xf66d
movq %rax, %r14
jmp 0xf677
jmp 0xf74b
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0xcd88
leaq 0x38(%rsp), %rdi
callq 0xcd88
leaq 0x58(%rsp), %rdi
jmp 0xf771
jmp 0xf692
jmp 0xf746
jmp 0xf746
jmp 0xf74b
movq %rax, %r14
leaq 0x38(%rsp), %rdi
jmp 0xf767
jmp 0xf750
jmp 0xf75f
jmp 0xf746
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0xcd88
jmp 0xf6c0
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xcd88
jmp 0xf6cf
movq %rax, %r14
leaq 0xc8(%rsp), %rdi
callq 0xcd88
jmp 0xf6e1
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0xcd88
jmp 0xf6f0
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0xcd88
leaq 0xe8(%rsp), %rdi
callq 0xcd88
leaq 0x88(%rsp), %rdi
callq 0xcd88
leaq 0x128(%rsp), %rdi
callq 0xcd88
leaq 0x108(%rsp), %rdi
jmp 0xf771
movq %rax, %r14
jmp 0xf6fd
movq %rax, %r14
jmp 0xf70a
movq %rax, %r14
jmp 0xf717
movq %rax, %r14
jmp 0xf724
jmp 0xf74b
jmp 0xf74b
movq %rax, %r14
jmp 0xf76c
movq %rax, %r14
jmp 0xf776
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xcd88
jmp 0xf762
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0xcd88
leaq 0x18(%rsp), %rdi
callq 0xcd88
movq 0x8(%rsp), %rdi
callq 0xcd88
movq %r14, %rdi
callq 0xc790