// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableMergeDrawChannels(ImGuiTable*)
void ImGui::TableMergeDrawChannels(ImGuiTable* table)
{
    ImGuiContext& g = *GImGui;
    ImDrawListSplitter* splitter = &table->DrawSplitter;
    const bool has_freeze_v = (table->FreezeRowsCount > 0);
    const bool has_freeze_h = (table->FreezeColumnsCount > 0);
    IM_ASSERT(splitter->_Current == 0);

    // Track which groups we are going to attempt to merge, and which channels goes into each group.
    struct MergeGroup
    {
        ImRect  ClipRect;
        int     ChannelsCount;
        ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> ChannelsMask;
    };
    int merge_group_mask = 0x00;
    MergeGroup merge_groups[4];
    memset(merge_groups, 0, sizeof(merge_groups));

    // 1. Scan channels and take note of those which can be merged
    for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
    {
        if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
            continue;
        ImGuiTableColumn* column = &table->Columns[column_n];

        const int merge_group_sub_count = has_freeze_v ? 2 : 1;
        for (int merge_group_sub_n = 0; merge_group_sub_n < merge_group_sub_count; merge_group_sub_n++)
        {
            const int channel_no = (merge_group_sub_n == 0) ? column->DrawChannelFrozen : column->DrawChannelUnfrozen;

            // Don't attempt to merge if there are multiple draw calls within the column
            ImDrawChannel* src_channel = &splitter->_Channels[channel_no];
            if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0)
                src_channel->_CmdBuffer.pop_back();
            if (src_channel->_CmdBuffer.Size != 1)
                continue;

            // Find out the width of this merge group and check if it will fit in our column
            // (note that we assume that rendering didn't stray on the left direction. we should need a CursorMinPos to detect it)
            if (!(column->Flags & ImGuiTableColumnFlags_NoClip))
            {
                float content_max_x;
                if (!has_freeze_v)
                    content_max_x = ImMax(column->ContentMaxXUnfrozen, column->ContentMaxXHeadersUsed); // No row freeze
                else if (merge_group_sub_n == 0)
                    content_max_x = ImMax(column->ContentMaxXFrozen, column->ContentMaxXHeadersUsed);   // Row freeze: use width before freeze
                else
                    content_max_x = column->ContentMaxXUnfrozen;                                        // Row freeze: use width after freeze
                if (content_max_x > column->ClipRect.Max.x)
                    continue;
            }

            const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
            IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS);
            MergeGroup* merge_group = &merge_groups[merge_group_n];
            if (merge_group->ChannelsCount == 0)
                merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
            merge_group->ChannelsMask.SetBit(channel_no);
            merge_group->ChannelsCount++;
            merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
            merge_group_mask |= (1 << merge_group_n);
        }

        // Invalidate current draw channel
        // (we don't clear DrawChannelFrozen/DrawChannelUnfrozen solely to facilitate debugging/later inspection of data)
        column->DrawChannelCurrent = (ImGuiTableDrawChannelIdx)-1;
    }

    // [DEBUG] Display merge groups
#if 0
    if (g.IO.KeyShift)
        for (int merge_group_n = 0; merge_group_n < IM_ARRAYSIZE(merge_groups); merge_group_n++)
        {
            MergeGroup* merge_group = &merge_groups[merge_group_n];
            if (merge_group->ChannelsCount == 0)
                continue;
            char buf[32];
            ImFormatString(buf, 32, "MG%d:%d", merge_group_n, merge_group->ChannelsCount);
            ImVec2 text_pos = merge_group->ClipRect.Min + ImVec2(4, 4);
            ImVec2 text_size = CalcTextSize(buf, NULL);
            GetForegroundDrawList()->AddRectFilled(text_pos, text_pos + text_size, IM_COL32(0, 0, 0, 255));
            GetForegroundDrawList()->AddText(text_pos, IM_COL32(255, 255, 0, 255), buf, NULL);
            GetForegroundDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 255, 0, 255));
        }
#endif

    // 2. Rewrite channel list in our preferred order
    if (merge_group_mask != 0)
    {
        // We skip channel 0 (Bg0/Bg1) and 1 (Bg2 frozen) from the shuffling since they won't move - see channels allocation in TableSetupDrawChannels().
        const int LEADING_DRAW_CHANNELS = 2;
        g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
        ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
        ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> remaining_mask;                       // We need 132-bit of storage
        remaining_mask.ClearAllBits();
        remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count);
        remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen);
        IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
        int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
        //ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
        ImRect host_rect = table->HostClipRect;
        for (int merge_group_n = 0; merge_group_n < IM_ARRAYSIZE(merge_groups); merge_group_n++)
        {
            if (int merge_channels_count = merge_groups[merge_group_n].ChannelsCount)
            {
                MergeGroup* merge_group = &merge_groups[merge_group_n];
                ImRect merge_clip_rect = merge_group->ClipRect;

                // Extend outer-most clip limits to match those of host, so draw calls can be merged even if
                // outer-most columns have some outer padding offsetting them from their parent ClipRect.
                // The principal cases this is dealing with are:
                // - On a same-window table (not scrolling = single group), all fitting columns ClipRect -> will extend and match host ClipRect -> will merge
                // - Columns can use padding and have left-most ClipRect.Min.x and right-most ClipRect.Max.x != from host ClipRect -> will extend and match host ClipRect -> will merge
                // FIXME-TABLE FIXME-WORKRECT: We are wasting a merge opportunity on tables without scrolling if column doesn't fit
                // within host clip rect, solely because of the half-padding difference between window->WorkRect and window->InnerClipRect.
                if ((merge_group_n & 1) == 0 || !has_freeze_h)
                    merge_clip_rect.Min.x = ImMin(merge_clip_rect.Min.x, host_rect.Min.x);
                if ((merge_group_n & 2) == 0 || !has_freeze_v)
                    merge_clip_rect.Min.y = ImMin(merge_clip_rect.Min.y, host_rect.Min.y);
                if ((merge_group_n & 1) != 0)
                    merge_clip_rect.Max.x = ImMax(merge_clip_rect.Max.x, host_rect.Max.x);
                if ((merge_group_n & 2) != 0 && (table->Flags & ImGuiTableFlags_NoHostExtendY) == 0)
                    merge_clip_rect.Max.y = ImMax(merge_clip_rect.Max.y, host_rect.Max.y);
#if 0
                GetOverlayDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, ~0, 1.0f);
                GetOverlayDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
                GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
#endif
                remaining_count -= merge_group->ChannelsCount;
                for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++)
                    remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n];
                for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
                {
                    // Copy + overwrite new clip rect
                    if (!merge_group->ChannelsMask.TestBit(n))
                        continue;
                    merge_group->ChannelsMask.ClearBit(n);
                    merge_channels_count--;

                    ImDrawChannel* channel = &splitter->_Channels[n];
                    IM_ASSERT(channel->_CmdBuffer.Size == 1 && merge_clip_rect.Contains(ImRect(channel->_CmdBuffer[0].ClipRect)));
                    channel->_CmdBuffer[0].ClipRect = merge_clip_rect.ToVec4();
                    memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
                }
            }

            // Make sure Bg2DrawChannelUnfrozen appears in the middle of our groups (whereas Bg0/Bg1 and Bg2 frozen are fixed to 0 and 1)
            if (merge_group_n == 1 && has_freeze_v)
                memcpy(dst_tmp++, &splitter->_Channels[table->Bg2DrawChannelUnfrozen], sizeof(ImDrawChannel));
        }

        // Append unmergeable channels that we didn't reorder at the end of the list
        for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
        {
            if (!remaining_mask.TestBit(n))
                continue;
            ImDrawChannel* channel = &splitter->_Channels[n];
            memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
            remaining_count--;
        }
        IM_ASSERT(dst_tmp == g.DrawChannelsTempMergeBuffer.Data + g.DrawChannelsTempMergeBuffer.Size);
        memcpy(splitter->_Channels.Data + LEADING_DRAW_CHANNELS, g.DrawChannelsTempMergeBuffer.Data, (splitter->_Count - LEADING_DRAW_CHANNELS) * sizeof(ImDrawChannel));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
leaq 0xe337a(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x1e8, %rax            # imm = 0x1E8
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x241(%rax), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x243(%rax), %eax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movb %al, -0x1a(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x12fc12
jmp 0x12fc31
leaq 0x5d1f5(%rip), %rdi     # 0x18ce0e
leaq 0x5c382(%rip), %rsi     # 0x18bfa2
movl $0x8ad, %edx            # imm = 0x8AD
leaq 0x5d1fa(%rip), %rcx     # 0x18ce26
callq 0xd180
movl $0x0, -0x20(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, %rcx
addq $0xa0, %rcx
movq %rcx, -0x1c0(%rbp)
movq %rax, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x1321c0
movq -0x1c8(%rbp), %rax
movq -0x1c0(%rbp), %rcx
addq $0x28, %rax
cmpq %rcx, %rax
movq %rax, -0x1b8(%rbp)
jne 0x12fc57
leaq -0xc0(%rbp), %rdi
xorl %esi, %esi
movl $0xa0, %edx
callq 0xd2f0
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x130025
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movl -0xc4(%rbp), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x12fcdf
jmp 0x130011
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl -0xc4(%rbp), %esi
callq 0xeea20
movq %rax, -0xd0(%rbp)
movb -0x19(%rbp), %dl
movl $0x1, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xd4(%rbp)
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jge 0x130006
cmpl $0x0, -0xd8(%rbp)
jne 0x12fd49
movq -0xd0(%rbp), %rax
movb 0x58(%rax), %al
movb %al, -0x1c9(%rbp)
jmp 0x12fd59
movq -0xd0(%rbp), %rax
movb 0x59(%rax), %al
movb %al, -0x1c9(%rbp)
movb -0x1c9(%rbp), %al
movzbl %al, %eax
movl %eax, -0xdc(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0xdc(%rbp), %esi
callq 0x127430
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x12fdac
movq -0xe8(%rbp), %rdi
callq 0xeba20
cmpl $0x0, 0x20(%rax)
jne 0x12fdac
movq -0xe8(%rbp), %rdi
callq 0x1270c0
movq -0xe8(%rbp), %rax
cmpl $0x1, (%rax)
je 0x12fdbd
jmp 0x12fff2
movq -0xd0(%rbp), %rax
movl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x12fe63
testb $0x1, -0x19(%rbp)
jne 0x12fe01
movq -0xd0(%rbp), %rax
movss 0x44(%rax), %xmm0
movq -0xd0(%rbp), %rax
movss 0x48(%rax), %xmm1
callq 0x12a620
movss %xmm0, -0xec(%rbp)
jmp 0x12fe47
cmpl $0x0, -0xd8(%rbp)
jne 0x12fe31
movq -0xd0(%rbp), %rax
movss 0x40(%rax), %xmm0
movq -0xd0(%rbp), %rax
movss 0x48(%rax), %xmm1
callq 0x12a620
movss %xmm0, -0xec(%rbp)
jmp 0x12fe45
movq -0xd0(%rbp), %rax
movss 0x44(%rax), %xmm0
movss %xmm0, -0xec(%rbp)
jmp 0x12fe47
movss -0xec(%rbp), %xmm0
movq -0xd0(%rbp), %rax
ucomiss 0x28(%rax), %xmm0
jbe 0x12fe61
jmp 0x12fff2
jmp 0x12fe63
xorl %eax, %eax
testb $0x1, -0x1a(%rbp)
movb %al, -0x1ca(%rbp)
je 0x12fe8d
movl -0xc4(%rbp), %eax
movq -0x8(%rbp), %rcx
movsbl 0x243(%rcx), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x1ca(%rbp)
movb -0x1ca(%rbp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x1d0(%rbp)
xorl %eax, %eax
testb $0x1, -0x19(%rbp)
movb %al, -0x1cb(%rbp)
je 0x12fec4
cmpl $0x0, -0xd8(%rbp)
sete %al
movb %al, -0x1cb(%rbp)
movl -0x1d0(%rbp), %eax
movb -0x1cb(%rbp), %sil
movl $0x2, %ecx
xorl %edx, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
addl %ecx, %eax
movl %eax, -0xf0(%rbp)
cmpl $0x84, -0xdc(%rbp)
jge 0x12fef5
jmp 0x12ff14
leaq 0x5cf5b(%rip), %rdi     # 0x18ce57
leaq 0x5c09f(%rip), %rsi     # 0x18bfa2
movl $0x8dd, %edx            # imm = 0x8DD
leaq 0x5cf17(%rip), %rcx     # 0x18ce26
callq 0xd180
movslq -0xf0(%rbp), %rcx
leaq -0xc0(%rbp), %rax
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x12ff7b
leaq -0x108(%rbp), %rdi
movss 0x42068(%rip), %xmm1    # 0x171fb4
movss 0x42804(%rip), %xmm3    # 0x172758
movaps %xmm1, %xmm0
movaps %xmm3, %xmm2
callq 0xec090
movq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rcx
movq %rcx, (%rax)
movq -0x100(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xf8(%rbp), %rdi
addq $0x14, %rdi
movl -0xdc(%rbp), %esi
callq 0x1375a0
movq -0xf8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0xf8(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0xe8(%rbp), %rdi
xorl %esi, %esi
callq 0xeb940
movq %rax, %rsi
leaq -0x118(%rbp), %rdi
callq 0xeb300
movq -0x1d8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xe85b0
movl -0xf0(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
orl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x12fd1c
movq -0xd0(%rbp), %rax
movb $-0x1, 0x57(%rax)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x12fca5
cmpl $0x0, -0x20(%rbp)
je 0x13065a
movl $0x2, -0x11c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20f8, %rdi           # imm = 0x20F8
movq -0x18(%rbp), %rax
movl 0x4(%rax), %esi
subl $0x2, %esi
callq 0x127530
movq -0x10(%rbp), %rax
movq 0x2100(%rax), %rax
movq %rax, -0x128(%rbp)
leaq -0x13c(%rbp), %rdi
callq 0x137600
leaq -0x13c(%rbp), %rdi
callq 0x137610
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
leaq -0x13c(%rbp), %rdi
movl $0x2, %esi
callq 0x137640
movq -0x8(%rbp), %rax
movzbl 0x247(%rax), %esi
leaq -0x13c(%rbp), %rdi
callq 0x137670
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x1d9(%rbp)
je 0x1300d8
movq -0x8(%rbp), %rax
movzbl 0x247(%rax), %eax
cmpl $0x1, %eax
setne %al
movb %al, -0x1d9(%rbp)
movb -0x1d9(%rbp), %al
testb $0x1, %al
jne 0x1300e4
jmp 0x1300e6
jmp 0x130105
leaq 0x5cd84(%rip), %rdi     # 0x18ce71
leaq 0x5beae(%rip), %rsi     # 0x18bfa2
movl $0x909, %edx            # imm = 0x909
leaq 0x5cd26(%rip), %rcx     # 0x18ce26
callq 0xd180
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movb -0x19(%rbp), %sil
movl $0x2, %ecx
movl $0x3, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
subl %ecx, %eax
movl %eax, -0x140(%rbp)
movq -0x8(%rbp), %rax
movq 0x15c(%rax), %rcx
movq %rcx, -0x150(%rbp)
movq 0x164(%rax), %rax
movq %rax, -0x148(%rbp)
movl $0x0, -0x154(%rbp)
cmpl $0x4, -0x154(%rbp)
jge 0x130514
movslq -0x154(%rbp), %rcx
leaq -0xc0(%rbp), %rax
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x158(%rbp)
cmpl $0x0, -0x158(%rbp)
je 0x130496
movslq -0x154(%rbp), %rcx
leaq -0xc0(%rbp), %rax
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x170(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x168(%rbp)
movl -0x154(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1301d7
testb $0x1, -0x1a(%rbp)
jne 0x1301f4
movss -0x170(%rbp), %xmm0
movss -0x150(%rbp), %xmm1
callq 0x12a6b0
movss %xmm0, -0x170(%rbp)
movl -0x154(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x130208
testb $0x1, -0x19(%rbp)
jne 0x130225
movss -0x16c(%rbp), %xmm0
movss -0x14c(%rbp), %xmm1
callq 0x12a6b0
movss %xmm0, -0x16c(%rbp)
movl -0x154(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x130250
movss -0x168(%rbp), %xmm0
movss -0x148(%rbp), %xmm1
callq 0x12a620
movss %xmm0, -0x168(%rbp)
movl -0x154(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x13028c
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
jne 0x13028c
movss -0x164(%rbp), %xmm0
movss -0x144(%rbp), %xmm1
callq 0x12a620
movss %xmm0, -0x164(%rbp)
movq -0x160(%rbp), %rax
movl 0x10(%rax), %ecx
movl -0x140(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x140(%rbp)
movl $0x0, -0x174(%rbp)
cmpl $0x5, -0x174(%rbp)
jge 0x1302f2
movq -0x160(%rbp), %rax
movslq -0x174(%rbp), %rcx
movl 0x14(%rax,%rcx,4), %ecx
xorl $-0x1, %ecx
movslq -0x174(%rbp), %rax
andl -0x13c(%rbp,%rax,4), %ecx
movl %ecx, -0x13c(%rbp,%rax,4)
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x1302ae
movl $0x0, -0x178(%rbp)
movl -0x178(%rbp), %ecx
movq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x1da(%rbp)
jge 0x130323
cmpl $0x0, -0x158(%rbp)
setne %al
movb %al, -0x1da(%rbp)
movb -0x1da(%rbp), %al
testb $0x1, %al
jne 0x130332
jmp 0x130494
movq -0x160(%rbp), %rdi
addq $0x14, %rdi
movl -0x178(%rbp), %esi
callq 0x1376d0
testb $0x1, %al
jne 0x130351
jmp 0x130480
movq -0x160(%rbp), %rdi
addq $0x14, %rdi
movl -0x178(%rbp), %esi
callq 0x137670
movl -0x158(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x158(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x178(%rbp), %esi
callq 0x127430
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rcx
xorl %eax, %eax
cmpl $0x1, (%rcx)
movb %al, -0x1db(%rbp)
jne 0x1303da
movq -0x180(%rbp), %rdi
xorl %esi, %esi
callq 0xeb940
movq %rax, %rsi
leaq -0x190(%rbp), %rdi
callq 0xeb300
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xe8a40
movb %al, -0x1db(%rbp)
movb -0x1db(%rbp), %al
testb $0x1, %al
jne 0x1303e6
jmp 0x1303e8
jmp 0x130407
leaq 0x5cada(%rip), %rdi     # 0x18cec9
leaq 0x5bbac(%rip), %rsi     # 0x18bfa2
movl $0x934, %edx            # imm = 0x934
leaq 0x5ca24(%rip), %rcx     # 0x18ce26
callq 0xd180
leaq -0x170(%rbp), %rdi
callq 0x137560
movlpd %xmm0, -0x1a0(%rbp)
movlpd %xmm1, -0x198(%rbp)
movq -0x180(%rbp), %rdi
xorl %esi, %esi
callq 0xeb940
movq -0x1a0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x198(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x128(%rbp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x128(%rbp)
movq -0x180(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl -0x178(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x178(%rbp)
jmp 0x1302fc
jmp 0x130496
cmpl $0x1, -0x154(%rbp)
jne 0x1304fe
testb $0x1, -0x19(%rbp)
je 0x1304fe
movq -0x128(%rbp), %rax
movq %rax, -0x1e8(%rbp)
addq $0x20, %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movzbl 0x247(%rax), %esi
callq 0x127430
movq %rax, %rcx
movq -0x1e8(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x130500
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x130153
movl $0x0, -0x1a4(%rbp)
movl -0x1a4(%rbp), %ecx
movq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x1e9(%rbp)
jge 0x130545
cmpl $0x0, -0x140(%rbp)
setne %al
movb %al, -0x1e9(%rbp)
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x130554
jmp 0x1305e3
movl -0x1a4(%rbp), %esi
leaq -0x13c(%rbp), %rdi
callq 0x1376d0
testb $0x1, %al
jne 0x13056c
jmp 0x1305cf
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x1a4(%rbp), %esi
callq 0x127430
movq %rax, -0x1b0(%rbp)
movq -0x128(%rbp), %rax
movq %rax, %rcx
addq $0x20, %rcx
movq %rcx, -0x128(%rbp)
movq -0x1b0(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movl -0x140(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x140(%rbp)
movl -0x1a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1a4(%rbp)
jmp 0x13051e
movq -0x128(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x2100(%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq 0x20f8(%rdx), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x13060e
jmp 0x13062d
leaq 0x5c917(%rip), %rdi     # 0x18cf2c
leaq 0x5b986(%rip), %rsi     # 0x18bfa2
movl $0x948, %edx            # imm = 0x948
leaq 0x5c7fe(%rip), %rcx     # 0x18ce26
callq 0xd180
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rax
movq 0x2100(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
movslq %eax, %rdx
shlq $0x5, %rdx
callq 0xd0a0
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
nopw %cs:(%rax,%rax)