LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::Prepend(char const*, unsigned long)
void Prepend(const char* data, size_t len)
  {
    Grow(len);

    char   *buffer = GetBuffer();
    size_t  buflen = GetSize();

    memmove(buffer + len, buffer, buflen - len);
    memcpy(buffer, data, len);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq -0x18(%rbp), %rsi
callq 0x96e0
movq -0x30(%rbp), %rdi
callq 0x8ba0
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x8be0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
addq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
subq -0x18(%rbp), %rdx
callq 0x6780
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x63c0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::AppendUnless(char const*, unsigned long)
void AppendUnless(const char* data, size_t data_len)
  {
    size_t len = GetSize();
    char* buf = GetBuffer();

    if (len < data_len || 0 != memcmp(buf + len - data_len, data, data_len))
    {
      Append(data, data_len);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
callq 0x8be0
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x8ba0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jb 0x91b2
movq -0x28(%rbp), %rdi
addq -0x20(%rbp), %rdi
xorl %eax, %eax
subq -0x18(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x6230
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x91c3
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x90b0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::ToForwardSlashes()
void ToForwardSlashes()
  {
    size_t len = GetSize();
    char* buf = GetBuffer();
    for (size_t i = 0; i < len; ++i)
    {
      if (buf[i] == '\\')
        buf[i] = '/';
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8be0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x9239
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x9229
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb $0x2f, (%rax,%rcx)
jmp 0x922b
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x9202
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::ToUppercase()
void ToUppercase()
  {
    size_t len = GetSize();
    char* buf = GetBuffer();
    for (size_t i = 0; i < len; ++i)
    {
      buf[i] = (char) toupper(buf[i]);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8be0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x9318
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x6840
movb %al, %dl
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x92e2
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::ToLowercase()
void ToLowercase()
  {
    size_t len = GetSize();
    char* buf = GetBuffer();
    for (size_t i = 0; i < len; ++i)
    {
      buf[i] = (char) tolower(buf[i]);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8be0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x9388
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x6660
movb %al, %dl
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x9352
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::DropSuffix()
void DropSuffix()
  {
    size_t len = GetSize();
    char* buf = GetBuffer();
    for (int i = (int) len - 1; i >= 0; --i)
    {
      if ('.' == buf[i])
      {
        Shrink(i);
        break;
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8be0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x93fb
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movl $0x2e, %eax
cmpl %ecx, %eax
jne 0x93ee
movq -0x28(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x98d0
jmp 0x93fb
jmp 0x93f0
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x93c4
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::GetFilename()
void GetFilename()
  {
    size_t len = GetSize();
    char* buf = GetBuffer();
    for (int i = (int) len - 1; i >= 0; --i)
    {
      if ('/' == buf[i] || '\\' == buf[i])
      {
        int target_len = int(len - i - 1);
        memmove(buf, buf + i + 1, target_len);
        Shrink(target_len);
        break;
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8be0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x94be
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movl $0x2f, %eax
cmpl %ecx, %eax
je 0x9474
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
movl $0x5c, %eax
cmpl %ecx, %eax
jne 0x94b1
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
subq %rcx, %rax
subq $0x1, %rax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rax
addq %rax, %rsi
addq $0x1, %rsi
movslq -0x20(%rbp), %rdx
callq 0x6780
movq -0x28(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x98d0
jmp 0x94be
jmp 0x94b3
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x9444
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::Quote()
void Quote()
  {
    // Avoid double quoting.
    {
      char* data = GetBuffer();
      const size_t orig_len = GetSize();

      if (orig_len > 0 && data[0] == '"' && data[orig_len-1] == '"')
      {
        // Already quoted. Make sure it doesn't end in a backslash.
        if (orig_len > 1 && data[orig_len-2] == '\\')
        {
          Shrink(orig_len - 1);
          size_t len = orig_len - 1;

          data = GetBuffer();
          data[len-1] = '"';
        }
        return;
      }
    }

    PrepQuoteCommon();
    Prepend("\"", 1);
    Append("\"", 1);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x8ba0
movq -0x28(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8be0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jbe 0x960a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x960a
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x22, %eax
jne 0x960a
cmpq $0x1, -0x18(%rbp)
jbe 0x9608
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x2, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x9608
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
subq $0x1, %rsi
callq 0x98d0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
callq 0x8ba0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movb $0x22, (%rax,%rcx)
jmp 0x963d
movq -0x28(%rbp), %rdi
callq 0x9920
movq -0x28(%rbp), %rdi
leaq 0x46bb6(%rip), %rsi     # 0x501d4
movl $0x1, %edx
callq 0x9040
movq -0x28(%rbp), %rdi
leaq 0x46ba1(%rip), %rsi     # 0x501d4
movl $0x1, %edx
callq 0x90b0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::Grow(unsigned long)
char* Grow(size_t len)
  {
    if (m_Buffer.m_Size)
    {
      return BufferAlloc(&m_Buffer, m_Heap, len);
    }
    else if (len + m_InternalBufferUsed <= kInternalBufferSize)
    {
      size_t offset = m_InternalBufferUsed;
      m_InternalBufferUsed += len;
      return m_InternalBuffer + offset;
    } 
    else
    {
      BufferAppend(&m_Buffer, m_Heap, m_InternalBuffer, m_InternalBufferUsed);
      return BufferAlloc(&m_Buffer, m_Heap, len);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x58(%rax)
je 0x971c
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x50, %rdi
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x97a0
movq %rax, -0x8(%rbp)
jmp 0x978d
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
addq 0x8(%rcx), %rax
cmpq $0x40, %rax
ja 0x9754
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rcx
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
addq $0x10, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x978d
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x50, %rdi
movq (%rax), %rsi
movq %rax, %rdx
addq $0x10, %rdx
movq 0x8(%rax), %rcx
callq 0x9880
movq -0x28(%rbp), %rax
movq %rax, %rdi
addq $0x50, %rdi
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x97a0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::Shrink(unsigned long)
void Shrink(size_t size)
  {
    CHECK(size <= GetSize());
    if (m_Buffer.m_Size)
    {
      m_Buffer.m_Size = size;
    }
    else
    {
      CHECK(size <= kInternalBufferSize);
      m_InternalBufferUsed = size;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x98e6
movq -0x18(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x98ff
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x58(%rax)
jmp 0x990f
jmp 0x9901
jmp 0x9903
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::PrepQuoteCommon()
void PrepQuoteCommon()
  {
    // Drop trailing backslash - can't be escaped on windows
    {
      size_t len = GetSize();
      char* buf = GetBuffer();
      if (len > 0 && buf[len - 1] == '\\')
        Shrink(len - 1);
    }

    size_t bs_count = 0;
    {
      size_t len = GetSize();
      char* buf = GetBuffer();

      for (size_t i = 0; i < len; ++i)
      {
        if (buf[i] == '\\')
          ++bs_count;
      }
    }

    if (bs_count > 0)
    {
      size_t orig_len = GetSize();
      Grow(bs_count);
      char* data = GetBuffer();
      memmove(data + bs_count, data, orig_len);

      size_t r = bs_count;
      size_t w = 0;
      while (r < orig_len + bs_count)
      {
        char ch = data[r++];
        data[w++] = ch;

        if (ch == '\\')
        {
          data[w++] = '\\';
        }
      }
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x8be0
movq -0x68(%rbp), %rdi
movq %rax, -0x10(%rbp)
callq 0x8ba0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0x9977
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x9977
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rsi
subq $0x1, %rsi
callq 0x98d0
movq -0x68(%rbp), %rdi
movq $0x0, -0x20(%rbp)
callq 0x8be0
movq -0x68(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x8ba0
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x99d8
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x99c8
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x99ca
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x99a1
cmpq $0x0, -0x20(%rbp)
jbe 0x9a96
movq -0x68(%rbp), %rdi
callq 0x8be0
movq -0x68(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rsi
callq 0x96e0
movq -0x68(%rbp), %rdi
callq 0x8ba0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
addq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x6780
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0x40(%rbp), %rcx
addq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jae 0x9a94
movq -0x48(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x50(%rbp)
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %dl
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x58(%rbp)
movb %dl, (%rax,%rcx)
movsbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
jne 0x9a92
movq -0x48(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
movb $0x5c, (%rax,%rcx)
jmp 0x9a2f
jmp 0x9a96
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonNativeOpen(lua_State*)
void LuaJsonNativeOpen(lua_State* L)
{
  static luaL_Reg functions[] =
  {
    { "new",                        LuaJsonWriterNew },
    { nullptr,                      nullptr }
  };

  static luaL_Reg meta_table[] =
  {
    { "write_number",               LuaJsonWriteNumber },
    { "write_string",               LuaJsonWriteString },
    { "write_bool",                 LuaJsonWriteBool },
    { "begin_object",               LuaJsonBeginObject },
    { "end_object",                 LuaJsonEndObject },
    { "begin_array",                LuaJsonBeginArray },
    { "end_array",                  LuaJsonEndArray },
    { "close",                      LuaJsonGc },
    { "__gc",                       LuaJsonGc },
    { nullptr,                      nullptr }
  };

  luaL_register(L, "tundra.native.json", functions);
  lua_pop(L, 1);

  luaL_newmetatable(L, "tundra_jsonw");
  lua_pushvalue(L, -1);
  lua_setfield(L, -2, "__index");
  luaL_register(L, nullptr, meta_table);
  lua_pop(L, 1);

  s_EscapeTable[uint32_t('\n')] = 'n';
  s_EscapeTable[uint32_t('\r')] = 'r';
  s_EscapeTable[uint32_t('\t')] = 't';
  s_EscapeTable[uint32_t('\v')] = 'v';
  s_EscapeTable[uint32_t('\f')] = 'f';
  s_EscapeTable[uint32_t('\\')] = '\\';
  s_EscapeTable[uint32_t('"')] = '"';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x43ad5(%rip), %rsi     # 0x4d5fc
leaq 0x59972(%rip), %rdx     # 0x634a0
callq 0x2c850
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x29940
movq -0x8(%rbp), %rdi
leaq 0x43ac3(%rip), %rsi     # 0x4d60f
callq 0x2c380
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x29e10
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x43aad(%rip), %rdx     # 0x4d61c
callq 0x2b030
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x5993d(%rip), %rdx     # 0x634c0
callq 0x2c850
movq -0x8(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x29940
movb $0x6e, 0x59ced(%rip)    # 0x6388a
movb $0x72, 0x59ce9(%rip)    # 0x6388d
movb $0x74, 0x59cde(%rip)    # 0x63889
movb $0x76, 0x59cd9(%rip)    # 0x6388b
movb $0x66, 0x59cd3(%rip)    # 0x6388c
movb $0x5c, 0x59d1c(%rip)    # 0x638dc
movb $0x22, 0x59cdb(%rip)    # 0x638a2
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonWriterNew(lua_State*)
static int LuaJsonWriterNew(lua_State* L)
{
  const char* filename = luaL_checkstring(L, 1);
  LuaJsonWriter* self = (LuaJsonWriter*) lua_newuserdata(L, sizeof(LuaJsonWriter));

  memset(self, 0, sizeof *self);

  self->m_FirstElem = true;

  if (FILE* f = fopen(filename, "w"))
  {
    BufferedWriterInit(&self->m_Writer, f);

    luaL_getmetatable(L, "tundra_jsonw");
    lua_setmetatable(L, -2);
    return 1;
  }
  else
  {
    return luaL_error(L, "couldn't open %s for writing", filename);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2018, %esi           # imm = 0x2018
callq 0x2bbf0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x2018, %edx           # imm = 0x2018
callq 0x6290
movq -0x20(%rbp), %rax
movb $0x1, (%rax)
movq -0x18(%rbp), %rdi
leaq 0x4356e(%rip), %rsi     # 0x4d194
callq 0x6560
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9c73
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
callq 0x9fe0
movq -0x10(%rbp), %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
leaq 0x439b8(%rip), %rdx     # 0x4d60f
callq 0x2abe0
movq -0x10(%rbp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x2b270
movl $0x1, -0x4(%rbp)
jmp 0x9c8c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x439a2(%rip), %rsi     # 0x4d624
movb $0x0, %al
callq 0x2c000
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonWriteNumber(lua_State*)
static int LuaJsonWriteNumber(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  lua_Number num = luaL_checknumber(L, 2);
  WriteCommon(L, self, 3);

  char buffer[64];
  lua_number2str(buffer, num);
  BufferedWriterAppendString(&self->m_Writer, buffer);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x43953(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x2c5d0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x3, %edx
callq 0xa010
leaq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x4334b(%rip), %rsi     # 0x4d043
movb $0x0, %al
callq 0x60e0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
leaq -0x60(%rbp), %rsi
callq 0xa080
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonWriteString(lua_State*)
static int LuaJsonWriteString(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  size_t value_len;
  const char* value = lua_tolstring(L, 2, &value_len);
  WriteCommon(L, self, 3);
  WriteEscapedString(&self->m_Writer, value, value_len);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x438d3(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq -0x18(%rbp), %rdx
callq 0x2a310
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x3, %edx
callq 0xa010
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xa110
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonWriteBool(lua_State*)
static int LuaJsonWriteBool(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  int value = lua_toboolean(L, 2);
  WriteCommon(L, self, 3);
  BufferedWriterAppendString(&self->m_Writer, value ? "true" : "false");
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x43863(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x2a2b0
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x3, %edx
callq 0xa010
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl -0x14(%rbp), %ecx
leaq 0x4385c(%rip), %rsi     # 0x4d646
leaq 0x43850(%rip), %rax     # 0x4d641
cmpl $0x0, %ecx
cmovneq %rax, %rsi
callq 0xa080
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonBeginObject(lua_State*)
static int LuaJsonBeginObject(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  WriteCommon(L, self, 2);
  BufferedWriterAppend(&self->m_Writer, '{');
  self->m_FirstElem = true;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x437e3(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0xa010
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x7b, %esi
callq 0xa240
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonEndObject(lua_State*)
static int LuaJsonEndObject(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  BufferedWriterAppend(&self->m_Writer, '}');
  self->m_FirstElem = false;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x43783(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x7d, %esi
callq 0xa240
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonEndArray(lua_State*)
static int LuaJsonEndArray(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  BufferedWriterAppend(&self->m_Writer, ']');
  self->m_FirstElem = false;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x436d3(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x5d, %esi
callq 0xa240
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::LuaJsonGc(lua_State*)
static int LuaJsonGc(lua_State* L)
{
  LuaJsonWriter* self = (LuaJsonWriter*) luaL_checkudata(L, 1, "tundra_jsonw");
  if (FILE* f = self->m_Writer.m_File)
  {
    BufferedWriterFlush(&self->m_Writer);
    self->m_Writer.m_File = nullptr;
    fclose(f);
  }

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x43683(%rip), %rdx     # 0x4d60f
callq 0x2c410
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x2010(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x9fd0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0xa1c0
movq -0x10(%rbp), %rax
movq $0x0, 0x2010(%rax)
movq -0x18(%rbp), %rdi
callq 0x64b0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::WriteCommon(lua_State*, t2::LuaJsonWriter*, int)
static void WriteCommon(lua_State* L, LuaJsonWriter* self, int name_index)
{
  WriteComma(self);
  if (lua_gettop(L) >= name_index)
  {
    size_t len;
    const char* str = luaL_checklstring(L, name_index, &len);
    WriteEscapedString(&self->m_Writer, str, len);
    BufferedWriterAppend(&self->m_Writer, ':');
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa0d0
movq -0x8(%rbp), %rdi
callq 0x29910
cmpl -0x14(%rbp), %eax
jl 0xa075
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0x2c330
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xa110
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x3a, %esi
callq 0xa240
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::WriteEscapedString(t2::BufferedWriter*, char const*, unsigned long)
static void WriteEscapedString(BufferedWriter* w, const char* str, size_t len)
{
  BufferedWriterAppend(w, '"');

  for (size_t i = 0; i < len; ++i)
  {
    char ch = str[i];
    char escape_code = s_EscapeTable[(uint32_t) ch];

    if (escape_code)
    {
      BufferedWriterAppend(w, '\\');
      BufferedWriterAppend(w, escape_code);
    }
    else
    {
      BufferedWriterAppend(w, ch);
    }
  }

  BufferedWriterAppend(w, '"');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0xa240
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xa1a7
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x5971f(%rip), %rax     # 0x63880
movb (%rax,%rcx), %al
movb %al, -0x22(%rbp)
cmpb $0x0, -0x22(%rbp)
je 0xa18a
movq -0x8(%rbp), %rdi
movl $0x5c, %esi
callq 0xa240
movq -0x8(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0xa240
jmp 0xa197
movq -0x8(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0xa240
jmp 0xa199
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xa13a
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0xa240
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::BufferedWriterFlush(t2::BufferedWriter*)
static void BufferedWriterFlush(BufferedWriter* w)
{
  size_t remain = w->m_Used;
  const char* src = w->m_Buffer;
  while (remain)
  {
    size_t count = fwrite(src, 1, remain, w->m_File);
    src += count;
    remain -= count;
  }
  w->m_Used = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa228
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x2008(%rax), %rcx
movl $0x1, %esi
callq 0x68a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0xa1e3
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaJsonWriter.cpp
// Function: t2::BufferedWriterAppend(t2::BufferedWriter*, int)
inline void BufferedWriterAppend(BufferedWriter* w, int ch)
{
  size_t pos = w->m_Used;
  if (pos == ARRAY_SIZE(w->m_Buffer))
  {
    BufferedWriterFlush(w);
    pos = 0;
  }
  w->m_Buffer[pos] = (char) ch;
  w->m_Used = pos + 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x2000, -0x18(%rbp)    # imm = 0x2000
jne 0xa275
movq -0x8(%rbp), %rdi
callq 0xa1c0
movq $0x0, -0x18(%rbp)
movl -0xc(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, 0x8(%rax,%rcx)
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathSplit(lua_State*)
static int LuaPathSplit(lua_State* L)
{
  PathBuffer pbuf;
  PathInit(&pbuf, luaL_checkstring(L, 1));

  if (pbuf.m_SegCount > 1)
  {
    char dir[kMaxPathLength];
    char file[kMaxPathLength];
    PathFormatPartial(dir, &pbuf, 0, pbuf.m_SegCount-2);
    PathFormatPartial(file, &pbuf, pbuf.m_SegCount-1, pbuf.m_SegCount-1);
    lua_pushstring(L, dir);
    lua_pushstring(L, file);
  }
  else
  {
    char file[kMaxPathLength];
    PathFormat(file, &pbuf);
    lua_pushstring(L, ".");
    lua_pushstring(L, file);
  }
  return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8a0, %rsp            # imm = 0x8A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, %rsi
leaq -0x294(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
movzwl -0x28e(%rbp), %eax
cmpl $0x1, %eax
jle 0xa386
movzwl -0x28e(%rbp), %ecx
subl $0x2, %ecx
leaq -0x4a0(%rbp), %rdi
leaq -0x294(%rbp), %rsi
xorl %edx, %edx
callq 0xd900
movzwl -0x28e(%rbp), %edx
subl $0x1, %edx
movzwl -0x28e(%rbp), %ecx
subl $0x1, %ecx
leaq -0x6a0(%rbp), %rdi
leaq -0x294(%rbp), %rsi
callq 0xd900
movq -0x8(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x2a7a0
movq -0x8(%rbp), %rdi
leaq -0x6a0(%rbp), %rsi
callq 0x2a7a0
jmp 0xa3b9
leaq -0x8a0(%rbp), %rdi
leaq -0x294(%rbp), %rsi
callq 0xd8d0
movq -0x8(%rbp), %rdi
leaq 0x47187(%rip), %rsi     # 0x5152b
callq 0x2a7a0
movq -0x8(%rbp), %rdi
leaq -0x8a0(%rbp), %rsi
callq 0x2a7a0
movl $0x2, %eax
addq $0x8a0, %rsp            # imm = 0x8A0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathNormalize(lua_State*)
static int LuaPathNormalize(lua_State* L)
{
  size_t input_len;
  const char* input = luaL_checklstring(L, 1, &input_len);

  PathBuffer buf;
  PathInit(&buf, input);

  char fmt[kMaxPathLength];
  PathFormat(fmt, &buf);

  lua_pushstring(L, fmt);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq -0x10(%rbp), %rdx
callq 0x2c330
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x2a4(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
leaq -0x4b0(%rbp), %rdi
leaq -0x2a4(%rbp), %rsi
callq 0xd8d0
movq -0x8(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x2a7a0
movl $0x1, %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathJoin(lua_State*)
static int LuaPathJoin(lua_State* L)
{
  const char* p1 = luaL_checkstring(L, 1);
  const char* p2 = luaL_checkstring(L, 2);

  PathBuffer buf;
  PathInit(&buf, p1);
  PathConcat(&buf, p2);

  char fmt[kMaxPathLength];
  PathFormat(fmt, &buf);

  lua_pushstring(L, fmt);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x2a4(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
movq -0x18(%rbp), %rsi
leaq -0x2a4(%rbp), %rdi
callq 0xd6e0
leaq -0x4b0(%rbp), %rdi
leaq -0x2a4(%rbp), %rsi
callq 0xd8d0
movq -0x8(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x2a7a0
movl $0x1, %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathGetFilenameDir(lua_State*)
static int LuaPathGetFilenameDir(lua_State* L)
{
  const char* path = luaL_checkstring(L, 1);

  PathBuffer buf;
  PathInit(&buf, path);
  if (PathStripLast(&buf))
  {
    char fmt[kMaxPathLength];
    PathFormat(fmt, &buf);
    lua_pushstring(L, fmt);
    return 1;
  }
  else
  {
    lua_pushstring(L, ".");
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x2a4(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
leaq -0x2a4(%rbp), %rdi
callq 0xd680
testb $0x1, %al
jne 0xa519
jmp 0xa545
leaq -0x4b0(%rbp), %rdi
leaq -0x2a4(%rbp), %rsi
callq 0xd8d0
movq -0x10(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
callq 0x2a7a0
movl $0x1, -0x4(%rbp)
jmp 0xa55c
movq -0x10(%rbp), %rdi
leaq 0x46fdb(%rip), %rsi     # 0x5152b
callq 0x2a7a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathGetFilename(lua_State*)
static int LuaPathGetFilename(lua_State* L)
{
  PathBuffer pbuf;
  PathInit(&pbuf, luaL_checkstring(L, 1));
  if (pbuf.m_SegCount > 0)
  {
    char buf[kMaxPathLength];
    PathFormatPartial(buf, &pbuf, pbuf.m_SegCount-1, pbuf.m_SegCount-1);
    lua_pushstring(L, buf);
  }
  else
  {
    lua_pushstring(L, "");
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, %rsi
leaq -0x294(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
movzwl -0x28e(%rbp), %eax
cmpl $0x0, %eax
jle 0xa5e7
movzwl -0x28e(%rbp), %edx
subl $0x1, %edx
movzwl -0x28e(%rbp), %ecx
subl $0x1, %ecx
leaq -0x4a0(%rbp), %rdi
leaq -0x294(%rbp), %rsi
callq 0xd900
movq -0x8(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x2a7a0
jmp 0xa5f7
movq -0x8(%rbp), %rdi
leaq 0x459d8(%rip), %rsi     # 0x4ffca
callq 0x2a7a0
movl $0x1, %eax
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathGetExtension(lua_State*)
static int LuaPathGetExtension(lua_State* L)
{
  const char* input = luaL_checkstring(L, 1);
  
  // Make sure to look at the last path segment only.
  if (const char* pslash = strrchr(input, '/'))
  {
    input = pslash;
  }

  if (const char* pslash = strrchr(input, '\\'))
  {
    if (pslash > input)
      input = pslash;
  }

  if (const char* dot = strrchr(input, '.'))
    lua_pushstring(L, dot);
  else
    lua_pushstring(L, "");
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x6500
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa653
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x5c, %esi
callq 0x6500
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xa680
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0xa67e
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xa680
movq -0x10(%rbp), %rdi
movl $0x2e, %esi
callq 0x6500
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa6a8
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2a7a0
jmp 0xa6b8
movq -0x8(%rbp), %rdi
leaq 0x45917(%rip), %rsi     # 0x4ffca
callq 0x2a7a0
movl $0x1, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathDropSuffix(lua_State*)
static int LuaPathDropSuffix(lua_State* L)
{
  const char* input = luaL_checkstring(L, 1);
  if (const char* dot = strrchr(input, '.'))
    lua_pushlstring(L, input, size_t(dot - input));
  else
    lua_pushvalue(L, 1);
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2e, %esi
callq 0x6500
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa725
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
callq 0x2a720
jmp 0xa733
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x29e10
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathGetFilenameBase(lua_State*)
static int LuaPathGetFilenameBase(lua_State* L)
{
  PathBuffer pbuf;
  PathInit(&pbuf, luaL_checkstring(L, 1));
  if (pbuf.m_SegCount > 0)
  {
    char buf[kMaxPathLength];
    PathFormatPartial(buf, &pbuf, pbuf.m_SegCount-1, pbuf.m_SegCount-1);
    if (char* dot = strrchr(buf, '.'))
      *dot = '\0';
    lua_pushstring(L, buf);
  }
  else
  {
    lua_pushstring(L, "");
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2c330
movq %rax, %rsi
leaq -0x294(%rbp), %rdi
xorl %edx, %edx
callq 0xd180
movzwl -0x28e(%rbp), %eax
cmpl $0x0, %eax
jle 0xa7e3
movzwl -0x28e(%rbp), %edx
subl $0x1, %edx
movzwl -0x28e(%rbp), %ecx
subl $0x1, %ecx
leaq -0x4a0(%rbp), %rdi
leaq -0x294(%rbp), %rsi
callq 0xd900
leaq -0x4a0(%rbp), %rdi
movl $0x2e, %esi
callq 0x6500
movq %rax, -0x4a8(%rbp)
cmpq $0x0, -0x4a8(%rbp)
je 0xa7d1
movq -0x4a8(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x2a7a0
jmp 0xa7f3
movq -0x8(%rbp), %rdi
leaq 0x457dc(%rip), %rsi     # 0x4ffca
callq 0x2a7a0
movl $0x1, %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::LuaProfilerInit(t2::MemAllocHeap*, t2::MemAllocLinear*, lua_State*)
void LuaProfilerInit(MemAllocHeap* heap, MemAllocLinear* alloc, lua_State* L)
{
  LuaProfilerState* self = &s_Profiler;

  memset(self, 0, sizeof *self);

  self->m_LuaState            = L;
  self->m_Heap                = heap;
  self->m_Allocator           = alloc;

  HashTableInit(&self->m_Functions, heap);

  RehashInvocationTable(1024);

  uint32_t toplevel_hash = Djb2Hash(s_TopLevelString);

  s_Profiler.m_CurrentInvocation = PushInvocation(&s_TopLevel, toplevel_hash);
  s_Profiler.m_CurrentInvocation->m_StartTick = TimerGet();

  // Install debug hook.
  lua_sethook(L, ProfilerLuaEvent, LUA_MASKCALL|LUA_MASKRET, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x590b5(%rip), %rax     # 0x63980
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x6290
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movq -0x8(%rbp), %rsi
callq 0xb1d0
movl $0x400, %edi            # imm = 0x400
callq 0xa980
leaq 0x42dbc(%rip), %rdi     # 0x4d6e0
callq 0xbd20
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
leaq 0x590aa(%rip), %rdi     # 0x639e0
callq 0xaa60
movq %rax, 0x59096(%rip)     # 0x639d8
callq 0xc1d0
movq %rax, %rcx
movq 0x59087(%rip), %rax     # 0x639d8
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rdi
leaq 0x280(%rip), %rsi       # 0xabe0
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x2d770
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::RehashInvocationTable(unsigned int)
static void RehashInvocationTable(uint32_t new_size)
{
  const uint32_t old_size = s_Profiler.m_InvocationTableSize;

  Invocation** new_table = HeapAllocateArrayZeroed<Invocation*>(s_Profiler.m_Heap, new_size);

  for (uint32_t i = 0; i < old_size; ++i)
  {
    Invocation* chain = s_Profiler.m_InvocationTable[i];
    while (chain)
    {
      Invocation* next = chain->m_Next;

      uint32_t new_index = chain->m_Hash & (new_size - 1);
      chain->m_Next = new_table[new_index];
      new_table[new_index] = chain;

      chain = next;
    }
  }

  HeapFree(s_Profiler.m_Heap, s_Profiler.m_InvocationTable);

  // Commit.
  s_Profiler.m_InvocationTable     = new_table;
  s_Profiler.m_InvocationTableSize = new_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl 0x5903b(%rip), %eax     # 0x639cc
movl %eax, -0x8(%rbp)
movq 0x58fed(%rip), %rdi     # 0x63988
movl -0x4(%rbp), %eax
movl %eax, %esi
callq 0xb250
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jae 0xaa27
movq 0x59011(%rip), %rax     # 0x639d0
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xaa1a
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xa9ca
jmp 0xaa1c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa9b0
movq 0x58f5a(%rip), %rdi     # 0x63988
movq 0x58f9b(%rip), %rsi     # 0x639d0
callq 0xcf00
movq -0x10(%rbp), %rax
movq %rax, 0x58f8b(%rip)     # 0x639d0
movl -0x4(%rbp), %eax
movl %eax, 0x58f7e(%rip)     # 0x639cc
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::ProfilerLuaEvent(lua_State*, lua_Debug*)
static void ProfilerLuaEvent(lua_State* L, lua_Debug* ar)
{
  Invocation* i = s_Profiler.m_CurrentInvocation;

  // Update the time for this leaf, which will now go away.
  const uint64_t now = TimerGet();
  i->m_Ticks += now - i->m_StartTick;

  if (LUA_HOOKCALL == ar->event)
  {
    // We're calling a new function.
    // Figure out what function it is.

    uint32_t hash;
    FunctionMeta* f = FindFunction(L, ar, &hash);

    s_Profiler.m_CurrentInvocation = PushInvocation(f, hash);
    s_Profiler.m_CurrentInvocation->m_CallCount += 1;
  }
  else
  {
    // We're returning to our parent.
    s_Profiler.m_CurrentInvocation = i->m_Parent;
  }

  // Start counting from here on out. This is the last thing we do, so time
  // spent inside this hook will not be counted.
  s_Profiler.m_CurrentInvocation->m_StartTick = TimerGet();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x58de1(%rip), %rax     # 0x639d8
movq %rax, -0x18(%rbp)
callq 0xc1d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
jne 0xac60
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0xaf20
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0xaa60
movq %rax, 0x58d8a(%rip)     # 0x639d8
movq 0x58d83(%rip), %rax     # 0x639d8
movl 0x18(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18(%rax)
jmp 0xac6f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x58d69(%rip)     # 0x639d8
callq 0xc1d0
movq %rax, %rcx
movq 0x58d5a(%rip), %rax     # 0x639d8
movq %rcx, 0x28(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::LuaProfilerDestroy()
void LuaProfilerDestroy()
{
  LuaProfilerState* self = &s_Profiler;

  lua_sethook(self->m_LuaState, nullptr, 0, 0);

  MemAllocHeap* heap = self->m_Heap;

  HeapFree(heap, self->m_InvocationTable);

  HashTableDestroy(&self->m_Functions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x58ce1(%rip), %rax     # 0x63980
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x2d770
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0xcf00
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
callq 0xb200
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::LuaProfilerReport()
void LuaProfilerReport()
{
  printf("Generating profiling report..\n");

  if (FILE* f = fopen("tundra.prof", "w"))
  {
    DumpReport(f);

    fclose(f);
  }
  else
  {
    fprintf(stderr, "Failed to write tundra.prof\n");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x429f4(%rip), %rdi     # 0x4d6f3
movb $0x0, %al
callq 0x6070
leaq 0x42a05(%rip), %rdi     # 0x4d712
leaq 0x42480(%rip), %rsi     # 0x4d194
callq 0x6560
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xad38
movq -0x8(%rbp), %rdi
callq 0xad60
movq -0x8(%rbp), %rdi
callq 0x64b0
jmp 0xad50
movq 0x58291(%rip), %rax     # 0x62fd0
movq (%rax), %rdi
leaq 0x429d5(%rip), %rsi     # 0x4d71e
movb $0x0, %al
callq 0x6630
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)