// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
callq 0x43b94
movq %rax, %r14
movl 0x14(%r15), %eax
movl %eax, (%rbx)
testl %eax, %eax
jne 0x3e850
addq %r13, %r12
decq %r12
je 0x3e850
xorl %eax, %eax
movq %r12, %rcx
incl %eax
shrq $0x4, %rcx
cmpq $0xf, %r12
movq %rcx, %r12
ja 0x3e83f
movl %eax, (%rbx)
callq 0x562cd
movss %xmm0, 0x4(%rbx)
leaq 0x8054f(%rip), %rdi     # 0xbedb0
movss 0x76767(%rip), %xmm0    # 0xb4fd0
xorl %esi, %esi
xorl %edx, %edx
callq 0x44a23
addss 0x7676a(%rip), %xmm0    # 0xb4fe4
movss %xmm0, 0x8(%rbx)
movss 0x76761(%rip), %xmm1    # 0xb4fe8
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, 0xc(%rbx)
movss 0x7674d(%rip), %xmm2    # 0xb4fec
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
xorps %xmm2, %xmm2
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 0x3e923
addss %xmm0, %xmm1
movss %xmm1, 0x1c(%rbx)
movl 0x10(%r15), %ecx
testl %ecx, %ecx
jle 0x3e916
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
xorps %xmm4, %xmm4
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
nop