// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/backends/imgui_impl_sdl.cpp
// Function: ImGui_ImplSDL2_NewFrame(SDL_Window*)
void ImGui_ImplSDL2_NewFrame(SDL_Window* window)
{
    ImGuiIO& io = ImGui::GetIO();
    IM_ASSERT(io.Fonts->IsBuilt() && "Font atlas not built! It is generally built by the renderer backend. Missing call to renderer _NewFrame() function? e.g. ImGui_ImplOpenGL3_NewFrame().");

    // Setup display size (every frame to accommodate for window resizing)
    int w, h;
    int display_w, display_h;
    SDL_GetWindowSize(window, &w, &h);
    if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)
        w = h = 0;
    SDL_GL_GetDrawableSize(window, &display_w, &display_h);
    io.DisplaySize = ImVec2((float)w, (float)h);
    if (w > 0 && h > 0)
        io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);

    // Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)
    static Uint64 frequency = SDL_GetPerformanceFrequency();
    Uint64 current_time = SDL_GetPerformanceCounter();
    io.DeltaTime = g_Time > 0 ? (float)((double)(current_time - g_Time) / frequency) : (float)(1.0f / 60.0f);
    g_Time = current_time;

    ImGui_ImplSDL2_UpdateMousePosAndButtons();
    ImGui_ImplSDL2_UpdateMouseCursor();

    // Update game controllers (if enabled and available)
    ImGui_ImplSDL2_UpdateGamepads();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
callq 0x47c7c
movq %rax, %rbx
movq 0xa0(%rax), %rax
cmpl $0x0, 0x40(%rax)
jle 0xaffc8
cmpq $0x0, 0x18(%rax)
jne 0xafa2e
cmpq $0x0, 0x20(%rax)
je 0xaffc8
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r14, %rdi
callq 0xc6f0
movq %r14, %rdi
callq 0xc780
testb $0x40, %al
je 0xafa52
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
movl %eax, -0x30(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
movq %r14, %rdi
callq 0xc7b0
movl -0x30(%rbp), %eax
cvtsi2ss %eax, %xmm0
movl -0x2c(%rbp), %ecx
cvtsi2ss %ecx, %xmm1
movss %xmm0, 0x8(%rbx)
movss %xmm1, 0xc(%rbx)
testl %eax, %eax
setg %al
testl %ecx, %ecx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xafaad
cvtsi2ssl -0x40(%rbp), %xmm2
cvtsi2ssl -0x3c(%rbp), %xmm3
divss %xmm0, %xmm2
divss %xmm1, %xmm3
movss %xmm2, 0xb8(%rbx)
movss %xmm3, 0xbc(%rbx)
movb 0x54d8d(%rip), %al      # 0x104840
testb %al, %al
je 0xaffe7
callq 0xc200
movq 0x54d81(%rip), %rcx     # 0x104848
testq %rcx, %rcx
je 0xafb24
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, %xmm0
movq 0x23451(%rip), %xmm1    # 0xd2f30
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x23455(%rip), %xmm2    # 0xd2f40
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x54d35(%rip), %xmm0    # 0x104838
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
jmp 0xafb2c
movss 0x25950(%rip), %xmm0    # 0xd547c
movss %xmm0, 0x10(%rbx)
movq %rax, 0x54d10(%rip)     # 0x104848
callq 0x47c7c
movq %rax, %rbx
cmpb $0x1, 0x393(%rax)
jne 0xafb67
cvttss2si 0x120(%rbx), %esi
movq 0x54c80(%rip), %rdi     # 0x1047d8
cvttss2si 0x124(%rbx), %edx
callq 0xc0f0
jmp 0xafb78
movabsq $-0x80000000800001, %rax # imm = 0xFF7FFFFFFF7FFFFF
movq %rax, 0x120(%rbx)
leaq -0x38(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xc810
movb 0x54c45(%rip), %cl      # 0x1047d0
orb %al, %cl
andb $0x1, %cl
movb %cl, 0x128(%rbx)
movl %eax, %ecx
shrb $0x2, %cl
orb 0x54c30(%rip), %cl      # 0x1047d1
andb $0x1, %cl
movb %cl, 0x129(%rbx)
shrb %al
orb 0x54c20(%rip), %al      # 0x1047d2
andb $0x1, %al
movb %al, 0x12a(%rbx)
xorl %eax, %eax
movb %al, 0x54c10(%rip)      # 0x1047d2
movb %al, 0x54c09(%rip)      # 0x1047d1
movb %al, 0x54c02(%rip)      # 0x1047d0
callq 0xc070
cmpq %rax, 0x54bfe(%rip)     # 0x1047d8
jne 0xafc3c
cmpb $0x1, 0x4df4d(%rip)     # 0xfdb30
jne 0xafc1c
leaq -0x48(%rbp), %r14
leaq -0x44(%rbp), %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc280
leaq -0x38(%rbp), %r12
leaq -0x34(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xc580
movl (%r14), %eax
subl %eax, (%r12)
movl (%r15), %eax
subl %eax, (%r13)
xorps %xmm0, %xmm0
cvtsi2ssl -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl -0x34(%rbp), %xmm1
movss %xmm0, 0x120(%rbx)
movss %xmm1, 0x124(%rbx)
callq 0x52843
movzbl %al, %edi
callq 0xc6c0
callq 0x47c7c
testb $0x20, (%rax)
jne 0xafc93
movq %rax, %rbx
callq 0x52986
xorl %edi, %edi
cmpl $-0x1, %eax
je 0xafc8e
cmpb $0x0, 0xc0(%rbx)
jne 0xafc8e
cltq
leaq 0x54b7c(%rip), %rcx     # 0x1047f0
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
jne 0xafc84
movq 0x54b6c(%rip), %rdi     # 0x1047f0
callq 0xc630
movl $0x1, %edi
callq 0xc710
callq 0x47c7c
xorps %xmm0, %xmm0
movups %xmm0, 0x33c(%rax)
movups %xmm0, 0x34c(%rax)
movups %xmm0, 0x35c(%rax)
movups %xmm0, 0x36c(%rax)
movups %xmm0, 0x37c(%rax)
movl $0x0, 0x38c(%rax)
testb $0x2, (%rax)
je 0xaffb9
movq %rax, %rbx
xorl %edi, %edi
callq 0xc670
testq %rax, %rax
je 0xaffb5
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0xc750
movss 0x72eb(%rip), %xmm1     # 0xb6fe4
xorps %xmm0, %xmm0
testb %al, %al
je 0xafd03
movaps %xmm1, %xmm0
movss %xmm0, 0x33c(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafd27
movss 0x72bd(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x340(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafd4b
movss 0x7299(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x348(%rbx)
movq %r14, %rdi
movl $0x3, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafd6f
movss 0x7275(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x344(%rbx)
movq %r14, %rdi
movl $0xd, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafd93
movss 0x7251(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x34c(%rbx)
movq %r14, %rdi
movl $0xe, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafdb7
movss 0x722d(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x350(%rbx)
movq %r14, %rdi
movl $0xb, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafddb
movss 0x7209(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x354(%rbx)
movq %r14, %rdi
movl $0xc, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafdff
movss 0x71e5(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x358(%rbx)
movq %r14, %rdi
movl $0x9, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafe23
movss 0x71c1(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x36c(%rbx)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafe47
movss 0x719d(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x370(%rbx)
movq %r14, %rdi
movl $0x9, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafe6b
movss 0x7179(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x374(%rbx)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xafe8f
movss 0x7155(%rip), %xmm0     # 0xb6fe4
movss %xmm0, 0x378(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0xc180
cwtl
addl $0x1f40, %eax           # imm = 0x1F40
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x255ca(%rip), %xmm0    # 0xd5480
movss 0x7126(%rip), %xmm1     # 0xb6fe4
minss %xmm0, %xmm1
ucomiss 0x797b(%rip), %xmm1     # 0xb7844
jbe 0xafedc
ucomiss 0x35c(%rbx), %xmm1
jbe 0xafedc
movss %xmm1, 0x35c(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0xc180
cwtl
addl $0xffffe0c0, %eax       # imm = 0xFFFFE0C0
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
divss 0x25589(%rip), %xmm1    # 0xd5484
movss 0x70e1(%rip), %xmm0     # 0xb6fe4
minss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xaff20
ucomiss 0x360(%rbx), %xmm0
jbe 0xaff20
movss %xmm0, 0x360(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0xc180
cwtl
addl $0x1f40, %eax           # imm = 0x1F40
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
divss 0x25546(%rip), %xmm1    # 0xd5488
movss 0x709a(%rip), %xmm0     # 0xb6fe4
minss %xmm1, %xmm0
ucomiss 0x78ef(%rip), %xmm0     # 0xb7844
jbe 0xaff68
ucomiss 0x364(%rbx), %xmm0
jbe 0xaff68
movss %xmm0, 0x364(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0xc180
cwtl
addl $0xffffe0c0, %eax       # imm = 0xFFFFE0C0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x254fa(%rip), %xmm0    # 0xd5484
movss 0x7052(%rip), %xmm1     # 0xb6fe4
minss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jbe 0xaffaf
ucomiss 0x368(%rbx), %xmm1
jbe 0xaffaf
movss %xmm1, 0x368(%rbx)
orb $0x1, 0x4(%rbx)
jmp 0xaffb9
andb $-0x2, 0x4(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x255f7(%rip), %rdi     # 0xd55c6
leaq 0x25552(%rip), %rsi     # 0xd5528
leaq 0x25699(%rip), %rcx     # 0xd5676
movl $0x15a, %edx            # imm = 0x15A
callq 0xc140
leaq 0x54852(%rip), %rdi     # 0x104840
callq 0xc2c0
testl %eax, %eax
je 0xafabb
callq 0xc950
movq %rax, 0x54831(%rip)     # 0x104838
leaq 0x54832(%rip), %rdi     # 0x104840
callq 0xc4c0
jmp 0xafabb
movq %rax, %rbx
leaq 0x5481e(%rip), %rdi     # 0x104840
callq 0xc3a0
movq %rbx, %rdi
callq 0xc560