// File: /workspace/github_cpp_makefile_star2_O1/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, 0x27fbc(%rip)     # 0x5fde8
jne 0x37e33
callq 0x37a37
callq 0xb1e1
movq %rax, %rbx
leaq -0x30(%rbp), %r15
leaq -0x2c(%rbp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7600
cvtsi2ssl (%r15), %xmm0
cvtsi2ssl (%r12), %xmm1
movss %xmm0, (%rbx)
movss %xmm1, 0x4(%rbx)
callq 0x7870
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x1011c(%rip), %xmm0    # 0x47f98
movsd 0x27f6c(%rip), %xmm1    # 0x5fdf0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
ja 0x37e98
movss 0x790a(%rip), %xmm1     # 0x3f7a0
jmp 0x37ea7
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
movss %xmm1, 0x8(%rbx)
movsd %xmm0, 0x27f3c(%rip)    # 0x5fdf0
leaq -0x28(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x7700
movl %eax, %r15d
movq %r14, %rdi
callq 0x76b0
btl $0xa, %eax
jb 0x37ee5
movabsq $-0x407fffff40800000, %rax # imm = 0xBF800000BF800000
movq %rax, 0xe8(%rbx)
jmp 0x37f05
xorps %xmm0, %xmm0
cvtsi2ssl -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtsi2ssl -0x24(%rbp), %xmm1
movss %xmm0, 0xe8(%rbx)
movss %xmm1, 0xec(%rbx)
movb 0x27ed1(%rip), %al      # 0x5fddc
orb %r15b, %al
andb $0x1, %al
movb %al, 0xf0(%rbx)
movl %r15d, %eax
shrb $0x2, %al
orb 0x27ebb(%rip), %al      # 0x5fddd
andb $0x1, %al
movb %al, 0xf1(%rbx)
shrb %r15b
orb 0x27eaa(%rip), %r15b    # 0x5fdde
andb $0x1, %r15b
movb %r15b, 0xf2(%rbx)
xorl %eax, %eax
movb %al, 0x27e97(%rip)      # 0x5fdde
movb %al, 0x27e90(%rip)      # 0x5fddd
movb %al, 0x27e89(%rip)      # 0x5fddc
movss 0x27e7d(%rip), %xmm0    # 0x5fdd8
movss %xmm0, 0xf8(%rbx)
movl $0x0, 0x27e6b(%rip)     # 0x5fdd8
movzbl 0xfc(%rbx), %edi
xorl $0x1, %edi
callq 0x7620
callq 0xb24d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop