// File: xelia-it[P]mustache/src/mustache-light.cpp
// Function: mustache::Mustache::printVariable(bool)
void Mustache::printVariable(bool escape_html)
{
    const string& variable_name = tokens_.at(currentToken_);
    ensureValidIdentifier(variable_name);
    LOG(" ");
    LOG(variable_name);
    if (visible_) {
        json variable;
        try {
            variable = searchVariableInContext(variable_name);
        } catch(const std::out_of_range& ex) {
            variable = nullptr;
        } catch(const std::invalid_argument& ex) {
            variable = nullptr;
        }

        if (variable.is_primitive()) {
            if (variable.is_null()) {
                // OK
            } else if (variable.is_boolean()) {
                if (variable.get<bool>()) {
                    rendered_.append("true");
                }
            } else if (variable.is_string()) {
                string to_be_appended = variable.get<string>();
                if (escape_html) {
                    htmlEscape(to_be_appended);
                }
                rendered_.append(to_be_appended);
            } else {
                rendered_.append(variable.dump());
            }
        }
    }
    // else skip render invisible parts
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq %rax, %rdi
addq $0xd0, %rdi
movq 0xe8(%rax), %rsi
callq 0x67da0
movq -0xc0(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq 0x5186a(%rip), %rdx     # 0xc5ea8
callq 0x6cc40
movq -0xc0(%rbp), %rax
testb $0x1, 0x148(%rax)
je 0x748e9
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x6b8d0
movq -0xc0(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x6adb0
jmp 0x7467a
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x68bc0
leaq -0x38(%rbp), %rdi
callq 0x6b680
jmp 0x746f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x7471c
movq -0x40(%rbp), %rdi
callq 0x683e0
movq %rax, -0x68(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x6b8d0
movq -0xd0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x68bc0
movq -0xd0(%rbp), %rdi
callq 0x6b680
callq 0x6ced0
jmp 0x746f4
jmp 0x746f6
leaq -0x28(%rbp), %rdi
callq 0x69140
testb $0x1, %al
jne 0x74708
jmp 0x748d3
leaq -0x28(%rbp), %rdi
callq 0x6b930
testb $0x1, %al
jne 0x74717
jmp 0x74786
jmp 0x748d1
movl -0xc4(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x748de
movq -0x40(%rbp), %rdi
callq 0x683e0
movq %rax, -0x50(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x6b8d0
movq -0xd8(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x68bc0
movq -0xd8(%rbp), %rdi
callq 0x6b680
callq 0x6ced0
jmp 0x74773
jmp 0x746f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x748de
leaq -0x28(%rbp), %rdi
callq 0x6dcf0
testb $0x1, %al
jne 0x74795
jmp 0x747d5
leaq -0x28(%rbp), %rdi
callq 0x6bbc0
movb %al, -0xd9(%rbp)
jmp 0x747a6
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x747b2
jmp 0x747d0
movq -0xc0(%rbp), %rdi
addq $0x90, %rdi
leaq 0x34f18(%rip), %rsi     # 0xa96df
callq 0x6e080
jmp 0x747ce
jmp 0x747d0
jmp 0x748cf
leaq -0x28(%rbp), %rdi
callq 0x6e0b0
testb $0x1, %al
jne 0x747e4
jmp 0x7485a
leaq -0x98(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6cfa0
jmp 0x747f6
testb $0x1, -0x9(%rbp)
je 0x74830
movq -0xc0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x69880
jmp 0x74811
jmp 0x74830
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x6e458
jmp 0x748de
movq -0xc0(%rbp), %rdi
addq $0x90, %rdi
leaq -0x98(%rbp), %rsi
callq 0x6e220
jmp 0x7484c
leaq -0x98(%rbp), %rdi
callq 0x6e458
jmp 0x748cd
movq -0xc0(%rbp), %rax
addq $0x90, %rax
movq %rax, -0xe8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x20, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x6a270
jmp 0x74890
movq -0xe8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x6e220
jmp 0x748a5
leaq -0xb8(%rbp), %rdi
callq 0x6e458
jmp 0x748cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x6e458
jmp 0x748de
jmp 0x748cf
jmp 0x748d1
jmp 0x748d3
leaq -0x28(%rbp), %rdi
callq 0x6b680
jmp 0x748e9
leaq -0x28(%rbp), %rdi
callq 0x6b680
jmp 0x748f2
addq $0xf0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x6d7b0
nopl (%rax,%rax)