; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-01/upsolved (I - No place to hide - lzy)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Seg = type { double, double }

@_ZL2pi = external hidden global double, align 8
@s = external dso_local global [20009 x %struct.Seg], align 16
@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@v = external dso_local global [10009 x double], align 16
@x = external dso_local global [10009 x double], align 16
@y = external dso_local global [10009 x double], align 16
@d = external dso_local global double, align 8
@t = external dso_local global double, align 8
@a = external dso_local global double, align 8
@R = external dso_local global double, align 8
@l = external dso_local global [20009 x double], align 16
@r = external dso_local global [20009 x double], align 16
@ans = external dso_local global i32, align 4
@tmp = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind
declare double @acos(double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4dcmpd(double noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3sqrd(double noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmp3SegS_(double, double, double, double) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @T)
  br label %11

11:                                               ; preds = %297, %0
  %12 = load i32, ptr @T, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @T, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %298

15:                                               ; preds = %11
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

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

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

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds double, ptr @v, i64 %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds double, ptr @x, i64 %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds double, ptr @y, i64 %30
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25, ptr noundef %28, ptr noundef %31)
  br label %33

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

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

37:                                               ; preds = %128, %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 7, ptr %4, align 4
  br label %131

42:                                               ; preds = %37
  %43 = load double, ptr @x, align 16, !tbaa !11
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10009 x double], ptr @x, i64 0, i64 %45
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = fsub double %47, %43
  store double %48, ptr %46, align 8, !tbaa !11
  %49 = load double, ptr @y, align 16, !tbaa !11
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [10009 x double], ptr @y, i64 0, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = fsub double %53, %49
  store double %54, ptr %52, align 8, !tbaa !11
  %55 = load double, ptr @v, align 16, !tbaa !11
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [10009 x double], ptr @v, i64 0, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !11
  %60 = fcmp olt double %55, %59
  br i1 %60, label %61, label %63

61:                                               ; preds = %42
  %62 = call i32 @puts(ptr noundef @.str.2)
  store i32 10, ptr %4, align 4
  br label %131

63:                                               ; preds = %42
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10009 x double], ptr @x, i64 0, i64 %65
  %67 = load double, ptr %66, align 8, !tbaa !11
  %68 = call noundef i32 @_Z4dcmpd(double noundef %67)
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %79

70:                                               ; preds = %63
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10009 x double], ptr @y, i64 0, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = call noundef i32 @_Z4dcmpd(double noundef %74)
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %70
  %78 = call i32 @puts(ptr noundef @.str.2)
  store i32 10, ptr %4, align 4
  br label %131

79:                                               ; preds = %70, %63
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10009 x double], ptr @x, i64 0, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = call noundef double @_Z3sqrd(double noundef %83)
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10009 x double], ptr @y, i64 0, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = call noundef double @_Z3sqrd(double noundef %88)
  %90 = fadd double %84, %89
  %91 = call double @sqrt(double noundef %90) #8
  store double %91, ptr @d, align 8, !tbaa !11
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10009 x double], ptr @y, i64 0, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !11
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10009 x double], ptr @x, i64 0, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !11
  %100 = call double @atan2(double noundef %95, double noundef %99) #8
  store double %100, ptr @t, align 8, !tbaa !11
  %101 = load double, ptr @v, align 16, !tbaa !11
  %102 = call noundef double @_Z3sqrd(double noundef %101)
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10009 x double], ptr @v, i64 0, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = call noundef double @_Z3sqrd(double noundef %106)
  %108 = fsub double %102, %107
  %109 = call double @sqrt(double noundef %108) #8
  %110 = load double, ptr @v, align 16, !tbaa !11
  %111 = fdiv double %109, %110
  store double %111, ptr @a, align 8, !tbaa !11
  %112 = load double, ptr @t, align 8, !tbaa !11
  %113 = load double, ptr @a, align 8, !tbaa !11
  %114 = call double @acos(double noundef %113) #8
  %115 = fsub double %112, %114
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Seg, ptr %118, i32 0, i32 0
  store double %115, ptr %119, align 16, !tbaa !13
  %120 = load double, ptr @t, align 8, !tbaa !11
  %121 = load double, ptr @a, align 8, !tbaa !11
  %122 = call double @acos(double noundef %121) #8
  %123 = fadd double %120, %122
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.Seg, ptr %126, i32 0, i32 1
  store double %123, ptr %127, align 8, !tbaa !15
  br label %128

128:                                              ; preds = %79
  %129 = load i32, ptr %3, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !16

131:                                              ; preds = %77, %61, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  %132 = load i32, ptr %4, align 4
  switch i32 %132, label %299 [
    i32 7, label %133
    i32 10, label %297
  ]

133:                                              ; preds = %131
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.Seg, ptr @s, i64 %135
  %137 = getelementptr inbounds %struct.Seg, ptr %136, i64 1
  call void @_ZSt4sortIP3SegPFbS0_S0_EEvT_S4_T0_(ptr noundef getelementptr inbounds (%struct.Seg, ptr @s, i64 1), ptr noundef %137, ptr noundef @_Z3cmp3SegS_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %160, %133
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = load i32, ptr @n, align 4, !tbaa !5
  %141 = icmp sle i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %163

143:                                              ; preds = %138
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.Seg, ptr %146, i32 0, i32 0
  %148 = load double, ptr %147, align 16, !tbaa !13
  %149 = load i32, ptr %5, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %150
  store double %148, ptr %151, align 8, !tbaa !11
  %152 = load i32, ptr %5, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %153
  %155 = getelementptr inbounds %struct.Seg, ptr %154, i32 0, i32 1
  %156 = load double, ptr %155, align 8, !tbaa !15
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %158
  store double %156, ptr %159, align 8, !tbaa !11
  br label %160

160:                                              ; preds = %143
  %161 = load i32, ptr %5, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %5, align 4, !tbaa !5
  br label %138, !llvm.loop !17

163:                                              ; preds = %142
  %164 = load i32, ptr @n, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  br label %166

166:                                              ; preds = %283, %163
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = load i32, ptr @n, align 4, !tbaa !5
  %169 = icmp sle i32 %167, %168
  br i1 %169, label %171, label %170

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

171:                                              ; preds = %166
  store i32 1, ptr @tmp, align 4, !tbaa !5
  %172 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %172, ptr %9, align 4, !tbaa !5
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %8, align 4, !tbaa !5
  store i32 %174, ptr %7, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %241, %171
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = add nsw i32 %177, %178
  %180 = icmp slt i32 %176, %179
  br i1 %180, label %181, label %243

181:                                              ; preds = %175
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %183
  %185 = load double, ptr %184, align 8, !tbaa !11
  store double %185, ptr @R, align 8, !tbaa !11
  %186 = load double, ptr @R, align 8, !tbaa !11
  %187 = fadd double %186, 1.000000e-08
  %188 = load i32, ptr %6, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %189
  %191 = load double, ptr %190, align 8, !tbaa !11
  %192 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %193 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %192, double %191)
  %194 = fcmp ogt double %187, %193
  br i1 %194, label %195, label %196

195:                                              ; preds = %181
  br label %243

196:                                              ; preds = %181
  br label %197

197:                                              ; preds = %226, %196
  %198 = load i32, ptr %8, align 4, !tbaa !5
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = load i32, ptr @n, align 4, !tbaa !5
  %201 = add nsw i32 %199, %200
  %202 = icmp slt i32 %198, %201
  br i1 %202, label %203, label %211

203:                                              ; preds = %197
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %205
  %207 = load double, ptr %206, align 8, !tbaa !11
  %208 = load double, ptr @R, align 8, !tbaa !11
  %209 = fadd double %208, 1.000000e-08
  %210 = fcmp olt double %207, %209
  br label %211

211:                                              ; preds = %203, %197
  %212 = phi i1 [ false, %197 ], [ %210, %203 ]
  br i1 %212, label %213, label %229

213:                                              ; preds = %211
  %214 = load i32, ptr %9, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %215
  %217 = load double, ptr %216, align 8, !tbaa !11
  %218 = load i32, ptr %8, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %219
  %221 = load double, ptr %220, align 8, !tbaa !11
  %222 = fcmp olt double %217, %221
  br i1 %222, label %223, label %225

223:                                              ; preds = %213
  %224 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %224, ptr %9, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %223, %213
  br label %226

226:                                              ; preds = %225
  %227 = load i32, ptr %8, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %8, align 4, !tbaa !5
  br label %197, !llvm.loop !18

229:                                              ; preds = %211
  %230 = load i32, ptr %9, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %231
  %233 = load double, ptr %232, align 8, !tbaa !11
  %234 = load double, ptr @R, align 8, !tbaa !11
  %235 = fcmp ogt double %233, %234
  br i1 %235, label %236, label %239

236:                                              ; preds = %229
  %237 = load i32, ptr @tmp, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr @tmp, align 4, !tbaa !5
  br label %240

239:                                              ; preds = %229
  br label %243

240:                                              ; preds = %236
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %242, ptr %7, align 4, !tbaa !5
  br label %175, !llvm.loop !19

243:                                              ; preds = %239, %195, %175
  %244 = load i32, ptr %9, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %245
  %247 = load double, ptr %246, align 8, !tbaa !11
  store double %247, ptr @R, align 8, !tbaa !11
  %248 = load double, ptr @R, align 8, !tbaa !11
  %249 = fadd double %248, 1.000000e-08
  %250 = load i32, ptr %6, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %251
  %253 = load double, ptr %252, align 8, !tbaa !11
  %254 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %255 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %254, double %253)
  %256 = fcmp ogt double %249, %255
  br i1 %256, label %257, label %260

257:                                              ; preds = %243
  %258 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) @tmp)
  %259 = load i32, ptr %258, align 4, !tbaa !5
  store i32 %259, ptr @ans, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %257, %243
  %261 = load i32, ptr %6, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %262
  %264 = load double, ptr %263, align 8, !tbaa !11
  %265 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %266 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %265, double %264)
  %267 = load i32, ptr %6, align 4, !tbaa !5
  %268 = load i32, ptr @n, align 4, !tbaa !5
  %269 = add nsw i32 %267, %268
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %270
  store double %266, ptr %271, align 8, !tbaa !11
  %272 = load i32, ptr %6, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %273
  %275 = load double, ptr %274, align 8, !tbaa !11
  %276 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %277 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %276, double %275)
  %278 = load i32, ptr %6, align 4, !tbaa !5
  %279 = load i32, ptr @n, align 4, !tbaa !5
  %280 = add nsw i32 %278, %279
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %281
  store double %277, ptr %282, align 8, !tbaa !11
  br label %283

283:                                              ; preds = %260
  %284 = load i32, ptr %6, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %6, align 4, !tbaa !5
  br label %166, !llvm.loop !20

286:                                              ; preds = %170
  %287 = load i32, ptr @ans, align 4, !tbaa !5
  %288 = load i32, ptr @n, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  %290 = icmp eq i32 %287, %289
  br i1 %290, label %291, label %292

291:                                              ; preds = %286
  br label %294

292:                                              ; preds = %286
  %293 = load i32, ptr @ans, align 4, !tbaa !5
  br label %294

294:                                              ; preds = %292, %291
  %295 = phi i32 [ 0, %291 ], [ %293, %292 ]
  %296 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %295)
  br label %297

297:                                              ; preds = %294, %131
  br label %11, !llvm.loop !21

298:                                              ; preds = %11
  ret i32 0

299:                                              ; preds = %131
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

declare i32 @puts(ptr noundef) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #0

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3SegPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7

declare i32 @printf(ptr noundef, ...) #3

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { 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 = !{!14, !12, i64 0}
!14 = !{!"_ZTS3Seg", !12, i64 0, !12, i64 8}
!15 = !{!14, !12, i64 8}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !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"

%struct.Seg = type { double, double }

@_ZL2pi = external hidden local_unnamed_addr global double, align 8
@s = external dso_local global [20009 x %struct.Seg], align 16
@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@v = external dso_local global [10009 x double], align 16
@x = external dso_local global [10009 x double], align 16
@y = external dso_local global [10009 x double], align 16
@d = external dso_local local_unnamed_addr global double, align 8
@t = external dso_local local_unnamed_addr global double, align 8
@a = external dso_local local_unnamed_addr global double, align 8
@R = external dso_local local_unnamed_addr global double, align 8
@l = external dso_local local_unnamed_addr global [20009 x double], align 16
@r = external dso_local local_unnamed_addr global [20009 x double], align 16
@ans = external dso_local global i32, align 4
@tmp = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @acos(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4dcmpd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3sqrd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmp3SegS_(double, double, double, double) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @T)
  %2 = load i32, ptr @T, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @T, align 4, !tbaa !5
  %.not104 = icmp eq i32 %2, 0
  br i1 %.not104, label %._crit_edge107, label %.lr.ph106

.lr.ph106:                                        ; preds = %0, %.thread
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not5968 = icmp slt i32 %5, 0
  br i1 %.not5968, label %.preheader66.._crit_edge_crit_edge, label %.lr.ph

.preheader66:                                     ; preds = %.lr.ph
  %.not6070 = icmp slt i32 %11, 1
  br i1 %.not6070, label %.preheader66.._crit_edge_crit_edge, label %.lr.ph72

.preheader66.._crit_edge_crit_edge:               ; preds = %.lr.ph106, %.preheader66
  %6 = phi i32 [ %11, %.preheader66 ], [ %5, %.lr.ph106 ]
  %.pre146 = sext i32 %6 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph106, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph106 ]
  %7 = getelementptr inbounds double, ptr @v, i64 %indvars.iv
  %8 = getelementptr inbounds double, ptr @x, i64 %indvars.iv
  %9 = getelementptr inbounds double, ptr @y, i64 %indvars.iv
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not59.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not59.not, label %.lr.ph, label %.preheader66, !llvm.loop !9

.lr.ph72:                                         ; preds = %.preheader66, %36
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %36 ], [ 1, %.preheader66 ]
  %13 = load double, ptr @x, align 16, !tbaa !11
  %14 = getelementptr inbounds [10009 x double], ptr @x, i64 0, i64 %indvars.iv115
  %15 = load double, ptr %14, align 8, !tbaa !11
  %16 = fsub double %15, %13
  store double %16, ptr %14, align 8, !tbaa !11
  %17 = load double, ptr @y, align 16, !tbaa !11
  %18 = getelementptr inbounds [10009 x double], ptr @y, i64 0, i64 %indvars.iv115
  %19 = load double, ptr %18, align 8, !tbaa !11
  %20 = fsub double %19, %17
  store double %20, ptr %18, align 8, !tbaa !11
  %21 = load double, ptr @v, align 16, !tbaa !11
  %22 = getelementptr inbounds [10009 x double], ptr @v, i64 0, i64 %indvars.iv115
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = fcmp olt double %21, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %.lr.ph72
  %26 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.thread

27:                                               ; preds = %.lr.ph72
  %28 = tail call noundef i32 @_Z4dcmpd(double noundef %16)
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %36

30:                                               ; preds = %27
  %31 = load double, ptr %18, align 8, !tbaa !11
  %32 = tail call noundef i32 @_Z4dcmpd(double noundef %31)
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %30
  %35 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.thread

36:                                               ; preds = %30, %27
  %37 = load double, ptr %14, align 8, !tbaa !11
  %38 = tail call noundef double @_Z3sqrd(double noundef %37)
  %39 = load double, ptr %18, align 8, !tbaa !11
  %40 = tail call noundef double @_Z3sqrd(double noundef %39)
  %41 = fadd double %38, %40
  %42 = tail call double @sqrt(double noundef %41) #7
  store double %42, ptr @d, align 8, !tbaa !11
  %43 = load double, ptr %18, align 8, !tbaa !11
  %44 = load double, ptr %14, align 8, !tbaa !11
  %45 = tail call double @atan2(double noundef %43, double noundef %44) #7
  store double %45, ptr @t, align 8, !tbaa !11
  %46 = load double, ptr @v, align 16, !tbaa !11
  %47 = tail call noundef double @_Z3sqrd(double noundef %46)
  %48 = load double, ptr %22, align 8, !tbaa !11
  %49 = tail call noundef double @_Z3sqrd(double noundef %48)
  %50 = fsub double %47, %49
  %51 = tail call double @sqrt(double noundef %50) #7
  %52 = load double, ptr @v, align 16, !tbaa !11
  %53 = fdiv double %51, %52
  store double %53, ptr @a, align 8, !tbaa !11
  %54 = load double, ptr @t, align 8, !tbaa !11
  %55 = tail call double @acos(double noundef %53) #7
  %56 = fsub double %54, %55
  %57 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %indvars.iv115
  store double %56, ptr %57, align 16, !tbaa !13
  %58 = load double, ptr @t, align 8, !tbaa !11
  %59 = load double, ptr @a, align 8, !tbaa !11
  %60 = tail call double @acos(double noundef %59) #7
  %61 = fadd double %58, %60
  %62 = getelementptr inbounds i8, ptr %57, i64 8
  store double %61, ptr %62, align 8, !tbaa !15
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not60.not = icmp slt i64 %indvars.iv115, %64
  br i1 %.not60.not, label %.lr.ph72, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %36, %.preheader66.._crit_edge_crit_edge
  %.pre-phi147 = phi i64 [ %.pre146, %.preheader66.._crit_edge_crit_edge ], [ %64, %36 ]
  %gep = getelementptr %struct.Seg, ptr getelementptr inbounds (i8, ptr @s, i64 16), i64 %.pre-phi147
  tail call void @_ZSt4sortIP3SegPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 16), ptr noundef nonnull %gep, ptr noundef nonnull @_Z3cmp3SegS_)
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %.not6173 = icmp slt i32 %65, 1
  %.pre148 = add i32 %65, 1
  br i1 %.not6173, label %._crit_edge77.thread, label %.lr.ph76.preheader

._crit_edge77.thread:                             ; preds = %._crit_edge
  store i32 %.pre148, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge102

.lr.ph76.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext i32 %.pre148 to i64
  %66 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %.pre148, 5
  br i1 %min.iters.check, label %.lr.ph76.preheader167, label %vector.ph

.lr.ph76.preheader167:                            ; preds = %middle.block, %.lr.ph76.preheader
  %indvars.iv118.ph = phi i64 [ 1, %.lr.ph76.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph76

vector.ph:                                        ; preds = %.lr.ph76.preheader
  %n.vec = and i64 %66, -4
  %ind.end = or disjoint i64 %n.vec, 1
  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
  %67 = or disjoint i64 %index, 3
  %68 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %offset.idx
  %69 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %67
  %wide.vec = load <4 x double>, ptr %68, align 16, !tbaa !11
  %wide.vec163 = load <4 x double>, ptr %69, align 16, !tbaa !11
  %strided.vec = shufflevector <4 x double> %wide.vec, <4 x double> poison, <2 x i32> <i32 0, i32 2>
  %strided.vec164 = shufflevector <4 x double> %wide.vec163, <4 x double> poison, <2 x i32> <i32 0, i32 2>
  %strided.vec165 = shufflevector <4 x double> %wide.vec, <4 x double> poison, <2 x i32> <i32 1, i32 3>
  %strided.vec166 = shufflevector <4 x double> %wide.vec163, <4 x double> poison, <2 x i32> <i32 1, i32 3>
  %70 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %offset.idx
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  store <2 x double> %strided.vec, ptr %70, align 8, !tbaa !11
  store <2 x double> %strided.vec164, ptr %71, align 8, !tbaa !11
  %72 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %offset.idx
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  store <2 x double> %strided.vec165, ptr %72, align 8, !tbaa !11
  store <2 x double> %strided.vec166, ptr %73, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %74 = icmp eq i64 %index.next, %n.vec
  br i1 %74, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %66, %n.vec
  br i1 %cmp.n, label %._crit_edge77, label %.lr.ph76.preheader167

._crit_edge77:                                    ; preds = %.lr.ph76, %middle.block
  store i32 %.pre148, ptr @ans, align 4, !tbaa !5
  br i1 %.not6173, label %._crit_edge102, label %.lr.ph101

.lr.ph76:                                         ; preds = %.lr.ph76.preheader167, %.lr.ph76
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.lr.ph76 ], [ %indvars.iv118.ph, %.lr.ph76.preheader167 ]
  %75 = getelementptr inbounds [20009 x %struct.Seg], ptr @s, i64 0, i64 %indvars.iv118
  %76 = load double, ptr %75, align 16, !tbaa !13
  %77 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %indvars.iv118
  store double %76, ptr %77, align 8, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %75, i64 8
  %79 = load double, ptr %78, align 8, !tbaa !15
  %80 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %indvars.iv118
  store double %79, ptr %80, align 8, !tbaa !11
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge77, label %.lr.ph76, !llvm.loop !20

._crit_edge102.loopexit:                          ; preds = %127
  %.pre138 = add nsw i32 %129, 1
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge77.thread, %._crit_edge102.loopexit, %._crit_edge77
  %.pre-phi139 = phi i32 [ %.pre138, %._crit_edge102.loopexit ], [ %.pre148, %._crit_edge77 ], [ %.pre148, %._crit_edge77.thread ]
  %81 = phi i32 [ %128, %._crit_edge102.loopexit ], [ %.pre148, %._crit_edge77 ], [ %.pre148, %._crit_edge77.thread ]
  %82 = icmp eq i32 %81, %.pre-phi139
  %83 = select i1 %82, i32 0, i32 %81
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %83)
  br label %.thread

.lr.ph101:                                        ; preds = %._crit_edge77, %127
  %85 = phi i32 [ %128, %127 ], [ %.pre148, %._crit_edge77 ]
  %86 = phi i32 [ %129, %127 ], [ %65, %._crit_edge77 ]
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %127 ], [ 1, %._crit_edge77 ]
  store i32 1, ptr @tmp, align 4, !tbaa !5
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %87 = trunc nuw nsw i64 %indvars.iv125 to i32
  %88 = add i32 %86, %87
  %89 = icmp sgt i32 %86, 1
  %90 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %indvars.iv125
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %93 = tail call double @llvm.fmuladd.f64(double %92, double 2.000000e+00, double %91)
  br i1 %89, label %.lr.ph89, label %.lr.ph101._crit_edge

.lr.ph89:                                         ; preds = %.lr.ph101
  %94 = sext i32 %88 to i64
  %95 = trunc nuw i64 %indvars.iv.next126 to i32
  %sext = shl i64 %indvars.iv125, 32
  %.phi.trans.insert = ashr exact i64 %sext, 32
  %.phi.trans.insert128 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %.phi.trans.insert
  %.pre = load double, ptr %.phi.trans.insert128, align 8, !tbaa !11
  br label %96

96:                                               ; preds = %.lr.ph89, %115
  %97 = phi double [ %.pre, %.lr.ph89 ], [ %.pre131, %115 ]
  %.087 = phi i32 [ %87, %.lr.ph89 ], [ %.1.lcssa.ph, %115 ]
  %.04986 = phi i32 [ %95, %.lr.ph89 ], [ %.150.lcssa.ph, %115 ]
  %98 = phi i32 [ 1, %.lr.ph89 ], [ %116, %115 ]
  %99 = fadd double %97, 1.000000e-08
  %100 = fcmp ule double %99, %93
  %101 = icmp slt i32 %.04986, %88
  %or.cond = select i1 %100, i1 %101, i1 false
  br i1 %or.cond, label %.lr.ph80.preheader, label %.lr.ph101._crit_edge

.lr.ph80.preheader:                               ; preds = %96
  %102 = sext i32 %.04986 to i64
  br label %.lr.ph80

.lr.ph80:                                         ; preds = %.lr.ph80.preheader, %107
  %indvars.iv121 = phi i64 [ %102, %.lr.ph80.preheader ], [ %indvars.iv.next122, %107 ]
  %.179 = phi i32 [ %.087, %.lr.ph80.preheader ], [ %.2, %107 ]
  %103 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %indvars.iv121
  %104 = load double, ptr %103, align 8, !tbaa !11
  %105 = fcmp olt double %104, %99
  %106 = trunc nsw i64 %indvars.iv121 to i32
  br i1 %105, label %107, label %.critedge

107:                                              ; preds = %.lr.ph80
  %108 = sext i32 %.179 to i64
  %109 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %indvars.iv121
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = fcmp olt double %110, %112
  %.2 = select i1 %113, i32 %106, i32 %.179
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next122, %94
  br i1 %exitcond124.not, label %.critedge, label %.lr.ph80, !llvm.loop !21

.critedge:                                        ; preds = %.lr.ph80, %107
  %.150.lcssa.ph = phi i32 [ %106, %.lr.ph80 ], [ %88, %107 ]
  %.1.lcssa.ph = phi i32 [ %.179, %.lr.ph80 ], [ %.2, %107 ]
  %.pre129 = sext i32 %.1.lcssa.ph to i64
  %.phi.trans.insert130 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %.pre129
  %.pre131 = load double, ptr %.phi.trans.insert130, align 8, !tbaa !11
  %114 = fcmp ogt double %.pre131, %97
  br i1 %114, label %115, label %.lr.ph101._crit_edge

115:                                              ; preds = %.critedge
  %116 = add nuw nsw i32 %98, 1
  store i32 %116, ptr @tmp, align 4, !tbaa !5
  %117 = icmp slt i32 %.150.lcssa.ph, %88
  br i1 %117, label %96, label %.lr.ph101._crit_edge, !llvm.loop !22

.lr.ph101._crit_edge:                             ; preds = %115, %96, %.critedge, %.lr.ph101
  %.3 = phi i32 [ %87, %.lr.ph101 ], [ %.1.lcssa.ph, %.critedge ], [ %.087, %96 ], [ %.1.lcssa.ph, %115 ]
  %118 = sext i32 %.3 to i64
  %119 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !11
  store double %120, ptr @R, align 8, !tbaa !11
  %121 = fadd double %120, 1.000000e-08
  %122 = fcmp ogt double %121, %93
  br i1 %122, label %123, label %127

123:                                              ; preds = %.lr.ph101._crit_edge
  %124 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %indvars.iv125
  %125 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) @tmp)
  %126 = load i32, ptr %125, align 4, !tbaa !5
  store i32 %126, ptr @ans, align 4, !tbaa !5
  %.pre135 = load double, ptr %124, align 8, !tbaa !11
  %.pre136 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %.pre137 = load i32, ptr @n, align 4, !tbaa !5
  %.pre142 = tail call double @llvm.fmuladd.f64(double %.pre136, double 2.000000e+00, double %.pre135)
  %.pre144 = add nsw i32 %.pre137, %87
  br label %127

127:                                              ; preds = %123, %.lr.ph101._crit_edge
  %.pre-phi145 = phi i32 [ %.pre144, %123 ], [ %88, %.lr.ph101._crit_edge ]
  %.pre-phi143 = phi double [ %.pre142, %123 ], [ %93, %.lr.ph101._crit_edge ]
  %128 = phi i32 [ %126, %123 ], [ %85, %.lr.ph101._crit_edge ]
  %129 = phi i32 [ %.pre137, %123 ], [ %86, %.lr.ph101._crit_edge ]
  %130 = phi double [ %.pre136, %123 ], [ %92, %.lr.ph101._crit_edge ]
  %131 = sext i32 %.pre-phi145 to i64
  %132 = getelementptr inbounds [20009 x double], ptr @l, i64 0, i64 %131
  store double %.pre-phi143, ptr %132, align 8, !tbaa !11
  %133 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %indvars.iv125
  %134 = load double, ptr %133, align 8, !tbaa !11
  %135 = tail call double @llvm.fmuladd.f64(double %130, double 2.000000e+00, double %134)
  %136 = getelementptr inbounds [20009 x double], ptr @r, i64 0, i64 %131
  store double %135, ptr %136, align 8, !tbaa !11
  %137 = sext i32 %129 to i64
  %.not62.not = icmp slt i64 %indvars.iv125, %137
  br i1 %.not62.not, label %.lr.ph101, label %._crit_edge102.loopexit, !llvm.loop !23

.thread:                                          ; preds = %34, %25, %._crit_edge102
  %138 = load i32, ptr @T, align 4, !tbaa !5
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr @T, align 4, !tbaa !5
  %.not = icmp eq i32 %138, 0
  br i1 %.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !24

._crit_edge107:                                   ; preds = %.thread, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3SegPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) "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 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 #2 = { 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 #3 = { 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 #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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 = !{!14, !12, i64 0}
!14 = !{!"_ZTS3Seg", !12, i64 0, !12, i64 8}
!15 = !{!14, !12, i64 8}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !19, !18}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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