// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableBeginApplyRequests(ImGuiTable*)
void ImGui::TableBeginApplyRequests(ImGuiTable* table)
{
    // Handle resizing request
    // (We process this at the first TableBegin of the frame)
    // FIXME-TABLE: Contains columns if our work area doesn't allow for scrolling?
    if (table->InstanceCurrent == 0)
    {
        if (table->ResizedColumn != -1 && table->ResizedColumnNextWidth != FLT_MAX)
            TableSetColumnWidth(table->ResizedColumn, table->ResizedColumnNextWidth);
        table->LastResizedColumn = table->ResizedColumn;
        table->ResizedColumnNextWidth = FLT_MAX;
        table->ResizedColumn = -1;

        // Process auto-fit for single column, which is a special case for stretch columns and fixed columns with FixedSame policy.
        // FIXME-TABLE: Would be nice to redistribute available stretch space accordingly to other weights, instead of giving it all to siblings.
        if (table->AutoFitSingleColumn != -1)
        {
            TableSetColumnWidth(table->AutoFitSingleColumn, table->Columns[table->AutoFitSingleColumn].WidthAuto);
            table->AutoFitSingleColumn = -1;
        }
    }

    // Handle reordering request
    // Note: we don't clear ReorderColumn after handling the request.
    if (table->InstanceCurrent == 0)
    {
        if (table->HeldHeaderColumn == -1 && table->ReorderColumn != -1)
            table->ReorderColumn = -1;
        table->HeldHeaderColumn = -1;
        if (table->ReorderColumn != -1 && table->ReorderColumnDir != 0)
        {
            // We need to handle reordering across hidden columns.
            // In the configuration below, moving C to the right of E will lead to:
            //    ... C [D] E  --->  ... [D] E  C   (Column name/index)
            //    ... 2  3  4        ...  2  3  4   (Display order)
            const int reorder_dir = table->ReorderColumnDir;
            IM_ASSERT(reorder_dir == -1 || reorder_dir == +1);
            IM_ASSERT(table->Flags & ImGuiTableFlags_Reorderable);
            ImGuiTableColumn* src_column = &table->Columns[table->ReorderColumn];
            ImGuiTableColumn* dst_column = &table->Columns[(reorder_dir == -1) ? src_column->PrevEnabledColumn : src_column->NextEnabledColumn];
            IM_UNUSED(dst_column);
            const int src_order = src_column->DisplayOrder;
            const int dst_order = dst_column->DisplayOrder;
            src_column->DisplayOrder = (ImGuiTableColumnIdx)dst_order;
            for (int order_n = src_order + reorder_dir; order_n != dst_order + reorder_dir; order_n += reorder_dir)
                table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder -= (ImGuiTableColumnIdx)reorder_dir;
            IM_ASSERT(dst_column->DisplayOrder == dst_order - reorder_dir);

            // Display order is stored in both columns->IndexDisplayOrder and table->DisplayOrder[],
            // rebuild the later from the former.
            for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
                table->DisplayOrderToIndex[table->Columns[column_n].DisplayOrder] = (ImGuiTableColumnIdx)column_n;
            table->ReorderColumnDir = 0;
            table->IsSettingsDirty = true;
        }
    }

    // Handle display order reset request
    if (table->IsResetDisplayOrderRequest)
    {
        for (int n = 0; n < table->ColumnsCount; n++)
            table->DisplayOrderToIndex[n] = table->Columns[n].DisplayOrder = (ImGuiTableColumnIdx)n;
        table->IsResetDisplayOrderRequest = false;
        table->IsSettingsDirty = true;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpw $0x0, 0x78(%rdi)
jne 0x87184
movsbl 0x237(%rbx), %edi
cmpl $-0x1, %edi
je 0x87128
movss 0xe0(%rbx), %xmm0
ucomiss 0x2e72a(%rip), %xmm0    # 0xb5840
jne 0x8711a
jnp 0x8712b
callq 0x873f0
movb 0x237(%rbx), %dil
jmp 0x8712b
movb $-0x1, %dil
movb %dil, 0x238(%rbx)
movl $0x7f7fffff, 0xe0(%rbx) # imm = 0x7F7FFFFF
movb $-0x1, 0x237(%rbx)
movsbq 0x236(%rbx), %rdi
cmpq $-0x1, %rdi
je 0x8717d
testb %dil, %dil
js 0x8735d
imulq $0x68, %rdi, %rax
addq 0x10(%rbx), %rax
cmpq 0x18(%rbx), %rax
jae 0x8735d
movss 0x14(%rax), %xmm0
callq 0x873f0
movb $-0x1, 0x236(%rbx)
cmpw $0x0, 0x78(%rbx)
je 0x871e5
cmpb $0x1, 0x252(%rbx)
jne 0x871de
cmpl $0x0, 0x6c(%rbx)
jle 0x871d0
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x10(%rbx), %rdx
leaq (%rdx,%rax), %rsi
cmpq 0x18(%rbx), %rsi
jae 0x8735d
movb %cl, 0x52(%rdx,%rax)
movq 0x20(%rbx), %rdx
addq %rcx, %rdx
cmpq 0x28(%rbx), %rdx
jae 0x87374
movb %cl, (%rdx)
incq %rcx
movslq 0x6c(%rbx), %rdx
addq $0x68, %rax
cmpq %rdx, %rcx
jl 0x87197
movb $0x0, 0x252(%rbx)
movb $0x1, 0x24f(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpb $-0x1, 0x239(%rbx)
movsbq 0x23a(%rbx), %rdx
je 0x87345
movb $-0x1, 0x239(%rbx)
cmpb $-0x1, %dl
je 0x87184
movsbl 0x23b(%rbx), %eax
testl %eax, %eax
je 0x87184
cmpb $0x1, %al
je 0x8722c
movzbl %al, %ecx
cmpl $0xff, %ecx
jne 0x873d1
testb $0x2, 0x4(%rbx)
je 0x87393
testb %dl, %dl
js 0x8735d
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %r8
imulq $0x68, %rdx, %rdi
addq %rcx, %rdi
cmpq %r8, %rdi
jae 0x8735d
xorl %edx, %edx
cmpb $-0x1, %al
sete %dl
xorq $0x55, %rdx
movsbq (%rdi,%rdx), %rdx
testq %rdx, %rdx
js 0x8735d
imulq $0x68, %rdx, %rsi
addq %rcx, %rsi
cmpq %r8, %rsi
jae 0x8735d
movb 0x52(%rdi), %r8b
movsbl 0x52(%rsi), %edx
movb %dl, 0x52(%rdi)
cmpb %dl, %r8b
je 0x872e5
movsbq %r8b, %rdi
movq 0x20(%rbx), %r8
movslq %eax, %r9
leaq (%rdi,%r9), %r10
testq %r10, %r10
js 0x87374
leaq (%r8,%r10), %r11
cmpq 0x28(%rbx), %r11
jae 0x87374
movsbq (%r11), %r11
testq %r11, %r11
js 0x8735d
imulq $0x68, %r11, %r11
addq %rcx, %r11
cmpq 0x18(%rbx), %r11
jae 0x8735d
subb %al, 0x52(%r11)
addq %r9, %rdi
addq %r9, %r10
cmpl %edx, %edi
jne 0x8729e
movb 0x52(%rsi), %r8b
movsbl %r8b, %ecx
subl %eax, %edx
cmpl %ecx, %edx
jne 0x873b2
cmpl $0x0, 0x6c(%rbx)
jle 0x87332
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x10(%rbx), %rdx
leaq (%rdx,%rax), %rsi
cmpq 0x18(%rbx), %rsi
jae 0x8735d
movsbq 0x52(%rdx,%rax), %rdx
testq %rdx, %rdx
js 0x87374
addq 0x20(%rbx), %rdx
cmpq 0x28(%rbx), %rdx
jae 0x87374
movb %cl, (%rdx)
incq %rcx
movslq 0x6c(%rbx), %rdx
addq $0x68, %rax
cmpq %rdx, %rcx
jl 0x872fd
movb $0x0, 0x23b(%rbx)
movb $0x1, 0x24f(%rbx)
jmp 0x87184
cmpb $-0x1, %dl
je 0x87351
movb $-0x1, 0x23a(%rbx)
movb $-0x1, 0x239(%rbx)
jmp 0x87184
leaq 0x33354(%rip), %rdi     # 0xba6b8
leaq 0x322d4(%rip), %rsi     # 0xb963f
leaq 0x3335f(%rip), %rcx     # 0xba6d1
jmp 0x87389
leaq 0x3333d(%rip), %rdi     # 0xba6b8
leaq 0x322bd(%rip), %rsi     # 0xb963f
leaq 0x496b0(%rip), %rcx     # 0xd0a39
movl $0x20e, %edx            # imm = 0x20E
callq 0xc140
leaq 0x47cdb(%rip), %rdi     # 0xcf075
leaq 0x47ae9(%rip), %rsi     # 0xcee8a
leaq 0x47c9b(%rip), %rcx     # 0xcf043
movl $0x24e, %edx            # imm = 0x24E
callq 0xc140
leaq 0x47ce7(%rip), %rdi     # 0xcf0a0
leaq 0x47aca(%rip), %rsi     # 0xcee8a
leaq 0x47c7c(%rip), %rcx     # 0xcf043
movl $0x257, %edx            # imm = 0x257
callq 0xc140
leaq 0x47c44(%rip), %rdi     # 0xcf01c
leaq 0x47aab(%rip), %rsi     # 0xcee8a
leaq 0x47c5d(%rip), %rcx     # 0xcf043
movl $0x24d, %edx            # imm = 0x24D
callq 0xc140