; LLVM IR from xhub/reshop :: gui/external/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_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order = external hidden unnamed_addr constant [4 x i32], align 16
@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311 = 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_P8ImGuiDirRK6ImRectS7_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
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %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 = call <2 x float> @_ZL7ImClampRK6ImVec2S1_S1_(ptr noundef nonnull align 4 dereferenceable(8) %32, ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store <2 x float> %39, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %158

42:                                               ; 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_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp ne i32 %44, -1
  %46 = zext i1 %45 to i64
  %47 = select i1 %45, i32 -1, i32 0
  store i32 %47, ptr %17, align 4, !tbaa !13
  br label %48

48:                                               ; preds = %149, %42
  %49 = load i32, ptr %17, align 4, !tbaa !13
  %50 = icmp slt i32 %49, 4
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 2, ptr %18, align 4
  br label %152

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

55:                                               ; preds = %52
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i32, ptr %56, align 4, !tbaa !11
  br label %63

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

63:                                               ; preds = %58, %55
  %64 = phi i32 [ %57, %55 ], [ %62, %58 ]
  store i32 %64, ptr %19, align 4, !tbaa !11
  %65 = load i32, ptr %17, align 4, !tbaa !13
  %66 = icmp ne i32 %65, -1
  br i1 %66, label %67, label %73

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

72:                                               ; preds = %67
  store i32 4, ptr %18, align 4
  br label %147

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

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

85:                                               ; preds = %76, %73
  %86 = load i32, ptr %19, align 4, !tbaa !11
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %101

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

101:                                              ; preds = %88, %85
  %102 = load i32, ptr %19, align 4, !tbaa !11
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %117

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

117:                                              ; preds = %104, %101
  %118 = load i32, ptr %19, align 4, !tbaa !11
  %119 = icmp eq i32 %118, 2
  br i1 %119, label %120, label %137

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

137:                                              ; preds = %120, %117
  %138 = 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
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %139)
  store <2 x float> %140, 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)
  %141 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16) %138, ptr noundef nonnull align 4 dereferenceable(16) %24)
  %142 = xor i1 %141, 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 %142, label %143, label %144

143:                                              ; preds = %137
  store i32 4, ptr %18, align 4
  br label %147

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

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

149:                                              ; preds = %147
  %150 = load i32, ptr %17, align 4, !tbaa !13
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %17, align 4, !tbaa !13
  br label %48, !llvm.loop !26

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

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

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

157:                                              ; preds = %155
  br label %158

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

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

164:                                              ; preds = %161, %158
  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_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  %166 = load i32, ptr %165, align 4, !tbaa !11
  %167 = icmp ne i32 %166, -1
  %168 = zext i1 %167 to i64
  %169 = select i1 %167, i32 -1, i32 0
  store i32 %169, ptr %27, align 4, !tbaa !13
  br label %170

170:                                              ; preds = %355, %164
  %171 = load i32, ptr %27, align 4, !tbaa !13
  %172 = icmp slt i32 %171, 4
  br i1 %172, label %174, label %173

173:                                              ; preds = %170
  store i32 5, ptr %18, align 4
  br label %358

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

177:                                              ; preds = %174
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = load i32, ptr %178, align 4, !tbaa !11
  br label %185

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

185:                                              ; preds = %180, %177
  %186 = phi i32 [ %179, %177 ], [ %184, %180 ]
  store i32 %186, ptr %28, align 4, !tbaa !11
  %187 = load i32, ptr %27, align 4, !tbaa !13
  %188 = icmp ne i32 %187, -1
  br i1 %188, label %189, label %195

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

194:                                              ; preds = %189
  store i32 7, ptr %18, align 4
  br label %353

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

198:                                              ; preds = %195
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.ImRect, ptr %199, i32 0, i32 0
  %201 = getelementptr inbounds %struct.ImVec2, ptr %200, i32 0, i32 0
  %202 = load float, ptr %201, align 4, !tbaa !15
  br label %208

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

208:                                              ; preds = %203, %198
  %209 = phi float [ %202, %198 ], [ %207, %203 ]
  %210 = load i32, ptr %28, align 4, !tbaa !11
  %211 = icmp eq i32 %210, 1
  br i1 %211, label %212, label %217

212:                                              ; preds = %208
  %213 = load ptr, ptr %12, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.ImRect, ptr %213, i32 0, i32 1
  %215 = getelementptr inbounds %struct.ImVec2, ptr %214, i32 0, i32 0
  %216 = load float, ptr %215, align 4, !tbaa !24
  br label %222

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

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

227:                                              ; preds = %222
  %228 = load ptr, ptr %12, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.ImRect, ptr %228, i32 0, i32 0
  %230 = getelementptr inbounds %struct.ImVec2, ptr %229, i32 0, i32 1
  %231 = load float, ptr %230, align 4, !tbaa !22
  br label %237

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

237:                                              ; preds = %232, %227
  %238 = phi float [ %231, %227 ], [ %236, %232 ]
  %239 = load i32, ptr %28, align 4, !tbaa !11
  %240 = icmp eq i32 %239, 3
  br i1 %240, label %241, label %246

241:                                              ; preds = %237
  %242 = load ptr, ptr %12, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.ImRect, ptr %242, i32 0, i32 1
  %244 = getelementptr inbounds %struct.ImVec2, ptr %243, i32 0, i32 1
  %245 = load float, ptr %244, align 4, !tbaa !19
  br label %251

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

251:                                              ; preds = %246, %241
  %252 = phi float [ %245, %241 ], [ %250, %246 ]
  %253 = fsub float %238, %252
  store float %253, ptr %30, align 4, !tbaa !21
  %254 = load float, ptr %29, align 4, !tbaa !21
  %255 = load ptr, ptr %9, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.ImVec2, ptr %255, i32 0, i32 0
  %257 = load float, ptr %256, align 4, !tbaa !25
  %258 = fcmp olt float %254, %257
  br i1 %258, label %259, label %266

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

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

265:                                              ; preds = %262, %259
  store i32 7, ptr %18, align 4
  br label %352

266:                                              ; preds = %262, %251
  %267 = load float, ptr %30, align 4, !tbaa !21
  %268 = load ptr, ptr %9, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.ImVec2, ptr %268, i32 0, i32 1
  %270 = load float, ptr %269, align 4, !tbaa !23
  %271 = fcmp olt float %267, %270
  br i1 %271, label %272, label %279

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

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

278:                                              ; preds = %275, %272
  store i32 7, ptr %18, align 4
  br label %352

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

282:                                              ; preds = %279
  %283 = load ptr, ptr %12, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.ImRect, ptr %283, i32 0, i32 0
  %285 = getelementptr inbounds %struct.ImVec2, ptr %284, i32 0, i32 0
  %286 = load float, ptr %285, align 4, !tbaa !15
  %287 = load ptr, ptr %9, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.ImVec2, ptr %287, i32 0, i32 0
  %289 = load float, ptr %288, align 4, !tbaa !25
  %290 = fsub float %286, %289
  br label %304

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

294:                                              ; preds = %291
  %295 = load ptr, ptr %12, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.ImRect, ptr %295, i32 0, i32 1
  %297 = getelementptr inbounds %struct.ImVec2, ptr %296, i32 0, i32 0
  %298 = load float, ptr %297, align 4, !tbaa !24
  br label %302

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

302:                                              ; preds = %299, %294
  %303 = phi float [ %298, %294 ], [ %301, %299 ]
  br label %304

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

309:                                              ; preds = %304
  %310 = load ptr, ptr %12, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.ImRect, ptr %310, i32 0, i32 0
  %312 = getelementptr inbounds %struct.ImVec2, ptr %311, i32 0, i32 1
  %313 = load float, ptr %312, align 4, !tbaa !22
  %314 = load ptr, ptr %9, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.ImVec2, ptr %314, i32 0, i32 1
  %316 = load float, ptr %315, align 4, !tbaa !23
  %317 = fsub float %313, %316
  br label %331

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

321:                                              ; preds = %318
  %322 = load ptr, ptr %12, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.ImRect, ptr %322, i32 0, i32 1
  %324 = getelementptr inbounds %struct.ImVec2, ptr %323, i32 0, i32 1
  %325 = load float, ptr %324, align 4, !tbaa !19
  br label %329

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

329:                                              ; preds = %326, %321
  %330 = phi float [ %325, %321 ], [ %328, %326 ]
  br label %331

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

352:                                              ; preds = %331, %278, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %353

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

355:                                              ; preds = %353
  %356 = load i32, ptr %27, align 4, !tbaa !13
  %357 = add nsw i32 %356, 1
  store i32 %357, ptr %27, align 4, !tbaa !13
  br label %170, !llvm.loop !28

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

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

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

363:                                              ; preds = %361
  br label %364

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

368:                                              ; preds = %364
  %369 = 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)
  %370 = call <2 x float> @_ZplRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %369, ptr noundef nonnull align 4 dereferenceable(8) %31)
  store <2 x float> %370, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  store i32 1, ptr %18, align 4
  br label %415

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

415:                                              ; preds = %371, %368, %361, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %416 = load <2 x float>, ptr %7, align 4
  ret <2 x float> %416
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZL7ImClampRK6ImVec2S1_S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #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 = !{!"_ZTS8ImGuiDir", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !18, i64 0}
!16 = !{!"_ZTS6ImRect", !17, i64 0, !17, i64 8}
!17 = !{!"_ZTS6ImVec2", !18, i64 0, !18, i64 4}
!18 = !{!"float", !7, i64 0}
!19 = !{!16, !18, i64 12}
!20 = !{i64 0, i64 4, !21, i64 4, i64 4, !21}
!21 = !{!18, !18, i64 0}
!22 = !{!16, !18, i64 4}
!23 = !{!17, !18, i64 4}
!24 = !{!16, !18, i64 8}
!25 = !{!17, !18, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


; 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_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order = external hidden unnamed_addr constant [4 x i32], align 16
@__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311 = 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_P8ImGuiDirRK6ImRectS7_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.ImVec2, align 8
  %13 = alloca %struct.ImRect, align 4
  %14 = alloca %struct.ImVec2, align 8
  %15 = alloca %struct.ImVec2, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = tail call <2 x float> @_ZmiRK6ImVec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %1)
  store <2 x float> %17, ptr %8, align 8
  %18 = call <2 x float> @_ZL7ImClampRK6ImVec2S1_S1_(ptr noundef nonnull align 4 dereferenceable(8) %0, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %19 = icmp eq i32 %5, 1
  br i1 %19, label %20, label %.critedge118

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

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

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

34:                                               ; preds = %31, %27
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  switch i32 %30, label %59 [
    i32 3, label %35
    i32 1, label %39
    i32 0, label %45
    i32 2, label %51
  ]

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

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

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %46 = load float, ptr %22, align 4, !tbaa !16
  %47 = load float, ptr %1, align 4, !tbaa !17
  %48 = fsub float %46, %47
  %49 = load float, ptr %25, align 4, !tbaa !13
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef %48, float noundef %49)
  %50 = load i64, ptr %11, align 8
  store i64 %50, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %59

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

59:                                               ; preds = %45, %39, %35, %34, %51
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %60 = 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> %60, ptr %14, align 8
  call void @_ZN6ImRectC2ERK6ImVec2S2_(ptr noundef nonnull align 4 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %61 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERKS_(ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  br i1 %61, label %.critedge, label %62

.critedge:                                        ; preds = %59
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %221

62:                                               ; preds = %31, %59
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond, label %.critedge118, label %27, !llvm.loop !18

.critedge118:                                     ; preds = %62, %6
  %63 = icmp eq i32 %5, 2
  switch i32 %5, label %.critedge121 [
    i32 2, label %64
    i32 0, label %64
  ]

64:                                               ; preds = %.critedge118, %.critedge118
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %.not110 = icmp ne i32 %65, -1
  %.val = load float, ptr %4, align 4
  %.val127 = load float, ptr %16, align 4
  %66 = getelementptr inbounds i8, ptr %4, i64 8
  %.val128 = load float, ptr %66, align 4
  %.val129 = load float, ptr %3, align 4
  %67 = getelementptr inbounds i8, ptr %4, i64 4
  %68 = getelementptr inbounds i8, ptr %4, i64 12
  %69 = getelementptr inbounds i8, ptr %3, i64 4
  %70 = load float, ptr %1, align 4
  %.val130 = load float, ptr %67, align 4
  %71 = getelementptr inbounds i8, ptr %3, i64 12
  %.val131 = load float, ptr %71, align 4
  %.val132 = load float, ptr %68, align 4
  %.val133 = load float, ptr %69, align 4
  %72 = getelementptr inbounds i8, ptr %1, i64 4
  %73 = load float, ptr %72, align 4
  %.in111 = select i1 %.not110, ptr %2, ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311
  %74 = load i32, ptr %.in111, align 4, !tbaa !5
  %75 = icmp ne i32 %74, -1
  %or.cond166.not = select i1 %.not110, i1 true, i1 %75
  br i1 %or.cond166.not, label %76, label %109

76:                                               ; preds = %64
  %77 = icmp eq i32 %74, 0
  %78 = select i1 %77, float %.val, float %.val127
  %79 = icmp eq i32 %74, 1
  %80 = select i1 %79, float %.val128, float %.val129
  %81 = fsub float %78, %80
  %82 = fcmp olt float %81, %70
  %or.cond8 = icmp ult i32 %74, 2
  %or.cond = select i1 %82, i1 %or.cond8, i1 false
  br i1 %or.cond, label %109, label %83

83:                                               ; preds = %76
  %84 = icmp eq i32 %74, 3
  %85 = icmp eq i32 %74, 2
  %86 = select i1 %85, float %.val130, float %.val131
  %87 = select i1 %84, float %.val132, float %.val133
  %88 = fsub float %86, %87
  %89 = fcmp olt float %88, %73
  %90 = and i32 %74, -2
  %or.cond10 = icmp eq i32 %90, 2
  %or.cond119 = select i1 %89, i1 %or.cond10, i1 false
  br i1 %or.cond119, label %109, label %91

91:                                               ; preds = %177, %158, %139, %120, %83
  %.lcssa177 = phi i32 [ %74, %83 ], [ %111, %120 ], [ %130, %139 ], [ %149, %158 ], [ %168, %177 ]
  %.lcssa176 = phi i1 [ %84, %83 ], [ %121, %120 ], [ %140, %139 ], [ %159, %158 ], [ %178, %177 ]
  %.lcssa175 = phi i1 [ %85, %83 ], [ %122, %120 ], [ %141, %139 ], [ %160, %158 ], [ %179, %177 ]
  %.lcssa174 = phi i1 [ %77, %83 ], [ %114, %120 ], [ %133, %139 ], [ %152, %158 ], [ %171, %177 ]
  %.lcssa = phi i1 [ %79, %83 ], [ %116, %120 ], [ %135, %139 ], [ %154, %158 ], [ %173, %177 ]
  call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %7)
  br i1 %.lcssa174, label %92, label %96

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

96:                                               ; preds = %91
  br i1 %.lcssa, label %97, label %99

97:                                               ; preds = %96
  %98 = load float, ptr %66, align 4, !tbaa !16
  br label %.thread122

.thread122:                                       ; preds = %92, %97
  %.ph = phi float [ %98, %97 ], [ %95, %92 ]
  store float %.ph, ptr %7, align 8, !tbaa !17
  br label %107

99:                                               ; preds = %96
  %.sroa.0.0.vec.extract = extractelement <2 x float> %18, i64 0
  store float %.sroa.0.0.vec.extract, ptr %7, align 8, !tbaa !17
  br i1 %.lcssa175, label %100, label %104

100:                                              ; preds = %99
  %101 = load float, ptr %67, align 4, !tbaa !14
  %102 = load float, ptr %72, align 4, !tbaa !15
  %103 = fsub float %101, %102
  br label %185

104:                                              ; preds = %99
  br i1 %.lcssa176, label %105, label %107

105:                                              ; preds = %104
  %106 = load float, ptr %68, align 4, !tbaa !13
  br label %185

107:                                              ; preds = %.thread122, %104
  %108 = phi float [ %.ph, %.thread122 ], [ %.sroa.0.0.vec.extract, %104 ]
  %.sroa.0.4.vec.extract = extractelement <2 x float> %18, i64 1
  br label %185

109:                                              ; preds = %83, %76, %64
  %not..not110 = xor i1 %.not110, true
  %indvars.iv.next155 = zext i1 %not..not110 to i64
  %110 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311, i64 0, i64 %indvars.iv.next155
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = icmp eq i32 %111, %65
  br i1 %112, label %128, label %113

113:                                              ; preds = %109
  %114 = icmp eq i32 %111, 0
  %115 = select i1 %114, float %.val, float %.val127
  %116 = icmp eq i32 %111, 1
  %117 = select i1 %116, float %.val128, float %.val129
  %118 = fsub float %115, %117
  %119 = fcmp olt float %118, %70
  %or.cond8.1 = icmp ult i32 %111, 2
  %or.cond.1 = and i1 %119, %or.cond8.1
  br i1 %or.cond.1, label %128, label %120

120:                                              ; preds = %113
  %121 = icmp eq i32 %111, 3
  %122 = icmp eq i32 %111, 2
  %123 = select i1 %122, float %.val130, float %.val131
  %124 = select i1 %121, float %.val132, float %.val133
  %125 = fsub float %123, %124
  %126 = fcmp olt float %125, %73
  %127 = and i32 %111, -2
  %or.cond10.1 = icmp eq i32 %127, 2
  %or.cond119.1 = and i1 %126, %or.cond10.1
  br i1 %or.cond119.1, label %128, label %91

128:                                              ; preds = %109, %113, %120
  %indvars.iv.next155.1 = select i1 %.not110, i64 1, i64 2
  %129 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311, i64 0, i64 %indvars.iv.next155.1
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp eq i32 %130, %65
  br i1 %131, label %147, label %132

132:                                              ; preds = %128
  %133 = icmp eq i32 %130, 0
  %134 = select i1 %133, float %.val, float %.val127
  %135 = icmp eq i32 %130, 1
  %136 = select i1 %135, float %.val128, float %.val129
  %137 = fsub float %134, %136
  %138 = fcmp olt float %137, %70
  %or.cond8.2 = icmp ult i32 %130, 2
  %or.cond.2 = and i1 %138, %or.cond8.2
  br i1 %or.cond.2, label %147, label %139

139:                                              ; preds = %132
  %140 = icmp eq i32 %130, 3
  %141 = icmp eq i32 %130, 2
  %142 = select i1 %141, float %.val130, float %.val131
  %143 = select i1 %140, float %.val132, float %.val133
  %144 = fsub float %142, %143
  %145 = fcmp olt float %144, %73
  %146 = and i32 %130, -2
  %or.cond10.2 = icmp eq i32 %146, 2
  %or.cond119.2 = and i1 %145, %or.cond10.2
  br i1 %or.cond119.2, label %147, label %91

147:                                              ; preds = %128, %132, %139
  %indvars.iv.next155.2 = select i1 %.not110, i64 2, i64 3
  %148 = getelementptr inbounds [4 x i32], ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311, i64 0, i64 %indvars.iv.next155.2
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = icmp eq i32 %149, %65
  br i1 %150, label %166, label %151

151:                                              ; preds = %147
  %152 = icmp eq i32 %149, 0
  %153 = select i1 %152, float %.val, float %.val127
  %154 = icmp eq i32 %149, 1
  %155 = select i1 %154, float %.val128, float %.val129
  %156 = fsub float %153, %155
  %157 = fcmp olt float %156, %70
  %or.cond8.3 = icmp ult i32 %149, 2
  %or.cond.3 = and i1 %157, %or.cond8.3
  br i1 %or.cond.3, label %166, label %158

158:                                              ; preds = %151
  %159 = icmp eq i32 %149, 3
  %160 = icmp eq i32 %149, 2
  %161 = select i1 %160, float %.val130, float %.val131
  %162 = select i1 %159, float %.val132, float %.val133
  %163 = fsub float %161, %162
  %164 = fcmp olt float %163, %73
  %165 = and i32 %149, -2
  %or.cond10.3 = icmp eq i32 %165, 2
  %or.cond119.3 = and i1 %164, %or.cond10.3
  br i1 %or.cond119.3, label %166, label %91

166:                                              ; preds = %158, %151, %147
  br i1 %.not110, label %167, label %.critedge121, !llvm.loop !20

167:                                              ; preds = %166
  %168 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN5ImGui27FindBestWindowPosForPopupExERK6ImVec2S2_P8ImGuiDirRK6ImRectS7_24ImGuiPopupPositionPolicy.dir_prefered_order.311, i64 12), align 4, !tbaa !5
  %169 = icmp eq i32 %168, %65
  br i1 %169, label %.critedge121, label %170

170:                                              ; preds = %167
  %171 = icmp eq i32 %168, 0
  %172 = select i1 %171, float %.val, float %.val127
  %173 = icmp eq i32 %168, 1
  %174 = select i1 %173, float %.val128, float %.val129
  %175 = fsub float %172, %174
  %176 = fcmp olt float %175, %70
  %or.cond8.4 = icmp ult i32 %168, 2
  %or.cond.4 = and i1 %176, %or.cond8.4
  br i1 %or.cond.4, label %.critedge121, label %177

177:                                              ; preds = %170
  %178 = icmp eq i32 %168, 3
  %179 = icmp eq i32 %168, 2
  %180 = select i1 %179, float %.val130, float %.val131
  %181 = select i1 %178, float %.val132, float %.val133
  %182 = fsub float %180, %181
  %183 = fcmp olt float %182, %73
  %184 = and i32 %168, -2
  %or.cond10.4 = icmp eq i32 %184, 2
  %or.cond119.4 = and i1 %183, %or.cond10.4
  br i1 %or.cond119.4, label %.critedge121, label %91

185:                                              ; preds = %105, %107, %100
  %186 = phi float [ %.sroa.0.0.vec.extract, %100 ], [ %.sroa.0.0.vec.extract, %105 ], [ %108, %107 ]
  %187 = phi float [ %103, %100 ], [ %106, %105 ], [ %.sroa.0.4.vec.extract, %107 ]
  %188 = getelementptr inbounds i8, ptr %7, i64 4
  store float %187, ptr %188, align 4, !tbaa !15
  %189 = load float, ptr %3, align 4, !tbaa !9
  %190 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %186, float noundef %189)
  store float %190, ptr %7, align 8, !tbaa !17
  %191 = load float, ptr %188, align 4, !tbaa !15
  %192 = load float, ptr %69, align 4, !tbaa !14
  %193 = call noundef float @_ZL5ImMaxIfET_S0_S0_(float noundef %191, float noundef %192)
  store float %193, ptr %188, align 4, !tbaa !15
  store i32 %.lcssa177, ptr %2, align 4, !tbaa !5
  br label %221

.critedge121:                                     ; preds = %166, %177, %170, %167, %.critedge118
  store i32 -1, ptr %2, align 4, !tbaa !5
  br i1 %63, label %194, label %196

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

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

221:                                              ; preds = %185, %.critedge, %196, %194
  %222 = load <2 x float>, ptr %7, align 8
  ret <2 x float> %222
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden <2 x float> @_ZL7ImClampRK6ImVec2S1_S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) 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 = !{!"_ZTS8ImGuiDir", !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