// File: /workspace/github_cpp_makefile_star2_O3/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 0x4714d
movq %rax, %rbx
movq 0xa0(%rax), %rax
cmpl $0x0, 0x40(%rax)
jle 0xae8f2
cmpq $0x0, 0x18(%rax)
jne 0xae34a
cmpq $0x0, 0x20(%rax)
je 0xae8f2
leaq -0x30(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r14, %rdi
callq 0xc6f0
movq %r14, %rdi
callq 0xc780
testb $0x40, %al
je 0xae36e
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 0xae3c9
cvtsi2ssl -0x40(%rbp), %xmm2
cvtsi2ssl -0x3c(%rbp), %xmm3
divss %xmm0, %xmm2
divss %xmm1, %xmm3
movss %xmm2, 0xb8(%rbx)
movss %xmm3, 0xbc(%rbx)
movb 0x54471(%rip), %al      # 0x102840
testb %al, %al
je 0xae911
callq 0xc200
movq 0x54465(%rip), %rcx     # 0x102848
testq %rcx, %rcx
je 0xae440
movq %rax, %rdx
subq %rcx, %rdx
movq %rdx, %xmm0
movq 0x22a05(%rip), %xmm1    # 0xd0e00
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x22a09(%rip), %xmm2    # 0xd0e10
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movq 0x54419(%rip), %xmm0    # 0x102838
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 0xae448
movss 0x24ee0(%rip), %xmm0    # 0xd3328
movss %xmm0, 0x10(%rbx)
movq %rax, 0x543f4(%rip)     # 0x102848
callq 0x4714d
movq %rax, %rbx
cmpb $0x1, 0x393(%rax)
jne 0xae483
cvttss2si 0x120(%rbx), %esi
movq 0x54364(%rip), %rdi     # 0x1027d8
cvttss2si 0x124(%rbx), %edx
callq 0xc0f0
jmp 0xae494
movabsq $-0x80000000800001, %rax # imm = 0xFF7FFFFFFF7FFFFF
movq %rax, 0x120(%rbx)
leaq -0x38(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xc810
movb 0x54329(%rip), %cl      # 0x1027d0
orb %al, %cl
andb $0x1, %cl
movb %cl, 0x128(%rbx)
movl %eax, %ecx
shrb $0x2, %cl
orb 0x54314(%rip), %cl      # 0x1027d1
andb $0x1, %cl
movb %cl, 0x129(%rbx)
shrb %al
orb 0x54304(%rip), %al      # 0x1027d2
andb $0x1, %al
movb %al, 0x12a(%rbx)
xorl %eax, %eax
movb %al, 0x542f4(%rip)      # 0x1027d2
movb %al, 0x542ed(%rip)      # 0x1027d1
movb %al, 0x542e6(%rip)      # 0x1027d0
callq 0xc070
cmpq %rax, 0x542e2(%rip)     # 0x1027d8
jne 0xae566
cmpb $0x0, 0x4d631(%rip)     # 0xfbb30
je 0xae542
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 (%r12), %eax
subl (%r14), %eax
movl %eax, (%r12)
movl (%r13), %ecx
subl (%r15), %ecx
movl %ecx, (%r13)
jmp 0xae548
movl -0x38(%rbp), %eax
movl -0x34(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss %xmm0, 0x120(%rbx)
movss %xmm1, 0x124(%rbx)
callq 0x51855
movzbl %al, %edi
callq 0xc6c0
callq 0x4714d
testb $0x20, (%rax)
jne 0xae5bd
movq %rax, %rbx
callq 0x51998
xorl %edi, %edi
cmpl $-0x1, %eax
je 0xae5b8
cmpb $0x0, 0xc0(%rbx)
jne 0xae5b8
cltq
leaq 0x54252(%rip), %rcx     # 0x1027f0
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
jne 0xae5ae
movq 0x54242(%rip), %rdi     # 0x1027f0
callq 0xc630
movl $0x1, %edi
callq 0xc710
callq 0x4714d
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 0xae8e3
movq %rax, %rbx
xorl %edi, %edi
callq 0xc670
testq %rax, %rax
je 0xae8df
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
callq 0xc750
movss 0x69c1(%rip), %xmm1     # 0xb4fe4
xorps %xmm0, %xmm0
testb %al, %al
je 0xae62d
movaps %xmm1, %xmm0
movss %xmm0, 0x33c(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae651
movss 0x6993(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x340(%rbx)
movq %r14, %rdi
movl $0x2, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae675
movss 0x696f(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x348(%rbx)
movq %r14, %rdi
movl $0x3, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae699
movss 0x694b(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x344(%rbx)
movq %r14, %rdi
movl $0xd, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae6bd
movss 0x6927(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x34c(%rbx)
movq %r14, %rdi
movl $0xe, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae6e1
movss 0x6903(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x350(%rbx)
movq %r14, %rdi
movl $0xb, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae705
movss 0x68df(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x354(%rbx)
movq %r14, %rdi
movl $0xc, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae729
movss 0x68bb(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x358(%rbx)
movq %r14, %rdi
movl $0x9, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae74d
movss 0x6897(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x36c(%rbx)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae771
movss 0x6873(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x370(%rbx)
movq %r14, %rdi
movl $0x9, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae795
movss 0x684f(%rip), %xmm0     # 0xb4fe4
movss %xmm0, 0x374(%rbx)
movq %r14, %rdi
movl $0xa, %esi
callq 0xc750
xorps %xmm0, %xmm0
testb %al, %al
je 0xae7b9
movss 0x682b(%rip), %xmm0     # 0xb4fe4
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 0x24b4c(%rip), %xmm0    # 0xd332c
movss 0x67fc(%rip), %xmm1     # 0xb4fe4
minss %xmm0, %xmm1
ucomiss 0x7051(%rip), %xmm1     # 0xb5844
jbe 0xae806
ucomiss 0x35c(%rbx), %xmm1
jbe 0xae806
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 0x24b0b(%rip), %xmm1    # 0xd3330
movss 0x67b7(%rip), %xmm0     # 0xb4fe4
minss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xae84a
ucomiss 0x360(%rbx), %xmm0
jbe 0xae84a
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 0x24ac8(%rip), %xmm1    # 0xd3334
movss 0x6770(%rip), %xmm0     # 0xb4fe4
minss %xmm1, %xmm0
ucomiss 0x6fc5(%rip), %xmm0     # 0xb5844
jbe 0xae892
ucomiss 0x364(%rbx), %xmm0
jbe 0xae892
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 0x24a7c(%rip), %xmm0    # 0xd3330
movss 0x6728(%rip), %xmm1     # 0xb4fe4
minss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jbe 0xae8d9
ucomiss 0x368(%rbx), %xmm1
jbe 0xae8d9
movss %xmm1, 0x368(%rbx)
orb $0x1, 0x4(%rbx)
jmp 0xae8e3
andb $-0x2, 0x4(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24b7d(%rip), %rdi     # 0xd3476
leaq 0x24ad8(%rip), %rsi     # 0xd33d8
leaq 0x24c1f(%rip), %rcx     # 0xd3526
movl $0x15a, %edx            # imm = 0x15A
callq 0xc140
leaq 0x53f28(%rip), %rdi     # 0x102840
callq 0xc2c0
testl %eax, %eax
je 0xae3d7
callq 0xc950
movq %rax, 0x53f07(%rip)     # 0x102838
leaq 0x53f08(%rip), %rdi     # 0x102840
callq 0xc4c0
jmp 0xae3d7
movq %rax, %rbx
leaq 0x53ef4(%rip), %rdi     # 0x102840
callq 0xc3a0
movq %rbx, %rdi
callq 0xc560