// File: donfreiday[P]gb/./imgui/imgui_demo.cpp
// Function: ExampleAppConsole::ExecCommand(char const*)
void    ExecCommand(const char* command_line)
    {
        AddLog("# %s\n", command_line);

        // Insert into history. First find match and delete it so it can be pushed to the back. This isn't trying to be smart or optimal.
        HistoryPos = -1;
        for (int i = History.Size-1; i >= 0; i--)
            if (Stricmp(History[i], command_line) == 0)
            {
                free(History[i]);
                History.erase(History.begin() + i);
                break;
            }
        History.push_back(strdup(command_line));

        // Process command
        if (Stricmp(command_line, "CLEAR") == 0)
        {
            ClearLog();
        }
        else if (Stricmp(command_line, "HELP") == 0)
        {
            AddLog("Commands:");
            for (int i = 0; i < Commands.Size; i++)
                AddLog("- %s", Commands[i]);
        }
        else if (Stricmp(command_line, "HISTORY") == 0)
        {
            for (int i = History.Size >= 10 ? History.Size - 10 : 0; i < History.Size; i++)
                AddLog("%3d: %s\n", i, History[i]);
        }
        else
        {
            AddLog("Unknown command: '%s'\n", command_line);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x24a00(%rip), %rsi     # 0x60233
movb $0x0, %al
callq 0x3b6c0
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x128(%rax) # imm = 0xFFFFFFFF
movl 0x118(%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x3b8e3
movq -0x30(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0x14(%rbp), %esi
callq 0x3b520
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x3c250
cmpl $0x0, %eax
jne 0x3b8d3
movq -0x30(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0x14(%rbp), %esi
callq 0x3b520
movq (%rax), %rdi
callq 0x7950
movq -0x30(%rbp), %rdi
movq %rdi, %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x38(%rbp)
addq $0x118, %rdi            # imm = 0x118
callq 0x3c3d0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x3c2d0
jmp 0x3b8e3
jmp 0x3b8d5
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3b854
movq -0x30(%rbp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7030
movq -0x40(%rbp), %rdi
movq %rax, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x3ba60
movq -0x10(%rbp), %rdi
leaq 0x246ac(%rip), %rsi     # 0x5ffc2
callq 0x3c250
cmpl $0x0, %eax
jne 0x3b92e
movq -0x30(%rbp), %rdi
callq 0x3b3c0
jmp 0x3ba4b
movq -0x10(%rbp), %rdi
leaq 0x2467c(%rip), %rsi     # 0x5ffb5
callq 0x3c250
cmpl $0x0, %eax
jne 0x3b9a3
movq -0x30(%rbp), %rdi
leaq 0x248eb(%rip), %rsi     # 0x60239
movb $0x0, %al
callq 0x3b6c0
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x130(%rcx), %eax
jge 0x3b99e
movq -0x30(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl -0x24(%rbp), %esi
callq 0x3c1f0
movq -0x30(%rbp), %rdi
movq (%rax), %rdx
leaq 0x248b7(%rip), %rsi     # 0x60243
movb $0x0, %al
callq 0x3b6c0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3b95c
jmp 0x3ba49
movq -0x10(%rbp), %rdi
leaq 0x2460c(%rip), %rsi     # 0x5ffba
callq 0x3c250
cmpl $0x0, %eax
jne 0x3ba31
movq -0x30(%rbp), %rax
cmpl $0xa, 0x118(%rax)
jl 0x3b9d7
movq -0x30(%rbp), %rax
movl 0x118(%rax), %eax
subl $0xa, %eax
movl %eax, -0x44(%rbp)
jmp 0x3b9de
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x3b9de
movl -0x44(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x30(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x118(%rcx), %eax
jge 0x3ba2f
movq -0x30(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, -0x48(%rbp)
addq $0x118, %rdi            # imm = 0x118
movl -0x28(%rbp), %esi
callq 0x3b520
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %edx
movq (%rax), %rcx
leaq 0x2482b(%rip), %rsi     # 0x60248
movb $0x0, %al
callq 0x3b6c0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3b9e4
jmp 0x3ba47
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x24811(%rip), %rsi     # 0x60251
movb $0x0, %al
callq 0x3b6c0
jmp 0x3ba49
jmp 0x3ba4b
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)