// File: /workspace/github_cpp_makefile_star2_O3/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), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x3420
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x128(%rsp,%rax)
je 0x85e1
movq 0x17a70(%rip), %rdi     # 0x1fff0
leaq 0xe9b9(%rip), %rsi      # 0x16f40
movl $0x1a, %edx
callq 0x32f0
movq 0x210(%rbx), %rsi
movq 0x218(%rbx), %rdx
movq 0x17a4a(%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 0x890d
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xe66c(%rip), %rdx      # 0x16c74
leaq 0x30(%rsp), %rdi
movq %rdx, %rsi
callq 0x5bde
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), %r14
movq 0x17932(%rip), %rbp     # 0x1ff98
movq 0x108(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x34e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x8853
cmpq $0x0, 0x78(%rsp)
je 0x8666
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x3400
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
callq 0x3340
movq 0x30(%rsp), %rax
movb (%rax), %al
cmpb $0x76, %al
jne 0x8731
cmpq $0x1, 0x38(%rsp)
jne 0x8731
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 0x8f52
movq 0x30(%rsp), %rax
movb (%rax), %al
cmpb $0x66, %al
jne 0x87a7
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 0x90fc
movq 0x30(%rsp), %rax
movb (%rax), %al
cmpb $0x6d, %al
jne 0x8836
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 %r14, %rdi
callq 0x5756
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1081c
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x881a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8836
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x3210
leaq 0x390(%rsp), %rdi
callq 0x30e0
jmp 0x8666
leaq 0x108(%rsp), %rdi
callq 0x3080
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x8885
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x88aa
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x88cf
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x88eb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x890d
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 0x8982
movq %rax, %rbx
jmp 0x8a36
movq %rax, %rbx
jmp 0x8a58
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x8962
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x8962
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x898a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x898a
jmp 0x8982
movq %rax, %rbx
jmp 0x89ab
movq %rax, %rbx
movq 0x17607(%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 0x89d0
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x89f5
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x8a1a
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8a36
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x8a58
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x32d0
leaq 0x108(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x34b0
nop