; LLVM IR from tangjz/acm-icpc :: hdu (6354)

; 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
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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 i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %23

23:                                               ; preds = %124, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %2, align 4, !tbaa !5
  %26 = icmp ne i32 %24, 0
  br i1 %26, label %27, label %133

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store double 0.000000e+00, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %29 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  store double %29, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %121, %27
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %9, ptr noundef %10, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = mul nsw i32 %37, %38
  %40 = load i32, ptr %10, align 4, !tbaa !5
  %41 = load i32, ptr %10, align 4, !tbaa !5
  %42 = mul nsw i32 %40, %41
  %43 = add nsw i32 %39, %42
  store i32 %43, ptr %12, align 4, !tbaa !5
  %44 = load i32, ptr %12, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = sub nsw i32 %45, %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !5
  %50 = sub nsw i32 %48, %49
  %51 = mul nsw i32 %47, %50
  %52 = icmp slt i32 %44, %51
  br i1 %52, label %63, label %53

53:                                               ; preds = %35
  %54 = load i32, ptr %12, align 4, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = add nsw i32 %55, %56
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = add nsw i32 %58, %59
  %61 = mul nsw i32 %57, %60
  %62 = icmp sgt i32 %54, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %53, %35
  store i32 6, ptr %8, align 4
  br label %118

64:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = sitofp i32 %65 to x86_fp80
  %67 = call x86_fp80 @sqrtl(x86_fp80 noundef %66) #6
  %68 = fptrunc x86_fp80 %67 to double
  store double %68, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = mul nsw i32 %70, %71
  %73 = add nsw i32 %69, %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = mul nsw i32 %74, %75
  %77 = sub nsw i32 %73, %76
  %78 = sitofp i32 %77 to double
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = mul nsw i32 2, %79
  %81 = sitofp i32 %80 to double
  %82 = load double, ptr %13, align 8, !tbaa !9
  %83 = fmul double %81, %82
  %84 = fdiv double %78, %83
  store double %84, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store double -1.000000e+00, ptr %16, align 8, !tbaa !9
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store double 1.000000e+00, ptr %17, align 8, !tbaa !9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = call double @acos(double noundef %87) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  store double %88, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %89 = load i32, ptr %12, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = mul nsw i32 %90, %91
  %93 = sub nsw i32 %89, %92
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = mul nsw i32 %94, %95
  %97 = add nsw i32 %93, %96
  %98 = sitofp i32 %97 to double
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = mul nsw i32 2, %99
  %101 = sitofp i32 %100 to double
  %102 = load double, ptr %13, align 8, !tbaa !9
  %103 = fmul double %101, %102
  %104 = fdiv double %98, %103
  store double %104, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store double -1.000000e+00, ptr %20, align 8, !tbaa !9
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store double 1.000000e+00, ptr %21, align 8, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %107 = load double, ptr %106, align 8, !tbaa !9
  %108 = call double @acos(double noundef %107) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  store double %108, ptr %18, align 8, !tbaa !9
  %109 = load double, ptr %14, align 8, !tbaa !9
  %110 = load double, ptr %6, align 8, !tbaa !9
  %111 = fsub double %110, %109
  store double %111, ptr %6, align 8, !tbaa !9
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = mul nsw i32 2, %112
  %114 = sitofp i32 %113 to double
  %115 = load double, ptr %18, align 8, !tbaa !9
  %116 = load double, ptr %5, align 8, !tbaa !9
  %117 = call double @llvm.fmuladd.f64(double %114, double %115, double %116)
  store double %117, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store i32 0, ptr %8, align 4
  br label %118

118:                                              ; preds = %64, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %119 = load i32, ptr %8, align 4
  switch i32 %119, label %135 [
    i32 0, label %120
    i32 6, label %121
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120, %118
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !5
  br label %30, !llvm.loop !11

124:                                              ; preds = %34
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = mul nsw i32 2, %125
  %127 = sitofp i32 %126 to double
  %128 = load double, ptr %6, align 8, !tbaa !9
  %129 = load double, ptr %5, align 8, !tbaa !9
  %130 = call double @llvm.fmuladd.f64(double %127, double %128, double %129)
  store double %130, ptr %5, align 8, !tbaa !9
  %131 = load double, ptr %5, align 8, !tbaa !9
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %131)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %23, !llvm.loop !13

133:                                              ; preds = %23
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %134 = load i32, ptr %1, align 4
  ret i32 %134

135:                                              ; preds = %118
  unreachable
}

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

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

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #0

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

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

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = 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 nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %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 double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %1, align 4, !tbaa !5
  %.not27 = icmp eq i32 %14, 0
  br i1 %.not27, label %._crit_edge30, label %.lr.ph29

.lr.ph29:                                         ; preds = %0, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %17 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %.not2022 = icmp slt i32 %18, 1
  br i1 %.not2022, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %77, %.lr.ph29
  %.016.lcssa = phi double [ %17, %.lr.ph29 ], [ %.117, %77 ]
  %.0.lcssa = phi double [ 0.000000e+00, %.lr.ph29 ], [ %.1, %77 ]
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = shl nsw i32 %19, 1
  %21 = sitofp i32 %20 to double
  %22 = call double @llvm.fmuladd.f64(double %21, double %.016.lcssa, double %.0.lcssa)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %._crit_edge30, label %.lr.ph29, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph29, %77
  %.025 = phi double [ %.1, %77 ], [ 0.000000e+00, %.lr.ph29 ]
  %.01624 = phi double [ %.117, %77 ], [ %17, %.lr.ph29 ]
  %.01823 = phi i32 [ %78, %77 ], [ 1, %.lr.ph29 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = mul nsw i32 %27, %27
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = mul nsw i32 %29, %29
  %31 = add nuw nsw i32 %30, %28
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sub nsw i32 %32, %33
  %35 = mul nsw i32 %34, %34
  %36 = icmp ult i32 %31, %35
  br i1 %36, label %77, label %37

37:                                               ; preds = %.lr.ph
  %38 = add nsw i32 %33, %32
  %39 = mul nsw i32 %38, %38
  %40 = icmp ugt i32 %31, %39
  br i1 %40, label %77, label %41

41:                                               ; preds = %37
  %42 = uitofp nneg i32 %31 to x86_fp80
  %sqrt = call x86_fp80 @llvm.sqrt.f80(x86_fp80 %42)
  %43 = fptrunc x86_fp80 %sqrt to double
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %44 = mul nsw i32 %32, %32
  %45 = add nuw nsw i32 %44, %31
  %46 = mul nsw i32 %33, %33
  %47 = sub nsw i32 %45, %46
  %48 = sitofp i32 %47 to double
  %49 = shl nsw i32 %32, 1
  %50 = sitofp i32 %49 to double
  %51 = fmul double %43, %50
  %52 = fdiv double %48, %51
  store double %52, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store double -1.000000e+00, ptr %8, align 8, !tbaa !9
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store double 1.000000e+00, ptr %9, align 8, !tbaa !9
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = call double @acos(double noundef %55) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = mul nsw i32 %57, %57
  %59 = sub nsw i32 %31, %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = mul nsw i32 %60, %60
  %62 = add nsw i32 %59, %61
  %63 = sitofp i32 %62 to double
  %64 = shl nsw i32 %60, 1
  %65 = sitofp i32 %64 to double
  %66 = fmul double %43, %65
  %67 = fdiv double %63, %66
  store double %67, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  store double -1.000000e+00, ptr %11, align 8, !tbaa !9
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  store double 1.000000e+00, ptr %12, align 8, !tbaa !9
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = call double @acos(double noundef %70) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %72 = fsub double %.01624, %56
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = shl nsw i32 %73, 1
  %75 = sitofp i32 %74 to double
  %76 = call double @llvm.fmuladd.f64(double %75, double %71, double %.025)
  br label %77

77:                                               ; preds = %.lr.ph, %37, %41
  %.117 = phi double [ %72, %41 ], [ %.01624, %37 ], [ %.01624, %.lr.ph ]
  %.1 = phi double [ %76, %41 ], [ %.025, %37 ], [ %.025, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %78 = add nuw nsw i32 %.01823, 1
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %.not20.not = icmp slt i32 %.01823, %79
  br i1 %.not20.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge30:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

; 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 nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.sqrt.f80(x86_fp80) #6

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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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