LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/LuaInterpolate.cpp
// Function: t2::LuaEnvLookupScope::GetValue(unsigned long, unsigned long*)
const char* GetValue(size_t index, size_t* len_out)
  {
    lua_State* L = m_LuaState;
    CHECK(lua_type(L, -1) == LUA_TTABLE);
    lua_rawgeti(L, -1, int(index + 1));
    if (lua_type(L, -1) != LUA_TSTRING)
    {
      fprintf(stderr, "env lookup failed: elem %d is not a string: %s\n", (int) index + 1, lua_typename(L, lua_type(L, -1)));
      return nullptr;
    }
    // This is technically not allowed but we do it anyway for performance.
    // We check that the value is already a string, and we know it's being
    // kept alive by the table which is on our stack.
    const char* str = lua_tolstring(L, -1, len_out);
    lua_pop(L, 1);
    return str;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq (%rdi), %r14
incl %ebx
pushq $-0x1
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x189fb
movq %r14, %rdi
movl %ebp, %esi
callq 0x18318
cmpl $0x4, %eax
jne 0x81c0
pushq $-0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x1853d
movq %rax, %rbx
pushq $-0x2
popq %rsi
movq %r14, %rdi
callq 0x180d8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x39e11(%rip), %rax     # 0x41fd8
movq (%rax), %r15
pushq $-0x1
popq %rsi
movq %r14, %rdi
callq 0x18318
movq %r14, %rdi
movl %eax, %esi
callq 0x18334
leaq 0x242b7(%rip), %rsi     # 0x2c49d
movq %r15, %rdi
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x6670
xorl %eax, %eax
jmp 0x81b5
nop
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rsi
callq 0x85c6
movq 0x58(%r15), %rdx
leaq 0x10(%r15), %r12
testq %rdx, %rdx
cmovneq 0x50(%r15), %r12
cmoveq 0x8(%r15), %rdx
leaq (%r12,%rbx), %rdi
subq %rbx, %rdx
movq %r12, %rsi
callq 0x67c0
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x63d0
// File: /workspace/github_c_makefile_star2_O2/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 0x82c8
movq 0x8(%r15), %rax
cmpq %rbx, %rax
jb 0x82f1
testq %rcx, %rcx
je 0x82d8
movq 0x50(%r15), %rdi
jmp 0x82dc
leaq 0x10(%r15), %rdi
addq %rax, %rdi
subq %rbx, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x64e0
testl %eax, %eax
je 0x830f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x85c6
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_O2/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 0x84d0
movzbl -0x1(%rsi,%rdi), %r8d
decq %rdi
cmpl $0x5c, %r8d
je 0x84c6
cmpl $0x2f, %r8d
jne 0x84ad
testq %rdx, %rdx
cmoveq %rcx, %rax
movq %rdi, (%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbx
testl %eax, %eax
jle 0x8483
movzbl -0x1(%rdi,%rax), %ecx
decq %rax
incq %rbx
cmpl $0x5c, %ecx
je 0x8469
cmpl $0x2f, %ecx
jne 0x8450
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_O2/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), %rsi
leaq 0x10(%rdi), %rcx
movq %rax, %rdi
movq %rsi, %rdx
testq %rsi, %rsi
jne 0x84f7
movq 0x8(%rbx), %rdx
movq %rcx, %rdi
testq %rdx, %rdx
je 0x853c
cmpb $0x22, (%rdi)
jne 0x853c
cmpb $0x22, -0x1(%rdi,%rdx)
jne 0x853c
cmpq $0x1, %rdx
je 0x8568
cmpb $0x5c, -0x2(%rdi,%rdx)
jne 0x8568
leaq 0x58(%rbx), %rdi
addq $0x8, %rbx
testq %rsi, %rsi
cmovneq %rdi, %rbx
leaq -0x1(%rdx), %rsi
movq %rsi, (%rbx)
cmpq $0x0, (%rdi)
cmoveq %rcx, %rax
addq %rdx, %rax
addq $-0x2, %rax
jmp 0x8565
movq %rbx, %rdi
callq 0x8698
leaq 0x267b9(%rip), %rsi     # 0x2ed04
pushq $0x1
popq %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x81fa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x85c6
movb $0x22, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
testq %rcx, %rcx
movq 0x8(%rdi), %r14
movq 0x50(%rdi), %rax
movq %rcx, %rdx
cmoveq %r14, %rdx
leaq 0x10(%rdi), %rbx
testq %rdx, %rdx
je 0x86f1
testq %rcx, %rcx
movq %rax, %rsi
cmoveq %rbx, %rsi
cmpb $0x5c, -0x1(%rsi,%rdx)
jne 0x86f1
leaq 0x58(%r15), %rsi
leaq 0x8(%r15), %rdi
decq %rdx
testq %rcx, %rcx
movq %rsi, %rcx
cmoveq %rdi, %rcx
movq %rdx, (%rcx)
movq (%rsi), %rcx
movq (%rdi), %r14
testq %rcx, %rcx
cmovneq %rcx, %r14
cmoveq %rbx, %rax
xorl %ecx, %ecx
xorl %r12d, %r12d
cmpq %rcx, %r14
je 0x8717
xorl %edx, %edx
cmpb $0x5c, (%rax,%rcx)
sete %dl
addq %rdx, %r12
incq %rcx
jmp 0x8701
testq %r12, %r12
je 0x876a
movq %r15, %rdi
movq %r12, %rsi
callq 0x85c6
cmpq $0x0, 0x58(%r15)
je 0x8732
movq 0x50(%r15), %rbx
leaq (%rbx,%r12), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x67c0
addq %r12, %r14
xorl %eax, %eax
cmpq %r14, %r12
jae 0x876a
movb (%rbx,%r12), %cl
movb %cl, (%rbx,%rax)
cmpb $0x5c, %cl
jne 0x8762
movb $0x5c, 0x1(%rbx,%rax)
addq $0x2, %rax
jmp 0x8765
incq %rax
incq %r12
jmp 0x8746
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x23d77(%rip), %rsi     # 0x2c52c
leaq 0x39d04(%rip), %rdx     # 0x424c0
callq 0x198df
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x180d8
leaq 0x23d6a(%rip), %rsi     # 0x2c53f
movq %rbx, %rdi
callq 0x195b9
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x182f8
leaq 0x23d5d(%rip), %rdx     # 0x2c54c
movq %rbx, %rdi
movl %ebp, %esi
callq 0x18b4f
leaq 0x39ce0(%rip), %rdx     # 0x424e0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x198df
movq %rbx, %rdi
movl %ebp, %esi
callq 0x180d8
movb $0x72, 0x3a092(%rip)    # 0x428ad
movl $0x66766e74, 0x3a084(%rip) # imm = 0x66766E74
movb $0x5c, 0x3a0d0(%rip)    # 0x428fc
movb $0x22, 0x3a08f(%rip)    # 0x428c2
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r14
movl $0x2018, %esi           # imm = 0x2018
movq %rbx, %rdi
callq 0x19120
movq %rax, %r15
movl $0x2018, %edx           # imm = 0x2018
movq %rax, %rdi
xorl %esi, %esi
callq 0x62a0
movb $0x1, (%r15)
leaq 0x2391b(%rip), %rsi     # 0x2c194
movq %r14, %rdi
callq 0x6580
testq %rax, %rax
je 0x88ba
andq $0x0, 0x8(%r15)
movq %rax, 0x2010(%r15)
leaq 0x23ca6(%rip), %rdx     # 0x2c53f
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x18977
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18c82
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23c93(%rip), %rsi     # 0x2c554
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x19357
// File: /workspace/github_c_makefile_star2_O2/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 0x23c59(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x19749
movq %rax, %r15
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8b0f
leaq 0x2372f(%rip), %rsi     # 0x2c043
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6100
addq $0x8, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8b78
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23bee(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1853d
movq %rax, %r12
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8b0f
addq $0x8, %r14
movq (%r15), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x8b9e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23b93(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x18519
movl %eax, %ebp
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8b0f
addq $0x8, %r14
testl %ebp, %ebp
leaq 0x23b97(%rip), %rax     # 0x2c576
leaq 0x23b8b(%rip), %rsi     # 0x2c571
cmoveq %rax, %rsi
movq %r14, %rdi
callq 0x8b78
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
leaq 0x23b38(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %r14
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8b0f
leaq 0x8(%r14), %rdi
pushq $0x7b
popq %rsi
callq 0x8c52
movb $0x1, (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23afd(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %rbx
leaq 0x8(%rax), %rdi
pushq $0x7d
popq %rsi
callq 0x8c52
movb $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23a96(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq %rax, %rbx
leaq 0x8(%rax), %rdi
pushq $0x5d
popq %rsi
callq 0x8c52
movb $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x23a6d(%rip), %rdx     # 0x2c53f
pushq $0x1
popq %rsi
callq 0x19620
movq 0x2010(%rax), %rbx
testq %rbx, %rbx
je 0x8b05
movq %rax, %r14
movq %rax, %rdi
addq $0x8, %rdi
callq 0x8c0a
andq $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_O2/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 0x8b28
movb $0x0, (%rbx)
jmp 0x8b34
leaq 0x8(%rbx), %rdi
pushq $0x2c
popq %rsi
callq 0x8c52
movq %r14, %rdi
callq 0x180cb
cmpl %ebp, %eax
jl 0x8b6d
movq %rsp, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x1958c
addq $0x8, %rbx
movq (%r15), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8b9e
pushq $0x3a
popq %rsi
movq %rbx, %rdi
callq 0x8c52
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x22
popq %rsi
callq 0x8c52
xorl %r12d, %r12d
leaq 0x39cdc(%rip), %r13     # 0x428a0
cmpq %r12, %r14
je 0x8bf1
movsbl (%r15,%r12), %esi
movsbl (%rsi,%r13), %ebp
testl %ebp, %ebp
je 0x8be4
movq %rbx, %rdi
pushq $0x5c
popq %rsi
callq 0x8c52
movl %ebp, %esi
movq %rbx, %rdi
callq 0x8c52
incq %r12
jmp 0x8bc4
pushq $0x22
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8c52
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
leaq 0x8(%rdi), %r15
pushq $0x1
popq %r12
testq %r14, %r14
je 0x8c42
movq 0x2008(%rbx), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x68e0
addq %rax, %r15
subq %rax, %r14
jmp 0x8c20
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
cmpq $0x2000, %rax           # imm = 0x2000
jne 0x8c6f
movq %rbx, %rdi
callq 0x8c0a
xorl %eax, %eax
movb %bpl, 0x8(%rbx,%rax)
incq %rax
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
movzwl 0x6(%r14), %ecx
cmpl $0x2, %ecx
jb 0x8d2a
addl $-0x2, %ecx
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xa8db
movzwl 0x6(%r15), %ecx
decl %ecx
leaq 0x490(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movl %ecx, %edx
callq 0xa8db
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18741
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x8d54
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xa8ce
leaq 0x271f5(%rip), %rsi     # 0x2ff3b
movq %rbx, %rdi
callq 0x18741
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18741
pushq $0x2
popq %rax
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdi, %rbx
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %rdx
movl %ebp, %esi
callq 0x1958c
leaq 0x21c(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xa8ce
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18741
movl %ebp, %eax
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x490, %rsp            # imm = 0x490
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r14
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r15
leaq 0x204(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0xa558
movq %r12, %rdi
movq %r15, %rsi
callq 0xa7b5
movq %rsp, %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0xa8ce
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18741
movl %ebp, %eax
addq $0x490, %rsp            # imm = 0x490
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
movq %r14, %rdi
callq 0xa795
testb %al, %al
je 0x8e98
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xa8ce
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x8ea2
leaq 0x2709c(%rip), %rsi     # 0x2ff3b
movq %rbx, %rdi
callq 0x18741
pushq $0x1
popq %rax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
movzwl 0x6(%r14), %ecx
testl %ecx, %ecx
je 0x8f08
decl %ecx
leaq 0x290(%rsp), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
movl %ecx, %edx
callq 0xa8db
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x8f12
leaq 0x25bf3(%rip), %rsi     # 0x2eb02
movq %rbx, %rdi
callq 0x18741
pushq $0x1
popq %rax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r14
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x6520
testq %rax, %rax
cmovneq %rax, %r14
pushq $0x5c
popq %rsi
movq %r14, %rdi
callq 0x6520
cmpq %r14, %rax
cmovaq %rax, %r14
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x6520
testq %rax, %rax
leaq 0x25b8e(%rip), %rsi     # 0x2eb02
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x18741
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r14
pushq $0x2e
popq %rsi
movq %rax, %rdi
callq 0x6520
testq %rax, %rax
je 0x8fbe
subq %r14, %rax
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x186ea
jmp 0x8fc9
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x182f8
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
leaq 0x20c(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
movzwl 0x6(%r14), %ecx
testl %ecx, %ecx
je 0x9038
decl %ecx
movq %rsp, %r14
leaq 0x20c(%rsp), %rsi
movq %r14, %rdi
movl %ecx, %edx
callq 0xa8db
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x6520
testq %rax, %rax
je 0x9033
movb $0x0, (%rax)
movq %rsp, %rsi
jmp 0x903f
leaq 0x25ac3(%rip), %rsi     # 0x2eb02
movq %rbx, %rdi
callq 0x18741
pushq $0x1
popq %rax
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x290, %rsp            # imm = 0x290
movq %rdi, %rbx
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
callq 0x1958c
leaq 0x4(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0xa558
movzwl 0x4(%r14), %esi
andl $0x1, %esi
movq %rbx, %rdi
callq 0x18905
movl %ebp, %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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, 0x39922(%rip)    # 0x429d0
movups %xmm0, 0x3993b(%rip)    # 0x429f0
movups %xmm0, 0x39924(%rip)    # 0x429e0
movq %rdx, 0x398dd(%rip)     # 0x429a0
movq %rdi, 0x398de(%rip)     # 0x429a8
movq %rsi, 0x398df(%rip)     # 0x429b0
movups %xmm0, 0x398e0(%rip)    # 0x429b8
movups %xmm0, 0x398e5(%rip)    # 0x429c4
movq %rdi, 0x398f2(%rip)     # 0x429d8
movl $0x400, %edi            # imm = 0x400
callq 0x9136
leaq 0x23519(%rip), %rdi     # 0x2c610
callq 0x9b4a
leaq 0x398fd(%rip), %rdi     # 0x42a00
movl %eax, %esi
callq 0x91b3
movq %rax, 0x398e7(%rip)     # 0x429f8
callq 0x9da1
movq 0x398db(%rip), %rcx     # 0x429f8
movq %rax, 0x28(%rcx)
leaq 0x170(%rip), %rsi       # 0x9298
pushq $0x3
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
popq %rbx
jmp 0x1a254
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movl %edi, %ebx
movl 0x398a8(%rip), %r15d    # 0x429ec
movq 0x3985d(%rip), %rdi     # 0x429a8
movl %ebx, %esi
callq 0x95d9
movq %rax, %r14
leal -0x1(%rbx), %eax
xorl %ecx, %ecx
cmpq %r15, %rcx
je 0x918d
movq 0x3988a(%rip), %rdx     # 0x429f0
movq (%rdx,%rcx,8), %rdx
testq %rdx, %rdx
je 0x9188
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
jmp 0x916a
incq %rcx
jmp 0x915a
movq 0x39814(%rip), %rdi     # 0x429a8
movq 0x39855(%rip), %rsi     # 0x429f0
callq 0xa456
movq %r14, 0x39849(%rip)     # 0x429f0
movl %ebx, 0x3983f(%rip)     # 0x429ec
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x39832(%rip), %r14     # 0x429f8
testq %r14, %r14
je 0x91ce
xorl (%r14), %ebp
movl 0x39818(%rip), %edi     # 0x429ec
leal -0x1(%rdi), %r15d
andl %ebp, %r15d
leaq (,%r15,8), %rax
addq 0x39806(%rip), %rax     # 0x429f0
movq (%rax), %rax
testq %rax, %rax
je 0x9221
cmpl %ebp, (%rax)
jne 0x921b
cmpq %rbx, 0x8(%rax)
jne 0x921b
movq %rax, %rcx
movq %r14, %rdx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0x9216
cmpq %rdx, %rcx
jne 0x9216
movq 0x10(%rdx), %rdx
jmp 0x9202
cmpq %rdx, %rcx
je 0x928d
addq $0x30, %rax
jmp 0x91ea
movl 0x397c1(%rip), %eax     # 0x429e8
incl %eax
cvtsi2sd %rax, %xmm0
movl %edi, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
ucomisd 0x233bf(%rip), %xmm0    # 0x2c600
jbe 0x9257
addl %edi, %edi
callq 0x9136
movl 0x3979b(%rip), %r15d    # 0x429ec
decl %r15d
andl %ebp, %r15d
movq 0x39752(%rip), %rdi     # 0x429b0
callq 0x9601
movl %ebp, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, 0x10(%rax)
andl $0x0, 0x18(%rax)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rax)
movq 0x3976f(%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_O2/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 %rbx
subq $0x410, %rsp            # imm = 0x410
movq %rsi, %rbx
movq %rdi, %r14
movq 0x39747(%rip), %r15     # 0x429f8
callq 0x9da1
subq 0x28(%r15), %rax
addq %rax, 0x20(%r15)
cmpl $0x0, (%rbx)
je 0x92d3
movq 0x10(%r15), %rax
movq %rax, 0x3972a(%rip)     # 0x429f8
jmp 0x93a9
leaq 0x23372(%rip), %rsi     # 0x2c64c
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1a3f4
testl %eax, %eax
je 0x93c6
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
testq %rcx, %rcx
leaq 0x25803(%rip), %rax     # 0x2eb02
cmoveq %rax, %rcx
testq %r8, %r8
cmoveq %rax, %r8
movq 0x20(%rbx), %r9
movl 0x30(%rbx), %eax
movl %eax, (%rsp)
leaq 0x2335e(%rip), %rdx     # 0x2c679
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 0x9b4a
movl %eax, %ebx
leaq 0x39670(%rip), %rdi     # 0x429b8
movl %eax, %esi
movq %r14, %rdx
callq 0x960c
testq %rax, %rax
je 0x935c
movq (%rax), %rdi
jmp 0x9398
movq 0x3964d(%rip), %rdi     # 0x429b0
callq 0x962a
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq 0x39639(%rip), %rdi     # 0x429b0
leaq 0x10(%rsp), %rsi
callq 0x9659
leaq 0x39630(%rip), %rdi     # 0x429b8
movl %ebx, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x9635
movq (%r14), %rdi
movl %ebx, %esi
callq 0x91b3
movq %rax, 0x39652(%rip)     # 0x429f8
incl 0x18(%rax)
callq 0x9da1
movq 0x39643(%rip), %rcx     # 0x429f8
movq %rax, 0x28(%rcx)
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r14
popq %r15
retq
leaq 0x23282(%rip), %rdi     # 0x2c64f
xorl %eax, %eax
callq 0x9939
// File: /workspace/github_c_makefile_star2_O2/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 0x395c4(%rip), %rdi     # 0x429a0
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1a254
movq 0x395ba(%rip), %rdi     # 0x429a8
movq 0x395fb(%rip), %rsi     # 0x429f0
callq 0xa456
leaq 0x395b7(%rip), %rdi     # 0x429b8
popq %rax
jmp 0x95b2
// File: /workspace/github_c_makefile_star2_O2/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 0x232a9(%rip), %rdi     # 0x2c6c5
callq 0x6740
leaq 0x231fb(%rip), %rdi     # 0x2c623
leaq 0x22d65(%rip), %rsi     # 0x2c194
callq 0x6580
testq %rax, %rax
je 0x9588
movq %rax, %rbx
leaq 0x2323e(%rip), %rdi     # 0x2c685
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x68e0
leaq 0x23235(%rip), %rsi     # 0x2c691
leaq 0x3959d(%rip), %rdx     # 0x42a00
leaq 0x231a6(%rip), %rcx     # 0x2c610
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6670
movq 0x3953d(%rip), %r15     # 0x429b8
movq 0x3953e(%rip), %r12     # 0x429c0
movq 0x39557(%rip), %r13     # 0x429e0
movl 0x39539(%rip), %ebp     # 0x429c8
xorl %r14d, %r14d
cmpq %r14, %rbp
je 0x94bd
cmpl $0x0, (%r15,%r14,4)
je 0x94b8
movq (%r12,%r14,8), %rcx
movq (%r13,%r14,8), %rdx
movq %rbx, %rdi
leaq 0x231e0(%rip), %rsi     # 0x2c691
xorl %eax, %eax
callq 0x6670
incq %r14
jmp 0x9492
leaq 0x231d5(%rip), %rdi     # 0x2c699
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x68e0
movl 0x39514(%rip), %eax     # 0x429ec
movq %rax, 0x8(%rsp)
leaq 0x2561e(%rip), %r13     # 0x2eb02
leaq 0x231c1(%rip), %r12     # 0x2c6ac
leaq 0x231b5(%rip), %r15     # 0x2c6a7
xorl %eax, %eax
cmpq 0x8(%rsp), %rax
je 0x9572
movq %rax, 0x10(%rsp)
leaq (,%rax,8), %r14
addq 0x394e1(%rip), %r14     # 0x429f0
movq (%r14), %r14
testq %r14, %r14
je 0x9568
movq %r14, %rbp
testq %rbp, %rbp
je 0x9542
cmpq $0x0, 0x10(%rbp)
movq 0x8(%rbp), %rdx
movq %r12, %rcx
cmoveq %r13, %rcx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x6670
movq 0x10(%rbp), %rbp
jmp 0x951a
movl 0x18(%r14), %ebp
movq 0x20(%r14), %rdi
callq 0x9dd6
movq %rbx, %rdi
leaq 0x23156(%rip), %rsi     # 0x2c6af
movl %ebp, %edx
movb $0x1, %al
callq 0x6670
addq $0x30, %r14
jmp 0x950f
movq 0x10(%rsp), %rax
incq %rax
jmp 0x94f4
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x64c0
movq 0x38a49(%rip), %rax     # 0x41fd8
movq (%rax), %rcx
leaq 0x23096(%rip), %rdi     # 0x2c62f
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x68e0
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/lua/src/ldebug.c
// Function: currentline
static int currentline (lua_State *L, CallInfo *ci) {
  int pc = currentpc(L, ci);
  if (pc < 0)
    return -1;  /* only active lua functions have current-line information */
  else
    return luadebug_getline(ci_func(ci)->l.p, pc);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x1b244
testl %eax, %eax
js 0x1b2a9
movq 0x8(%rbx), %rcx
movq (%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x28(%rcx), %rcx
testq %rcx, %rcx
je 0x1b2ae
movl %eax, %eax
movl (%rcx,%rax,4), %eax
jmp 0x1b2b0
pushq $-0x1
popq %rax
jmp 0x1b2b0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1958c
movq %rax, %r14
leaq 0x113c0(%rip), %rdx     # 0x2f48c
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x19533
movq %rax, %r12
movq %rbx, %rdi
callq 0x1e414
movq %rax, %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x6580
movq %rax, (%r15)
testq %rax, %rax
je 0x1e139
cmpb $0x72, (%r12)
jne 0x1e12a
cmpb $0x0, 0x1(%r12)
je 0x1e119
cmpb $0x62, 0x1(%r12)
jne 0x1e12a
cmpb $0x0, 0x2(%r12)
jne 0x1e12a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e76c
cmpq $0x0, (%r15)
je 0x1e139
pushq $0x1
popq %rax
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 0x1dab3
// File: /workspace/github_c_makefile_star2_O2/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, %r12
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %rsi
callq 0x18318
testl %eax, %eax
jle 0x1e3fc
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1853d
testq %rax, %rax
je 0x1e3c4
movq %rax, %r15
movq %r14, %rdi
callq 0x1e414
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x6580
movq %rax, (%r13)
testq %rax, %rax
jne 0x1e39d
movq %r14, %rdi
movq %r15, %rsi
callq 0x1e454
movzbl (%r12), %ecx
cmpl $0x72, %ecx
jne 0x1e3d9
cmpb $0x0, 0x1(%r12)
je 0x1e3e2
movzbl 0x1(%r12), %eax
subl $0x62, %eax
jne 0x1e3c0
movzbl 0x2(%r12), %eax
negl %eax
jmp 0x1e3de
movq %r14, %rdi
callq 0x1da3f
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x182f8
jmp 0x1e3ed
pushq $0x72
popq %rax
subl %ecx, %eax
testl %eax, %eax
jne 0x1e3ed
movq %r14, %rdi
movq %r15, %rsi
callq 0x1e76c
movq %r14, %rdi
movl $0xffffd8ef, %esi       # imm = 0xFFFFD8EF
movl %ebx, %edx
callq 0x18c13
movq %r14, %rdi
movl $0xffffd8ef, %esi       # imm = 0xFFFFD8EF
movl %ebx, %edx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x189fb
// File: /workspace/github_c_makefile_star2_O2/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 0x10253(%rip), %rsi     # 0x2e702
leaq 0x22eca(%rip), %rdx     # 0x41380
callq 0x198df
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, %rdi
callq 0x186c2
leaq 0x10370(%rip), %rdx     # 0x2e844
pushq $-0x2
popq %rsi
movq %rbx, %rdi
callq 0x18b4f
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xa5043(%rip), %rsi     # 0xc37c0
callq 0x1891f
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x18957
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x18318
cmpl $0x5, %eax
je 0x1e7de
pushq $-0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x180d8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x18a30
leaq 0xa5001(%rip), %rsi     # 0xc37c0
movq %rbx, %rdi
callq 0x1891f
movq %rbx, %rdi
movl %ebp, %esi
callq 0x182f8
movq %rbx, %rdi
movl $0xffffd8f0, %esi       # imm = 0xFFFFD8F0
callq 0x18b28
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18741
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x18905
pushq $-0x3
popq %rsi
movq %rbx, %rdi
callq 0x18b28
pushq $-0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x180d8