; LLVM IR from tangjz/acm-icpc :: codeforces/1408C.ll (Z5solvev)

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

@_ZZ5solvevE1a = external hidden global [100009 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3lft = external hidden global [100009 x double], align 16
@_ZZ5solvevE3rht = external hidden global [100009 x double], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i32, ptr @_ZZ5solvevE1a, i64 %14
  %16 = getelementptr inbounds i32, ptr %15, i64 1
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16)
  store i32 0, ptr @_ZZ5solvevE1a, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %28, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i32, ptr @_ZZ5solvevE1a, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %26)
  br label %28

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

31:                                               ; preds = %22
  store double 0.000000e+00, ptr @_ZZ5solvevE3lft, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %62, %31
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = icmp sle i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %65

38:                                               ; preds = %32
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !11
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sub nsw i32 %47, %52
  %54 = sitofp i32 %53 to double
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sitofp i32 %55 to double
  %57 = fdiv double %54, %56
  %58 = fadd double %43, %57
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %60
  store double %58, ptr %61, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %38
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !5
  br label %32, !llvm.loop !13

65:                                               ; preds = %37
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %68
  store double 0.000000e+00, ptr %69, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %70 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %102, %65
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %105

75:                                               ; preds = %71
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sub nsw i32 %85, %89
  %91 = sitofp i32 %90 to double
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sub nsw i32 %93, %94
  %96 = sitofp i32 %95 to double
  %97 = fdiv double %91, %96
  %98 = fadd double %80, %97
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %100
  store double %98, ptr %101, align 8, !tbaa !11
  br label %102

102:                                              ; preds = %75
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %4, align 4, !tbaa !5
  br label %71, !llvm.loop !14

105:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sitofp i32 %110 to double
  store double %111, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %207, %105
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = load i32, ptr %1, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %210

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %119
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %123
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull align 8 dereferenceable(8) %124)
  %126 = load double, ptr %125, align 8, !tbaa !11
  store double %126, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %129
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %132
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef nonnull align 8 dereferenceable(8) %133)
  %135 = load double, ptr %134, align 8, !tbaa !11
  store double %135, ptr %9, align 8, !tbaa !11
  %136 = load double, ptr %8, align 8, !tbaa !11
  %137 = load double, ptr %9, align 8, !tbaa !11
  %138 = fsub double %136, %137
  %139 = call noundef i32 @_Z3sgnd(double noundef %138)
  %140 = icmp sgt i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %117
  store i32 13, ptr %7, align 4
  br label %204

142:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sub nsw i32 %147, %151
  %153 = sitofp i32 %152 to double
  store double %153, ptr %10, align 8, !tbaa !11
  %154 = load double, ptr %8, align 8, !tbaa !11
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !11
  %159 = fsub double %154, %158
  %160 = load i32, ptr %6, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  %162 = sitofp i32 %161 to double
  %163 = load double, ptr %10, align 8, !tbaa !11
  %164 = fneg double %159
  %165 = call double @llvm.fmuladd.f64(double %164, double %162, double %163)
  store double %165, ptr %10, align 8, !tbaa !11
  %166 = load double, ptr %8, align 8, !tbaa !11
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !11
  %172 = fsub double %166, %171
  %173 = load i32, ptr %1, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = sub nsw i32 %174, %175
  %177 = sitofp i32 %176 to double
  %178 = load double, ptr %10, align 8, !tbaa !11
  %179 = fneg double %172
  %180 = call double @llvm.fmuladd.f64(double %179, double %177, double %178)
  store double %180, ptr %10, align 8, !tbaa !11
  %181 = load double, ptr %10, align 8, !tbaa !11
  %182 = call noundef i32 @_Z3sgnd(double noundef %181)
  %183 = icmp slt i32 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %142
  store i32 13, ptr %7, align 4
  br label %203

185:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %186 = load double, ptr %8, align 8, !tbaa !11
  %187 = load double, ptr %10, align 8, !tbaa !11
  %188 = load i32, ptr %1, align 4, !tbaa !5
  %189 = add nsw i32 %188, 2
  %190 = sitofp i32 %189 to double
  %191 = fdiv double %187, %190
  %192 = fadd double %186, %191
  store double %192, ptr %11, align 8, !tbaa !11
  %193 = load double, ptr %11, align 8, !tbaa !11
  %194 = load double, ptr %9, align 8, !tbaa !11
  %195 = fsub double %193, %194
  %196 = call noundef i32 @_Z3sgnd(double noundef %195)
  %197 = icmp sgt i32 %196, 0
  br i1 %197, label %198, label %199

198:                                              ; preds = %185
  store i32 13, ptr %7, align 4
  br label %202

199:                                              ; preds = %185
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %201 = load double, ptr %200, align 8, !tbaa !11
  store double %201, ptr %5, align 8, !tbaa !11
  store i32 0, ptr %7, align 4
  br label %202

202:                                              ; preds = %199, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %203

203:                                              ; preds = %202, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %204

204:                                              ; preds = %203, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %205 = load i32, ptr %7, align 4
  switch i32 %205, label %213 [
    i32 0, label %206
    i32 13, label %207
  ]

206:                                              ; preds = %204
  br label %207

207:                                              ; preds = %206, %204
  %208 = load i32, ptr %6, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %6, align 4, !tbaa !5
  br label %112, !llvm.loop !15

210:                                              ; preds = %116
  %211 = load double, ptr %5, align 8, !tbaa !11
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %211)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void

213:                                              ; preds = %204
  unreachable
}

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

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


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

@_ZZ5solvevE1a = external hidden global [100009 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3lft = external hidden global [100009 x double], align 16
@_ZZ5solvevE3rht = external hidden global [100009 x double], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i32, ptr @_ZZ5solvevE1a, i64 %6
  %8 = getelementptr inbounds i8, ptr %7, i64 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  store i32 0, ptr @_ZZ5solvevE1a, align 16, !tbaa !5
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %.not45 = icmp slt i32 %10, 1
  br i1 %.not45, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %11 = phi i32 [ %10, %0 ], [ %23, %.lr.ph ]
  store double 0.000000e+00, ptr @_ZZ5solvevE3lft, align 16, !tbaa !9
  %12 = add nsw i32 %11, 1
  %.not4247 = icmp slt i32 %11, 0
  br i1 %.not4247, label %._crit_edge51.thread, label %.lr.ph50.preheader

._crit_edge51.thread:                             ; preds = %._crit_edge
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %13
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %15 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %13
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sitofp i32 %16 to double
  store double %17, ptr %2, align 8, !tbaa !9
  br label %._crit_edge61

.lr.ph50.preheader:                               ; preds = %._crit_edge
  %.pre = load i32, ptr @_ZZ5solvevE1a, align 16, !tbaa !5
  %18 = add nuw i32 %11, 1
  %19 = zext i32 %18 to i64
  %xtraiter = and i64 %19, 1
  %20 = icmp eq i32 %11, 0
  br i1 %20, label %._crit_edge51.unr-lcssa, label %.lr.ph50.preheader.new

.lr.ph50.preheader.new:                           ; preds = %.lr.ph50.preheader
  %unroll_iter = and i64 %19, 4294967294
  br label %.lr.ph50

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %21 = getelementptr inbounds i32, ptr @_ZZ5solvevE1a, i64 %indvars.iv
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not.not = icmp slt i64 %indvars.iv, %24
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge51.unr-lcssa:                          ; preds = %.lr.ph50, %.lr.ph50.preheader
  %.unr = phi i32 [ %.pre, %.lr.ph50.preheader ], [ %62, %.lr.ph50 ]
  %.unr73 = phi double [ 0.000000e+00, %.lr.ph50.preheader ], [ %68, %.lr.ph50 ]
  %indvars.iv63.unr = phi i64 [ 1, %.lr.ph50.preheader ], [ %indvars.iv.next64.1, %.lr.ph50 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge51, label %.lr.ph50.epil

.lr.ph50.epil:                                    ; preds = %._crit_edge51.unr-lcssa
  %25 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv63.unr
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sub nsw i32 %26, %.unr
  %28 = sitofp i32 %27 to double
  %29 = trunc nuw nsw i64 %indvars.iv63.unr to i32
  %30 = uitofp nneg i32 %29 to double
  %31 = fdiv double %28, %30
  %32 = fadd double %.unr73, %31
  %33 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %indvars.iv63.unr
  store double %32, ptr %33, align 8, !tbaa !9
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.unr-lcssa, %.lr.ph50.epil
  %34 = zext nneg i32 %12 to i64
  %35 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %34
  store double 0.000000e+00, ptr %35, align 8, !tbaa !9
  %36 = zext nneg i32 %11 to i64
  %37 = shl nuw nsw i64 %36, 3
  %38 = getelementptr i8, ptr @_ZZ5solvevE3rht, i64 %37
  %scevgep = getelementptr i8, ptr %38, i64 8
  %load_initial = load double, ptr %scevgep, align 8
  %39 = and i64 %36, 1
  %lcmp.mod75.not.not = icmp eq i64 %39, 0
  br i1 %lcmp.mod75.not.not, label %.lr.ph55.prol, label %.lr.ph55.prol.loopexit

.lr.ph55.prol:                                    ; preds = %._crit_edge51
  %40 = or disjoint i64 %36, 1
  %41 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %36
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sub nsw i32 %42, %44
  %46 = sitofp i32 %45 to double
  %47 = fadd double %load_initial, %46
  %48 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %36
  store double %47, ptr %48, align 8, !tbaa !9
  %indvars.iv.next67.prol = add nsw i64 %36, -1
  br label %.lr.ph55.prol.loopexit

.lr.ph55.prol.loopexit:                           ; preds = %.lr.ph55.prol, %._crit_edge51
  %store_forwarded.unr = phi double [ %load_initial, %._crit_edge51 ], [ %47, %.lr.ph55.prol ]
  %indvars.iv66.unr = phi i64 [ %36, %._crit_edge51 ], [ %indvars.iv.next67.prol, %.lr.ph55.prol ]
  %49 = icmp eq i32 %11, 0
  br i1 %49, label %._crit_edge56, label %.lr.ph55

.lr.ph50:                                         ; preds = %.lr.ph50, %.lr.ph50.preheader.new
  %50 = phi i32 [ %.pre, %.lr.ph50.preheader.new ], [ %62, %.lr.ph50 ]
  %51 = phi double [ 0.000000e+00, %.lr.ph50.preheader.new ], [ %68, %.lr.ph50 ]
  %indvars.iv63 = phi i64 [ 1, %.lr.ph50.preheader.new ], [ %indvars.iv.next64.1, %.lr.ph50 ]
  %niter = phi i64 [ 0, %.lr.ph50.preheader.new ], [ %niter.next.1, %.lr.ph50 ]
  %52 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv63
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sub nsw i32 %53, %50
  %55 = sitofp i32 %54 to double
  %56 = trunc nuw nsw i64 %indvars.iv63 to i32
  %57 = uitofp nneg i32 %56 to double
  %58 = fdiv double %55, %57
  %59 = fadd double %51, %58
  %60 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %indvars.iv63
  store double %59, ptr %60, align 8, !tbaa !9
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %61 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv.next64
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sub nsw i32 %62, %53
  %64 = sitofp i32 %63 to double
  %65 = trunc nuw nsw i64 %indvars.iv.next64 to i32
  %66 = uitofp nneg i32 %65 to double
  %67 = fdiv double %64, %66
  %68 = fadd double %59, %67
  %69 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %indvars.iv.next64
  store double %68, ptr %69, align 8, !tbaa !9
  %indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge51.unr-lcssa, label %.lr.ph50, !llvm.loop !13

._crit_edge56:                                    ; preds = %.lr.ph55, %.lr.ph55.prol.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %70 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %34
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sitofp i32 %71 to double
  store double %72, ptr %2, align 8, !tbaa !9
  br i1 %.not4247, label %._crit_edge61, label %.lr.ph60

.lr.ph55:                                         ; preds = %.lr.ph55.prol.loopexit, %.lr.ph55
  %store_forwarded = phi double [ %94, %.lr.ph55 ], [ %store_forwarded.unr, %.lr.ph55.prol.loopexit ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67.1, %.lr.ph55 ], [ %indvars.iv66.unr, %.lr.ph55.prol.loopexit ]
  %73 = add nuw nsw i64 %indvars.iv66, 1
  %74 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv66
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sub nsw i32 %75, %77
  %79 = sitofp i32 %78 to double
  %80 = trunc i64 %indvars.iv66 to i32
  %81 = sub i32 %12, %80
  %82 = sitofp i32 %81 to double
  %83 = fdiv double %79, %82
  %84 = fadd double %store_forwarded, %83
  %85 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %indvars.iv66
  store double %84, ptr %85, align 8, !tbaa !9
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  %86 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv.next67
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sub nsw i32 %77, %87
  %89 = sitofp i32 %88 to double
  %90 = trunc i64 %indvars.iv.next67 to i32
  %91 = sub i32 %12, %90
  %92 = sitofp i32 %91 to double
  %93 = fdiv double %89, %92
  %94 = fadd double %84, %93
  %95 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %indvars.iv.next67
  store double %94, ptr %95, align 8, !tbaa !9
  %indvars.iv.next67.1 = add nsw i64 %indvars.iv66, -2
  %.not.1 = icmp eq i64 %indvars.iv.next67, 0
  br i1 %.not.1, label %._crit_edge56, label %.lr.ph55, !llvm.loop !14

._crit_edge61.loopexit:                           ; preds = %145
  %.pre72 = load double, ptr %2, align 8, !tbaa !9
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge51.thread, %._crit_edge61.loopexit, %._crit_edge56
  %96 = phi double [ %.pre72, %._crit_edge61.loopexit ], [ %72, %._crit_edge56 ], [ %17, %._crit_edge51.thread ]
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %96)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

.lr.ph60:                                         ; preds = %._crit_edge56, %145
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %145 ], [ 0, %._crit_edge56 ]
  %98 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %indvars.iv69
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %99 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %indvars.iv.next70
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull align 8 dereferenceable(8) %99)
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3lft, i64 0, i64 %indvars.iv.next70
  %103 = getelementptr inbounds [100009 x double], ptr @_ZZ5solvevE3rht, i64 0, i64 %indvars.iv69
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef nonnull align 8 dereferenceable(8) %103)
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = fsub double %101, %105
  %107 = call noundef i32 @_Z3sgnd(double noundef %106)
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %145, label %109

109:                                              ; preds = %.lr.ph60
  %110 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv.next70
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = getelementptr inbounds [100009 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv69
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 %111, %113
  %115 = sitofp i32 %114 to double
  %116 = load double, ptr %98, align 8, !tbaa !9
  %117 = fsub double %101, %116
  %118 = trunc nuw nsw i64 %indvars.iv.next70 to i32
  %119 = uitofp nneg i32 %118 to double
  %120 = fneg double %117
  %121 = call double @llvm.fmuladd.f64(double %120, double %119, double %115)
  %122 = load double, ptr %99, align 8, !tbaa !9
  %123 = fsub double %101, %122
  %124 = load i32, ptr %1, align 4, !tbaa !5
  %125 = trunc nuw nsw i64 %indvars.iv69 to i32
  %reass.sub = sub i32 %124, %125
  %126 = add i32 %reass.sub, 1
  %127 = sitofp i32 %126 to double
  %128 = fneg double %123
  %129 = call double @llvm.fmuladd.f64(double %128, double %127, double %121)
  %130 = call noundef i32 @_Z3sgnd(double noundef %129)
  %131 = icmp slt i32 %130, 0
  br i1 %131, label %145, label %132

132:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %133 = load i32, ptr %1, align 4, !tbaa !5
  %134 = add nsw i32 %133, 2
  %135 = sitofp i32 %134 to double
  %136 = fdiv double %129, %135
  %137 = fadd double %101, %136
  store double %137, ptr %3, align 8, !tbaa !9
  %138 = fsub double %137, %105
  %139 = call noundef i32 @_Z3sgnd(double noundef %138)
  %140 = icmp sgt i32 %139, 0
  br i1 %140, label %144, label %141

141:                                              ; preds = %132
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %143 = load double, ptr %142, align 8, !tbaa !9
  store double %143, ptr %2, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %132, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %145

145:                                              ; preds = %144, %109, %.lr.ph60
  %146 = load i32, ptr %1, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %.not43.not = icmp slt i64 %indvars.iv69, %147
  br i1 %.not43.not, label %.lr.ph60, label %._crit_edge61.loopexit, !llvm.loop !15
}

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

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


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