; LLVM IR from tangjz/acm-icpc :: lydsy (2671)

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

@tot = external dso_local global i32, align 4
@prime = external dso_local global [316229 x i32], align 16
@last = external dso_local global [316229 x i32], align 16
@n = external dso_local global i32, align 4
@sqn = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@d = external dso_local global [11 x i32], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5calc2ii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %10)
  %12 = call double @llvm.ceil.f64(double %11)
  %13 = fptosi double %12 to i32
  store i32 %13, ptr @sqn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %79, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @sqn, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %82

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %34, label %25

25:                                               ; preds = %19
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr @tot, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %32
  store i32 %26, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %25, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %35 = load i32, ptr @sqn, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sdiv i32 %35, %36
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %74, %34
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr @tot, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %49

42:                                               ; preds = %38
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br label %49

49:                                               ; preds = %42, %38
  %50 = phi i1 [ false, %38 ], [ %48, %42 ]
  br i1 %50, label %52, label %51

51:                                               ; preds = %49
  store i32 5, ptr %3, align 4
  br label %77

52:                                               ; preds = %49
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = mul nsw i32 %57, %61
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %63
  store i32 %56, ptr %64, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = srem i32 %65, %69
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %52
  store i32 5, ptr %3, align 4
  br label %77

73:                                               ; preds = %52
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %4, align 4, !tbaa !5
  br label %38, !llvm.loop !9

77:                                               ; preds = %72, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !11

82:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %179, %82
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sdiv i32 %86, %87
  store i32 %88, ptr @T, align 4, !tbaa !5
  %89 = icmp sle i32 %85, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %83
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %182

91:                                               ; preds = %83
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %92 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %92, ptr %7, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %117, %91
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = icmp sgt i32 %94, 1
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %124

97:                                               ; preds = %93
  %98 = load i32, ptr @cnt, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = icmp ne i32 %101, %105
  br i1 %106, label %107, label %116

107:                                              ; preds = %97
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr @cnt, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr @cnt, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %114
  store i32 %111, ptr %115, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %107, %97
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sdiv i32 %122, %121
  store i32 %123, ptr %7, align 4, !tbaa !5
  br label %93, !llvm.loop !12

124:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %125 = load i32, ptr @cnt, align 4, !tbaa !5
  %126 = shl i32 1, %125
  %127 = sitofp i32 %126 to double
  %128 = load i32, ptr @T, align 4, !tbaa !5
  %129 = sitofp i32 %128 to double
  %130 = fmul double %127, %129
  %131 = load i32, ptr @cnt, align 4, !tbaa !5
  %132 = sitofp i32 %131 to double
  %133 = fdiv double %130, %132
  %134 = call double @sqrt(double noundef %133) #8
  %135 = fptosi double %134 to i32
  store i32 %135, ptr %8, align 4, !tbaa !5
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = icmp sle i32 %136, %137
  br i1 %138, label %139, label %148

139:                                              ; preds = %124
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = mul nsw i32 2, %142
  %144 = sub nsw i32 %143, 1
  %145 = call noundef i64 @_Z5calc2ii(i32 noundef %141, i32 noundef %144)
  %146 = load i64, ptr @ans, align 8, !tbaa !13
  %147 = add nsw i64 %146, %145
  store i64 %147, ptr @ans, align 8, !tbaa !13
  br label %178

148:                                              ; preds = %124
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = mul nsw i32 2, %151
  %153 = icmp sge i32 %150, %152
  br i1 %153, label %154, label %163

154:                                              ; preds = %148
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = mul nsw i32 2, %157
  %159 = sub nsw i32 %158, 1
  %160 = call noundef i64 @_Z5calc1ii(i32 noundef %156, i32 noundef %159)
  %161 = load i64, ptr @ans, align 8, !tbaa !13
  %162 = add nsw i64 %161, %160
  store i64 %162, ptr @ans, align 8, !tbaa !13
  br label %177

163:                                              ; preds = %148
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = call noundef i64 @_Z5calc1ii(i32 noundef %165, i32 noundef %166)
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = mul nsw i32 2, %170
  %172 = sub nsw i32 %171, 1
  %173 = call noundef i64 @_Z5calc2ii(i32 noundef %169, i32 noundef %172)
  %174 = add nsw i64 %167, %173
  %175 = load i64, ptr @ans, align 8, !tbaa !13
  %176 = add nsw i64 %175, %174
  store i64 %176, ptr @ans, align 8, !tbaa !13
  br label %177

177:                                              ; preds = %163, %154
  br label %178

178:                                              ; preds = %177, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %6, align 4, !tbaa !5
  br label %83, !llvm.loop !15

182:                                              ; preds = %90
  %183 = load i64, ptr @ans, align 8, !tbaa !13
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %183)
  ret i32 0
}

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

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

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

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

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

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

@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [316229 x i32], align 16
@last = external dso_local local_unnamed_addr global [316229 x i32], align 16
@n = external dso_local global i32, align 4
@sqn = external dso_local local_unnamed_addr global i32, align 4
@T = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@d = external dso_local local_unnamed_addr global [11 x i32], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z5calc2ii(i32 noundef, i32 noundef) local_unnamed_addr #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 @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %2)
  %4 = tail call double @llvm.ceil.f64(double %3)
  %5 = fptosi double %4 to i32
  store i32 %5, ptr @sqn, align 4, !tbaa !5
  %.not54 = icmp slt i32 %5, 2
  br i1 %.not54, label %.preheader, label %.lr.ph56.preheader

.lr.ph56.preheader:                               ; preds = %0
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %6 = add nuw i32 %5, 1
  %wide.trip.count = zext i32 %6 to i64
  br label %.lr.ph56

.preheader:                                       ; preds = %.critedge, %0
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = sdiv i32 %7, 2
  store i32 %8, ptr @T, align 4, !tbaa !5
  %.not45.not58 = icmp sgt i32 %7, 5
  br i1 %.not45.not58, label %.lr.ph60, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = load i64, ptr @ans, align 8, !tbaa !9
  br label %._crit_edge

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %.critedge
  %indvars.iv62 = phi i64 [ 2, %.lr.ph56.preheader ], [ %indvars.iv.next63, %.critedge ]
  %9 = phi i32 [ %tot.promoted, %.lr.ph56.preheader ], [ %18, %.critedge ]
  %10 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %indvars.iv62
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %.not49 = icmp eq i32 %11, 0
  %12 = trunc nuw nsw i64 %indvars.iv62 to i32
  br i1 %.not49, label %13, label %.lr.ph56._crit_edge

13:                                               ; preds = %.lr.ph56
  store i32 %12, ptr %10, align 4, !tbaa !5
  %14 = add nsw i32 %9, 1
  store i32 %14, ptr @tot, align 4, !tbaa !5
  %15 = sext i32 %9 to i64
  %16 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %15
  store i32 %12, ptr %16, align 4, !tbaa !5
  br label %.lr.ph56._crit_edge

.lr.ph56._crit_edge:                              ; preds = %.lr.ph56, %13
  %17 = phi i32 [ %12, %13 ], [ %11, %.lr.ph56 ]
  %18 = phi i32 [ %14, %13 ], [ %9, %.lr.ph56 ]
  %19 = udiv i32 %5, %12
  %20 = icmp sgt i32 %18, 0
  br i1 %20, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.lr.ph56._crit_edge
  %21 = zext nneg i32 %18 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %24 ]
  %22 = getelementptr inbounds [316229 x i32], ptr @prime, i64 0, i64 %indvars.iv
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not50 = icmp sgt i32 %23, %19
  br i1 %.not50, label %.critedge, label %24

24:                                               ; preds = %.lr.ph
  %25 = mul nsw i32 %23, %12
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %26
  store i32 %17, ptr %27, align 4, !tbaa !5
  %28 = srem i32 %12, %23
  %29 = icmp ne i32 %28, 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = icmp ult i64 %indvars.iv.next, %21
  %or.cond = select i1 %29, i1 %30, i1 false
  br i1 %or.cond, label %.lr.ph, label %.critedge, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph, %24, %.lr.ph56._crit_edge
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph56, !llvm.loop !13

._crit_edge:                                      ; preds = %81, %.preheader.._crit_edge_crit_edge
  %31 = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %.sink, %81 ]
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %31)
  ret i32 0

.lr.ph60:                                         ; preds = %.preheader, %81
  %33 = phi i32 [ %84, %81 ], [ %8, %.preheader ]
  %34 = phi i32 [ %82, %81 ], [ 3, %.preheader ]
  %.03759 = phi i32 [ %34, %81 ], [ 2, %.preheader ]
  store i32 0, ptr @cnt, align 4, !tbaa !5
  br label %44

35:                                               ; preds = %56
  %36 = shl nuw i32 1, %57
  %37 = sitofp i32 %36 to double
  %38 = sitofp i32 %33 to double
  %39 = fmul double %38, %37
  %40 = sitofp i32 %57 to double
  %41 = fdiv double %39, %40
  %42 = tail call double @sqrt(double noundef %41) #7
  %43 = fptosi double %42 to i32
  %.not46 = icmp slt i32 %.03759, %43
  br i1 %.not46, label %66, label %60

44:                                               ; preds = %.lr.ph60, %56
  %.03657 = phi i32 [ %.03759, %.lr.ph60 ], [ %58, %56 ]
  %45 = phi i32 [ 0, %.lr.ph60 ], [ %57, %56 ]
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = zext nneg i32 %.03657 to i64
  %50 = getelementptr inbounds [316229 x i32], ptr @last, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %.not48 = icmp eq i32 %48, %51
  br i1 %.not48, label %56, label %52

52:                                               ; preds = %44
  %53 = add nsw i32 %45, 1
  store i32 %53, ptr @cnt, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [11 x i32], ptr @d, i64 0, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %44, %52
  %57 = phi i32 [ %45, %44 ], [ %53, %52 ]
  %58 = sdiv i32 %.03657, %51
  %59 = icmp sgt i32 %58, 1
  br i1 %59, label %44, label %35, !llvm.loop !14

60:                                               ; preds = %35
  %61 = shl nuw nsw i32 %.03759, 1
  %62 = add nsw i32 %61, -1
  %63 = tail call noundef i64 @_Z5calc2ii(i32 noundef %34, i32 noundef %62)
  %64 = load i64, ptr @ans, align 8, !tbaa !9
  %65 = add nsw i64 %64, %63
  br label %81

66:                                               ; preds = %35
  %67 = add nsw i32 %43, 1
  %68 = shl nuw nsw i32 %.03759, 1
  %.not47 = icmp slt i32 %67, %68
  br i1 %.not47, label %74, label %69

69:                                               ; preds = %66
  %70 = add nsw i32 %68, -1
  %71 = tail call noundef i64 @_Z5calc1ii(i32 noundef %34, i32 noundef %70)
  %72 = load i64, ptr @ans, align 8, !tbaa !9
  %73 = add nsw i64 %72, %71
  br label %81

74:                                               ; preds = %66
  %75 = tail call noundef i64 @_Z5calc1ii(i32 noundef %34, i32 noundef %43)
  %76 = add nsw i32 %68, -1
  %77 = tail call noundef i64 @_Z5calc2ii(i32 noundef %67, i32 noundef %76)
  %78 = add nsw i64 %77, %75
  %79 = load i64, ptr @ans, align 8, !tbaa !9
  %80 = add nsw i64 %78, %79
  br label %81

81:                                               ; preds = %69, %74, %60
  %.sink = phi i64 [ %73, %69 ], [ %80, %74 ], [ %65, %60 ]
  store i64 %.sink, ptr @ans, align 8, !tbaa !9
  %82 = add nuw nsw i32 %34, 1
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = sdiv i32 %83, %34
  store i32 %84, ptr @T, align 4, !tbaa !5
  %.not45.not = icmp slt i32 %34, %84
  br i1 %.not45.not, label %.lr.ph60, label %._crit_edge, !llvm.loop !15
}

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

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !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: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass