// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/../include/imgui_club/imgui_memory_editor/imgui_memory_editor.h
// Function: MemoryEditor::CalcSizes(MemoryEditor::Sizes&, unsigned long, unsigned long)
void CalcSizes(Sizes& s, size_t mem_size, size_t base_display_addr)
    {
        ImGuiStyle& style = ImGui::GetStyle();
        s.AddrDigitsCount = OptAddrDigitsCount;
        if (s.AddrDigitsCount == 0)
            for (size_t n = base_display_addr + mem_size - 1; n > 0; n >>= 4)
                s.AddrDigitsCount++;
        s.LineHeight = ImGui::GetTextLineHeight();
        s.GlyphWidth = ImGui::CalcTextSize("F").x + 1;                  // We assume the font is mono-space
        s.HexCellWidth = (float)(int)(s.GlyphWidth * 2.5f);             // "FF " we include trailing space in the width to easily catch clicks everywhere
        s.SpacingBetweenMidCols = (float)(int)(s.HexCellWidth * 0.25f); // Every OptMidColsCount columns we add a bit of extra spacing
        s.PosHexStart = (s.AddrDigitsCount + 2) * s.GlyphWidth;
        s.PosHexEnd = s.PosHexStart + (s.HexCellWidth * Cols);
        s.PosAsciiStart = s.PosAsciiEnd = s.PosHexEnd;
        if (OptShowAscii)
        {
            s.PosAsciiStart = s.PosHexEnd + s.GlyphWidth * 1;
            if (OptMidColsCount > 0)
                s.PosAsciiStart += (float)((Cols + OptMidColsCount - 1) / OptMidColsCount) * s.SpacingBetweenMidCols;
            s.PosAsciiEnd = s.PosAsciiStart + Cols * s.GlyphWidth;
        }
        s.WindowWidth = s.PosAsciiEnd + style.ScrollbarSize + style.WindowPadding.x * 2 + s.GlyphWidth;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
callq 0x35cfd
movq %rax, %r14
movl 0x14(%r15), %eax
movl %eax, (%rbx)
testl %eax, %eax
je 0x31961
callq 0x43e97
movss %xmm0, 0x4(%rbx)
leaq 0x74867(%rip), %rdi     # 0xa60e0
movss 0x6a76f(%rip), %xmm0    # 0x9bff0
xorl %esi, %esi
xorl %edx, %edx
callq 0x365e8
addss 0x6a766(%rip), %xmm0    # 0x9bff8
movss %xmm0, 0x8(%rbx)
movss 0x6a75d(%rip), %xmm1    # 0x9bffc
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, 0xc(%rbx)
movss 0x6a749(%rip), %xmm2    # 0x9c000
mulss %xmm1, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm3
movss %xmm3, 0x10(%rbx)
movl (%rbx), %eax
addl $0x2, %eax
cvtsi2ss %eax, %xmm4
mulss %xmm0, %xmm4
movss %xmm4, 0x14(%rbx)
movl 0x4(%r15), %eax
cvtsi2ss %eax, %xmm2
mulss %xmm2, %xmm1
addss %xmm4, %xmm1
movss %xmm1, 0x18(%rbx)
movss %xmm1, 0x20(%rbx)
movss %xmm1, 0x1c(%rbx)
cmpb $0x1, 0xb(%r15)
jne 0x31935
addss %xmm0, %xmm1
movss %xmm1, 0x1c(%rbx)
movl 0x10(%r15), %ecx
testl %ecx, %ecx
jle 0x31928
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
cvtsi2ss %eax, %xmm4
mulss %xmm3, %xmm4
addss %xmm4, %xmm1
movss %xmm1, 0x1c(%rbx)
mulss %xmm0, %xmm2
addss %xmm2, %xmm1
movss %xmm1, 0x20(%rbx)
addss 0x70(%r14), %xmm1
movss 0x4(%r14), %xmm2
addss %xmm2, %xmm2
addss %xmm1, %xmm2
addss %xmm2, %xmm0
movss %xmm0, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%r12,%r13), %rax
decq %rax
pushq $0x1
popq %rcx
testq %rax, %rax
je 0x31868
movl %ecx, (%rbx)
shrq $0x4, %rax
incl %ecx
jmp 0x3196b