; LLVM IR from jan-van-bergen/GPU-Raytracer :: include/Imgui/imgui_impl_sdl.ll (Z23ImGui_ImplSDL2_NewFramev)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ImVec2 = type { float, float }
%struct.ImGui_ImplSDL2_Data = type <{ ptr, ptr, i64, i32, [4 x i8], [9 x ptr], ptr, i8, [7 x i8] }>
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, i32, %struct.ImVec2, [645 x i32], [512 x i8], %struct.ImVec2, [5 x i8], float, float, i8, i8, i8, i8, [20 x float], i32, i32, [645 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x i8], [5 x i8], [5 x float], [5 x float], [5 x float], [20 x float], [20 x float], float, i8, i8, i8, i16, %struct.ImVector }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVector = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__._Z23ImGui_ImplSDL2_NewFramev = external hidden unnamed_addr constant [31 x i8], align 1
@_ZZ23ImGui_ImplSDL2_NewFramevE9frequency = external hidden global i64, align 8
@_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency = external hidden global i64, align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv() #1

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav() #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23ImGui_ImplSDL2_NewFramev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca %struct.ImVec2, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %12 = call noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav()
  store ptr %12, ptr %1, align 8, !tbaa !5
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %0
  br label %16

16:                                               ; preds = %15, %0
  %17 = phi i1 [ false, %0 ], [ true, %15 ]
  br i1 %17, label %18, label %19

18:                                               ; preds = %16
  br label %21

19:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 517, ptr noundef @__PRETTY_FUNCTION__._Z23ImGui_ImplSDL2_NewFramev) #7
  unreachable

20:                                               ; No predecessors!
  br label %21

21:                                               ; preds = %20, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %22 = call noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv()
  store ptr %22, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  call void @SDL_GetWindowSize(ptr noundef %25, ptr noundef %3, ptr noundef %4)
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @SDL_GetWindowFlags(ptr noundef %28)
  %30 = and i32 %29, 64
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %33

32:                                               ; preds = %21
  store i32 0, ptr %4, align 4, !tbaa !14
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %33

33:                                               ; preds = %32, %21
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = load ptr, ptr %1, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = call i32 @SDL_GetRendererOutputSize(ptr noundef %41, ptr noundef %5, ptr noundef %6)
  br label %47

43:                                               ; preds = %33
  %44 = load ptr, ptr %1, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  call void @SDL_GL_GetDrawableSize(ptr noundef %46, ptr noundef %5, ptr noundef %6)
  br label %47

47:                                               ; preds = %43, %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %48 = load i32, ptr %3, align 4, !tbaa !14
  %49 = sitofp i32 %48 to float
  %50 = load i32, ptr %4, align 4, !tbaa !14
  %51 = sitofp i32 %50 to float
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef %49, float noundef %51)
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ImGuiIO, ptr %52, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %54 = load i32, ptr %3, align 4, !tbaa !14
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %72

56:                                               ; preds = %47
  %57 = load i32, ptr %4, align 4, !tbaa !14
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %59, label %72

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %60 = load i32, ptr %5, align 4, !tbaa !14
  %61 = sitofp i32 %60 to float
  %62 = load i32, ptr %3, align 4, !tbaa !14
  %63 = sitofp i32 %62 to float
  %64 = fdiv float %61, %63
  %65 = load i32, ptr %6, align 4, !tbaa !14
  %66 = sitofp i32 %65 to float
  %67 = load i32, ptr %4, align 4, !tbaa !14
  %68 = sitofp i32 %67 to float
  %69 = fdiv float %66, %68
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef %64, float noundef %69)
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ImGuiIO, ptr %70, i32 0, i32 17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %71, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %72

72:                                               ; preds = %59, %56, %47
  %73 = load atomic i8, ptr @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency acquire, align 8
  %74 = icmp eq i8 %73, 0
  br i1 %74, label %75, label %81, !prof !19

75:                                               ; preds = %72
  %76 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #6
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = invoke i64 @SDL_GetPerformanceFrequency()
          to label %80 unwind label %106

80:                                               ; preds = %78
  store i64 %79, ptr @_ZZ23ImGui_ImplSDL2_NewFramevE9frequency, align 8, !tbaa !20
  call void @__cxa_guard_release(ptr @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #6
  br label %81

81:                                               ; preds = %80, %75, %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %82 = call i64 @SDL_GetPerformanceCounter()
  store i64 %82, ptr %11, align 8, !tbaa !20
  %83 = load ptr, ptr %1, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %83, i32 0, i32 2
  %85 = load i64, ptr %84, align 8, !tbaa !21
  %86 = icmp ugt i64 %85, 0
  br i1 %86, label %87, label %98

87:                                               ; preds = %81
  %88 = load i64, ptr %11, align 8, !tbaa !20
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %89, i32 0, i32 2
  %91 = load i64, ptr %90, align 8, !tbaa !21
  %92 = sub i64 %88, %91
  %93 = uitofp i64 %92 to double
  %94 = load i64, ptr @_ZZ23ImGui_ImplSDL2_NewFramevE9frequency, align 8, !tbaa !20
  %95 = uitofp i64 %94 to double
  %96 = fdiv double %93, %95
  %97 = fptrunc double %96 to float
  br label %99

98:                                               ; preds = %81
  br label %99

99:                                               ; preds = %98, %87
  %100 = phi float [ %97, %87 ], [ 0x3F91111120000000, %98 ]
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.ImGuiIO, ptr %101, i32 0, i32 3
  store float %100, ptr %102, align 8, !tbaa !22
  %103 = load i64, ptr %11, align 8, !tbaa !20
  %104 = load ptr, ptr %1, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ImGui_ImplSDL2_Data, ptr %104, i32 0, i32 2
  store i64 %103, ptr %105, align 8, !tbaa !21
  call void @_ZL30ImGui_ImplSDL2_UpdateMouseDatav()
  call void @_ZL32ImGui_ImplSDL2_UpdateMouseCursorv()
  call void @_ZL29ImGui_ImplSDL2_UpdateGamepadsv()
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void

106:                                              ; preds = %78
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  br label %110

110:                                              ; preds = %106
  %111 = load ptr, ptr %9, align 8
  %112 = load i32, ptr %10, align 4
  %113 = insertvalue { ptr, i32 } poison, ptr %111, 0
  %114 = insertvalue { ptr, i32 } %113, i32 %112, 1
  resume { ptr, i32 } %114
}

declare void @SDL_GetWindowSize(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @SDL_GetWindowFlags(ptr noundef) #1

declare i32 @SDL_GetRendererOutputSize(ptr noundef, ptr noundef, ptr noundef) #1

declare void @SDL_GL_GetDrawableSize(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #6

declare i64 @SDL_GetPerformanceFrequency() #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #6

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #6

declare i64 @SDL_GetPerformanceCounter() #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL30ImGui_ImplSDL2_UpdateMouseDatav() #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL32ImGui_ImplSDL2_UpdateMouseCursorv() #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL29ImGui_ImplSDL2_UpdateGamepadsv() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS19ImGui_ImplSDL2_Data", !6, i64 0, !6, i64 8, !11, i64 16, !12, i64 24, !7, i64 32, !6, i64 104, !13, i64 112}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !12, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!"branch_weights", i32 1, i32 1048575}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !11, i64 16}
!22 = !{!23, !18, i64 16}
!23 = !{!"_ZTS7ImGuiIO", !12, i64 0, !12, i64 4, !24, i64 8, !18, i64 16, !18, i64 20, !6, i64 24, !6, i64 32, !18, i64 40, !18, i64 44, !18, i64 48, !18, i64 52, !18, i64 56, !6, i64 64, !6, i64 72, !18, i64 80, !13, i64 84, !6, i64 88, !24, i64 96, !13, i64 104, !13, i64 105, !13, i64 106, !13, i64 107, !13, i64 108, !13, i64 109, !13, i64 110, !18, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !13, i64 200, !13, i64 201, !13, i64 202, !13, i64 203, !13, i64 204, !13, i64 205, !13, i64 206, !18, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !24, i64 232, !7, i64 240, !7, i64 2820, !24, i64 3332, !7, i64 3340, !18, i64 3348, !18, i64 3352, !13, i64 3356, !13, i64 3357, !13, i64 3358, !13, i64 3359, !7, i64 3360, !12, i64 3440, !12, i64 3444, !7, i64 3448, !13, i64 13768, !24, i64 13772, !7, i64 13780, !7, i64 13824, !7, i64 13864, !7, i64 13869, !7, i64 13874, !7, i64 13884, !7, i64 13894, !7, i64 13899, !7, i64 13904, !7, i64 13912, !7, i64 13932, !7, i64 13952, !7, i64 13972, !7, i64 14052, !18, i64 14132, !13, i64 14136, !7, i64 14137, !13, i64 14138, !25, i64 14140, !26, i64 14144}
!24 = !{!"_ZTS6ImVec2", !18, i64 0, !18, i64 4}
!25 = !{!"short", !7, i64 0}
!26 = !{!"_ZTS8ImVectorItE", !12, i64 0, !12, i64 4, !6, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ImVec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__._Z23ImGui_ImplSDL2_NewFramev = external hidden unnamed_addr constant [31 x i8], align 1
@_ZZ23ImGui_ImplSDL2_NewFramevE9frequency = external hidden local_unnamed_addr global i64, align 8
@_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency = external hidden global i64, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav() local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23ImGui_ImplSDL2_NewFramev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.ImVec2, align 8
  %6 = alloca %struct.ImVec2, align 8
  %7 = tail call noundef ptr @_ZL29ImGui_ImplSDL2_GetBackendDatav()
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %0
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 517, ptr noundef nonnull @__PRETTY_FUNCTION__._Z23ImGui_ImplSDL2_NewFramev) #6
  unreachable

9:                                                ; preds = %0
  %10 = tail call noundef nonnull align 8 dereferenceable(14160) ptr @_ZN5ImGui5GetIOEv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %11 = load ptr, ptr %7, align 8, !tbaa !5
  call void @SDL_GetWindowSize(ptr noundef %11, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %12 = load ptr, ptr %7, align 8, !tbaa !5
  %13 = call i32 @SDL_GetWindowFlags(ptr noundef %12)
  %14 = and i32 %13, 64
  %.not18 = icmp eq i32 %14, 0
  br i1 %.not18, label %16, label %15

15:                                               ; preds = %9
  store i32 0, ptr %2, align 4, !tbaa !13
  store i32 0, ptr %1, align 4, !tbaa !13
  br label %16

16:                                               ; preds = %15, %9
  %17 = getelementptr inbounds i8, ptr %7, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %.not19 = icmp eq ptr %18, null
  br i1 %.not19, label %21, label %19

19:                                               ; preds = %16
  %20 = call i32 @SDL_GetRendererOutputSize(ptr noundef nonnull %18, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %23

21:                                               ; preds = %16
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  call void @SDL_GL_GetDrawableSize(ptr noundef %22, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %23

23:                                               ; preds = %21, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %24 = load i32, ptr %1, align 4, !tbaa !13
  %25 = sitofp i32 %24 to float
  %26 = load i32, ptr %2, align 4, !tbaa !13
  %27 = sitofp i32 %26 to float
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef %25, float noundef %27)
  %28 = getelementptr inbounds i8, ptr %10, i64 8
  %29 = load i64, ptr %5, align 8
  store i64 %29, ptr %28, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %30 = load i32, ptr %1, align 4, !tbaa !13
  %31 = icmp sgt i32 %30, 0
  %32 = load i32, ptr %2, align 4
  %33 = icmp sgt i32 %32, 0
  %or.cond = select i1 %31, i1 %33, i1 false
  br i1 %or.cond, label %34, label %45

34:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %35 = load i32, ptr %3, align 4, !tbaa !13
  %36 = sitofp i32 %35 to float
  %37 = uitofp nneg i32 %30 to float
  %38 = fdiv float %36, %37
  %39 = load i32, ptr %4, align 4, !tbaa !13
  %40 = sitofp i32 %39 to float
  %41 = uitofp nneg i32 %32 to float
  %42 = fdiv float %40, %41
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %6, float noundef %38, float noundef %42)
  %43 = getelementptr inbounds i8, ptr %10, i64 96
  %44 = load i64, ptr %6, align 8
  store i64 %44, ptr %43, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %45

45:                                               ; preds = %34, %23
  %46 = load atomic i8, ptr @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency acquire, align 8
  %47 = icmp eq i8 %46, 0
  br i1 %47, label %48, label %53, !prof !15

48:                                               ; preds = %45
  %49 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #7
  %.not20 = icmp eq i32 %49, 0
  br i1 %.not20, label %53, label %50

50:                                               ; preds = %48
  %51 = invoke i64 @SDL_GetPerformanceFrequency()
          to label %52 unwind label %67

52:                                               ; preds = %50
  store i64 %51, ptr @_ZZ23ImGui_ImplSDL2_NewFramevE9frequency, align 8, !tbaa !16
  call void @__cxa_guard_release(ptr nonnull @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #7
  br label %53

53:                                               ; preds = %52, %48, %45
  %54 = call i64 @SDL_GetPerformanceCounter()
  %55 = getelementptr inbounds i8, ptr %7, i64 16
  %56 = load i64, ptr %55, align 8, !tbaa !17
  %.not21 = icmp eq i64 %56, 0
  br i1 %.not21, label %64, label %57

57:                                               ; preds = %53
  %58 = sub i64 %54, %56
  %59 = uitofp i64 %58 to double
  %60 = load i64, ptr @_ZZ23ImGui_ImplSDL2_NewFramevE9frequency, align 8, !tbaa !16
  %61 = uitofp i64 %60 to double
  %62 = fdiv double %59, %61
  %63 = fptrunc double %62 to float
  br label %64

64:                                               ; preds = %53, %57
  %65 = phi float [ %63, %57 ], [ 0x3F91111120000000, %53 ]
  %66 = getelementptr inbounds i8, ptr %10, i64 16
  store float %65, ptr %66, align 8, !tbaa !18
  store i64 %54, ptr %55, align 8, !tbaa !17
  call void @_ZL30ImGui_ImplSDL2_UpdateMouseDatav()
  call void @_ZL32ImGui_ImplSDL2_UpdateMouseCursorv()
  call void @_ZL29ImGui_ImplSDL2_UpdateGamepadsv()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret void

67:                                               ; preds = %50
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_guard_abort(ptr nonnull @_ZGVZ23ImGui_ImplSDL2_NewFramevE9frequency) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %68
}

declare void @SDL_GetWindowSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SDL_GetWindowFlags(ptr noundef) local_unnamed_addr #1

declare i32 @SDL_GetRendererOutputSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @SDL_GL_GetDrawableSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #4 align 2

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #5

declare i64 @SDL_GetPerformanceFrequency() local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #5

declare i64 @SDL_GetPerformanceCounter() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL30ImGui_ImplSDL2_UpdateMouseDatav() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL32ImGui_ImplSDL2_UpdateMouseCursorv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL29ImGui_ImplSDL2_UpdateGamepadsv() local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS19ImGui_ImplSDL2_Data", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 32, !7, i64 104, !12, i64 112}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!6, !7, i64 8}
!15 = !{!"branch_weights", i32 1, i32 1048575}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !10, i64 16}
!18 = !{!19, !21, i64 16}
!19 = !{!"_ZTS7ImGuiIO", !11, i64 0, !11, i64 4, !20, i64 8, !21, i64 16, !21, i64 20, !7, i64 24, !7, i64 32, !21, i64 40, !21, i64 44, !21, i64 48, !21, i64 52, !21, i64 56, !7, i64 64, !7, i64 72, !21, i64 80, !12, i64 84, !7, i64 88, !20, i64 96, !12, i64 104, !12, i64 105, !12, i64 106, !12, i64 107, !12, i64 108, !12, i64 109, !12, i64 110, !21, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !12, i64 200, !12, i64 201, !12, i64 202, !12, i64 203, !12, i64 204, !12, i64 205, !12, i64 206, !21, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !20, i64 232, !8, i64 240, !8, i64 2820, !20, i64 3332, !8, i64 3340, !21, i64 3348, !21, i64 3352, !12, i64 3356, !12, i64 3357, !12, i64 3358, !12, i64 3359, !8, i64 3360, !11, i64 3440, !11, i64 3444, !8, i64 3448, !12, i64 13768, !20, i64 13772, !8, i64 13780, !8, i64 13824, !8, i64 13864, !8, i64 13869, !8, i64 13874, !8, i64 13884, !8, i64 13894, !8, i64 13899, !8, i64 13904, !8, i64 13912, !8, i64 13932, !8, i64 13952, !8, i64 13972, !8, i64 14052, !21, i64 14132, !12, i64 14136, !8, i64 14137, !12, i64 14138, !22, i64 14140, !23, i64 14144}
!20 = !{!"_ZTS6ImVec2", !21, i64 0, !21, i64 4}
!21 = !{!"float", !8, i64 0}
!22 = !{!"short", !8, i64 0}
!23 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !7, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass