; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/Rockethon 2015/Problem C (C)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@l = external dso_local global [5 x i32], align 16
@r = external dso_local global [5 x i32], align 16
@mx = external dso_local global i32, align 4
@ans = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %35, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25, ptr noundef %28)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %31
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr @mx, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %22
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

38:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %326, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr @mx, align 4, !tbaa !5
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %329

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %322, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = shl i32 1, %47
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %325

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %70, %51
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %73

57:                                               ; preds = %52
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = shl i32 1, %59
  %61 = and i32 %58, %60
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %63, label %69

63:                                               ; preds = %57
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %64 unwind label %65

64:                                               ; preds = %63
  br label %69

65:                                               ; preds = %63
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %8, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %332

69:                                               ; preds = %64, %57
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %7, align 4, !tbaa !5
  br label %52, !llvm.loop !11

73:                                               ; preds = %56
  %74 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %75 = icmp ult i64 %74, 2
  br i1 %75, label %76, label %77

76:                                               ; preds = %73
  store i32 10, ptr %4, align 4
  br label %319

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store double 1.000000e+00, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %160, %77
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %163

83:                                               ; preds = %78
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = shl i32 1, %85
  %87 = and i32 %84, %86
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %89, label %119

89:                                               ; preds = %83
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %96, label %117

96:                                               ; preds = %89
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp sle i32 %97, %101
  br i1 %102, label %103, label %117

103:                                              ; preds = %96
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sub nsw i32 %107, %111
  %113 = add nsw i32 %112, 1
  %114 = sitofp i32 %113 to double
  %115 = load double, ptr %10, align 8, !tbaa !12
  %116 = fdiv double %115, %114
  store double %116, ptr %10, align 8, !tbaa !12
  br label %118

117:                                              ; preds = %96, %89
  store double 0.000000e+00, ptr %10, align 8, !tbaa !12
  br label %118

118:                                              ; preds = %117, %103
  br label %159

119:                                              ; preds = %83
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %126, label %157

126:                                              ; preds = %119
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = icmp sge i32 %130, %131
  br i1 %132, label %133, label %156

133:                                              ; preds = %126
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sub nsw i32 %134, %138
  %140 = sitofp i32 %139 to double
  %141 = load double, ptr %10, align 8, !tbaa !12
  %142 = fmul double %141, %140
  store double %142, ptr %10, align 8, !tbaa !12
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sub nsw i32 %146, %150
  %152 = add nsw i32 %151, 1
  %153 = sitofp i32 %152 to double
  %154 = load double, ptr %10, align 8, !tbaa !12
  %155 = fdiv double %154, %153
  store double %155, ptr %10, align 8, !tbaa !12
  br label %156

156:                                              ; preds = %133, %126
  br label %158

157:                                              ; preds = %119
  store double 0.000000e+00, ptr %10, align 8, !tbaa !12
  br label %158

158:                                              ; preds = %157, %156
  br label %159

159:                                              ; preds = %158, %118
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %11, align 4, !tbaa !5
  br label %78, !llvm.loop !14

163:                                              ; preds = %82
  %164 = load double, ptr %10, align 8, !tbaa !12
  %165 = load i32, ptr %3, align 4, !tbaa !5
  %166 = sitofp i32 %165 to double
  %167 = load double, ptr @ans, align 8, !tbaa !12
  %168 = call double @llvm.fmuladd.f64(double %164, double %166, double %167)
  store double %168, ptr @ans, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %169 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %170 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %169, ptr %170, align 8
  br label %171

171:                                              ; preds = %315, %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %172 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %173 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %172, ptr %173, align 8
  %174 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %318

176:                                              ; preds = %171
  store double 1.000000e+00, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %305, %176
  %178 = load i32, ptr %14, align 4, !tbaa !5
  %179 = load i32, ptr @n, align 4, !tbaa !5
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  store i32 20, ptr %4, align 4
  br label %308

182:                                              ; preds = %177
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = icmp eq i32 %183, %185
  br i1 %186, label %187, label %227

187:                                              ; preds = %182
  %188 = load i32, ptr %14, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %3, align 4, !tbaa !5
  %193 = icmp sgt i32 %191, %192
  br i1 %193, label %194, label %225

194:                                              ; preds = %187
  %195 = load i32, ptr %14, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = load i32, ptr %3, align 4, !tbaa !5
  %200 = icmp sle i32 %198, %199
  br i1 %200, label %201, label %224

201:                                              ; preds = %194
  %202 = load i32, ptr %14, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = load i32, ptr %3, align 4, !tbaa !5
  %207 = sub nsw i32 %205, %206
  %208 = sitofp i32 %207 to double
  %209 = load double, ptr %10, align 8, !tbaa !12
  %210 = fmul double %209, %208
  store double %210, ptr %10, align 8, !tbaa !12
  %211 = load i32, ptr %14, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = load i32, ptr %14, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = sub nsw i32 %214, %218
  %220 = add nsw i32 %219, 1
  %221 = sitofp i32 %220 to double
  %222 = load double, ptr %10, align 8, !tbaa !12
  %223 = fdiv double %222, %221
  store double %223, ptr %10, align 8, !tbaa !12
  br label %224

224:                                              ; preds = %201, %194
  br label %226

225:                                              ; preds = %187
  store double 0.000000e+00, ptr %10, align 8, !tbaa !12
  store i32 20, ptr %4, align 4
  br label %308

226:                                              ; preds = %224
  br label %304

227:                                              ; preds = %182
  %228 = load i32, ptr %5, align 4, !tbaa !5
  %229 = load i32, ptr %14, align 4, !tbaa !5
  %230 = shl i32 1, %229
  %231 = and i32 %228, %230
  %232 = icmp sgt i32 %231, 0
  br i1 %232, label %233, label %263

233:                                              ; preds = %227
  %234 = load i32, ptr %14, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = load i32, ptr %3, align 4, !tbaa !5
  %239 = icmp sle i32 %237, %238
  br i1 %239, label %240, label %261

240:                                              ; preds = %233
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = load i32, ptr %14, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = icmp sle i32 %241, %245
  br i1 %246, label %247, label %261

247:                                              ; preds = %240
  %248 = load i32, ptr %14, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = load i32, ptr %14, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = sub nsw i32 %251, %255
  %257 = add nsw i32 %256, 1
  %258 = sitofp i32 %257 to double
  %259 = load double, ptr %10, align 8, !tbaa !12
  %260 = fdiv double %259, %258
  store double %260, ptr %10, align 8, !tbaa !12
  br label %262

261:                                              ; preds = %240, %233
  store double 0.000000e+00, ptr %10, align 8, !tbaa !12
  store i32 20, ptr %4, align 4
  br label %308

262:                                              ; preds = %247
  br label %303

263:                                              ; preds = %227
  %264 = load i32, ptr %14, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = load i32, ptr %3, align 4, !tbaa !5
  %269 = icmp slt i32 %267, %268
  br i1 %269, label %270, label %301

270:                                              ; preds = %263
  %271 = load i32, ptr %14, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %275 = load i32, ptr %3, align 4, !tbaa !5
  %276 = icmp sge i32 %274, %275
  br i1 %276, label %277, label %300

277:                                              ; preds = %270
  %278 = load i32, ptr %3, align 4, !tbaa !5
  %279 = load i32, ptr %14, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = sub nsw i32 %278, %282
  %284 = sitofp i32 %283 to double
  %285 = load double, ptr %10, align 8, !tbaa !12
  %286 = fmul double %285, %284
  store double %286, ptr %10, align 8, !tbaa !12
  %287 = load i32, ptr %14, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = load i32, ptr %14, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %292
  %294 = load i32, ptr %293, align 4, !tbaa !5
  %295 = sub nsw i32 %290, %294
  %296 = add nsw i32 %295, 1
  %297 = sitofp i32 %296 to double
  %298 = load double, ptr %10, align 8, !tbaa !12
  %299 = fdiv double %298, %297
  store double %299, ptr %10, align 8, !tbaa !12
  br label %300

300:                                              ; preds = %277, %270
  br label %302

301:                                              ; preds = %263
  store double 0.000000e+00, ptr %10, align 8, !tbaa !12
  store i32 20, ptr %4, align 4
  br label %308

302:                                              ; preds = %300
  br label %303

303:                                              ; preds = %302, %262
  br label %304

304:                                              ; preds = %303, %226
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %14, align 4, !tbaa !5
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %14, align 4, !tbaa !5
  br label %177, !llvm.loop !15

308:                                              ; preds = %301, %261, %225, %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %309

309:                                              ; preds = %308
  %310 = load double, ptr %10, align 8, !tbaa !12
  %311 = load i32, ptr %3, align 4, !tbaa !5
  %312 = sitofp i32 %311 to double
  %313 = load double, ptr @ans, align 8, !tbaa !12
  %314 = call double @llvm.fmuladd.f64(double %310, double %312, double %313)
  store double %314, ptr @ans, align 8, !tbaa !12
  br label %315

315:                                              ; preds = %309
  %316 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #7
  %317 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %316, ptr %317, align 8
  br label %171, !llvm.loop !16

318:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  store i32 0, ptr %4, align 4
  br label %319

319:                                              ; preds = %318, %76
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  %320 = load i32, ptr %4, align 4
  switch i32 %320, label %337 [
    i32 0, label %321
    i32 10, label %322
  ]

321:                                              ; preds = %319
  br label %322

322:                                              ; preds = %321, %319
  %323 = load i32, ptr %5, align 4, !tbaa !5
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !17

325:                                              ; preds = %50
  br label %326

326:                                              ; preds = %325
  %327 = load i32, ptr %3, align 4, !tbaa !5
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !18

329:                                              ; preds = %43
  %330 = load double, ptr @ans, align 8, !tbaa !12
  %331 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %330)
  ret i32 0

332:                                              ; preds = %65
  %333 = load ptr, ptr %8, align 8
  %334 = load i32, ptr %9, align 4
  %335 = insertvalue { ptr, i32 } poison, ptr %333, 0
  %336 = insertvalue { ptr, i32 } %335, i32 %334, 1
  resume { ptr, i32 } %336

337:                                              ; preds = %319
  unreachable
}

declare i32 @__isoc99_scanf(ptr 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

declare i32 @printf(ptr noundef, ...) #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 = { "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@l = external dso_local global [5 x i32], align 16
@r = external dso_local global [5 x i32], align 16
@mx = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %..preheader100_crit_edge

..preheader100_crit_edge:                         ; preds = %0
  %.pre = load i32, ptr @mx, align 4, !tbaa !5
  br label %.preheader100

.preheader100:                                    ; preds = %.lr.ph, %..preheader100_crit_edge
  %8 = phi i32 [ %6, %..preheader100_crit_edge ], [ %15, %.lr.ph ]
  %9 = phi i32 [ %.pre, %..preheader100_crit_edge ], [ %14, %.lr.ph ]
  %.not125 = icmp slt i32 %9, 1
  br i1 %.not125, label %._crit_edge127, label %.preheader99

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %indvars.iv
  %11 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %13 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %14, ptr @mx, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader100, !llvm.loop !9

.preheader99:                                     ; preds = %.preheader100, %._crit_edge124
  %18 = phi i32 [ %25, %._crit_edge124 ], [ %9, %.preheader100 ]
  %19 = phi i32 [ %26, %._crit_edge124 ], [ %8, %.preheader100 ]
  %.071126 = phi i32 [ %27, %._crit_edge124 ], [ 1, %.preheader100 ]
  %20 = shl nuw i32 1, %19
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %.lr.ph123, label %._crit_edge124

.lr.ph123:                                        ; preds = %.preheader99
  %22 = uitofp nneg i32 %.071126 to double
  br label %28

._crit_edge127:                                   ; preds = %._crit_edge124, %.preheader100
  %23 = load double, ptr @ans, align 8, !tbaa !11
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %23)
  ret i32 0

._crit_edge124.loopexit:                          ; preds = %133
  %.pre141 = load i32, ptr @mx, align 4, !tbaa !5
  br label %._crit_edge124

._crit_edge124:                                   ; preds = %._crit_edge124.loopexit, %.preheader99
  %25 = phi i32 [ %.pre141, %._crit_edge124.loopexit ], [ %18, %.preheader99 ]
  %26 = phi i32 [ %135, %._crit_edge124.loopexit ], [ %19, %.preheader99 ]
  %27 = add nuw nsw i32 %.071126, 1
  %.not.not = icmp slt i32 %.071126, %25
  br i1 %.not.not, label %.preheader99, label %._crit_edge127, !llvm.loop !13

28:                                               ; preds = %.lr.ph123, %133
  %.072122 = phi i32 [ 1, %.lr.ph123 ], [ %134, %133 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph103, label %._crit_edge

._crit_edge:                                      ; preds = %41, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %31 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %32 = icmp ult i64 %31, 2
  br i1 %32, label %133, label %.preheader98

.preheader98:                                     ; preds = %._crit_edge
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph106.preheader, label %._crit_edge107

.lr.ph106.preheader:                              ; preds = %.preheader98
  %wide.trip.count = zext nneg i32 %33 to i64
  br label %.lr.ph106

.lr.ph103:                                        ; preds = %28, %41
  %35 = phi i32 [ %42, %41 ], [ %29, %28 ]
  %storemerge102 = phi i32 [ %44, %41 ], [ 0, %28 ]
  %36 = shl nuw i32 1, %storemerge102
  %37 = and i32 %36, %.072122
  %.not93 = icmp eq i32 %37, 0
  br i1 %.not93, label %41, label %38

38:                                               ; preds = %.lr.ph103
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %._crit_edge138 unwind label %39

._crit_edge138:                                   ; preds = %38
  %.pre139 = load i32, ptr %2, align 4, !tbaa !5
  %.pre140 = load i32, ptr @n, align 4, !tbaa !5
  br label %41

39:                                               ; preds = %38
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %40

41:                                               ; preds = %._crit_edge138, %.lr.ph103
  %42 = phi i32 [ %.pre140, %._crit_edge138 ], [ %35, %.lr.ph103 ]
  %43 = phi i32 [ %.pre139, %._crit_edge138 ], [ %storemerge102, %.lr.ph103 ]
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  %45 = icmp slt i32 %44, %42
  br i1 %45, label %.lr.ph103, label %._crit_edge, !llvm.loop !14

._crit_edge107:                                   ; preds = %76, %.preheader98
  %.070.lcssa = phi double [ 1.000000e+00, %.preheader98 ], [ %.1, %76 ]
  %46 = load double, ptr @ans, align 8, !tbaa !11
  %47 = call double @llvm.fmuladd.f64(double %.070.lcssa, double %22, double %46)
  store double %47, ptr @ans, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %48 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %48, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %49 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %49, ptr %4, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %50, label %.preheader, label %._crit_edge121

.lr.ph106:                                        ; preds = %.lr.ph106.preheader, %76
  %indvars.iv132 = phi i64 [ 0, %.lr.ph106.preheader ], [ %indvars.iv.next133, %76 ]
  %.070104 = phi double [ 1.000000e+00, %.lr.ph106.preheader ], [ %.1, %76 ]
  %51 = trunc nuw nsw i64 %indvars.iv132 to i32
  %52 = shl nuw i32 1, %51
  %53 = and i32 %52, %.072122
  %.not89 = icmp eq i32 %53, 0
  %54 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %indvars.iv132
  %55 = load i32, ptr %54, align 4, !tbaa !5
  br i1 %.not89, label %64, label %56

56:                                               ; preds = %.lr.ph106
  %.not91 = icmp sgt i32 %55, %.071126
  br i1 %.not91, label %76, label %57

57:                                               ; preds = %56
  %58 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv132
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %.not92 = icmp sgt i32 %.071126, %59
  br i1 %.not92, label %76, label %60

60:                                               ; preds = %57
  %reass.sub = sub i32 %59, %55
  %61 = add i32 %reass.sub, 1
  %62 = sitofp i32 %61 to double
  %63 = fdiv double %.070104, %62
  br label %76

64:                                               ; preds = %.lr.ph106
  %65 = icmp slt i32 %55, %.071126
  br i1 %65, label %66, label %76

66:                                               ; preds = %64
  %67 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv132
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %.not90 = icmp slt i32 %68, %.071126
  br i1 %.not90, label %76, label %69

69:                                               ; preds = %66
  %70 = sub nsw i32 %.071126, %55
  %71 = sitofp i32 %70 to double
  %72 = fmul double %.070104, %71
  %reass.sub128 = sub i32 %68, %55
  %73 = add i32 %reass.sub128, 1
  %74 = sitofp i32 %73 to double
  %75 = fdiv double %72, %74
  br label %76

76:                                               ; preds = %64, %56, %57, %60, %66, %69
  %.1 = phi double [ %63, %60 ], [ %75, %69 ], [ %.070104, %66 ], [ 0.000000e+00, %57 ], [ 0.000000e+00, %56 ], [ 0.000000e+00, %64 ]
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next133, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !15

.preheader:                                       ; preds = %._crit_edge107, %._crit_edge111
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph110, label %._crit_edge111

._crit_edge121:                                   ; preds = %._crit_edge111, %._crit_edge107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %133

.lr.ph110:                                        ; preds = %.preheader, %124
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %124 ], [ 0, %.preheader ]
  %.2108 = phi double [ %.3, %124 ], [ 1.000000e+00, %.preheader ]
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = icmp eq i64 %indvars.iv135, %81
  br i1 %82, label %83, label %98

83:                                               ; preds = %.lr.ph110
  %84 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv135
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp sgt i32 %85, %.071126
  br i1 %86, label %87, label %._crit_edge111

87:                                               ; preds = %83
  %88 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %indvars.iv135
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %.not88 = icmp sgt i32 %89, %.071126
  br i1 %.not88, label %124, label %90

90:                                               ; preds = %87
  %91 = sub nsw i32 %85, %.071126
  %92 = sitofp i32 %91 to double
  %93 = fmul double %.2108, %92
  %94 = add i32 %85, 1
  %95 = sub i32 %94, %89
  %96 = sitofp i32 %95 to double
  %97 = fdiv double %93, %96
  br label %124

98:                                               ; preds = %.lr.ph110
  %99 = trunc nuw nsw i64 %indvars.iv135 to i32
  %100 = shl nuw i32 1, %99
  %101 = and i32 %100, %.072122
  %.not84 = icmp eq i32 %101, 0
  %102 = getelementptr inbounds [5 x i32], ptr @l, i64 0, i64 %indvars.iv135
  %103 = load i32, ptr %102, align 4, !tbaa !5
  br i1 %.not84, label %112, label %104

104:                                              ; preds = %98
  %.not86 = icmp sgt i32 %103, %.071126
  br i1 %.not86, label %._crit_edge111, label %105

105:                                              ; preds = %104
  %106 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv135
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %.not87 = icmp sgt i32 %.071126, %107
  br i1 %.not87, label %._crit_edge111, label %108

108:                                              ; preds = %105
  %reass.sub129 = sub i32 %107, %103
  %109 = add i32 %reass.sub129, 1
  %110 = sitofp i32 %109 to double
  %111 = fdiv double %.2108, %110
  br label %124

112:                                              ; preds = %98
  %113 = icmp slt i32 %103, %.071126
  br i1 %113, label %114, label %._crit_edge111

114:                                              ; preds = %112
  %115 = getelementptr inbounds [5 x i32], ptr @r, i64 0, i64 %indvars.iv135
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %.not85 = icmp slt i32 %116, %.071126
  br i1 %.not85, label %124, label %117

117:                                              ; preds = %114
  %118 = sub nsw i32 %.071126, %103
  %119 = sitofp i32 %118 to double
  %120 = fmul double %.2108, %119
  %reass.sub130 = sub i32 %116, %103
  %121 = add i32 %reass.sub130, 1
  %122 = sitofp i32 %121 to double
  %123 = fdiv double %120, %122
  br label %124

124:                                              ; preds = %87, %90, %117, %114, %108
  %.3 = phi double [ %97, %90 ], [ %.2108, %87 ], [ %111, %108 ], [ %123, %117 ], [ %.2108, %114 ]
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = icmp slt i64 %indvars.iv.next136, %126
  br i1 %127, label %.lr.ph110, label %._crit_edge111, !llvm.loop !16

._crit_edge111:                                   ; preds = %124, %83, %105, %104, %112, %.preheader
  %.4 = phi double [ 1.000000e+00, %.preheader ], [ 0.000000e+00, %112 ], [ 0.000000e+00, %104 ], [ 0.000000e+00, %105 ], [ 0.000000e+00, %83 ], [ %.3, %124 ]
  %128 = load double, ptr @ans, align 8, !tbaa !11
  %129 = call double @llvm.fmuladd.f64(double %.4, double %22, double %128)
  store double %129, ptr @ans, align 8, !tbaa !11
  %130 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %131 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  store ptr %131, ptr %4, align 8
  %132 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br i1 %132, label %.preheader, label %._crit_edge121, !llvm.loop !17

133:                                              ; preds = %._crit_edge, %._crit_edge121
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %134 = add nuw nsw i32 %.072122, 1
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = shl nuw i32 1, %135
  %137 = icmp slt i32 %134, %136
  br i1 %137, label %28, label %._crit_edge124.loopexit, !llvm.loop !18
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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