// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableHeader(char const*)
void ImGui::TableHeader(const char* label)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    if (window->SkipItems)
        return;

    ImGuiTable* table = g.CurrentTable;
    IM_ASSERT(table != NULL && "Need to call TableHeader() after BeginTable()!");
    IM_ASSERT(table->CurrentColumn != -1);
    const int column_n = table->CurrentColumn;
    ImGuiTableColumn* column = &table->Columns[column_n];

    // Label
    if (label == NULL)
        label = "";
    const char* label_end = FindRenderedTextEnd(label);
    ImVec2 label_size = CalcTextSize(label, label_end, true);
    ImVec2 label_pos = window->DC.CursorPos;

    // If we already got a row height, there's use that.
    // FIXME-TABLE: Padding problem if the correct outer-padding CellBgRect strays off our ClipRect?
    ImRect cell_r = TableGetCellBgRect(table, column_n);
    float label_height = ImMax(label_size.y, table->RowMinHeight - table->CellPaddingY * 2.0f);

    // Calculate ideal size for sort order arrow
    float w_arrow = 0.0f;
    float w_sort_text = 0.0f;
    char sort_order_suf[4] = "";
    const float ARROW_SCALE = 0.65f;
    if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
    {
        w_arrow = ImFloor(g.FontSize * ARROW_SCALE + g.Style.FramePadding.x);
        if (column->SortOrder > 0)
        {
            ImFormatString(sort_order_suf, IM_ARRAYSIZE(sort_order_suf), "%d", column->SortOrder + 1);
            w_sort_text = g.Style.ItemInnerSpacing.x + CalcTextSize(sort_order_suf).x;
        }
    }

    // We feed our unclipped width to the column without writing on CursorMaxPos, so that column is still considering for merging.
    float max_pos_x = label_pos.x + label_size.x + w_sort_text + w_arrow;
    column->ContentMaxXHeadersUsed = ImMax(column->ContentMaxXHeadersUsed, column->WorkMaxX);
    column->ContentMaxXHeadersIdeal = ImMax(column->ContentMaxXHeadersIdeal, max_pos_x);

    // Keep header highlighted when context menu is open.
    const bool selected = (table->IsContextPopupOpen && table->ContextPopupColumn == column_n && table->InstanceInteracted == table->InstanceCurrent);
    ImGuiID id = window->GetID(label);
    ImRect bb(cell_r.Min.x, cell_r.Min.y, cell_r.Max.x, ImMax(cell_r.Max.y, cell_r.Min.y + label_height + g.Style.CellPadding.y * 2.0f));
    ItemSize(ImVec2(0.0f, label_height)); // Don't declare unclipped width, it'll be fed ContentMaxPosHeadersIdeal
    if (!ItemAdd(bb, id))
        return;

    //GetForegroundDrawList()->AddRect(cell_r.Min, cell_r.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
    //GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]

    // Using AllowItemOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items.
    bool hovered, held;
    bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowItemOverlap);
    if (g.ActiveId != id)
        SetItemAllowOverlap();
    if (held || hovered || selected)
    {
        const ImU32 col = GetColorU32(held ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
        //RenderFrame(bb.Min, bb.Max, col, false, 0.0f);
        TableSetBgColor(ImGuiTableBgTarget_CellBg, col, table->CurrentColumn);
        RenderNavHighlight(bb, id, ImGuiNavHighlightFlags_TypeThin | ImGuiNavHighlightFlags_NoRounding);
    }
    else
    {
        // Submit single cell bg color in the case we didn't submit a full header row
        if ((table->RowFlags & ImGuiTableRowFlags_Headers) == 0)
            TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_TableHeaderBg), table->CurrentColumn);
    }
    if (held)
        table->HeldHeaderColumn = (ImGuiTableColumnIdx)column_n;
    window->DC.CursorPos.y -= g.Style.ItemSpacing.y * 0.5f;

    // Drag and drop to re-order columns.
    // FIXME-TABLE: Scroll request while reordering a column and it lands out of the scrolling zone.
    if (held && (table->Flags & ImGuiTableFlags_Reorderable) && IsMouseDragging(0) && !g.DragDropActive)
    {
        // While moving a column it will jump on the other side of the mouse, so we also test for MouseDelta.x
        table->ReorderColumn = (ImGuiTableColumnIdx)column_n;
        table->InstanceInteracted = table->InstanceCurrent;

        // We don't reorder: through the frozen<>unfrozen line, or through a column that is marked with ImGuiTableColumnFlags_NoReorder.
        if (g.IO.MouseDelta.x < 0.0f && g.IO.MousePos.x < cell_r.Min.x)
            if (ImGuiTableColumn* prev_column = (column->PrevEnabledColumn != -1) ? &table->Columns[column->PrevEnabledColumn] : NULL)
                if (!((column->Flags | prev_column->Flags) & ImGuiTableColumnFlags_NoReorder))
                    if ((column->IndexWithinEnabledSet < table->FreezeColumnsRequest) == (prev_column->IndexWithinEnabledSet < table->FreezeColumnsRequest))
                        table->ReorderColumnDir = -1;
        if (g.IO.MouseDelta.x > 0.0f && g.IO.MousePos.x > cell_r.Max.x)
            if (ImGuiTableColumn* next_column = (column->NextEnabledColumn != -1) ? &table->Columns[column->NextEnabledColumn] : NULL)
                if (!((column->Flags | next_column->Flags) & ImGuiTableColumnFlags_NoReorder))
                    if ((column->IndexWithinEnabledSet < table->FreezeColumnsRequest) == (next_column->IndexWithinEnabledSet < table->FreezeColumnsRequest))
                        table->ReorderColumnDir = +1;
    }

    // Sort order arrow
    const float ellipsis_max = cell_r.Max.x - w_arrow - w_sort_text;
    if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
    {
        if (column->SortOrder != -1)
        {
            float x = ImMax(cell_r.Min.x, cell_r.Max.x - w_arrow - w_sort_text);
            float y = label_pos.y;
            if (column->SortOrder > 0)
            {
                PushStyleColor(ImGuiCol_Text, GetColorU32(ImGuiCol_Text, 0.70f));
                RenderText(ImVec2(x + g.Style.ItemInnerSpacing.x, y), sort_order_suf);
                PopStyleColor();
                x += w_sort_text;
            }
            RenderArrow(window->DrawList, ImVec2(x, y), GetColorU32(ImGuiCol_Text), column->SortDirection == ImGuiSortDirection_Ascending ? ImGuiDir_Up : ImGuiDir_Down, ARROW_SCALE);
        }

        // Handle clicking on column header to adjust Sort Order
        if (pressed && table->ReorderColumn != column_n)
        {
            ImGuiSortDirection sort_direction = TableGetColumnNextSortDirection(column);
            TableSetColumnSortDirection(column_n, sort_direction, g.IO.KeyShift);
        }
    }

    // Render clipped label. Clipping here ensure that in the majority of situations, all our header cells will
    // be merged into a single draw call.
    //window->DrawList->AddCircleFilled(ImVec2(ellipsis_max, label_pos.y), 40, IM_COL32_WHITE);
    RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);

    const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
    if (text_clipped && hovered && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay)
        SetTooltip("%.*s", (int)(label_end - label), label);

    // We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
    if (IsMouseReleased(1) && IsItemHovered())
        TableOpenContextMenu(column_n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
leaq 0xe02fa(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x93(%rax)
je 0x132c6e
jmp 0x133695
movq -0x10(%rbp), %rax
movq 0x20a8(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0xda(%rbp)
je 0x132c96
movb $0x1, %al
movb %al, -0xda(%rbp)
jmp 0x132c96
movb -0xda(%rbp), %al
testb $0x1, %al
jne 0x132ca2
jmp 0x132ca4
jmp 0x132cc3
leaq 0x5a5e3(%rip), %rdi     # 0x18d28e
leaq 0x592f0(%rip), %rsi     # 0x18bfa2
movl $0xabc, %edx            # imm = 0xABC
leaq 0x5a614(%rip), %rcx     # 0x18d2d2
callq 0xd180
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x74(%rax)
je 0x132ccf
jmp 0x132cee
leaq 0x5a622(%rip), %rdi     # 0x18d2f8
leaq 0x592c5(%rip), %rsi     # 0x18bfa2
movl $0xabd, %edx            # imm = 0xABD
leaq 0x5a5e9(%rip), %rcx     # 0x18d2d2
callq 0xd180
movq -0x20(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movl -0x24(%rbp), %esi
callq 0xeea20
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x132d1e
leaq 0x3f1ef(%rip), %rax     # 0x171f09
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc8090
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x1, %edx
movss 0x3f23c(%rip), %xmm0    # 0x171f80
callq 0xc87e0
movlpd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x131200
movlpd %xmm0, -0x58(%rbp)
movlpd %xmm1, -0x50(%rbp)
movss -0x3c(%rbp), %xmm0
movq -0x20(%rbp), %rax
movss 0x84(%rax), %xmm2
movq -0x20(%rbp), %rax
movss 0xc0(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
addss %xmm1, %xmm1
addss %xmm2, %xmm1
callq 0x12a620
movss %xmm0, -0x5c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x64(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0xd2f0
movss 0x3f9b5(%rip), %xmm0    # 0x17278c
movss %xmm0, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x132ebc
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x132ebc
movq -0x10(%rbp), %rax
movss 0x1980(%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0x1598(%rax), %xmm1
movss 0x3f969(%rip), %xmm2    # 0x17278c
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0x12cdc0
movss %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %rax
movsbl 0x56(%rax), %eax
cmpl $0x0, %eax
jle 0x132eba
movq -0x30(%rbp), %rax
movsbl 0x56(%rax), %ecx
incl %ecx
leaq 0x46b74(%rip), %rdx     # 0x1799c7
xorl %eax, %eax
movl %eax, -0xe4(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
movl $0x4, %esi
callq 0xc4d30
movq -0xf0(%rbp), %rdi
movl -0xe4(%rbp), %edx
movq -0x10(%rbp), %rax
movss 0x15b0(%rax), %xmm0
movss %xmm0, -0xe0(%rbp)
movl %edx, %esi
movss 0x3f0e5(%rip), %xmm0    # 0x171f80
callq 0xc87e0
movaps %xmm0, %xmm1
movss -0xe0(%rbp), %xmm0
movlpd %xmm1, -0x74(%rbp)
addss -0x74(%rbp), %xmm0
movss %xmm0, -0x64(%rbp)
jmp 0x132ebc
movss -0x48(%rbp), %xmm0
addss -0x40(%rbp), %xmm0
addss -0x64(%rbp), %xmm0
addss -0x60(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
movq -0x30(%rbp), %rax
movss 0x48(%rax), %xmm0
movq -0x30(%rbp), %rax
movss 0x38(%rax), %xmm1
callq 0x12a620
movq -0x30(%rbp), %rax
movss %xmm0, 0x48(%rax)
movq -0x30(%rbp), %rax
movss 0x4c(%rax), %xmm0
movss -0x78(%rbp), %xmm1
callq 0x12a620
movq -0x30(%rbp), %rax
movss %xmm0, 0x4c(%rax)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x24d(%rcx)
movb %al, -0xf1(%rbp)
je 0x132f59
movq -0x20(%rbp), %rax
movsbl 0x23f(%rax), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0xf1(%rbp)
jne 0x132f59
movq -0x20(%rbp), %rax
movswl 0x7a(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x78(%rcx), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
andb $0x1, %al
movb %al, -0x79(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xc9910
movl %eax, -0x80(%rbp)
movss -0x58(%rbp), %xmm0
movss %xmm0, -0xf8(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x100(%rbp)
movss -0x50(%rbp), %xmm0
movss %xmm0, -0xfc(%rbp)
movss -0x4c(%rbp), %xmm0
movss -0x54(%rbp), %xmm2
addss -0x5c(%rbp), %xmm2
movq -0x10(%rbp), %rax
movss 0x15bc(%rax), %xmm1
addss %xmm1, %xmm1
addss %xmm2, %xmm1
callq 0x12a620
movss -0x100(%rbp), %xmm1
movss -0xfc(%rbp), %xmm2
movaps %xmm0, %xmm3
movss -0xf8(%rbp), %xmm0
leaq -0x90(%rbp), %rdi
callq 0xec090
movss -0x5c(%rbp), %xmm1
leaq -0x98(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xbf4c0
leaq -0x98(%rbp), %rdi
movss 0x3ef6f(%rip), %xmm0    # 0x171f80
callq 0xd6030
movl -0x80(%rbp), %esi
leaq -0x90(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0xd6250
testb $0x1, %al
jne 0x133032
jmp 0x133695
movl -0x80(%rbp), %esi
leaq -0x90(%rbp), %rdi
leaq -0x99(%rbp), %rdx
leaq -0x9a(%rbp), %rcx
movl $0x1000, %r8d           # imm = 0x1000
callq 0x139df0
andb $0x1, %al
movb %al, -0x9b(%rbp)
movq -0x10(%rbp), %rax
movl 0x1b30(%rax), %eax
cmpl -0x80(%rbp), %eax
je 0x133071
callq 0xd5760
testb $0x1, -0x9a(%rbp)
jne 0x133089
testb $0x1, -0x99(%rbp)
jne 0x133089
testb $0x1, -0x79(%rbp)
je 0x133101
testb $0x1, -0x9a(%rbp)
je 0x13309f
movl $0x1a, %eax
movl %eax, -0x104(%rbp)
jmp 0x1330bb
movb -0x99(%rbp), %dl
movl $0x18, %eax
movl $0x19, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %edi
movss 0x3db73(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x74(%rax), %edx
movl $0x3, %edi
callq 0x131310
movl -0x80(%rbp), %esi
leaq -0x90(%rbp), %rdi
movl $0xa, %edx
callq 0xc91e0
jmp 0x133140
movq -0x20(%rbp), %rax
movl 0x90(%rax), %eax
shll $0x10, %eax
sarl $0x10, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13313e
movl $0x2a, %edi
movss 0x3db16(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, %esi
movq -0x20(%rbp), %rax
movl 0x74(%rax), %edx
movl $0x3, %edi
callq 0x131310
jmp 0x133140
testb $0x1, -0x9a(%rbp)
je 0x133158
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x239(%rax)
movq -0x10(%rbp), %rax
movss 0x15ac(%rax), %xmm0
movq -0x18(%rbp), %rax
movss 0xdc(%rax), %xmm1
movd %xmm0, %ecx
xorl $0x80000000, %ecx       # imm = 0x80000000
movd %ecx, %xmm0
movss 0x3ee52(%rip), %xmm2    # 0x171fd8
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xdc(%rax)
testb $0x1, -0x9a(%rbp)
je 0x1333cc
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1333cc
xorl %edi, %edi
movss 0x3edc0(%rip), %xmm0    # 0x171f80
callq 0xd4fe0
testb $0x1, %al
jne 0x1331ce
jmp 0x1333cc
movq -0x10(%rbp), %rax
testb $0x1, 0x2004(%rax)
jne 0x1333cc
movl -0x24(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x23a(%rax)
movq -0x20(%rbp), %rax
movw 0x78(%rax), %cx
movq -0x20(%rbp), %rax
movw %cx, 0x7a(%rax)
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0x3b8(%rax), %xmm0
jbe 0x1332e4
movq -0x10(%rbp), %rax
movss 0x128(%rax), %xmm1
movss -0x58(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x1332e4
movq -0x30(%rbp), %rax
movsbl 0x54(%rax), %eax
cmpl $-0x1, %eax
je 0x133257
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rax
movsbl 0x54(%rax), %esi
callq 0xeea20
movq %rax, -0x110(%rbp)
jmp 0x133262
xorl %eax, %eax
movq %rax, -0x110(%rbp)
jmp 0x133262
movq -0x110(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x1332e2
movq -0x30(%rbp), %rax
movl (%rax), %eax
movq -0xa8(%rbp), %rcx
orl (%rcx), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x1332e0
movq -0x30(%rbp), %rax
movsbl 0x53(%rax), %eax
movq -0x20(%rbp), %rcx
movsbl 0x242(%rcx), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movq -0xa8(%rbp), %rcx
movsbl 0x53(%rcx), %ecx
movq -0x20(%rbp), %rdx
movsbl 0x242(%rdx), %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x1332de
movq -0x20(%rbp), %rax
movb $-0x1, 0x23b(%rax)
jmp 0x1332e0
jmp 0x1332e2
jmp 0x1332e4
movq -0x10(%rbp), %rax
movss 0x3b8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1333ca
movq -0x10(%rbp), %rax
movss 0x128(%rax), %xmm0
ucomiss -0x50(%rbp), %xmm0
jbe 0x1333ca
movq -0x30(%rbp), %rax
movsbl 0x55(%rax), %eax
cmpl $-0x1, %eax
je 0x13333d
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rax
movsbl 0x55(%rax), %esi
callq 0xeea20
movq %rax, -0x118(%rbp)
jmp 0x133348
xorl %eax, %eax
movq %rax, -0x118(%rbp)
jmp 0x133348
movq -0x118(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
je 0x1333c8
movq -0x30(%rbp), %rax
movl (%rax), %eax
movq -0xb0(%rbp), %rcx
orl (%rcx), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x1333c6
movq -0x30(%rbp), %rax
movsbl 0x53(%rax), %eax
movq -0x20(%rbp), %rcx
movsbl 0x242(%rcx), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movq -0xb0(%rbp), %rcx
movsbl 0x53(%rcx), %ecx
movq -0x20(%rbp), %rdx
movsbl 0x242(%rdx), %edx
cmpl %edx, %ecx
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x1333c4
movq -0x20(%rbp), %rax
movb $0x1, 0x23b(%rax)
jmp 0x1333c6
jmp 0x1333c8
jmp 0x1333ca
jmp 0x1333cc
movss -0x50(%rbp), %xmm0
subss -0x60(%rbp), %xmm0
subss -0x64(%rbp), %xmm0
movss %xmm0, -0xb4(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x133597
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x133597
movq -0x30(%rbp), %rax
movsbl 0x56(%rax), %eax
cmpl $-0x1, %eax
je 0x133550
movss -0x58(%rbp), %xmm0
movss -0x50(%rbp), %xmm1
subss -0x60(%rbp), %xmm1
subss -0x64(%rbp), %xmm1
callq 0x12a620
movss %xmm0, -0xb8(%rbp)
movss -0x44(%rbp), %xmm0
movss %xmm0, -0xbc(%rbp)
movq -0x30(%rbp), %rax
movsbl 0x56(%rax), %eax
cmpl $0x0, %eax
jle 0x1334e1
xorl %edi, %edi
movl %edi, -0x11c(%rbp)
movss 0x3f356(%rip), %xmm0    # 0x1727c0
callq 0xc76e0
movl -0x11c(%rbp), %edi
movl %eax, %esi
callq 0xc7850
movss -0xb8(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss 0x15b0(%rax), %xmm1
addss %xmm1, %xmm0
movss -0xbc(%rbp), %xmm1
leaq -0xc4(%rbp), %rdi
callq 0xbf4c0
leaq -0x68(%rbp), %rdi
movsd -0xc4(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0xc8120
movl $0x1, %edi
callq 0xc7990
movss -0x64(%rbp), %xmm0
addss -0xb8(%rbp), %xmm0
movss %xmm0, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x128(%rbp)
movss -0xb8(%rbp), %xmm0
movss -0xbc(%rbp), %xmm1
leaq -0xcc(%rbp), %rdi
callq 0xbf4c0
xorl %edi, %edi
movss 0x3d723(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movq -0x128(%rbp), %rdi
movl %eax, %esi
movq -0x30(%rbp), %rax
movb 0x64(%rax), %al
andb $0x3, %al
subb $0x1, %al
sete %al
movzbl %al, %edx
xorl $0x3, %edx
movsd -0xcc(%rbp), %xmm0
movss 0x3f241(%rip), %xmm1    # 0x17278c
callq 0x11ca10
testb $0x1, -0x9b(%rbp)
je 0x133595
movq -0x20(%rbp), %rax
movsbl 0x23a(%rax), %eax
cmpl -0x24(%rbp), %eax
je 0x133595
movq -0x30(%rbp), %rdi
callq 0x132380
movl %eax, -0xd0(%rbp)
movl -0x24(%rbp), %edi
movl -0xd0(%rbp), %esi
movq -0x10(%rbp), %rax
movb 0x141(%rax), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x132470
jmp 0x133597
movq -0x18(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x130(%rbp)
movss -0xb4(%rbp), %xmm0
movss -0x44(%rbp), %xmm1
addss -0x5c(%rbp), %xmm1
movq -0x10(%rbp), %rax
addss 0x159c(%rax), %xmm1
leaq -0xd8(%rbp), %rdi
callq 0xbf4c0
movq -0x130(%rbp), %rdi
movss -0xb4(%rbp), %xmm0
movss -0xb4(%rbp), %xmm1
movq -0x8(%rbp), %rcx
movq -0x38(%rbp), %r8
leaq -0x48(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
leaq -0x40(%rbp), %r9
callq 0xc89c0
movss -0x40(%rbp), %xmm0
movss -0xb4(%rbp), %xmm1
subss -0x48(%rbp), %xmm1
ucomiss %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, -0xd9(%rbp)
testb $0x1, -0xd9(%rbp)
je 0x133670
testb $0x1, -0x99(%rbp)
je 0x133670
movq -0x10(%rbp), %rax
movss 0x1b2c(%rax), %xmm0
movq -0x10(%rbp), %rax
ucomiss 0x30ac(%rax), %xmm0
jbe 0x133670
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movl %eax, %esi
movq -0x8(%rbp), %rdx
leaq 0x42186(%rip), %rdi     # 0x1757ef
movb $0x0, %al
callq 0xd4170
movl $0x1, %edi
callq 0xd4e60
testb $0x1, %al
jne 0x133680
jmp 0x133695
xorl %edi, %edi
callq 0xca1c0
testb $0x1, %al
jne 0x13368d
jmp 0x133695
movl -0x24(%rbp), %edi
callq 0x12f350
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop