// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::ErrorCheckEndFrameRecover(void (*)(void*, char const*, ...), void*)
void    ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data)
{
    // PVS-Studio V1044 is "Loop break conditions do not depend on the number of iterations"
    ImGuiContext& g = *GImGui;
    while (g.CurrentWindowStack.Size > 0)
    {
#ifdef IMGUI_HAS_TABLE
        while (g.CurrentTable && (g.CurrentTable->OuterWindow == g.CurrentWindow || g.CurrentTable->InnerWindow == g.CurrentWindow))
        {
            if (log_callback) log_callback(user_data, "Recovered from missing EndTable() in '%s'", g.CurrentTable->OuterWindow->Name);
            EndTable();
        }
#endif
        ImGuiWindow* window = g.CurrentWindow;
        IM_ASSERT(window != NULL);
        while (g.CurrentTabBar != NULL) //-V1044
        {
            if (log_callback) log_callback(user_data, "Recovered from missing EndTabBar() in '%s'", window->Name);
            EndTabBar();
        }
        while (window->DC.TreeDepth > 0)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing TreePop() in '%s'", window->Name);
            TreePop();
        }
        while (g.GroupStack.Size > window->DC.StackSizesOnBegin.SizeOfGroupStack)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing EndGroup() in '%s'", window->Name);
            EndGroup();
        }
        while (window->IDStack.Size > 1)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing PopID() in '%s'", window->Name);
            PopID();
        }
        while (g.ColorStack.Size > window->DC.StackSizesOnBegin.SizeOfColorStack)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing PopStyleColor() in '%s' for ImGuiCol_%s", window->Name, GetStyleColorName(g.ColorStack.back().Col));
            PopStyleColor();
        }
        while (g.StyleVarStack.Size > window->DC.StackSizesOnBegin.SizeOfStyleVarStack)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name);
            PopStyleVar();
        }
        while (g.FocusScopeStack.Size > window->DC.StackSizesOnBegin.SizeOfFocusScopeStack)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name);
            PopFocusScope();
        }
        if (g.CurrentWindowStack.Size == 1)
        {
            IM_ASSERT(g.CurrentWindow->IsFallbackWindow);
            break;
        }
        IM_ASSERT(window == g.CurrentWindow);
        if (window->Flags & ImGuiWindowFlags_ChildWindow)
        {
            if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
            EndChild();
        }
        else
        {
            if (log_callback) log_callback(user_data, "Recovered from missing End() for '%s'", window->Name);
            End();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x137489(%rip), %rax    # 0x212f40
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x1ab8(%rax)
jle 0xdbe73
jmp 0xdbace
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x20a8(%rcx)
movb %al, -0x21(%rbp)
je 0xdbb2e
movq -0x18(%rbp), %rax
movq 0x20a8(%rax), %rax
movq 0x1c8(%rax), %rcx
movq -0x18(%rbp), %rdx
movb $0x1, %al
cmpq 0x1ae0(%rdx), %rcx
movb %al, -0x22(%rbp)
je 0xdbb28
movq -0x18(%rbp), %rax
movq 0x20a8(%rax), %rax
movq 0x1d0(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x1ae0(%rcx), %rax
sete %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xdbb37
jmp 0xdbb70
cmpq $0x0, -0x8(%rbp)
je 0xdbb66
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20a8(%rax), %rax
movq 0x1c8(%rax), %rax
movq (%rax), %rdx
leaq 0x98d71(%rip), %rsi     # 0x1748d3
movb $0x0, %al
callq *%rcx
callq 0x12dc40
jmp 0xdbace
movq -0x18(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xdbb88
jmp 0xdbba7
leaq 0x98d6e(%rip), %rdi     # 0x1748fd
leaq 0x97373(%rip), %rsi     # 0x172f09
movl $0x1b7f, %edx           # imm = 0x1B7F
leaq 0x98d6c(%rip), %rcx     # 0x17490e
callq 0xd180
jmp 0xdbba9
movq -0x18(%rbp), %rax
cmpq $0x0, 0x2108(%rax)
je 0xdbbdf
cmpq $0x0, -0x8(%rbp)
je 0xdbbd8
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98d7f(%rip), %rsi     # 0x174953
movb $0x0, %al
callq *%rcx
callq 0x155dd0
jmp 0xdbba9
jmp 0xdbbe1
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18c(%rax)
jle 0xdbc16
cmpq $0x0, -0x8(%rbp)
je 0xdbc0f
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98d73(%rip), %rsi     # 0x17497e
movb $0x0, %al
callq *%rcx
callq 0x1523d0
jmp 0xdbbe1
jmp 0xdbc18
movq -0x18(%rbp), %rax
movl 0x1c60(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x202(%rcx), %ecx
cmpl %ecx, %eax
jle 0xdbc59
cmpq $0x0, -0x8(%rbp)
je 0xdbc52
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98d59(%rip), %rsi     # 0x1749a7
movb $0x0, %al
callq *%rcx
callq 0xdbe80
jmp 0xdbc18
jmp 0xdbc5b
movq -0x20(%rbp), %rax
cmpl $0x1, 0xc8(%rax)
jle 0xdbc90
cmpq $0x0, -0x8(%rbp)
je 0xdbc89
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98d4c(%rip), %rsi     # 0x1749d1
movb $0x0, %al
callq *%rcx
callq 0xdb640
jmp 0xdbc5b
jmp 0xdbc92
movq -0x18(%rbp), %rax
movl 0x1c10(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x1fa(%rcx), %ecx
cmpl %ecx, %eax
jle 0xdbd0b
cmpq $0x0, -0x8(%rbp)
je 0xdbcff
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1c10, %rdi           # imm = 0x1C10
callq 0xe8720
movl (%rax), %edi
callq 0xc7cf0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %r8
movq %rax, %rcx
leaq 0x98cfe(%rip), %rsi     # 0x1749f8
movb $0x0, %al
callq *%r8
movl $0x1, %edi
callq 0xc7990
jmp 0xdbc92
jmp 0xdbd0d
movq -0x18(%rbp), %rax
movl 0x1c20(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x1fc(%rcx), %ecx
cmpl %ecx, %eax
jle 0xdbd53
cmpq $0x0, -0x8(%rbp)
je 0xdbd47
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98cf4(%rip), %rsi     # 0x174a37
movb $0x0, %al
callq *%rcx
movl $0x1, %edi
callq 0xc7c10
jmp 0xdbd0d
jmp 0xdbd55
movq -0x18(%rbp), %rax
movl 0x1c40(%rax), %eax
movq -0x20(%rbp), %rcx
movswl 0x200(%rcx), %ecx
cmpl %ecx, %eax
jle 0xdbd96
cmpq $0x0, -0x8(%rbp)
je 0xdbd8f
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98cd9(%rip), %rsi     # 0x174a64
movb $0x0, %al
callq *%rcx
callq 0xdaff0
jmp 0xdbd55
movq -0x18(%rbp), %rax
cmpl $0x1, 0x1ab8(%rax)
jne 0xdbddd
movq -0x18(%rbp), %rax
movq 0x1ae0(%rax), %rax
testb $0x1, 0x96(%rax)
je 0xdbdb9
jmp 0xdbdd8
leaq 0x98cd3(%rip), %rdi     # 0x174a93
leaq 0x97142(%rip), %rsi     # 0x172f09
movl $0x1ba5, %edx           # imm = 0x1BA5
leaq 0x98b3b(%rip), %rcx     # 0x17490e
callq 0xd180
jmp 0xdbe73
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x1ae0(%rcx), %rax
jne 0xdbdf0
jmp 0xdbe0f
leaq 0xb05cf(%rip), %rdi     # 0x18c3c6
leaq 0x9710b(%rip), %rsi     # 0x172f09
movl $0x1ba8, %edx           # imm = 0x1BA8
leaq 0x98b04(%rip), %rcx     # 0x17490e
callq 0xd180
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0xdbe48
cmpq $0x0, -0x8(%rbp)
je 0xdbe41
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98c78(%rip), %rsi     # 0x174ab5
movb $0x0, %al
callq *%rcx
callq 0xd5d90
jmp 0xdbe6e
cmpq $0x0, -0x8(%rbp)
je 0xdbe69
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x98c7b(%rip), %rsi     # 0x174ae0
movb $0x0, %al
callq *%rcx
callq 0xd3b60
jmp 0xdbabb
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)