// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/TargetSelect.cpp
// Function: t2::DestructureInputSpec(t2::TargetSelectInput const&, t2::InputSpec*, char const*)
static bool DestructureInputSpec(const TargetSelectInput& input, InputSpec* spec, const char* name)
{
  char buffer[256];
  strncpy(buffer, name, sizeof buffer);
  buffer[(sizeof buffer) - 1] = '\0';

  // Pick apart win32-msvc-debug-default
  // config:     win32-msvc
  // variant:    debug
  // subvariant: default
  char* dash1 = strchr(buffer, '-');
  char* dash2 = dash1 ? strchr(dash1 + 1, '-') : nullptr;
  char* dash3 = dash2 ? strchr(dash2 + 1, '-') : nullptr;

  if (!dash1)
    return false;

  const char* config     = buffer;
  const char* variant    = nullptr;
  const char* subvariant = nullptr;

  if (dash2)
  {
    *dash2 = '\0';
    variant = dash2 + 1;

    if (dash3)
    {
      *dash3 = '\0';
      subvariant = dash3 + 1;
    }
  }

  if (!FindHash(&spec->m_ConfigIndex, input.m_ConfigNameHashes, input.m_ConfigCount, Djb2Hash(config)))
    return false;

  if (variant)
  {
    if (!FindHash(&spec->m_VariantIndex, input.m_VariantNameHashes, input.m_VariantCount, Djb2Hash(variant)))
      return false;
  }
  else
  {
    spec->m_VariantIndex = -1;
  }

  if (subvariant)
  {
    if (!FindHash(&spec->m_SubVariantIndex, input.m_SubVariantNameHashes, input.m_SubVariantCount, Djb2Hash(subvariant)))
      return false;
  }
  else
  {
    spec->m_SubVariantIndex = -1;
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x120(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x31b0
movb $0x0, -0x21(%rbp)
leaq -0x120(%rbp), %rdi
movl $0x2d, %esi
callq 0x3130
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
je 0x1e750
movq -0x128(%rbp), %rdi
addq $0x1, %rdi
movl $0x2d, %esi
callq 0x3130
movq %rax, -0x158(%rbp)
jmp 0x1e75b
xorl %eax, %eax
movq %rax, -0x158(%rbp)
jmp 0x1e75b
movq -0x158(%rbp), %rax
movq %rax, -0x130(%rbp)
cmpq $0x0, -0x130(%rbp)
je 0x1e791
movq -0x130(%rbp), %rdi
addq $0x1, %rdi
movl $0x2d, %esi
callq 0x3130
movq %rax, -0x160(%rbp)
jmp 0x1e79c
xorl %eax, %eax
movq %rax, -0x160(%rbp)
jmp 0x1e79c
movq -0x160(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x128(%rbp)
jne 0x1e7bd
movb $0x0, -0x1(%rbp)
jmp 0x1e976
leaq -0x120(%rbp), %rax
movq %rax, -0x140(%rbp)
movq $0x0, -0x148(%rbp)
movq $0x0, -0x150(%rbp)
cmpq $0x0, -0x130(%rbp)
je 0x1e82f
movq -0x130(%rbp), %rax
movb $0x0, (%rax)
movq -0x130(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x148(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x1e82d
movq -0x138(%rbp), %rax
movb $0x0, (%rax)
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x150(%rbp)
jmp 0x1e82f
movq -0x18(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x170(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x164(%rbp)
movq -0x140(%rbp), %rdi
callq 0x7860
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
movl -0x164(%rbp), %edx
movl %eax, %ecx
callq 0x1e680
testb $0x1, %al
jne 0x1e889
movb $0x0, -0x1(%rbp)
jmp 0x1e976
cmpq $0x0, -0x148(%rbp)
je 0x1e8f4
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x190(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x188(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x17c(%rbp)
movq -0x148(%rbp), %rdi
callq 0x7860
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
movl -0x17c(%rbp), %edx
movl %eax, %ecx
callq 0x1e680
testb $0x1, %al
jne 0x1e8f2
movb $0x0, -0x1(%rbp)
jmp 0x1e976
jmp 0x1e8ff
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
cmpq $0x0, -0x150(%rbp)
je 0x1e967
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1a8(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x194(%rbp)
movq -0x150(%rbp), %rdi
callq 0x7860
movq -0x1a8(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
movl -0x194(%rbp), %edx
movl %eax, %ecx
callq 0x1e680
testb $0x1, %al
jne 0x1e965
movb $0x0, -0x1(%rbp)
jmp 0x1e976
jmp 0x1e972
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop