// File: alan0201tw[P]RayTracer/include/tiny_obj_loader.h
// Function: tinyobj::parseTextureType(char const**, tinyobj::texture_type_t)
static inline texture_type_t parseTextureType(
    const char **token, texture_type_t default_value = TEXTURE_TYPE_NONE) {
  (*token) += strspn((*token), " \t");
  const char *end = (*token) + strcspn((*token), " \t\r");
  texture_type_t ty = default_value;

  if ((0 == strncmp((*token), "cube_top", strlen("cube_top")))) {
    ty = TEXTURE_TYPE_CUBE_TOP;
  } else if ((0 == strncmp((*token), "cube_bottom", strlen("cube_bottom")))) {
    ty = TEXTURE_TYPE_CUBE_BOTTOM;
  } else if ((0 == strncmp((*token), "cube_left", strlen("cube_left")))) {
    ty = TEXTURE_TYPE_CUBE_LEFT;
  } else if ((0 == strncmp((*token), "cube_right", strlen("cube_right")))) {
    ty = TEXTURE_TYPE_CUBE_RIGHT;
  } else if ((0 == strncmp((*token), "cube_front", strlen("cube_front")))) {
    ty = TEXTURE_TYPE_CUBE_FRONT;
  } else if ((0 == strncmp((*token), "cube_back", strlen("cube_back")))) {
    ty = TEXTURE_TYPE_CUBE_BACK;
  } else if ((0 == strncmp((*token), "sphere", strlen("sphere")))) {
    ty = TEXTURE_TYPE_SPHERE;
  }

  (*token) = end;
  return ty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62723(%rip), %rsi     # 0x7e5a0
callq 0x71d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62d06(%rip), %rsi     # 0x7ebae
callq 0x7060
movq %rax, %rcx
movq -0x28(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62c6e(%rip), %rsi     # 0x7eb3d
movl $0x8, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1beed
movl $0x2, -0x1c(%rbp)
jmp 0x1bff3
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62c4b(%rip), %rsi     # 0x7eb46
movl $0xb, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bf19
movl $0x3, -0x1c(%rbp)
jmp 0x1bff1
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62c2b(%rip), %rsi     # 0x7eb52
movl $0x9, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bf45
movl $0x6, -0x1c(%rbp)
jmp 0x1bfef
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62c09(%rip), %rsi     # 0x7eb5c
movl $0xa, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bf6e
movl $0x7, -0x1c(%rbp)
jmp 0x1bfed
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62beb(%rip), %rsi     # 0x7eb67
movl $0xa, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bf97
movl $0x4, -0x1c(%rbp)
jmp 0x1bfeb
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62bcd(%rip), %rsi     # 0x7eb72
movl $0x9, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bfc0
movl $0x5, -0x1c(%rbp)
jmp 0x1bfe9
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x62bae(%rip), %rsi     # 0x7eb7c
movl $0x6, %edx
callq 0x7240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1bfe7
movl $0x1, -0x1c(%rbp)
jmp 0x1bfe9
jmp 0x1bfeb
jmp 0x1bfed
jmp 0x1bfef
jmp 0x1bff1
jmp 0x1bff3
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)