// File: SpiritLooper[P]RDV_OBJRender/obj_render.cpp
// Function: main
int main(int argc, char const ** argv)
{
    std::string file_obj = "./model/head.obj";
    
    bool _3Dmode = true;

    if(argc >= 2) {
        for (int i = 1; i <= 2 && i < argc; i++)
        {
            if ( std::string(argv[i]) == "--no-3d" ){
                _3Dmode = false;
                std::cout << "*** Disabled 3D ***"  << std::endl;

            } else {
                file_obj = std::string(argv[i]) ;
            }
        }
    }
    
    std::cout << "Loading model " << file_obj << std::endl;
    Model* model = new Model(file_obj.c_str());
    
    render(model, _3Dmode);
    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x2390
movq -0xb0(%rbp), %rdx
leaq 0xd15(%rip), %rsi       # 0xf23c
leaq -0x30(%rbp), %rdi
callq 0xa3d0
jmp 0xe532
leaq -0x31(%rbp), %rdi
callq 0x2240
movb $0x1, -0x45(%rbp)
cmpl $0x2, -0x8(%rbp)
jl 0xe722
movl $0x1, -0x4c(%rbp)
xorl %eax, %eax
cmpl $0x2, -0x4c(%rbp)
movb %al, -0xb1(%rbp)
jg 0xe56d
movl -0x4c(%rbp), %eax
cmpl -0x8(%rbp), %eax
setl %al
movb %al, -0xb1(%rbp)
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0xe57c
jmp 0xe720
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xc8(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x2390
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0xa3d0
jmp 0xe5b8
leaq 0xc8e(%rip), %rsi       # 0xf24d
leaq -0x70(%rbp), %rdi
callq 0xea00
movb %al, -0xc9(%rbp)
jmp 0xe5d0
leaq -0x70(%rbp), %rdi
callq 0x2140
leaq -0x71(%rbp), %rdi
callq 0x2240
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0xe5f1
jmp 0xe687
movb $0x0, -0x45(%rbp)
movq 0x79dc(%rip), %rdi      # 0x15fd8
leaq 0xc52(%rip), %rsi       # 0xf255
callq 0x21f0
movq %rax, -0xd8(%rbp)
jmp 0xe611
movq -0xd8(%rbp), %rdi
movq 0x79a9(%rip), %rsi      # 0x15fc8
callq 0x2220
jmp 0xe626
jmp 0xe710
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x2240
jmp 0xe7fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xe668
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x2140
leaq -0x71(%rbp), %rdi
callq 0x2240
jmp 0xe7f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xe7f5
movq -0x10(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe8(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x2390
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0xa3d0
jmp 0xe6c9
leaq -0x30(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x2290
leaq -0x98(%rbp), %rdi
callq 0x2140
leaq -0x99(%rbp), %rdi
callq 0x2240
jmp 0xe710
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x99(%rbp), %rdi
callq 0x2240
jmp 0xe7f5
jmp 0xe712
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xe550
jmp 0xe722
movq 0x78af(%rip), %rdi      # 0x15fd8
leaq 0xb39(%rip), %rsi       # 0xf269
callq 0x21f0
movq %rax, -0xf0(%rbp)
jmp 0xe73e
movq -0xf0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x21e0
movq %rax, -0xf8(%rbp)
jmp 0xe757
movq -0xf8(%rbp), %rdi
movq 0x7863(%rip), %rsi      # 0x15fc8
callq 0x2220
jmp 0xe76c
movl $0x30, %edi
callq 0x2200
movq %rax, -0x100(%rbp)
jmp 0xe77f
leaq -0x30(%rbp), %rdi
callq 0x20f0
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0x82f0
jmp 0xe799
movq -0x100(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
movzbl -0x45(%rbp), %esi
andl $0x1, %esi
callq 0xdaf0
jmp 0xe7bc
movl $0x0, -0x4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2140
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x30, %esi
callq 0x2210
leaq -0x30(%rbp), %rdi
callq 0x2140
movq -0x40(%rbp), %rdi
callq 0x2380
nopw (%rax,%rax)