; LLVM IR from VastoLorde95/Competitive-Programming :: Timus/1342 (A)

; 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" }
%"struct.std::_Setprecision" = type { i32 }

@pos = external dso_local global [2 x [1010 x i32]], align 16
@dp = external dso_local global [2 x [1010 x double]], align 16
@k = external dso_local global [1010 x i32], align 16
@p = external dso_local global [1010 x double], align 16
@q = external dso_local global [1010 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z8get_costiddd(i32 noundef, double noundef, double noundef, double noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 double, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Setprecision", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %29 = 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)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %31

31:                                               ; preds = %55, %0
  %32 = load i32, ptr %5, align 4, !tbaa !8
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %58

36:                                               ; preds = %31
  %37 = load i32, ptr %5, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %39)
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %45 = load i32, ptr %5, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1010 x double], ptr @q, i64 0, i64 %46
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(8) %47)
  %49 = load i32, ptr %5, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = add nsw i32 %53, %52
  store i32 %54, ptr %4, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %36
  %56 = load i32, ptr %5, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %5, align 4, !tbaa !8
  br label %31, !llvm.loop !11

58:                                               ; preds = %35
  %59 = load i32, ptr %4, align 4, !tbaa !8
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %107

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 0.000000e+00, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %63

63:                                               ; preds = %89, %62
  %64 = load i32, ptr %7, align 4, !tbaa !8
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %92

68:                                               ; preds = %63
  %69 = load i32, ptr %7, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = load i32, ptr %7, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !8
  %77 = sitofp i32 %76 to double
  %78 = load i32, ptr %7, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !13
  %82 = load i32, ptr %7, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1010 x double], ptr @q, i64 0, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !13
  %86 = call noundef double @_Z8get_costiddd(i32 noundef %72, double noundef %77, double noundef %81, double noundef %85)
  %87 = load double, ptr %6, align 8, !tbaa !13
  %88 = fadd double %87, %86
  store double %88, ptr %6, align 8, !tbaa !13
  br label %89

89:                                               ; preds = %68
  %90 = load i32, ptr %7, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %7, align 4, !tbaa !8
  br label %63, !llvm.loop !15

92:                                               ; preds = %67
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %94 = load i32, ptr %4, align 4, !tbaa !8
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %93, i32 noundef %94)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %98 = call i32 @_ZSt12setprecisioni(i32 noundef 2)
  %99 = getelementptr inbounds %"struct.std::_Setprecision", ptr %8, i32 0, i32 0
  store i32 %98, ptr %99, align 4
  %100 = getelementptr inbounds %"struct.std::_Setprecision", ptr %8, i32 0, i32 0
  %101 = load i32, ptr %100, align 4
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %97, i32 %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.1)
  %104 = load double, ptr %6, align 8, !tbaa !13
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %103, double noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %244

107:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %108

108:                                              ; preds = %141, %107
  %109 = load i32, ptr %10, align 4, !tbaa !8
  %110 = icmp slt i32 %109, 2
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %144

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %113

113:                                              ; preds = %133, %112
  %114 = load i32, ptr %11, align 4, !tbaa !8
  %115 = load i32, ptr %3, align 4, !tbaa !8
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %136

118:                                              ; preds = %113
  %119 = load i32, ptr %10, align 4, !tbaa !8
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %120
  %122 = load i32, ptr %11, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1010 x double], ptr %121, i64 0, i64 %123
  store double 1.000000e+09, ptr %124, align 8, !tbaa !13
  %125 = load i32, ptr %3, align 4, !tbaa !8
  %126 = add nsw i32 %125, 1
  %127 = load i32, ptr %10, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %128
  %130 = load i32, ptr %11, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1010 x i32], ptr %129, i64 0, i64 %131
  store i32 %126, ptr %132, align 4, !tbaa !8
  br label %133

133:                                              ; preds = %118
  %134 = load i32, ptr %11, align 4, !tbaa !8
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %11, align 4, !tbaa !8
  br label %113, !llvm.loop !16

136:                                              ; preds = %117
  %137 = load i32, ptr %10, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %138
  %140 = getelementptr inbounds [1010 x double], ptr %139, i64 0, i64 0
  store double 0.000000e+00, ptr %140, align 16, !tbaa !13
  br label %141

141:                                              ; preds = %136
  %142 = load i32, ptr %10, align 4, !tbaa !8
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %10, align 4, !tbaa !8
  br label %108, !llvm.loop !17

144:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !8
  br label %145

145:                                              ; preds = %163, %144
  %146 = load i32, ptr %12, align 4, !tbaa !8
  %147 = load i32, ptr getelementptr inbounds ([1010 x i32], ptr @k, i64 0, i64 1), align 4, !tbaa !8
  %148 = icmp sle i32 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %166

150:                                              ; preds = %145
  %151 = load i32, ptr %12, align 4, !tbaa !8
  %152 = load i32, ptr getelementptr inbounds ([1010 x i32], ptr @k, i64 0, i64 1), align 4, !tbaa !8
  %153 = sitofp i32 %152 to double
  %154 = load double, ptr getelementptr inbounds ([1010 x double], ptr @p, i64 0, i64 1), align 8, !tbaa !13
  %155 = load double, ptr getelementptr inbounds ([1010 x double], ptr @q, i64 0, i64 1), align 8, !tbaa !13
  %156 = call noundef double @_Z8get_costiddd(i32 noundef %151, double noundef %153, double noundef %154, double noundef %155)
  %157 = load i32, ptr %12, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [1010 x double], ptr @dp, i64 0, i64 %158
  store double %156, ptr %159, align 8, !tbaa !13
  %160 = load i32, ptr %12, align 4, !tbaa !8
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1010 x i32], ptr @pos, i64 0, i64 %161
  store i32 0, ptr %162, align 4, !tbaa !8
  br label %163

163:                                              ; preds = %150
  %164 = load i32, ptr %12, align 4, !tbaa !8
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %12, align 4, !tbaa !8
  br label %145, !llvm.loop !18

166:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %167 = load i32, ptr getelementptr inbounds ([1010 x i32], ptr @k, i64 0, i64 1), align 4, !tbaa !8
  store i32 %167, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 2, ptr %15, align 4, !tbaa !8
  br label %168

168:                                              ; preds = %224, %166
  %169 = load i32, ptr %15, align 4, !tbaa !8
  %170 = load i32, ptr %2, align 4, !tbaa !8
  %171 = icmp sle i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %227

173:                                              ; preds = %168
  %174 = load i32, ptr %14, align 4, !tbaa !8
  %175 = xor i32 %174, 1
  store i32 %175, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !8
  br label %176

176:                                              ; preds = %210, %173
  %177 = load i32, ptr %16, align 4, !tbaa !8
  %178 = load i32, ptr %3, align 4, !tbaa !8
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %213

181:                                              ; preds = %176
  %182 = load i32, ptr %14, align 4, !tbaa !8
  %183 = xor i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %184
  %186 = load i32, ptr %16, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1010 x double], ptr %185, i64 0, i64 %187
  %189 = load double, ptr %188, align 8, !tbaa !13
  %190 = load i32, ptr %14, align 4, !tbaa !8
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %191
  %193 = load i32, ptr %16, align 4, !tbaa !8
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [1010 x double], ptr %192, i64 0, i64 %194
  store double %189, ptr %195, align 8, !tbaa !13
  %196 = load i32, ptr %14, align 4, !tbaa !8
  %197 = xor i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %198
  %200 = load i32, ptr %16, align 4, !tbaa !8
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [1010 x i32], ptr %199, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !8
  %204 = load i32, ptr %14, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %205
  %207 = load i32, ptr %16, align 4, !tbaa !8
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [1010 x i32], ptr %206, i64 0, i64 %208
  store i32 %203, ptr %209, align 4, !tbaa !8
  br label %210

210:                                              ; preds = %181
  %211 = load i32, ptr %16, align 4, !tbaa !8
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %16, align 4, !tbaa !8
  br label %176, !llvm.loop !19

213:                                              ; preds = %180
  %214 = load i32, ptr %14, align 4, !tbaa !8
  %215 = load i32, ptr %15, align 4, !tbaa !8
  %216 = load i32, ptr %3, align 4, !tbaa !8
  %217 = load i32, ptr %3, align 4, !tbaa !8
  call void @_Z5solveiiiiii(i32 noundef %214, i32 noundef %215, i32 noundef 1, i32 noundef %216, i32 noundef 1, i32 noundef %217)
  %218 = load i32, ptr %15, align 4, !tbaa !8
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !8
  %222 = load i32, ptr %13, align 4, !tbaa !8
  %223 = add nsw i32 %222, %221
  store i32 %223, ptr %13, align 4, !tbaa !8
  br label %224

224:                                              ; preds = %213
  %225 = load i32, ptr %15, align 4, !tbaa !8
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %15, align 4, !tbaa !8
  br label %168, !llvm.loop !20

227:                                              ; preds = %172
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %229 = call i32 @_ZSt12setprecisioni(i32 noundef 2)
  %230 = getelementptr inbounds %"struct.std::_Setprecision", ptr %17, i32 0, i32 0
  store i32 %229, ptr %230, align 4
  %231 = getelementptr inbounds %"struct.std::_Setprecision", ptr %17, i32 0, i32 0
  %232 = load i32, ptr %231, align 4
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %228, i32 %232)
  %234 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %233, ptr noundef @.str.1)
  %235 = load i32, ptr %14, align 4, !tbaa !8
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %236
  %238 = load i32, ptr %3, align 4, !tbaa !8
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [1010 x double], ptr %237, i64 0, i64 %239
  %241 = load double, ptr %240, align 8, !tbaa !13
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %234, double noundef %241)
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %242, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %244

244:                                              ; preds = %227, %92
  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
  %245 = load i32, ptr %1, align 4
  ret i32 %245
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #5

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #1 align 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 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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" }

@pos = external dso_local local_unnamed_addr global [2 x [1010 x i32]], align 16
@dp = external dso_local local_unnamed_addr global [2 x [1010 x double]], align 16
@k = external dso_local global [1010 x i32], align 16
@p = external dso_local global [1010 x double], align 16
@q = external dso_local global [1010 x double], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z8get_costiddd(i32 noundef, double noundef, double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %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 = load i32, ptr %1, align 4, !tbaa !8
  %.not71 = icmp slt i32 %16, 1
  br i1 %.not71, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %17 = phi i32 [ %16, %0 ], [ %35, %.lr.ph ]
  %.057.lcssa = phi i32 [ 0, %0 ], [ %34, %.lr.ph ]
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = icmp slt i32 %.057.lcssa, %18
  br i1 %19, label %.preheader, label %.preheader70

.preheader70:                                     ; preds = %._crit_edge
  %.not6574 = icmp slt i32 %18, 1
  %20 = add i32 %18, 1
  br i1 %.not6574, label %.preheader69.us.preheader, label %.preheader69.preheader

.preheader69.preheader:                           ; preds = %.preheader70
  %wide.trip.count = zext i32 %20 to i64
  %21 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %20, 5
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader69.preheader
  %indvars.iv104.ph = phi i64 [ 1, %.preheader69.preheader ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader69.preheader
  %n.vec = and i64 %21, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %20, i64 0
  %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %22 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 0, i64 %offset.idx
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x double> <double 1.000000e+09, double 1.000000e+09>, ptr %22, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+09, double 1.000000e+09>, ptr %23, align 8, !tbaa !11
  %24 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 0, i64 %offset.idx
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  store <2 x i32> %broadcast.splat, ptr %24, align 4, !tbaa !8
  store <2 x i32> %broadcast.splat, ptr %25, align 4, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %21, %n.vec
  br i1 %cmp.n, label %._crit_edge77, label %scalar.ph.preheader

.preheader69.us.preheader:                        ; preds = %.preheader70
  store double 0.000000e+00, ptr @dp, align 16, !tbaa !11
  br label %.preheader68

.preheader:                                       ; preds = %._crit_edge
  %.not6694 = icmp slt i32 %17, 1
  br i1 %.not6694, label %._crit_edge98, label %.lr.ph97

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %.05773 = phi i32 [ %34, %.lr.ph ], [ 0, %0 ]
  %27 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %29 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %indvars.iv
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = getelementptr inbounds [1010 x double], ptr @q, i64 0, i64 %indvars.iv
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERd(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i32, ptr %27, align 4, !tbaa !8
  %34 = add nsw i32 %33, %.05773
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %1, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %.not.not = icmp slt i64 %indvars.iv, %36
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge98:                                    ; preds = %.lr.ph97, %.preheader
  %.059.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %53, %.lr.ph97 ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %37, i32 noundef %.057.lcssa)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %41 = call i32 @_ZSt12setprecisioni(i32 noundef 2)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %40, i32 %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @.str.1)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %43, double noundef %.059.lcssa)
  br label %130

.lr.ph97:                                         ; preds = %.preheader, %.lr.ph97
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %.lr.ph97 ], [ 1, %.preheader ]
  %.05995 = phi double [ %53, %.lr.ph97 ], [ 0.000000e+00, %.preheader ]
  %45 = getelementptr inbounds [1010 x i32], ptr @k, i64 0, i64 %indvars.iv123
  %46 = load i32, ptr %45, align 4, !tbaa !8
  %47 = sitofp i32 %46 to double
  %48 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %indvars.iv123
  %49 = load double, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds [1010 x double], ptr @q, i64 0, i64 %indvars.iv123
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = call noundef double @_Z8get_costiddd(i32 noundef %46, double noundef %47, double noundef %49, double noundef %51)
  %53 = fadd double %.05995, %52
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %54 = load i32, ptr %1, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %.not66.not = icmp slt i64 %indvars.iv123, %55
  br i1 %.not66.not, label %.lr.ph97, label %._crit_edge98, !llvm.loop !18

.preheader68:                                     ; preds = %scalar.ph133, %middle.block132, %.preheader69.us.preheader
  store double 0.000000e+00, ptr getelementptr inbounds (i8, ptr @dp, i64 8080), align 16, !tbaa !11
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @k, i64 4), align 4, !tbaa !8
  %.not6279 = icmp slt i32 %56, 1
  br i1 %.not6279, label %.preheader67, label %.lr.ph81

._crit_edge77:                                    ; preds = %scalar.ph, %middle.block
  store double 0.000000e+00, ptr @dp, align 16, !tbaa !11
  %57 = add nsw i64 %wide.trip.count, -1
  %min.iters.check134 = icmp ult i32 %20, 5
  br i1 %min.iters.check134, label %scalar.ph133.preheader, label %vector.ph135

vector.ph135:                                     ; preds = %._crit_edge77
  %n.vec137 = and i64 %57, -4
  %ind.end138 = or disjoint i64 %n.vec137, 1
  %broadcast.splatinsert143 = insertelement <2 x i32> poison, i32 %20, i64 0
  %broadcast.splat144 = shufflevector <2 x i32> %broadcast.splatinsert143, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body140

vector.body140:                                   ; preds = %vector.body140, %vector.ph135
  %index141 = phi i64 [ 0, %vector.ph135 ], [ %index.next145, %vector.body140 ]
  %offset.idx142 = or disjoint i64 %index141, 1
  %58 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 1, i64 %offset.idx142
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <2 x double> <double 1.000000e+09, double 1.000000e+09>, ptr %58, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+09, double 1.000000e+09>, ptr %59, align 8, !tbaa !11
  %60 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 1, i64 %offset.idx142
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  store <2 x i32> %broadcast.splat144, ptr %60, align 4, !tbaa !8
  store <2 x i32> %broadcast.splat144, ptr %61, align 4, !tbaa !8
  %index.next145 = add nuw i64 %index141, 4
  %62 = icmp eq i64 %index.next145, %n.vec137
  br i1 %62, label %middle.block132, label %vector.body140, !llvm.loop !19

middle.block132:                                  ; preds = %vector.body140
  %cmp.n146 = icmp eq i64 %57, %n.vec137
  br i1 %cmp.n146, label %.preheader68, label %scalar.ph133.preheader

scalar.ph133.preheader:                           ; preds = %middle.block132, %._crit_edge77
  %indvars.iv104.1.ph = phi i64 [ 1, %._crit_edge77 ], [ %ind.end138, %middle.block132 ]
  br label %scalar.ph133

scalar.ph133:                                     ; preds = %scalar.ph133.preheader, %scalar.ph133
  %indvars.iv104.1 = phi i64 [ %indvars.iv.next105.1, %scalar.ph133 ], [ %indvars.iv104.1.ph, %scalar.ph133.preheader ]
  %63 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 1, i64 %indvars.iv104.1
  store double 1.000000e+09, ptr %63, align 8, !tbaa !11
  %64 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 1, i64 %indvars.iv104.1
  store i32 %20, ptr %64, align 4, !tbaa !8
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next105.1, %wide.trip.count
  br i1 %exitcond.1.not, label %.preheader68, label %scalar.ph133, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %scalar.ph ], [ %indvars.iv104.ph, %scalar.ph.preheader ]
  %65 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 0, i64 %indvars.iv104
  store double 1.000000e+09, ptr %65, align 8, !tbaa !11
  %66 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 0, i64 %indvars.iv104
  store i32 %20, ptr %66, align 4, !tbaa !8
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge77, label %scalar.ph, !llvm.loop !21

.preheader67.loopexit:                            ; preds = %.lr.ph81
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %.preheader67

.preheader67:                                     ; preds = %.preheader67.loopexit, %.preheader68
  %67 = phi i32 [ %.pre, %.preheader67.loopexit ], [ %17, %.preheader68 ]
  %.not6388 = icmp slt i32 %67, 2
  br i1 %.not6388, label %._crit_edge92, label %.lr.ph91

.lr.ph81:                                         ; preds = %.preheader68, %.lr.ph81
  %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.lr.ph81 ], [ 1, %.preheader68 ]
  %68 = phi i32 [ %76, %.lr.ph81 ], [ %56, %.preheader68 ]
  %69 = sitofp i32 %68 to double
  %70 = load double, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !11
  %71 = load double, ptr getelementptr inbounds (i8, ptr @q, i64 8), align 8, !tbaa !11
  %72 = trunc nuw nsw i64 %indvars.iv113 to i32
  %73 = call noundef double @_Z8get_costiddd(i32 noundef %72, double noundef %69, double noundef %70, double noundef %71)
  %74 = getelementptr inbounds [1010 x double], ptr @dp, i64 0, i64 %indvars.iv113
  store double %73, ptr %74, align 8, !tbaa !11
  %75 = getelementptr inbounds [1010 x i32], ptr @pos, i64 0, i64 %indvars.iv113
  store i32 0, ptr %75, align 4, !tbaa !8
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @k, i64 4), align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %.not62.not = icmp slt i64 %indvars.iv113, %77
  br i1 %.not62.not, label %.lr.ph81, label %.preheader67.loopexit, !llvm.loop !22

._crit_edge92.loopexit:                           ; preds = %._crit_edge86
  %78 = zext nneg i32 %88 to i64
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit, %.preheader67
  %.052.lcssa = phi i64 [ 0, %.preheader67 ], [ %78, %._crit_edge92.loopexit ]
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %80 = call i32 @_ZSt12setprecisioni(i32 noundef 2)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %79, i32 %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str.1)
  %83 = load i32, ptr %2, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %.052.lcssa, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %82, double noundef %86)
  br label %130

.lr.ph91:                                         ; preds = %.preheader67, %._crit_edge86
  %.05190 = phi i32 [ %116, %._crit_edge86 ], [ 2, %.preheader67 ]
  %.05289 = phi i32 [ %88, %._crit_edge86 ], [ 0, %.preheader67 ]
  %88 = xor i32 %.05289, 1
  %89 = load i32, ptr %2, align 4, !tbaa !8
  %.not6482 = icmp slt i32 %89, 1
  br i1 %.not6482, label %._crit_edge86, label %.lr.ph85

.lr.ph85:                                         ; preds = %.lr.ph91
  %90 = zext nneg i32 %.05289 to i64
  %91 = zext nneg i32 %88 to i64
  %92 = add nuw i32 %89, 1
  %wide.trip.count121 = zext i32 %92 to i64
  %93 = zext nneg i32 %89 to i64
  %min.iters.check150 = icmp ult i32 %89, 10
  br i1 %min.iters.check150, label %scalar.ph149.preheader, label %vector.memcheck

scalar.ph149.preheader:                           ; preds = %middle.block148, %vector.memcheck, %.lr.ph85
  %indvars.iv118.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %.lr.ph85 ], [ %ind.end154, %middle.block148 ]
  %94 = zext nneg i32 %89 to i64
  %95 = and i32 %89, 1
  %lcmp.mod.not = icmp eq i32 %95, 0
  br i1 %lcmp.mod.not, label %scalar.ph149.prol.loopexit, label %scalar.ph149.prol

scalar.ph149.prol:                                ; preds = %scalar.ph149.preheader
  %96 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %90, i64 %indvars.iv118.ph
  %97 = load double, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %91, i64 %indvars.iv118.ph
  store double %97, ptr %98, align 8, !tbaa !11
  %99 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %90, i64 %indvars.iv118.ph
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %91, i64 %indvars.iv118.ph
  store i32 %100, ptr %101, align 4, !tbaa !8
  %indvars.iv.next119.prol = add nuw nsw i64 %indvars.iv118.ph, 1
  br label %scalar.ph149.prol.loopexit

scalar.ph149.prol.loopexit:                       ; preds = %scalar.ph149.prol, %scalar.ph149.preheader
  %indvars.iv118.unr = phi i64 [ %indvars.iv118.ph, %scalar.ph149.preheader ], [ %indvars.iv.next119.prol, %scalar.ph149.prol ]
  %102 = icmp eq i64 %indvars.iv118.ph, %94
  br i1 %102, label %._crit_edge86, label %scalar.ph149

vector.memcheck:                                  ; preds = %.lr.ph85
  %103 = mul nuw nsw i64 %91, 8080
  %.neg = mul nsw i64 %90, -8080
  %104 = add nsw i64 %.neg, %103
  %diff.check = icmp ult i64 %104, 32
  %105 = mul nuw nsw i64 %91, 4040
  %.neg164 = mul nsw i64 %90, -4040
  %106 = add nsw i64 %.neg164, %105
  %diff.check147 = icmp ult i64 %106, 16
  %conflict.rdx = or i1 %diff.check, %diff.check147
  br i1 %conflict.rdx, label %scalar.ph149.preheader, label %vector.ph151

vector.ph151:                                     ; preds = %vector.memcheck
  %n.vec153 = and i64 %93, 2147483644
  %ind.end154 = or disjoint i64 %n.vec153, 1
  br label %vector.body156

vector.body156:                                   ; preds = %vector.body156, %vector.ph151
  %index157 = phi i64 [ 0, %vector.ph151 ], [ %index.next162, %vector.body156 ]
  %offset.idx158 = or disjoint i64 %index157, 1
  %107 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %90, i64 %offset.idx158
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  %wide.load = load <2 x double>, ptr %107, align 8, !tbaa !11
  %wide.load159 = load <2 x double>, ptr %108, align 8, !tbaa !11
  %109 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %91, i64 %offset.idx158
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  store <2 x double> %wide.load, ptr %109, align 8, !tbaa !11
  store <2 x double> %wide.load159, ptr %110, align 8, !tbaa !11
  %111 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %90, i64 %offset.idx158
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  %wide.load160 = load <2 x i32>, ptr %111, align 4, !tbaa !8
  %wide.load161 = load <2 x i32>, ptr %112, align 4, !tbaa !8
  %113 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %91, i64 %offset.idx158
  %114 = getelementptr inbounds i8, ptr %113, i64 8
  store <2 x i32> %wide.load160, ptr %113, align 4, !tbaa !8
  store <2 x i32> %wide.load161, ptr %114, align 4, !tbaa !8
  %index.next162 = add nuw i64 %index157, 4
  %115 = icmp eq i64 %index.next162, %n.vec153
  br i1 %115, label %middle.block148, label %vector.body156, !llvm.loop !23

middle.block148:                                  ; preds = %vector.body156
  %cmp.n163 = icmp eq i64 %n.vec153, %93
  br i1 %cmp.n163, label %._crit_edge86, label %scalar.ph149.preheader

._crit_edge86:                                    ; preds = %scalar.ph149.prol.loopexit, %scalar.ph149, %middle.block148, %.lr.ph91
  call void @_Z5solveiiiiii(i32 noundef %88, i32 noundef %.05190, i32 noundef 1, i32 noundef %89, i32 noundef 1, i32 noundef %89)
  %116 = add nuw nsw i32 %.05190, 1
  %117 = load i32, ptr %1, align 4, !tbaa !8
  %.not63.not = icmp slt i32 %.05190, %117
  br i1 %.not63.not, label %.lr.ph91, label %._crit_edge92.loopexit, !llvm.loop !24

scalar.ph149:                                     ; preds = %scalar.ph149.prol.loopexit, %scalar.ph149
  %indvars.iv118 = phi i64 [ %indvars.iv.next119.1, %scalar.ph149 ], [ %indvars.iv118.unr, %scalar.ph149.prol.loopexit ]
  %118 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %90, i64 %indvars.iv118
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %91, i64 %indvars.iv118
  store double %119, ptr %120, align 8, !tbaa !11
  %121 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %90, i64 %indvars.iv118
  %122 = load i32, ptr %121, align 4, !tbaa !8
  %123 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %91, i64 %indvars.iv118
  store i32 %122, ptr %123, align 4, !tbaa !8
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %124 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %90, i64 %indvars.iv.next119
  %125 = load double, ptr %124, align 8, !tbaa !11
  %126 = getelementptr inbounds [2 x [1010 x double]], ptr @dp, i64 0, i64 %91, i64 %indvars.iv.next119
  store double %125, ptr %126, align 8, !tbaa !11
  %127 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %90, i64 %indvars.iv.next119
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = getelementptr inbounds [2 x [1010 x i32]], ptr @pos, i64 0, i64 %91, i64 %indvars.iv.next119
  store i32 %128, ptr %129, align 4, !tbaa !8
  %indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
  %exitcond122.not.1 = icmp eq i64 %indvars.iv.next119.1, %wide.trip.count121
  br i1 %exitcond122.not.1, label %._crit_edge86, label %scalar.ph149, !llvm.loop !25

130:                                              ; preds = %._crit_edge92, %._crit_edge98
  %.sink = phi ptr [ %87, %._crit_edge92 ], [ %44, %._crit_edge98 ]
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 2

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 #4

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

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

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

; 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 #1 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #1 align 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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !10, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !15, !16}
!20 = distinct !{!20, !14, !16, !15}
!21 = distinct !{!21, !14, !16, !15}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14, !15, !16}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass