// File: /workspace/github_cpp_makefile_star2_O1/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 0x44587
movq %rax, %r14
movl 0x14(%r15), %eax
movl %eax, (%rbx)
testl %eax, %eax
jne 0x3f0a4
addq %r13, %r12
decq %r12
je 0x3f0a4
movl (%rbx), %eax
movq %r12, %rcx
incl %eax
shrq $0x4, %rcx
cmpq $0xf, %r12
movq %rcx, %r12
ja 0x3f093
movl %eax, (%rbx)
callq 0x573d2
movss %xmm0, 0x4(%rbx)
leaq 0x81d2b(%rip), %rdi     # 0xc0de0
movss 0x77f13(%rip), %xmm0    # 0xb6fd0
xorl %esi, %esi
xorl %edx, %edx
callq 0x4548d
addss 0x77f16(%rip), %xmm0    # 0xb6fe4
movss %xmm0, 0x8(%rbx)
movss 0x77f0d(%rip), %xmm1    # 0xb6fe8
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, 0xc(%rbx)
movss 0x77ef9(%rip), %xmm2    # 0xb6fec
mulss %xmm1, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
movss %xmm2, 0x10(%rbx)
movl (%rbx), %eax
addl $0x2, %eax
cvtsi2ss %eax, %xmm4
mulss %xmm0, %xmm4
movss %xmm4, 0x14(%rbx)
movl 0x4(%r15), %eax
cvtsi2ss %eax, %xmm3
mulss %xmm3, %xmm1
addss %xmm4, %xmm1
movss %xmm1, 0x18(%rbx)
movss %xmm1, 0x20(%rbx)
movss %xmm1, 0x1c(%rbx)
cmpb $0x1, 0xb(%r15)
jne 0x3f175
addss %xmm0, %xmm1
movss %xmm1, 0x1c(%rbx)
movl 0x10(%r15), %ecx
testl %ecx, %ecx
jle 0x3f167
addl %ecx, %eax
decl %eax
cltd
idivl %ecx
xorps %xmm4, %xmm4
cvtsi2ss %eax, %xmm4
mulss %xmm2, %xmm4
addss %xmm1, %xmm4
movss %xmm4, 0x1c(%rbx)
mulss %xmm0, %xmm3
addss 0x1c(%rbx), %xmm3
movss %xmm3, 0x20(%rbx)
movss 0x20(%rbx), %xmm1
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