; LLVM IR from tangjz/acm-icpc :: luogu/1378.ll (Z3dfsi)

; 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
@n = external dso_local global i32, align 4
@used = external dso_local global [6 x i8], align 1
@a0 = external dso_local global double, align 8
@b0 = external dso_local global double, align 8
@a1 = external dso_local global double, align 8
@b1 = external dso_local global double, align 8
@x = external dso_local global [6 x double], align 16
@y = external dso_local global [6 x double], align 16
@r = external dso_local global [6 x double], align 16
@ans = external dso_local global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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
  %13 = alloca double, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp eq i32 %14, %15
  br i1 %16, label %17, label %42

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store double 0.000000e+00, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %36, %17
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %39

23:                                               ; preds = %18
  %24 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %26
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = fmul double %24, %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = load double, ptr %3, align 8, !tbaa !9
  %35 = call double @llvm.fmuladd.f64(double %29, double %33, double %34)
  store double %35, ptr %3, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %23
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !5
  br label %18, !llvm.loop !11

39:                                               ; preds = %22
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %41 = load double, ptr %40, align 8, !tbaa !9
  store double %41, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %186

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

43:                                               ; preds = %183, %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %186

48:                                               ; preds = %43
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !13, !range !15, !noundef !16
  %53 = trunc i8 %52 to i1
  br i1 %53, label %182, label %54

54:                                               ; preds = %48
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %56
  store i8 1, ptr %57, align 1, !tbaa !13
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %59
  store double 1.000000e+04, ptr %60, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %131, %54
  %62 = load i32, ptr %7, 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 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %134

66:                                               ; preds = %61
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = icmp ne i32 %67, %68
  br i1 %69, label %70, label %130

70:                                               ; preds = %66
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !13, !range !15, !noundef !16
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %130

76:                                               ; preds = %70
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !9
  %88 = fsub double %83, %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %90
  %92 = load double, ptr %91, align 8, !tbaa !9
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fsub double %92, %96
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = fsub double %101, %105
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !9
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = fsub double %110, %114
  %116 = fmul double %106, %115
  %117 = call double @llvm.fmuladd.f64(double %88, double %97, double %116)
  %118 = call double @sqrt(double noundef %117) #5
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !9
  %123 = fsub double %118, %122
  store double %123, ptr %9, align 8, !tbaa !9
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull align 8 dereferenceable(8) %124)
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %128
  store double %126, ptr %129, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %130

130:                                              ; preds = %76, %70, %66
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %7, align 4, !tbaa !5
  br label %61, !llvm.loop !17

134:                                              ; preds = %65
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !9
  %142 = load double, ptr @a0, align 8, !tbaa !9
  %143 = fsub double %141, %142
  %144 = call double @llvm.fabs.f64(double %143)
  store double %144, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !9
  %149 = load double, ptr @a1, align 8, !tbaa !9
  %150 = fsub double %148, %149
  %151 = call double @llvm.fabs.f64(double %150)
  store double %151, ptr %11, align 8, !tbaa !9
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_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 %12) #5
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !9
  %157 = load double, ptr @b0, align 8, !tbaa !9
  %158 = fsub double %156, %157
  %159 = call double @llvm.fabs.f64(double %158)
  store double %159, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %160 = load i32, ptr %5, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %161
  %163 = load double, ptr %162, align 8, !tbaa !9
  %164 = load double, ptr @b1, align 8, !tbaa !9
  %165 = fsub double %163, %164
  %166 = call double @llvm.fabs.f64(double %165)
  store double %166, ptr %13, align 8, !tbaa !9
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef nonnull align 8 dereferenceable(8) %167)
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %168)
  %170 = load double, ptr %169, align 8, !tbaa !9
  %171 = load i32, ptr %5, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %172
  store double %170, ptr %173, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  call void @_Z3dfsi(i32 noundef %175)
  %176 = load i32, ptr %5, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %177
  store i8 0, ptr %178, align 1, !tbaa !13
  %179 = load i32, ptr %5, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %180
  store double 0.000000e+00, ptr %181, align 8, !tbaa !9
  br label %182

182:                                              ; preds = %134, %48
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %5, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %5, align 4, !tbaa !5
  br label %43, !llvm.loop !18

186:                                              ; preds = %47, %39
  ret void
}

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

; 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)) #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)) #3

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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
@n = external dso_local local_unnamed_addr global i32, align 4
@used = external dso_local local_unnamed_addr global [6 x i8], align 1
@a0 = external dso_local local_unnamed_addr global double, align 8
@b0 = external dso_local local_unnamed_addr global double, align 8
@a1 = external dso_local local_unnamed_addr global double, align 8
@b1 = external dso_local local_unnamed_addr global double, align 8
@x = external dso_local local_unnamed_addr global [6 x double], align 16
@y = external dso_local local_unnamed_addr global [6 x double], align 16
@r = external dso_local global [6 x double], align 16
@ans = external dso_local global double, align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp eq i32 %9, %0
  br i1 %10, label %13, label %.preheader

.preheader:                                       ; preds = %1
  %11 = icmp sgt i32 %9, 0
  br i1 %11, label %.lr.ph40, label %.loopexit

.lr.ph40:                                         ; preds = %.preheader
  %12 = add nsw i32 %0, 1
  br label %42

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %14 = icmp sgt i32 %0, 0
  br i1 %14, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %13
  %15 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %wide.trip.count = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %16 = icmp ult i32 %0, 4
  br i1 %16, label %._crit_edge44.loopexit.unr-lcssa, label %.lr.ph43.new

.lr.ph43.new:                                     ; preds = %.lr.ph43
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %24

._crit_edge44.loopexit.unr-lcssa:                 ; preds = %24, %.lr.ph43
  %.lcssa56.ph = phi double [ poison, %.lr.ph43 ], [ %41, %24 ]
  %indvars.iv50.unr = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next51.3, %24 ]
  %.unr = phi double [ 0.000000e+00, %.lr.ph43 ], [ %41, %24 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge44, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge44.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %.epil.preheader ], [ %indvars.iv50.unr, %._crit_edge44.loopexit.unr-lcssa ]
  %17 = phi double [ %21, %.epil.preheader ], [ %.unr, %._crit_edge44.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge44.loopexit.unr-lcssa ]
  %18 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv50.epil
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = fmul double %15, %19
  %21 = tail call double @llvm.fmuladd.f64(double %20, double %19, double %17)
  %indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge44, label %.epil.preheader, !llvm.loop !11

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit.unr-lcssa, %.epil.preheader, %13
  %.lcssa = phi double [ 0.000000e+00, %13 ], [ %.lcssa56.ph, %._crit_edge44.loopexit.unr-lcssa ], [ %21, %.epil.preheader ]
  store double %.lcssa, ptr %2, align 8, !tbaa !9
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %23 = load double, ptr %22, align 8, !tbaa !9
  store double %23, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  br label %.loopexit

24:                                               ; preds = %24, %.lr.ph43.new
  %indvars.iv50 = phi i64 [ 0, %.lr.ph43.new ], [ %indvars.iv.next51.3, %24 ]
  %25 = phi double [ 0.000000e+00, %.lr.ph43.new ], [ %41, %24 ]
  %niter = phi i64 [ 0, %.lr.ph43.new ], [ %niter.next.3, %24 ]
  %26 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv50
  %27 = load double, ptr %26, align 16, !tbaa !9
  %28 = fmul double %15, %27
  %29 = tail call double @llvm.fmuladd.f64(double %28, double %27, double %25)
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %30 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv.next51
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = fmul double %15, %31
  %33 = tail call double @llvm.fmuladd.f64(double %32, double %31, double %29)
  %indvars.iv.next51.1 = or disjoint i64 %indvars.iv50, 2
  %34 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv.next51.1
  %35 = load double, ptr %34, align 16, !tbaa !9
  %36 = fmul double %15, %35
  %37 = tail call double @llvm.fmuladd.f64(double %36, double %35, double %33)
  %indvars.iv.next51.2 = or disjoint i64 %indvars.iv50, 3
  %38 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv.next51.2
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = fmul double %15, %39
  %41 = tail call double @llvm.fmuladd.f64(double %40, double %39, double %37)
  %indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge44.loopexit.unr-lcssa, label %24, !llvm.loop !13

42:                                               ; preds = %.lr.ph40, %100
  %43 = phi i32 [ %9, %.lr.ph40 ], [ %101, %100 ]
  %indvars.iv47 = phi i64 [ 0, %.lr.ph40 ], [ %indvars.iv.next48, %100 ]
  %44 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %indvars.iv47
  %45 = load i8, ptr %44, align 1, !tbaa !15, !range !17, !noundef !18
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %100, label %47

47:                                               ; preds = %42
  store i8 1, ptr %44, align 1, !tbaa !15
  %48 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv47
  store double 1.000000e+04, ptr %48, align 8, !tbaa !9
  %49 = icmp sgt i32 %43, 0
  br i1 %49, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %47
  %50 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %indvars.iv47
  %51 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %indvars.iv47
  br label %73

._crit_edge:                                      ; preds = %96, %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %52 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %indvars.iv47
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = load double, ptr @a0, align 8, !tbaa !9
  %55 = fsub double %53, %54
  %56 = call double @llvm.fabs.f64(double %55)
  store double %56, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %57 = load double, ptr @a1, align 8, !tbaa !9
  %58 = fsub double %53, %57
  %59 = call double @llvm.fabs.f64(double %58)
  store double %59, ptr %6, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %61 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %indvars.iv47
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = load double, ptr @b0, align 8, !tbaa !9
  %64 = fsub double %62, %63
  %65 = call double @llvm.fabs.f64(double %64)
  store double %65, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %66 = load double, ptr @b1, align 8, !tbaa !9
  %67 = fsub double %62, %66
  %68 = call double @llvm.fabs.f64(double %67)
  store double %68, ptr %8, align 8, !tbaa !9
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %70)
  %72 = load double, ptr %71, align 8, !tbaa !9
  store double %72, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_Z3dfsi(i32 noundef %12)
  store i8 0, ptr %44, align 1, !tbaa !15
  store double 0.000000e+00, ptr %48, align 8, !tbaa !9
  %.pre53 = load i32, ptr @n, align 4, !tbaa !5
  br label %100

73:                                               ; preds = %.lr.ph, %96
  %74 = phi i32 [ %43, %.lr.ph ], [ %97, %96 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %96 ]
  %.not = icmp eq i64 %indvars.iv47, %indvars.iv
  br i1 %.not, label %96, label %75

75:                                               ; preds = %73
  %76 = getelementptr inbounds [6 x i8], ptr @used, i64 0, i64 %indvars.iv
  %77 = load i8, ptr %76, align 1, !tbaa !15, !range !17, !noundef !18
  %78 = trunc nuw i8 %77 to i1
  br i1 %78, label %79, label %96

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store double 0.000000e+00, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %80 = load double, ptr %50, align 8, !tbaa !9
  %81 = getelementptr inbounds [6 x double], ptr @x, i64 0, i64 %indvars.iv
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fsub double %80, %82
  %84 = load double, ptr %51, align 8, !tbaa !9
  %85 = getelementptr inbounds [6 x double], ptr @y, i64 0, i64 %indvars.iv
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fsub double %84, %86
  %88 = fmul double %87, %87
  %89 = call double @llvm.fmuladd.f64(double %83, double %83, double %88)
  %sqrt = call double @llvm.sqrt.f64(double %89)
  %90 = getelementptr inbounds [6 x double], ptr @r, i64 0, i64 %indvars.iv
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = fsub double %sqrt, %91
  store double %92, ptr %4, align 8, !tbaa !9
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load double, ptr %94, align 8, !tbaa !9
  store double %95, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %73, %75, %79
  %97 = phi i32 [ %74, %73 ], [ %74, %75 ], [ %.pre, %79 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next, %98
  br i1 %99, label %73, label %._crit_edge, !llvm.loop !19

100:                                              ; preds = %42, %._crit_edge
  %101 = phi i32 [ %43, %42 ], [ %.pre53, %._crit_edge ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next48, %102
  br i1 %103, label %42, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %100, %.preheader, %._crit_edge44
  ret void
}

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

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

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

; 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 #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 #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; Effective O3 passes: AggressiveInstCombinePass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass