// File: alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::LoadObj(tinyobj::attrib_t*, std::vector<tinyobj::shape_t, std::allocator<tinyobj::shape_t>>*, std::vector<tinyobj::material_t, std::allocator<tinyobj::material_t>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, char const*, char const*, bool, bool)
bool LoadObj(attrib_t *attrib, std::vector<shape_t> *shapes,
             std::vector<material_t> *materials, std::string *warn,
             std::string *err, const char *filename, const char *mtl_basedir,
             bool trianglulate, bool default_vcols_fallback) {
  attrib->vertices.clear();
  attrib->normals.clear();
  attrib->texcoords.clear();
  attrib->colors.clear();
  shapes->clear();

  std::stringstream errss;

  std::ifstream ifs(filename);
  if (!ifs) {
    errss << "Cannot open file [" << filename << "]" << std::endl;
    if (err) {
      (*err) = errss.str();
    }
    return false;
  }

  std::string baseDir = mtl_basedir ? mtl_basedir : "";
  if (!baseDir.empty()) {
#ifndef _WIN32
    const char dirsep = '/';
#else
    const char dirsep = '\\';
#endif
    if (baseDir[baseDir.length() - 1] != dirsep) baseDir += dirsep;
  }
  MaterialFileReader matFileReader(baseDir);

  return LoadObj(attrib, shapes, materials, warn, err, &ifs, &matFileReader,
                 trianglulate, default_vcols_fallback);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rcx, -0x470(%rbp)
movq %rdx, %rax
movq -0x470(%rbp), %rdx
movq %rax, -0x468(%rbp)
movq %rsi, %rax
movq -0x468(%rbp), %rsi
movq %rax, -0x460(%rbp)
movq %rdi, %r10
movq -0x460(%rbp), %rdi
movb 0x20(%rbp), %al
movb 0x18(%rbp), %cl
movq 0x10(%rbp), %r11
movq %r10, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
andb $0x1, %cl
movb %cl, -0x39(%rbp)
andb $0x1, %al
movb %al, -0x3a(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2b6d0
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x2b6d0
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
callq 0x2b6d0
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
callq 0x2b6d0
movq -0x18(%rbp), %rdi
callq 0x2b6f0
leaq -0x1c8(%rbp), %rdi
callq 0x7360
movq -0x38(%rbp), %rsi
leaq -0x3d0(%rbp), %rdi
movl $0x8, %edx
callq 0x78c0
jmp 0x1e5b7
movq -0x3d0(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x3d0(%rbp,%rax), %rdi
callq 0x7220
movb %al, -0x471(%rbp)
jmp 0x1e5d7
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x1e5e6
jmp 0x1e6c7
leaq -0x1b8(%rbp), %rdi
leaq 0x601b5(%rip), %rsi     # 0x7e7a9
callq 0x74e0
movq %rax, -0x480(%rbp)
jmp 0x1e602
movq -0x480(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x74e0
movq %rax, -0x488(%rbp)
jmp 0x1e61b
movq -0x488(%rbp), %rdi
leaq 0x62baf(%rip), %rsi     # 0x811d8
callq 0x74e0
movq %rax, -0x490(%rbp)
jmp 0x1e637
movq -0x490(%rbp), %rdi
movq 0x9192b(%rip), %rsi     # 0xaff70
callq 0x7540
jmp 0x1e64c
cmpq $0x0, -0x30(%rbp)
je 0x1e6b4
leaq -0x400(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x74d0
jmp 0x1e668
movq -0x30(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x75f0
leaq -0x400(%rbp), %rdi
callq 0x72e0
jmp 0x1e6b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3d8(%rbp)
movl %eax, -0x3dc(%rbp)
jmp 0x1e8ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3d8(%rbp)
movl %eax, -0x3dc(%rbp)
jmp 0x1e8c2
movb $0x0, -0x1(%rbp)
movl $0x1, -0x404(%rbp)
jmp 0x1e89c
cmpq $0x0, 0x10(%rbp)
je 0x1e6db
movq 0x10(%rbp), %rax
movq %rax, -0x498(%rbp)
jmp 0x1e6eb
leaq 0x5fec0(%rip), %rax     # 0x7e5a2
movq %rax, -0x498(%rbp)
jmp 0x1e6eb
movq -0x498(%rbp), %rax
movq %rax, -0x4a8(%rbp)
leaq -0x429(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x7870
movq -0x4a8(%rbp), %rsi
movq -0x4a0(%rbp), %rdx
leaq -0x428(%rbp), %rdi
callq 0x2b020
jmp 0x1e728
leaq -0x429(%rbp), %rdi
callq 0x7560
leaq -0x428(%rbp), %rdi
callq 0x77e0
testb $0x1, %al
jne 0x1e7dd
movb $0x2f, -0x42a(%rbp)
leaq -0x428(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x7720
movq -0x4b8(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x7930
movq %rax, -0x4b0(%rbp)
jmp 0x1e77d
movq -0x4b0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x1e7db
leaq -0x428(%rbp), %rdi
movl $0x2f, %esi
callq 0x72f0
jmp 0x1e79f
jmp 0x1e7db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3d8(%rbp)
movl %eax, -0x3dc(%rbp)
leaq -0x429(%rbp), %rdi
callq 0x7560
jmp 0x1e8c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3d8(%rbp)
movl %eax, -0x3dc(%rbp)
jmp 0x1e88e
jmp 0x1e7dd
leaq -0x458(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x2b710
jmp 0x1e7f2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movzbl -0x39(%rbp), %r9d
movzbl -0x3a(%rbp), %r10d
andl $0x1, %r10d
movq %rsp, %rax
movl %r10d, 0x10(%rax)
andl $0x1, %r9d
movl %r9d, 0x8(%rax)
leaq -0x458(%rbp), %r9
movq %r9, (%rax)
leaq -0x3d0(%rbp), %r9
callq 0x1e8f0
movb %al, -0x4b9(%rbp)
jmp 0x1e841
movb -0x4b9(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x1, -0x404(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x2b770
leaq -0x428(%rbp), %rdi
callq 0x72e0
jmp 0x1e89c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x3d8(%rbp)
movl %eax, -0x3dc(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x2b770
leaq -0x428(%rbp), %rdi
callq 0x72e0
jmp 0x1e8c2
leaq -0x3d0(%rbp), %rdi
callq 0x70f0
leaq -0x1c8(%rbp), %rdi
callq 0x73b0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
leaq -0x3d0(%rbp), %rdi
callq 0x70f0
leaq -0x1c8(%rbp), %rdi
callq 0x73b0
movq -0x3d8(%rbp), %rdi
callq 0x7860
nopw %cs:(%rax,%rax)