LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_clear_state(ImStb::STB_TexteditState*, int)
static void stb_textedit_clear_state(STB_TexteditState *state, int is_single_line)
{
   state->undostate.undo_point = 0;
   state->undostate.undo_char_point = 0;
   state->undostate.redo_point = STB_TEXTEDIT_UNDOSTATECOUNT;
   state->undostate.redo_char_point = STB_TEXTEDIT_UNDOCHARCOUNT;
   state->select_end = state->select_start = 0;
   state->cursor = 0;
   state->has_preferred_x = 0;
   state->preferred_x = 0;
   state->cursor_at_end_of_line = 0;
   state->initialized = 1;
   state->single_line = (unsigned char) is_single_line;
   state->insert_mode = 0;
   state->row_count_per_page = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movw $0x0, 0xe1e(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xe24(%rax)
movq -0x8(%rbp), %rax
movw $0x63, 0xe20(%rax)
movq -0x8(%rbp), %rax
movl $0x3e7, 0xe28(%rax)     # imm = 0x3E7
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x16(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x14(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x15(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x17(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_paste_internal(ImGuiInputTextState*, ImStb::STB_TexteditState*, unsigned short*, int)
static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, STB_TEXTEDIT_CHARTYPE *text, int len)
{
   // if there's a selection, the paste should delete it
   stb_textedit_clamp(str, state);
   stb_textedit_delete_selection(str,state);
   // try to insert the characters
   if (STB_TEXTEDIT_INSERTCHARS(str, state->cursor, text, len)) {
      stb_text_makeundo_insert(state, state->cursor, len);
      state->cursor += len;
      state->has_preferred_x = 0;
      return 1;
   }
   // remove the undo since we didn't actually insert the characters
   if (state->undostate.undo_point)
      --state->undostate.undo_point;
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x159680
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1590d0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x158ed0
testb $0x1, %al
jne 0x15a62d
jmp 0x15a65b
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movl -0x24(%rbp), %edx
callq 0x159190
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x16(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x15a686
movq -0x18(%rbp), %rax
cmpw $0x0, 0xe1e(%rax)
je 0x15a67f
movq -0x18(%rbp), %rax
movw 0xe1e(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xe1e(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: TabItemComparerBySection(void const*, void const*)
static int IMGUI_CDECL TabItemComparerBySection(const void* lhs, const void* rhs)
{
    const ImGuiTabItem* a = (const ImGuiTabItem*)lhs;
    const ImGuiTabItem* b = (const ImGuiTabItem*)rhs;
    const int a_section = (a->Flags & ImGuiTabItemFlags_Leading) ? 0 : (a->Flags & ImGuiTabItemFlags_Trailing) ? 2 : 1;
    const int b_section = (b->Flags & ImGuiTabItemFlags_Leading) ? 0 : (b->Flags & ImGuiTabItemFlags_Trailing) ? 2 : 1;
    if (a_section != b_section)
        return a_section - b_section;
    return (int)(a->IndexDuringLayout - b->IndexDuringLayout);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x15a802
xorl %eax, %eax
movl %eax, -0x34(%rbp)
jmp 0x15a822
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
andl $0x80, %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x15a83e
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0x15a85e
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edx
andl $0x80, %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0x15a877
movl -0x2c(%rbp), %eax
subl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x15a88c
movq -0x20(%rbp), %rax
movswl 0x20(%rax), %eax
movq -0x28(%rbp), %rcx
movswl 0x20(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: GetMinimumStepAtDecimalPrecision(int)
static float GetMinimumStepAtDecimalPrecision(int decimal_precision)
{
    static const float min_steps[10] = { 1.0f, 0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f, 0.0000001f, 0.00000001f, 0.000000001f };
    if (decimal_precision < 0)
        return FLT_MIN;
    return (decimal_precision < IM_ARRAYSIZE(min_steps)) ? min_steps[decimal_precision] : ImPow(10.0f, (float)-decimal_precision);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0x15b180
movss 0x30dbf(%rip), %xmm0    # 0x18bf38
movss %xmm0, -0x4(%rbp)
jmp 0x15b1c2
cmpl $0xa, -0x8(%rbp)
jge 0x15b19d
movslq -0x8(%rbp), %rcx
leaq 0x331bf(%rip), %rax     # 0x18e350
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0xc(%rbp)
jmp 0x15b1b8
xorl %eax, %eax
subl -0x8(%rbp), %eax
cvtsi2ss %eax, %xmm1
movss 0x16e2e(%rip), %xmm0    # 0x171fdc
callq 0x15b1d0
movss %xmm0, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: bool ImGui::CheckboxFlagsT<int>(char const*, int*, int)
bool ImGui::CheckboxFlagsT(const char* label, T* flags, T flags_value)
{
    bool all_on = (*flags & flags_value) == flags_value;
    bool any_on = (*flags & flags_value) != 0;
    bool pressed;
    if (!all_on && any_on)
    {
        ImGuiWindow* window = GetCurrentWindow();
        ImGuiItemFlags backup_item_flags = window->DC.ItemFlags;
        window->DC.ItemFlags |= ImGuiItemFlags_MixedValue;
        pressed = Checkbox(label, &all_on);
        window->DC.ItemFlags = backup_item_flags;
    }
    else
    {
        pressed = Checkbox(label, &all_on);

    }
    if (pressed)
    {
        if (all_on)
            *flags |= flags_value;
        else
            *flags &= ~flags_value;
    }
    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl -0x14(%rbp), %eax
cmpl -0x14(%rbp), %eax
sete %al
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x16(%rbp)
testb $0x1, -0x15(%rbp)
jne 0x15bc11
testb $0x1, -0x16(%rbp)
je 0x15bc11
callq 0xeb270
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x1cc(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl 0x1cc(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x1cc(%rax)
movq -0x8(%rbp), %rdi
leaq -0x15(%rbp), %rsi
callq 0x13c7c0
andb $0x1, %al
movb %al, -0x17(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x1cc(%rax)
jmp 0x15bc23
movq -0x8(%rbp), %rdi
leaq -0x15(%rbp), %rsi
callq 0x13c7c0
andb $0x1, %al
movb %al, -0x17(%rbp)
testb $0x1, -0x17(%rbp)
je 0x15bc4c
testb $0x1, -0x15(%rbp)
je 0x15bc3c
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x15bc4a
movl -0x14(%rbp), %ecx
xorl $-0x1, %ecx
movq -0x10(%rbp), %rax
andl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x15bc4c
movb -0x17(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: int ImGui::RoundScalarWithFormatT<int, int>(char const*, int, int)
TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, TYPE v)
{
    const char* fmt_start = ImParseFormatFindStart(format);
    if (fmt_start[0] != '%' || fmt_start[1] == '%') // Don't apply if the value is not visible in the format string
        return v;
    char v_str[64];
    ImFormatString(v_str, IM_ARRAYSIZE(v_str), fmt_start, v);
    const char* p = v_str;
    while (*p == ' ')
        p++;
    if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
        v = (TYPE)ImAtof(p);
    else
        ImAtoi(p, (SIGNEDTYPE*)&v);
    return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x145440
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x163a58
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x25, %eax
jne 0x163a60
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x163aca
leaq -0x60(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl -0x18(%rbp), %ecx
movl $0x40, %esi
movb $0x0, %al
callq 0xc4d30
leaq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x163a99
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x163a7f
cmpl $0x8, -0x14(%rbp)
je 0x163aa5
cmpl $0x9, -0x14(%rbp)
jne 0x163ab7
movq -0x68(%rbp), %rdi
callq 0xd7c0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
jmp 0x163ac4
movq -0x68(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x145790
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_sdl.cpp
// Function: ImGui_ImplSDL2_Shutdown()
void ImGui_ImplSDL2_Shutdown()
{
    g_Window = NULL;

    // Destroy last known clipboard data
    if (g_ClipboardTextData)
        SDL_free(g_ClipboardTextData);
    g_ClipboardTextData = NULL;

    // Destroy SDL mouse cursors
    for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
        SDL_FreeCursor(g_MouseCursors[cursor_n]);
    memset(g_MouseCursors, 0, sizeof(g_MouseCursors));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq $0x0, 0xb1795(%rip) # 0x219bf8
cmpq $0x0, 0xb1795(%rip)     # 0x219c00
je 0x168479
movq 0xb178c(%rip), %rdi     # 0x219c00
callq 0xdae0
movq $0x0, 0xb177c(%rip) # 0x219c00
movl $0x0, -0x4(%rbp)
cmpl $0x9, -0x4(%rbp)
jge 0x1684b0
movslq -0x4(%rbp), %rcx
leaq 0xb1774(%rip), %rax     # 0x219c10
movq (%rax,%rcx,8), %rdi
callq 0xd610
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x16848b
leaq 0xb1759(%rip), %rdi     # 0x219c10
xorl %esi, %esi
movl $0x48, %edx
callq 0xd2f0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_sdl.cpp
// Function: ImGui_ImplSDL2_UpdateMouseCursor()
static void ImGui_ImplSDL2_UpdateMouseCursor()
{
    ImGuiIO& io = ImGui::GetIO();
    if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange)
        return;

    ImGuiMouseCursor imgui_cursor = ImGui::GetMouseCursor();
    if (io.MouseDrawCursor || imgui_cursor == ImGuiMouseCursor_None)
    {
        // Hide OS mouse cursor if imgui is drawing it or if it wants no cursor
        SDL_ShowCursor(SDL_FALSE);
    }
    else
    {
        // Show OS mouse cursor
        SDL_SetCursor(g_MouseCursors[imgui_cursor] ? g_MouseCursors[imgui_cursor] : g_MouseCursors[ImGuiMouseCursor_Arrow]);
        SDL_ShowCursor(SDL_TRUE);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0xcb1a0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x1688b1
jmp 0x16891a
callq 0xd5320
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0xc0(%rax)
jne 0x1688cc
cmpl $-0x1, -0xc(%rbp)
jne 0x1688d5
xorl %edi, %edi
callq 0xd7d0
jmp 0x16891a
movslq -0xc(%rbp), %rcx
leaq 0xb1330(%rip), %rax     # 0x219c10
cmpq $0x0, (%rax,%rcx,8)
je 0x1688fc
movslq -0xc(%rbp), %rcx
leaq 0xb131e(%rip), %rax     # 0x219c10
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x168907
movq 0xb130d(%rip), %rax     # 0x219c10
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd6d0
movl $0x1, %edi
callq 0xd7d0
addq $0x20, %rsp
popq %rbp
retq
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_sdl.cpp
// Function: ImGui_ImplSDL2_GetClipboardText(void*)
static const char* ImGui_ImplSDL2_GetClipboardText(void*)
{
    if (g_ClipboardTextData)
        SDL_free(g_ClipboardTextData);
    g_ClipboardTextData = SDL_GetClipboardText();
    return g_ClipboardTextData;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, 0xb0cec(%rip)     # 0x219c00
je 0x168f22
movq 0xb0ce3(%rip), %rdi     # 0x219c00
callq 0xdae0
callq 0xd110
movq %rax, 0xb0cd2(%rip)     # 0x219c00
movq 0xb0ccb(%rip), %rax     # 0x219c00
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_opengl3.cpp
// Function: ImGui_ImplOpenGL3_DestroyDeviceObjects()
void    ImGui_ImplOpenGL3_DestroyDeviceObjects()
{
    if (g_VboHandle)        { glDeleteBuffers(1, &g_VboHandle); g_VboHandle = 0; }
    if (g_ElementsHandle)   { glDeleteBuffers(1, &g_ElementsHandle); g_ElementsHandle = 0; }
    if (g_ShaderHandle && g_VertHandle) { glDetachShader(g_ShaderHandle, g_VertHandle); }
    if (g_ShaderHandle && g_FragHandle) { glDetachShader(g_ShaderHandle, g_FragHandle); }
    if (g_VertHandle)       { glDeleteShader(g_VertHandle); g_VertHandle = 0; }
    if (g_FragHandle)       { glDeleteShader(g_FragHandle); g_FragHandle = 0; }
    if (g_ShaderHandle)     { glDeleteProgram(g_ShaderHandle); g_ShaderHandle = 0; }

    ImGui_ImplOpenGL3_DestroyFontsTexture();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0xb0bc9(%rip)     # 0x219cc4
je 0x16911c
movl $0x1, %edi
leaq 0xb0bbb(%rip), %rsi     # 0x219cc4
movq 0xa4e00(%rip), %rax     # 0x20df10
callq *(%rax)
movl $0x0, 0xb0ba8(%rip)     # 0x219cc4
cmpl $0x0, 0xb0ba5(%rip)     # 0x219cc8
je 0x169144
movl $0x1, %edi
leaq 0xb0b97(%rip), %rsi     # 0x219cc8
movq 0xa4dd8(%rip), %rax     # 0x20df10
callq *(%rax)
movl $0x0, 0xb0b84(%rip)     # 0x219cc8
cmpl $0x0, 0xb0b55(%rip)     # 0x219ca0
je 0x16916e
cmpl $0x0, 0xb0b54(%rip)     # 0x219ca8
je 0x16916e
movq 0xa4e6b(%rip), %rax     # 0x20dfc8
movq (%rax), %rax
movl 0xb0b3a(%rip), %edi     # 0x219ca0
movl 0xb0b3c(%rip), %esi     # 0x219ca8
callq *%rax
cmpl $0x0, 0xb0b2b(%rip)     # 0x219ca0
je 0x169198
cmpl $0x0, 0xb0b2e(%rip)     # 0x219cac
je 0x169198
movq 0xa4e41(%rip), %rax     # 0x20dfc8
movq (%rax), %rax
movl 0xb0b10(%rip), %edi     # 0x219ca0
movl 0xb0b16(%rip), %esi     # 0x219cac
callq *%rax
cmpl $0x0, 0xb0b09(%rip)     # 0x219ca8
je 0x1691bd
movq 0xa4dd0(%rip), %rax     # 0x20df78
movq (%rax), %rax
movl 0xb0af7(%rip), %edi     # 0x219ca8
callq *%rax
movl $0x0, 0xb0aeb(%rip)     # 0x219ca8
cmpl $0x0, 0xb0ae8(%rip)     # 0x219cac
je 0x1691e2
movq 0xa4dab(%rip), %rax     # 0x20df78
movq (%rax), %rax
movl 0xb0ad6(%rip), %edi     # 0x219cac
callq *%rax
movl $0x0, 0xb0aca(%rip)     # 0x219cac
cmpl $0x0, 0xb0ab7(%rip)     # 0x219ca0
je 0x169207
movq 0xa4d3e(%rip), %rax     # 0x20df30
movq (%rax), %rax
movl 0xb0aa5(%rip), %edi     # 0x219ca0
callq *%rax
movl $0x0, 0xb0a99(%rip)     # 0x219ca0
callq 0x16a090
popq %rbp
retq
nop
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_opengl3.cpp
// Function: ImGui_ImplOpenGL3_CreateFontsTexture()
bool ImGui_ImplOpenGL3_CreateFontsTexture()
{
    // Build texture atlas
    ImGuiIO& io = ImGui::GetIO();
    unsigned char* pixels;
    int width, height;
    io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);   // Load as RGBA 32-bit (75% of the memory is wasted, but default font is so small) because it is more likely to be compatible with user's existing shaders. If your ImTextureId represent a higher-level concept than just a GL texture id, consider calling GetTexDataAsAlpha8() instead to save on GPU memory.

    // Upload texture to graphics system
    GLint last_texture;
    glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
    glGenTextures(1, &g_FontTexture);
    glBindTexture(GL_TEXTURE_2D, g_FontTexture);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#ifdef GL_UNPACK_ROW_LENGTH
    glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);

    // Store our identifier
    io.Fonts->TexID = (ImTextureID)(intptr_t)g_FontTexture;

    // Restore state
    glBindTexture(GL_TEXTURE_2D, last_texture);

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
callq 0xcb1a0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdi
leaq -0x10(%rbp), %rsi
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x116480
movl $0x8069, %edi           # imm = 0x8069
leaq -0x1c(%rbp), %rsi
callq 0xd800
movl $0x1, %edi
leaq 0xafcc8(%rip), %rsi     # 0x219ca4
callq 0xd3d0
movl 0xafcbd(%rip), %esi     # 0x219ca4
movl $0xde1, %edi            # imm = 0xDE1
callq 0xdab0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
movl $0x2601, %edx           # imm = 0x2601
callq 0xd740
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
movl $0x2601, %edx           # imm = 0x2601
callq 0xd740
movl $0xcf2, %edi            # imm = 0xCF2
xorl %esi, %esi
callq 0xd930
movl -0x14(%rbp), %ecx
movl -0x18(%rbp), %r8d
movq -0x10(%rbp), %rax
movl $0xde1, %edi            # imm = 0xDE1
xorl %r9d, %r9d
movl $0x1908, %edx           # imm = 0x1908
movl %r9d, %esi
movl $0x1908, (%rsp)         # imm = 0x1908
movl $0x1401, 0x8(%rsp)      # imm = 0x1401
movq %rax, 0x10(%rsp)
callq 0xd9d0
movl 0xafc45(%rip), %eax     # 0x219ca4
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0xdab0
movb $0x1, %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_opengl3.cpp
// Function: ImGui_ImplOpenGL3_DestroyFontsTexture()
void ImGui_ImplOpenGL3_DestroyFontsTexture()
{
    if (g_FontTexture)
    {
        ImGuiIO& io = ImGui::GetIO();
        glDeleteTextures(1, &g_FontTexture);
        io.Fonts->TexID = 0;
        g_FontTexture = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0xafc05(%rip)     # 0x219ca4
je 0x16a0d8
callq 0xcb1a0
movq %rax, -0x8(%rbp)
movl $0x1, %edi
leaq 0xafbee(%rip), %rsi     # 0x219ca4
callq 0xd9b0
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq $0x0, 0x8(%rax)
movl $0x0, 0xafbcc(%rip)     # 0x219ca4
addq $0x10, %rsp
popq %rbp
retq
nop
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_opengl3.cpp
// Function: CheckShader(unsigned int, char const*)
static bool CheckShader(GLuint handle, const char* desc)
{
    GLint status = 0, log_length = 0;
    glGetShaderiv(handle, GL_COMPILE_STATUS, &status);
    glGetShaderiv(handle, GL_INFO_LOG_LENGTH, &log_length);
    if ((GLboolean)status == GL_FALSE)
        fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile %s!\n", desc);
    if (log_length > 1)
    {
        ImVector<char> buf;
        buf.resize((int)(log_length + 1));
        glGetShaderInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
        fprintf(stderr, "%s\n", buf.begin());
    }
    return (GLboolean)status == GL_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq 0xa3dfc(%rip), %rax     # 0x20df00
movq (%rax), %rax
movl -0x4(%rbp), %edi
movl $0x8b81, %esi           # imm = 0x8B81
leaq -0x14(%rbp), %rdx
callq *%rax
movq 0xa3de4(%rip), %rax     # 0x20df00
movq (%rax), %rax
movl -0x4(%rbp), %edi
movl $0x8b84, %esi           # imm = 0x8B84
leaq -0x18(%rbp), %rdx
callq *%rax
movl -0x14(%rbp), %eax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x16a154
movq 0xa3dd9(%rip), %rax     # 0x20df18
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x2724d(%rip), %rsi     # 0x19139a
movb $0x0, %al
callq 0xd1e0
cmpl $0x1, -0x18(%rbp)
jle 0x16a20d
leaq -0x28(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0xed6a0
movq -0x40(%rbp), %rdi
movl -0x18(%rbp), %esi
incl %esi
callq 0xe84f0
jmp 0x16a17b
movq 0xa3d3e(%rip), %rax     # 0x20dec0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xeea00
movq %rax, -0x48(%rbp)
jmp 0x16a1a4
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edi
xorl %edx, %edx
callq *%rax
jmp 0x16a1b8
movq 0xa3d59(%rip), %rax     # 0x20df18
movq (%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xeea00
movq %rax, -0x60(%rbp)
jmp 0x16a1d5
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rdi
leaq 0x18a1f(%rip), %rsi     # 0x182c03
movb $0x0, %al
callq 0xd1e0
leaq -0x28(%rbp), %rdi
callq 0xed8a0
jmp 0x16a20d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xed8a0
jmp 0x16a221
movl -0x14(%rbp), %eax
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0xd620
nopw (%rax,%rax)
// File: Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_opengl3.cpp
// Function: CheckProgram(unsigned int, char const*)
static bool CheckProgram(GLuint handle, const char* desc)
{
    GLint status = 0, log_length = 0;
    glGetProgramiv(handle, GL_LINK_STATUS, &status);
    glGetProgramiv(handle, GL_INFO_LOG_LENGTH, &log_length);
    if ((GLboolean)status == GL_FALSE)
        fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link %s! (with GLSL '%s')\n", desc, g_GlslVersionString);
    if (log_length > 1)
    {
        ImVector<char> buf;
        buf.resize((int)(log_length + 1));
        glGetProgramInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
        fprintf(stderr, "%s\n", buf.begin());
    }
    return (GLboolean)status == GL_TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq 0xa3c74(%rip), %rax     # 0x20dec8
movq (%rax), %rax
movl -0x4(%rbp), %edi
movl $0x8b82, %esi           # imm = 0x8B82
leaq -0x14(%rbp), %rdx
callq *%rax
movq 0xa3c5c(%rip), %rax     # 0x20dec8
movq (%rax), %rax
movl -0x4(%rbp), %edi
movl $0x8b84, %esi           # imm = 0x8B84
leaq -0x18(%rbp), %rdx
callq *%rax
movl -0x14(%rbp), %eax
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x16a2ab
movq 0xa3c89(%rip), %rax     # 0x20df18
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x27142(%rip), %rsi     # 0x1913df
leaq 0xaf9dc(%rip), %rcx     # 0x219c80
movb $0x0, %al
callq 0xd1e0
cmpl $0x1, -0x18(%rbp)
jle 0x16a356
leaq -0x28(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0xed6a0
movq -0x40(%rbp), %rdi
movl -0x18(%rbp), %esi
incl %esi
callq 0xe84f0
jmp 0x16a2d2
movq 0xa3c6f(%rip), %rax     # 0x20df48
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xeea00
movl -0x50(%rbp), %edi
movl -0x4c(%rbp), %esi
movq %rax, %rcx
movq -0x48(%rbp), %rax
xorl %edx, %edx
callq *%rax
jmp 0x16a308
movq 0xa3c09(%rip), %rax     # 0x20df18
movq (%rax), %rax
movq %rax, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xeea00
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x188d6(%rip), %rsi     # 0x182c03
movb $0x0, %al
callq 0xd1e0
leaq -0x28(%rbp), %rdi
callq 0xed8a0
jmp 0x16a356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xed8a0
jmp 0x16a36a
movl -0x14(%rbp), %eax
movzbl %al, %eax
cmpl $0x1, %eax
sete %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0xd620
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_23.cc
// Function: literal_strcat(char const*, char const*)
char* literal_strcat(const char* str1, const char* str2)
{
	// dynamically allocated array of char
	char* ret = new char[strlen(str1) + strlen(str2) + 1];
	strcat(ret, str1);
	strcat(ret, str2);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1050
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1050
movq -0x20(%rbp), %rdi
addq %rax, %rdi
addq $0x1, %rdi
callq 0x1030
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x1110
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1110
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_23.cc
// Function: main
int main(int argc, char const *argv[])
{
	const char* str1 = "Hello ";
	const char* str2 = "World!";

	char* str3 = literal_strcat(str1, str2);
	cout << str3 << endl;
	delete [] str3;

	string str4 = "Hello ";
	string str5 = "World!";

	cout << library_strcat(str4, str5) << endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xcd4(%rip), %rax       # 0x2004
movq %rax, -0x18(%rbp)
leaq 0xcd0(%rip), %rax       # 0x200b
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1270
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
movq 0x2c7d(%rip), %rdi      # 0x3fd8
callq 0x1090
movq %rax, %rdi
movq 0x2c5e(%rip), %rsi      # 0x3fc8
callq 0x10a0
movq -0x28(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x138c
movq -0xb0(%rbp), %rdi
callq 0x10c0
leaq -0x49(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x1100
movq -0xb8(%rbp), %rdx
leaq 0xc5a(%rip), %rsi       # 0x2004
leaq -0x48(%rbp), %rdi
callq 0x10d0
jmp 0x13b5
leaq -0x49(%rbp), %rdi
callq 0x10b0
leaq -0x81(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x1100
movq -0xc0(%rbp), %rdx
leaq 0xc2c(%rip), %rsi       # 0x200b
leaq -0x80(%rbp), %rdi
callq 0x10d0
jmp 0x13ea
leaq -0x81(%rbp), %rdi
callq 0x10b0
leaq -0xa8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x12d0
jmp 0x140c
movq 0x2bc5(%rip), %rdi      # 0x3fd8
leaq -0xa8(%rbp), %rsi
callq 0x1080
movq %rax, -0xc8(%rbp)
jmp 0x1428
movq -0xc8(%rbp), %rdi
movq 0x2b92(%rip), %rsi      # 0x3fc8
callq 0x10a0
jmp 0x143d
leaq -0xa8(%rbp), %rdi
callq 0x1060
movl $0x0, -0x4(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1060
leaq -0x48(%rbp), %rdi
callq 0x1060
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x10b0
jmp 0x14d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x10b0
jmp 0x14ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1060
leaq -0x80(%rbp), %rdi
callq 0x1060
leaq -0x48(%rbp), %rdi
callq 0x1060
movq -0x58(%rbp), %rdi
callq 0x10f0
// File: tomfunkhouser[P]gaps/apps/msh2pts/msh2pts.cpp
// Function: main
int
main(int argc, char **argv)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Parse args
  if(!ParseArgs(argc, argv)) exit(-1);

  // Read mesh
  R3Mesh *mesh = ReadMesh(mesh_name);
  if (!mesh) exit(-1);

  // Read property 
  R3MeshProperty *property = NULL;
  if (property_name) {
    property = ReadProperty(mesh, property_name);
    if (!property) exit(-1);
  }

  // Select points
  RNArray<Point *> *points = SelectPoints(mesh, property, selection_method);
  if (!points) exit(-1);

  // Write points
  if (!WritePoints(mesh, *points, points_name)) exit(-1);

  // Print message
  if (print_verbose) {
    fprintf(stdout, "Finished in %6.3f seconds.\n", start_time.Elapsed());
    fflush(stdout);
  }

  // Return success
  return 0;
}

// Assembly:
subq $0x48, %rsp
movl $0x0, 0x44(%rsp)
movl %edi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xe7be0
leaq 0x28(%rsp), %rdi
callq 0x1b2d0
movl 0x40(%rsp), %edi
movq 0x38(%rsp), %rsi
callq 0x13380
cmpl $0x0, %eax
jne 0x13276
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf610
movq 0x17e35b(%rip), %rdi    # 0x1915d8
callq 0x13df0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x13299
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf610
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x17e336(%rip)    # 0x1915e0
je 0x132d6
movq 0x20(%rsp), %rdi
movq 0x17e328(%rip), %rsi    # 0x1915e0
callq 0x13f50
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x132d4
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf610
jmp 0x132d6
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x17521a(%rip), %edx    # 0x188500
callq 0x14170
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x13302
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf610
movq 0x20(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x17e2d5(%rip), %rdx    # 0x1915e8
callq 0x12530
cmpl $0x0, %eax
jne 0x13327
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xf610
cmpl $0x0, 0x17e2a2(%rip)    # 0x1915d0
je 0x1336b
movq 0x174c59(%rip), %rax    # 0x187f90
movq (%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xe7ca0
movq 0x8(%rsp), %rdi
leaq 0x136e37(%rip), %rsi    # 0x14a18c
movb $0x1, %al
callq 0xf740
movq 0x174c2d(%rip), %rax    # 0x187f90
movq (%rax), %rdi
callq 0xf5e0
xorl %eax, %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/msh2pts/msh2pts.cpp
// Function: SelectCenterOfMass(gaps::R3Mesh*)
static RNArray<Point *> *
SelectCenterOfMass(R3Mesh *mesh)
{
  // Allocate array of points
  RNArray<Point *> *points = new RNArray<Point *>();
  if (!points) {
    RNFail("Unable to allocate array of points\n");
    return NULL;
  }

  // Compute mesh center of mass
  R3Point mesh_centroid = mesh->Centroid();

  // Insert mesh centroid
  Point *point = new Point(mesh_centroid, R3zero_vector);
  points->Insert(point);

  // Return points
  return points;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movl $0x10, %edi
callq 0xf4d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0x1b5a0
jmp 0x19145
movq 0x18(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x19195
leaq 0x1314b1(%rip), %rdi    # 0x14a60f
movb $0x0, %al
callq 0xebe00
movq $0x0, 0x60(%rsp)
jmp 0x19215
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
movl $0x10, %esi
callq 0xf4e0
jmp 0x1921f
movq 0x58(%rsp), %rsi
leaq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x416b0
movl $0x48, %edi
callq 0xf4d0
movq 0x8(%rsp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x5796d6(%rip), %rdx    # 0x5928a0
callq 0x1b4e0
jmp 0x191d1
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1b540
movq 0x50(%rsp), %rax
movq %rax, 0x60(%rsp)
jmp 0x19215
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
movl $0x48, %esi
callq 0xf4e0
jmp 0x1921f
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0xf8a0
nopl (%rax)
// File: tomfunkhouser[P]gaps/apps/msh2pts/msh2pts.cpp
// Function: SelectVertexClosestToCenterOfMass(gaps::R3Mesh*)
static RNArray<Point *> *
SelectVertexClosestToCenterOfMass(R3Mesh *mesh)
{
  // Allocate array of points
  RNArray<Point *> *points = new RNArray<Point *>();
  if (!points) {
    RNFail("Unable to allocate array of points\n");
    return NULL;
  }

  // Compute mesh center of mass
  R3Point mesh_centroid = mesh->Centroid();

  // Find closest vertex 
  RNScalar closest_d = FLT_MAX;
  R3MeshVertex *closest_vertex = NULL;
  for (int i = 0; i < mesh->NVertices(); i++) {
    R3MeshVertex *vertex = mesh->Vertex(i);
    const R3Point& position = mesh->VertexPosition(vertex);
    RNScalar d = R3Distance(position, mesh_centroid);
    if (d < closest_d) {
      closest_vertex = vertex;
      closest_d = d;
    }
  }

  // Insert closest vertex
  assert(closest_vertex);
  Point *point = new Point(mesh, closest_vertex);
  points->Insert(point);

  // Return points
  return points;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x88(%rsp)
movl $0x10, %edi
callq 0xf4d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
callq 0x1b5a0
jmp 0x1925b
movq 0x18(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x80(%rsp)
jne 0x192b4
leaq 0x131395(%rip), %rdi    # 0x14a60f
movb $0x0, %al
callq 0xebe00
movq $0x0, 0x90(%rsp)
jmp 0x193f6
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
movl $0x10, %esi
callq 0xf4e0
jmp 0x19406
movq 0x88(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x416b0
movsd 0x130d3a(%rip), %xmm0   # 0x14a008
movsd %xmm0, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x88(%rsp), %rdi
callq 0x1b460
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x19380
movq 0x88(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x1b5b0
movq %rax, 0x38(%rsp)
movq 0x88(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x1b740
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3a600
movsd %xmm0, 0x28(%rsp)
movsd 0x28(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1936e
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x19370
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x192e5
movl $0x48, %edi
callq 0xf4d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
movq 0x88(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x1b650
jmp 0x193a9
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x1b540
movq 0x80(%rsp), %rax
movq %rax, 0x90(%rsp)
jmp 0x193f6
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
movl $0x48, %esi
callq 0xf4e0
jmp 0x19406
movq 0x90(%rsp), %rax
addq $0x98, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0xf8a0
// File: tomfunkhouser[P]gaps/apps/msh2pts/msh2pts.cpp
// Function: CompareScaleSpaceScores(void const*, void const*)
static int
CompareScaleSpaceScores(const void *s1, const void *s2)
{
  const ScaleSpaceScore *score1 = (const ScaleSpaceScore *) s1;
  const ScaleSpaceScore *score2 = (const ScaleSpaceScore *) s2;
  RNScalar delta = score1->score - score2->score;
  if (delta > 0) return -1;
  else if (delta < 0) return 1;
  else return 0;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x20(%rsp), %rax
movsd 0x8(%rax), %xmm0
movq -0x28(%rsp), %rax
subsd 0x8(%rax), %xmm0
movsd %xmm0, -0x30(%rsp)
movsd -0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1a9e1
movl $0xffffffff, -0x4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1a9fe
xorps %xmm0, %xmm0
ucomisd -0x30(%rsp), %xmm0
jbe 0x1a9f6
movl $0x1, -0x4(%rsp)
jmp 0x1a9fe
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/apps/msh2pts/../../pkgs/R3Shapes/R3Kdtree.cpp
// Function: gaps::R3Kdtree<Point*>::FindAny(gaps::R3Point const&, double, double) const
PtrType R3Kdtree<PtrType>::
FindAny(const R3Point& query_position, 
  RNScalar min_distance, RNScalar max_distance) const
{
  // Check root
  if (!root) return NULL;

  // Use squared distances for efficiency
  if (max_distance < 0) return NULL;
  if (min_distance < 0) min_distance = 0;
  RNLength min_distance_squared = min_distance * min_distance;
  RNLength max_distance_squared = max_distance * max_distance;

  // Search nodes recursively
  return FindAny(root, bbox, 
    NULL, query_position, 
    min_distance_squared, max_distance_squared,
    NULL, NULL);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movsd %xmm0, 0x28(%rsp)
movsd %xmm1, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x50(%rax)
jne 0x1bf99
movq $0x0, 0x40(%rsp)
jmp 0x1c01e
xorps %xmm0, %xmm0
ucomisd 0x20(%rsp), %xmm0
jbe 0x1bfaf
movq $0x0, 0x40(%rsp)
jmp 0x1c01e
xorps %xmm0, %xmm0
ucomisd 0x28(%rsp), %xmm0
jbe 0x1bfc3
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x8(%rsp), %rdx
movsd 0x28(%rsp), %xmm0
mulsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
mulsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x50(%rdx), %rsi
movq 0x30(%rsp), %r8
movsd 0x18(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
xorl %eax, %eax
movl %eax, %r9d
movq %rdx, %rdi
movq %r9, %rcx
movq $0x0, (%rsp)
callq 0x1c330
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopl (%rax,%rax)
// File: dmonaldo[P]simple-network-file-system/BasicFileSys.cpp
// Function: BasicFileSys::mount()
void BasicFileSys::mount()
{
  // mount the disk
  bool new_disk = disk.mount("DISK");

  // if the disk exists, return as no further initialization is needed
  if (!new_disk) return;

  // initialize the superblock
  struct superblock_t super_block;
  super_block.bitmap[0] = 0x3;		// mark blocks 0 and 1 as used
  for (int i = 1; i < BLOCK_SIZE; i++) {
    super_block.bitmap[i] = 0;
  }
  disk.write_block(0, (void *) &super_block);

  // initialize the root directory
  struct dirblock_t dir_block;
  dir_block.magic = DIR_MAGIC_NUM;
  dir_block.num_entries = 0;
  for (int i = 0; i < MAX_DIR_ENTRIES; i++) {
    dir_block.dir_entries[i].block_num = 0;
  }
  disk.write_block(1, (void *) &dir_block);

  // write a zeroed-out data block to all other blocks on disk
  struct datablock_t data_block;
  for (int i = 0; i < BLOCK_SIZE; i++) {
    data_block.data[i] = 0;
  }
  for (int i = 2; i < NUM_BLOCKS; i++) {
    disk.write_block(i, (void *) &data_block);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
leaq 0x8743(%rip), %rsi      # 0xc004
callq 0x3c80
andb $0x1, %al
movb %al, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x38d6
jmp 0x3a0d
movb $0x3, -0x89(%rbp)
movl $0x1, -0x90(%rbp)
cmpl $0x80, -0x90(%rbp)
jge 0x3913
movslq -0x90(%rbp), %rax
movb $0x0, -0x89(%rbp,%rax)
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x38e7
movq -0x1a8(%rbp), %rdi
xorl %esi, %esi
leaq -0x89(%rbp), %rdx
callq 0x3e50
movl $0xffffffff, -0x110(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x10c(%rbp)
movl $0x0, -0x114(%rbp)
cmpl $0xa, -0x114(%rbp)
jge 0x397f
leaq -0x110(%rbp), %rax
addq $0x8, %rax
movslq -0x114(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movw $0x0, 0xa(%rax)
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x3946
movq -0x1a8(%rbp), %rdi
movl $0x1, %esi
leaq -0x110(%rbp), %rdx
callq 0x3e50
movl $0x0, -0x198(%rbp)
cmpl $0x80, -0x198(%rbp)
jge 0x39cd
movslq -0x198(%rbp), %rax
movb $0x0, -0x194(%rbp,%rax)
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
jmp 0x39a1
movl $0x2, -0x19c(%rbp)
cmpl $0x400, -0x19c(%rbp)    # imm = 0x400
jge 0x3a0d
movq -0x1a8(%rbp), %rdi
movl -0x19c(%rbp), %esi
leaq -0x194(%rbp), %rdx
callq 0x3e50
movl -0x19c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0x39d7
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dmonaldo[P]simple-network-file-system/BasicFileSys.cpp
// Function: BasicFileSys::get_free_block()
short BasicFileSys::get_free_block()
{
  // get superblock
  struct superblock_t super_block;
  disk.read_block(0, (void *) &super_block);
  
  // look for first available block
  for (int byte = 0; byte < BLOCK_SIZE; byte++) {

    // check to see if byte has available slot
    if (super_block.bitmap[byte] != 0xFF) {
 
      // loop to check each bit
      for (int bit = 0; bit < 8; bit++) {
        int mask = 1 << bit;
	if (mask & ~super_block.bitmap[byte]) {

          // Available block is found: set bit in bitmap, write result back
	  // to superblock, and return block number.
	  super_block.bitmap[byte] |= mask;
	  disk.write_block(0, (void *) &super_block);
	  return (byte * 8) + bit;
	}
      }
    }
  }

  // disk is full
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
xorl %esi, %esi
leaq -0x90(%rbp), %rdx
callq 0x3d40
movl $0x0, -0x94(%rbp)
cmpl $0x80, -0x94(%rbp)
jge 0x3b5b
movslq -0x94(%rbp), %rax
movzbl -0x90(%rbp,%rax), %eax
cmpl $0xff, %eax
je 0x3b45
movl $0x0, -0x98(%rbp)
cmpl $0x8, -0x98(%rbp)
jge 0x3b43
movl -0x98(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movslq -0x94(%rbp), %rcx
movzbl -0x90(%rbp,%rcx), %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x3b2d
movq -0xa8(%rbp), %rdi
movl -0x9c(%rbp), %edx
movslq -0x94(%rbp), %rax
movzbl -0x90(%rbp,%rax), %ecx
orl %edx, %ecx
movb %cl, -0x90(%rbp,%rax)
xorl %esi, %esi
leaq -0x90(%rbp), %rdx
callq 0x3e50
movl -0x94(%rbp), %eax
shll $0x3, %eax
addl -0x98(%rbp), %eax
movw %ax, -0x2(%rbp)
jmp 0x3b61
jmp 0x3b2f
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x3aa6
jmp 0x3b45
jmp 0x3b47
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x3a72
movw $0x0, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0xb0, %rsp
popq %rbp
retq
nop
// File: dmonaldo[P]simple-network-file-system/BasicFileSys.cpp
// Function: BasicFileSys::reclaim_block(short)
void BasicFileSys::reclaim_block(short block_num)
{
  // get superblock
  struct superblock_t super_block;
  disk.read_block(0, (void *) &super_block);

  // clear bit
  int byte = block_num / 8;		// byte number
  int bit = block_num % 8;		// bit number
  unsigned char mask = ~(1 << bit);	// mask to clear bit
  super_block.bitmap[byte] &= mask;

  // write back superblock
  disk.write_block(0, (void *) &super_block);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
xorl %esi, %esi
leaq -0x8a(%rbp), %rdx
callq 0x3d40
movq -0xa0(%rbp), %rdi
movswl -0xa(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x90(%rbp)
movswl -0xa(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x94(%rbp)
movl -0x94(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
xorl $-0x1, %eax
movb %al, -0x95(%rbp)
movzbl -0x95(%rbp), %edx
movslq -0x90(%rbp), %rax
movzbl -0x8a(%rbp,%rax), %ecx
andl %edx, %ecx
movb %cl, -0x8a(%rbp,%rax)
xorl %esi, %esi
leaq -0x8a(%rbp), %rdx
callq 0x3e50
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dmonaldo[P]simple-network-file-system/Disk.cpp
// Function: Disk::mount(char const*)
bool Disk::mount(const char *file_name)
{
  fd = open(file_name, O_RDWR);
  if (fd != -1) return false;

  fd = open(file_name, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    cerr << "Could not create disk" << endl;
    exit(-1);
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x3290
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $-0x1, (%rax)
je 0x3cbb
movb $0x0, -0x1(%rbp)
jmp 0x3d0d
movq -0x18(%rbp), %rdi
movl $0xc2, %esi
movl $0x180, %edx            # imm = 0x180
movb $0x0, %al
callq 0x3290
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $-0x1, (%rax)
jne 0x3d09
movq 0xc30c(%rip), %rdi      # 0xfff0
leaq 0x831e(%rip), %rsi      # 0xc009
callq 0x3340
movq %rax, %rdi
movq 0xc2ae(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: dmonaldo[P]simple-network-file-system/Disk.cpp
// Function: Disk::read_block(int, void*)
void Disk::read_block(int block_num, void *block)
{
  off_t offset;
  off_t new_offset;
  ssize_t size; 

  if (block_num < 0 || block_num >= NUM_BLOCKS) {
    cerr << "Invalid block size" << endl;
    exit(-1);
  }

  offset = block_num * BLOCK_SIZE;
  new_offset = lseek(fd, offset, SEEK_SET);
  if (offset != new_offset) {
    cerr << "Seek failure" << endl;
    exit(-1);
  }

  size = read(fd, block, BLOCK_SIZE);
  if (size != BLOCK_SIZE) {
    cerr << "Failed to read entire block" << endl;
    exit(-1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x3d6a
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jl 0x3d96
movq 0xc27f(%rip), %rdi      # 0xfff0
leaq 0x82a7(%rip), %rsi      # 0xc01f
callq 0x3340
movq %rax, %rdi
movq 0xc221(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
movq -0x38(%rbp), %rax
movl -0xc(%rbp), %ecx
shll $0x7, %ecx
movslq %ecx, %rcx
movq %rcx, -0x20(%rbp)
movl (%rax), %edi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x35c0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x3dee
movq 0xc227(%rip), %rdi      # 0xfff0
leaq 0x8262(%rip), %rsi      # 0xc032
callq 0x3340
movq %rax, %rdi
movq 0xc1c9(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
movq -0x38(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movl $0x80, %edx
callq 0x3490
movq %rax, -0x30(%rbp)
cmpq $0x80, -0x30(%rbp)
je 0x3e3c
movq 0xc1d9(%rip), %rdi      # 0xfff0
leaq 0x8221(%rip), %rsi      # 0xc03f
callq 0x3340
movq %rax, %rdi
movq 0xc17b(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: dmonaldo[P]simple-network-file-system/Disk.cpp
// Function: Disk::write_block(int, void*)
void Disk::write_block(int block_num, void *block)
{
  off_t offset;
  off_t new_offset;
  ssize_t size; 

  if (block_num < 0 || block_num >= NUM_BLOCKS) {
    cerr << "Invalid block size" << endl;
    exit(-1);
  }

  offset = block_num * BLOCK_SIZE;
  new_offset = lseek(fd, offset, SEEK_SET);
  if (offset != new_offset) {
    cerr << "Seek failure" << endl;
    exit(-1);
  }

  size = write(fd, block, BLOCK_SIZE);
  if (size != BLOCK_SIZE) {
    cerr << "Failed to write entire block" << endl;
    exit(-1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x3e7a
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jl 0x3ea6
movq 0xc16f(%rip), %rdi      # 0xfff0
leaq 0x8197(%rip), %rsi      # 0xc01f
callq 0x3340
movq %rax, %rdi
movq 0xc111(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
movq -0x38(%rbp), %rax
movl -0xc(%rbp), %ecx
shll $0x7, %ecx
movslq %ecx, %rcx
movq %rcx, -0x20(%rbp)
movl (%rax), %edi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x35c0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x3efe
movq 0xc117(%rip), %rdi      # 0xfff0
leaq 0x8152(%rip), %rsi      # 0xc032
callq 0x3340
movq %rax, %rdi
movq 0xc0b9(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
movq -0x38(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movl $0x80, %edx
callq 0x3150
movq %rax, -0x30(%rbp)
cmpq $0x80, -0x30(%rbp)
je 0x3f4c
movq 0xc0c9(%rip), %rdi      # 0xfff0
leaq 0x812d(%rip), %rsi      # 0xc05b
callq 0x3340
movq %rax, %rdi
movq 0xc06b(%rip), %rsi      # 0xffa8
callq 0x3390
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3410
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: dmonaldo[P]simple-network-file-system/FileSys.cpp
// Function: FileSys::mount(int)
void FileSys::mount(int sock) {
  bfs.mount();

  // by default current directory is home directory, in disk block #1
  curr_dir = 1;

  // use this socket to receive file system operations from the client and
  // send back response messages
  fs_sock = sock;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x38a0
movq -0x18(%rbp), %rax
movw $0x1, 0x4(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)