// File: /workspace/github_cpp_makefile_star2_O3/donfreiday[P]gb/./imgui/imgui_impl_sdl.cpp
// Function: ImGui_ImplSdl_NewFrame(SDL_Window*)
void ImGui_ImplSdl_NewFrame(SDL_Window *window)
{
    if (!g_FontTexture)
        ImGui_ImplSdl_CreateDeviceObjects();

    ImGuiIO& io = ImGui::GetIO();

    // Setup display size (every frame to accommodate for window resizing)
    int w, h;
    SDL_GetWindowSize(window, &w, &h);
    io.DisplaySize = ImVec2((float)w, (float)h);

    // Setup time step
    Uint32	time = SDL_GetTicks();
    double current_time = time / 1000.0;
    io.DeltaTime = g_Time > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f/60.0f);
    g_Time = current_time;

    // Setup inputs
    // (we already got mouse wheel, keyboard keys & characters from glfw callbacks polled in glfwPollEvents())
    int mx, my;
    Uint32 mouseMask = SDL_GetMouseState(&mx, &my);
    if (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS)
    	io.MousePos = ImVec2((float)mx, (float)my);   // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
    else
    	io.MousePos = ImVec2(-1,-1);
   
    io.MouseDown[0] = g_MousePressed[0] || (mouseMask & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0;		// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
    io.MouseDown[1] = g_MousePressed[1] || (mouseMask & SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0;
    io.MouseDown[2] = g_MousePressed[2] || (mouseMask & SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0;
    g_MousePressed[0] = g_MousePressed[1] = g_MousePressed[2] = false;

    io.MouseWheel = g_MouseWheel;
    g_MouseWheel = 0.0f;

    // Hide OS mouse cursor if ImGui is drawing it
    SDL_ShowCursor(io.MouseDrawCursor ? 0 : 1);

    // Start the frame
    ImGui::NewFrame();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
cmpl $0x0, 0x28914(%rip)     # 0x5fdd8
jne 0x374cb
callq 0x370cf
callq 0xb0ca
movq %rax, %rbx
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x75f0
cvtsi2ssl (%r15), %xmm0
cvtsi2ssl (%r12), %xmm1
movss %xmm0, (%rbx)
movss %xmm1, 0x4(%rbx)
callq 0x7850
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x10a2c(%rip), %xmm0    # 0x47f40
movsd 0x288c4(%rip), %xmm1    # 0x5fde0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
ja 0x37530
movss 0x81d6(%rip), %xmm1     # 0x3f704
jmp 0x3753f
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
movss %xmm1, 0x8(%rbx)
movsd %xmm0, 0x28894(%rip)    # 0x5fde0
leaq -0x28(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x76f0
movl %eax, %r15d
movq %r14, %rdi
callq 0x76a0
btl $0xa, %eax
jae 0x3757c
xorps %xmm0, %xmm0
cvtsi2ssl -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl -0x24(%rbp), %xmm1
jmp 0x37587
movss 0x5e18(%rip), %xmm0     # 0x3d39c
movaps %xmm0, %xmm1
movss %xmm0, 0xe8(%rbx)
movss %xmm1, 0xec(%rbx)
movb 0x2882f(%rip), %al      # 0x5fdcc
orb %r15b, %al
andb $0x1, %al
movb %al, 0xf0(%rbx)
movl %r15d, %eax
shrb $0x2, %al
orb 0x28819(%rip), %al      # 0x5fdcd
andb $0x1, %al
movb %al, 0xf1(%rbx)
shrb %r15b
orb 0x28808(%rip), %r15b    # 0x5fdce
andb $0x1, %r15b
movb %r15b, 0xf2(%rbx)
xorl %eax, %eax
movb %al, 0x287f5(%rip)      # 0x5fdce
movb %al, 0x287ee(%rip)      # 0x5fdcd
movb %al, 0x287e7(%rip)      # 0x5fdcc
movss 0x287db(%rip), %xmm0    # 0x5fdc8
movss %xmm0, 0xf8(%rbx)
movl $0x0, 0x287c9(%rip)     # 0x5fdc8
movzbl 0xfc(%rbx), %edi
xorl $0x1, %edi
callq 0x7610
callq 0xb136
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq