// File: Ciaxur[P]yagb-emu/include/imgui/imgui_tables.cpp
// Function: ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable*)
void ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable* table)
{
    IM_ASSERT(table->LeftMostStretchedColumn != -1 && table->RightMostStretchedColumn != -1);

    // Measure existing quantity
    float visible_weight = 0.0f;
    float visible_width = 0.0f;
    for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
    {
        ImGuiTableColumn* column = &table->Columns[column_n];
        if (!column->IsEnabled || !(column->Flags & ImGuiTableColumnFlags_WidthStretch))
            continue;
        IM_ASSERT(column->StretchWeight > 0.0f);
        visible_weight += column->StretchWeight;
        visible_width += column->WidthRequest;
    }
    IM_ASSERT(visible_weight > 0.0f && visible_width > 0.0f);

    // Apply new weights
    for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
    {
        ImGuiTableColumn* column = &table->Columns[column_n];
        if (!column->IsEnabled || !(column->Flags & ImGuiTableColumnFlags_WidthStretch))
            continue;
        column->StretchWeight = (column->WidthRequest / visible_width) * visible_weight;
        IM_ASSERT(column->StretchWeight > 0.0f);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x23c(%rax), %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, -0x31(%rbp)
je 0x131e45
movq -0x8(%rbp), %rax
movsbl 0x23d(%rax), %eax
cmpl $-0x1, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x131e4e
jmp 0x131e50
jmp 0x131e6f
leaq 0x5ae7e(%rip), %rdi     # 0x18ccd5
leaq 0x5a144(%rip), %rsi     # 0x18bfa2
movl $0x814, %edx            # imm = 0x814
leaq 0x5aeb9(%rip), %rcx     # 0x18cd23
callq 0xd180
xorps %xmm0, %xmm0
movss %xmm0, -0xc(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x131f2a
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl -0x14(%rbp), %esi
callq 0xeea20
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x5a(%rax)
je 0x131ec2
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x131ec4
jmp 0x131f1c
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x131ed7
jmp 0x131ef6
leaq 0x5ae81(%rip), %rdi     # 0x18cd5f
leaq 0x5a0bd(%rip), %rsi     # 0x18bfa2
movl $0x81e, %edx            # imm = 0x81E
leaq 0x5ae32(%rip), %rcx     # 0x18cd23
callq 0xd180
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm0
addss -0xc(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
addss -0x10(%rbp), %xmm0
movss %xmm0, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x131e86
movss -0xc(%rbp), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0x32(%rbp)
jbe 0x131f4d
movss -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
seta %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x131f56
jmp 0x131f58
jmp 0x131f77
leaq 0x5ae1d(%rip), %rdi     # 0x18cd7c
leaq 0x5a03c(%rip), %rsi     # 0x18bfa2
movl $0x822, %edx            # imm = 0x822
leaq 0x5adb1(%rip), %rcx     # 0x18cd23
callq 0xd180
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x13201a
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movl -0x24(%rbp), %esi
callq 0xeea20
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
testb $0x1, 0x5a(%rax)
je 0x131fba
movq -0x30(%rbp), %rax
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x131fbc
jmp 0x13200c
movq -0x30(%rbp), %rax
movss 0x10(%rax), %xmm0
divss -0x10(%rbp), %xmm0
mulss -0xc(%rbp), %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, 0x18(%rax)
movq -0x30(%rbp), %rax
movss 0x18(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x131feb
jmp 0x13200a
leaq 0x5ad6d(%rip), %rdi     # 0x18cd5f
leaq 0x59fa9(%rip), %rsi     # 0x18bfa2
movl $0x82b, %edx            # imm = 0x82B
leaq 0x5ad1e(%rip), %rcx     # 0x18cd23
callq 0xd180
jmp 0x13200c
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x131f7e
addq $0x40, %rsp
popq %rbp
retq