; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui (imgui)

; 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.ImRect = type { %struct.ImVec2, %struct.ImVec2 }

@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order = external hidden unnamed_addr constant [4 x i32], align 16
@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254 = external hidden unnamed_addr constant [4 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #0 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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMinIfET_S0_S0_(float noundef, float noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef, float noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(16) %4, i32 noundef %5) #5 {
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.ImVec2, align 4
  %15 = alloca %struct.ImVec2, align 4
  %16 = alloca [4 x i32], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.ImVec2, align 4
  %21 = alloca %struct.ImVec2, align 4
  %22 = alloca %struct.ImVec2, align 4
  %23 = alloca %struct.ImVec2, align 4
  %24 = alloca %struct.ImRect, align 4
  %25 = alloca %struct.ImVec2, align 4
  %26 = alloca [4 x i32], align 16
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca %struct.ImVec2, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ImRect, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ImRect, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(8) %37)
  store <2 x float> %38, ptr %15, align 4
  %39 = load <2 x float>, ptr %15, align 4
  %40 = call <2 x float> @_ZL7ImClampRK6ImVec2S1_S_(ptr noundef nonnull align 4 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(8) %34, <2 x float> %39)
  store <2 x float> %40, ptr %14, align 4
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %159

43:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = icmp ne i32 %45, -1
  %47 = zext i1 %46 to i64
  %48 = select i1 %46, i32 -1, i32 0
  store i32 %48, ptr %17, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %150, %43
  %50 = load i32, ptr %17, align 4, !tbaa !11
  %51 = icmp slt i32 %50, 4
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 2, ptr %18, align 4
  br label %153

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %54 = load i32, ptr %17, align 4, !tbaa !11
  %55 = icmp eq i32 %54, -1
  br i1 %55, label %56, label %59

56:                                               ; preds = %53
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load i32, ptr %57, align 4, !tbaa !11
  br label %64

59:                                               ; preds = %53
  %60 = load i32, ptr %17, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %59, %56
  %65 = phi i32 [ %58, %56 ], [ %63, %59 ]
  store i32 %65, ptr %19, align 4, !tbaa !11
  %66 = load i32, ptr %17, align 4, !tbaa !11
  %67 = icmp ne i32 %66, -1
  br i1 %67, label %68, label %74

68:                                               ; preds = %64
  %69 = load i32, ptr %19, align 4, !tbaa !11
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = icmp eq i32 %69, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %68
  store i32 4, ptr %18, align 4
  br label %148

74:                                               ; preds = %68, %64
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %75 = load i32, ptr %19, align 4, !tbaa !11
  %76 = icmp eq i32 %75, 3
  br i1 %76, label %77, label %86

77:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ImRect, ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %struct.ImVec2, ptr %79, i32 0, i32 0
  %81 = load float, ptr %80, align 4, !tbaa !13
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ImRect, ptr %82, i32 0, i32 1
  %84 = getelementptr inbounds %struct.ImVec2, ptr %83, i32 0, i32 1
  %85 = load float, ptr %84, align 4, !tbaa !17
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %20, float noundef %81, float noundef %85)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %86

86:                                               ; preds = %77, %74
  %87 = load i32, ptr %19, align 4, !tbaa !11
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %89, label %102

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ImRect, ptr %90, i32 0, i32 0
  %92 = getelementptr inbounds %struct.ImVec2, ptr %91, i32 0, i32 0
  %93 = load float, ptr %92, align 4, !tbaa !13
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ImRect, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.ImVec2, ptr %95, i32 0, i32 1
  %97 = load float, ptr %96, align 4, !tbaa !20
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ImVec2, ptr %98, i32 0, i32 1
  %100 = load float, ptr %99, align 4, !tbaa !21
  %101 = fsub float %97, %100
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %21, float noundef %93, float noundef %101)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %102

102:                                              ; preds = %89, %86
  %103 = load i32, ptr %19, align 4, !tbaa !11
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %118

105:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ImRect, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds %struct.ImVec2, ptr %107, i32 0, i32 0
  %109 = load float, ptr %108, align 4, !tbaa !22
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ImVec2, ptr %110, i32 0, i32 0
  %112 = load float, ptr %111, align 4, !tbaa !23
  %113 = fsub float %109, %112
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ImRect, ptr %114, i32 0, i32 1
  %116 = getelementptr inbounds %struct.ImVec2, ptr %115, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !17
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %22, float noundef %113, float noundef %117)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %22, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %118

118:                                              ; preds = %105, %102
  %119 = load i32, ptr %19, align 4, !tbaa !11
  %120 = icmp eq i32 %119, 2
  br i1 %120, label %121, label %138

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ImRect, ptr %122, i32 0, i32 1
  %124 = getelementptr inbounds %struct.ImVec2, ptr %123, i32 0, i32 0
  %125 = load float, ptr %124, align 4, !tbaa !22
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ImVec2, ptr %126, i32 0, i32 0
  %128 = load float, ptr %127, align 4, !tbaa !23
  %129 = fsub float %125, %128
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ImRect, ptr %130, i32 0, i32 0
  %132 = getelementptr inbounds %struct.ImVec2, ptr %131, i32 0, i32 1
  %133 = load float, ptr %132, align 4, !tbaa !20
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ImVec2, ptr %134, i32 0, i32 1
  %136 = load float, ptr %135, align 4, !tbaa !21
  %137 = fsub float %133, %136
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %23, float noundef %129, float noundef %137)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %138

138:                                              ; preds = %121, %118
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %140)
  store <2 x float> %141, ptr %25, align 4
  call void @_ZN6ImRectC2ERK6ImVec2S2_(ptr noundef nonnull align 4 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %25)
  %142 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16) %139, ptr noundef nonnull align 4 dereferenceable(16) %24)
  %143 = xor i1 %142, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  br i1 %143, label %144, label %145

144:                                              ; preds = %138
  store i32 4, ptr %18, align 4
  br label %148

145:                                              ; preds = %138
  %146 = load i32, ptr %19, align 4, !tbaa !11
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %146, ptr %147, align 4, !tbaa !11
  store i32 1, ptr %18, align 4
  br label %148

148:                                              ; preds = %145, %144, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %149 = load i32, ptr %18, align 4
  switch i32 %149, label %153 [
    i32 4, label %150
  ]

150:                                              ; preds = %148
  %151 = load i32, ptr %17, align 4, !tbaa !11
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %17, align 4, !tbaa !11
  br label %49, !llvm.loop !24

153:                                              ; preds = %148, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  %154 = load i32, ptr %18, align 4
  switch i32 %154, label %156 [
    i32 2, label %155
  ]

155:                                              ; preds = %153
  store i32 0, ptr %18, align 4
  br label %156

156:                                              ; preds = %155, %153
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  %157 = load i32, ptr %18, align 4
  switch i32 %157, label %416 [
    i32 0, label %158
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158, %6
  %160 = load i32, ptr %13, align 4, !tbaa !9
  %161 = icmp eq i32 %160, 2
  br i1 %161, label %165, label %162

162:                                              ; preds = %159
  %163 = load i32, ptr %13, align 4, !tbaa !9
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %365

165:                                              ; preds = %162, %159
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %26, ptr align 16 @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = load i32, ptr %166, align 4, !tbaa !11
  %168 = icmp ne i32 %167, -1
  %169 = zext i1 %168 to i64
  %170 = select i1 %168, i32 -1, i32 0
  store i32 %170, ptr %27, align 4, !tbaa !11
  br label %171

171:                                              ; preds = %356, %165
  %172 = load i32, ptr %27, align 4, !tbaa !11
  %173 = icmp slt i32 %172, 4
  br i1 %173, label %175, label %174

174:                                              ; preds = %171
  store i32 5, ptr %18, align 4
  br label %359

175:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %176 = load i32, ptr %27, align 4, !tbaa !11
  %177 = icmp eq i32 %176, -1
  br i1 %177, label %178, label %181

178:                                              ; preds = %175
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = load i32, ptr %179, align 4, !tbaa !11
  br label %186

181:                                              ; preds = %175
  %182 = load i32, ptr %27, align 4, !tbaa !11
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [4 x i32], ptr %26, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !11
  br label %186

186:                                              ; preds = %181, %178
  %187 = phi i32 [ %180, %178 ], [ %185, %181 ]
  store i32 %187, ptr %28, align 4, !tbaa !11
  %188 = load i32, ptr %27, align 4, !tbaa !11
  %189 = icmp ne i32 %188, -1
  br i1 %189, label %190, label %196

190:                                              ; preds = %186
  %191 = load i32, ptr %28, align 4, !tbaa !11
  %192 = load ptr, ptr %10, align 8, !tbaa !5
  %193 = load i32, ptr %192, align 4, !tbaa !11
  %194 = icmp eq i32 %191, %193
  br i1 %194, label %195, label %196

195:                                              ; preds = %190
  store i32 7, ptr %18, align 4
  br label %354

196:                                              ; preds = %190, %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %197 = load i32, ptr %28, align 4, !tbaa !11
  %198 = icmp eq i32 %197, 0
  br i1 %198, label %199, label %204

199:                                              ; preds = %196
  %200 = load ptr, ptr %12, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ImRect, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %struct.ImVec2, ptr %201, i32 0, i32 0
  %203 = load float, ptr %202, align 4, !tbaa !13
  br label %209

204:                                              ; preds = %196
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.ImRect, ptr %205, i32 0, i32 1
  %207 = getelementptr inbounds %struct.ImVec2, ptr %206, i32 0, i32 0
  %208 = load float, ptr %207, align 4, !tbaa !22
  br label %209

209:                                              ; preds = %204, %199
  %210 = phi float [ %203, %199 ], [ %208, %204 ]
  %211 = load i32, ptr %28, align 4, !tbaa !11
  %212 = icmp eq i32 %211, 1
  br i1 %212, label %213, label %218

213:                                              ; preds = %209
  %214 = load ptr, ptr %12, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.ImRect, ptr %214, i32 0, i32 1
  %216 = getelementptr inbounds %struct.ImVec2, ptr %215, i32 0, i32 0
  %217 = load float, ptr %216, align 4, !tbaa !22
  br label %223

218:                                              ; preds = %209
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.ImRect, ptr %219, i32 0, i32 0
  %221 = getelementptr inbounds %struct.ImVec2, ptr %220, i32 0, i32 0
  %222 = load float, ptr %221, align 4, !tbaa !13
  br label %223

223:                                              ; preds = %218, %213
  %224 = phi float [ %217, %213 ], [ %222, %218 ]
  %225 = fsub float %210, %224
  store float %225, ptr %29, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %226 = load i32, ptr %28, align 4, !tbaa !11
  %227 = icmp eq i32 %226, 2
  br i1 %227, label %228, label %233

228:                                              ; preds = %223
  %229 = load ptr, ptr %12, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.ImRect, ptr %229, i32 0, i32 0
  %231 = getelementptr inbounds %struct.ImVec2, ptr %230, i32 0, i32 1
  %232 = load float, ptr %231, align 4, !tbaa !20
  br label %238

233:                                              ; preds = %223
  %234 = load ptr, ptr %11, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.ImRect, ptr %234, i32 0, i32 1
  %236 = getelementptr inbounds %struct.ImVec2, ptr %235, i32 0, i32 1
  %237 = load float, ptr %236, align 4, !tbaa !17
  br label %238

238:                                              ; preds = %233, %228
  %239 = phi float [ %232, %228 ], [ %237, %233 ]
  %240 = load i32, ptr %28, align 4, !tbaa !11
  %241 = icmp eq i32 %240, 3
  br i1 %241, label %242, label %247

242:                                              ; preds = %238
  %243 = load ptr, ptr %12, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.ImRect, ptr %243, i32 0, i32 1
  %245 = getelementptr inbounds %struct.ImVec2, ptr %244, i32 0, i32 1
  %246 = load float, ptr %245, align 4, !tbaa !17
  br label %252

247:                                              ; preds = %238
  %248 = load ptr, ptr %11, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.ImRect, ptr %248, i32 0, i32 0
  %250 = getelementptr inbounds %struct.ImVec2, ptr %249, i32 0, i32 1
  %251 = load float, ptr %250, align 4, !tbaa !20
  br label %252

252:                                              ; preds = %247, %242
  %253 = phi float [ %246, %242 ], [ %251, %247 ]
  %254 = fsub float %239, %253
  store float %254, ptr %30, align 4, !tbaa !19
  %255 = load float, ptr %29, align 4, !tbaa !19
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.ImVec2, ptr %256, i32 0, i32 0
  %258 = load float, ptr %257, align 4, !tbaa !23
  %259 = fcmp olt float %255, %258
  br i1 %259, label %260, label %267

260:                                              ; preds = %252
  %261 = load i32, ptr %28, align 4, !tbaa !11
  %262 = icmp eq i32 %261, 0
  br i1 %262, label %266, label %263

263:                                              ; preds = %260
  %264 = load i32, ptr %28, align 4, !tbaa !11
  %265 = icmp eq i32 %264, 1
  br i1 %265, label %266, label %267

266:                                              ; preds = %263, %260
  store i32 7, ptr %18, align 4
  br label %353

267:                                              ; preds = %263, %252
  %268 = load float, ptr %30, align 4, !tbaa !19
  %269 = load ptr, ptr %9, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.ImVec2, ptr %269, i32 0, i32 1
  %271 = load float, ptr %270, align 4, !tbaa !21
  %272 = fcmp olt float %268, %271
  br i1 %272, label %273, label %280

273:                                              ; preds = %267
  %274 = load i32, ptr %28, align 4, !tbaa !11
  %275 = icmp eq i32 %274, 2
  br i1 %275, label %279, label %276

276:                                              ; preds = %273
  %277 = load i32, ptr %28, align 4, !tbaa !11
  %278 = icmp eq i32 %277, 3
  br i1 %278, label %279, label %280

279:                                              ; preds = %276, %273
  store i32 7, ptr %18, align 4
  br label %353

280:                                              ; preds = %276, %267
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  %281 = load i32, ptr %28, align 4, !tbaa !11
  %282 = icmp eq i32 %281, 0
  br i1 %282, label %283, label %292

283:                                              ; preds = %280
  %284 = load ptr, ptr %12, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.ImRect, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %struct.ImVec2, ptr %285, i32 0, i32 0
  %287 = load float, ptr %286, align 4, !tbaa !13
  %288 = load ptr, ptr %9, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.ImVec2, ptr %288, i32 0, i32 0
  %290 = load float, ptr %289, align 4, !tbaa !23
  %291 = fsub float %287, %290
  br label %305

292:                                              ; preds = %280
  %293 = load i32, ptr %28, align 4, !tbaa !11
  %294 = icmp eq i32 %293, 1
  br i1 %294, label %295, label %300

295:                                              ; preds = %292
  %296 = load ptr, ptr %12, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.ImRect, ptr %296, i32 0, i32 1
  %298 = getelementptr inbounds %struct.ImVec2, ptr %297, i32 0, i32 0
  %299 = load float, ptr %298, align 4, !tbaa !22
  br label %303

300:                                              ; preds = %292
  %301 = getelementptr inbounds %struct.ImVec2, ptr %14, i32 0, i32 0
  %302 = load float, ptr %301, align 4, !tbaa !23
  br label %303

303:                                              ; preds = %300, %295
  %304 = phi float [ %299, %295 ], [ %302, %300 ]
  br label %305

305:                                              ; preds = %303, %283
  %306 = phi float [ %291, %283 ], [ %304, %303 ]
  %307 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  store float %306, ptr %307, align 4, !tbaa !23
  %308 = load i32, ptr %28, align 4, !tbaa !11
  %309 = icmp eq i32 %308, 2
  br i1 %309, label %310, label %319

310:                                              ; preds = %305
  %311 = load ptr, ptr %12, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.ImRect, ptr %311, i32 0, i32 0
  %313 = getelementptr inbounds %struct.ImVec2, ptr %312, i32 0, i32 1
  %314 = load float, ptr %313, align 4, !tbaa !20
  %315 = load ptr, ptr %9, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.ImVec2, ptr %315, i32 0, i32 1
  %317 = load float, ptr %316, align 4, !tbaa !21
  %318 = fsub float %314, %317
  br label %332

319:                                              ; preds = %305
  %320 = load i32, ptr %28, align 4, !tbaa !11
  %321 = icmp eq i32 %320, 3
  br i1 %321, label %322, label %327

322:                                              ; preds = %319
  %323 = load ptr, ptr %12, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.ImRect, ptr %323, i32 0, i32 1
  %325 = getelementptr inbounds %struct.ImVec2, ptr %324, i32 0, i32 1
  %326 = load float, ptr %325, align 4, !tbaa !17
  br label %330

327:                                              ; preds = %319
  %328 = getelementptr inbounds %struct.ImVec2, ptr %14, i32 0, i32 1
  %329 = load float, ptr %328, align 4, !tbaa !21
  br label %330

330:                                              ; preds = %327, %322
  %331 = phi float [ %326, %322 ], [ %329, %327 ]
  br label %332

332:                                              ; preds = %330, %310
  %333 = phi float [ %318, %310 ], [ %331, %330 ]
  %334 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  store float %333, ptr %334, align 4, !tbaa !21
  %335 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  %336 = load float, ptr %335, align 4, !tbaa !23
  %337 = load ptr, ptr %11, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.ImRect, ptr %337, i32 0, i32 0
  %339 = getelementptr inbounds %struct.ImVec2, ptr %338, i32 0, i32 0
  %340 = load float, ptr %339, align 4, !tbaa !13
  %341 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %336, float noundef %340)
  %342 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  store float %341, ptr %342, align 4, !tbaa !23
  %343 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  %344 = load float, ptr %343, align 4, !tbaa !21
  %345 = load ptr, ptr %11, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.ImRect, ptr %345, i32 0, i32 0
  %347 = getelementptr inbounds %struct.ImVec2, ptr %346, i32 0, i32 1
  %348 = load float, ptr %347, align 4, !tbaa !20
  %349 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %344, float noundef %348)
  %350 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  store float %349, ptr %350, align 4, !tbaa !21
  %351 = load i32, ptr %28, align 4, !tbaa !11
  %352 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %351, ptr %352, align 4, !tbaa !11
  store i32 1, ptr %18, align 4
  br label %353

353:                                              ; preds = %332, %279, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %354

354:                                              ; preds = %353, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  %355 = load i32, ptr %18, align 4
  switch i32 %355, label %359 [
    i32 7, label %356
  ]

356:                                              ; preds = %354
  %357 = load i32, ptr %27, align 4, !tbaa !11
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %27, align 4, !tbaa !11
  br label %171, !llvm.loop !26

359:                                              ; preds = %354, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  %360 = load i32, ptr %18, align 4
  switch i32 %360, label %362 [
    i32 5, label %361
  ]

361:                                              ; preds = %359
  store i32 0, ptr %18, align 4
  br label %362

362:                                              ; preds = %361, %359
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  %363 = load i32, ptr %18, align 4
  switch i32 %363, label %416 [
    i32 0, label %364
  ]

364:                                              ; preds = %362
  br label %365

365:                                              ; preds = %364, %162
  %366 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 -1, ptr %366, align 4, !tbaa !11
  %367 = load i32, ptr %13, align 4, !tbaa !9
  %368 = icmp eq i32 %367, 2
  br i1 %368, label %369, label %372

369:                                              ; preds = %365
  %370 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %31, float noundef 2.000000e+00, float noundef 2.000000e+00)
  %371 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %370, ptr noundef nonnull align 4 dereferenceable(8) %31)
  store <2 x float> %371, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  store i32 1, ptr %18, align 4
  br label %416

372:                                              ; preds = %365
  %373 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %373, i64 8, i1 false), !tbaa.struct !18
  %374 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  %375 = load float, ptr %374, align 4, !tbaa !23
  %376 = load ptr, ptr %9, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.ImVec2, ptr %376, i32 0, i32 0
  %378 = load float, ptr %377, align 4, !tbaa !23
  %379 = fadd float %375, %378
  %380 = load ptr, ptr %11, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.ImRect, ptr %380, i32 0, i32 1
  %382 = getelementptr inbounds %struct.ImVec2, ptr %381, i32 0, i32 0
  %383 = load float, ptr %382, align 4, !tbaa !22
  %384 = call noundef float @_ZL5ImMinIfET_S0_S0_(float noundef %379, float noundef %383)
  %385 = load ptr, ptr %9, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.ImVec2, ptr %385, i32 0, i32 0
  %387 = load float, ptr %386, align 4, !tbaa !23
  %388 = fsub float %384, %387
  %389 = load ptr, ptr %11, align 8, !tbaa !5
  %390 = getelementptr inbounds %struct.ImRect, ptr %389, i32 0, i32 0
  %391 = getelementptr inbounds %struct.ImVec2, ptr %390, i32 0, i32 0
  %392 = load float, ptr %391, align 4, !tbaa !13
  %393 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %388, float noundef %392)
  %394 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 0
  store float %393, ptr %394, align 4, !tbaa !23
  %395 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  %396 = load float, ptr %395, align 4, !tbaa !21
  %397 = load ptr, ptr %9, align 8, !tbaa !5
  %398 = getelementptr inbounds %struct.ImVec2, ptr %397, i32 0, i32 1
  %399 = load float, ptr %398, align 4, !tbaa !21
  %400 = fadd float %396, %399
  %401 = load ptr, ptr %11, align 8, !tbaa !5
  %402 = getelementptr inbounds %struct.ImRect, ptr %401, i32 0, i32 1
  %403 = getelementptr inbounds %struct.ImVec2, ptr %402, i32 0, i32 1
  %404 = load float, ptr %403, align 4, !tbaa !17
  %405 = call noundef float @_ZL5ImMinIfET_S0_S0_(float noundef %400, float noundef %404)
  %406 = load ptr, ptr %9, align 8, !tbaa !5
  %407 = getelementptr inbounds %struct.ImVec2, ptr %406, i32 0, i32 1
  %408 = load float, ptr %407, align 4, !tbaa !21
  %409 = fsub float %405, %408
  %410 = load ptr, ptr %11, align 8, !tbaa !5
  %411 = getelementptr inbounds %struct.ImRect, ptr %410, i32 0, i32 0
  %412 = getelementptr inbounds %struct.ImVec2, ptr %411, i32 0, i32 1
  %413 = load float, ptr %412, align 4, !tbaa !20
  %414 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %409, float noundef %413)
  %415 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  store float %414, ptr %415, align 4, !tbaa !21
  store i32 1, ptr %18, align 4
  br label %416

416:                                              ; preds = %372, %369, %362, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %417 = load <2 x float>, ptr %7, align 4
  ret <2 x float> %417
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZL7ImClampRK6ImVec2S1_S_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), <2 x float>) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { inlinehint 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { 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, !10, i64 0}
!10 = !{!"_ZTS24ImGuiPopupPositionPolicy", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !16, i64 0}
!14 = !{!"_ZTS6ImRect", !15, i64 0, !15, i64 8}
!15 = !{!"_ZTS6ImVec2", !16, i64 0, !16, i64 4}
!16 = !{!"float", !7, i64 0}
!17 = !{!14, !16, i64 12}
!18 = !{i64 0, i64 4, !19, i64 4, i64 4, !19}
!19 = !{!16, !16, i64 0}
!20 = !{!14, !16, i64 4}
!21 = !{!15, !16, i64 4}
!22 = !{!14, !16, i64 8}
!23 = !{!15, !16, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


; 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 }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }

@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order = external hidden unnamed_addr constant [4 x i32], align 16
@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254 = external hidden unnamed_addr constant [4 x i32], align 16

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMinIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local <2 x float> @_ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, ptr nocapture noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %3, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %4, i32 noundef %5) local_unnamed_addr #4 {
  %7 = alloca %struct.ImVec2, align 8
  %8 = alloca %struct.ImVec2, align 8
  %9 = alloca %struct.ImVec2, align 8
  %10 = alloca %struct.ImVec2, align 8
  %11 = alloca %struct.ImVec2, align 8
  %12 = alloca %struct.ImRect, align 4
  %13 = alloca %struct.ImVec2, align 8
  %14 = alloca %struct.ImVec2, align 4
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  %16 = tail call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %1)
  %17 = tail call <2 x float> @_ZL7ImClampRK6ImVec2S1_S_(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %3, <2 x float> %16)
  %18 = icmp eq i32 %5, 1
  br i1 %18, label %19, label %.critedge119

19:                                               ; preds = %6
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp ne i32 %20, -1
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = getelementptr inbounds i8, ptr %4, i64 4
  %23 = getelementptr inbounds i8, ptr %1, i64 4
  %24 = getelementptr inbounds i8, ptr %4, i64 12
  %25 = sext i1 %.not to i64
  br label %26

26:                                               ; preds = %19, %61
  %indvars.iv = phi i64 [ %25, %19 ], [ %indvars.iv.next, %61 ]
  %27 = icmp eq i64 %indvars.iv, -1
  %28 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order, i64 0, i64 %indvars.iv
  %.in = select i1 %27, ptr %2, ptr %28
  %29 = load i32, ptr %.in, align 4, !tbaa !5
  br i1 %27, label %33, label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp eq i32 %29, %31
  br i1 %32, label %61, label %33

33:                                               ; preds = %30, %26
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  switch i32 %29, label %58 [
    i32 3, label %34
    i32 1, label %38
    i32 0, label %44
    i32 2, label %50
  ]

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %35 = load float, ptr %4, align 4, !tbaa !9
  %36 = load float, ptr %24, align 4, !tbaa !13
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef %35, float noundef %36)
  %37 = load i64, ptr %8, align 8
  store i64 %37, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %58

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %39 = load float, ptr %4, align 4, !tbaa !9
  %40 = load float, ptr %22, align 4, !tbaa !14
  %41 = load float, ptr %23, align 4, !tbaa !15
  %42 = fsub float %40, %41
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef %39, float noundef %42)
  %43 = load i64, ptr %9, align 8
  store i64 %43, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %58

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %45 = load float, ptr %21, align 4, !tbaa !16
  %46 = load float, ptr %1, align 4, !tbaa !17
  %47 = fsub float %45, %46
  %48 = load float, ptr %24, align 4, !tbaa !13
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef %47, float noundef %48)
  %49 = load i64, ptr %10, align 8
  store i64 %49, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %58

50:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %51 = load float, ptr %21, align 4, !tbaa !16
  %52 = load float, ptr %1, align 4, !tbaa !17
  %53 = fsub float %51, %52
  %54 = load float, ptr %22, align 4, !tbaa !14
  %55 = load float, ptr %23, align 4, !tbaa !15
  %56 = fsub float %54, %55
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %53, float noundef %56)
  %57 = load i64, ptr %11, align 8
  store i64 %57, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %58

58:                                               ; preds = %44, %38, %34, %33, %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %59 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %1)
  store <2 x float> %59, ptr %13, align 8
  call void @_ZN6ImRectC2ERK6ImVec2S2_(ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %13)
  %60 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br i1 %60, label %.critedge, label %61

.critedge:                                        ; preds = %58
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %220

61:                                               ; preds = %30, %58
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond, label %.critedge119, label %26, !llvm.loop !18

.critedge119:                                     ; preds = %61, %6
  %62 = icmp eq i32 %5, 2
  switch i32 %5, label %.critedge122 [
    i32 2, label %63
    i32 0, label %63
  ]

63:                                               ; preds = %.critedge119, %.critedge119
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %.not111 = icmp ne i32 %64, -1
  %.val = load float, ptr %4, align 4
  %.val128 = load float, ptr %15, align 4
  %65 = getelementptr inbounds i8, ptr %4, i64 8
  %.val129 = load float, ptr %65, align 4
  %.val130 = load float, ptr %3, align 4
  %66 = getelementptr inbounds i8, ptr %4, i64 4
  %67 = getelementptr inbounds i8, ptr %4, i64 12
  %68 = getelementptr inbounds i8, ptr %3, i64 4
  %69 = load float, ptr %1, align 4
  %.val131 = load float, ptr %66, align 4
  %70 = getelementptr inbounds i8, ptr %3, i64 12
  %.val132 = load float, ptr %70, align 4
  %.val133 = load float, ptr %67, align 4
  %.val134 = load float, ptr %68, align 4
  %71 = getelementptr inbounds i8, ptr %1, i64 4
  %72 = load float, ptr %71, align 4
  %.in112 = select i1 %.not111, ptr %2, ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254
  %73 = load i32, ptr %.in112, align 4, !tbaa !5
  %74 = icmp ne i32 %73, -1
  %or.cond167.not = select i1 %.not111, i1 true, i1 %74
  br i1 %or.cond167.not, label %75, label %108

75:                                               ; preds = %63
  %76 = icmp eq i32 %73, 0
  %77 = select i1 %76, float %.val, float %.val128
  %78 = icmp eq i32 %73, 1
  %79 = select i1 %78, float %.val129, float %.val130
  %80 = fsub float %77, %79
  %81 = fcmp olt float %80, %69
  %or.cond8 = icmp ult i32 %73, 2
  %or.cond = select i1 %81, i1 %or.cond8, i1 false
  br i1 %or.cond, label %108, label %82

82:                                               ; preds = %75
  %83 = icmp eq i32 %73, 3
  %84 = icmp eq i32 %73, 2
  %85 = select i1 %84, float %.val131, float %.val132
  %86 = select i1 %83, float %.val133, float %.val134
  %87 = fsub float %85, %86
  %88 = fcmp olt float %87, %72
  %89 = and i32 %73, -2
  %or.cond10 = icmp eq i32 %89, 2
  %or.cond120 = select i1 %88, i1 %or.cond10, i1 false
  br i1 %or.cond120, label %108, label %90

90:                                               ; preds = %176, %157, %138, %119, %82
  %.lcssa178 = phi i32 [ %73, %82 ], [ %110, %119 ], [ %129, %138 ], [ %148, %157 ], [ %167, %176 ]
  %.lcssa177 = phi i1 [ %83, %82 ], [ %120, %119 ], [ %139, %138 ], [ %158, %157 ], [ %177, %176 ]
  %.lcssa176 = phi i1 [ %84, %82 ], [ %121, %119 ], [ %140, %138 ], [ %159, %157 ], [ %178, %176 ]
  %.lcssa175 = phi i1 [ %76, %82 ], [ %113, %119 ], [ %132, %138 ], [ %151, %157 ], [ %170, %176 ]
  %.lcssa = phi i1 [ %78, %82 ], [ %115, %119 ], [ %134, %138 ], [ %153, %157 ], [ %172, %176 ]
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  br i1 %.lcssa175, label %91, label %95

91:                                               ; preds = %90
  %92 = load float, ptr %4, align 4, !tbaa !9
  %93 = load float, ptr %1, align 4, !tbaa !17
  %94 = fsub float %92, %93
  br label %.thread123

95:                                               ; preds = %90
  br i1 %.lcssa, label %96, label %98

96:                                               ; preds = %95
  %97 = load float, ptr %65, align 4, !tbaa !16
  br label %.thread123

.thread123:                                       ; preds = %91, %96
  %.ph = phi float [ %97, %96 ], [ %94, %91 ]
  store float %.ph, ptr %7, align 8, !tbaa !17
  br label %106

98:                                               ; preds = %95
  %.sroa.048.0.vec.extract = extractelement <2 x float> %17, i64 0
  store float %.sroa.048.0.vec.extract, ptr %7, align 8, !tbaa !17
  br i1 %.lcssa176, label %99, label %103

99:                                               ; preds = %98
  %100 = load float, ptr %66, align 4, !tbaa !14
  %101 = load float, ptr %71, align 4, !tbaa !15
  %102 = fsub float %100, %101
  br label %184

103:                                              ; preds = %98
  br i1 %.lcssa177, label %104, label %106

104:                                              ; preds = %103
  %105 = load float, ptr %67, align 4, !tbaa !13
  br label %184

106:                                              ; preds = %.thread123, %103
  %107 = phi float [ %.ph, %.thread123 ], [ %.sroa.048.0.vec.extract, %103 ]
  %.sroa.048.4.vec.extract = extractelement <2 x float> %17, i64 1
  br label %184

108:                                              ; preds = %82, %75, %63
  %not..not111 = xor i1 %.not111, true
  %indvars.iv.next156 = zext i1 %not..not111 to i64
  %109 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254, i64 0, i64 %indvars.iv.next156
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp eq i32 %110, %64
  br i1 %111, label %127, label %112

112:                                              ; preds = %108
  %113 = icmp eq i32 %110, 0
  %114 = select i1 %113, float %.val, float %.val128
  %115 = icmp eq i32 %110, 1
  %116 = select i1 %115, float %.val129, float %.val130
  %117 = fsub float %114, %116
  %118 = fcmp olt float %117, %69
  %or.cond8.1 = icmp ult i32 %110, 2
  %or.cond.1 = and i1 %118, %or.cond8.1
  br i1 %or.cond.1, label %127, label %119

119:                                              ; preds = %112
  %120 = icmp eq i32 %110, 3
  %121 = icmp eq i32 %110, 2
  %122 = select i1 %121, float %.val131, float %.val132
  %123 = select i1 %120, float %.val133, float %.val134
  %124 = fsub float %122, %123
  %125 = fcmp olt float %124, %72
  %126 = and i32 %110, -2
  %or.cond10.1 = icmp eq i32 %126, 2
  %or.cond120.1 = and i1 %125, %or.cond10.1
  br i1 %or.cond120.1, label %127, label %90

127:                                              ; preds = %108, %112, %119
  %indvars.iv.next156.1 = select i1 %.not111, i64 1, i64 2
  %128 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254, i64 0, i64 %indvars.iv.next156.1
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp eq i32 %129, %64
  br i1 %130, label %146, label %131

131:                                              ; preds = %127
  %132 = icmp eq i32 %129, 0
  %133 = select i1 %132, float %.val, float %.val128
  %134 = icmp eq i32 %129, 1
  %135 = select i1 %134, float %.val129, float %.val130
  %136 = fsub float %133, %135
  %137 = fcmp olt float %136, %69
  %or.cond8.2 = icmp ult i32 %129, 2
  %or.cond.2 = and i1 %137, %or.cond8.2
  br i1 %or.cond.2, label %146, label %138

138:                                              ; preds = %131
  %139 = icmp eq i32 %129, 3
  %140 = icmp eq i32 %129, 2
  %141 = select i1 %140, float %.val131, float %.val132
  %142 = select i1 %139, float %.val133, float %.val134
  %143 = fsub float %141, %142
  %144 = fcmp olt float %143, %72
  %145 = and i32 %129, -2
  %or.cond10.2 = icmp eq i32 %145, 2
  %or.cond120.2 = and i1 %144, %or.cond10.2
  br i1 %or.cond120.2, label %146, label %90

146:                                              ; preds = %127, %131, %138
  %indvars.iv.next156.2 = select i1 %.not111, i64 2, i64 3
  %147 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254, i64 0, i64 %indvars.iv.next156.2
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp eq i32 %148, %64
  br i1 %149, label %165, label %150

150:                                              ; preds = %146
  %151 = icmp eq i32 %148, 0
  %152 = select i1 %151, float %.val, float %.val128
  %153 = icmp eq i32 %148, 1
  %154 = select i1 %153, float %.val129, float %.val130
  %155 = fsub float %152, %154
  %156 = fcmp olt float %155, %69
  %or.cond8.3 = icmp ult i32 %148, 2
  %or.cond.3 = and i1 %156, %or.cond8.3
  br i1 %or.cond.3, label %165, label %157

157:                                              ; preds = %150
  %158 = icmp eq i32 %148, 3
  %159 = icmp eq i32 %148, 2
  %160 = select i1 %159, float %.val131, float %.val132
  %161 = select i1 %158, float %.val133, float %.val134
  %162 = fsub float %160, %161
  %163 = fcmp olt float %162, %72
  %164 = and i32 %148, -2
  %or.cond10.3 = icmp eq i32 %164, 2
  %or.cond120.3 = and i1 %163, %or.cond10.3
  br i1 %or.cond120.3, label %165, label %90

165:                                              ; preds = %157, %150, %146
  br i1 %.not111, label %166, label %.critedge122, !llvm.loop !20

166:                                              ; preds = %165
  %167 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_PiRK6ImRectS6_24ImGuiPopupPositionPolicy.dir_prefered_order.254, i64 12), align 4, !tbaa !5
  %168 = icmp eq i32 %167, %64
  br i1 %168, label %.critedge122, label %169

169:                                              ; preds = %166
  %170 = icmp eq i32 %167, 0
  %171 = select i1 %170, float %.val, float %.val128
  %172 = icmp eq i32 %167, 1
  %173 = select i1 %172, float %.val129, float %.val130
  %174 = fsub float %171, %173
  %175 = fcmp olt float %174, %69
  %or.cond8.4 = icmp ult i32 %167, 2
  %or.cond.4 = and i1 %175, %or.cond8.4
  br i1 %or.cond.4, label %.critedge122, label %176

176:                                              ; preds = %169
  %177 = icmp eq i32 %167, 3
  %178 = icmp eq i32 %167, 2
  %179 = select i1 %178, float %.val131, float %.val132
  %180 = select i1 %177, float %.val133, float %.val134
  %181 = fsub float %179, %180
  %182 = fcmp olt float %181, %72
  %183 = and i32 %167, -2
  %or.cond10.4 = icmp eq i32 %183, 2
  %or.cond120.4 = and i1 %182, %or.cond10.4
  br i1 %or.cond120.4, label %.critedge122, label %90

184:                                              ; preds = %104, %106, %99
  %185 = phi float [ %.sroa.048.0.vec.extract, %99 ], [ %.sroa.048.0.vec.extract, %104 ], [ %107, %106 ]
  %186 = phi float [ %102, %99 ], [ %105, %104 ], [ %.sroa.048.4.vec.extract, %106 ]
  %187 = getelementptr inbounds i8, ptr %7, i64 4
  store float %186, ptr %187, align 4, !tbaa !15
  %188 = load float, ptr %3, align 4, !tbaa !9
  %189 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %185, float noundef %188)
  store float %189, ptr %7, align 8, !tbaa !17
  %190 = load float, ptr %187, align 4, !tbaa !15
  %191 = load float, ptr %68, align 4, !tbaa !14
  %192 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %190, float noundef %191)
  store float %192, ptr %187, align 4, !tbaa !15
  store i32 %.lcssa178, ptr %2, align 4, !tbaa !5
  br label %220

.critedge122:                                     ; preds = %165, %176, %169, %166, %.critedge119
  store i32 -1, ptr %2, align 4, !tbaa !5
  br i1 %62, label %193, label %195

193:                                              ; preds = %.critedge122
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef 2.000000e+00, float noundef 2.000000e+00)
  %194 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store <2 x float> %194, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %220

195:                                              ; preds = %.critedge122
  %196 = load i64, ptr %0, align 4
  store i64 %196, ptr %7, align 8
  %197 = trunc i64 %196 to i32
  %198 = bitcast i32 %197 to float
  %199 = load float, ptr %1, align 4, !tbaa !17
  %200 = fadd float %199, %198
  %201 = load float, ptr %15, align 4, !tbaa !16
  %202 = call noundef float @_ZL5ImMinIfET_S0_S0_(float noundef %200, float noundef %201)
  %203 = load float, ptr %1, align 4, !tbaa !17
  %204 = fsub float %202, %203
  %205 = load float, ptr %3, align 4, !tbaa !9
  %206 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %204, float noundef %205)
  store float %206, ptr %7, align 8, !tbaa !17
  %207 = getelementptr inbounds i8, ptr %7, i64 4
  %208 = load float, ptr %207, align 4, !tbaa !15
  %209 = getelementptr inbounds i8, ptr %1, i64 4
  %210 = load float, ptr %209, align 4, !tbaa !15
  %211 = fadd float %208, %210
  %212 = getelementptr inbounds i8, ptr %3, i64 12
  %213 = load float, ptr %212, align 4, !tbaa !13
  %214 = call noundef float @_ZL5ImMinIfET_S0_S0_(float noundef %211, float noundef %213)
  %215 = load float, ptr %209, align 4, !tbaa !15
  %216 = fsub float %214, %215
  %217 = getelementptr inbounds i8, ptr %3, i64 4
  %218 = load float, ptr %217, align 4, !tbaa !14
  %219 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %216, float noundef %218)
  store float %219, ptr %207, align 4, !tbaa !15
  br label %220

220:                                              ; preds = %184, %.critedge, %195, %193
  %221 = load <2 x float>, ptr %7, align 8
  ret <2 x float> %221
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZL7ImClampRK6ImVec2S1_S_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), <2 x float>) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { inlinehint 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 #4 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 0}
!10 = !{!"_ZTS6ImRect", !11, i64 0, !11, i64 8}
!11 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !12, i64 12}
!14 = !{!10, !12, i64 4}
!15 = !{!11, !12, i64 4}
!16 = !{!10, !12, i64 8}
!17 = !{!11, !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass