// File: xelia-it[P]mustache/src/mustache-light.cpp
// Function: mustache::Mustache::getTemplateNameFromContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string Mustache::getTemplateNameFromContext(const string& key)
{
    json variable;
    try {
        variable = searchVariableInContext(key);
    } catch(const std::out_of_range& ex) {
        variable = nullptr;
    } catch(const std::invalid_argument& ex) {
        variable = nullptr;
    }

    if (variable.is_null()) {
        error("Missing template variable: " + key);
    } else if (!variable.is_string()) {
        error("Wrong template variable type: " + key + " must be a string");
    }

    return variable.get<string>();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0xf0(%rbp)
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x6b8d0
movq -0xe0(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x6adb0
jmp 0x755b6
leaq -0x28(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x68bc0
leaq -0x38(%rbp), %rdi
callq 0x6b680
jmp 0x75636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xf4(%rbp)
movl $0x2, %ecx
cmpl %ecx, %eax
jne 0x75676
movq -0x40(%rbp), %rdi
callq 0x683e0
movq %rax, -0x68(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x6b8d0
movq -0x100(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x68bc0
movq -0x100(%rbp), %rdi
callq 0x6b680
callq 0x6ced0
jmp 0x75634
jmp 0x75636
leaq -0x28(%rbp), %rdi
callq 0x6b930
testb $0x1, %al
jne 0x75648
jmp 0x75700
movq -0x18(%rbp), %rdx
leaq 0x341c3(%rip), %rsi     # 0xa9816
leaq -0x98(%rbp), %rdi
callq 0x6a3b0
jmp 0x75661
movq -0xe0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x6ba10
jmp 0x75676
movl -0xf4(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x757b8
movq -0x40(%rbp), %rdi
callq 0x683e0
movq %rax, -0x50(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x6b8d0
movq -0x108(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x68bc0
movq -0x108(%rbp), %rdi
callq 0x6b680
callq 0x6ced0
jmp 0x756cd
jmp 0x75636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x757b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x6e458
jmp 0x757b8
leaq -0x28(%rbp), %rdi
callq 0x6e0b0
testb $0x1, %al
jne 0x7578b
movq -0x18(%rbp), %rdx
leaq 0x3411a(%rip), %rsi     # 0xa9832
leaq -0xd8(%rbp), %rdi
callq 0x6a3b0
jmp 0x75726
leaq 0x34124(%rip), %rdx     # 0xa9851
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x678d0
jmp 0x75742
movq -0xe0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x6ba10
jmp 0x75757
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x7577d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x6e458
leaq -0xd8(%rbp), %rdi
callq 0x6e458
jmp 0x757b8
jmp 0x7578d
movq -0xf0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x6cfa0
jmp 0x7579f
leaq -0x28(%rbp), %rdi
callq 0x6b680
movq -0xe8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x6b680
movq -0x40(%rbp), %rdi
callq 0x6d7b0
nopw (%rax,%rax)