; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-13 (I - Little Zu Chongzhi's Triangles - 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.std::greater" = type { i8 }

@n = external dso_local global i32, align 4
@a = external dso_local global [19 x i32], align 16
@u = external dso_local global [19 x i8], align 16
@.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 double @_Z4calciii(i32 noundef, 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::greater", align 1
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %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
  br label %10

10:                                               ; preds = %137, %0
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %140

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %25, %14
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @a, i64 %22
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

28:                                               ; preds = %19
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr @a, i64 %30
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef @a, ptr noundef %31)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %41, %28
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %39
  store i8 0, ptr %40, align 1, !tbaa !11
  br label %41

41:                                               ; preds = %37
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !13

44:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store double 0.000000e+00, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %45

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

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

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %8, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %130, %50
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %9, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %126, %58
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %129

66:                                               ; preds = %61
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !11, !range !16, !noundef !17
  %71 = trunc i8 %70 to i1
  br i1 %71, label %125, label %72

72:                                               ; preds = %66
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !11, !range !16, !noundef !17
  %77 = trunc i8 %76 to i1
  br i1 %77, label %125, label %78

78:                                               ; preds = %72
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !11, !range !16, !noundef !17
  %83 = trunc i8 %82 to i1
  br i1 %83, label %125, label %84

84:                                               ; preds = %78
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %88, %92
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp sgt i32 %93, %97
  br i1 %98, label %99, label %124

99:                                               ; preds = %84
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %101
  store i8 1, ptr %102, align 1, !tbaa !11
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %104
  store i8 1, ptr %105, align 1, !tbaa !11
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %107
  store i8 1, ptr %108, align 1, !tbaa !11
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = call noundef double @_Z4calciii(i32 noundef %112, i32 noundef %116, i32 noundef %120)
  %122 = load double, ptr %5, align 8, !tbaa !14
  %123 = fadd double %122, %121
  store double %123, ptr %5, align 8, !tbaa !14
  br label %124

124:                                              ; preds = %99, %84
  br label %125

125:                                              ; preds = %124, %78, %72, %66
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %9, align 4, !tbaa !5
  br label %61, !llvm.loop !18

129:                                              ; preds = %65
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %8, align 4, !tbaa !5
  br label %53, !llvm.loop !19

133:                                              ; preds = %57
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %6, align 4, !tbaa !5
  br label %45, !llvm.loop !20

137:                                              ; preds = %49
  %138 = load double, ptr %5, align 8, !tbaa !14
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %138)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %10, !llvm.loop !21

140:                                              ; preds = %10
  ret i32 0
}

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

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

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!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"

@n = external dso_local global i32, align 4
@a = external dso_local global [19 x i32], align 16
@u = external dso_local local_unnamed_addr global [19 x i8], align 16
@.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 double @_Z4calciii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not54 = icmp eq i32 %2, 0
  br i1 %.not54, label %._crit_edge55, label %.preheader34

.preheader34:                                     ; preds = %0, %._crit_edge52
  %3 = phi i32 [ %18, %._crit_edge52 ], [ %2, %0 ]
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader34.._crit_edge_crit_edge

.preheader34.._crit_edge_crit_edge:               ; preds = %.preheader34
  %.pre78 = sext i32 %3 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader34.._crit_edge_crit_edge
  %.pre-phi79 = phi i64 [ %.pre78, %.preheader34.._crit_edge_crit_edge ], [ %11, %.lr.ph ]
  %5 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi79
  tail call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull @a, ptr noundef nonnull %5)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph51.preheader, label %._crit_edge52

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

.lr.ph51.preheader:                               ; preds = %._crit_edge
  %13 = zext nneg i32 %6 to i64
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @u, i8 0, i64 %13, i1 false), !tbaa !11
  br label %.lr.ph51

.loopexit33.loopexit:                             ; preds = %.loopexit
  %.pre77 = sext i32 %24 to i64
  br label %.loopexit33

.loopexit33:                                      ; preds = %.loopexit33.loopexit, %.lr.ph51
  %.pre-phi = phi i64 [ %.pre77, %.loopexit33.loopexit ], [ %20, %.lr.ph51 ]
  %14 = phi i32 [ %24, %.loopexit33.loopexit ], [ %19, %.lr.ph51 ]
  %.1.lcssa = phi double [ %.2.lcssa, %.loopexit33.loopexit ], [ %.02949, %.lr.ph51 ]
  %15 = icmp slt i64 %indvars.iv.next75, %.pre-phi
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  br i1 %15, label %.lr.ph51, label %._crit_edge52, !llvm.loop !13

._crit_edge52:                                    ; preds = %.loopexit33, %._crit_edge
  %.029.lcssa = phi double [ 0.000000e+00, %._crit_edge ], [ %.1.lcssa, %.loopexit33 ]
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %.029.lcssa)
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %._crit_edge55, label %.preheader34, !llvm.loop !14

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %.loopexit33
  %19 = phi i32 [ %6, %.lr.ph51.preheader ], [ %14, %.loopexit33 ]
  %indvars.iv74 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next75, %.loopexit33 ]
  %indvars.iv69 = phi i64 [ 1, %.lr.ph51.preheader ], [ %indvars.iv.next70, %.loopexit33 ]
  %indvars.iv62 = phi i64 [ 2, %.lr.ph51.preheader ], [ %indvars.iv.next63, %.loopexit33 ]
  %.02949 = phi double [ 0.000000e+00, %.lr.ph51.preheader ], [ %.1.lcssa, %.loopexit33 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next75, %20
  br i1 %21, label %.lr.ph47, label %.loopexit33

.lr.ph47:                                         ; preds = %.lr.ph51
  %22 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %indvars.iv74
  %23 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %indvars.iv74
  br label %27

.loopexit:                                        ; preds = %58, %.lr.ph42, %27
  %24 = phi i32 [ %28, %27 ], [ %28, %.lr.ph42 ], [ %59, %58 ]
  %25 = phi i32 [ %29, %27 ], [ %29, %.lr.ph42 ], [ %60, %58 ]
  %.2.lcssa = phi double [ %.144, %27 ], [ %.144, %.lr.ph42 ], [ %.3, %58 ]
  %26 = icmp sgt i32 %25, %30
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  br i1 %26, label %27, label %.loopexit33.loopexit, !llvm.loop !15

27:                                               ; preds = %.lr.ph47, %.loopexit
  %28 = phi i32 [ %19, %.lr.ph47 ], [ %24, %.loopexit ]
  %29 = phi i32 [ %19, %.lr.ph47 ], [ %25, %.loopexit ]
  %indvars.iv71 = phi i64 [ %indvars.iv69, %.lr.ph47 ], [ %indvars.iv.next72, %.loopexit ]
  %indvars.iv64 = phi i64 [ %indvars.iv62, %.lr.ph47 ], [ %indvars.iv.next65, %.loopexit ]
  %.144 = phi double [ %.02949, %.lr.ph47 ], [ %.2.lcssa, %.loopexit ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %30 = trunc nuw i64 %indvars.iv.next72 to i32
  %31 = icmp sgt i32 %29, %30
  br i1 %31, label %.lr.ph42, label %.loopexit

.lr.ph42:                                         ; preds = %27
  %32 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %indvars.iv71
  %33 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %indvars.iv71
  %34 = load i8, ptr %22, align 1, !tbaa !11, !range !16, !noundef !17
  %35 = trunc nuw i8 %34 to i1
  br i1 %35, label %.loopexit, label %.lr.ph42.split

.lr.ph42.split:                                   ; preds = %.lr.ph42, %58
  %36 = phi i32 [ %59, %58 ], [ %28, %.lr.ph42 ]
  %37 = phi i32 [ %60, %58 ], [ %29, %.lr.ph42 ]
  %38 = phi i32 [ %61, %58 ], [ %29, %.lr.ph42 ]
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %58 ], [ %indvars.iv64, %.lr.ph42 ]
  %.239 = phi double [ %.3, %58 ], [ %.144, %.lr.ph42 ]
  %39 = load i8, ptr %22, align 1, !tbaa !11, !range !16, !noundef !17
  %40 = trunc nuw i8 %39 to i1
  br i1 %40, label %58, label %41

41:                                               ; preds = %.lr.ph42.split
  %42 = load i8, ptr %32, align 1, !tbaa !11, !range !16, !noundef !17
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %58, label %44

44:                                               ; preds = %41
  %45 = getelementptr inbounds [19 x i8], ptr @u, i64 0, i64 %indvars.iv66
  %46 = load i8, ptr %45, align 1, !tbaa !11, !range !16, !noundef !17
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %58, label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %33, align 4, !tbaa !5
  %50 = getelementptr inbounds [19 x i32], ptr @a, i64 0, i64 %indvars.iv66
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, %49
  %53 = load i32, ptr %23, align 4, !tbaa !5
  %54 = icmp sgt i32 %52, %53
  br i1 %54, label %55, label %58

55:                                               ; preds = %48
  store i8 1, ptr %45, align 1, !tbaa !11
  store i8 1, ptr %32, align 1, !tbaa !11
  store i8 1, ptr %22, align 1, !tbaa !11
  %56 = tail call noundef double @_Z4calciii(i32 noundef %53, i32 noundef %49, i32 noundef %51)
  %57 = fadd double %.239, %56
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %.lr.ph42.split, %41, %44, %55, %48
  %59 = phi i32 [ %36, %.lr.ph42.split ], [ %36, %41 ], [ %36, %44 ], [ %.pre, %55 ], [ %36, %48 ]
  %60 = phi i32 [ %37, %.lr.ph42.split ], [ %37, %41 ], [ %37, %44 ], [ %.pre, %55 ], [ %37, %48 ]
  %61 = phi i32 [ %38, %.lr.ph42.split ], [ %38, %41 ], [ %38, %44 ], [ %.pre, %55 ], [ %38, %48 ]
  %.3 = phi double [ %.239, %.lr.ph42.split ], [ %.239, %41 ], [ %.239, %44 ], [ %57, %55 ], [ %.239, %48 ]
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %62 = trunc nuw i64 %indvars.iv.next67 to i32
  %63 = icmp sgt i32 %61, %62
  br i1 %63, label %.lr.ph42.split, label %.loopexit, !llvm.loop !18

._crit_edge55:                                    ; preds = %._crit_edge52, %0
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #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 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 nounwind willreturn memory(argmem: write) }

!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 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !10, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}


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