// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::ErrorCheckNewFrameSanityChecks()
static void ImGui::ErrorCheckNewFrameSanityChecks()
{
    ImGuiContext& g = *GImGui;

    // Check user IM_ASSERT macro
    // (IF YOU GET A WARNING OR COMPILE ERROR HERE: it means you assert macro is incorrectly defined!
    //  If your macro uses multiple statements, it NEEDS to be surrounded by a 'do { ... } while (0)' block.
    //  This is a common C/C++ idiom to allow multiple statements macros to be used in control flow blocks.)
    // #define IM_ASSERT(EXPR)   if (SomeCode(EXPR)) SomeMoreCode();                    // Wrong!
    // #define IM_ASSERT(EXPR)   do { if (SomeCode(EXPR)) SomeMoreCode(); } while (0)   // Correct!
    if (true) IM_ASSERT(1); else IM_ASSERT(0);

    // Check user data
    // (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
    IM_ASSERT(g.Initialized);
    IM_ASSERT((g.IO.DeltaTime > 0.0f || g.FrameCount == 0)              && "Need a positive DeltaTime!");
    IM_ASSERT((g.FrameCount == 0 || g.FrameCountEnded == g.FrameCount)  && "Forgot to call Render() or EndFrame() at the end of the previous frame?");
    IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f  && "Invalid DisplaySize value!");
    IM_ASSERT(g.IO.Fonts->Fonts.Size > 0                                && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()?");
    IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded()                          && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()?");
    IM_ASSERT(g.Style.CurveTessellationTol > 0.0f                       && "Invalid style setting!");
    IM_ASSERT(g.Style.CircleSegmentMaxError > 0.0f                      && "Invalid style setting!");
    IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f            && "Invalid style setting!"); // Allows us to avoid a few clamps in color computations
    IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting.");
    IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right);
    for (int n = 0; n < ImGuiKey_COUNT; n++)
        IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)");

    // Check: required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only added in 1.60 WIP)
    if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard)
        IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");

    // Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
    if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
        g.IO.ConfigWindowsResizeFromEdges = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq 0x145ce1(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, (%rax)
je 0xcd26e
jmp 0xcd28d
leaq 0xa6713(%rip), %rdi     # 0x173988
leaq 0xa5c8d(%rip), %rsi     # 0x172f09
movl $0x1b31, %edx           # imm = 0x1B31
leaq 0xa98f5(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
ja 0xcd2b0
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x1a68(%rcx)
movb %al, -0xd(%rbp)
jne 0xcd2b7
movb $0x1, %al
movb %al, -0xd(%rbp)
jmp 0xcd2b7
movb -0xd(%rbp), %al
testb $0x1, %al
jne 0xcd2c0
jmp 0xcd2c2
jmp 0xcd2e1
leaq 0xa98fc(%rip), %rdi     # 0x176bc5
leaq 0xa5c39(%rip), %rsi     # 0x172f09
movl $0x1b32, %edx           # imm = 0x1B32
leaq 0xa98a1(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1a68(%rax)
je 0xcd309
movq -0x8(%rbp), %rax
movl 0x1a6c(%rax), %ecx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpl 0x1a68(%rdx), %ecx
movb %al, -0xe(%rbp)
jne 0xcd310
movb $0x1, %al
movb %al, -0xe(%rbp)
jmp 0xcd310
movb -0xe(%rbp), %al
testb $0x1, %al
jne 0xcd319
jmp 0xcd31b
jmp 0xcd33a
leaq 0xa9938(%rip), %rdi     # 0x176c5a
leaq 0xa5be0(%rip), %rsi     # 0x172f09
movl $0x1b33, %edx           # imm = 0x1B33
leaq 0xa9848(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0xf(%rbp)
jb 0xcd36d
movq -0x8(%rbp), %rax
movss 0x14(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0xf(%rbp)
jb 0xcd36d
movb $0x1, %al
movb %al, -0xf(%rbp)
jmp 0xcd36d
movb -0xf(%rbp), %al
testb $0x1, %al
jne 0xcd376
jmp 0xcd378
jmp 0xcd397
leaq 0xa997c(%rip), %rdi     # 0x176cfb
leaq 0xa5b83(%rip), %rsi     # 0x172f09
movl $0x1b34, %edx           # imm = 0x1B34
leaq 0xa97eb(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rcx
xorl %eax, %eax
cmpl $0x0, 0x40(%rcx)
movb %al, -0x10(%rbp)
jle 0xcd3b4
movb $0x1, %al
movb %al, -0x10(%rbp)
jmp 0xcd3b4
movb -0x10(%rbp), %al
testb $0x1, %al
jne 0xcd3bd
jmp 0xcd3bf
jmp 0xcd3de
leaq 0xa99e8(%rip), %rdi     # 0x176dae
leaq 0xa5b3c(%rip), %rsi     # 0x172f09
movl $0x1b35, %edx           # imm = 0x1B35
leaq 0xa97a4(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rdi
addq $0x40, %rdi
xorl %esi, %esi
callq 0xede60
movq (%rax), %rdi
callq 0xea840
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x11(%rbp)
jne 0xcd40a
jmp 0xcd411
movb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0xcd411
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xcd41a
jmp 0xcd41c
jmp 0xcd43b
leaq 0xa9a05(%rip), %rdi     # 0x176e28
leaq 0xa5adf(%rip), %rsi     # 0x172f09
movl $0x1b36, %edx           # imm = 0x1B36
leaq 0xa9747(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x161c(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0x12(%rbp)
jbe 0xcd45b
movb $0x1, %al
movb %al, -0x12(%rbp)
jmp 0xcd45b
movb -0x12(%rbp), %al
testb $0x1, %al
jne 0xcd464
jmp 0xcd466
jmp 0xcd485
leaq 0xa9a52(%rip), %rdi     # 0x176ebf
leaq 0xa5a95(%rip), %rsi     # 0x172f09
movl $0x1b37, %edx           # imm = 0x1B37
leaq 0xa96fd(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x1620(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0x13(%rbp)
jbe 0xcd4a5
movb $0x1, %al
movb %al, -0x13(%rbp)
jmp 0xcd4a5
movb -0x13(%rbp), %al
testb $0x1, %al
jne 0xcd4ae
jmp 0xcd4b0
jmp 0xcd4cf
leaq 0xa9a48(%rip), %rdi     # 0x176eff
leaq 0xa5a4b(%rip), %rsi     # 0x172f09
movl $0x1b38, %edx           # imm = 0x1B38
leaq 0xa96b3(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x1560(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0x14(%rbp)
jb 0xcd509
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movss 0xa3746(%rip), %xmm0    # 0x170c3c
ucomiss 0x1560(%rcx), %xmm0
movb %al, -0x14(%rbp)
jb 0xcd509
movb $0x1, %al
movb %al, -0x14(%rbp)
jmp 0xcd509
movb -0x14(%rbp), %al
testb $0x1, %al
jne 0xcd512
jmp 0xcd514
jmp 0xcd533
leaq 0xa9a25(%rip), %rdi     # 0x176f40
leaq 0xa59e7(%rip), %rsi     # 0x172f09
movl $0x1b39, %edx           # imm = 0x1B39
leaq 0xa964f(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x1574(%rax), %xmm0
xorl %eax, %eax
movss 0xa36f3(%rip), %xmm1    # 0x170c3c
ucomiss %xmm1, %xmm0
movb %al, -0x15(%rbp)
jb 0xcd576
movq -0x8(%rbp), %rax
movss 0x1578(%rax), %xmm0
xorl %eax, %eax
movss 0xa36d5(%rip), %xmm1    # 0x170c3c
ucomiss %xmm1, %xmm0
movb %al, -0x15(%rbp)
jb 0xcd576
movb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0xcd576
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0xcd57f
jmp 0xcd581
jmp 0xcd5a0
leaq 0xa9a1a(%rip), %rdi     # 0x176fa2
leaq 0xa597a(%rip), %rsi     # 0x172f09
movl $0x1b3a, %edx           # imm = 0x1B3A
leaq 0xa95e2(%rip), %rcx     # 0x176b7d
callq 0xd180
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $-0x1, 0x1584(%rcx)
movb %al, -0x16(%rbp)
je 0xcd5d5
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x1584(%rcx)
movb %al, -0x16(%rbp)
je 0xcd5d5
movq -0x8(%rbp), %rax
cmpl $0x1, 0x1584(%rax)
sete %al
movb %al, -0x16(%rbp)
movb -0x16(%rbp), %al
testb $0x1, %al
jne 0xcd5de
jmp 0xcd5e0
jmp 0xcd5ff
leaq 0xa9a1a(%rip), %rdi     # 0x177001
leaq 0xa591b(%rip), %rsi     # 0x172f09
movl $0x1b3b, %edx           # imm = 0x1B3B
leaq 0xa9583(%rip), %rcx     # 0x176b7d
callq 0xd180
movl $0x0, -0xc(%rbp)
cmpl $0x16, -0xc(%rbp)
jge 0xcd675
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
xorl %eax, %eax
cmpl $-0x1, 0x3c(%rcx,%rdx,4)
movb %al, -0x17(%rbp)
jl 0xcd63e
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
xorl %eax, %eax
cmpl $0x200, 0x3c(%rcx,%rdx,4) # imm = 0x200
movb %al, -0x17(%rbp)
jge 0xcd63e
movb $0x1, %al
movb %al, -0x17(%rbp)
jmp 0xcd63e
movb -0x17(%rbp), %al
testb $0x1, %al
jne 0xcd647
jmp 0xcd649
jmp 0xcd668
leaq 0xa9aa5(%rip), %rdi     # 0x1770f5
leaq 0xa58b2(%rip), %rsi     # 0x172f09
movl $0x1b3d, %edx           # imm = 0x1B3D
leaq 0xa951a(%rip), %rcx     # 0x176b7d
callq 0xd180
jmp 0xcd66a
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xcd606
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xcd6c6
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $-0x1, 0x6c(%rcx)
movb %al, -0x18(%rbp)
je 0xcd69a
movb $0x1, %al
movb %al, -0x18(%rbp)
jmp 0xcd69a
movb -0x18(%rbp), %al
testb $0x1, %al
jne 0xcd6a3
jmp 0xcd6a5
jmp 0xcd6c4
leaq 0xa9b48(%rip), %rdi     # 0x1771f4
leaq 0xa5856(%rip), %rsi     # 0x172f09
movl $0x1b41, %edx           # imm = 0x1B41
leaq 0xa94be(%rip), %rcx     # 0x176b7d
callq 0xd180
jmp 0xcd6c6
movq -0x8(%rbp), %rax
testb $0x1, 0xcc(%rax)
je 0xcd6ed
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0xcd6ed
movq -0x8(%rbp), %rax
movb $0x0, 0xcc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)