; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-01 (D)

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

@_ZL2pi = external hidden global double, align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [10010 x double], align 16
@ans = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5checkd(double 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: nounwind
declare double @acos(double 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %15

15:                                               ; preds = %140, %138, %0
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr @t, align 4, !tbaa !5
  %18 = icmp ne i32 %16, 0
  br i1 %18, label %19, label %141

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

21:                                               ; preds = %31, %19
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds double, ptr @a, i64 %28
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

34:                                               ; preds = %25
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds double, ptr @a, i64 %36
  call void @_ZSt4sortIPdEvT_S1_(ptr noundef @a, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store double 0.000000e+00, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store double 1.000000e+04, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 0, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %63, %34
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 233
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i32 7, ptr %8, align 4
  br label %66

42:                                               ; preds = %38
  %43 = load double, ptr %3, align 8, !tbaa !11
  %44 = load double, ptr %4, align 8, !tbaa !11
  %45 = fadd double %43, %44
  %46 = fdiv double %45, 2.000000e+00
  store double %46, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %47 = load double, ptr %5, align 8, !tbaa !11
  %48 = call noundef i32 @_Z5checkd(double noundef %47)
  store i32 %48, ptr %9, align 4, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %42
  store i8 1, ptr %6, align 1, !tbaa !13
  store i32 7, ptr %8, align 4
  br label %60

52:                                               ; preds = %42
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %52
  %56 = load double, ptr %5, align 8, !tbaa !11
  store double %56, ptr %3, align 8, !tbaa !11
  br label %59

57:                                               ; preds = %52
  %58 = load double, ptr %5, align 8, !tbaa !11
  store double %58, ptr %4, align 8, !tbaa !11
  br label %59

59:                                               ; preds = %57, %55
  store i32 0, ptr %8, align 4
  br label %60

60:                                               ; preds = %59, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %61 = load i32, ptr %8, align 4
  switch i32 %61, label %66 [
    i32 0, label %62
  ]

62:                                               ; preds = %60
  br label %63

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

66:                                               ; preds = %60, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %67

67:                                               ; preds = %66
  %68 = load i8, ptr %6, align 1, !tbaa !13, !range !16, !noundef !17
  %69 = trunc i8 %68 to i1
  br i1 %69, label %72, label %70

70:                                               ; preds = %67
  %71 = call i32 @puts(ptr noundef @.str.2)
  store i32 2, ptr %8, align 4
  br label %138, !llvm.loop !18

72:                                               ; preds = %67
  store double 0.000000e+00, ptr @ans, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store double 0.000000e+00, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %129, %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 10, ptr %8, align 4
  br label %132

78:                                               ; preds = %73
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [10010 x double], ptr @a, i64 0, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !11
  %83 = load double, ptr %5, align 8, !tbaa !11
  %84 = fmul double 2.000000e+00, %83
  %85 = fcmp ogt double %82, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %78
  store i32 1, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %132

87:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10010 x double], ptr @a, i64 0, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load double, ptr %5, align 8, !tbaa !11
  %93 = fdiv double %91, %92
  %94 = call noundef double @_Z3sqrd(double noundef %93)
  %95 = fdiv double %94, 2.000000e+00
  %96 = fsub double 1.000000e+00, %95
  %97 = call double @acos(double noundef %96) #6
  store double %97, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %98 = load double, ptr %5, align 8, !tbaa !11
  %99 = call noundef double @_Z3sqrd(double noundef %98)
  %100 = load double, ptr %12, align 8, !tbaa !11
  %101 = call double @sin(double noundef %100) #6
  %102 = fmul double %99, %101
  %103 = fdiv double %102, 2.000000e+00
  store double %103, ptr %13, align 8, !tbaa !11
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = icmp eq i32 %105, %106
  br i1 %107, label %108, label %121

108:                                              ; preds = %87
  %109 = load double, ptr %10, align 8, !tbaa !11
  %110 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %111 = fcmp olt double %109, %110
  br i1 %111, label %112, label %115

112:                                              ; preds = %108
  %113 = load double, ptr %13, align 8, !tbaa !11
  %114 = fneg double %113
  br label %117

115:                                              ; preds = %108
  %116 = load double, ptr %13, align 8, !tbaa !11
  br label %117

117:                                              ; preds = %115, %112
  %118 = phi double [ %114, %112 ], [ %116, %115 ]
  %119 = load double, ptr @ans, align 8, !tbaa !11
  %120 = fadd double %119, %118
  store double %120, ptr @ans, align 8, !tbaa !11
  br label %128

121:                                              ; preds = %87
  %122 = load double, ptr %12, align 8, !tbaa !11
  %123 = load double, ptr %10, align 8, !tbaa !11
  %124 = fadd double %123, %122
  store double %124, ptr %10, align 8, !tbaa !11
  %125 = load double, ptr %13, align 8, !tbaa !11
  %126 = load double, ptr @ans, align 8, !tbaa !11
  %127 = fadd double %126, %125
  store double %127, ptr @ans, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %121, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %129

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

132:                                              ; preds = %86, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %133 = load i32, ptr %8, align 4
  switch i32 %133, label %137 [
    i32 10, label %134
  ]

134:                                              ; preds = %132
  %135 = load double, ptr @ans, align 8, !tbaa !11
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %135)
  store i32 0, ptr %8, align 4
  br label %137

137:                                              ; preds = %134, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %138

138:                                              ; preds = %137, %70
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %139 = load i32, ptr %8, align 4
  switch i32 %139, label %144 [
    i32 0, label %140
    i32 2, label %15
    i32 1, label %142
  ]

140:                                              ; preds = %138
  br label %15, !llvm.loop !18

141:                                              ; preds = %15
  store i32 0, ptr %1, align 4
  br label %142

142:                                              ; preds = %141, %138
  %143 = load i32, ptr %1, align 4
  ret i32 %143

144:                                              ; preds = %138
  unreachable
}

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

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

declare i32 @puts(ptr noundef) #4

; Function Attrs: nounwind
declare double @sin(double noundef) #2

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 = { 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 = { 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 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 = { 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, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

@_ZL2pi = external hidden local_unnamed_addr global double, align 8
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [10010 x double], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) 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
  %.not83 = icmp eq i32 %2, 0
  br i1 %.not83, label %.thread65, label %.lr.ph85

.lr.ph85:                                         ; preds = %0, %58
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.lr.ph85.._crit_edge_crit_edge

.lr.ph85.._crit_edge_crit_edge:                   ; preds = %.lr.ph85
  %.pre = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph85.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph85.._crit_edge_crit_edge ], [ %12, %.lr.ph ]
  %7 = getelementptr inbounds double, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPdEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  %8 = tail call noundef i32 @_Z5checkd(double noundef 5.000000e+03)
  %.not56.not97 = icmp eq i32 %8, 0
  br i1 %.not56.not97, label %.thread, label %.lr.ph101

.lr.ph:                                           ; preds = %.lr.ph85, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph85 ]
  %9 = getelementptr inbounds double, ptr @a, i64 %indvars.iv
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !9

14:                                               ; preds = %.lr.ph101
  %15 = icmp sgt i32 %19, 0
  %.050. = select i1 %15, double %.05074100, double %20
  %..036 = select i1 %15, double %20, double %.0367698
  %16 = fadd double %.050., %..036
  %17 = fmul double %16, 5.000000e-01
  %18 = tail call noundef i32 @_Z5checkd(double noundef %17)
  %.not56.not = icmp eq i32 %18, 0
  br i1 %.not56.not, label %.thread.loopexit, label %.lr.ph101, !llvm.loop !11

.lr.ph101:                                        ; preds = %._crit_edge, %14
  %19 = phi i32 [ %18, %14 ], [ %8, %._crit_edge ]
  %20 = phi double [ %17, %14 ], [ 5.000000e+03, %._crit_edge ]
  %.05074100 = phi double [ %.050., %14 ], [ 1.000000e+04, %._crit_edge ]
  %.0437599 = phi i32 [ %21, %14 ], [ 0, %._crit_edge ]
  %.0367698 = phi double [ %..036, %14 ], [ 0.000000e+00, %._crit_edge ]
  %21 = add nuw nsw i32 %.0437599, 1
  %exitcond.not = icmp eq i32 %21, 233
  br i1 %exitcond.not, label %.thread.loopexit, label %14, !llvm.loop !11

.thread.loopexit:                                 ; preds = %14, %.lr.ph101
  %.lcssa96.ph = phi double [ %20, %.lr.ph101 ], [ %17, %14 ]
  %22 = icmp ult i32 %.0437599, 232
  br label %.thread

.thread:                                          ; preds = %.thread.loopexit, %._crit_edge
  %.lcssa96 = phi double [ 5.000000e+03, %._crit_edge ], [ %.lcssa96.ph, %.thread.loopexit ]
  %.lcssa71 = phi i1 [ true, %._crit_edge ], [ %22, %.thread.loopexit ]
  br i1 %.lcssa71, label %.preheader, label %25

.preheader:                                       ; preds = %.thread
  store double 0.000000e+00, ptr @ans, align 8, !tbaa !12
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %.not5877 = icmp sgt i32 %23, 0
  br i1 %.not5877, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %.preheader
  %24 = fmul double %.lcssa96, 2.000000e+00
  br label %27

25:                                               ; preds = %.thread
  %26 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %58, !llvm.loop !14

27:                                               ; preds = %.lr.ph80, %55
  %indvars.iv90 = phi i64 [ 0, %.lr.ph80 ], [ %indvars.iv.next91, %55 ]
  %.03478 = phi double [ 0.000000e+00, %.lr.ph80 ], [ %.135, %55 ]
  %28 = getelementptr inbounds [10010 x double], ptr @a, i64 0, i64 %indvars.iv90
  %29 = load double, ptr %28, align 8, !tbaa !12
  %30 = fcmp ogt double %29, %24
  br i1 %30, label %.thread65, label %31

31:                                               ; preds = %27
  %32 = fdiv double %29, %.lcssa96
  %33 = tail call noundef double @_Z3sqrd(double noundef %32)
  %34 = fmul double %33, 5.000000e-01
  %35 = fsub double 1.000000e+00, %34
  %36 = tail call double @acos(double noundef %35) #5
  %37 = tail call noundef double @_Z3sqrd(double noundef %.lcssa96)
  %38 = tail call double @sin(double noundef %36) #5
  %39 = fmul double %37, %38
  %40 = fmul double %39, 5.000000e-01
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = icmp eq i64 %indvars.iv.next91, %42
  br i1 %43, label %44, label %51

44:                                               ; preds = %31
  %45 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %46 = fcmp olt double %.03478, %45
  %47 = fneg double %40
  %48 = select i1 %46, double %47, double %40
  %49 = load double, ptr @ans, align 8, !tbaa !12
  %50 = fadd double %49, %48
  br label %55

51:                                               ; preds = %31
  %52 = fadd double %.03478, %36
  %53 = load double, ptr @ans, align 8, !tbaa !12
  %54 = fadd double %40, %53
  br label %55

55:                                               ; preds = %51, %44
  %storemerge = phi double [ %54, %51 ], [ %50, %44 ]
  %.135 = phi double [ %52, %51 ], [ %.03478, %44 ]
  store double %storemerge, ptr @ans, align 8, !tbaa !12
  %56 = sext i32 %41 to i64
  %.not58 = icmp slt i64 %indvars.iv.next91, %56
  br i1 %.not58, label %27, label %._crit_edge81, !llvm.loop !15

._crit_edge81:                                    ; preds = %55, %.preheader
  %storemerge57.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %storemerge, %55 ]
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %storemerge57.lcssa)
  br label %58

58:                                               ; preds = %._crit_edge81, %25
  %59 = load i32, ptr @t, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %59, 0
  br i1 %.not, label %.thread65, label %.lr.ph85

.thread65:                                        ; preds = %58, %27, %0
  %.3 = phi i32 [ 0, %0 ], [ 1, %27 ], [ 0, %58 ]
  ret i32 %.3
}

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

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

; 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 @sin(double noundef) local_unnamed_addr #1

; 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 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 #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 = { nounwind }

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

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


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