// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::MaterialFileReader::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<tinyobj::material_t, std::allocator<tinyobj::material_t>>*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
bool MaterialFileReader::operator()(const std::string &matId,
                                    std::vector<material_t> *materials,
                                    std::map<std::string, int> *matMap,
                                    std::string *warn, std::string *err) {
  std::string filepath;

  if (!m_mtlBaseDir.empty()) {
    filepath = std::string(m_mtlBaseDir) + matId;
  } else {
    filepath = matId;
  }

  std::ifstream matIStream(filepath.c_str());
  if (!matIStream) {
    std::stringstream ss;
    ss << "Material file [ " << filepath << " ] not found." << std::endl;
    if (warn) {
      (*warn) += ss.str();
    }
    return false;
  }

  LoadMtl(matMap, materials, &matIStream, warn, err);

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3d0, %rsp            # imm = 0x3D0
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq $0x0, 0x10(%rdi)
je 0xe3b4
movq %rdi, %rsi
addq $0x8, %rsi
leaq 0x40(%rsp), %rdi
callq 0x6540
leaq 0x1c8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %r12, %rdx
callq 0x16520
movq %rsp, %rdi
leaq 0x1c8(%rsp), %r12
movq %r12, %rsi
callq 0x64e0
movq %r12, %rdi
callq 0x61a0
leaq 0x40(%rsp), %rdi
callq 0x61a0
jmp 0xe3bf
movq %rsp, %rdi
movq %r12, %rsi
callq 0x6220
movq (%rsp), %rsi
leaq 0x1c8(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x6760
movq 0x1c8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x1e8(%rsp,%rax), %ebp
testb $0x5, %bpl
je 0xe460
leaq 0x40(%rsp), %rdi
callq 0x62d0
leaq 0x50(%rsp), %rdi
leaq 0x22562(%rip), %rsi     # 0x30964
callq 0x6420
movq %rsp, %rsi
movq %rax, %rdi
callq 0x63b0
leaq 0x2255c(%rip), %rsi     # 0x30975
movq %rax, %rdi
callq 0x6420
movq %rax, %rdi
callq 0x61d0
testq %rbx, %rbx
je 0xe454
leaq 0x58(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x6660
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x67d0
leaq 0x20(%rsp), %rdi
callq 0x61a0
leaq 0x40(%rsp), %rdi
callq 0x6320
jmp 0xe476
leaq 0x1c8(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0xce86
testb $0x5, %bpl
sete %bl
leaq 0x1c8(%rsp), %rdi
callq 0x60c0
movq %rsp, %rdi
callq 0x61a0
movl %ebx, %eax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe4b9
jmp 0xe4cf
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x61a0
jmp 0xe4d7
jmp 0xe4d4
movq %rax, %rbx
jmp 0xe4e1
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x61a0
jmp 0xe4ee
jmp 0xe4cf
movq %rax, %rbx
jmp 0xe4ee
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6320
leaq 0x1c8(%rsp), %rdi
callq 0x60c0
movq %rsp, %rdi
callq 0x61a0
movq %rbx, %rdi
callq 0x6710