; LLVM IR from marcinlos/iga-ads :: src/ads/bspline (bspline)

; 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_eval_ctx" = type { %"class.std::vector", i32, [4 x i8], %"struct.ads::bspline::basis_eval_array", %"struct.ads::bspline::basis_eval_array" }
%"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 }
%"struct.ads::bspline::basis_eval_array" = type <{ ptr, i32, [4 x i8] }>
%"struct.ads::bspline::basis" = type { %"class.std::vector", i32, %"class.std::vector" }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3ads7bspline14basis_eval_ctx4leftEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3ads7bspline14basis_eval_ctx5rightEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ads7bspline27eval_basis_with_derivativesEidRKNS0_5basisEPPdiRNS0_14basis_eval_ctxE(i32 noundef %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(64) %5) #3 {
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !11
  store i32 %4, ptr %11, align 4, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %36 = load ptr, ptr %12, align 8, !tbaa !11
  %37 = getelementptr inbounds %"struct.ads::bspline::basis_eval_ctx", ptr %36, i32 0, i32 3
  store ptr %37, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %38 = load ptr, ptr %12, align 8, !tbaa !11
  %39 = getelementptr inbounds %"struct.ads::bspline::basis_eval_ctx", ptr %38, i32 0, i32 4
  store ptr %39, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %40 = load ptr, ptr %12, align 8, !tbaa !11
  %41 = call noundef ptr @_ZN3ads7bspline14basis_eval_ctx4leftEv(ptr noundef nonnull align 8 dereferenceable(64) %40)
  store ptr %41, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %42 = load ptr, ptr %12, align 8, !tbaa !11
  %43 = call noundef ptr @_ZN3ads7bspline14basis_eval_ctx5rightEv(ptr noundef nonnull align 8 dereferenceable(64) %42)
  store ptr %43, ptr %16, align 8, !tbaa !11
  %44 = load ptr, ptr %13, align 8, !tbaa !11
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %44, i32 noundef 0, i32 noundef 0)
  store double 1.000000e+00, ptr %45, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %150, %6
  %47 = load i32, ptr %17, align 4, !tbaa !5
  %48 = load ptr, ptr %9, align 8, !tbaa !11
  %49 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 8, !tbaa !13
  %51 = icmp sle i32 %47, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %153

53:                                               ; preds = %46
  %54 = load double, ptr %8, align 8, !tbaa !9
  %55 = load ptr, ptr %9, align 8, !tbaa !11
  %56 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %55, i32 0, i32 0
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  %59 = load i32, ptr %17, align 4, !tbaa !5
  %60 = sub nsw i32 %58, %59
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %61) #5
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = fsub double %54, %63
  %65 = load ptr, ptr %15, align 8, !tbaa !11
  %66 = load i32, ptr %17, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  store double %64, ptr %68, align 8, !tbaa !9
  %69 = load ptr, ptr %9, align 8, !tbaa !11
  %70 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %69, i32 0, i32 0
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load i32, ptr %17, align 4, !tbaa !5
  %73 = add nsw i32 %71, %72
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %74) #5
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = load double, ptr %8, align 8, !tbaa !9
  %78 = fsub double %76, %77
  %79 = load ptr, ptr %16, align 8, !tbaa !11
  %80 = load i32, ptr %17, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  store double %78, ptr %82, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %141, %53
  %84 = load i32, ptr %20, align 4, !tbaa !5
  %85 = load i32, ptr %17, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %144

88:                                               ; preds = %83
  %89 = load ptr, ptr %16, align 8, !tbaa !11
  %90 = load i32, ptr %20, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %89, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = load ptr, ptr %15, align 8, !tbaa !11
  %96 = load i32, ptr %17, align 4, !tbaa !5
  %97 = load i32, ptr %20, align 4, !tbaa !5
  %98 = sub nsw i32 %96, %97
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds double, ptr %95, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = fadd double %94, %101
  %103 = load ptr, ptr %13, align 8, !tbaa !11
  %104 = load i32, ptr %17, align 4, !tbaa !5
  %105 = load i32, ptr %20, align 4, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %103, i32 noundef %104, i32 noundef %105)
  store double %102, ptr %106, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %107 = load ptr, ptr %13, align 8, !tbaa !11
  %108 = load i32, ptr %20, align 4, !tbaa !5
  %109 = load i32, ptr %17, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %107, i32 noundef %108, i32 noundef %110)
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = load ptr, ptr %13, align 8, !tbaa !11
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = load i32, ptr %20, align 4, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %113, i32 noundef %114, i32 noundef %115)
  %117 = load double, ptr %116, align 8, !tbaa !9
  %118 = fdiv double %112, %117
  store double %118, ptr %21, align 8, !tbaa !9
  %119 = load double, ptr %19, align 8, !tbaa !9
  %120 = load ptr, ptr %16, align 8, !tbaa !11
  %121 = load i32, ptr %20, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds double, ptr %120, i64 %123
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = load double, ptr %21, align 8, !tbaa !9
  %127 = call double @llvm.fmuladd.f64(double %125, double %126, double %119)
  %128 = load ptr, ptr %13, align 8, !tbaa !11
  %129 = load i32, ptr %20, align 4, !tbaa !5
  %130 = load i32, ptr %17, align 4, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %128, i32 noundef %129, i32 noundef %130)
  store double %127, ptr %131, align 8, !tbaa !9
  %132 = load ptr, ptr %15, align 8, !tbaa !11
  %133 = load i32, ptr %17, align 4, !tbaa !5
  %134 = load i32, ptr %20, align 4, !tbaa !5
  %135 = sub nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %132, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !9
  %139 = load double, ptr %21, align 8, !tbaa !9
  %140 = fmul double %138, %139
  store double %140, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %141

141:                                              ; preds = %88
  %142 = load i32, ptr %20, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %20, align 4, !tbaa !5
  br label %83, !llvm.loop !19

144:                                              ; preds = %87
  %145 = load double, ptr %19, align 8, !tbaa !9
  %146 = load ptr, ptr %13, align 8, !tbaa !11
  %147 = load i32, ptr %17, align 4, !tbaa !5
  %148 = load i32, ptr %17, align 4, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %146, i32 noundef %147, i32 noundef %148)
  store double %145, ptr %149, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %150

150:                                              ; preds = %144
  %151 = load i32, ptr %17, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %17, align 4, !tbaa !5
  br label %46, !llvm.loop !21

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

154:                                              ; preds = %175, %153
  %155 = load i32, ptr %22, align 4, !tbaa !5
  %156 = load ptr, ptr %9, align 8, !tbaa !11
  %157 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 8, !tbaa !13
  %159 = icmp sle i32 %155, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %154
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %178

161:                                              ; preds = %154
  %162 = load ptr, ptr %13, align 8, !tbaa !11
  %163 = load i32, ptr %22, align 4, !tbaa !5
  %164 = load ptr, ptr %9, align 8, !tbaa !11
  %165 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 8, !tbaa !13
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %162, i32 noundef %163, i32 noundef %166)
  %168 = load double, ptr %167, align 8, !tbaa !9
  %169 = load ptr, ptr %10, align 8, !tbaa !11
  %170 = getelementptr inbounds ptr, ptr %169, i64 0
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = load i32, ptr %22, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds double, ptr %171, i64 %173
  store double %168, ptr %174, align 8, !tbaa !9
  br label %175

175:                                              ; preds = %161
  %176 = load i32, ptr %22, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %22, align 4, !tbaa !5
  br label %154, !llvm.loop !22

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

179:                                              ; preds = %353, %178
  %180 = load i32, ptr %23, align 4, !tbaa !5
  %181 = load ptr, ptr %9, align 8, !tbaa !11
  %182 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %181, i32 0, i32 1
  %183 = load i32, ptr %182, align 8, !tbaa !13
  %184 = icmp sle i32 %180, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %179
  store i32 11, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %356

186:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 1, ptr %25, align 4, !tbaa !5
  %187 = load ptr, ptr %14, align 8, !tbaa !11
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %187, i32 noundef 0, i32 noundef 0)
  store double 1.000000e+00, ptr %188, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %349, %186
  %190 = load i32, ptr %26, align 4, !tbaa !5
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = icmp sle i32 %190, %191
  br i1 %192, label %194, label %193

193:                                              ; preds = %189
  store i32 14, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %352

194:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store double 0.000000e+00, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %195 = load i32, ptr %23, align 4, !tbaa !5
  %196 = load i32, ptr %26, align 4, !tbaa !5
  %197 = sub nsw i32 %195, %196
  store i32 %197, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %198 = load ptr, ptr %9, align 8, !tbaa !11
  %199 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %198, i32 0, i32 1
  %200 = load i32, ptr %199, align 8, !tbaa !13
  %201 = load i32, ptr %26, align 4, !tbaa !5
  %202 = sub nsw i32 %200, %201
  store i32 %202, ptr %29, align 4, !tbaa !5
  %203 = load i32, ptr %23, align 4, !tbaa !5
  %204 = load i32, ptr %26, align 4, !tbaa !5
  %205 = icmp sge i32 %203, %204
  br i1 %205, label %206, label %231

206:                                              ; preds = %194
  %207 = load ptr, ptr %14, align 8, !tbaa !11
  %208 = load i32, ptr %24, align 4, !tbaa !5
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %207, i32 noundef %208, i32 noundef 0)
  %210 = load double, ptr %209, align 8, !tbaa !9
  %211 = load ptr, ptr %13, align 8, !tbaa !11
  %212 = load i32, ptr %29, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  %214 = load i32, ptr %28, align 4, !tbaa !5
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %211, i32 noundef %213, i32 noundef %214)
  %216 = load double, ptr %215, align 8, !tbaa !9
  %217 = fdiv double %210, %216
  %218 = load ptr, ptr %14, align 8, !tbaa !11
  %219 = load i32, ptr %25, align 4, !tbaa !5
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %218, i32 noundef %219, i32 noundef 0)
  store double %217, ptr %220, align 8, !tbaa !9
  %221 = load ptr, ptr %14, align 8, !tbaa !11
  %222 = load i32, ptr %25, align 4, !tbaa !5
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %221, i32 noundef %222, i32 noundef 0)
  %224 = load double, ptr %223, align 8, !tbaa !9
  %225 = load ptr, ptr %13, align 8, !tbaa !11
  %226 = load i32, ptr %28, align 4, !tbaa !5
  %227 = load i32, ptr %29, align 4, !tbaa !5
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %225, i32 noundef %226, i32 noundef %227)
  %229 = load double, ptr %228, align 8, !tbaa !9
  %230 = fmul double %224, %229
  store double %230, ptr %27, align 8, !tbaa !9
  br label %231

231:                                              ; preds = %206, %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %232 = load i32, ptr %28, align 4, !tbaa !5
  %233 = icmp sge i32 %232, -1
  br i1 %233, label %234, label %235

234:                                              ; preds = %231
  br label %238

235:                                              ; preds = %231
  %236 = load i32, ptr %28, align 4, !tbaa !5
  %237 = sub nsw i32 0, %236
  br label %238

238:                                              ; preds = %235, %234
  %239 = phi i32 [ 1, %234 ], [ %237, %235 ]
  store i32 %239, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %240 = load i32, ptr %23, align 4, !tbaa !5
  %241 = sub nsw i32 %240, 1
  %242 = load i32, ptr %29, align 4, !tbaa !5
  %243 = icmp sle i32 %241, %242
  br i1 %243, label %244, label %247

244:                                              ; preds = %238
  %245 = load i32, ptr %26, align 4, !tbaa !5
  %246 = sub nsw i32 %245, 1
  br label %253

247:                                              ; preds = %238
  %248 = load ptr, ptr %9, align 8, !tbaa !11
  %249 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %248, i32 0, i32 1
  %250 = load i32, ptr %249, align 8, !tbaa !13
  %251 = load i32, ptr %23, align 4, !tbaa !5
  %252 = sub nsw i32 %250, %251
  br label %253

253:                                              ; preds = %247, %244
  %254 = phi i32 [ %246, %244 ], [ %252, %247 ]
  store i32 %254, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %255 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %255, ptr %32, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %301, %253
  %257 = load i32, ptr %32, align 4, !tbaa !5
  %258 = load i32, ptr %31, align 4, !tbaa !5
  %259 = icmp sle i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 17, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %304

261:                                              ; preds = %256
  %262 = load ptr, ptr %14, align 8, !tbaa !11
  %263 = load i32, ptr %24, align 4, !tbaa !5
  %264 = load i32, ptr %32, align 4, !tbaa !5
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %262, i32 noundef %263, i32 noundef %264)
  %266 = load double, ptr %265, align 8, !tbaa !9
  %267 = load ptr, ptr %14, align 8, !tbaa !11
  %268 = load i32, ptr %24, align 4, !tbaa !5
  %269 = load i32, ptr %32, align 4, !tbaa !5
  %270 = sub nsw i32 %269, 1
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %267, i32 noundef %268, i32 noundef %270)
  %272 = load double, ptr %271, align 8, !tbaa !9
  %273 = fsub double %266, %272
  %274 = load ptr, ptr %13, align 8, !tbaa !11
  %275 = load i32, ptr %29, align 4, !tbaa !5
  %276 = add nsw i32 %275, 1
  %277 = load i32, ptr %28, align 4, !tbaa !5
  %278 = load i32, ptr %32, align 4, !tbaa !5
  %279 = add nsw i32 %277, %278
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %274, i32 noundef %276, i32 noundef %279)
  %281 = load double, ptr %280, align 8, !tbaa !9
  %282 = fdiv double %273, %281
  %283 = load ptr, ptr %14, align 8, !tbaa !11
  %284 = load i32, ptr %25, align 4, !tbaa !5
  %285 = load i32, ptr %32, align 4, !tbaa !5
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %283, i32 noundef %284, i32 noundef %285)
  store double %282, ptr %286, align 8, !tbaa !9
  %287 = load ptr, ptr %14, align 8, !tbaa !11
  %288 = load i32, ptr %25, align 4, !tbaa !5
  %289 = load i32, ptr %32, align 4, !tbaa !5
  %290 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %287, i32 noundef %288, i32 noundef %289)
  %291 = load double, ptr %290, align 8, !tbaa !9
  %292 = load ptr, ptr %13, align 8, !tbaa !11
  %293 = load i32, ptr %28, align 4, !tbaa !5
  %294 = load i32, ptr %32, align 4, !tbaa !5
  %295 = add nsw i32 %293, %294
  %296 = load i32, ptr %29, align 4, !tbaa !5
  %297 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %292, i32 noundef %295, i32 noundef %296)
  %298 = load double, ptr %297, align 8, !tbaa !9
  %299 = load double, ptr %27, align 8, !tbaa !9
  %300 = call double @llvm.fmuladd.f64(double %291, double %298, double %299)
  store double %300, ptr %27, align 8, !tbaa !9
  br label %301

301:                                              ; preds = %261
  %302 = load i32, ptr %32, align 4, !tbaa !5
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %32, align 4, !tbaa !5
  br label %256, !llvm.loop !23

304:                                              ; preds = %260
  %305 = load i32, ptr %23, align 4, !tbaa !5
  %306 = load i32, ptr %29, align 4, !tbaa !5
  %307 = icmp sle i32 %305, %306
  br i1 %307, label %308, label %339

308:                                              ; preds = %304
  %309 = load ptr, ptr %14, align 8, !tbaa !11
  %310 = load i32, ptr %24, align 4, !tbaa !5
  %311 = load i32, ptr %26, align 4, !tbaa !5
  %312 = sub nsw i32 %311, 1
  %313 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %309, i32 noundef %310, i32 noundef %312)
  %314 = load double, ptr %313, align 8, !tbaa !9
  %315 = fneg double %314
  %316 = load ptr, ptr %13, align 8, !tbaa !11
  %317 = load i32, ptr %29, align 4, !tbaa !5
  %318 = add nsw i32 %317, 1
  %319 = load i32, ptr %23, align 4, !tbaa !5
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %316, i32 noundef %318, i32 noundef %319)
  %321 = load double, ptr %320, align 8, !tbaa !9
  %322 = fdiv double %315, %321
  %323 = load ptr, ptr %14, align 8, !tbaa !11
  %324 = load i32, ptr %25, align 4, !tbaa !5
  %325 = load i32, ptr %26, align 4, !tbaa !5
  %326 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %323, i32 noundef %324, i32 noundef %325)
  store double %322, ptr %326, align 8, !tbaa !9
  %327 = load ptr, ptr %14, align 8, !tbaa !11
  %328 = load i32, ptr %25, align 4, !tbaa !5
  %329 = load i32, ptr %26, align 4, !tbaa !5
  %330 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %327, i32 noundef %328, i32 noundef %329)
  %331 = load double, ptr %330, align 8, !tbaa !9
  %332 = load ptr, ptr %13, align 8, !tbaa !11
  %333 = load i32, ptr %23, align 4, !tbaa !5
  %334 = load i32, ptr %29, align 4, !tbaa !5
  %335 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %332, i32 noundef %333, i32 noundef %334)
  %336 = load double, ptr %335, align 8, !tbaa !9
  %337 = load double, ptr %27, align 8, !tbaa !9
  %338 = call double @llvm.fmuladd.f64(double %331, double %336, double %337)
  store double %338, ptr %27, align 8, !tbaa !9
  br label %339

339:                                              ; preds = %308, %304
  %340 = load double, ptr %27, align 8, !tbaa !9
  %341 = load ptr, ptr %10, align 8, !tbaa !11
  %342 = load i32, ptr %26, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds ptr, ptr %341, i64 %343
  %345 = load ptr, ptr %344, align 8, !tbaa !11
  %346 = load i32, ptr %23, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds double, ptr %345, i64 %347
  store double %340, ptr %348, align 8, !tbaa !9
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %349

349:                                              ; preds = %339
  %350 = load i32, ptr %26, align 4, !tbaa !5
  %351 = add nsw i32 %350, 1
  store i32 %351, ptr %26, align 4, !tbaa !5
  br label %189, !llvm.loop !24

352:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %353

353:                                              ; preds = %352
  %354 = load i32, ptr %23, align 4, !tbaa !5
  %355 = add nsw i32 %354, 1
  store i32 %355, ptr %23, align 4, !tbaa !5
  br label %179, !llvm.loop !25

356:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  %357 = load ptr, ptr %9, align 8, !tbaa !11
  %358 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %357, i32 0, i32 1
  %359 = load i32, ptr %358, align 8, !tbaa !13
  store i32 %359, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 1, ptr %34, align 4, !tbaa !5
  br label %360

360:                                              ; preds = %397, %356
  %361 = load i32, ptr %34, align 4, !tbaa !5
  %362 = load i32, ptr %11, align 4, !tbaa !5
  %363 = icmp sle i32 %361, %362
  br i1 %363, label %365, label %364

364:                                              ; preds = %360
  store i32 20, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %400

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

366:                                              ; preds = %386, %365
  %367 = load i32, ptr %35, align 4, !tbaa !5
  %368 = load ptr, ptr %9, align 8, !tbaa !11
  %369 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %368, i32 0, i32 1
  %370 = load i32, ptr %369, align 8, !tbaa !13
  %371 = icmp sle i32 %367, %370
  br i1 %371, label %373, label %372

372:                                              ; preds = %366
  store i32 23, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %389

373:                                              ; preds = %366
  %374 = load i32, ptr %33, align 4, !tbaa !5
  %375 = sitofp i32 %374 to double
  %376 = load ptr, ptr %10, align 8, !tbaa !11
  %377 = load i32, ptr %34, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds ptr, ptr %376, i64 %378
  %380 = load ptr, ptr %379, align 8, !tbaa !11
  %381 = load i32, ptr %35, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds double, ptr %380, i64 %382
  %384 = load double, ptr %383, align 8, !tbaa !9
  %385 = fmul double %384, %375
  store double %385, ptr %383, align 8, !tbaa !9
  br label %386

386:                                              ; preds = %373
  %387 = load i32, ptr %35, align 4, !tbaa !5
  %388 = add nsw i32 %387, 1
  store i32 %388, ptr %35, align 4, !tbaa !5
  br label %366, !llvm.loop !26

389:                                              ; preds = %372
  %390 = load ptr, ptr %9, align 8, !tbaa !11
  %391 = getelementptr inbounds %"struct.ads::bspline::basis", ptr %390, i32 0, i32 1
  %392 = load i32, ptr %391, align 8, !tbaa !13
  %393 = load i32, ptr %34, align 4, !tbaa !5
  %394 = sub nsw i32 %392, %393
  %395 = load i32, ptr %33, align 4, !tbaa !5
  %396 = mul nsw i32 %395, %394
  store i32 %396, ptr %33, align 4, !tbaa !5
  br label %397

397:                                              ; preds = %389
  %398 = load i32, ptr %34, align 4, !tbaa !5
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %34, align 4, !tbaa !5
  br label %360, !llvm.loop !27

400:                                              ; preds = %364
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef, i32 noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"_ZTSN3ads7bspline5basisE", !15, i64 0, !6, i64 24, !15, i64 32}
!15 = !{!"_ZTSSt6vectorIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}
!27 = distinct !{!27, !20}


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

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

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZN3ads7bspline14basis_eval_ctx4leftEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3ads7bspline14basis_eval_ctx5rightEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3ads7bspline27eval_basis_with_derivativesEidRKNS0_5basisEPPdiRNS0_14basis_eval_ctxE(i32 noundef %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(64) %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %5, i64 32
  %10 = getelementptr inbounds i8, ptr %5, i64 48
  %11 = tail call noundef ptr @_ZN3ads7bspline14basis_eval_ctx4leftEv(ptr noundef nonnull align 8 dereferenceable(64) %5)
  %12 = tail call noundef ptr @_ZN3ads7bspline14basis_eval_ctx5rightEv(ptr noundef nonnull align 8 dereferenceable(64) %5)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef 0, i32 noundef 0)
  store double 1.000000e+00, ptr %13, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %2, i64 24
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %.not171 = icmp slt i32 %15, 1
  br i1 %.not171, label %.preheader167, label %.lr.ph

.lr.ph:                                           ; preds = %6
  %16 = add nsw i32 %0, 1
  %17 = sext i32 %0 to i64
  br label %19

.preheader167:                                    ; preds = %34, %6
  %18 = phi i32 [ %15, %6 ], [ %36, %34 ]
  %.not156173 = icmp slt i32 %18, 0
  br i1 %.not156173, label %.preheader165, label %.lr.ph175

19:                                               ; preds = %.lr.ph, %34
  %indvars.iv204 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next205, %34 ]
  %20 = trunc nuw nsw i64 %indvars.iv204 to i32
  %21 = sub i32 %16, %20
  %22 = sext i32 %21 to i64
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %22) #5
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = fsub double %1, %24
  %26 = getelementptr inbounds double, ptr %11, i64 %indvars.iv204
  store double %25, ptr %26, align 8, !tbaa !5
  %27 = add nsw i64 %indvars.iv204, %17
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %27) #5
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = fsub double %29, %1
  %31 = getelementptr inbounds double, ptr %12, i64 %indvars.iv204
  store double %30, ptr %31, align 8, !tbaa !5
  %32 = trunc i64 %indvars.iv204 to i32
  %33 = add i32 %32, -1
  br label %38

34:                                               ; preds = %38
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %20, i32 noundef %20)
  store double %56, ptr %35, align 8, !tbaa !5
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %36 = load i32, ptr %14, align 8, !tbaa !9
  %37 = sext i32 %36 to i64
  %.not.not = icmp slt i64 %indvars.iv204, %37
  br i1 %.not.not, label %19, label %.preheader167, !llvm.loop !17

38:                                               ; preds = %19, %38
  %indvars.iv = phi i64 [ 0, %19 ], [ %indvars.iv.next, %38 ]
  %.0146170 = phi double [ 0.000000e+00, %19 ], [ %56, %38 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next
  %40 = load double, ptr %39, align 8, !tbaa !5
  %41 = sub nsw i64 %indvars.iv204, %indvars.iv
  %42 = getelementptr inbounds double, ptr %11, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = fadd double %40, %43
  %45 = trunc nuw nsw i64 %indvars.iv to i32
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %20, i32 noundef %45)
  store double %44, ptr %46, align 8, !tbaa !5
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %45, i32 noundef %33)
  %48 = load double, ptr %47, align 8, !tbaa !5
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %20, i32 noundef %45)
  %50 = load double, ptr %49, align 8, !tbaa !5
  %51 = fdiv double %48, %50
  %52 = load double, ptr %39, align 8, !tbaa !5
  %53 = tail call double @llvm.fmuladd.f64(double %52, double %51, double %.0146170)
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %45, i32 noundef %20)
  store double %53, ptr %54, align 8, !tbaa !5
  %55 = load double, ptr %42, align 8, !tbaa !5
  %56 = fmul double %51, %55
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv204
  br i1 %exitcond.not, label %34, label %38, !llvm.loop !19

.preheader166:                                    ; preds = %.lr.ph175
  %.not157185 = icmp slt i32 %67, 0
  br i1 %.not157185, label %.preheader165, label %.lr.ph187

.lr.ph187:                                        ; preds = %.preheader166
  %.not160180 = icmp slt i32 %4, 1
  br i1 %.not160180, label %.lr.ph187.split.us, label %.lr.ph183.preheader

.lr.ph183.preheader:                              ; preds = %.lr.ph187
  %57 = add nuw i32 %4, 1
  %wide.trip.count = zext i32 %57 to i64
  br label %.lr.ph183

.lr.ph187.split.us:                               ; preds = %.lr.ph187, %.lr.ph187.split.us
  %.0150186.us = phi i32 [ %59, %.lr.ph187.split.us ], [ 0, %.lr.ph187 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef 0, i32 noundef 0)
  store double 1.000000e+00, ptr %58, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %59 = add nuw nsw i32 %.0150186.us, 1
  %60 = load i32, ptr %14, align 8, !tbaa !9
  %.not157.us.not = icmp slt i32 %.0150186.us, %60
  br i1 %.not157.us.not, label %.lr.ph187.split.us, label %.preheader165, !llvm.loop !20

.lr.ph175:                                        ; preds = %.preheader167, %.lr.ph175
  %indvars.iv207 = phi i64 [ %indvars.iv.next208, %.lr.ph175 ], [ 0, %.preheader167 ]
  %61 = phi i32 [ %67, %.lr.ph175 ], [ %18, %.preheader167 ]
  %62 = trunc nuw nsw i64 %indvars.iv207 to i32
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %62, i32 noundef %61)
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = load ptr, ptr %3, align 8, !tbaa !21
  %66 = getelementptr inbounds double, ptr %65, i64 %indvars.iv207
  store double %64, ptr %66, align 8, !tbaa !5
  %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1
  %67 = load i32, ptr %14, align 8, !tbaa !9
  %68 = sext i32 %67 to i64
  %.not156.not = icmp slt i64 %indvars.iv207, %68
  br i1 %.not156.not, label %.lr.ph175, label %.preheader166, !llvm.loop !22

.preheader165:                                    ; preds = %._crit_edge184, %.lr.ph187.split.us, %.preheader167, %.preheader166
  %.lcssa = phi i32 [ %67, %.preheader166 ], [ %18, %.preheader167 ], [ %60, %.lr.ph187.split.us ], [ %74, %._crit_edge184 ]
  %.not158193 = icmp slt i32 %4, 1
  %.not159189 = icmp slt i32 %.lcssa, 0
  %or.cond = or i1 %.not158193, %.not159189
  br i1 %or.cond, label %._crit_edge196, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader165
  %69 = add nuw i32 %.lcssa, 1
  %70 = add nuw i32 %4, 1
  %wide.trip.count226 = zext i32 %70 to i64
  %wide.trip.count221 = zext i32 %69 to i64
  %min.iters.check = icmp ult i32 %.lcssa, 3
  %n.vec = and i64 %wide.trip.count221, 4294967292
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count221
  br label %.preheader

.lr.ph183:                                        ; preds = %.lr.ph183.preheader, %._crit_edge184
  %indvars.iv215 = phi i64 [ 0, %.lr.ph183.preheader ], [ %indvars.iv.next216, %._crit_edge184 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  store i32 0, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 1, ptr %8, align 4, !tbaa !23
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef 0, i32 noundef 0)
  store double 1.000000e+00, ptr %71, align 8, !tbaa !5
  %72 = add nsw i64 %indvars.iv215, -1
  %73 = trunc nuw nsw i64 %indvars.iv215 to i32
  br label %76

._crit_edge184:                                   ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
  %74 = load i32, ptr %14, align 8, !tbaa !9
  %75 = sext i32 %74 to i64
  %.not157.not = icmp slt i64 %indvars.iv215, %75
  br i1 %.not157.not, label %.lr.ph183, label %.preheader165, !llvm.loop !20

76:                                               ; preds = %.lr.ph183, %150
  %indvars.iv211 = phi i64 [ 1, %.lr.ph183 ], [ %indvars.iv.next212, %150 ]
  %77 = sub nsw i64 %indvars.iv215, %indvars.iv211
  %78 = load i32, ptr %14, align 8
  %79 = trunc nuw nsw i64 %indvars.iv211 to i32
  %80 = sub nsw i32 %78, %79
  %.not161 = icmp ult i64 %indvars.iv215, %indvars.iv211
  br i1 %.not161, label %98, label %81

81:                                               ; preds = %76
  %82 = load i32, ptr %7, align 4, !tbaa !23
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %82, i32 noundef 0)
  %84 = load double, ptr %83, align 8, !tbaa !5
  %85 = add nsw i32 %80, 1
  %86 = trunc nsw i64 %77 to i32
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %85, i32 noundef %86)
  %88 = load double, ptr %87, align 8, !tbaa !5
  %89 = fdiv double %84, %88
  %90 = load i32, ptr %8, align 4, !tbaa !23
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %90, i32 noundef 0)
  store double %89, ptr %91, align 8, !tbaa !5
  %92 = load i32, ptr %8, align 4, !tbaa !23
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %92, i32 noundef 0)
  %94 = load double, ptr %93, align 8, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %86, i32 noundef %80)
  %96 = load double, ptr %95, align 8, !tbaa !5
  %97 = fmul double %94, %96
  %.pre = load i32, ptr %14, align 8
  br label %98

98:                                               ; preds = %81, %76
  %99 = phi i32 [ %.pre, %81 ], [ %78, %76 ]
  %.0148 = phi double [ %97, %81 ], [ 0.000000e+00, %76 ]
  %100 = icmp sgt i64 %77, -2
  %101 = trunc i64 %77 to i32
  %102 = sub i32 0, %101
  %103 = select i1 %100, i32 1, i32 %102
  %104 = sext i32 %80 to i64
  %.not162 = icmp sgt i64 %72, %104
  %105 = sub nsw i32 %99, %73
  %106 = trunc i64 %indvars.iv211 to i32
  %107 = add i32 %106, -1
  %108 = select i1 %.not162, i32 %105, i32 %107
  %.not163176 = icmp sgt i32 %103, %108
  br i1 %.not163176, label %._crit_edge, label %.lr.ph179

.lr.ph179:                                        ; preds = %98
  %109 = add nsw i32 %80, 1
  %110 = trunc nsw i64 %77 to i32
  br label %111

._crit_edge:                                      ; preds = %111, %98
  %.1.lcssa = phi double [ %.0148, %98 ], [ %131, %111 ]
  %.not164 = icmp sgt i64 %indvars.iv215, %104
  br i1 %.not164, label %150, label %133

111:                                              ; preds = %.lr.ph179, %111
  %.0144178 = phi i32 [ %103, %.lr.ph179 ], [ %132, %111 ]
  %.1177 = phi double [ %.0148, %.lr.ph179 ], [ %131, %111 ]
  %112 = load i32, ptr %7, align 4, !tbaa !23
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %112, i32 noundef %.0144178)
  %114 = load double, ptr %113, align 8, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !23
  %116 = add nsw i32 %.0144178, -1
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %115, i32 noundef %116)
  %118 = load double, ptr %117, align 8, !tbaa !5
  %119 = fsub double %114, %118
  %120 = add nsw i32 %.0144178, %110
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %109, i32 noundef %120)
  %122 = load double, ptr %121, align 8, !tbaa !5
  %123 = fdiv double %119, %122
  %124 = load i32, ptr %8, align 4, !tbaa !23
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %124, i32 noundef %.0144178)
  store double %123, ptr %125, align 8, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !23
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %126, i32 noundef %.0144178)
  %128 = load double, ptr %127, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %120, i32 noundef %80)
  %130 = load double, ptr %129, align 8, !tbaa !5
  %131 = call double @llvm.fmuladd.f64(double %128, double %130, double %.1177)
  %132 = add i32 %.0144178, 1
  %exitcond210.not = icmp eq i32 %.0144178, %108
  br i1 %exitcond210.not, label %._crit_edge, label %111, !llvm.loop !24

133:                                              ; preds = %._crit_edge
  %134 = load i32, ptr %7, align 4, !tbaa !23
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %134, i32 noundef %107)
  %136 = load double, ptr %135, align 8, !tbaa !5
  %137 = fneg double %136
  %138 = add nsw i32 %80, 1
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %138, i32 noundef %73)
  %140 = load double, ptr %139, align 8, !tbaa !5
  %141 = fdiv double %137, %140
  %142 = load i32, ptr %8, align 4, !tbaa !23
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %142, i32 noundef %79)
  store double %141, ptr %143, align 8, !tbaa !5
  %144 = load i32, ptr %8, align 4, !tbaa !23
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %10, i32 noundef %144, i32 noundef %79)
  %146 = load double, ptr %145, align 8, !tbaa !5
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12) %9, i32 noundef %73, i32 noundef %80)
  %148 = load double, ptr %147, align 8, !tbaa !5
  %149 = call double @llvm.fmuladd.f64(double %146, double %148, double %.1.lcssa)
  br label %150

150:                                              ; preds = %133, %._crit_edge
  %.2 = phi double [ %149, %133 ], [ %.1.lcssa, %._crit_edge ]
  %151 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv211
  %152 = load ptr, ptr %151, align 8, !tbaa !21
  %153 = getelementptr inbounds double, ptr %152, i64 %indvars.iv215
  store double %.2, ptr %153, align 8, !tbaa !5
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8) #5
  %indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
  %exitcond214.not = icmp eq i64 %indvars.iv.next212, %wide.trip.count
  br i1 %exitcond214.not, label %._crit_edge184, label %76, !llvm.loop !25

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge192
  %indvars.iv223 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next224, %._crit_edge192 ]
  %.0143194 = phi i32 [ %.lcssa, %.preheader.preheader ], [ %164, %._crit_edge192 ]
  %154 = sitofp i32 %.0143194 to double
  %155 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv223
  %156 = load ptr, ptr %155, align 8, !tbaa !21
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %indvars.iv218.ph = phi i64 [ 0, %.preheader ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader
  %broadcast.splatinsert = insertelement <2 x double> poison, double %154, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %157 = getelementptr inbounds double, ptr %156, i64 %index
  %158 = getelementptr inbounds i8, ptr %157, i64 16
  %wide.load = load <2 x double>, ptr %157, align 8, !tbaa !5
  %wide.load243 = load <2 x double>, ptr %158, align 8, !tbaa !5
  %159 = fmul <2 x double> %wide.load, %broadcast.splat
  %160 = fmul <2 x double> %wide.load243, %broadcast.splat
  store <2 x double> %159, ptr %157, align 8, !tbaa !5
  store <2 x double> %160, ptr %158, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %161 = icmp eq i64 %index.next, %n.vec
  br i1 %161, label %middle.block, label %vector.body, !llvm.loop !26

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge192, label %scalar.ph.preheader

._crit_edge196:                                   ; preds = %._crit_edge192, %.preheader165
  ret void

._crit_edge192:                                   ; preds = %scalar.ph, %middle.block
  %162 = trunc i64 %indvars.iv223 to i32
  %163 = sub i32 %.lcssa, %162
  %164 = mul nsw i32 %163, %.0143194
  %indvars.iv.next224 = add nuw nsw i64 %indvars.iv223, 1
  %exitcond227.not = icmp eq i64 %indvars.iv.next224, %wide.trip.count226
  br i1 %exitcond227.not, label %._crit_edge196, label %.preheader, !llvm.loop !29

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv218 = phi i64 [ %indvars.iv.next219, %scalar.ph ], [ %indvars.iv218.ph, %scalar.ph.preheader ]
  %165 = getelementptr inbounds double, ptr %156, i64 %indvars.iv218
  %166 = load double, ptr %165, align 8, !tbaa !5
  %167 = fmul double %166, %154
  store double %167, ptr %165, align 8, !tbaa !5
  %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
  %exitcond222.not = icmp eq i64 %indvars.iv.next219, %wide.trip.count221
  br i1 %exitcond222.not, label %._crit_edge192, label %scalar.ph, !llvm.loop !30
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN3ads7bspline16basis_eval_arrayclEii(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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 = { 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, !16, i64 24}
!10 = !{!"_ZTSN3ads7bspline5basisE", !11, i64 0, !16, i64 24, !11, i64 32}
!11 = !{!"_ZTSSt6vectorIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = !{!15, !15, i64 0}
!22 = distinct !{!22, !18}
!23 = !{!16, !16, i64 0}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18, !27, !28}
!27 = !{!"llvm.loop.isvectorized", i32 1}
!28 = !{!"llvm.loop.unroll.runtime.disable"}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18, !28, !27}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass