LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x58(%rdi), %rcx
movq %rcx, %rax
testq %rcx, %rcx
jne 0x89aa
movq 0x8(%r15), %rax
cmpq %rbx, %rax
jb 0x89d3
testq %rcx, %rcx
je 0x89ba
movq 0x50(%r15), %rdi
jmp 0x89be
leaq 0x10(%r15), %rdi
addq %rax, %rdi
subq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x64e0
testl %eax, %eax
je 0x89f1
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8c9a
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x63d0
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::StringBuffer::GetFilenameDir()
size_t GetSize()
  {
    if (size_t sz = m_Buffer.m_Size)
      return sz;
    else
      return m_InternalBufferUsed;
  }

// Assembly:
leaq 0x58(%rdi), %rax
movq 0x58(%rdi), %rdx
leaq 0x8(%rdi), %rcx
leaq 0x10(%rdi), %rsi
testq %rdx, %rdx
movq 0x8(%rdi), %r8
cmovneq %rdx, %r8
cmovneq 0x50(%rdi), %rsi
movl %r8d, %edi
testl %edi, %edi
jle 0x8b62
movzbl -0x1(%rsi,%rdi), %r8d
decq %rdi
cmpl $0x5c, %r8d
je 0x8b58
cmpl $0x2f, %r8d
jne 0x8b3f
testq %rdx, %rdx
cmoveq %rcx, %rax
movq %rdi, (%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rax
movq 0x58(%rdi), %rcx
testq %rcx, %rcx
cmoveq 0x8(%rdi), %rcx
leaq 0x10(%rdi), %rdi
cmovneq 0x50(%rax), %rdi
leaq 0x58(%rax), %r14
leaq 0x8(%rax), %r15
movl %ecx, %eax
movq $-0x1, %rbx
testl %eax, %eax
jle 0x8b15
movzbl -0x1(%rdi,%rax), %ecx
decq %rax
incq %rbx
cmpl $0x5c, %ecx
je 0x8afb
cmpl $0x2f, %ecx
jne 0x8ae2
leaq (%rdi,%rax), %rsi
incq %rsi
movq %rbx, %rdx
callq 0x67c0
cmpq $0x0, (%r14)
cmovneq %r14, %r15
movq %rbx, (%r15)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x50(%rdi), %rax
movq 0x58(%rdi), %rdx
leaq 0x10(%rdi), %r14
movq %rax, %rsi
movq %rdx, %rcx
testq %rdx, %rdx
jne 0x8b89
movq 0x8(%rbx), %rcx
movq %r14, %rsi
testq %rcx, %rcx
je 0x8bce
cmpb $0x22, (%rsi)
jne 0x8bce
cmpb $0x22, -0x1(%rsi,%rcx)
jne 0x8bce
cmpq $0x1, %rcx
je 0x8c17
cmpb $0x5c, -0x2(%rsi,%rcx)
jne 0x8c17
leaq 0x58(%rbx), %rsi
addq $0x8, %rbx
testq %rdx, %rdx
cmovneq %rsi, %rbx
leaq -0x1(%rcx), %rdx
movq %rdx, (%rbx)
cmpq $0x0, (%rsi)
cmoveq %r14, %rax
addq %rcx, %rax
addq $-0x2, %rax
jmp 0x8c14
movq %rbx, %rdi
callq 0x8d6e
movl $0x1, %esi
movq %rbx, %rdi
callq 0x8c9a
movq 0x58(%rbx), %rdx
testq %rdx, %rdx
cmovneq 0x50(%rbx), %r14
cmoveq 0x8(%rbx), %rdx
leaq 0x1(%r14), %rdi
decq %rdx
movq %r14, %rsi
callq 0x67c0
movb $0x22, (%r14)
movl $0x1, %esi
movq %rbx, %rdi
callq 0x8c9a
movb $0x22, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x50(%rdi), %r15
cmpq $0x0, 0x58(%rdi)
jne 0x8cf6
movq 0x8(%r14), %r12
leaq (%r12,%rbx), %rax
leaq 0x10(%r14), %r13
cmpq $0x40, %rax
ja 0x8cda
movq %rax, 0x8(%r14)
addq %r12, %r13
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%r14), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x8d0d
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x63d0
movq (%r14), %rsi
movq %r15, %rdi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8d0d
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x58(%rdi), %rcx
movq %rcx, %rdx
testq %rcx, %rcx
jne 0x8d89
movq 0x8(%r15), %rdx
leaq 0x58(%r15), %rdi
movq 0x50(%r15), %rax
leaq 0x8(%r15), %rsi
leaq 0x10(%r15), %rbx
testq %rdx, %rdx
je 0x8dc0
testq %rcx, %rcx
movq %rax, %r8
cmoveq %rbx, %r8
cmpb $0x5c, -0x1(%r8,%rdx)
jne 0x8dc0
decq %rdx
testq %rcx, %rcx
movq %rdi, %rcx
cmoveq %rsi, %rcx
movq %rdx, (%rcx)
movq (%rdi), %r14
testq %r14, %r14
jne 0x8dce
movq (%rsi), %r14
movq %rbx, %rax
xorl %r12d, %r12d
testq %r14, %r14
je 0x8dec
xorl %ecx, %ecx
xorl %edx, %edx
cmpb $0x5c, (%rax,%rcx)
sete %dl
addq %rdx, %r12
incq %rcx
cmpq %rcx, %r14
jne 0x8dd8
testq %r12, %r12
je 0x8e48
movq %r15, %rdi
movq %r12, %rsi
callq 0x8c9a
cmpq $0x0, 0x58(%r15)
je 0x8e07
movq 0x50(%r15), %rbx
leaq (%rbx,%r12), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x67c0
leaq (%r12,%r14), %rax
cmpq %rax, %r12
jae 0x8e48
xorl %eax, %eax
xorl %ecx, %ecx
movb (%r15,%rax), %dl
movb %dl, (%rbx,%rcx)
cmpb $0x5c, %dl
jne 0x8e3d
movb $0x5c, 0x1(%rbx,%rcx)
addq $0x2, %rcx
jmp 0x8e40
incq %rcx
incq %rax
cmpq %rax, %r14
jne 0x8e26
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r14
movl $0x2018, %esi           # imm = 0x2018
movq %rbx, %rdi
callq 0x1b82f
movq %rax, %r15
movl $0x2018, %edx           # imm = 0x2018
movq %rax, %rdi
xorl %esi, %esi
callq 0x62a0
movb $0x1, (%r15)
leaq 0x27260(%rip), %rsi     # 0x30194
movq %r14, %rdi
callq 0x6580
testq %rax, %rax
je 0x8f7c
movq $0x0, 0x8(%r15)
movq %rax, 0x2010(%r15)
leaq 0x275e5(%rip), %rdx     # 0x3053c
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x1b08b
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x1b38c
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x275ce(%rip), %rsi     # 0x30551
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1ba66
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x27594(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1be75
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x925a
leaq 0x27067(%rip), %rsi     # 0x30043
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6100
addq $0x8, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x92f1
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x27523(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %r14
movq %rsp, %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %r15, %rdx
callq 0x1ac32
movq %rax, %r12
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x925a
addq $0x8, %r14
movq (%r15), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x9336
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x274c2(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1ac0c
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x925a
addq $0x8, %r14
testl %ebp, %ebp
leaq 0x274c0(%rip), %rax     # 0x30573
leaq 0x274b4(%rip), %rsi     # 0x3056e
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0x92f1
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x27461(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
movl $0x2, %edx
callq 0x925a
movq 0x8(%rbx), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x9112
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x7b, 0x10(%rbx,%rax)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x1, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
leaq 0x27409(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %rbx
movq 0x8(%rax), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x915a
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x7d, 0x10(%rbx,%rax)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
leaq 0x27369(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq %rax, %rbx
movq 0x8(%rax), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x91fa
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x5d, 0x10(%rbx,%rax)
incq %rax
movq %rax, 0x8(%rbx)
movb $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
leaq 0x27324(%rip), %rdx     # 0x3053c
movl $0x1, %esi
callq 0x1bd5c
movq 0x2010(%rax), %rbx
testq %rbx, %rbx
je 0x9250
movq %rax, %r14
movq %rax, %rdi
addq $0x8, %rdi
callq 0x9401
movq $0x0, 0x2010(%r14)
movq %rbx, %rdi
callq 0x64c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x1, (%rsi)
jne 0x9273
movb $0x0, (%rbx)
jmp 0x9296
movq 0x8(%rbx), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x928a
leaq 0x8(%rbx), %rdi
callq 0x9401
xorl %eax, %eax
movb $0x2c, 0x10(%rbx,%rax)
incq %rax
movq %rax, 0x8(%rbx)
movq %r14, %rdi
callq 0x1a79d
cmpl %ebp, %eax
jl 0x92e6
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x1bcb3
leaq 0x8(%rbx), %r14
movq (%r15), %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x9336
movq 0x8(%rbx), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x92da
movq %r14, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x3a, 0x10(%rbx,%rax)
incq %rax
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x935f
movq %rbx, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x22, 0x8(%rbx,%rax)
incq %rax
movq %rax, (%rbx)
testq %r14, %r14
je 0x93d2
xorl %r12d, %r12d
leaq 0x39527(%rip), %r13     # 0x428a0
movsbq (%r15,%r12), %rcx
movl %ecx, %eax
movb (%rax,%r13), %bpl
movq (%rbx), %rax
testb %bpl, %bpl
je 0x93ab
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x939e
movq %rbx, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x5c, 0x8(%rbx,%rax)
incq %rax
movq %rax, (%rbx)
jmp 0x93ad
movl %ecx, %ebp
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x93bf
movq %rbx, %rdi
callq 0x9401
xorl %eax, %eax
movb %bpl, 0x8(%rbx,%rax)
incq %rax
movq %rax, (%rbx)
incq %r12
cmpq %r12, %r14
jne 0x9379
movq (%rbx), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x93e7
movq %rbx, %rdi
callq 0x9401
xorl %eax, %eax
movb $0x22, 0x8(%rbx,%rax)
incq %rax
movq %rax, (%rbx)
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/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x9434
leaq 0x8(%rbx), %r15
movq 0x2008(%rbx), %rcx
movl $0x1, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x68e0
addq %rax, %r15
subq %rax, %r14
jne 0x9415
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x698, %rsp            # imm = 0x698
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
movzwl 0x6(%r14), %ecx
cmpl $0x2, %ecx
jb 0x94ee
addl $-0x2, %ecx
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xb17b
movzwl 0x6(%r15), %ecx
decl %ecx
leaq 0x490(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movl %ecx, %edx
callq 0xb17b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae54
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x9518
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xb16e
leaq 0x2a991(%rip), %rsi     # 0x33e9b
movq %rbx, %rdi
callq 0x1ae54
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae54
movl $0x2, %eax
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
subq $0x4a0, %rsp            # imm = 0x4A0
movq %rdi, %rbx
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
callq 0x1bcb3
leaq 0x214(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xb16e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1ae54
movl $0x1, %eax
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r14
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r15
leaq 0x20c(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xadf0
movq %r12, %rdi
movq %r15, %rsi
callq 0xb050
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0xb16e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae54
movl $0x1, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
movq %r14, %rdi
callq 0xb030
testb %al, %al
je 0x9664
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xb16e
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x966e
leaq 0x2a830(%rip), %rsi     # 0x33e9b
movq %rbx, %rdi
callq 0x1ae54
movl $0x1, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
movzwl 0x6(%r14), %ecx
testl %ecx, %ecx
je 0x96d8
decl %ecx
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
movl %ecx, %edx
callq 0xb17b
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x96e2
leaq 0x293c3(%rip), %rsi     # 0x32aa2
movq %rbx, %rdi
callq 0x1ae54
movl $0x1, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r14
movq %rax, %rdi
movl $0x2f, %esi
callq 0x6520
testq %rax, %rax
cmovneq %rax, %r14
movq %r14, %rdi
movl $0x5c, %esi
callq 0x6520
cmpq %r14, %rax
cmovaq %rax, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x6520
testq %rax, %rax
leaq 0x29356(%rip), %rsi     # 0x32aa2
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x1ae54
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r14
movq %rax, %rdi
movl $0x2e, %esi
callq 0x6520
testq %rax, %rax
je 0x97a0
subq %r14, %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1adfd
jmp 0x97ad
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1a9d8
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
leaq 0x20c(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
movzwl 0x6(%r14), %ecx
testl %ecx, %ecx
je 0x9822
decl %ecx
movq %rsp, %r14
leaq 0x20c(%rsp), %rsi
movq %r14, %rdi
movl %ecx, %edx
callq 0xb17b
movq %r14, %rdi
movl $0x2e, %esi
callq 0x6520
testq %rax, %rax
je 0x981d
movb $0x0, (%rax)
movq %rsp, %rsi
jmp 0x9829
leaq 0x29279(%rip), %rsi     # 0x32aa2
movq %rbx, %rdi
callq 0x1ae54
movl $0x1, %eax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/LuaPath.cpp
// Function: t2::LuaPathIsAbsolute(lua_State*)
static int LuaPathIsAbsolute(lua_State* L)
{
  PathBuffer pbuf;
  PathInit(&pbuf, luaL_checkstring(L, 1));
  lua_pushboolean(L, PathIsAbsolute(&pbuf) ? 1 : 0);
  return 1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xadf0
movzwl 0x4(%r14), %esi
andl $0x1, %esi
movq %rbx, %rdi
callq 0x1b019
movl $0x1, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdx, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x39106(%rip)    # 0x429a0
movups %xmm0, 0x3910f(%rip)    # 0x429b0
movups %xmm0, 0x39118(%rip)    # 0x429c0
movups %xmm0, 0x39121(%rip)    # 0x429d0
movups %xmm0, 0x3912a(%rip)    # 0x429e0
movups %xmm0, 0x39133(%rip)    # 0x429f0
movq %rdx, 0x390dc(%rip)     # 0x429a0
movq %rdi, 0x390dd(%rip)     # 0x429a8
movq %rsi, 0x390de(%rip)     # 0x429b0
movups %xmm0, 0x390df(%rip)    # 0x429b8
movups %xmm0, 0x390e4(%rip)    # 0x429c4
movq %rdi, 0x390f1(%rip)     # 0x429d8
movq $0x0, 0x390ee(%rip) # 0x429e0
movl $0x400, %edi            # imm = 0x400
callq 0x9944
leaq 0x26cfd(%rip), %rdi     # 0x30600
callq 0xa31c
leaq 0x390f1(%rip), %rdi     # 0x42a00
movl %eax, %esi
callq 0x99e9
movq %rax, 0x390db(%rip)     # 0x429f8
callq 0xa5ca
movq 0x390cf(%rip), %rcx     # 0x429f8
movq %rax, 0x28(%rcx)
leaq 0x1b8(%rip), %rsi       # 0x9aec
movq %rbx, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
popq %rbx
jmp 0x1c9f0
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl 0x39097(%rip), %r12d    # 0x429ec
movq 0x3904c(%rip), %rdi     # 0x429a8
movl %ebx, %esi
leaq (,%rsi,8), %r15
shlq $0x6, %rsi
callq 0xacde
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x62a0
testq %r12, %r12
je 0x99bd
leal -0x1(%rbx), %eax
xorl %ecx, %ecx
movq 0x39060(%rip), %rdx     # 0x429f0
movq (%rdx,%rcx,8), %rdx
testq %rdx, %rdx
je 0x99b5
movq 0x30(%rdx), %rsi
movl (%rdx), %edi
andl %eax, %edi
movq (%r14,%rdi,8), %r8
movq %r8, 0x30(%rdx)
movq %rdx, (%r14,%rdi,8)
movq %rsi, %rdx
testq %rsi, %rsi
jne 0x9999
incq %rcx
cmpq %r12, %rcx
jne 0x9989
movq 0x38fe4(%rip), %rdi     # 0x429a8
movq 0x39025(%rip), %rsi     # 0x429f0
callq 0xace6
movq %r14, 0x39019(%rip)     # 0x429f0
movl %ebx, 0x3900f(%rip)     # 0x429ec
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/LuaProfiler.cpp
// Function: t2::PushInvocation(t2::FunctionMeta*, unsigned int)
static Invocation* PushInvocation(FunctionMeta* f, uint32_t hash)
{
  Invocation* parent = s_Profiler.m_CurrentInvocation;
  if (parent)
    hash ^= parent->m_Hash;

  uint32_t index = hash & (s_Profiler.m_InvocationTableSize - 1);

  Invocation* chain = s_Profiler.m_InvocationTable[index];
  while (chain)
  {
    if (chain->m_Hash == hash && chain->m_Function == f && MatchInvocation(chain->m_Parent, s_Profiler.m_CurrentInvocation))
    {
      return chain;
    }

    chain = chain->m_Next;
  }

  // Create a new invocation.

  // See if we need to rehash.
  if (double(s_Profiler.m_InvocationCount + 1) / double(s_Profiler.m_InvocationTableSize) > 0.75)
  {
    RehashInvocationTable(s_Profiler.m_InvocationTableSize * 2);
  }

  // Recompute insertion index.
  index = hash & (s_Profiler.m_InvocationTableSize - 1);

  // Allocate and populate invocation record.
  Invocation* i = LinearAllocate<Invocation>(s_Profiler.m_Allocator);
  i->m_Hash      = hash;
  i->m_Function  = f;
  i->m_Parent    = parent;
  i->m_CallCount = 0;
  i->m_Ticks     = 0;
  i->m_StartTick = 0;
  i->m_Next      = s_Profiler.m_InvocationTable[index];

  // Insert
  s_Profiler.m_InvocationTable[index] = i;

  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x38ffc(%rip), %r14     # 0x429f8
testq %r14, %r14
je 0x9a04
xorl (%r14), %ebp
movl 0x38fe2(%rip), %edi     # 0x429ec
leal -0x1(%rdi), %eax
andl %ebp, %eax
movq 0x38fda(%rip), %rcx     # 0x429f0
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x9a68
cmpl %ebp, (%rax)
jne 0x9a62
cmpq %rbx, 0x8(%rax)
jne 0x9a62
movq 0x10(%rax), %rcx
testq %rcx, %rcx
sete %sil
cmpq %r14, %rcx
sete %dl
setne %r8b
orb %sil, %r8b
jne 0x9a5e
movq %r14, %rsi
movq 0x10(%rcx), %rcx
movq 0x10(%rsi), %rsi
cmpq %rsi, %rcx
sete %dl
testq %rcx, %rcx
je 0x9a5e
cmpq %rsi, %rcx
je 0x9a46
testb %dl, %dl
jne 0x9ae1
movq 0x30(%rax), %rax
jmp 0x9a1a
movl 0x38f7a(%rip), %eax     # 0x429e8
incl %eax
cvtsi2sd %rax, %xmm0
movl %edi, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
ucomisd 0x26b70(%rip), %xmm0    # 0x305f8
jbe 0x9a91
addl %edi, %edi
callq 0x9944
movl 0x38f54(%rip), %r15d    # 0x429ec
decl %r15d
andl %ebp, %r15d
movq 0x38f0b(%rip), %rdi     # 0x429b0
movl $0x38, %esi
movl $0x8, %edx
callq 0xadac
movl %ebp, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, 0x10(%rax)
movl $0x0, 0x18(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movq 0x38f1b(%rip), %rcx     # 0x429f0
movq (%rcx,%r15,8), %rdx
movq %rdx, 0x30(%rax)
movq %rax, (%rcx,%r15,8)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38eef(%rip), %r15     # 0x429f8
callq 0xa5ca
subq 0x28(%r15), %rax
addq %rax, 0x20(%r15)
cmpl $0x0, (%rbx)
je 0x9b2b
movq 0x10(%r15), %rax
movq %rax, 0x38ed2(%rip)     # 0x429f8
jmp 0x9c58
leaq 0x26b0a(%rip), %rsi     # 0x3063c
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1cba5
testl %eax, %eax
je 0x9c79
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
testq %rcx, %rcx
leaq 0x28f4b(%rip), %rax     # 0x32aa2
cmoveq %rax, %rcx
testq %r8, %r8
cmoveq %rax, %r8
movq 0x20(%rbx), %r9
movl 0x30(%rbx), %eax
movl %eax, (%rsp)
leaq 0x26af6(%rip), %rdx     # 0x30669
leaq 0x10(%rsp), %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
xorl %eax, %eax
callq 0x6780
movb $0x0, 0x3ff(%r14)
movq %r14, %rdi
callq 0xa31c
movl %eax, %ebx
leaq 0x38e18(%rip), %rdi     # 0x429b8
movl %eax, %esi
movq %r14, %rdx
callq 0x9e98
cmpl $-0x1, %eax
sete %dl
movq 0x38e29(%rip), %rcx     # 0x429e0
testq %rcx, %rcx
sete %sil
orb %dl, %sil
cmpb $0x1, %sil
jne 0x9c3e
movq 0x38de2(%rip), %rdi     # 0x429b0
movl $0x1, %esi
movl $0x1, %edx
callq 0xadac
movq %rax, %r14
movq 0x38dc9(%rip), %r15     # 0x429b0
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x6240
movq %rax, %r13
leaq 0x1(%rax), %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0xadac
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x63d0
movb $0x0, (%r15,%r13)
leaq 0x38d93(%rip), %rdi     # 0x429b8
movl %ebx, %esi
movq %r15, %rdx
callq 0x9f2f
movq 0x38daa(%rip), %rcx     # 0x429e0
cltq
movq %r14, (%rcx,%rax,8)
jmp 0x9c44
cltq
movq (%rcx,%rax,8), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x99e9
movq %rax, 0x38da3(%rip)     # 0x429f8
incl 0x18(%rax)
callq 0xa5ca
movq 0x38d94(%rip), %rcx     # 0x429f8
movq %rax, 0x28(%rcx)
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x269bf(%rip), %rdi     # 0x3063f
xorl %eax, %eax
callq 0xa101
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movq 0x38d11(%rip), %rdi     # 0x429a0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1c9f0
movq 0x38d07(%rip), %rdi     # 0x429a8
movq 0x38d48(%rip), %rsi     # 0x429f0
callq 0xace6
leaq 0x38d04(%rip), %rdi     # 0x429b8
popq %rax
jmp 0x9e5a
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x269e6(%rip), %rdi     # 0x306b5
callq 0x6740
leaq 0x26938(%rip), %rdi     # 0x30613
leaq 0x264b2(%rip), %rsi     # 0x30194
callq 0x6580
testq %rax, %rax
je 0x9e46
movq %rax, %rbx
leaq 0x2697b(%rip), %rdi     # 0x30675
movl $0xb, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x68e0
leaq 0x2696e(%rip), %rsi     # 0x30681
leaq 0x38ce6(%rip), %rdx     # 0x42a00
leaq 0x268df(%rip), %rcx     # 0x30600
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6670
movl 0x38c96(%rip), %r15d    # 0x429c8
testq %r15, %r15
je 0x9d79
movq 0x38c7a(%rip), %r12     # 0x429b8
movq 0x38c7b(%rip), %r13     # 0x429c0
movq 0x38c94(%rip), %rbp     # 0x429e0
xorl %r14d, %r14d
cmpl $0x0, (%r12,%r14,4)
je 0x9d71
movq (%r13,%r14,8), %rcx
movq (%rbp,%r14,8), %rdx
movq %rbx, %rdi
leaq 0x26917(%rip), %rsi     # 0x30681
xorl %eax, %eax
callq 0x6670
incq %r14
cmpq %r14, %r15
jne 0x9d4f
leaq 0x26909(%rip), %rdi     # 0x30689
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x68e0
movl 0x38c54(%rip), %eax     # 0x429ec
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x9e30
leaq 0x28cf5(%rip), %r13     # 0x32aa2
leaq 0x268e8(%rip), %r12     # 0x3069c
leaq 0x268dc(%rip), %r14     # 0x30697
xorl %ecx, %ecx
movq 0x38c2c(%rip), %rax     # 0x429f0
movq %rcx, 0x10(%rsp)
movq (%rax,%rcx,8), %r15
testq %r15, %r15
je 0x9e21
movq %r15, %rbp
cmpq $0x0, 0x10(%rbp)
movq 0x8(%rbp), %rdx
movq %r12, %rcx
cmoveq %r13, %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x6670
movq 0x10(%rbp), %rbp
testq %rbp, %rbp
jne 0x9dd5
movl 0x18(%r15), %ebp
movq 0x20(%r15), %rdi
callq 0xa5ff
movq %rbx, %rdi
leaq 0x2688d(%rip), %rsi     # 0x3069f
movl %ebp, %edx
movb $0x1, %al
callq 0x6670
movq 0x30(%r15), %r15
jmp 0x9dcd
movq 0x10(%rsp), %rcx
incq %rcx
cmpq 0x8(%rsp), %rcx
jne 0x9dbd
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x64c0
callq 0x699e
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/lua/src/liolib.c
// Function: io_open
static int io_open (lua_State *L) {
  const char *filename = luaL_checkstring(L, 1);
  const char *mode = luaL_optstring(L, 2, "r");
  FILE **pf = newfile(L);
  *pf = fopen(filename, mode);

  /* Tundra: Track opened files. */
  if (*pf && (0 == strcmp(mode, "r") || 0 == strcmp(mode, "rb")))
    lua_on_file_opened(L, filename);

  return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %esi
xorl %edx, %edx
callq 0x1bcb3
movq %rax, %r14
leaq 0x12884(%rip), %rdx     # 0x333f4
movq %rbx, %rdi
movl $0x2, %esi
xorl %ecx, %ecx
callq 0x1bc5a
movq %rax, %r12
movq %rbx, %rdi
callq 0x20ee0
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x6580
movq %rax, (%r15)
testq %rax, %rax
je 0x20bd1
leaq 0x1284d(%rip), %rsi     # 0x333f4
movq %r12, %rdi
callq 0x6650
testl %eax, %eax
je 0x20bc6
leaq 0x106b9(%rip), %rsi     # 0x31273
movq %r12, %rdi
callq 0x6650
testl %eax, %eax
jne 0x20bd1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x212ac
cmpq $0x0, (%r15)
je 0x20be8
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x204f8
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/liolib.c
// Function: g_iofile
static int g_iofile (lua_State *L, int f, const char *mode) {
  if (!lua_isnoneornil(L, 1)) {
    const char *filename = lua_tostring(L, 1);
    if (filename) {
      FILE **pf = newfile(L);
      *pf = fopen(filename, mode);
      if (*pf == NULL)
        fileerror(L, 1, filename);
      if (0 == strcmp("r", mode) || 0 == strcmp("rb", mode))
        lua_on_file_opened(L, filename);
    }
    else {
      tofile(L);  /* check that it's a valid file handle */
      lua_pushvalue(L, 1);
    }
    lua_rawseti(L, LUA_ENVIRONINDEX, f);
  }
  /* return current value */
  lua_rawgeti(L, LUA_ENVIRONINDEX, f);
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movl $0x1, %esi
callq 0x1a9f8
testl %eax, %eax
jle 0x20ec8
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1ac32
testq %rax, %rax
je 0x20ea4
movq %rax, %r12
movq %r14, %rdi
callq 0x20ee0
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x6580
movq %rax, (%r13)
testq %rax, %rax
jne 0x20e71
movq %r14, %rdi
movq %r12, %rsi
callq 0x20f27
leaq 0x1257c(%rip), %rdi     # 0x333f4
movq %r15, %rsi
callq 0x6650
testl %eax, %eax
je 0x20e97
leaq 0x103e8(%rip), %rdi     # 0x31273
movq %r15, %rsi
callq 0x6650
testl %eax, %eax
jne 0x20eb9
movq %r14, %rdi
movq %r12, %rsi
callq 0x212ac
jmp 0x20eb9
movq %r14, %rdi
callq 0x20486
movq %r14, %rdi
movl $0x1, %esi
callq 0x1a9d8
movq %r14, %rdi
movl $0xffffd8ef, %esi       # imm = 0xFFFFD8EF
movl %ebx, %edx
callq 0x1b324
movq %r14, %rdi
movl $0xffffd8ef, %esi       # imm = 0xFFFFD8EF
movl %ebx, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1b10f
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/lmathlib.c
// Function: luaopen_math
LUALIB_API int luaopen_math (lua_State *L) {
  luaL_register(L, LUA_MATHLIBNAME, mathlib);
#ifdef LLONG_MAX
  lua_pushnumber(L, LLONG_MAX);
#else
  lua_pushnumber(L, _I64_MAX);
#endif
  lua_setfield(L, -2, "huge");
  return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x1171b(%rip), %rsi     # 0x326a2
leaq 0x203f2(%rip), %rdx     # 0x41380
callq 0x1c034
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, %rdi
callq 0x1add5
leaq 0x11838(%rip), %rdx     # 0x327e4
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x1b267
movl $0x1, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/loadlib.c
// Function: lua_on_file_opened
void lua_on_file_opened(lua_State *L, const char* fn) {
	lua_pushlightuserdata(L, &lf_callback_key); // +1
	lua_gettable(L, LUA_REGISTRYINDEX); // -1, +1
	if (!lua_istable(L, -1))
	{
    lua_pop(L, 1); // -1
    lua_newtable(L); // +1
    lua_pushlightuserdata(L, &lf_callback_key); // +1
    lua_pushvalue(L, -2); // +1
    lua_settable(L, LUA_REGISTRYINDEX); // -2
	}
  lua_pushstring(L, fn); //+1
  lua_pushboolean(L, 1); //+1
  lua_settable(L, -3); //-2
  lua_pop(L, 1); // -1
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa2503(%rip), %rsi     # 0xc37c0
callq 0x1b033
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x1b06b
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a9f8
cmpl $0x5, %eax
je 0x21323
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x1a7aa
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1b144
leaq 0xa24bf(%rip), %rsi     # 0xc37c0
movq %rbx, %rdi
callq 0x1b033
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x1a9d8
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x1b240
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae54
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1b019
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x1b240
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1a7aa
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/loadlib.c
// Function: ll_get_accessed_files
static int ll_get_accessed_files(lua_State *L) {
	lua_pushlightuserdata(L, &lf_callback_key);
	lua_gettable(L, LUA_REGISTRYINDEX);
  if (lua_isnil(L, -1))
  {
    lua_pop(L, 1);
    lua_newtable(L);
  }
	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xa177c(%rip), %rsi     # 0xc37c0
callq 0x1b033
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x1b06b
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1a9f8
testl %eax, %eax
jne 0x22080
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x1a7aa
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1b144
movl $0x1, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/lua/src/ltable.c
// Function: luaH_free
void luaH_free (lua_State *L, Table *t) {
  if (t->node != dummynode)
    luaM_freearray(L, t->node, (lua_Number)sizenode(t), Node);
  luaM_freearray(L, t->array, t->sizearray, TValue);
  luaM_free(L, t);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rsi), %rsi
leaq 0xbc2d(%rip), %rax      # 0x33480
cmpq %rax, %rsi
je 0x27876
movb 0xb(%rbx), %cl
movl $0x1, %eax
shll %cl, %eax
cltq
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x2124a
movq 0x18(%rbx), %rsi
movslq 0x38(%rbx), %rdx
shlq $0x4, %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x2124a
movl $0x40, %edx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2124a
// File: /workspace/github_c_makefile_star2_O1/Nico01[P]obj2asm/odisasm.c
// Function: check_getw
int check_getw( result )
    dword   *result;
{
    int             ch;

    ch = buff_getc();
    if ( ch == EOF ) {
        return( TRUE );
    }
    *result = ch;
    ch = buff_getc();
    if ( ch == EOF ) {
        return( TRUE );
    }
    *result += ch << 8;
    return( FALSE );
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xf442
movl $0x1, %ebp
cmpl $-0x1, %eax
je 0x9713
cltq
movq %rax, (%rbx)
callq 0xf442
cmpl $-0x1, %eax
je 0x9713
shll $0x8, %eax
cltq
addq %rax, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq