; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-07-08/upsolved (F - Sputnik - tjz)

; 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 double, align 8
@T = external dso_local global double, align 8
@Tmax = external dso_local global double, align 8
@alpha = external dso_local global double, align 8
@phi = external dso_local global double, align 8
@lambda = external dso_local global double, align 8
@delta = external dso_local global double, align 8
@cos_alpha = external dso_local global double, align 8
@sin_alpha = external dso_local global double, align 8
@cos_phi = external dso_local global double, align 8
@sin_phi = external dso_local global double, align 8
@cos_delta = external dso_local global double, align 8
@Tx = external dso_local global double, align 8
@tau = external dso_local global double, align 8
@vx = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %13 = load ptr, ptr @stdin, align 8, !tbaa !5
  %14 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %13)
  %15 = load ptr, ptr @stdout, align 8, !tbaa !5
  %16 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %15)
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @t, ptr noundef @T, ptr noundef @Tmax, ptr noundef @alpha, ptr noundef @phi, ptr noundef @lambda, ptr noundef @delta)
  %18 = load double, ptr @Tmax, align 8, !tbaa !9
  %19 = load double, ptr @t, align 8, !tbaa !9
  %20 = fmul double 2.000000e+00, %19
  %21 = fcmp olt double %18, %20
  br i1 %21, label %22, label %24

22:                                               ; preds = %0
  %23 = call i32 @puts(ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  br label %176

24:                                               ; preds = %0
  %25 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %26 = fdiv double %25, 1.800000e+02
  %27 = load double, ptr @alpha, align 8, !tbaa !9
  %28 = fmul double %27, %26
  store double %28, ptr @alpha, align 8, !tbaa !9
  %29 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %30 = fdiv double %29, 1.800000e+02
  %31 = load double, ptr @phi, align 8, !tbaa !9
  %32 = fmul double %31, %30
  store double %32, ptr @phi, align 8, !tbaa !9
  %33 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %34 = fdiv double %33, 1.800000e+02
  %35 = load double, ptr @lambda, align 8, !tbaa !9
  %36 = fmul double %35, %34
  store double %36, ptr @lambda, align 8, !tbaa !9
  %37 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %38 = fdiv double %37, 1.800000e+02
  %39 = load double, ptr @delta, align 8, !tbaa !9
  %40 = fmul double %39, %38
  store double %40, ptr @delta, align 8, !tbaa !9
  %41 = load double, ptr @alpha, align 8, !tbaa !9
  %42 = call double @cos(double noundef %41) #6
  store double %42, ptr @cos_alpha, align 8, !tbaa !9
  %43 = load double, ptr @alpha, align 8, !tbaa !9
  %44 = call double @sin(double noundef %43) #6
  store double %44, ptr @sin_alpha, align 8, !tbaa !9
  %45 = load double, ptr @phi, align 8, !tbaa !9
  %46 = call double @cos(double noundef %45) #6
  store double %46, ptr @cos_phi, align 8, !tbaa !9
  %47 = load double, ptr @phi, align 8, !tbaa !9
  %48 = call double @sin(double noundef %47) #6
  store double %48, ptr @sin_phi, align 8, !tbaa !9
  %49 = load double, ptr @delta, align 8, !tbaa !9
  %50 = call double @cos(double noundef %49) #6
  store double %50, ptr @cos_delta, align 8, !tbaa !9
  %51 = load double, ptr @T, align 8, !tbaa !9
  %52 = load double, ptr @t, align 8, !tbaa !9
  %53 = fmul double %51, %52
  %54 = load double, ptr @T, align 8, !tbaa !9
  %55 = load double, ptr @t, align 8, !tbaa !9
  %56 = fsub double %54, %55
  %57 = fdiv double %53, %56
  store double %57, ptr @Tx, align 8, !tbaa !9
  call void @_Z13locateVolcanod(double noundef 0.000000e+00)
  %58 = load double, ptr @vx, align 8, !tbaa !9
  %59 = call double @acos(double noundef %58) #6
  store double %59, ptr @tau, align 8, !tbaa !9
  %60 = load double, ptr @phi, align 8, !tbaa !9
  %61 = fcmp olt double %60, 0.000000e+00
  br i1 %61, label %62, label %65

62:                                               ; preds = %24
  %63 = load double, ptr @tau, align 8, !tbaa !9
  %64 = fneg double %63
  store double %64, ptr @tau, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %62, %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %171, %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %67 = load double, ptr @Tx, align 8, !tbaa !9
  %68 = load i32, ptr %2, align 4, !tbaa !11
  %69 = sitofp i32 %68 to double
  %70 = fsub double %69, 4.990000e-01
  %71 = fmul double %67, %70
  store double %71, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %72 = load double, ptr @Tx, align 8, !tbaa !9
  %73 = load i32, ptr %2, align 4, !tbaa !11
  %74 = sitofp i32 %73 to double
  %75 = fadd double %74, 4.990000e-01
  %76 = fmul double %72, %75
  store double %76, ptr %4, align 8, !tbaa !9
  %77 = load double, ptr %4, align 8, !tbaa !9
  %78 = load double, ptr @t, align 8, !tbaa !9
  %79 = fmul double 2.000000e+00, %78
  %80 = fcmp olt double %77, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %66
  store i32 4, ptr %5, align 4
  br label %169

82:                                               ; preds = %66
  %83 = load double, ptr %4, align 8, !tbaa !9
  %84 = load double, ptr @Tmax, align 8, !tbaa !9
  %85 = fcmp ogt double %83, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %82
  %87 = load double, ptr @Tmax, align 8, !tbaa !9
  store double %87, ptr %4, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %86, %82
  br label %89

89:                                               ; preds = %88
  %90 = load double, ptr %3, align 8, !tbaa !9
  %91 = load double, ptr @t, align 8, !tbaa !9
  %92 = fmul double 2.000000e+00, %91
  %93 = fcmp olt double %90, %92
  br i1 %93, label %94, label %97

94:                                               ; preds = %89
  %95 = load double, ptr @t, align 8, !tbaa !9
  %96 = fmul double 2.000000e+00, %95
  store double %96, ptr %3, align 8, !tbaa !9
  br label %104

97:                                               ; preds = %89
  %98 = load double, ptr %3, align 8, !tbaa !9
  %99 = load double, ptr @Tmax, align 8, !tbaa !9
  %100 = fcmp ogt double %98, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %97
  %102 = call i32 @puts(ptr noundef @.str.5)
  store i32 2, ptr %5, align 4
  br label %169

103:                                              ; preds = %97
  br label %104

104:                                              ; preds = %103, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %105 = load double, ptr %3, align 8, !tbaa !9
  store double %105, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %133, %104
  %107 = load i32, ptr %7, align 4, !tbaa !11
  %108 = icmp slt i32 %107, 100
  br i1 %108, label %110, label %109

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

110:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %111 = load double, ptr %3, align 8, !tbaa !9
  %112 = load double, ptr %4, align 8, !tbaa !9
  %113 = load double, ptr %3, align 8, !tbaa !9
  %114 = fsub double %112, %113
  %115 = fdiv double %114, 3.000000e+00
  %116 = fadd double %111, %115
  store double %116, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %117 = load double, ptr %4, align 8, !tbaa !9
  %118 = load double, ptr %4, align 8, !tbaa !9
  %119 = load double, ptr %3, align 8, !tbaa !9
  %120 = fsub double %118, %119
  %121 = fdiv double %120, 3.000000e+00
  %122 = fsub double %117, %121
  store double %122, ptr %9, align 8, !tbaa !9
  %123 = load double, ptr %8, align 8, !tbaa !9
  %124 = call noundef double @_Z8calcDiffd(double noundef %123)
  %125 = load double, ptr %9, align 8, !tbaa !9
  %126 = call noundef double @_Z8calcDiffd(double noundef %125)
  %127 = fcmp ogt double %124, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %110
  %129 = load double, ptr %8, align 8, !tbaa !9
  store double %129, ptr %3, align 8, !tbaa !9
  br label %132

130:                                              ; preds = %110
  %131 = load double, ptr %9, align 8, !tbaa !9
  store double %131, ptr %4, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %130, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %7, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %7, align 4, !tbaa !11
  br label %106, !llvm.loop !13

136:                                              ; preds = %109
  %137 = load double, ptr %3, align 8, !tbaa !9
  %138 = call noundef double @_Z8calcDiffd(double noundef %137)
  %139 = fcmp ogt double %138, 0.000000e+00
  br i1 %139, label %140, label %141

140:                                              ; preds = %136
  store i32 4, ptr %5, align 4
  br label %168

141:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %142 = load double, ptr %3, align 8, !tbaa !9
  store double %142, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %143

143:                                              ; preds = %162, %141
  %144 = load i32, ptr %11, align 4, !tbaa !11
  %145 = icmp slt i32 %144, 100
  br i1 %145, label %147, label %146

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

147:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %148 = load double, ptr %6, align 8, !tbaa !9
  %149 = load double, ptr %10, align 8, !tbaa !9
  %150 = load double, ptr %6, align 8, !tbaa !9
  %151 = fsub double %149, %150
  %152 = fdiv double %151, 2.000000e+00
  %153 = fadd double %148, %152
  store double %153, ptr %12, align 8, !tbaa !9
  %154 = load double, ptr %12, align 8, !tbaa !9
  %155 = call noundef double @_Z8calcDiffd(double noundef %154)
  %156 = fcmp ogt double %155, 0.000000e+00
  br i1 %156, label %157, label %159

157:                                              ; preds = %147
  %158 = load double, ptr %12, align 8, !tbaa !9
  store double %158, ptr %6, align 8, !tbaa !9
  br label %161

159:                                              ; preds = %147
  %160 = load double, ptr %12, align 8, !tbaa !9
  store double %160, ptr %10, align 8, !tbaa !9
  br label %161

161:                                              ; preds = %159, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %11, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %11, align 4, !tbaa !11
  br label %143, !llvm.loop !15

165:                                              ; preds = %146
  %166 = load double, ptr %10, align 8, !tbaa !9
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, double noundef %166)
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %168

168:                                              ; preds = %165, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %169

169:                                              ; preds = %168, %101, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %170 = load i32, ptr %5, align 4
  switch i32 %170, label %174 [
    i32 4, label %171
  ]

171:                                              ; preds = %169
  %172 = load i32, ptr %2, align 4, !tbaa !11
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %2, align 4, !tbaa !11
  br label %66, !llvm.loop !16

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

175:                                              ; preds = %174
  store i32 0, ptr %1, align 4
  br label %176

176:                                              ; preds = %175, %22
  %177 = load i32, ptr %1, align 4
  ret i32 %177
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #2

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

declare i32 @puts(ptr noundef) #2

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

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

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

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

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

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

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

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { "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 willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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 double, align 8
@T = external dso_local global double, align 8
@Tmax = external dso_local global double, align 8
@alpha = external dso_local global double, align 8
@phi = external dso_local global double, align 8
@lambda = external dso_local global double, align 8
@delta = external dso_local global double, align 8
@cos_alpha = external dso_local local_unnamed_addr global double, align 8
@sin_alpha = external dso_local local_unnamed_addr global double, align 8
@cos_phi = external dso_local local_unnamed_addr global double, align 8
@sin_phi = external dso_local local_unnamed_addr global double, align 8
@cos_delta = external dso_local local_unnamed_addr global double, align 8
@Tx = external dso_local local_unnamed_addr global double, align 8
@tau = external dso_local local_unnamed_addr global double, align 8
@vx = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = load ptr, ptr @stdin, align 8, !tbaa !5
  %2 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %1)
  %3 = load ptr, ptr @stdout, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %3)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @t, ptr noundef nonnull @T, ptr noundef nonnull @Tmax, ptr noundef nonnull @alpha, ptr noundef nonnull @phi, ptr noundef nonnull @lambda, ptr noundef nonnull @delta)
  %6 = load double, ptr @Tmax, align 8, !tbaa !9
  %7 = load double, ptr @t, align 8, !tbaa !9
  %8 = fmul double %7, 2.000000e+00
  %9 = fcmp olt double %6, %8
  br i1 %9, label %10, label %12

10:                                               ; preds = %0
  %11 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %87

12:                                               ; preds = %0
  %13 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %14 = fdiv double %13, 1.800000e+02
  %15 = load double, ptr @alpha, align 8, !tbaa !9
  %16 = fmul double %15, %14
  store double %16, ptr @alpha, align 8, !tbaa !9
  %17 = load double, ptr @phi, align 8, !tbaa !9
  %18 = fmul double %14, %17
  store double %18, ptr @phi, align 8, !tbaa !9
  %19 = load double, ptr @lambda, align 8, !tbaa !9
  %20 = fmul double %14, %19
  store double %20, ptr @lambda, align 8, !tbaa !9
  %21 = load double, ptr @delta, align 8, !tbaa !9
  %22 = fmul double %14, %21
  store double %22, ptr @delta, align 8, !tbaa !9
  %23 = tail call double @cos(double noundef %16) #6
  store double %23, ptr @cos_alpha, align 8, !tbaa !9
  %24 = load double, ptr @alpha, align 8, !tbaa !9
  %25 = tail call double @sin(double noundef %24) #6
  store double %25, ptr @sin_alpha, align 8, !tbaa !9
  %26 = load double, ptr @phi, align 8, !tbaa !9
  %27 = tail call double @cos(double noundef %26) #6
  store double %27, ptr @cos_phi, align 8, !tbaa !9
  %28 = load double, ptr @phi, align 8, !tbaa !9
  %29 = tail call double @sin(double noundef %28) #6
  store double %29, ptr @sin_phi, align 8, !tbaa !9
  %30 = load double, ptr @delta, align 8, !tbaa !9
  %31 = tail call double @cos(double noundef %30) #6
  store double %31, ptr @cos_delta, align 8, !tbaa !9
  %32 = load double, ptr @T, align 8, !tbaa !9
  %33 = load double, ptr @t, align 8, !tbaa !9
  %34 = fmul double %32, %33
  %35 = fsub double %32, %33
  %36 = fdiv double %34, %35
  store double %36, ptr @Tx, align 8, !tbaa !9
  tail call void @_Z13locateVolcanod(double noundef 0.000000e+00)
  %37 = load double, ptr @vx, align 8, !tbaa !9
  %38 = tail call double @acos(double noundef %37) #6
  store double %38, ptr @tau, align 8, !tbaa !9
  %39 = load double, ptr @phi, align 8, !tbaa !9
  %40 = fcmp olt double %39, 0.000000e+00
  br i1 %40, label %41, label %43

41:                                               ; preds = %12
  %42 = fneg double %38
  store double %42, ptr @tau, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %41, %12
  %.pre57 = load double, ptr @Tx, align 8, !tbaa !9
  %.pre59 = load double, ptr @t, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %83, %43
  %45 = phi double [ %.pre59, %43 ], [ %84, %83 ]
  %46 = phi double [ %.pre57, %43 ], [ %85, %83 ]
  %.034 = phi i32 [ 1, %43 ], [ %86, %83 ]
  %47 = uitofp nneg i32 %.034 to double
  %48 = fadd double %47, -4.990000e-01
  %49 = fmul double %46, %48
  %50 = fadd double %47, 4.990000e-01
  %51 = fmul double %46, %50
  %52 = fmul double %45, 2.000000e+00
  %53 = fcmp olt double %51, %52
  br i1 %53, label %83, label %54

54:                                               ; preds = %44
  %55 = load double, ptr @Tmax, align 8, !tbaa !9
  %56 = fcmp ogt double %51, %55
  %.042 = select i1 %56, double %55, double %51
  %57 = fcmp olt double %49, %52
  br i1 %57, label %62, label %58

58:                                               ; preds = %54
  %59 = fcmp ogt double %49, %55
  br i1 %59, label %60, label %62

60:                                               ; preds = %58
  %61 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %87

62:                                               ; preds = %54, %58
  %.035 = phi double [ %49, %58 ], [ %52, %54 ]
  br label %66

63:                                               ; preds = %66
  %64 = tail call noundef double @_Z8calcDiffd(double noundef %..136)
  %65 = fcmp ogt double %64, 0.000000e+00
  %.pre = load double, ptr @Tx, align 8, !tbaa !9
  %.pre58 = load double, ptr @t, align 8, !tbaa !9
  br i1 %65, label %83, label %.preheader

66:                                               ; preds = %62, %66
  %.13652 = phi double [ %.035, %62 ], [ %..136, %66 ]
  %.03751 = phi i32 [ 0, %62 ], [ %74, %66 ]
  %.14350 = phi double [ %.042, %62 ], [ %.143., %66 ]
  %67 = fsub double %.14350, %.13652
  %68 = fdiv double %67, 3.000000e+00
  %69 = fadd double %.13652, %68
  %70 = fsub double %.14350, %68
  %71 = tail call noundef double @_Z8calcDiffd(double noundef %69)
  %72 = tail call noundef double @_Z8calcDiffd(double noundef %70)
  %73 = fcmp ogt double %71, %72
  %.143. = select i1 %73, double %.14350, double %70
  %..136 = select i1 %73, double %69, double %.13652
  %74 = add nuw nsw i32 %.03751, 1
  %exitcond.not = icmp eq i32 %74, 100
  br i1 %exitcond.not, label %63, label %66, !llvm.loop !11

75:                                               ; preds = %.preheader
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %.033.)
  br label %87

.preheader:                                       ; preds = %63, %.preheader
  %.03255 = phi i32 [ %82, %.preheader ], [ 0, %63 ]
  %.03354 = phi double [ %.033., %.preheader ], [ %..136, %63 ]
  %.03853 = phi double [ %..038, %.preheader ], [ %.035, %63 ]
  %77 = fsub double %.03354, %.03853
  %78 = fmul double %77, 5.000000e-01
  %79 = fadd double %.03853, %78
  %80 = tail call noundef double @_Z8calcDiffd(double noundef %79)
  %81 = fcmp ogt double %80, 0.000000e+00
  %..038 = select i1 %81, double %79, double %.03853
  %.033. = select i1 %81, double %.03354, double %79
  %82 = add nuw nsw i32 %.03255, 1
  %exitcond56.not = icmp eq i32 %82, 100
  br i1 %exitcond56.not, label %75, label %.preheader, !llvm.loop !13

83:                                               ; preds = %44, %63
  %84 = phi double [ %45, %44 ], [ %.pre58, %63 ]
  %85 = phi double [ %46, %44 ], [ %.pre, %63 ]
  %86 = add nuw nsw i32 %.034, 1
  br label %44, !llvm.loop !14

87:                                               ; preds = %60, %75, %10
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z8calcDiffd(double noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { "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 = { 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 = !{!"any pointer", !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}


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