// File: /workspace/github_cpp_makefile_star2_O2/xelia-it[P]mustache/mustache-interactive.cpp
// Function: main
int main(int argc, char *argv[]) {
    string view = "basic/empty";
    string context = "basic/empty";

    if (argc == 1) {
        // OK
    } else if (argc == 2) {
        view = argv[1];
    } else if (argc == 3) {
        view = argv[1];
        context = argv[2];
    } else {
        std::cerr << "Usage: test-mustache view context" << endl;
    }

    cout << "Open view: " << view << endl;
    cout << "Open context file: " << context << endl;

    Mustache m("./test/fixtures/");
    string rendered;

    std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
    rendered = m.render(m.fileRead(view), m.fileRead(context, "json"));
    std::chrono::steady_clock::time_point end= std::chrono::steady_clock::now();

    cout << "Rendered:" << endl
            << "------------------------------------------------------" << endl
            << rendered << endl
            << "------------------------------------------------------" << endl;
    string error = m.error();
    if (error.size() > 0) {
        cout << "Error:" << endl
                << error << endl
                << "------------------------------------------------------" << endl;
    }
    cout << "Elapsed = " << std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count() << " us" << endl;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, %rbx
movl %edi, %r12d
leaq 0xd57(%rip), %r13       # 0x2004
leaq -0x90(%rbp), %r14
leaq -0x260(%rbp), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x1030
leaq -0xb0(%rbp), %r15
leaq -0x260(%rbp), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x1030
cmpl $0x1, %r12d
je 0x1335
cmpl $0x2, %r12d
je 0x1309
cmpl $0x3, %r12d
jne 0x131a
movq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdi
callq 0x1120
pushq $0x10
popq %rax
movq %r15, %r14
jmp 0x130c
pushq $0x8
popq %rax
movq (%rbx,%rax), %rsi
movq %r14, %rdi
callq 0x1120
jmp 0x1335
movq 0x2ccf(%rip), %rdi      # 0x3ff0
leaq 0xce8(%rip), %rsi       # 0x2010
callq 0x1090
movq %rax, %rdi
callq 0x1050
movq 0x2c94(%rip), %rdi      # 0x3fd0
leaq 0xcef(%rip), %rsi       # 0x2032
callq 0x1090
leaq -0x90(%rbp), %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1050
movq 0x2c6a(%rip), %rdi      # 0x3fd0
leaq 0xcd1(%rip), %rsi       # 0x203e
callq 0x1090
leaq -0xb0(%rbp), %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1050
leaq 0xcc2(%rip), %rsi       # 0x2052
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x1030
leaq -0x260(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1130
leaq -0x50(%rbp), %rdi
callq 0x1040
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
callq 0x10c0
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x10f0
leaq 0xc74(%rip), %rsi       # 0x2063
leaq -0xd0(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x1030
leaq -0xf0(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
callq 0x10a0
leaq -0x70(%rbp), %rdi
leaq -0x260(%rbp), %rsi
leaq -0x110(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0x10d0
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %r14
movq %r14, %rsi
callq 0x10b0
movq %r14, %rdi
callq 0x1040
leaq -0xf0(%rbp), %rdi
callq 0x1040
leaq -0xd0(%rbp), %rdi
callq 0x1040
leaq -0x110(%rbp), %rdi
callq 0x1040
callq 0x10c0
movq %rax, %r14
movq 0x2b47(%rip), %rdi      # 0x3fd0
leaq 0xbd8(%rip), %rsi       # 0x2068
callq 0x1090
movq %rax, %rdi
callq 0x1050
leaq 0xbce(%rip), %rsi       # 0x2072
movq %rax, %rdi
callq 0x1090
movq %rax, %rdi
callq 0x1050
leaq -0x50(%rbp), %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1050
leaq 0xba3(%rip), %rsi       # 0x2072
movq %rax, %rdi
callq 0x1090
movq %rax, %rdi
callq 0x1050
leaq -0x70(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x1100
cmpq $0x0, -0x68(%rbp)
je 0x153c
movq 0x2ad3(%rip), %rdi      # 0x3fd0
leaq 0xba5(%rip), %rsi       # 0x20a9
callq 0x1090
movq %rax, %rdi
callq 0x1050
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x1070
movq %rax, %rdi
callq 0x1050
leaq 0xb46(%rip), %rsi       # 0x2072
movq %rax, %rdi
callq 0x1090
movq %rax, %rdi
callq 0x1050
movq 0x2a8d(%rip), %rdi      # 0x3fd0
leaq 0xb66(%rip), %rsi       # 0x20b0
callq 0x1090
movq %rax, %rdi
subq %rbx, %r14
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r14, %rax
cqto
idivq %rcx
movq %rax, %rsi
callq 0x1080
leaq 0xb4a(%rip), %rsi       # 0x20bb
movq %rax, %rdi
callq 0x1090
movq %rax, %rdi
callq 0x1050
leaq -0x70(%rbp), %rdi
callq 0x1040
leaq -0x50(%rbp), %rdi
callq 0x1040
leaq -0x260(%rbp), %rdi
callq 0x1140
leaq -0xb0(%rbp), %rdi
callq 0x1040
leaq -0x90(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1627
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x1040
jmp 0x15e1
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x1040
jmp 0x15f2
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0x161b
jmp 0x1627
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1040
jmp 0x163f
jmp 0x1622
movq %rax, %rbx
jmp 0x164b
jmp 0x1614
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x1040
jmp 0x162a
movq %rax, %rbx
jmp 0x163f
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1040
leaq -0x260(%rbp), %rdi
callq 0x1140
leaq -0xb0(%rbp), %rdi
callq 0x1040
leaq -0x90(%rbp), %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1110