// File: /workspace/github_cpp_makefile_star2_O1/IsaacLaw12[P]RayTracer/./src/Model.cpp
// Function: Model::load_model()
void Model::load_model(){
    std::ifstream in(original_file);
    if (!in){
        std::cerr << "Could not open model file " << original_file << std::endl;
        load_successful = false;
        return;
    }
    std::string obj_line;
    std::string line_type = "";
    double vx, vy, vz;
    int f1, f2, f3;
    std::string s1, s2, s3;
    while (std::getline(in, obj_line)){
        if(obj_line.empty()){
            continue;
        }
        std::stringstream obj_read(obj_line);
        obj_read >> line_type;
        if (line_type[0] == 'v' && line_type.size() == 1){
            obj_read >> vx >> vy >> vz;
            add_vertex(vx, vy, vz);
        }
        if (line_type[0] == 'f'){
            obj_read >> f1 >> s1;
            obj_read >> f2 >> s2 ;
            obj_read >> f3 >> s3 ;
            add_face(f1, f2, f3);
        }
        // Materials line starts with mtllib
        if (line_type[0] == 'm'){
            std::string file_name;
            obj_read >> file_name;
            load_material(file_name);
        }
    }
    in.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
leaq 0x210(%rdi), %rsi
leaq 0x108(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x3420
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x128(%rsp,%rax)
je 0x8643
movq 0x17a0e(%rip), %rdi     # 0x1fff0
leaq 0xe957(%rip), %rsi      # 0x16f40
movl $0x1a, %edx
callq 0x32f0
movq 0x210(%rbx), %rsi
movq 0x218(%rbx), %rdx
movq 0x179e8(%rip), %rdi     # 0x1fff0
callq 0x32f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movb $0x0, 0x250(%rbx)
jmp 0x896c
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xe60a(%rip), %rdx      # 0x16c74
leaq 0x30(%rsp), %rdi
movq %rdx, %rsi
callq 0x5be2
leaq 0xe0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xc0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x70(%rsp), %r12
leaq 0x310(%rsp), %r13
leaq 0x50(%rsp), %r15
movq 0x178d0(%rip), %rbp     # 0x1ff98
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x34e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x88b2
cmpq $0x0, 0x78(%rsp)
je 0x86c8
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x3400
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x3340
movq 0x30(%rsp), %rax
cmpb $0x76, (%rax)
jne 0x878b
cmpq $0x1, 0x38(%rsp)
jne 0x878b
movq %r13, %rdi
leaq 0x100(%rsp), %rsi
callq 0x31b0
movq %rax, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x31b0
movq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x31b0
movsd 0x100(%rsp), %xmm0
movsd 0xf8(%rsp), %xmm1
movsd 0xf0(%rsp), %xmm2
movq %rbx, %rdi
callq 0x8fcc
movq 0x30(%rsp), %rax
cmpb $0x66, (%rax)
jne 0x8800
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x3340
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x3340
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0x90(%rsp), %rsi
callq 0x3340
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movq %rbx, %rdi
callq 0x9176
movq 0x30(%rsp), %rax
cmpb $0x6d, (%rax)
jne 0x8895
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3340
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x5760
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10914
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x8879
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8895
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3210
leaq 0x390(%rsp), %rdi
callq 0x30e0
jmp 0x86c8
leaq 0x108(%rsp), %rdi
callq 0x3080
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x88e4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x8909
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x892e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x894a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x896c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x108(%rsp), %rdi
callq 0x30a0
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x89e1
movq %rax, %rbx
jmp 0x8a95
movq %rax, %rbx
jmp 0x8ab7
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x89c1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x89c1
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x89e9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x89e9
jmp 0x89e1
movq %rax, %rbx
jmp 0x8a0a
movq %rax, %rbx
movq 0x175a8(%rip), %rsi     # 0x1ff98
leaq 0x310(%rsp), %rdi
callq 0x3210
leaq 0x390(%rsp), %rdi
callq 0x30e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x8a2f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x8a54
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x8a79
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8a95
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8ab7
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x108(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x34b0