// File: /workspace/github_cpp_makefile_star2_O2/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), %r14
leaq 0x108(%rsp), %r15
pushq $0x8
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3400
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x128(%rsp,%rax)
je 0x8790
movq 0x2188b(%rip), %rdi     # 0x29ff0
leaq 0x10cf4(%rip), %rsi     # 0x19460
callq 0x32a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3280
movq %rax, %rdi
callq 0x3120
movb $0x0, 0x250(%rbx)
jmp 0x89c7
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10a26(%rip), %rsi     # 0x191ce
leaq 0x28(%rsp), %rdi
leaq 0x310(%rsp), %rdx
callq 0x61f6
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq 0xb8(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
leaq 0x98(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %cl, (%rax)
movb %cl, (%rdx)
movb %cl, (%rsi)
leaq 0x108(%rsp), %r14
leaq 0x68(%rsp), %r15
leaq 0x310(%rsp), %r12
leaq 0x48(%rsp), %rbp
leaq 0xe8(%rsp), %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x897f
cmpq $0x0, 0x70(%rsp)
je 0x8817
movq %r12, %rdi
movq %r15, %rsi
pushq $0x18
popq %rdx
callq 0x33e0
movq %r12, %rdi
leaq 0x28(%rsp), %rsi
callq 0x3320
movq 0x28(%rsp), %rax
movb (%rax), %al
cmpb $0x76, %al
jne 0x88b2
cmpq $0x1, 0x30(%rsp)
jne 0x88b2
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31b0
movq %rax, %rdi
leaq 0x18(%rsp), %rsi
callq 0x31b0
movq %rax, %rdi
leaq 0x10(%rsp), %rsi
callq 0x31b0
movsd 0x20(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %rbx, %rdi
callq 0x8dde
movq 0x28(%rsp), %rax
movb (%rax), %al
cmpb $0x66, %al
jne 0x8928
movq %r12, %rdi
leaq 0xc(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3320
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xa8(%rsp), %rsi
callq 0x3320
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3190
movq %rax, %rdi
leaq 0x88(%rsp), %rsi
callq 0x3320
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movq %rbx, %rdi
callq 0x8eb4
movq 0x28(%rsp), %rax
movb (%rax), %al
cmpb $0x6d, %al
jne 0x8972
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
andq $0x0, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3320
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3360
movq %rbx, %rdi
movq %r13, %rsi
callq 0x11994
movq %r13, %rdi
callq 0x3100
movq %rbp, %rdi
callq 0x3100
movq %r12, %rdi
callq 0x3200
jmp 0x8817
leaq 0x108(%rsp), %rdi
callq 0x3080
leaq 0x88(%rsp), %rdi
callq 0x3100
leaq 0xa8(%rsp), %rdi
callq 0x3100
leaq 0xc8(%rsp), %rdi
callq 0x3100
leaq 0x28(%rsp), %rdi
callq 0x3100
leaq 0x68(%rsp), %rdi
callq 0x3100
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 0x8a15
movq %rax, %rbx
jmp 0x8a5b
movq %rax, %rbx
jmp 0x8a65
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x3100
jmp 0x8a07
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3100
jmp 0x8a1d
jmp 0x8a15
movq %rax, %rbx
jmp 0x8a2a
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0x3200
leaq 0x88(%rsp), %rdi
callq 0x3100
leaq 0xa8(%rsp), %rdi
callq 0x3100
leaq 0xc8(%rsp), %rdi
callq 0x3100
leaq 0x28(%rsp), %rdi
callq 0x3100
leaq 0x68(%rsp), %rdi
callq 0x3100
leaq 0x108(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3490