// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/src/../include/imgui_club/imgui_memory_editor/imgui_memory_editor.h
// Function: MemoryEditor::DrawPreviewData(unsigned long, unsigned char const*, unsigned long, int, MemoryEditor::DataFormat, char*, unsigned long) const
void DrawPreviewData(size_t addr, const ImU8* mem_data, size_t mem_size, ImGuiDataType data_type, DataFormat data_format, char* out_buf, size_t out_buf_size) const
    {
        uint8_t buf[8];
        size_t elem_size = DataTypeGetSize(data_type);
        size_t size = addr + elem_size > mem_size ? mem_size - addr : elem_size;
        if (ReadFn)
            for (int i = 0, n = (int)size; i < n; ++i)
                buf[i] = ReadFn(mem_data, addr + i);
        else
            memcpy(buf, mem_data + addr, size);

        if (data_format == DataFormat_Bin)
        {
            uint8_t binbuf[8];
            EndianessCopy(binbuf, buf, size);
            ImSnprintf(out_buf, out_buf_size, "%s", FormatBinary(binbuf, (int)size * 8));
            return;
        }

        out_buf[0] = 0;
        switch (data_type)
        {
        case ImGuiDataType_S8:
        {
            int8_t int8 = 0;
            EndianessCopy(&int8, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%hhd", int8); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%02x", int8 & 0xFF); return; }
            break;
        }
        case ImGuiDataType_U8:
        {
            uint8_t uint8 = 0;
            EndianessCopy(&uint8, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%hhu", uint8); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%02x", uint8 & 0XFF); return; }
            break;
        }
        case ImGuiDataType_S16:
        {
            int16_t int16 = 0;
            EndianessCopy(&int16, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%hd", int16); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%04x", int16 & 0xFFFF); return; }
            break;
        }
        case ImGuiDataType_U16:
        {
            uint16_t uint16 = 0;
            EndianessCopy(&uint16, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%hu", uint16); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%04x", uint16 & 0xFFFF); return; }
            break;
        }
        case ImGuiDataType_S32:
        {
            int32_t int32 = 0;
            EndianessCopy(&int32, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%d", int32); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%08x", int32); return; }
            break;
        }
        case ImGuiDataType_U32:
        {
            uint32_t uint32 = 0;
            EndianessCopy(&uint32, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%u", uint32); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%08x", uint32); return; }
            break;
        }
        case ImGuiDataType_S64:
        {
            int64_t int64 = 0;
            EndianessCopy(&int64, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%lld", (long long)int64); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%016llx", (long long)int64); return; }
            break;
        }
        case ImGuiDataType_U64:
        {
            uint64_t uint64 = 0;
            EndianessCopy(&uint64, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%llu", (long long)uint64); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "0x%016llx", (long long)uint64); return; }
            break;
        }
        case ImGuiDataType_Float:
        {
            float float32 = 0.0f;
            EndianessCopy(&float32, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%f", float32); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "%a", float32); return; }
            break;
        }
        case ImGuiDataType_Double:
        {
            double float64 = 0.0;
            EndianessCopy(&float64, buf, size);
            if (data_format == DataFormat_Dec) { ImSnprintf(out_buf, out_buf_size, "%f", float64); return; }
            if (data_format == DataFormat_Hex) { ImSnprintf(out_buf, out_buf_size, "%a", float64); return; }
            break;
        }
        case ImGuiDataType_COUNT:
            break;
        } // Switch
        IM_ASSERT(0); // Shouldn't reach
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, -0x48(%rbp)
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movl %r8d, -0x44(%rbp)
movl %r8d, %esi
callq 0x32590
leaq (%rax,%r15), %rcx
movq %r12, %rdx
subq %r15, %rdx
cmpq %r12, %rcx
cmovbeq %rax, %rdx
cmpq $0x0, 0x20(%r13)
movq %rdx, -0x40(%rbp)
je 0x32c6e
xorl %r12d, %r12d
testl %edx, %edx
movl $0x0, %ebx
cmovgl %edx, %ebx
cmpq %r12, %rbx
je 0x32c7d
leaq (%r15,%r12), %rsi
movq %r14, %rdi
callq *0x20(%r13)
movb %al, -0x38(%rbp,%r12)
incq %r12
jmp 0x32c54
addq %r15, %r14
leaq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0xc080
movq 0x18(%rbp), %r15
movq 0x10(%rbp), %r14
movl -0x48(%rbp), %ebx
testl %ebx, %ebx
je 0x32d03
movb $0x0, (%r14)
movl -0x44(%rbp), %eax
cmpl $0x9, %eax
ja 0x330e7
movl %eax, %eax
leaq 0x6937f(%rip), %rcx     # 0x9c024
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, -0x30(%rbp)
movq 0xb0fc7(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32ccc
leaq 0x4e1(%rip), %rax       # 0x331a6
movq %rax, 0xb0fb4(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x33098
cmpl $0x1, %ebx
jne 0x330e7
movsbl -0x30(%rbp), %ecx
leaq 0x698b3(%rip), %rdx     # 0x9c5b1
jmp 0x330b0
movq 0xb0f76(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32d1d
leaq 0x490(%rip), %rax       # 0x331a6
movq %rax, 0xb0f63(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rbx
leaq -0x38(%rbp), %rsi
movq %rbx, %rdi
movq -0x40(%rbp), %r12
movq %r12, %rdx
callq *%rax
shll $0x3, %r12d
movq %r13, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x33106
leaq 0x6ce36(%rip), %rdx     # 0x9fb87
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rcx
jmp 0x33067
andl $0x0, -0x30(%rbp)
movq 0xb0f16(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32d7d
leaq 0x430(%rip), %rax       # 0x331a6
movq %rax, 0xb0f03(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x3304a
cmpl $0x1, %ebx
jne 0x330e7
movl -0x30(%rbp), %ecx
leaq 0x709d4(%rip), %rdx     # 0xa3782
jmp 0x330b0
andq $0x0, -0x30(%rbp)
movq 0xb0ec1(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32dd2
leaq 0x3db(%rip), %rax       # 0x331a6
movq %rax, 0xb0eae(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x33070
cmpl $0x1, %ebx
jne 0x330e7
movsd -0x30(%rbp), %xmm0
leaq 0x73a14(%rip), %rdx     # 0xa6819
jmp 0x330cb
andw $0x0, -0x30(%rbp)
movq 0xb0e6a(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32e29
leaq 0x384(%rip), %rax       # 0x331a6
movq %rax, 0xb0e57(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x3307e
cmpl $0x1, %ebx
jne 0x330e7
movswl -0x30(%rbp), %ecx
leaq 0x69767(%rip), %rdx     # 0x9c5c2
jmp 0x330b0
andw $0x0, -0x30(%rbp)
movq 0xb0e14(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32e7f
leaq 0x32e(%rip), %rax       # 0x331a6
movq %rax, 0xb0e01(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x1, %ebx
je 0x3308b
cmpl $0x2, %ebx
jne 0x330e7
leaq 0x69719(%rip), %rdx     # 0x9c5c6
jmp 0x33092
andq $0x0, -0x30(%rbp)
movq 0xb0dc2(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32ed1
leaq 0x2dc(%rip), %rax       # 0x331a6
movq %rax, 0xb0daf(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x33056
cmpl $0x1, %ebx
jne 0x330e7
movq -0x30(%rbp), %rcx
leaq 0x696e4(%rip), %rdx     # 0x9c5e7
jmp 0x33061
movb $0x0, -0x30(%rbp)
movq 0xb0d6d(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32f26
leaq 0x287(%rip), %rax       # 0x331a6
movq %rax, 0xb0d5a(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x1, %ebx
je 0x330a5
cmpl $0x2, %ebx
jne 0x330e7
leaq 0x69662(%rip), %rdx     # 0x9c5b6
jmp 0x330ac
andl $0x0, -0x30(%rbp)
movq 0xb0d1c(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32f77
leaq 0x236(%rip), %rax       # 0x331a6
movq %rax, 0xb0d09(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x3304a
cmpl $0x1, %ebx
jne 0x330e7
movl -0x30(%rbp), %ecx
leaq 0x79d07(%rip), %rdx     # 0xaccaf
jmp 0x330b0
andq $0x0, -0x30(%rbp)
movq 0xb0cc7(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x32fcc
leaq 0x1e1(%rip), %rax       # 0x331a6
movq %rax, 0xb0cb4(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x2, %ebx
je 0x33056
cmpl $0x1, %ebx
jne 0x330e7
movq -0x30(%rbp), %rcx
leaq 0x695de(%rip), %rdx     # 0x9c5d8
jmp 0x33061
andl $0x0, -0x30(%rbp)
movq 0xb0c79(%rip), %rax     # 0xe3c80
testq %rax, %rax
jne 0x3301a
leaq 0x193(%rip), %rax       # 0x331a6
movq %rax, 0xb0c66(%rip)     # 0xe3c80
movl 0xb0(%r13), %ecx
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq *%rax
cmpl $0x1, %ebx
je 0x330bf
cmpl $0x2, %ebx
jne 0x330e7
leaq 0x695a4(%rip), %rdx     # 0x9c5ec
jmp 0x330c6
movl -0x30(%rbp), %ecx
leaq 0x6957d(%rip), %rdx     # 0x9c5d1
jmp 0x330b0
movq -0x30(%rbp), %rcx
leaq 0x6957c(%rip), %rdx     # 0x9c5dd
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xc4a0
jmp 0x330d8
movsd -0x30(%rbp), %xmm0
leaq 0x69570(%rip), %rdx     # 0x9c5ec
jmp 0x330cb
movzwl -0x30(%rbp), %ecx
leaq 0x6953d(%rip), %rdx     # 0x9c5c6
jmp 0x330b0
leaq 0x6953b(%rip), %rdx     # 0x9c5cd
movzwl -0x30(%rbp), %ecx
jmp 0x330b0
movzbl -0x30(%rbp), %ecx
leaq 0x69513(%rip), %rdx     # 0x9c5b6
jmp 0x330b0
leaq 0x69511(%rip), %rdx     # 0x9c5bd
movzbl -0x30(%rbp), %ecx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xc4a0
jmp 0x330d8
leaq 0x73753(%rip), %rdx     # 0xa6819
cvtss2sd -0x30(%rbp), %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0xc4a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6c02e(%rip), %rdi     # 0x9f11c
leaq 0x69297(%rip), %rsi     # 0x9c38c
leaq 0x694f3(%rip), %rcx     # 0x9c5ef
movl $0x2e2, %edx            # imm = 0x2E2
callq 0xc140