; LLVM IR from marcinlos/iga-ads :: examples/cg/shishkin.ll (Z12create_basisddiiibd)

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

%"struct.ads::bspline::basis" = type { %"class.std::vector", i32, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12create_basisddiiibd(ptr dead_on_unwind noalias writable sret(%"struct.ads::bspline::basis") align 8 %0, double noundef %1, double noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6, double noundef %7) #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca i32, align 4
  %32 = alloca %"class.std::vector", align 8
  store ptr %0, ptr %9, align 8
  store double %1, ptr %10, align 8, !tbaa !5
  store double %2, ptr %11, align 8, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  %33 = zext i1 %6 to i8
  store i8 %33, ptr %15, align 1, !tbaa !11
  store double %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %34 = load i32, ptr %13, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %36 = load i32, ptr %14, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  %40 = mul nsw i32 2, %39
  %41 = load i32, ptr %17, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 2
  %43 = load i32, ptr %18, align 4, !tbaa !9
  %44 = mul nsw i32 %42, %43
  %45 = add nsw i32 %40, %44
  store i32 %45, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %46 = load i32, ptr %19, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %47, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %48 unwind label %54

48:                                               ; preds = %8
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %70, %48
  %50 = load i32, ptr %24, align 4, !tbaa !9
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %58, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %73

54:                                               ; preds = %8
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %22, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %23, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  br label %162

58:                                               ; preds = %49
  %59 = load double, ptr %10, align 8, !tbaa !5
  %60 = load i32, ptr %24, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %61) #4
  store double %59, ptr %62, align 8, !tbaa !5
  %63 = load double, ptr %11, align 8, !tbaa !5
  %64 = load i32, ptr %19, align 4, !tbaa !9
  %65 = load i32, ptr %24, align 4, !tbaa !9
  %66 = sub nsw i32 %64, %65
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %68) #4
  store double %63, ptr %69, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %58
  %71 = load i32, ptr %24, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %24, align 4, !tbaa !9
  br label %49, !llvm.loop !13

73:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  store double 5.000000e-01, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %74 = load double, ptr %16, align 8, !tbaa !5
  %75 = fsub double 1.000000e+00, %74
  store double %75, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 1, ptr %27, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %150, %73
  %77 = load i32, ptr %27, align 4, !tbaa !9
  %78 = load i32, ptr %17, align 4, !tbaa !9
  %79 = sub nsw i32 %78, 1
  %80 = icmp slt i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  store i32 5, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %154

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %83 = load i32, ptr %27, align 4, !tbaa !9
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = invoke noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef %83, i32 noundef %84, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %86 unwind label %121

86:                                               ; preds = %82
  store double %85, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %87 = load i8, ptr %15, align 1, !tbaa !11, !range !15, !noundef !16
  %88 = trunc i8 %87 to i1
  br i1 %88, label %89, label %112

89:                                               ; preds = %86
  %90 = load double, ptr %29, align 8, !tbaa !5
  %91 = load double, ptr %25, align 8, !tbaa !5
  %92 = fcmp olt double %90, %91
  br i1 %92, label %93, label %99

93:                                               ; preds = %89
  %94 = load double, ptr %29, align 8, !tbaa !5
  %95 = load double, ptr %25, align 8, !tbaa !5
  %96 = fdiv double %94, %95
  %97 = load double, ptr %26, align 8, !tbaa !5
  %98 = fmul double %96, %97
  br label %110

99:                                               ; preds = %89
  %100 = load double, ptr %29, align 8, !tbaa !5
  %101 = load double, ptr %25, align 8, !tbaa !5
  %102 = fsub double %100, %101
  %103 = load double, ptr %25, align 8, !tbaa !5
  %104 = fsub double 1.000000e+00, %103
  %105 = fdiv double %102, %104
  %106 = load double, ptr %26, align 8, !tbaa !5
  %107 = fsub double 1.000000e+00, %106
  %108 = load double, ptr %26, align 8, !tbaa !5
  %109 = call double @llvm.fmuladd.f64(double %105, double %107, double %108)
  br label %110

110:                                              ; preds = %99, %93
  %111 = phi double [ %98, %93 ], [ %109, %99 ]
  br label %114

112:                                              ; preds = %86
  %113 = load double, ptr %29, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %112, %110
  %115 = phi double [ %111, %110 ], [ %113, %112 ]
  store double %115, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %142, %114
  %117 = load i32, ptr %31, align 4, !tbaa !9
  %118 = load i32, ptr %18, align 4, !tbaa !9
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %125, label %120

120:                                              ; preds = %116
  store i32 8, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  br label %149

121:                                              ; preds = %82
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %22, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %23, align 4
  br label %153

125:                                              ; preds = %116
  %126 = load double, ptr %30, align 8, !tbaa !5
  %127 = load double, ptr %10, align 8, !tbaa !5
  %128 = load double, ptr %11, align 8, !tbaa !5
  %129 = invoke noundef double @_ZN3ads4lerpIddEET0_T_S1_S1_(double noundef %126, double noundef %127, double noundef %128)
          to label %130 unwind label %145

130:                                              ; preds = %125
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  %133 = load i32, ptr %27, align 4, !tbaa !9
  %134 = sub nsw i32 %133, 1
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = mul nsw i32 %134, %135
  %137 = add nsw i32 %132, %136
  %138 = load i32, ptr %31, align 4, !tbaa !9
  %139 = add nsw i32 %137, %138
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %140) #4
  store double %129, ptr %141, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %130
  %143 = load i32, ptr %31, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %31, align 4, !tbaa !9
  br label %116, !llvm.loop !17

145:                                              ; preds = %125
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %22, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  br label %153

149:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %27, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %27, align 4, !tbaa !9
  br label %76, !llvm.loop !18

153:                                              ; preds = %145, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %161

154:                                              ; preds = %81
  call void @_ZNSt6vectorIdSaIdEEC2EOS1_(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  %155 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZN3ads7bspline5basisC2ESt6vectorIdSaIdEEi(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %32, i32 noundef %155)
          to label %156 unwind label %157

156:                                              ; preds = %154
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  ret void

157:                                              ; preds = %154
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %22, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %23, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %32) #4
  br label %161

161:                                              ; preds = %157, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  br label %162

162:                                              ; preds = %161, %54
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %22, align 8
  %165 = load i32, ptr %23, align 4
  %166 = insertvalue { ptr, i32 } poison, ptr %164, 0
  %167 = insertvalue { ptr, i32 } %166, i32 %165, 1
  resume { ptr, i32 } %167
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef, i32 noundef, double noundef, double noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3ads4lerpIddEET0_T_S1_S1_(double noundef, double noundef, double noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ads7bspline5basisC2ESt6vectorIdSaIdEEi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !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"

%"struct.ads::bspline::basis" = type { %"class.std::vector", i32, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12create_basisddiiibd(ptr dead_on_unwind noalias writable sret(%"struct.ads::bspline::basis") align 8 %0, double noundef %1, double noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6, double noundef %7) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::vector", align 8
  %12 = add i32 %5, 1
  %13 = add i32 %3, 1
  %14 = shl nsw i32 %13, 1
  %15 = add nsw i32 %4, -1
  %16 = mul nsw i32 %12, %15
  %17 = add nsw i32 %16, %14
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  %18 = sext i32 %17 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %18, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %19 unwind label %53

19:                                               ; preds = %8
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  %.not57 = icmp slt i32 %3, 0
  br i1 %.not57, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %19
  %wide.trip.count = zext i32 %13 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %19
  %20 = fsub double 1.000000e+00, %7
  %21 = icmp sgt i32 %4, 1
  br i1 %21, label %.lr.ph66, label %._crit_edge67

.lr.ph66:                                         ; preds = %._crit_edge
  %22 = fsub double 1.000000e+00, %20
  %.not5659 = icmp slt i32 %5, 0
  br i1 %.not5659, label %.lr.ph66.split.us, label %.lr.ph66.split

.lr.ph66.split.us:                                ; preds = %.lr.ph66
  br i1 %6, label %.lr.ph66.split.us.split.us, label %.lr.ph66.split.us.split

.lr.ph66.split.us.split.us:                       ; preds = %.lr.ph66.split.us, %24
  %.04764.us.us = phi i32 [ %25, %24 ], [ 1, %.lr.ph66.split.us ]
  %23 = invoke noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef %.04764.us.us, i32 noundef %4, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %24 unwind label %.split.us.split.us

24:                                               ; preds = %.lr.ph66.split.us.split.us
  %25 = add nuw nsw i32 %.04764.us.us, 1
  %exitcond96.not = icmp eq i32 %25, %4
  br i1 %exitcond96.not, label %._crit_edge67, label %.lr.ph66.split.us.split.us, !llvm.loop !5

.split.us.split.us:                               ; preds = %.lr.ph66.split.us.split.us
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.lr.ph66.split.us.split:                          ; preds = %.lr.ph66.split.us, %28
  %.04764.us = phi i32 [ %29, %28 ], [ 1, %.lr.ph66.split.us ]
  %27 = invoke noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef %.04764.us, i32 noundef %4, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %28 unwind label %.split.us.split

28:                                               ; preds = %.lr.ph66.split.us.split
  %29 = add nuw nsw i32 %.04764.us, 1
  %exitcond95.not = icmp eq i32 %29, %4
  br i1 %exitcond95.not, label %._crit_edge67, label %.lr.ph66.split.us.split, !llvm.loop !5

.split.us.split:                                  ; preds = %.lr.ph66.split.us.split
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

.lr.ph66.split:                                   ; preds = %.lr.ph66
  %31 = sext i32 %12 to i64
  %32 = sext i32 %13 to i64
  %wide.trip.count93 = zext nneg i32 %4 to i64
  %wide.trip.count88 = zext i32 %12 to i64
  br i1 %6, label %.lr.ph66.split.split.us, label %.lr.ph66.split.split

.lr.ph66.split.split.us:                          ; preds = %.lr.ph66.split, %._crit_edge63.us
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %._crit_edge63.us ], [ 1, %.lr.ph66.split ]
  %33 = trunc nuw nsw i64 %indvars.iv90 to i32
  %34 = invoke noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef %33, i32 noundef %4, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %35 unwind label %.split.split.us

35:                                               ; preds = %.lr.ph66.split.split.us
  %36 = fcmp olt double %34, 5.000000e-01
  br i1 %36, label %41, label %37

37:                                               ; preds = %35
  %38 = fadd double %34, -5.000000e-01
  %39 = fmul double %38, 2.000000e+00
  %40 = call double @llvm.fmuladd.f64(double %39, double %22, double %20)
  br label %.lr.ph62.us

41:                                               ; preds = %35
  %42 = fmul double %34, 2.000000e+00
  %43 = fmul double %20, %42
  br label %.lr.ph62.us

.lr.ph62.us:                                      ; preds = %41, %37
  %44 = phi double [ %43, %41 ], [ %40, %37 ]
  %45 = add nsw i64 %indvars.iv90, -1
  %46 = mul nsw i64 %45, %31
  %47 = add nsw i64 %46, %32
  br label %48

48:                                               ; preds = %48, %.lr.ph62.us
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %48 ], [ 0, %.lr.ph62.us ]
  %49 = call noundef double @_ZN3ads4lerpIddEET0_T_S1_S1_(double noundef %44, double noundef %1, double noundef %2)
  %50 = add nsw i64 %47, %indvars.iv85
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %50) #4
  store double %49, ptr %51, align 8, !tbaa !7
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond89.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count88
  br i1 %exitcond89.not, label %._crit_edge63.us, label %48, !llvm.loop !11

._crit_edge63.us:                                 ; preds = %48
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count93
  br i1 %exitcond94.not, label %._crit_edge67, label %.lr.ph66.split.split.us, !llvm.loop !5

.split.split.us:                                  ; preds = %.lr.ph66.split.split.us
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

53:                                               ; preds = %8
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  br label %74

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv) #4
  store double %1, ptr %55, align 8, !tbaa !7
  %56 = trunc i64 %indvars.iv to i32
  %57 = xor i32 %56, -1
  %58 = add i32 %17, %57
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %59) #4
  store double %2, ptr %60, align 8, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge67:                                    ; preds = %._crit_edge63, %._crit_edge63.us, %28, %24, %._crit_edge
  call void @_ZNSt6vectorIdSaIdEEC2EOS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  invoke void @_ZN3ads7bspline5basisC2ESt6vectorIdSaIdEEi(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull %11, i32 noundef %3)
          to label %71 unwind label %72

.lr.ph66.split.split:                             ; preds = %.lr.ph66.split, %._crit_edge63
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge63 ], [ 1, %.lr.ph66.split ]
  %61 = trunc nuw nsw i64 %indvars.iv80 to i32
  %62 = invoke noundef double @_ZN3ads4lerpIiidEET1_T_T0_S1_S1_(i32 noundef %61, i32 noundef %4, double noundef 0.000000e+00, double noundef 1.000000e+00)
          to label %.lr.ph62 unwind label %.split.split

.lr.ph62:                                         ; preds = %.lr.ph66.split.split
  %63 = add nsw i64 %indvars.iv80, -1
  %64 = mul nsw i64 %63, %31
  %65 = add nsw i64 %64, %32
  br label %67

._crit_edge63:                                    ; preds = %67
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count93
  br i1 %exitcond84.not, label %._crit_edge67, label %.lr.ph66.split.split, !llvm.loop !5

.split.split:                                     ; preds = %.lr.ph66.split.split
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %.split.us

67:                                               ; preds = %.lr.ph62, %67
  %indvars.iv75 = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next76, %67 ]
  %68 = call noundef double @_ZN3ads4lerpIddEET0_T_S1_S1_(double noundef %62, double noundef %1, double noundef %2)
  %69 = add nsw i64 %65, %indvars.iv75
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %69) #4
  store double %68, ptr %70, align 8, !tbaa !7
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count88
  br i1 %exitcond79.not, label %._crit_edge63, label %67, !llvm.loop !11

71:                                               ; preds = %._crit_edge67
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  ret void

72:                                               ; preds = %._crit_edge67
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  br label %.split.us

.split.us:                                        ; preds = %.split.us.split.us, %.split.us.split, %.split.split.us, %.split.split, %72
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %30, %.split.us.split ], [ %26, %.split.us.split.us ], [ %66, %.split.split ], [ %52, %.split.split.us ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %74

74:                                               ; preds = %.split.us, %53
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.split.us ], [ %54, %53 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  resume { ptr, i32 } %.pn.pn
}

; 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 nounwind uwtable
declare dso_local void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3ads4lerpIddEET0_T_S1_S1_(double noundef, double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2EOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3ads7bspline5basisC2ESt6vectorIdSaIdEEi(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass