; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Edge Verve Coding Round (Question 1 - Shortest Path along the sides of 3D box)

; 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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [1000 x double], align 16
  %9 = alloca [1000 x double], align 16
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8000, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 8000, i1 false)
  call void @llvm.lifetime.start.p0(i64 8000, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 8000, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store double 0x4202A05F1FF80000, ptr %10, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %41

31:                                               ; preds = %0
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = mul nsw i32 %32, %33
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = mul nsw i32 %35, %36
  %38 = add nsw i32 %34, %37
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %38)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %428

41:                                               ; preds = %0
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %54

44:                                               ; preds = %41
  %45 = load i32, ptr %5, align 4, !tbaa !9
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = mul nsw i32 %45, %46
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %7, align 4, !tbaa !9
  %50 = mul nsw i32 %48, %49
  %51 = add nsw i32 %47, %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %51)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %427

54:                                               ; preds = %41
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %67

57:                                               ; preds = %54
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = mul nsw i32 %58, %59
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = mul nsw i32 %61, %62
  %64 = add nsw i32 %60, %63
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %426

67:                                               ; preds = %54
  %68 = load i32, ptr %2, align 4, !tbaa !9
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %186

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %125, %71
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = icmp sle i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %128

77:                                               ; preds = %72
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = mul nsw i32 %78, %79
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = mul nsw i32 %81, %82
  %84 = add nsw i32 %80, %83
  %85 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %84)
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %87
  store double %85, ptr %88, align 8, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = sub nsw i32 %89, %90
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = sub nsw i32 %92, %93
  %95 = mul nsw i32 %91, %94
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = mul nsw i32 %96, %97
  %99 = add nsw i32 %95, %98
  %100 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %99)
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %102
  store double %100, ptr %103, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !5
  %112 = fadd double %107, %111
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !5
  %121 = fadd double %116, %120
  %122 = fmul double %112, %121
  store double %122, ptr %12, align 8, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %124 = load double, ptr %123, align 8, !tbaa !5
  store double %124, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %125

125:                                              ; preds = %77
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %11, align 4, !tbaa !9
  br label %72, !llvm.loop !11

128:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %182, %128
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = load i32, ptr %6, align 4, !tbaa !9
  %132 = icmp sle i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %185

134:                                              ; preds = %129
  %135 = load i32, ptr %13, align 4, !tbaa !9
  %136 = load i32, ptr %13, align 4, !tbaa !9
  %137 = mul nsw i32 %135, %136
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = load i32, ptr %5, align 4, !tbaa !9
  %140 = mul nsw i32 %138, %139
  %141 = add nsw i32 %137, %140
  %142 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %141)
  %143 = load i32, ptr %13, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %144
  store double %142, ptr %145, align 8, !tbaa !5
  %146 = load i32, ptr %6, align 4, !tbaa !9
  %147 = load i32, ptr %13, align 4, !tbaa !9
  %148 = sub nsw i32 %146, %147
  %149 = load i32, ptr %6, align 4, !tbaa !9
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = sub nsw i32 %149, %150
  %152 = mul nsw i32 %148, %151
  %153 = load i32, ptr %7, align 4, !tbaa !9
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = mul nsw i32 %153, %154
  %156 = add nsw i32 %152, %155
  %157 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %156)
  %158 = load i32, ptr %13, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %159
  store double %157, ptr %160, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %161 = load i32, ptr %13, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !5
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %166
  %168 = load double, ptr %167, align 8, !tbaa !5
  %169 = fadd double %164, %168
  %170 = load i32, ptr %13, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !5
  %174 = load i32, ptr %13, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !5
  %178 = fadd double %173, %177
  %179 = fmul double %169, %178
  store double %179, ptr %14, align 8, !tbaa !5
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %181 = load double, ptr %180, align 8, !tbaa !5
  store double %181, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %182

182:                                              ; preds = %134
  %183 = load i32, ptr %13, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %13, align 4, !tbaa !9
  br label %129, !llvm.loop !13

185:                                              ; preds = %133
  br label %421

186:                                              ; preds = %67
  %187 = load i32, ptr %3, align 4, !tbaa !9
  %188 = load i32, ptr %6, align 4, !tbaa !9
  %189 = icmp eq i32 %187, %188
  br i1 %189, label %190, label %305

190:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %244, %190
  %192 = load i32, ptr %15, align 4, !tbaa !9
  %193 = load i32, ptr %7, align 4, !tbaa !9
  %194 = icmp sle i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %247

196:                                              ; preds = %191
  %197 = load i32, ptr %15, align 4, !tbaa !9
  %198 = load i32, ptr %15, align 4, !tbaa !9
  %199 = mul nsw i32 %197, %198
  %200 = load i32, ptr %6, align 4, !tbaa !9
  %201 = load i32, ptr %6, align 4, !tbaa !9
  %202 = mul nsw i32 %200, %201
  %203 = add nsw i32 %199, %202
  %204 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %203)
  %205 = load i32, ptr %15, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %206
  store double %204, ptr %207, align 8, !tbaa !5
  %208 = load i32, ptr %7, align 4, !tbaa !9
  %209 = load i32, ptr %15, align 4, !tbaa !9
  %210 = sub nsw i32 %208, %209
  %211 = load i32, ptr %7, align 4, !tbaa !9
  %212 = load i32, ptr %15, align 4, !tbaa !9
  %213 = sub nsw i32 %211, %212
  %214 = mul nsw i32 %210, %213
  %215 = load i32, ptr %5, align 4, !tbaa !9
  %216 = load i32, ptr %5, align 4, !tbaa !9
  %217 = mul nsw i32 %215, %216
  %218 = add nsw i32 %214, %217
  %219 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %218)
  %220 = load i32, ptr %15, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %221
  store double %219, ptr %222, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %223 = load i32, ptr %15, align 4, !tbaa !9
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %224
  %226 = load double, ptr %225, align 8, !tbaa !5
  %227 = load i32, ptr %15, align 4, !tbaa !9
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %228
  %230 = load double, ptr %229, align 8, !tbaa !5
  %231 = fadd double %226, %230
  %232 = load i32, ptr %15, align 4, !tbaa !9
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %233
  %235 = load double, ptr %234, align 8, !tbaa !5
  %236 = load i32, ptr %15, align 4, !tbaa !9
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %237
  %239 = load double, ptr %238, align 8, !tbaa !5
  %240 = fadd double %235, %239
  %241 = fmul double %231, %240
  store double %241, ptr %16, align 8, !tbaa !5
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %243 = load double, ptr %242, align 8, !tbaa !5
  store double %243, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %244

244:                                              ; preds = %196
  %245 = load i32, ptr %15, align 4, !tbaa !9
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %15, align 4, !tbaa !9
  br label %191, !llvm.loop !14

247:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %248

248:                                              ; preds = %301, %247
  %249 = load i32, ptr %17, align 4, !tbaa !9
  %250 = load i32, ptr %5, align 4, !tbaa !9
  %251 = icmp sle i32 %249, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %248
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %304

253:                                              ; preds = %248
  %254 = load i32, ptr %17, align 4, !tbaa !9
  %255 = load i32, ptr %17, align 4, !tbaa !9
  %256 = mul nsw i32 %254, %255
  %257 = load i32, ptr %7, align 4, !tbaa !9
  %258 = load i32, ptr %7, align 4, !tbaa !9
  %259 = mul nsw i32 %257, %258
  %260 = add nsw i32 %256, %259
  %261 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %260)
  %262 = load i32, ptr %17, align 4, !tbaa !9
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %263
  store double %261, ptr %264, align 8, !tbaa !5
  %265 = load i32, ptr %5, align 4, !tbaa !9
  %266 = load i32, ptr %17, align 4, !tbaa !9
  %267 = sub nsw i32 %265, %266
  %268 = load i32, ptr %5, align 4, !tbaa !9
  %269 = load i32, ptr %17, align 4, !tbaa !9
  %270 = sub nsw i32 %268, %269
  %271 = mul nsw i32 %267, %270
  %272 = load i32, ptr %6, align 4, !tbaa !9
  %273 = load i32, ptr %6, align 4, !tbaa !9
  %274 = mul nsw i32 %272, %273
  %275 = add nsw i32 %271, %274
  %276 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %275)
  %277 = load i32, ptr %17, align 4, !tbaa !9
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %278
  store double %276, ptr %279, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %280 = load i32, ptr %17, align 4, !tbaa !9
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %281
  %283 = load double, ptr %282, align 8, !tbaa !5
  %284 = load i32, ptr %17, align 4, !tbaa !9
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %285
  %287 = load double, ptr %286, align 8, !tbaa !5
  %288 = fadd double %283, %287
  %289 = load i32, ptr %17, align 4, !tbaa !9
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %290
  %292 = load double, ptr %291, align 8, !tbaa !5
  %293 = load i32, ptr %17, align 4, !tbaa !9
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %294
  %296 = load double, ptr %295, align 8, !tbaa !5
  %297 = fadd double %292, %296
  %298 = fmul double %288, %297
  store double %298, ptr %18, align 8, !tbaa !5
  %299 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %300 = load double, ptr %299, align 8, !tbaa !5
  store double %300, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %301

301:                                              ; preds = %253
  %302 = load i32, ptr %17, align 4, !tbaa !9
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %17, align 4, !tbaa !9
  br label %248, !llvm.loop !15

304:                                              ; preds = %252
  br label %420

305:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %306

306:                                              ; preds = %359, %305
  %307 = load i32, ptr %19, align 4, !tbaa !9
  %308 = load i32, ptr %5, align 4, !tbaa !9
  %309 = icmp sle i32 %307, %308
  br i1 %309, label %311, label %310

310:                                              ; preds = %306
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %362

311:                                              ; preds = %306
  %312 = load i32, ptr %19, align 4, !tbaa !9
  %313 = load i32, ptr %19, align 4, !tbaa !9
  %314 = mul nsw i32 %312, %313
  %315 = load i32, ptr %7, align 4, !tbaa !9
  %316 = load i32, ptr %7, align 4, !tbaa !9
  %317 = mul nsw i32 %315, %316
  %318 = add nsw i32 %314, %317
  %319 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %318)
  %320 = load i32, ptr %19, align 4, !tbaa !9
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %321
  store double %319, ptr %322, align 8, !tbaa !5
  %323 = load i32, ptr %5, align 4, !tbaa !9
  %324 = load i32, ptr %19, align 4, !tbaa !9
  %325 = sub nsw i32 %323, %324
  %326 = load i32, ptr %5, align 4, !tbaa !9
  %327 = load i32, ptr %19, align 4, !tbaa !9
  %328 = sub nsw i32 %326, %327
  %329 = mul nsw i32 %325, %328
  %330 = load i32, ptr %6, align 4, !tbaa !9
  %331 = load i32, ptr %6, align 4, !tbaa !9
  %332 = mul nsw i32 %330, %331
  %333 = add nsw i32 %329, %332
  %334 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %333)
  %335 = load i32, ptr %19, align 4, !tbaa !9
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %336
  store double %334, ptr %337, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %338 = load i32, ptr %19, align 4, !tbaa !9
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %339
  %341 = load double, ptr %340, align 8, !tbaa !5
  %342 = load i32, ptr %19, align 4, !tbaa !9
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %343
  %345 = load double, ptr %344, align 8, !tbaa !5
  %346 = fadd double %341, %345
  %347 = load i32, ptr %19, align 4, !tbaa !9
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %348
  %350 = load double, ptr %349, align 8, !tbaa !5
  %351 = load i32, ptr %19, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %352
  %354 = load double, ptr %353, align 8, !tbaa !5
  %355 = fadd double %350, %354
  %356 = fmul double %346, %355
  store double %356, ptr %20, align 8, !tbaa !5
  %357 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %358 = load double, ptr %357, align 8, !tbaa !5
  store double %358, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %359

359:                                              ; preds = %311
  %360 = load i32, ptr %19, align 4, !tbaa !9
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr %19, align 4, !tbaa !9
  br label %306, !llvm.loop !16

362:                                              ; preds = %310
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %363

363:                                              ; preds = %416, %362
  %364 = load i32, ptr %21, align 4, !tbaa !9
  %365 = load i32, ptr %6, align 4, !tbaa !9
  %366 = icmp sle i32 %364, %365
  br i1 %366, label %368, label %367

367:                                              ; preds = %363
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %419

368:                                              ; preds = %363
  %369 = load i32, ptr %21, align 4, !tbaa !9
  %370 = load i32, ptr %21, align 4, !tbaa !9
  %371 = mul nsw i32 %369, %370
  %372 = load i32, ptr %5, align 4, !tbaa !9
  %373 = load i32, ptr %5, align 4, !tbaa !9
  %374 = mul nsw i32 %372, %373
  %375 = add nsw i32 %371, %374
  %376 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %375)
  %377 = load i32, ptr %21, align 4, !tbaa !9
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %378
  store double %376, ptr %379, align 8, !tbaa !5
  %380 = load i32, ptr %6, align 4, !tbaa !9
  %381 = load i32, ptr %21, align 4, !tbaa !9
  %382 = sub nsw i32 %380, %381
  %383 = load i32, ptr %6, align 4, !tbaa !9
  %384 = load i32, ptr %21, align 4, !tbaa !9
  %385 = sub nsw i32 %383, %384
  %386 = mul nsw i32 %382, %385
  %387 = load i32, ptr %7, align 4, !tbaa !9
  %388 = load i32, ptr %7, align 4, !tbaa !9
  %389 = mul nsw i32 %387, %388
  %390 = add nsw i32 %386, %389
  %391 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %390)
  %392 = load i32, ptr %21, align 4, !tbaa !9
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %393
  store double %391, ptr %394, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %395 = load i32, ptr %21, align 4, !tbaa !9
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %396
  %398 = load double, ptr %397, align 8, !tbaa !5
  %399 = load i32, ptr %21, align 4, !tbaa !9
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %400
  %402 = load double, ptr %401, align 8, !tbaa !5
  %403 = fadd double %398, %402
  %404 = load i32, ptr %21, align 4, !tbaa !9
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds [1000 x double], ptr %8, i64 0, i64 %405
  %407 = load double, ptr %406, align 8, !tbaa !5
  %408 = load i32, ptr %21, align 4, !tbaa !9
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds [1000 x double], ptr %9, i64 0, i64 %409
  %411 = load double, ptr %410, align 8, !tbaa !5
  %412 = fadd double %407, %411
  %413 = fmul double %403, %412
  store double %413, ptr %22, align 8, !tbaa !5
  %414 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %415 = load double, ptr %414, align 8, !tbaa !5
  store double %415, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %416

416:                                              ; preds = %368
  %417 = load i32, ptr %21, align 4, !tbaa !9
  %418 = add nsw i32 %417, 1
  store i32 %418, ptr %21, align 4, !tbaa !9
  br label %363, !llvm.loop !17

419:                                              ; preds = %367
  br label %420

420:                                              ; preds = %419, %304
  br label %421

421:                                              ; preds = %420, %185
  %422 = load double, ptr %10, align 8, !tbaa !5
  %423 = fptosi double %422 to i32
  %424 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %423)
  %425 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %424, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %426

426:                                              ; preds = %421, %57
  br label %427

427:                                              ; preds = %426, %44
  br label %428

428:                                              ; preds = %427, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8000, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8000, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

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

attributes #0 = { mustprogress norecurse 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: write) }
attributes #3 = { "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"="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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store double 0x4202A05F1FF80000, ptr %7, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 0
  %22 = load i32, ptr %5, align 4, !tbaa !9
  br i1 %21, label %23, label %28

23:                                               ; preds = %0
  %24 = mul nsw i32 %22, %22
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = mul nsw i32 %25, %25
  %27 = add nuw nsw i32 %26, %24
  br label %164

28:                                               ; preds = %0
  %29 = icmp eq i32 %22, 0
  br i1 %29, label %30, label %35

30:                                               ; preds = %28
  %31 = mul nsw i32 %20, %20
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = mul nsw i32 %32, %32
  %34 = add nuw nsw i32 %33, %31
  br label %164

35:                                               ; preds = %28
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %42

38:                                               ; preds = %35
  %39 = mul nsw i32 %20, %20
  %40 = mul nsw i32 %22, %22
  %41 = add nuw nsw i32 %40, %39
  br label %164

42:                                               ; preds = %35
  %43 = load i32, ptr %1, align 4, !tbaa !9
  %44 = icmp eq i32 %43, %20
  br i1 %44, label %.preheader84, label %83

.preheader84:                                     ; preds = %42
  %.not82102 = icmp slt i32 %36, 0
  br i1 %.not82102, label %.preheader, label %.lr.ph104

.preheader.loopexit:                              ; preds = %.lr.ph104
  %.pre111 = load i32, ptr %5, align 4, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader84
  %45 = phi double [ %62, %.preheader.loopexit ], [ 0x4202A05F1FF80000, %.preheader84 ]
  %46 = phi i32 [ %.pre111, %.preheader.loopexit ], [ %22, %.preheader84 ]
  %.not83105 = icmp slt i32 %46, 0
  br i1 %.not83105, label %.loopexit, label %.lr.ph107

.lr.ph104:                                        ; preds = %.preheader84, %.lr.ph104
  %.076103 = phi i32 [ %63, %.lr.ph104 ], [ 0, %.preheader84 ]
  %47 = mul nuw nsw i32 %.076103, %.076103
  %48 = load i32, ptr %4, align 4, !tbaa !9
  %49 = mul nsw i32 %48, %48
  %50 = add nuw nsw i32 %49, %47
  %51 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %50)
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = sub nsw i32 %52, %.076103
  %54 = mul nsw i32 %53, %53
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = mul nsw i32 %55, %55
  %57 = add nuw nsw i32 %54, %56
  %58 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %57)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %59 = fadd double %51, %58
  %60 = fmul double %59, %59
  store double %60, ptr %8, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %62 = load double, ptr %61, align 8, !tbaa !5
  store double %62, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %63 = add nuw nsw i32 %.076103, 1
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %.not82.not = icmp slt i32 %.076103, %64
  br i1 %.not82.not, label %.lr.ph104, label %.preheader.loopexit, !llvm.loop !11

.lr.ph107:                                        ; preds = %.preheader, %.lr.ph107
  %.075106 = phi i32 [ %81, %.lr.ph107 ], [ 0, %.preheader ]
  %65 = mul nuw nsw i32 %.075106, %.075106
  %66 = load i32, ptr %4, align 4, !tbaa !9
  %67 = mul nsw i32 %66, %66
  %68 = add nuw nsw i32 %67, %65
  %69 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %68)
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = sub nsw i32 %70, %.075106
  %72 = mul nsw i32 %71, %71
  %73 = load i32, ptr %6, align 4, !tbaa !9
  %74 = mul nsw i32 %73, %73
  %75 = add nuw nsw i32 %72, %74
  %76 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %75)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %77 = fadd double %69, %76
  %78 = fmul double %77, %77
  store double %78, ptr %9, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %80 = load double, ptr %79, align 8, !tbaa !5
  store double %80, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %81 = add nuw nsw i32 %.075106, 1
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %.not83.not = icmp slt i32 %.075106, %82
  br i1 %.not83.not, label %.lr.ph107, label %.loopexit, !llvm.loop !13

83:                                               ; preds = %42
  %84 = load i32, ptr %2, align 4, !tbaa !9
  %85 = icmp eq i32 %84, %22
  br i1 %85, label %.preheader87, label %.preheader90

.preheader90:                                     ; preds = %83
  %.not91 = icmp slt i32 %20, 0
  br i1 %.not91, label %.preheader88, label %.lr.ph

.preheader87:                                     ; preds = %83
  %.not8096 = icmp slt i32 %36, 0
  br i1 %.not8096, label %.preheader85, label %.lr.ph98

.preheader85.loopexit:                            ; preds = %.lr.ph98
  %.pre110 = load i32, ptr %4, align 4, !tbaa !9
  br label %.preheader85

.preheader85:                                     ; preds = %.preheader85.loopexit, %.preheader87
  %86 = phi double [ %103, %.preheader85.loopexit ], [ 0x4202A05F1FF80000, %.preheader87 ]
  %87 = phi i32 [ %.pre110, %.preheader85.loopexit ], [ %20, %.preheader87 ]
  %.not8199 = icmp slt i32 %87, 0
  br i1 %.not8199, label %.loopexit, label %.lr.ph101

.lr.ph98:                                         ; preds = %.preheader87, %.lr.ph98
  %.07497 = phi i32 [ %104, %.lr.ph98 ], [ 0, %.preheader87 ]
  %88 = mul nuw nsw i32 %.07497, %.07497
  %89 = load i32, ptr %5, align 4, !tbaa !9
  %90 = mul nsw i32 %89, %89
  %91 = add nuw nsw i32 %90, %88
  %92 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %91)
  %93 = load i32, ptr %6, align 4, !tbaa !9
  %94 = sub nsw i32 %93, %.07497
  %95 = mul nsw i32 %94, %94
  %96 = load i32, ptr %4, align 4, !tbaa !9
  %97 = mul nsw i32 %96, %96
  %98 = add nuw nsw i32 %95, %97
  %99 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %98)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %100 = fadd double %92, %99
  %101 = fmul double %100, %100
  store double %101, ptr %10, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %103 = load double, ptr %102, align 8, !tbaa !5
  store double %103, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  %104 = add nuw nsw i32 %.07497, 1
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %.not80.not = icmp slt i32 %.07497, %105
  br i1 %.not80.not, label %.lr.ph98, label %.preheader85.loopexit, !llvm.loop !14

.lr.ph101:                                        ; preds = %.preheader85, %.lr.ph101
  %.073100 = phi i32 [ %122, %.lr.ph101 ], [ 0, %.preheader85 ]
  %106 = mul nuw nsw i32 %.073100, %.073100
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = mul nsw i32 %107, %107
  %109 = add nuw nsw i32 %108, %106
  %110 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %109)
  %111 = load i32, ptr %4, align 4, !tbaa !9
  %112 = sub nsw i32 %111, %.073100
  %113 = mul nsw i32 %112, %112
  %114 = load i32, ptr %5, align 4, !tbaa !9
  %115 = mul nsw i32 %114, %114
  %116 = add nuw nsw i32 %113, %115
  %117 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %116)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %118 = fadd double %110, %117
  %119 = fmul double %118, %118
  store double %119, ptr %11, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %121 = load double, ptr %120, align 8, !tbaa !5
  store double %121, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  %122 = add nuw nsw i32 %.073100, 1
  %123 = load i32, ptr %4, align 4, !tbaa !9
  %.not81.not = icmp slt i32 %.073100, %123
  br i1 %.not81.not, label %.lr.ph101, label %.loopexit, !llvm.loop !15

.preheader88.loopexit:                            ; preds = %.lr.ph
  %.pre = load i32, ptr %5, align 4, !tbaa !9
  br label %.preheader88

.preheader88:                                     ; preds = %.preheader88.loopexit, %.preheader90
  %124 = phi double [ %141, %.preheader88.loopexit ], [ 0x4202A05F1FF80000, %.preheader90 ]
  %125 = phi i32 [ %.pre, %.preheader88.loopexit ], [ %22, %.preheader90 ]
  %.not7993 = icmp slt i32 %125, 0
  br i1 %.not7993, label %.loopexit, label %.lr.ph95

.lr.ph:                                           ; preds = %.preheader90, %.lr.ph
  %.07292 = phi i32 [ %142, %.lr.ph ], [ 0, %.preheader90 ]
  %126 = mul nuw nsw i32 %.07292, %.07292
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = mul nsw i32 %127, %127
  %129 = add nuw nsw i32 %128, %126
  %130 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %129)
  %131 = load i32, ptr %4, align 4, !tbaa !9
  %132 = sub nsw i32 %131, %.07292
  %133 = mul nsw i32 %132, %132
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = mul nsw i32 %134, %134
  %136 = add nuw nsw i32 %133, %135
  %137 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %136)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %138 = fadd double %130, %137
  %139 = fmul double %138, %138
  store double %139, ptr %12, align 8, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %141 = load double, ptr %140, align 8, !tbaa !5
  store double %141, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %142 = add nuw nsw i32 %.07292, 1
  %143 = load i32, ptr %4, align 4, !tbaa !9
  %.not.not = icmp slt i32 %.07292, %143
  br i1 %.not.not, label %.lr.ph, label %.preheader88.loopexit, !llvm.loop !16

.lr.ph95:                                         ; preds = %.preheader88, %.lr.ph95
  %.094 = phi i32 [ %160, %.lr.ph95 ], [ 0, %.preheader88 ]
  %144 = mul nuw nsw i32 %.094, %.094
  %145 = load i32, ptr %4, align 4, !tbaa !9
  %146 = mul nsw i32 %145, %145
  %147 = add nuw nsw i32 %146, %144
  %148 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %147)
  %149 = load i32, ptr %5, align 4, !tbaa !9
  %150 = sub nsw i32 %149, %.094
  %151 = mul nsw i32 %150, %150
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = mul nsw i32 %152, %152
  %154 = add nuw nsw i32 %151, %153
  %155 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %154)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %156 = fadd double %148, %155
  %157 = fmul double %156, %156
  store double %157, ptr %13, align 8, !tbaa !5
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %159 = load double, ptr %158, align 8, !tbaa !5
  store double %159, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  %160 = add nuw nsw i32 %.094, 1
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %.not79.not = icmp slt i32 %.094, %161
  br i1 %.not79.not, label %.lr.ph95, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %.lr.ph95, %.lr.ph101, %.lr.ph107, %.preheader88, %.preheader85, %.preheader
  %162 = phi double [ %124, %.preheader88 ], [ %86, %.preheader85 ], [ %45, %.preheader ], [ %80, %.lr.ph107 ], [ %121, %.lr.ph101 ], [ %159, %.lr.ph95 ]
  %163 = fptosi double %162 to i32
  br label %164

164:                                              ; preds = %30, %.loopexit, %38, %23
  %.sink119 = phi i32 [ %34, %30 ], [ %163, %.loopexit ], [ %41, %38 ], [ %27, %23 ]
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink119)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

attributes #0 = { mustprogress norecurse 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 = { "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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass