LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Main.cpp
// Function: ShowHelp()
static void ShowHelp()
{
  printf("\nTundra Build Processor 2.0\n");
  printf("Copyright (C) 2010-2023 Andreas Fredriksson\n\n");

#ifdef HAVE_GIT_INFO
  printf("Git branch: %s\n", g_GitBranch);
  printf("Git commit: %s\n\n", g_GitVersion);
#endif

  printf("This program comes with ABSOLUTELY NO WARRANTY.\n");

  printf("Usage: tundra2 [options...] [targets...]\n\n");
  printf("Options:\n");

  size_t max_opt_len = 0;
  for (size_t i = 0; i < ARRAY_SIZE(g_OptionTemplates); ++i)
  {
    size_t opt_len = strlen(g_OptionTemplates[i].m_LongName) + 12;
    if (opt_len > max_opt_len)
      max_opt_len = opt_len;
  }

  for (size_t i = 0; i < ARRAY_SIZE(g_OptionTemplates); ++i)
  {
    const OptionTemplate* t = g_OptionTemplates + i;

    if (!t->m_Help)
      continue;

    char long_text[256];
    if (t->m_Type == OptionType::kInt)
      snprintf(long_text, sizeof long_text, "%s=<integer>", t->m_LongName);
    else if (t->m_Type == OptionType::kString)
      snprintf(long_text, sizeof long_text, "%s=<string>", t->m_LongName);
    else
      snprintf(long_text, sizeof long_text, "%s          ", t->m_LongName);

    printf("  -%c, --%-*s %s\n", t->m_ShortName, (int) max_opt_len, long_text, t->m_Help);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq 0x1166e(%rip), %rdi     # 0x15873
callq 0x3540
leaq 0x1167e(%rip), %rdi     # 0x1588f
callq 0x3540
leaq 0x115b9(%rip), %rdi     # 0x157d6
leaq 0x10e15(%rip), %rsi     # 0x15039
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3060
leaq 0x115b2(%rip), %rdi     # 0x157e6
leaq 0x10dd5(%rip), %rsi     # 0x15010
xorl %eax, %eax
callq 0x3060
leaq 0x11673(%rip), %rdi     # 0x158bc
callq 0x3540
leaq 0x11697(%rip), %rdi     # 0x158ec
callq 0x3540
leaq 0x116b5(%rip), %rdi     # 0x15916
callq 0x3540
movl $0x8, %r14d
leaq 0x1881d(%rip), %r13     # 0x1ca90
movq %rbx, %r15
movq (%r14,%r13), %rdi
callq 0x3150
movq %rax, %rbx
addq $0xc, %rbx
cmpq %r15, %rbx
cmovbeq %r15, %rbx
addq $0x28, %r14
cmpq $0x328, %r14            # imm = 0x328
jne 0x4273
movl $0x20, %ebp
movq %rsp, %r14
leaq 0x11574(%rip), %r15     # 0x1581d
movq (%rbp,%r13), %r12
testq %r12, %r12
je 0x4305
movl -0x10(%rbp,%r13), %eax
leaq 0x11545(%rip), %rdx     # 0x15804
cmpl $0x2, %eax
je 0x42cb
leaq 0x11545(%rip), %rdx     # 0x15810
movq -0x18(%rbp,%r13), %rcx
cmpl $0x1, %eax
leaq 0x1151d(%rip), %rax     # 0x157f7
cmoveq %rax, %rdx
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
xorl %eax, %eax
callq 0x3560
movsbl -0x20(%rbp,%r13), %esi
movq %r15, %rdi
movl %ebx, %edx
movq %r14, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x3060
addq $0x28, %rbp
cmpq $0x340, %rbp            # imm = 0x340
jne 0x42a9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Main.cpp
// Function: AssignOptionValue(char*, OptionTemplate const*, char const*, bool)
static int AssignOptionValue(char* option_base, const OptionTemplate* templ, const char* value, bool is_short)
{
  char* dest = option_base + templ->m_Offset;

  switch (templ->m_Type)
  {
    case OptionType::kBool:
      *(bool*)dest = true;
      return 1;

    case OptionType::kInt:
      if (value)
      {
        *(int*)dest = atoi(value);
        return is_short ? 2 : 1;
      }
      else
      {
        if (is_short)
          fprintf(stderr, "option requires an argument: %c\n", templ->m_ShortName);
        else
          fprintf(stderr, "option requires an argument: --%s\n", templ->m_LongName);
        return 0;
      }
      break;

    case OptionType::kString:
      if (value)
      {
        *(const char**)dest = value;
        return is_short ? 2 : 1;
      }
      else
      {
        if (is_short)
          fprintf(stderr, "option requires an argument: %c\n", templ->m_ShortName);
        else
          fprintf(stderr, "option requires an argument: --%s\n", templ->m_LongName);
        return 0;
      }
      break;

    default:
      return 0;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %ecx, %ebx
movq %rdi, %r14
movq 0x18(%rsi), %r15
movl 0x10(%rsi), %eax
cmpl $0x2, %eax
je 0x4364
cmpl $0x1, %eax
je 0x4351
xorl %ebx, %ebx
testl %eax, %eax
jne 0x4372
movb $0x1, (%r14,%r15)
movl $0x1, %ebx
jmp 0x4372
testq %rdx, %rdx
je 0x437a
movq %rdx, %rdi
callq 0x3550
movl %eax, (%r14,%r15)
jmp 0x436d
testq %rdx, %rdx
je 0x437a
movq %rdx, (%r14,%r15)
movzbl %bl, %ebx
incl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x18c57(%rip), %rax     # 0x1cfd8
movq (%rax), %rdi
testb %bl, %bl
je 0x439d
movsbl (%rsi), %edx
leaq 0x11400(%rip), %rsi     # 0x15792
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3480
jmp 0x4372
movq 0x8(%rsi), %rdx
leaq 0x1140b(%rip), %rsi     # 0x157b3
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x3480
jmp 0x4372
nop
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/BuildQueue.cpp
// Function: t2::BuildQueueBuildNodeRange(t2::BuildQueue*, int, int, int)
BuildResult::Enum BuildQueueBuildNodeRange(BuildQueue* queue, int start_index, int count, int pass_index)
  {
    // Make sure none of the build threads see in-progress state due to a spurious wakeup.
    MutexLock(&queue->m_Lock);

    CHECK(start_index + count <= queue->m_Config.m_MaxNodes);

    queue->m_CurrentPassIndex = pass_index;

    // Initialize build queue with index range to build
    int32_t   *build_queue = queue->m_Queue;
    NodeState *node_states = queue->m_Config.m_NodeState;

    for (int i = 0; i < count; ++i)
    {
      NodeState* state = node_states + start_index + i;

      NodeStateFlagQueued(state);

      // Verify node hasn't been touched already
      CHECK(state->m_Progress == BuildProgress::kInitial);

      build_queue[i] = start_index + i;
    }

    queue->m_PendingNodeCount = count;
    queue->m_FailedNodeCount  = 0;
    queue->m_QueueWriteIndex  = count;
    queue->m_QueueReadIndex   = 0;

    MutexUnlock(&queue->m_Lock);

    CondBroadcast(&queue->m_WorkAvailable);

    // This thread is thread 0.
    BuildLoop(&queue->m_ThreadState[0]);

    if (SignalGetReason())
      return BuildResult::kInterrupted;
    else if (queue->m_FailedNodeCount)
      return BuildResult::kBuildError;
    else
      return BuildResult::kOk;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x34b0
testl %eax, %eax
jne 0x4893
movl %r15d, 0xf0(%rbx)
testl %ebp, %ebp
jle 0x482f
movq 0x58(%rbx), %rax
movslq %r14d, %rdx
movl %edx, %ecx
shlq $0x6, %rdx
addq 0x90(%rbx), %rdx
movl %ebp, %esi
xorl %edi, %edi
orb $0x1, (%rdx)
leal (%rcx,%rdi), %r8d
movl %r8d, (%rax,%rdi,4)
incq %rdi
addq $0x40, %rdx
cmpq %rdi, %rsi
jne 0x4818
movl %ebp, 0xe8(%rbx)
xorl %eax, %eax
movl %eax, 0xec(%rbx)
movl %ebp, 0x68(%rbx)
movl %eax, 0x64(%rbx)
movq %rbx, %rdi
callq 0x3250
testl %eax, %eax
jne 0x489c
leaq 0x28(%rbx), %rdi
callq 0x3110
testl %eax, %eax
jne 0x48a5
movq 0x100(%rbx), %rdi
callq 0x48b3
callq 0x11a74
movq %rax, %rcx
movl $0x1, %eax
testq %rcx, %rcx
jne 0x4888
xorl %eax, %eax
cmpl $0x0, 0xec(%rbx)
setne %al
addl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x111da(%rip), %rdi     # 0x15a74
jmp 0x48ac
leaq 0x111ed(%rip), %rdi     # 0x15a90
jmp 0x48ac
leaq 0x11202(%rip), %rdi     # 0x15aae
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/BuildQueue.cpp
// Function: t2::WakeWaiters(t2::BuildQueue*, int)
static void WakeWaiters(BuildQueue* queue, int count)
  {
    if (count > 1)
      CondBroadcast(&queue->m_WorkAvailable);
    else
      CondSignal(&queue->m_WorkAvailable);
  }

// Assembly:
pushq %rax
addq $0x28, %rdi
cmpl $0x2, %esi
jl 0x5a25
callq 0x3110
testl %eax, %eax
je 0x5a2e
leaq 0x1008b(%rip), %rdi     # 0x15aae
jmp 0x5a37
callq 0x3040
testl %eax, %eax
jne 0x5a30
popq %rax
retq
leaq 0x10122(%rip), %rdi     # 0x15b59
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/BuildQueue.cpp
// Function: t2::MakeDirectoriesRecursive(t2::StatCache*, t2::PathBuffer const&)
static bool MakeDirectoriesRecursive(StatCache* stat_cache, const PathBuffer& dir)
  {
    PathBuffer parent_dir = dir;
    PathStripLast(&parent_dir);

    // Can't go any higher.
    if (dir == parent_dir)
      return true;

    if (!MakeDirectoriesRecursive(stat_cache, parent_dir))
      return false;

    char path[kMaxPathLength];
    PathFormat(path, &dir);

    FileInfo info = StatCacheStat(stat_cache, path);

    if (info.Exists())
    {
      // Just asssume this is a directory. We could check it - but there's currently no way via _stat64() calls
      // on Windows to check if a file is a symbolic link (to a directory).
      return true;
    }
    else
    {
      Log(kSpam, "create dir \"%s\"", path);
      bool success = MakeDirectory(path);
      StatCacheMarkDirty(stat_cache, path, Djb2HashPath(path));
      return success;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4b8, %rsp            # imm = 0x4B8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x24(%rsp), %r15
movl $0x28c, %edx            # imm = 0x28C
movq %r15, %rdi
callq 0x3290
movq %r15, %rdi
callq 0xf42c
movzwl 0x6(%r14), %r13d
cmpw 0x6(%r15), %r13w
jne 0x5ae2
movb $0x1, %bpl
testq %r13, %r13
je 0x5b6d
leaq 0xa(%r14), %r12
leaq 0x2e(%rsp), %rsi
leal (,%r13,2), %edx
movq %r12, %rdi
callq 0x3360
testl %eax, %eax
jne 0x5ae2
movl $0x8a, %eax
leaq (%r14,%rax), %rdi
addq %rax, %r15
cmpl $0x1, %r13d
jne 0x5abd
movzwl (%r12), %eax
jmp 0x5acf
leal -0x1(%r13), %eax
movzwl (%r12,%rax,2), %eax
addl $-0x2, %r13d
subw (%r12,%r13,2), %ax
movzwl %ax, %edx
movq %r15, %rsi
callq 0x3360
testl %eax, %eax
je 0x5b6d
leaq 0x24(%rsp), %rsi
movq %rbx, %rdi
callq 0x5a3e
testb %al, %al
je 0x5b6b
leaq 0x2b0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xf56a
movq %r15, %rdi
callq 0x5df8
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %eax, %ecx
callq 0x11dc4
movb $0x1, %bpl
testb $0x1, (%r14)
jne 0x5b6d
leaq 0x10252(%rip), %rsi     # 0x15d85
leaq 0x2b0(%rsp), %r14
movl $0x10, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x5ef0
movq %r14, %rdi
callq 0x6132
movl %eax, %ebp
movq %r14, %rdi
callq 0x5df8
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x11d47
jmp 0x5b6d
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x4b8, %rsp            # imm = 0x4B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Stats.hpp
// Function: t2::TimingScope::~TimingScope()
~TimingScope()
  {
    uint64_t micros = TimerGet() - m_StartTime;
    if (uint32_t *ptr = m_CountPtr)
      AtomicIncrement(ptr);
    AtomicAdd(m_TimePtr, micros);
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x60a6
movq (%rbx), %rdx
movq 0x10(%rbx), %rcx
testq %rdx, %rdx
je 0x5bc4
lock
incl (%rdx)
subq %rcx, %rax
movq 0x8(%rbx), %rcx
lock
addq %rax, (%rcx)
popq %rbx
retq
movq %rax, %rdi
callq 0x5ba0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Croak(char const*, ...)
void NORETURN Croak(const char* fmt, ...)
{
  va_list args;
  va_start(args, fmt);
  vfprintf(stderr, fmt, args);
  va_end(args);
  fprintf(stderr, "\n");
  if (DebuggerAttached())
    abort();
  else
    exit(1);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5c3c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x17375(%rip), %rbx     # 0x1cfd8
movq (%rbx), %rdi
movq %r10, %rsi
callq 0x3450
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x3410
movl $0x1, %edi
callq 0x33f0
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::CroakErrno(char const*, ...)
void NORETURN CroakErrno(const char* fmt, ...)
{
  va_list args;
  va_start(args, fmt);
  vfprintf(stderr, fmt, args);
  va_end(args);
  fprintf(stderr, "\n");
  fprintf(stderr, "errno: %d (%s)\n", errno, strerror(errno));
#if defined(TUNDRA_WIN32)
  DWORD gle = GetLastError();

  char* message = nullptr;
  size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
                                 NULL, gle, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char*)&message, 0, NULL);
    
  fprintf(stderr, "Win32 GLE: %u (%s)\n", gle, message);
#endif
  if (DebuggerAttached())
    abort();
  else
    exit(1);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5ce5
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x172cc(%rip), %rbx     # 0x1cfd8
movq (%rbx), %rdi
movq %r10, %rsi
callq 0x3450
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x3410
movq (%rbx), %rbx
callq 0x3050
movl (%rax), %ebp
movl %ebp, %edi
callq 0x30f0
leaq 0x100bc(%rip), %rsi     # 0x15df8
movq %rbx, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x3480
movl $0x1, %edi
callq 0x33f0
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::CroakAbort(char const*, ...)
void NORETURN CroakAbort(const char* fmt, ...)
{
  va_list args;
  va_start(args, fmt);
  vfprintf(stderr, fmt, args);
  va_end(args);
  fprintf(stderr, "\n");
  abort();
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5db4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x171fd(%rip), %rbx     # 0x1cfd8
movq (%rbx), %rdi
movq %r10, %rsi
callq 0x3450
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x3410
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Djb2Hash(char const*)
uint32_t Djb2Hash(const char *str_)
{
  const uint8_t *str = (const uint8_t *) str_;
  uint32_t hash      = 5381;
  int c;

  while (0 != (c = *str++))
  {
    hash = (hash * 33) + c;
  }

  return hash ? hash : 1;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x5e1f
incq %rdi
movl $0x1505, %edx           # imm = 0x1505
movl %edx, %eax
movzbl %cl, %ecx
shll $0x5, %eax
addl %edx, %eax
addl %ecx, %eax
movb (%rdi), %cl
incq %rdi
movl %eax, %edx
testb %cl, %cl
jne 0x5e08
jmp 0x5e24
movl $0x1505, %eax           # imm = 0x1505
cmpl $0x1, %eax
adcl $0x0, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Djb2Hash64(char const*)
uint64_t Djb2Hash64(const char *str_)
{
  const uint8_t *str = (const uint8_t *) str_;
  uint64_t hash      = 5381;
  int c;

  while (0 != (c = *str++))
  {
    hash = (hash * 33) + c;
  }

  return hash ? hash : 1;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x5e54
incq %rdi
movl $0x1505, %eax           # imm = 0x1505
movq %rax, %rdx
shlq $0x5, %rdx
addq %rax, %rdx
movzbl %cl, %eax
addq %rdx, %rax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x5e39
jmp 0x5e59
movl $0x1505, %eax           # imm = 0x1505
cmpq $0x1, %rax
adcq $0x0, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Djb2HashNoCase(char const*)
uint32_t Djb2HashNoCase(const char *str_)
{
  const uint8_t *str = (const uint8_t *) str_;
  uint32_t hash = 5381;
  int c;

  while (0 != (c = *str++))
  {
    hash = (hash * 33) + FoldCase(c);
  }

  return hash ? hash : 1;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x5e93
incq %rdi
movl $0x1505, %eax           # imm = 0x1505
movzbl %cl, %ecx
movl %eax, %edx
shll $0x5, %edx
addl %eax, %edx
leal -0x41(%rcx), %esi
leal 0x20(%rcx), %eax
cmpl $0x1a, %esi
cmovael %ecx, %eax
addl %edx, %eax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x5e70
jmp 0x5e98
movl $0x1505, %eax           # imm = 0x1505
cmpl $0x1, %eax
adcl $0x0, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Djb2HashNoCase64(char const*)
uint64_t Djb2HashNoCase64(const char *str_)
{
  const uint8_t *str = (const uint8_t *) str_;
  uint64_t hash = 5381;
  int c;

  while (0 != (c = *str++))
  {
    hash = (hash * 33) + FoldCase(c);
  }

  return hash ? hash : 1;
}

// Assembly:
movb (%rdi), %cl
testb %cl, %cl
je 0x5ed4
incq %rdi
movl $0x1505, %eax           # imm = 0x1505
movzbl %cl, %ecx
movq %rax, %rdx
shlq $0x5, %rdx
addq %rax, %rdx
leal -0x41(%rcx), %esi
leal 0x20(%rcx), %eax
cmpl $0x1a, %esi
cmovael %ecx, %eax
addq %rdx, %rax
movb (%rdi), %cl
incq %rdi
testb %cl, %cl
jne 0x5ead
jmp 0x5ed9
movl $0x1505, %eax           # imm = 0x1505
cmpq $0x1, %rax
adcq $0x0, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::Log(t2::LogLevel, char const*, ...)
void Log(LogLevel level, const char* fmt, ...)
{
  if (s_LogFlags & level)
  {
    const char* prefix = "?";

    switch (level)
    {
      case kError   : prefix = "E"; break;
      case kWarning : prefix = "W"; break;
      case kInfo    : prefix = "I"; break;
      case kDebug   : prefix = "D"; break;
      case kSpam    : prefix = "S"; break;
      default       : break;
    }
    fprintf(stderr, "[%s] ", prefix);

    va_list args;
    va_start(args, fmt);
    vfprintf(stderr, fmt, args);
    va_end(args);

    fprintf(stderr, "\n");
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
testb %al, %al
je 0x5f35
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testl %edi, 0x17441(%rip)     # 0x1d390
jne 0x5f5c
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
leaq 0xfea2(%rip), %rdx      # 0x15e08
leal -0x1(%rdi), %eax
cmpl $0x7, %eax
ja 0x5f87
leaq 0xfe3b(%rip), %rcx      # 0x15db0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x100bc(%rip), %rdx     # 0x16041
jmp 0x5fae
cmpl $0x10, %edi
jne 0x5fae
leaq 0x1008f(%rip), %rdx     # 0x16022
jmp 0x5fae
leaq 0x10d1b(%rip), %rdx     # 0x16cb7
jmp 0x5fae
leaq 0xfe67(%rip), %rdx      # 0x15e0c
jmp 0x5fae
leaq 0xfe5c(%rip), %rdx      # 0x15e0a
movq 0x17023(%rip), %r14     # 0x1cfd8
movq (%r14), %rdi
leaq 0xfe4f(%rip), %rsi      # 0x15e0e
xorl %eax, %eax
callq 0x3480
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3450
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3410
jmp 0x5f51
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::NextPowerOfTwo(unsigned int)
uint32_t NextPowerOfTwo(uint32_t val)
{
  uint32_t mask = val - 1;

  mask |= mask >> 16;
  mask |= mask >> 8;
  mask |= mask >> 4;
  mask |= mask >> 2;
  mask |= mask >> 1;

  uint32_t pow2 = mask + 1;
  CHECK(pow2 >= val);
  CHECK((pow2 & mask) == 0);
  CHECK((pow2 & ~mask) == pow2);

  return pow2;
}

// Assembly:
leal -0x1(%rdi), %eax
movl %eax, %ecx
shrl $0x10, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %edx
shrl $0x2, %edx
orl %ecx, %edx
movl %edx, %eax
shrl %eax
orl %edx, %eax
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Common.cpp
// Function: t2::CountTrailingZeroes(unsigned int)
int CountTrailingZeroes(uint32_t v)
{
  v &= -int32_t(v);

  int bit_index = 32;

  if (v)
    --bit_index;

  if (v & 0x0000ffff) bit_index -= 16;
  if (v & 0x00ff00ff) bit_index -= 8;
  if (v & 0x0f0f0f0f) bit_index -= 4;
  if (v & 0x33333333) bit_index -= 2;
  if (v & 0x55555555) bit_index -= 1;

  return bit_index;
}

// Assembly:
movl %edi, %ecx
negl %ecx
xorl %eax, %eax
andl %edi, %ecx
sete %al
xorl %edx, %edx
testw %cx, %cx
sete %dl
shll $0x4, %edx
orl %eax, %edx
xorl %eax, %eax
testl $0xff00ff, %ecx         # imm = 0xFF00FF
sete %al
leal (%rdx,%rax,8), %eax
xorl %edx, %edx
testl $0xf0f0f0f, %ecx        # imm = 0xF0F0F0F
sete %dl
leal (%rax,%rdx,4), %eax
xorl %edx, %edx
testl $0x33333333, %ecx       # imm = 0x33333333
sete %dl
leal (%rax,%rdx,2), %eax
andl $0x55555555, %ecx       # imm = 0x55555555
cmpl $0x1, %ecx
adcl $-0x1, %eax
incl %eax
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteCommonStringPtr(t2::BinarySegment*, t2::BinarySegment*, char const*, t2::HashTable<t2::CommonStringRecord, 0u>*, t2::MemAllocLinear*)
void WriteCommonStringPtr(BinarySegment* segment, BinarySegment* str_seg, const char* ptr, HashTable<CommonStringRecord, 0>* table, MemAllocLinear* scratch)
{
  uint32_t hash = Djb2Hash(ptr);
  CommonStringRecord* r;
  if (nullptr == (r = HashTableLookup(table, hash, ptr)))
  {
    CommonStringRecord r;
    r.m_Pointer = BinarySegmentPosition(str_seg);
    HashTableInsert(table, hash, ptr, r);
    BinarySegmentWriteStringData(str_seg, ptr);
    BinarySegmentWritePointer(segment, r.m_Pointer);
  }
  else
  {
    BinarySegmentWritePointer(segment, r->m_Pointer);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x5df8
movl %eax, %ebp
movq %r12, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x6220
cltq
shlq $0x4, %rax
addq 0x28(%r12), %rax
jmp 0x6222
xorl %eax, %eax
testq %rax, %rax
je 0x6232
movl (%rax), %esi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
jmp 0x6286
movq %r15, %rdi
callq 0x13bed
movl %eax, %r13d
movq %r15, (%rsp)
movq %rdx, %r15
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x8d20
movq 0x28(%r12), %rcx
cltq
shlq $0x4, %rax
movl %r13d, (%rcx,%rax)
movq %r15, 0x8(%rcx,%rax)
movq %r14, %rdi
callq 0x3150
leaq 0x1(%rax), %rdx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x13b75
movq %rbx, %rdi
movl %r13d, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13ba1
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindStringValue(t2::JsonValue const*, char const*, char const*)
static const char* FindStringValue(const JsonValue* obj, const char* key, const char* default_value = nullptr)
{
  if (JsonValue::kObject != obj->m_Type)
    return default_value;

  const JsonValue *node = obj->Find(key);

  if (!node)
    return default_value;

  if (JsonValue::kString != node->m_Type)
    return default_value;

  return static_cast<const JsonStringValue*>(node)->m_String;
}

// Assembly:
movq %rdx, %rax
cmpl $0x2, (%rdi)
jne 0x65a3
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %r13
testq %r13, %r13
je 0x6573
movq %rsi, %r15
movq %rax, (%rsp)
movq 0x10(%r14), %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
movq (%rbp,%rbx,8), %rdi
movq %r15, %rsi
callq 0x3470
testl %eax, %eax
je 0x6578
incq %rbx
cmpq %rbx, %r13
jne 0x6558
jmp 0x6580
xorl %r12d, %r12d
jmp 0x6584
movq 0x18(%r14), %rax
movq (%rax,%rbx,8), %r12
movq (%rsp), %rax
testq %r12, %r12
je 0x6595
cmpl $0x4, (%r12)
jne 0x6595
movq 0x8(%r12), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindArrayValue(t2::JsonObjectValue const*, char const*)
static const JsonArrayValue* FindArrayValue(const JsonObjectValue* obj, const char* key)
{
  if (obj == nullptr)
    return nullptr;

  const JsonValue *node = obj->Find(key);

  if (!node)
    return nullptr;
  if (JsonValue::kArray != node->m_Type)
    return nullptr;
  return static_cast<const JsonArrayValue*>(node);
}

// Assembly:
testq %rdi, %rdi
je 0x65f1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
cmpl $0x2, (%rdi)
cmovneq %r15, %rbx
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x65fc
movq %rsi, %r14
movq 0x10(%rbx), %r13
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdi
movq %r14, %rsi
callq 0x3470
testl %eax, %eax
je 0x65f4
incq %rbp
cmpq %rbp, %r12
jne 0x65d6
jmp 0x65fc
xorl %eax, %eax
retq
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %r15
xorl %eax, %eax
testq %r15, %r15
je 0x660b
cmpl $0x3, (%r15)
cmoveq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GenerateIdeIntegrationFiles(char const*, int, char const**)
bool GenerateIdeIntegrationFiles(const char* build_file, int argc, const char** argv)
{
  MemAllocHeap heap;
  HeapInit(&heap);

  Buffer<char> args;
  BufferInit(&args);
  CreateCommandLine(&heap, &args, argc, argv);

  // Run DAG generator.
  bool result = RunExternalTool("generate-ide-files %s %s", build_file, args.m_Storage);

  BufferDestroy(&args, &heap);
  t2::HeapDestroy(&heap);

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0xf(%rsp), %r15
movq %r15, %rdi
callq 0xef60
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
movq $0x0, 0x10(%r12)
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x6b4b
movq (%r12), %rdx
leaq 0xf4c3(%rip), %rdi      # 0x15fc5
movq %r14, %rsi
xorl %eax, %eax
callq 0x68b8
movl %eax, %ebx
movq (%r12), %rsi
testq %rsi, %rsi
je 0x6b32
leaq 0xf(%rsp), %rdi
callq 0xef6a
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0xf(%rsp), %rdi
callq 0xef61
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::CreateCommandLine(t2::MemAllocHeap*, t2::Buffer<char>*, int, char const**)
static void CreateCommandLine(MemAllocHeap* heap, Buffer<char>* args, int argc, const char** argv)
{
  for (int i = 0; i < argc; ++i)
  {
    if (i > 0)
      BufferAppendOne(args, heap, ' ');

    const size_t arglen = strlen(argv[i]);
    const bool has_spaces = nullptr != strchr(argv[i], ' ');

    if (has_spaces)
      BufferAppendOne(args, heap, '"');

    BufferAppend(args, heap, argv[i], arglen);

    if (has_spaces)
      BufferAppendOne(args, heap, '"');
  }

  BufferAppendOne(args, heap, '\0');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
jle 0x6c1b
movq %rcx, %r15
movl %edx, %eax
movq %rax, (%rsp)
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x6b87
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c28
movb $0x20, (%rax)
movq (%r15,%rbp,8), %r13
movq %r13, %rdi
callq 0x3150
movq %rax, %r12
movq %r13, %rdi
movl $0x20, %esi
callq 0x3130
testq %rax, %rax
je 0x6bf2
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c28
movb $0x22, %cl
movb %cl, (%rax)
movq (%r15,%rbp,8), %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x8c28
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3290
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c28
movb $0x22, %cl
movb %cl, (%rax)
jmp 0x6c0e
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x8c28
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3290
incq %rbp
cmpq %rbp, (%rsp)
jne 0x6b6f
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8c28
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GenerateTemplateFiles(int, char const**)
bool GenerateTemplateFiles(int argc, const char** argv)
{
  MemAllocHeap heap;
  HeapInit(&heap);

  Buffer<char> args;
  BufferInit(&args);
  CreateCommandLine(&heap, &args, argc, argv);

  // Run DAG generator.
  bool result = RunExternalTool("create-template-file %s", args.m_Storage);

  BufferDestroy(&args, &heap);
  t2::HeapDestroy(&heap);

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xf(%rsp), %r14
movq %r14, %rdi
callq 0xef60
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
callq 0x6b4b
movq (%r15), %rsi
leaq 0xf357(%rip), %rdi      # 0x15fde
xorl %eax, %eax
callq 0x68b8
movl %eax, %ebx
movq (%r15), %rsi
testq %rsi, %rsi
je 0x6cb3
leaq 0xf(%rsp), %rdi
callq 0xef6a
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0xf(%rsp), %rdi
callq 0xef61
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteStringPtr(t2::BinarySegment*, t2::BinarySegment*, char const*)
static void WriteStringPtr(BinarySegment* seg, BinarySegment *str_seg, const char* text)
{
  if (text)
  {
    BinarySegmentWritePointer(seg, BinarySegmentPosition(str_seg));
    BinarySegmentWriteStringData(str_seg, text);
  }
  else
  {
    BinarySegmentWriteNullPointer(seg);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r15
testq %rdx, %rdx
je 0x868e
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x13bed
movq %r15, %rdi
movl %eax, %esi
callq 0x13ba1
movq %rbx, %rdi
callq 0x3150
leaq 0x1(%rax), %rdx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x13b75
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movl $0x4, %edx
movq %r15, %rdi
callq 0x13b75
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindObjectValue(t2::JsonObjectValue const*, char const*)
static const JsonObjectValue* FindObjectValue(const JsonObjectValue* obj, const char* key)
{
  const JsonValue *node = obj->Find(key);
  if (!node)
    return nullptr;
  if (JsonValue::kObject != node->m_Type)
    return nullptr;
  return static_cast<const JsonObjectValue*>(node);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
cmpl $0x2, (%rdi)
cmovneq %r15, %rbx
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x8700
movq %rsi, %r14
movq 0x10(%rbx), %r13
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdi
movq %r14, %rsi
callq 0x3470
testl %eax, %eax
je 0x86f8
incq %rbp
cmpq %rbp, %r12
jne 0x86dd
jmp 0x8700
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %r15
xorl %eax, %eax
testq %r15, %r15
je 0x870f
cmpl $0x2, (%r15)
cmoveq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteStrHashArray(t2::BinarySegment*, t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*)
static bool WriteStrHashArray(
    BinarySegment* main_seg,
    BinarySegment* aux_seg,
    BinarySegment* str_seg,
    const JsonArrayValue* strings)
{
  BinarySegmentWriteInt32(main_seg, (int) strings->m_Count);
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
  for (size_t i = 0, count = strings->m_Count; i < count; ++i)
  {
    const char* str = strings->m_Values[i]->GetString();
    if (!str)
      return false;
    WriteStringPtr(aux_seg, str_seg, str);
  }
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
  for (size_t i = 0, count = strings->m_Count; i < count; ++i)
  {
    const char* str = strings->m_Values[i]->GetString();
    uint32_t hash = Djb2Hash(str);
    BinarySegmentWriteUint32(aux_seg, hash);
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rcx), %eax
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
callq 0x13b75
movq %r14, %rdi
callq 0x13bed
movq %r15, %rdi
movl %eax, %esi
callq 0x13ba1
movq 0x8(%rbx), %r13
testq %r13, %r13
sete %bpl
je 0x87d6
movq 0x10(%rbx), %rax
movq (%rax), %rax
xorl %ecx, %ecx
cmpl $0x4, (%rax)
cmoveq %rax, %rcx
movq 0x8(%rcx), %rdx
testq %rdx, %rdx
je 0x87c7
movq %r15, 0x8(%rsp)
leaq -0x1(%r13), %r15
xorl %ebp, %ebp
movq %r14, %rdi
movq %r12, %rsi
callq 0x8645
cmpq %rbp, %r15
je 0x87ce
movq 0x10(%rbx), %rax
movq 0x8(%rax,%rbp,8), %rax
cmpl $0x4, (%rax)
je 0x87af
xorl %eax, %eax
movq 0x8(%rax), %rdx
incq %rbp
testq %rdx, %rdx
jne 0x878f
cmpq %r13, %rbp
setae %bpl
movq 0x8(%rsp), %r15
testb %bpl, %bpl
jne 0x87d6
jmp 0x882d
movb $0x1, %bpl
movq 0x8(%rsp), %r15
movq %r14, %rdi
callq 0x13bed
movq %r15, %rdi
movl %eax, %esi
callq 0x13ba1
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x882d
xorl %r13d, %r13d
leaq 0x4(%rsp), %r15
movq 0x10(%rbx), %rax
movq (%rax,%r13,8), %rax
cmpl $0x4, (%rax)
je 0x8808
xorl %eax, %eax
movq 0x8(%rax), %rdi
callq 0x5df8
movl %eax, 0x4(%rsp)
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x13b75
incq %r13
cmpq %r13, %r12
jne 0x87f9
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindIntValue(t2::JsonObjectValue const*, char const*, long)
static int64_t FindIntValue(const JsonObjectValue* obj, const char* key, int64_t def_value)
{
  const JsonValue *node = obj->Find(key);
  if (!node)
    return def_value;
  if (JsonValue::kNumber != node->m_Type)
    return def_value;
  return (int64_t) static_cast<const JsonNumberValue*>(node)->m_Number;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rax
movq %rdi, %r14
xorl %r12d, %r12d
cmpl $0x2, (%rdi)
cmovneq %r12, %r14
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x8899
movq %rsi, %r15
movq %rax, (%rsp)
movq 0x10(%r14), %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
movq (%rbp,%rbx,8), %rdi
movq %r15, %rsi
callq 0x3470
testl %eax, %eax
je 0x888d
incq %rbx
cmpq %rbx, %r13
jne 0x8872
jmp 0x8895
movq 0x18(%r14), %rax
movq (%rax,%rbx,8), %r12
movq (%rsp), %rax
testq %r12, %r12
je 0x88ac
cmpl $0x5, (%r12)
jne 0x88ac
cvttsd2si 0x8(%r12), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteNodeArray(t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*, int const*)
static bool WriteNodeArray(BinarySegment* top_seg, BinarySegment* data_seg, const JsonArrayValue* ints, const int32_t remap_table[])
{
  BinarySegmentWriteInt32(top_seg, (int) ints->m_Count);
  BinarySegmentWritePointer(top_seg, BinarySegmentPosition(data_seg));

  for (size_t i = 0, count = ints->m_Count; i < count; ++i)
  {
    if (const JsonNumberValue* num = ints->m_Values[i]->AsNumber())
    {
      int index = remap_table[(int) num->m_Number];
      BinarySegmentWriteInt32(data_seg, index);
    }
    else
      return false;
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x8(%rdx), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
callq 0x13b75
movq %r15, %rdi
callq 0x13bed
movq %r12, %rdi
movl %eax, %esi
callq 0x13ba1
movq 0x8(%r14), %r13
testq %r13, %r13
sete %al
je 0x8955
movq 0x10(%r14), %rcx
movq (%rcx), %rcx
cmpl $0x5, (%rcx)
jne 0x8955
movl $0x1, %eax
movq %rsp, %r12
cvttsd2si 0x8(%rcx), %ecx
movq %rax, %rbp
movslq %ecx, %rax
movl (%rbx,%rax,4), %eax
movl %eax, (%rsp)
movl $0x4, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x13b75
cmpq %rbp, %r13
je 0x894f
movq 0x10(%r14), %rax
movq (%rax,%rbp,8), %rcx
leaq 0x1(%rbp), %rax
cmpl $0x5, (%rcx)
je 0x8918
cmpq %r13, %rbp
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GetBoolean(t2::JsonObjectValue const*, char const*)
static bool GetBoolean(const JsonObjectValue* obj, const char* name)
{
  if (const JsonValue* val = obj->Find(name))
  {
    if (const JsonBooleanValue* b = val->AsBoolean())
    {
      return b->m_Boolean;
    }
  }

  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
cmpl $0x2, (%rdi)
cmovneq %r15, %rbx
movq 0x8(%rbx), %r12
testq %r12, %r12
je 0x89b4
movq %rsi, %r14
movq 0x10(%rbx), %r13
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%r13,%rbp,8), %rdi
movq %r14, %rsi
callq 0x3470
testl %eax, %eax
je 0x89ac
incq %rbp
cmpq %rbp, %r12
jne 0x8991
jmp 0x89b4
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %r15
testq %r15, %r15
je 0x89c5
cmpl $0x1, (%r15)
jne 0x89c5
movb 0x4(%r15), %al
jmp 0x89c7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteFileArray(t2::BinarySegment*, t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*)
static bool WriteFileArray(
    BinarySegment* seg,
    BinarySegment* ptr_seg,
    BinarySegment* str_seg,
    const JsonArrayValue* files)
{
  if (!files || 0 == files->m_Count)
  {
    BinarySegmentWriteInt32(seg, 0);
    BinarySegmentWriteNullPointer(seg);
    return true;
  }

  BinarySegmentWriteInt32(seg, (int) files->m_Count);
  BinarySegmentWritePointer(seg, BinarySegmentPosition(ptr_seg));

  for (size_t i = 0, count = files->m_Count; i < count; ++i)
  {
    const JsonStringValue *path = files->m_Values[i]->AsString();
    if (!path)
      return false;

    PathBuffer pathbuf;
    PathInit(&pathbuf, path->m_String);

    char cleaned_path[kMaxPathLength];
    PathFormat(cleaned_path, &pathbuf);

    WriteStringPtr(ptr_seg, str_seg, cleaned_path);
    BinarySegmentWriteUint32(ptr_seg, Djb2HashPath(cleaned_path));
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdx, 0x8(%rsp)
movq %rdi, %r12
testq %rcx, %rcx
je 0x8abf
movq %rcx, %rbx
movq 0x8(%rcx), %rax
testq %rax, %rax
je 0x8abf
movq %rsi, %r15
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %r12, %rdi
callq 0x13b75
movq %r15, %rdi
callq 0x13bed
movq %r12, %rdi
movl %eax, %esi
callq 0x13ba1
movq 0x8(%rbx), %rbp
testq %rbp, %rbp
je 0x8aec
movq 0x10(%rbx), %rax
movq (%rax), %rax
cmpl $0x4, (%rax)
jne 0x8aec
movl $0x1, %r14d
leaq 0x14(%rsp), %r12
leaq 0x2a0(%rsp), %r13
movq 0x8(%rax), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0xf1ec
movq %r13, %rdi
movq %r12, %rsi
callq 0xf56a
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x8645
movq %r13, %rdi
callq 0x5df8
movl %eax, 0x4(%rsp)
movl $0x4, %edx
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0x13b75
cmpq %r14, %rbp
je 0x8aec
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rax
incq %r14
cmpl $0x4, (%rax)
je 0x8a61
jmp 0x8aec
xorl %ebp, %ebp
leaq 0x14(%rsp), %rbx
movl %ebp, (%rbx)
movl $0x4, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x13b75
movl %ebp, (%rbx)
leaq 0x14(%rsp), %rsi
movl $0x4, %edx
movq %r12, %rdi
callq 0x13b75
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GetNodeFlag(t2::JsonObjectValue const*, char const*, unsigned int)
static uint32_t GetNodeFlag(const JsonObjectValue* node, const char* name, uint32_t value)
{
  uint32_t result = 0;

  if (const JsonValue* val = node->Find(name))
  {
    if (const JsonBooleanValue* flag = val->AsBoolean())
    {
      if (flag->m_Boolean)
        result = value;
    }
  }

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %eax, %eax
cmpl $0x2, (%rdi)
cmovneq %rax, %r14
movq 0x8(%r14), %r13
movl $0x0, %r12d
testq %r13, %r13
je 0x8b5d
movq %rsi, %r15
movl %edx, 0x4(%rsp)
movq 0x10(%r14), %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
movq (%rbp,%rbx,8), %rdi
movq %r15, %rsi
callq 0x3470
testl %eax, %eax
je 0x8b4f
incq %rbx
cmpq %rbx, %r13
jne 0x8b34
jmp 0x8b57
movq 0x18(%r14), %rax
movq (%rax,%rbx,8), %r12
xorl %eax, %eax
movl 0x4(%rsp), %edx
testq %r12, %r12
je 0x8b74
cmpl $0x1, (%r12)
jne 0x8b74
xorl %eax, %eax
cmpb $0x0, 0x4(%r12)
cmovnel %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Buffer.hpp
// Function: int* t2::BufferAlloc<int>(t2::Buffer<int>*, t2::MemAllocHeap*, unsigned long)
T* BufferAlloc(Buffer<T>* buffer, MemAllocHeap* heap, size_t count)
  {
    T            *storage  = buffer->m_Storage;
    const size_t  old_size = buffer->m_Size;
    const size_t  capacity = buffer->m_Capacity;

    if (old_size + count > capacity)
    {
      size_t new_capacity = capacity ? capacity *2 : 8;

      if (new_capacity < old_size + count)
        new_capacity = old_size + count;

      storage           = (T*) HeapReallocate(heap, storage, sizeof(T) *new_capacity);
      buffer->m_Storage  = storage;
      buffer->m_Capacity = new_capacity;
    }

    buffer->m_Size = old_size + count;
    return storage + old_size;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %r15
movq 0x10(%rdi), %rcx
addq %r15, %rbx
cmpq %rcx, %rbx
jbe 0x8c14
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x8, %r12d
cmovneq %rdx, %r12
cmpq %rbx, %r12
cmovbeq %rbx, %r12
leaq (,%r12,4), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0xef72
movq %rax, (%r14)
movq %r12, 0x10(%r14)
movq %rbx, 0x8(%r14)
leaq (%rax,%r15,4), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/HashTable.hpp
// Function: int t2::HashTableBaseLookup<0u>(t2::HashTableBase<0u>*, unsigned int, char const*)
int HashTableBaseLookup(HashTableBase<kFlags>* self, uint32_t hash, const char* string)
  {
    uint32_t size = self->m_TableSize;

    if (0 == size)
    {
      return -1;
    }

    int (*compare_fn)(const char* l, const char* r);

    if (kFlags & kFlagCaseInsensitive)
    {
      compare_fn = FastCompareNoCase;
    }
    else
    {
      compare_fn = strcmp;
    }

    const uint32_t* hashes = self->m_Hashes;
    const char* const* strings = self->m_Strings;

    uint32_t index = hash & (size - 1);

    for (;;)
    {
      uint32_t candidate_hash = hashes[index];

      if (!candidate_hash)
        return -1;

      if (hash == candidate_hash)
      {
        const char* candidate_string = strings[index];
        if (candidate_string == string || compare_fn(candidate_string, string) == 0)
        {
          return index;
        }
      }

      index = (index + 1) & (size - 1);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x10(%rdi), %r15d
testl %r15d, %r15d
je 0x8d08
movq %rdx, %rbx
movl %esi, %ebp
movq (%rdi), %r12
movq 0x8(%rdi), %rax
movq %rax, (%rsp)
decl %r15d
movl %r15d, %r14d
andl %esi, %r14d
movl %r14d, %eax
movl (%r12,%rax,4), %ecx
testl %ecx, %ecx
je 0x8ce5
cmpl %ebp, %ecx
jne 0x8cf6
movq (%rsp), %rcx
movq (%rcx,%rax,8), %rdi
cmpq %rbx, %rdi
je 0x8ced
movq %rbx, %rsi
callq 0x3470
testl %eax, %eax
setne %al
cmovel %r14d, %r13d
jmp 0x8cf2
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x8d00
xorl %eax, %eax
movl %r14d, %r13d
testb %al, %al
je 0x8d00
incl %r14d
andl %r15d, %r14d
movb $0x1, %al
jmp 0x8d02
xorl %eax, %eax
testb %al, %al
jne 0x8cb6
jmp 0x8d0e
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/HashTable.hpp
// Function: int t2::HashTableBaseInsert<t2::HashTable<t2::CommonStringRecord, 0u>>(t2::HashTable<t2::CommonStringRecord, 0u>*, unsigned int, char const*)
int HashTableBaseInsert(TableType* self, uint32_t hash, const char* string)
  {
    uint32_t record_count = self->m_RecordCount;
    uint32_t table_size = self->m_TableSize;
    uint64_t load = 0x100 * uint64_t(record_count + 1) >> uint64_t(self->m_TableSizeShift);

    if (load > 0x050)
    {
      HashTableGrow(self);
      table_size = self->m_TableSize;
    }

    uint32_t index = hash & (table_size - 1);

    uint32_t* hashes = self->m_Hashes;

    while (hashes[index] != 0)
    {
      index = (index + 1) & (table_size - 1);
    }

    hashes[index] = hash;
    self->m_Strings[index] = string;
    self->m_RecordCount = record_count + 1;

    return index;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl 0x18(%rdi), %r15d
incl %r15d
movq %r15, %rax
shlq $0x8, %rax
movb 0x14(%rdi), %cl
shrq %cl, %rax
cmpq $0x51, %rax
jb 0x8d51
movq %r14, %rdi
callq 0x8d84
movl 0x10(%r14), %edx
decl %edx
movl %edx, %eax
andl %ebp, %eax
movq (%r14), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x8d6a
incl %eax
andl %edx, %eax
jmp 0x8d5e
movl %ebp, (%rcx,%rax,4)
movq 0x8(%r14), %rcx
movq %rbx, (%rcx,%rax,8)
movl %r15d, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq