LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginTabItem(char const*, bool*, int)
bool    ImGui::BeginTabItem(const char* label, bool* p_open, ImGuiTabItemFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return false;
    }
    IM_ASSERT(!(flags & ImGuiTabItemFlags_Button)); // BeginTabItem() Can't be used with button flags, use TabItemButton() instead!

    bool ret = TabItemEx(tab_bar, label, p_open, flags);
    if (ret && !(flags & ImGuiTabItemFlags_NoPushId))
    {
        ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
        PushOverrideID(tab->ID); // We already hashed 'label' so push into the ID stack directly instead of doing another hash through PushID(label)
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x56fff(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
je 0x8ccf8
xorl %eax, %eax
jmp 0x8cd41
movq 0x2108(%rax), %r14
testq %r14, %r14
je 0x8cd46
movl %edx, %ebx
btl $0x15, %edx
jb 0x8cd65
movq %rsi, %rdx
movq %rdi, %rsi
movq %r14, %rdi
movl %ebx, %ecx
callq 0x8cd84
movl %eax, %ecx
xorb $0x1, %cl
andl $0x8, %ebx
shrl $0x3, %ebx
orb %cl, %bl
jne 0x8cd41
movswl 0x70(%r14), %esi
movq %r14, %rdi
callq 0x4bc4e
movl (%rax), %edi
callq 0x42f94
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2d235(%rip), %rdi     # 0xb9f82
leaq 0x2b634(%rip), %rsi     # 0xb8388
leaq 0x2d270(%rip), %rcx     # 0xb9fcb
movl $0x1d5e, %edx           # imm = 0x1D5E
callq 0xc140
leaq 0x2d370(%rip), %rdi     # 0xba0dc
leaq 0x2b615(%rip), %rsi     # 0xb8388
leaq 0x2d251(%rip), %rcx     # 0xb9fcb
movl $0x1d61, %edx           # imm = 0x1D61
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndTabItem()
void    ImGui::EndTabItem()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return;
    }
    IM_ASSERT(tab_bar->LastTabItemIdx >= 0);
    ImGuiTabItem* tab = &tab_bar->Tabs[tab_bar->LastTabItemIdx];
    if (!(tab->Flags & ImGuiTabItemFlags_NoPushId))
        PopID();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x56766(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rcx
cmpb $0x0, 0x93(%rcx)
jne 0x8d5b2
movq 0x2108(%rax), %rdi
testq %rdi, %rdi
je 0x8d5b4
movswl 0x70(%rdi), %esi
testl %esi, %esi
js 0x8d5d3
callq 0x4bc4e
testb $0x8, 0x4(%rax)
jne 0x8d5b2
popq %rbp
jmp 0x42fea
popq %rbp
retq
leaq 0x2ca52(%rip), %rdi     # 0xba00d
leaq 0x2adc6(%rip), %rsi     # 0xb8388
leaq 0x2ca97(%rip), %rcx     # 0xba060
movl $0x1d76, %edx           # imm = 0x1D76
callq 0xc140
leaq 0x2ca9f(%rip), %rdi     # 0xba079
leaq 0x2ada7(%rip), %rsi     # 0xb8388
leaq 0x2ca78(%rip), %rcx     # 0xba060
movl $0x1d79, %edx           # imm = 0x1D79
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabItemButton(char const*, int)
bool    ImGui::TabItemButton(const char* label, ImGuiTabItemFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return false;

    ImGuiTabBar* tab_bar = g.CurrentTabBar;
    if (tab_bar == NULL)
    {
        IM_ASSERT_USER_ERROR(tab_bar != NULL, "Needs to be called between BeginTabBar() and EndTabBar()!");
        return false;
    }
    return TabItemEx(tab_bar, label, NULL, flags | ImGuiTabItemFlags_Button | ImGuiTabItemFlags_NoReorder);
}

// Assembly:
leaq 0x566e7(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rdx
cmpb $0x0, 0x93(%rdx)
je 0x8d60f
xorl %eax, %eax
retq
movl %esi, %ecx
movq %rdi, %rsi
movq 0x2108(%rax), %rdi
testq %rdi, %rdi
je 0x8d62d
orl $0x200020, %ecx         # imm = 0x200020
xorl %edx, %edx
jmp 0x8cd84
pushq %rbp
movq %rsp, %rbp
leaq 0x2c9d5(%rip), %rdi     # 0xba00d
leaq 0x2ad49(%rip), %rsi     # 0xb8388
leaq 0x2ca50(%rip), %rcx     # 0xba096
movl $0x1d89, %edx           # imm = 0x1D89
callq 0xc140
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabBarCalcTabID(ImGuiTabBar*, char const*)
static ImU32   ImGui::TabBarCalcTabID(ImGuiTabBar* tab_bar, const char* label)
{
    if (tab_bar->Flags & ImGuiTabBarFlags_DockNode)
    {
        ImGuiID id = ImHashStr(label);
        KeepAliveID(id);
        return id;
    }
    else
    {
        ImGuiWindow* window = GImGui->CurrentWindow;
        return window->GetID(label);
    }
}

// Assembly:
testb $0x10, 0x12(%rdi)
jne 0x8d66e
leaq 0x56683(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rdi
xorl %edx, %edx
jmp 0x3700a
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3479a
movl %eax, %ebx
movl %eax, %edi
callq 0x370fd
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::TabItemCalcSize(char const*, bool)
ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button)
{
    ImGuiContext& g = *GImGui;
    ImVec2 label_size = CalcTextSize(label, NULL, true);
    ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f);
    if (has_close_button)
        size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle.
    else
        size.x += g.Style.FramePadding.x + 1.0f;
    return ImVec2(ImMin(size.x, TabBarCalcMaxTabWidth()), size.y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leaq 0x5663b(%rip), %r14     # 0xe3ce0
movq (%r14), %r15
pushq $0x1
popq %rdx
movss 0xe93d(%rip), %xmm0     # 0x9bff0
xorl %esi, %esi
callq 0x365e8
movaps %xmm0, %xmm1
movss 0x1598(%r15), %xmm0
movss 0x159c(%r15), %xmm2
testl %ebx, %ebx
je 0x8d6e7
movss 0x15b0(%r15), %xmm3
addss 0x1980(%r15), %xmm3
jmp 0x8d6ef
movss 0xe909(%rip), %xmm3     # 0x9bff8
addss %xmm0, %xmm3
addss %xmm1, %xmm0
addss %xmm3, %xmm0
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm2, %xmm2
movq (%r14), %rax
movss 0x1980(%rax), %xmm3
mulss 0xf226(%rip), %xmm3     # 0x9c93c
addss %xmm1, %xmm2
minss %xmm3, %xmm0
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::SetTabItemClosed(char const*)
void    ImGui::SetTabItemClosed(const char* label)
{
    ImGuiContext& g = *GImGui;
    bool is_within_manual_tab_bar = g.CurrentTabBar && !(g.CurrentTabBar->Flags & ImGuiTabBarFlags_DockNode);
    if (is_within_manual_tab_bar)
    {
        ImGuiTabBar* tab_bar = g.CurrentTabBar;
        ImGuiID tab_id = TabBarCalcTabID(tab_bar, label);
        if (ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, tab_id))
            tab->WantClose = true; // Will be processed by next call to TabBarLayout()
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x55f92(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x2108(%rax), %rbx
testq %rbx, %rbx
je 0x8dd81
testb $0x10, 0x12(%rbx)
jne 0x8dd81
movq %rdi, %rsi
movq %rbx, %rdi
callq 0x8d650
movq %rbx, %rdi
movl %eax, %esi
callq 0x8cadd
testq %rax, %rax
je 0x8dd81
movb $0x1, 0x22(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_text_makeundo_replace(ImGuiInputTextState*, ImStb::STB_TexteditState*, int, int, int)
static void stb_text_makeundo_replace(STB_TEXTEDIT_STRING *str, STB_TexteditState *state, int where, int old_length, int new_length)
{
   int i;
   STB_TEXTEDIT_CHARTYPE *p = stb_text_createundo(&state->undostate, where, old_length, new_length);
   if (p) {
      for (i=0; i < old_length; ++i)
         p[i] = STB_TEXTEDIT_GETCHAR(str, where+i);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r12d
movq %rdi, %r14
leaq 0x20(%rsi), %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x8e3e4
testq %rax, %rax
je 0x8dddd
movq %rax, %r15
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
movl %r12d, %r12d
cmpq %r13, %rbx
je 0x8dddd
leal (%r12,%r13), %esi
movq %r14, %rdi
callq 0x8e281
movw %ax, (%r15,%r13,2)
incq %r13
jmp 0x8ddc2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImStb::STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState*, int, int)
static void STB_TEXTEDIT_DELETECHARS(STB_TEXTEDIT_STRING* obj, int pos, int n)
{
    ImWchar* dst = obj->TextW.Data + pos;

    // We maintain our buffer length in both UTF-8 and wchar formats
    obj->Edited = true;
    obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n);
    obj->CurLenW -= n;

    // Offset remaining text (FIXME-OPT: Use memmove)
    const ImWchar* src = obj->TextW.Data + pos + n;
    while (ImWchar c = *src++)
        *dst++ = c;
    *dst = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r14
movslq %esi, %r15
leaq (%r14,%r15,2), %rdi
movb $0x1, 0xe7e(%rbx)
movslq %edx, %r12
leaq (%rdi,%r12,2), %rsi
callq 0x34bb3
subl %eax, 0x8(%rbx)
subl %r12d, 0x4(%rbx)
addq %r12, %r12
addq 0x18(%rbx), %r12
addq %r15, %r15
movzwl (%r12,%r15), %eax
testw %ax, %ax
je 0x8de3e
movw %ax, (%r14,%r15)
addq $0x2, %r15
jmp 0x8de29
andw $0x0, (%r14,%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_delete_selection(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_delete_selection(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   stb_textedit_clamp(str, state);
   if (STB_TEXT_HAS_SELECTION(state)) {
      if (state->select_start < state->select_end) {
         stb_textedit_delete(str, state, state->select_start, state->select_end - state->select_start);
         state->select_end = state->cursor = state->select_start;
      } else {
         stb_textedit_delete(str, state, state->select_end, state->select_start - state->select_end);
         state->select_start = state->cursor = state->select_end;
      }
      state->has_preferred_x = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x8e08f
leaq 0x4(%rbx), %r12
movl 0x4(%rbx), %edx
movl 0x8(%rbx), %ecx
leaq 0x8(%rbx), %r15
movl %edx, %eax
subl %ecx, %eax
je 0x8e01e
jge 0x8dffe
subl %edx, %ecx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8e359
movq %r12, %rax
jmp 0x8e013
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
movl %eax, %ecx
callq 0x8e359
movq %r15, %rax
movq %r12, %r15
movl (%rax), %eax
movl %eax, (%r15)
movl %eax, (%rbx)
movb $0x0, 0x16(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_move_to_first(ImStb::STB_TexteditState*)
static void stb_textedit_move_to_first(STB_TexteditState *state)
{
   if (STB_TEXT_HAS_SELECTION(state)) {
      stb_textedit_sortselection(state);
      state->cursor = state->select_start;
      state->select_end = state->select_start;
      state->has_preferred_x = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
cmpl %ecx, %eax
je 0x8e057
jle 0x8e04e
movl %ecx, 0x4(%rdi)
movl %ecx, %eax
movl %eax, (%rdi)
movl %eax, 0x8(%rdi)
movb $0x0, 0x16(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_move_to_last(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_move_to_last(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   if (STB_TEXT_HAS_SELECTION(state)) {
      stb_textedit_sortselection(state);
      stb_textedit_clamp(str, state);
      state->cursor = state->select_end;
      state->select_start = state->select_end;
      state->has_preferred_x = 0;
   }
}

// Assembly:
movl 0x4(%rsi), %eax
movl 0x8(%rsi), %ecx
cmpl %ecx, %eax
je 0x8e08e
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
jle 0x8e074
movl %eax, 0x8(%rbx)
movl %ecx, 0x4(%rbx)
movq %rbx, %rsi
callq 0x8e08f
movl 0x8(%rbx), %eax
movl %eax, (%rbx)
movl %eax, 0x4(%rbx)
movb $0x0, 0x16(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_clamp(ImGuiInputTextState*, ImStb::STB_TexteditState*)
static void stb_textedit_clamp(STB_TEXTEDIT_STRING *str, STB_TexteditState *state)
{
   int n = STB_TEXTEDIT_STRINGLEN(str);
   if (STB_TEXT_HAS_SELECTION(state)) {
      if (state->select_start > n) state->select_start = n;
      if (state->select_end   > n) state->select_end = n;
      // if clamping forced them to be equal, move the cursor to match
      if (state->select_start == state->select_end)
         state->cursor = state->select_start;
   }
   if (state->cursor > n) state->cursor = n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %eax
movl 0x4(%rsi), %ecx
movl 0x8(%rsi), %edx
cmpl %edx, %ecx
je 0x8e0b8
cmpl %eax, %ecx
jle 0x8e0a9
movl %eax, 0x4(%rsi)
movl %eax, %ecx
cmpl %eax, %edx
jle 0x8e0b2
movl %eax, 0x8(%rsi)
movl %eax, %edx
cmpl %edx, %ecx
jne 0x8e0b8
movl %ecx, (%rsi)
cmpl %eax, (%rsi)
jle 0x8e0be
movl %eax, (%rsi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImStb::STB_TEXTEDIT_LAYOUTROW(ImStb::StbTexteditRow*, ImGuiInputTextState*, int)
static void    STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, STB_TEXTEDIT_STRING* obj, int line_start_idx)
{
    const ImWchar* text = obj->TextW.Data;
    const ImWchar* text_remaining = NULL;
    const ImVec2 size = InputTextCalcTextSizeW(text + line_start_idx, text + obj->CurLenW, &text_remaining, NULL, true);
    r->x0 = 0.0f;
    r->x1 = size.x;
    r->baseline_y_delta = size.y;
    r->ymin = 0.0f;
    r->ymax = size.y;
    r->num_chars = (int)(text_remaining - (text + line_start_idx));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rsi), %rax
leaq -0x20(%rbp), %r14
andq $0x0, (%r14)
movslq %edx, %rcx
leaq (%rax,%rcx,2), %r15
movslq 0x4(%rsi), %rcx
leaq (%rax,%rcx,2), %rsi
pushq $0x1
popq %rcx
movq %r15, %rdi
movq %r14, %rdx
callq 0x84f81
andl $0x0, (%rbx)
movss %xmm0, 0x4(%rbx)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, 0x8(%rbx)
andl $0x0, 0xc(%rbx)
movss %xmm0, 0x10(%rbx)
movq (%r14), %rax
subq %r15, %rax
shrq %rax
movl %eax, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_text_createundo(ImStb::StbUndoState*, int, int, int)
static STB_TEXTEDIT_CHARTYPE *stb_text_createundo(StbUndoState *state, int pos, int insert_len, int delete_len)
{
   StbUndoRecord *r = stb_text_create_undo_record(state, insert_len);
   if (r == NULL)
      return NULL;

   r->where = pos;
   r->insert_length = (STB_TEXTEDIT_POSITIONTYPE) insert_len;
   r->delete_length = (STB_TEXTEDIT_POSITIONTYPE) delete_len;

   if (insert_len == 0) {
      r->char_storage = -1;
      return NULL;
   } else {
      r->char_storage = state->undo_char_point;
      state->undo_char_point += insert_len;
      return &state->undo_char[r->char_storage];
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movw $0x63, 0xe00(%rdi)
movl $0x3e7, 0xe08(%rdi)     # imm = 0x3E7
cmpw $0x63, 0xdfe(%rdi)
jne 0x8e420
movq %rbx, %rdi
callq 0x8e4a9
cmpl $0x3e7, %r15d           # imm = 0x3E7
jle 0x8e43a
andw $0x0, 0xdfe(%rbx)
andl $0x0, 0xe04(%rbx)
jmp 0x8e49e
movl 0xe04(%rbx), %ecx
leal (%rcx,%r15), %eax
cmpl $0x3e8, %eax            # imm = 0x3E8
jl 0x8e455
movq %rbx, %rdi
callq 0x8e4a9
jmp 0x8e43a
movswq 0xdfe(%rbx), %rsi
leal 0x1(%rsi), %edx
movw %dx, 0xdfe(%rbx)
shlq $0x4, %rsi
leaq (%rbx,%rsi), %rdx
movl %r12d, (%rbx,%rsi)
movl %r15d, 0x4(%rbx,%rsi)
movl %r14d, 0x8(%rbx,%rsi)
testl %r15d, %r15d
je 0x8e49a
movslq %ecx, %rcx
movl %ecx, 0xc(%rdx)
movl %eax, 0xe04(%rbx)
leaq (%rbx,%rcx,2), %rax
addq $0x630, %rax            # imm = 0x630
jmp 0x8e4a0
orl $-0x1, 0xc(%rdx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imstb_textedit.h
// Function: ImStb::stb_textedit_discard_undo(ImStb::StbUndoState*)
static void stb_textedit_discard_undo(StbUndoState *state)
{
   if (state->undo_point > 0) {
      // if the 0th undo state has characters, clean those up
      if (state->undo_rec[0].char_storage >= 0) {
         int n = state->undo_rec[0].insert_length, i;
         // delete n characters from all other records
         state->undo_char_point -= n;
         STB_TEXTEDIT_memmove(state->undo_char, state->undo_char + n, (size_t) (state->undo_char_point*sizeof(STB_TEXTEDIT_CHARTYPE)));
         for (i=0; i < state->undo_point; ++i)
            if (state->undo_rec[i].char_storage >= 0)
               state->undo_rec[i].char_storage -= n; // @OPTIMIZE: get rid of char_storage and infer it
      }
      --state->undo_point;
      STB_TEXTEDIT_memmove(state->undo_rec, state->undo_rec+1, (size_t) (state->undo_point*sizeof(state->undo_rec[0])));
   }
}

// Assembly:
movzwl 0xdfe(%rdi), %eax
testw %ax, %ax
jle 0x8e549
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0xc(%rdi)
js 0x8e528
movslq 0x4(%rbx), %r14
movslq 0xe04(%rbx), %rdx
subq %r14, %rdx
movl %edx, 0xe04(%rbx)
leaq 0x630(%rbx), %rdi
leaq (%rbx,%r14,2), %rsi
addq $0x630, %rsi            # imm = 0x630
addq %rdx, %rdx
callq 0xc130
movzwl 0xdfe(%rbx), %eax
xorl %ecx, %ecx
testw %ax, %ax
movl %eax, %edx
cmovlel %ecx, %edx
movzwl %dx, %edx
shll $0x4, %edx
cmpq %rcx, %rdx
je 0x8e528
movl 0xc(%rbx,%rcx), %esi
testl %esi, %esi
js 0x8e522
subl %r14d, %esi
movl %esi, 0xc(%rbx,%rcx)
addq $0x10, %rcx
jmp 0x8e50e
decl %eax
movw %ax, 0xdfe(%rbx)
leaq 0x10(%rbx), %rsi
movswq %ax, %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xc130
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movl 0x4(%rdi), %ecx
xorl %eax, %eax
testb %cl, %cl
sets %al
incl %eax
xorl %edx, %edx
testb $0x40, %cl
cmovnel %edx, %eax
movl 0x4(%rsi), %ecx
xorl %r8d, %r8d
testb %cl, %cl
sets %r8b
incl %r8d
testb $0x40, %cl
cmovnel %edx, %r8d
subl %r8d, %eax
jne 0x8e766
movswl 0x20(%rdi), %eax
movswl 0x20(%rsi), %ecx
subl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
testl %edi, %edi
js 0x8e7ad
cmpl $0x9, %edi
ja 0x8e7b7
movl %edi, %eax
leaq 0x29b6a(%rip), %rcx     # 0xb8310
movss (%rcx,%rax,4), %xmm0
jmp 0x8e7b5
movss 0x278ff(%rip), %xmm0    # 0xb60b4
popq %rbp
retq
negl %edi
cvtsi2ss %edi, %xmm1
movss 0xd857(%rip), %xmm0     # 0x9c01c
popq %rbp
jmp 0xc770
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r14
movl (%rsi), %eax
andl %edx, %eax
cmpl %edx, %eax
sete -0x21(%rbp)
setne %cl
testl %eax, %eax
setne %al
testb %al, %cl
jne 0x8e87b
leaq -0x21(%rbp), %rsi
callq 0x7bae6
jmp 0x8e8b8
leaq 0x5545e(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %r15
movb $0x1, 0x90(%r15)
movl 0x1cc(%r15), %r12d
movl %r12d, %eax
orl $0x40, %eax
movl %eax, 0x1cc(%r15)
leaq -0x21(%rbp), %rsi
callq 0x7bae6
movl %r12d, 0x1cc(%r15)
testb %al, %al
je 0x8e8c7
cmpb $0x1, -0x21(%rbp)
jne 0x8e8cb
orl (%r14), %ebx
jmp 0x8e8d0
xorl %eax, %eax
jmp 0x8e8d5
notl %ebx
andl (%r14), %ebx
movl %ebx, (%r14)
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: float ImGui::RoundScalarWithFormatT<float, float>(char const*, int, float)
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
pushq %rbx
subq $0x58, %rsp
movaps %xmm0, -0x20(%rbp)
movl %esi, %ebx
callq 0x809e0
cmpb $0x25, (%rax)
jne 0x94a4f
cmpb $0x25, 0x1(%rax)
jne 0x94a5a
movaps -0x20(%rbp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
cvtss2sd -0x20(%rbp), %xmm0
leaq -0x60(%rbp), %rdi
pushq $0x40
popq %rsi
movq %rax, %rdx
movb $0x1, %al
callq 0x3468c
leaq -0x61(%rbp), %rdi
movb 0x1(%rdi), %al
incq %rdi
cmpb $0x20, %al
je 0x94a74
andl $-0x2, %ebx
cmpl $0x8, %ebx
jne 0x94a91
callq 0xc730
cvtsd2ss %xmm0, %xmm0
jmp 0x94a53
xorl %ecx, %ecx
cmpb $0x2d, %al
sete %cl
xorl %edx, %edx
cmpb $0x2b, (%rdi,%rcx)
sete %dl
addq %rcx, %rdi
addq %rdx, %rdi
xorps %xmm0, %xmm0
movss 0x756a(%rip), %xmm2     # 0x9c01c
movb (%rdi), %cl
addb $-0x30, %cl
cmpb $0x9, %cl
ja 0x94ad0
movsbl %cl, %ecx
cvtsi2ss %ecx, %xmm1
incq %rdi
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
jmp 0x94ab2
cmpb $0x2d, %al
jne 0x94a53
xorps 0x7501(%rip), %xmm0     # 0x9bfe0
jmp 0x94a53
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
andq $0x0, 0x5525d(%rip)     # 0xea7e8
movq 0x5525e(%rip), %rdi     # 0xea7f0
testq %rdi, %rdi
je 0x9559c
callq 0xc9c0
andq $0x0, 0x5524c(%rip)     # 0xea7f0
xorl %ebx, %ebx
leaq 0x55253(%rip), %r14     # 0xea800
cmpq $0x48, %rbx
je 0x955c2
movq (%rbx,%r14), %rdi
callq 0xc570
addq $0x8, %rbx
jmp 0x955ad
xorps %xmm0, %xmm0
movaps %xmm0, 0x55264(%rip)    # 0xea830
movaps %xmm0, 0x5524d(%rip)    # 0xea820
movaps %xmm0, 0x55236(%rip)    # 0xea810
movaps %xmm0, 0x5521f(%rip)    # 0xea800
andq $0x0, 0x55257(%rip)     # 0xea840
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movq 0x54bd4(%rip), %rdi     # 0xea7f0
testq %rdi, %rdi
je 0x95c26
callq 0xc9c0
callq 0xc0e0
movq %rax, 0x54bbe(%rip)     # 0xea7f0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, 0x54b34(%rip)     # 0xea8b4
je 0x95d9c
movq 0x49197(%rip), %rax     # 0xdef20
leaq 0x54b24(%rip), %rsi     # 0xea8b4
pushq $0x1
popq %rdi
callq *(%rax)
andl $0x0, 0x54b18(%rip)     # 0xea8b4
cmpl $0x0, 0x54b15(%rip)     # 0xea8b8
je 0x95dbf
movq 0x49174(%rip), %rax     # 0xdef20
leaq 0x54b05(%rip), %rsi     # 0xea8b8
pushq $0x1
popq %rdi
callq *(%rax)
andl $0x0, 0x54af9(%rip)     # 0xea8b8
movl 0x54acb(%rip), %edi     # 0xea890
testl %edi, %edi
setne %al
movl 0x54ac8(%rip), %esi     # 0xea898
testl %esi, %esi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x95deb
movq 0x491ed(%rip), %rax     # 0xdefd0
callq *(%rax)
movl 0x54aa5(%rip), %edi     # 0xea890
testl %edi, %edi
setne %al
movl 0x54aa6(%rip), %esi     # 0xea89c
testl %esi, %esi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x95e0b
movq 0x491c7(%rip), %rax     # 0xdefd0
callq *(%rax)
movl 0x54a87(%rip), %edi     # 0xea898
testl %edi, %edi
je 0x95e25
movq 0x4916c(%rip), %rax     # 0xdef88
callq *(%rax)
andl $0x0, 0x54a73(%rip)     # 0xea898
movl 0x54a71(%rip), %edi     # 0xea89c
testl %edi, %edi
je 0x95e3f
movq 0x49152(%rip), %rax     # 0xdef88
callq *(%rax)
andl $0x0, 0x54a5d(%rip)     # 0xea89c
movl 0x54a4b(%rip), %edi     # 0xea890
testl %edi, %edi
je 0x95e59
movq 0x490f0(%rip), %rax     # 0xdef40
callq *(%rax)
andl $0x0, 0x54a37(%rip)     # 0xea890
popq %rbp
jmp 0x96a98
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x37e82
movq %rax, %rbx
movq 0xa0(%rax), %rdi
leaq -0x40(%rbp), %r14
leaq -0x34(%rbp), %r12
leaq -0x30(%rbp), %r13
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x65f88
leaq -0x2c(%rbp), %r15
movl $0x8069, %edi           # imm = 0x8069
movq %r15, %rsi
callq 0xc780
leaq 0x53ea8(%rip), %rsi     # 0xea894
pushq $0x1
popq %rdi
callq 0xc330
movl 0x53e9a(%rip), %esi     # 0xea894
movl $0xde1, %edi            # imm = 0xDE1
callq 0xc990
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
movl $0x2601, %edx           # imm = 0x2601
callq 0xc6c0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
movl $0x2601, %edx           # imm = 0x2601
callq 0xc6c0
movl $0xcf2, %edi            # imm = 0xCF2
xorl %esi, %esi
callq 0xc870
movl (%r12), %ecx
movl (%r13), %r8d
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x1908, %edx           # imm = 0x1908
xorl %r9d, %r9d
pushq (%r14)
pushq $0x1401                 # imm = 0x1401
pushq $0x1908                 # imm = 0x1908
callq 0xc900
addq $0x20, %rsp
movl 0x53e25(%rip), %eax     # 0xea894
movq 0xa0(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl (%r15), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0xc990
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
cmpl $0x0, 0x53df5(%rip)     # 0xea894
je 0x96ad7
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x37e82
movq %rax, %rbx
leaq 0x53dde(%rip), %rsi     # 0xea894
pushq $0x1
popq %rdi
callq 0xc8f0
movq 0xa0(%rbx), %rax
andq $0x0, 0x8(%rax)
andl $0x0, 0x53dc3(%rip)     # 0xea894
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq -0x44(%rbp), %r15
andl $0x0, (%r15)
leaq -0x2c(%rbp), %r12
andl $0x0, (%r12)
movq 0x4840a(%rip), %r13     # 0xdef10
movl $0x8b81, %esi           # imm = 0x8B81
movq %r15, %rdx
callq *(%r13)
movl %ebx, %edi
movl $0x8b84, %esi           # imm = 0x8B84
movq %r12, %rdx
callq *(%r13)
cmpb $0x0, (%r15)
je 0x96b3d
movl -0x2c(%rbp), %esi
cmpl $0x2, %esi
jge 0x96b5a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x483e4(%rip), %rax     # 0xdef28
movq (%rax), %rdi
leaq 0x244b8(%rip), %rsi     # 0xbb006
movq %r14, %rdx
xorl %eax, %eax
callq 0xc1a0
jmp 0x96b26
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
incl %esi
callq 0x49cb6
movq 0x4835e(%rip), %rax     # 0xdeed0
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
movl %ebx, %edi
xorl %edx, %edx
callq *(%rax)
movq 0x483a2(%rip), %rax     # 0xdef28
movq (%rax), %rdi
leaq -0x40(%rbp), %rbx
movq 0x8(%rbx), %rdx
leaq 0x15d6b(%rip), %rsi     # 0xac903
xorl %eax, %eax
callq 0xc1a0
movq %rbx, %rdi
callq 0x4be3a
jmp 0x96b2e
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x4be3a
movq %rbx, %rdi
callq 0xc580
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
leaq 0xd3d(%rip), %r14       # 0x2004
leaq 0xd3d(%rip), %rbx       # 0x200b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x124c
movq %rax, %r15
movq 0x2cf5(%rip), %rdi      # 0x3fd8
movq %rax, %rsi
callq 0x10a0
movq %rax, %rdi
callq 0x1070
movq %r15, %rdi
callq 0x10b0
leaq -0x78(%rbp), %rdi
leaq -0x58(%rbp), %rdx
movq %r14, %rsi
callq 0x1040
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rdx
movq %rbx, %rsi
callq 0x1040
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x139c
movq 0x2ca5(%rip), %rdi      # 0x3fd8
leaq -0x38(%rbp), %rsi
callq 0x1090
movq %rax, %rdi
callq 0x1070
leaq -0x38(%rbp), %rdi
callq 0x1060
leaq -0x58(%rbp), %rdi
callq 0x1060
leaq -0x78(%rbp), %rdi
callq 0x1060
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1382
movq %rax, %rbx
jmp 0x138b
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x1060
leaq -0x58(%rbp), %rdi
callq 0x1060
leaq -0x78(%rbp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O2/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:
movapd %xmm0, %xmm2
movq 0x50(%rdi), %rax
testq %rax, %rax
sete %cl
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
seta %dl
orb %cl, %dl
je 0x14ad6
xorl %eax, %eax
retq
pushq %rax
movq %rsi, %r8
maxsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
andq $0x0, (%rsp)
movq %rax, %rsi
movq %rdi, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x14bd4
popq %rcx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rdi, %rbx
leaq 0x4983(%rip), %rsi      # 0x8004
callq 0x381c
testb %al, %al
je 0x3728
movb $0x3, 0x80(%rsp)
pushq $0x1
popq %rax
cmpq $0x80, %rax
je 0x36ae
movb $0x0, 0x80(%rsp,%rax)
incq %rax
jmp 0x3699
leaq 0x80(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x391a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, (%rsp)
pushq $0x12
popq %rax
cmpq $0x8a, %rax
je 0x36df
andw $0x0, (%rsp,%rax)
addq $0xc, %rax
jmp 0x36cc
pushq $0x1
popq %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x391a
xorl %eax, %eax
cmpq $0x80, %rax
je 0x3704
movb $0x0, 0x100(%rsp,%rax)
incq %rax
jmp 0x36ef
pushq $0x2
popq %rbp
leaq 0x100(%rsp), %r14
cmpl $0x400, %ebp            # imm = 0x400
je 0x3728
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x391a
incl %ebp
jmp 0x370f
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsp, %rdx
xorl %esi, %esi
callq 0x388e
pushq $0x1
popq %rdx
xorl %eax, %eax
cmpq $0x80, %rax
je 0x37b1
movzbl (%rsp,%rax), %esi
cmpl $0xff, %esi
je 0x3784
xorl %ebp, %ebp
cmpl $0x8, %ebp
je 0x3784
movl %edx, %edi
movl %ebp, %ecx
shll %cl, %edi
btl %ebp, %esi
jae 0x378d
incl %ebp
jmp 0x3770
incq %rax
addl $-0x8, %r14d
jmp 0x375a
orl %edi, %esi
movb %sil, (%rsp,%rax)
movq %rsp, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x391a
subl %r14d, %ebp
movl %ebp, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x37a3
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x80, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq %rsp, %r14
xorl %esi, %esi
movq %r14, %rdx
callq 0x388e
movl %ebp, %eax
andb $0x7, %bpl
pushq $0x1
popq %rsi
movl %ebp, %ecx
shll %cl, %esi
cwtd
movw $0x8, %cx
idivw %cx
movswq %ax, %rax
notb %sil
andb %sil, (%rsp,%rax)
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x391a
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x31e0
movl %eax, %ebp
movl %eax, (%rbx)
cmpl $-0x1, %eax
jne 0x3857
movq %r14, %rdi
movl $0xc2, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x31e0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0x3862
cmpl $-0x1, %ebp
sete %al
popq %rbx
popq %r14
popq %rbp
retq
movq 0x7787(%rip), %rdi      # 0xaff0
leaq 0x4799(%rip), %rsi      # 0x8009
callq 0x3270
movq %rax, %rdi
callq 0x3160
pushq $-0x1
popq %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
cmpl $0x400, %esi            # imm = 0x400
jae 0x38d7
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
shll $0x7, %r15d
movl (%rdi), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3450
cmpq %r15, %rax
jne 0x38e7
movl (%r14), %edi
movl $0x80, %edx
movq %rbx, %rsi
callq 0x3360
cmpq $0x80, %rax
jne 0x38f7
popq %rbx
popq %r14
popq %r15
retq
movq 0x7712(%rip), %rdi      # 0xaff0
leaq 0x473a(%rip), %rsi      # 0x801f
jmp 0x3905
movq 0x7702(%rip), %rdi      # 0xaff0
leaq 0x473d(%rip), %rsi      # 0x8032
jmp 0x3905
movq 0x76f2(%rip), %rdi      # 0xaff0
leaq 0x473a(%rip), %rsi      # 0x803f
callq 0x3270
movq %rax, %rdi
callq 0x3160
pushq $-0x1
popq %rdi
callq 0x32f0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
cmpl $0x400, %esi            # imm = 0x400
jae 0x3963
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
shll $0x7, %r15d
movl (%rdi), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3450
cmpq %r15, %rax
jne 0x3973
movl (%r14), %edi
movl $0x80, %edx
movq %rbx, %rsi
callq 0x3110
cmpq $0x80, %rax
jne 0x3983
popq %rbx
popq %r14
popq %r15
retq
movq 0x7686(%rip), %rdi      # 0xaff0
leaq 0x46ae(%rip), %rsi      # 0x801f
jmp 0x3991
movq 0x7676(%rip), %rdi      # 0xaff0
leaq 0x46b1(%rip), %rsi      # 0x8032
jmp 0x3991
movq 0x7666(%rip), %rdi      # 0xaff0
leaq 0x46ca(%rip), %rsi      # 0x805b
callq 0x3270
movq %rax, %rdi
callq 0x3160
pushq $-0x1
popq %rdi
callq 0x32f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x366c
movw $0x1, 0x4(%r14)
movl %ebx, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dmonaldo[P]simple-network-file-system/FileSys.cpp
// Function: FileSys::cd(char const*)
void FileSys::cd(const char *name)
{
  bool error = false;
  bool found = false;
  char buffer[256];

  //retrieve current directory data block
  dirblock_t dir_ptr;
  bfs.read_block(curr_dir, (void *) &dir_ptr);

  //check if any sub directories exist in current directory
  if(dir_ptr.num_entries > 0){
    //check each sub directory and check directory names for match
    for(int i= 1; i <= dir_ptr.num_entries; i++){
      if(strcmp(dir_ptr.dir_entries[i].name, name) == 0){
        found = true;
        if(!is_directory(dir_ptr.dir_entries[i].block_num)){
          error = true;
          strcat(buffer, "500 File is not a directory\r\n");
        }
        else{
          strcat(buffer, "200 OK\r\n");
          curr_dir = dir_ptr.dir_entries[i].block_num;
        }
      }
    }
  }
  // if this point reached, no matching directory found
  if(found && !error){
    strcat(buffer, "503 File does not exist\r\n");
  }
  cout << buffer << endl;
  send(fs_sock, buffer, sizeof(buffer), 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rsi, %r14
movq %rdi, %rbx
movswl 0x4(%rdi), %esi
leaq 0x108(%rsp), %r15
movq %r15, %rdx
callq 0x380e
movl 0x4(%r15), %eax
testl %eax, %eax
je 0x3ce3
pushq $0x1
popq %r13
leaq 0x11c(%rsp), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movl %eax, %eax
cmpq %rax, %r13
ja 0x3cb8
movq %r15, %rdi
movq %r14, %rsi
callq 0x3350
testl %eax, %eax
jne 0x3ca8
movswl 0xa(%r15), %esi
movq %rbx, %rdi
callq 0x3d22
movl %eax, %ebp
movq %rsp, %rdi
callq 0x3140
addq %rsp, %rax
testb %bpl, %bpl
je 0x3c8d
movabsq $0xa0d4b4f20303032, %rcx # imm = 0xA0D4B4F20303032
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
movzwl 0xa(%r15), %eax
movw %ax, 0x4(%rbx)
jmp 0x3ca5
movups 0x4465(%rip), %xmm0     # 0x80f9
movups %xmm0, 0xe(%rax)
movups 0x444c(%rip), %xmm0     # 0x80eb
movups %xmm0, (%rax)
movb $0x1, %r12b
movb $0x1, %bpl
incq %r13
movl 0x10c(%rsp), %eax
addq $0xc, %r15
jmp 0x3c3c
notb %bpl
orb %r12b, %bpl
testb $0x1, %bpl
jne 0x3ce3
movq %rsp, %rdi
callq 0x3140
movups 0x4436(%rip), %xmm0     # 0x8109
movups %xmm0, (%rsp,%rax)
movups 0x4435(%rip), %xmm0     # 0x8113
movups %xmm0, 0xa(%rsp,%rax)
movq 0x72d6(%rip), %rdi      # 0xafc0
movq %rsp, %r14
movq %r14, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3160
movl 0x8(%rbx), %edi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x3170
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop