; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (quadrature)

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

@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@__func__.quadrature_gauss_legendre = external hidden unnamed_addr constant [26 x i8], align 1

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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @quadrature_gauss_legendre(ptr noundef %0, ptr noundef %1, i32 noundef %2, double noundef %3, ptr noundef %4) #3 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %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
  %22 = alloca [2048 x i8], align 16
  %23 = alloca [2048 x i8], align 16
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  %27 = sdiv i32 %26, 2
  store i32 %27, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %147, %5
  %29 = load i32, ptr %14, align 4, !tbaa !9
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %32, label %150

32:                                               ; preds = %28
  %33 = load i32, ptr %14, align 4, !tbaa !9
  %34 = sitofp i32 %33 to double
  %35 = fsub double %34, 2.500000e-01
  %36 = fmul double 0x400921FB54442D18, %35
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = sitofp i32 %37 to double
  %39 = fadd double %38, 5.000000e-01
  %40 = fdiv double %36, %39
  %41 = call double @cos(double noundef %40) #5
  store double %41, ptr %17, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %99, %32
  store double 1.000000e+00, ptr %21, align 8, !tbaa !11
  store double 0.000000e+00, ptr %20, align 8, !tbaa !11
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %66, %42
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %47, label %69

47:                                               ; preds = %43
  %48 = load double, ptr %20, align 8, !tbaa !11
  store double %48, ptr %19, align 8, !tbaa !11
  %49 = load double, ptr %21, align 8, !tbaa !11
  store double %49, ptr %20, align 8, !tbaa !11
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = sitofp i32 %50 to double
  %52 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %51, double -1.000000e+00)
  %53 = load double, ptr %17, align 8, !tbaa !11
  %54 = fmul double %52, %53
  %55 = load double, ptr %20, align 8, !tbaa !11
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  %58 = fsub double %57, 1.000000e+00
  %59 = load double, ptr %19, align 8, !tbaa !11
  %60 = fmul double %58, %59
  %61 = fneg double %60
  %62 = call double @llvm.fmuladd.f64(double %54, double %55, double %61)
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = sitofp i32 %63 to double
  %65 = fdiv double %62, %64
  store double %65, ptr %21, align 8, !tbaa !11
  br label %66

66:                                               ; preds = %47
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %13, align 4, !tbaa !9
  br label %43, !llvm.loop !13

69:                                               ; preds = %43
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = sitofp i32 %70 to double
  %72 = load double, ptr %17, align 8, !tbaa !11
  %73 = load double, ptr %21, align 8, !tbaa !11
  %74 = load double, ptr %20, align 8, !tbaa !11
  %75 = fneg double %74
  %76 = call double @llvm.fmuladd.f64(double %72, double %73, double %75)
  %77 = fmul double %71, %76
  %78 = load double, ptr %17, align 8, !tbaa !11
  %79 = load double, ptr %17, align 8, !tbaa !11
  %80 = call double @llvm.fmuladd.f64(double %78, double %79, double -1.000000e+00)
  %81 = fdiv double %77, %80
  store double %81, ptr %18, align 8, !tbaa !11
  %82 = load double, ptr %17, align 8, !tbaa !11
  store double %82, ptr %16, align 8, !tbaa !11
  %83 = load double, ptr %16, align 8, !tbaa !11
  %84 = load double, ptr %21, align 8, !tbaa !11
  %85 = load double, ptr %18, align 8, !tbaa !11
  %86 = fdiv double %84, %85
  %87 = fsub double %83, %86
  store double %87, ptr %17, align 8, !tbaa !11
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %15, align 4, !tbaa !9
  %90 = load i32, ptr %15, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 10000
  br i1 %91, label %92, label %98

92:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 2048, ptr %22) #5
  %93 = getelementptr inbounds [2048 x i8], ptr %22, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %93, ptr noundef @.str.13)
  call void @llvm.lifetime.start.p0(i64 2048, ptr %23) #5
  %94 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  %95 = getelementptr inbounds [2048 x i8], ptr %22, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %94, ptr noundef @.str.14, ptr noundef @.str.15, ptr noundef %95)
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %96, ptr noundef @.str.2, ptr noundef @__func__.quadrature_gauss_legendre, i32 noundef 772, ptr noundef %97)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr %22) #5
  store i32 1, ptr %6, align 4
  store i32 1, ptr %24, align 4
  br label %151

98:                                               ; preds = %69
  br label %99

99:                                               ; preds = %98
  %100 = load double, ptr %17, align 8, !tbaa !11
  %101 = load double, ptr %16, align 8, !tbaa !11
  %102 = fsub double %100, %101
  %103 = call double @llvm.fabs.f64(double %102)
  %104 = load double, ptr %10, align 8, !tbaa !11
  %105 = fcmp ogt double %103, %104
  br i1 %105, label %42, label %106, !llvm.loop !15

106:                                              ; preds = %99
  %107 = load double, ptr %17, align 8, !tbaa !11
  %108 = fneg double %107
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %109, i64 %112
  store double %108, ptr %113, align 8, !tbaa !11
  %114 = load double, ptr %17, align 8, !tbaa !11
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = sub nsw i32 %116, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %115, i64 %119
  store double %114, ptr %120, align 8, !tbaa !11
  %121 = load double, ptr %17, align 8, !tbaa !11
  %122 = load double, ptr %17, align 8, !tbaa !11
  %123 = fneg double %121
  %124 = call double @llvm.fmuladd.f64(double %123, double %122, double 1.000000e+00)
  %125 = load double, ptr %18, align 8, !tbaa !11
  %126 = fmul double %124, %125
  %127 = load double, ptr %18, align 8, !tbaa !11
  %128 = fmul double %126, %127
  %129 = fdiv double 2.000000e+00, %128
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %14, align 4, !tbaa !9
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds double, ptr %130, i64 %133
  store double %129, ptr %134, align 8, !tbaa !11
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = sub nsw i32 %136, 1
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds double, ptr %135, i64 %138
  %140 = load double, ptr %139, align 8, !tbaa !11
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = load i32, ptr %14, align 4, !tbaa !9
  %144 = sub nsw i32 %142, %143
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %141, i64 %145
  store double %140, ptr %146, align 8, !tbaa !11
  br label %147

147:                                              ; preds = %106
  %148 = load i32, ptr %14, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %14, align 4, !tbaa !9
  br label %28, !llvm.loop !16

150:                                              ; preds = %28
  store i32 0, ptr %6, align 4
  store i32 1, ptr %24, align 4
  br label %151

151:                                              ; preds = %150, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %152 = load i32, ptr %6, align 4
  ret i32 %152
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 speculatable willreturn memory(none) }
attributes #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !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"

@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@__func__.quadrature_gauss_legendre = external hidden unnamed_addr constant [26 x i8], align 1

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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @quadrature_gauss_legendre(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, i32 noundef %2, double noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca [2048 x i8], align 16
  %7 = alloca [2048 x i8], align 16
  %.not73 = icmp slt i32 %2, 1
  br i1 %.not73, label %.loopexit, label %.split.preheader

.split.preheader:                                 ; preds = %5
  %8 = add nuw i32 %2, 1
  %9 = sdiv i32 %8, 2
  %10 = uitofp nneg i32 %2 to double
  %11 = fadd double %10, 5.000000e-01
  %12 = zext nneg i32 %2 to i64
  %smax = tail call i32 @llvm.smax.i32(i32 %9, i32 1)
  %13 = add nuw nsw i32 %smax, 1
  %wide.trip.count = zext nneg i32 %13 to i64
  %xtraiter = and i32 %2, 1
  %14 = icmp eq i32 %2, 1
  %unroll_iter = and i32 %2, 2147483646
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br label %.split

.split:                                           ; preds = %.split.preheader, %.split71
  %indvars.iv = phi i64 [ 1, %.split.preheader ], [ %indvars.iv.next, %.split71 ]
  %15 = trunc nuw nsw i64 %indvars.iv to i32
  %16 = uitofp nneg i32 %15 to double
  %17 = fadd double %16, -2.500000e-01
  %18 = fmul double %17, 0x400921FB54442D18
  %19 = fdiv double %18, %11
  %20 = tail call double @cos(double noundef %19) #6
  br label %.lr.ph

.lr.ph:                                           ; preds = %51, %.split
  %.056 = phi i32 [ 0, %.split ], [ %49, %51 ]
  %.054 = phi double [ %20, %.split ], [ %58, %51 ]
  br i1 %14, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph, %.lr.ph.new
  %.066 = phi double [ %38, %.lr.ph.new ], [ 1.000000e+00, %.lr.ph ]
  %.05165 = phi double [ %29, %.lr.ph.new ], [ 0.000000e+00, %.lr.ph ]
  %.05364 = phi i32 [ %39, %.lr.ph.new ], [ 1, %.lr.ph ]
  %niter = phi i32 [ %niter.next.1, %.lr.ph.new ], [ 0, %.lr.ph ]
  %21 = uitofp nneg i32 %.05364 to double
  %22 = tail call double @llvm.fmuladd.f64(double %21, double 2.000000e+00, double -1.000000e+00)
  %23 = fmul double %.054, %22
  %24 = add nsw i32 %.05364, -1
  %25 = sitofp i32 %24 to double
  %26 = fneg double %.05165
  %27 = fmul double %26, %25
  %28 = tail call double @llvm.fmuladd.f64(double %23, double %.066, double %27)
  %29 = fdiv double %28, %21
  %30 = add nuw i32 %.05364, 1
  %31 = uitofp nneg i32 %30 to double
  %32 = tail call double @llvm.fmuladd.f64(double %31, double 2.000000e+00, double -1.000000e+00)
  %33 = fmul double %.054, %32
  %34 = sitofp i32 %.05364 to double
  %35 = fneg double %.066
  %36 = fmul double %35, %34
  %37 = tail call double @llvm.fmuladd.f64(double %33, double %29, double %36)
  %38 = fdiv double %37, %31
  %39 = add nuw i32 %.05364, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %.lr.ph.new, !llvm.loop !5

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph.new, %.lr.ph
  %.066.lcssa.ph = phi double [ poison, %.lr.ph ], [ %29, %.lr.ph.new ]
  %.lcssa.ph = phi double [ poison, %.lr.ph ], [ %38, %.lr.ph.new ]
  %.066.unr = phi double [ 1.000000e+00, %.lr.ph ], [ %38, %.lr.ph.new ]
  %.05165.unr = phi double [ 0.000000e+00, %.lr.ph ], [ %29, %.lr.ph.new ]
  %.05364.unr = phi i32 [ 1, %.lr.ph ], [ %39, %.lr.ph.new ]
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %._crit_edge.unr-lcssa
  %40 = uitofp nneg i32 %.05364.unr to double
  %41 = tail call double @llvm.fmuladd.f64(double %40, double 2.000000e+00, double -1.000000e+00)
  %42 = fmul double %.054, %41
  %43 = add nsw i32 %.05364.unr, -1
  %44 = sitofp i32 %43 to double
  %45 = fneg double %.05165.unr
  %46 = fmul double %45, %44
  %47 = tail call double @llvm.fmuladd.f64(double %42, double %.066.unr, double %46)
  %48 = fdiv double %47, %40
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %.066.lcssa = phi double [ %.066.lcssa.ph, %._crit_edge.unr-lcssa ], [ %.066.unr, %._crit_edge.epilog-lcssa ]
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %48, %._crit_edge.epilog-lcssa ]
  %49 = add nuw nsw i32 %.056, 1
  %50 = icmp eq i32 %49, 10000
  br i1 %50, label %.split69.us, label %51

.split69.us:                                      ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %6) #6
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.13) #6
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %7) #6
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15, ptr noundef nonnull %6) #6
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %4, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.quadrature_gauss_legendre, i32 noundef 772, ptr noundef nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #6
  br label %.loopexit

51:                                               ; preds = %._crit_edge
  %52 = fneg double %.066.lcssa
  %53 = tail call double @llvm.fmuladd.f64(double %.054, double %.lcssa, double %52)
  %54 = fmul double %53, %10
  %55 = tail call double @llvm.fmuladd.f64(double %.054, double %.054, double -1.000000e+00)
  %56 = fdiv double %54, %55
  %57 = fdiv double %.lcssa, %56
  %58 = fsub double %.054, %57
  %59 = fsub double %58, %.054
  %60 = tail call double @llvm.fabs.f64(double %59)
  %61 = fcmp ogt double %60, %3
  br i1 %61, label %.lr.ph, label %.split71, !llvm.loop !7

.split71:                                         ; preds = %51
  %62 = fneg double %58
  %63 = add nsw i64 %indvars.iv, -1
  %64 = getelementptr inbounds double, ptr %0, i64 %63
  store double %62, ptr %64, align 8, !tbaa !8
  %65 = sub nsw i64 %12, %indvars.iv
  %66 = getelementptr inbounds double, ptr %0, i64 %65
  store double %58, ptr %66, align 8, !tbaa !8
  %67 = tail call double @llvm.fmuladd.f64(double %62, double %58, double 1.000000e+00)
  %68 = fmul double %56, %67
  %69 = fmul double %56, %68
  %70 = fdiv double 2.000000e+00, %69
  %71 = getelementptr inbounds double, ptr %1, i64 %63
  store double %70, ptr %71, align 8, !tbaa !8
  %72 = getelementptr inbounds double, ptr %1, i64 %65
  store double %70, ptr %72, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond82.not, label %.loopexit, label %.split, !llvm.loop !12

.loopexit:                                        ; preds = %.split71, %5, %.split69.us
  %.052 = phi i32 [ 1, %.split69.us ], [ 0, %5 ], [ 0, %.split71 ]
  ret i32 %.052
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 speculatable willreturn memory(none) }
attributes #3 = { 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 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = distinct !{!12, !6}


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