; LLVM IR from microsoft/LightAIMD :: src (basis_func)

; 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.vec3d = type { double, double, double }
%struct.basis_func = type { i64, i64, i64, i64, ptr, ptr, ptr, double, double, double, double }

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #0

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

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

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

; Function Attrs: nounwind
declare double @exp(double noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @basis_funcs_second_derivative(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #3 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %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 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 double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca i64, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca double, align 8
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca double, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.vec3d, ptr %42, i32 0, i32 0
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.basis_func, ptr %45, i32 0, i32 8
  %47 = load double, ptr %46, align 8, !tbaa !12
  %48 = fsub double %44, %47
  %49 = fadd double %48, 1.000000e-100
  store double %49, ptr %17, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.vec3d, ptr %50, i32 0, i32 1
  %52 = load double, ptr %51, align 8, !tbaa !16
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.basis_func, ptr %53, i32 0, i32 9
  %55 = load double, ptr %54, align 8, !tbaa !17
  %56 = fsub double %52, %55
  %57 = fadd double %56, 1.000000e-100
  store double %57, ptr %18, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.vec3d, ptr %58, i32 0, i32 2
  %60 = load double, ptr %59, align 8, !tbaa !18
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.basis_func, ptr %61, i32 0, i32 10
  %63 = load double, ptr %62, align 8, !tbaa !19
  %64 = fsub double %60, %63
  %65 = fadd double %64, 1.000000e-100
  store double %65, ptr %19, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %66 = load double, ptr %17, align 8, !tbaa !15
  %67 = load double, ptr %17, align 8, !tbaa !15
  %68 = load double, ptr %18, align 8, !tbaa !15
  %69 = load double, ptr %18, align 8, !tbaa !15
  %70 = fmul double %68, %69
  %71 = call double @llvm.fmuladd.f64(double %66, double %67, double %70)
  %72 = load double, ptr %19, align 8, !tbaa !15
  %73 = load double, ptr %19, align 8, !tbaa !15
  %74 = call double @llvm.fmuladd.f64(double %72, double %73, double %71)
  store double %74, ptr %20, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %75 = load double, ptr %17, align 8, !tbaa !15
  %76 = load double, ptr %17, align 8, !tbaa !15
  %77 = fmul double %75, %76
  store double %77, ptr %21, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %78 = load double, ptr %18, align 8, !tbaa !15
  %79 = load double, ptr %18, align 8, !tbaa !15
  %80 = fmul double %78, %79
  store double %80, ptr %22, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %81 = load double, ptr %19, align 8, !tbaa !15
  %82 = load double, ptr %19, align 8, !tbaa !15
  %83 = fmul double %81, %82
  store double %83, ptr %23, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %84 = load double, ptr %17, align 8, !tbaa !15
  %85 = load double, ptr %18, align 8, !tbaa !15
  %86 = fmul double %84, %85
  store double %86, ptr %24, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %87 = load double, ptr %17, align 8, !tbaa !15
  %88 = load double, ptr %19, align 8, !tbaa !15
  %89 = fmul double %87, %88
  store double %89, ptr %25, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %90 = load double, ptr %18, align 8, !tbaa !15
  %91 = load double, ptr %19, align 8, !tbaa !15
  %92 = fmul double %90, %91
  store double %92, ptr %26, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  store double 0.000000e+00, ptr %27, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  store double 0.000000e+00, ptr %28, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  store double 0.000000e+00, ptr %29, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  store double 0.000000e+00, ptr %30, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  store double 0.000000e+00, ptr %31, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  store double 0.000000e+00, ptr %32, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  store i64 0, ptr %33, align 8, !tbaa !20
  br label %93

93:                                               ; preds = %327, %8
  %94 = load i64, ptr %33, align 8, !tbaa !20
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.basis_func, ptr %95, i32 0, i32 3
  %97 = load i64, ptr %96, align 8, !tbaa !21
  %98 = icmp ult i64 %94, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  br label %330

100:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.basis_func, ptr %101, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = load i64, ptr %33, align 8, !tbaa !20
  %105 = getelementptr inbounds double, ptr %103, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !15
  store double %106, ptr %34, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.basis_func, ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !23
  %110 = load i64, ptr %33, align 8, !tbaa !20
  %111 = getelementptr inbounds double, ptr %109, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !15
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.basis_func, ptr %113, i32 0, i32 6
  %115 = load ptr, ptr %114, align 8, !tbaa !24
  %116 = load i64, ptr %33, align 8, !tbaa !20
  %117 = getelementptr inbounds double, ptr %115, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !15
  %119 = fmul double %112, %118
  %120 = load double, ptr %17, align 8, !tbaa !15
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.basis_func, ptr %121, i32 0, i32 0
  %123 = load i64, ptr %122, align 8, !tbaa !25
  %124 = uitofp i64 %123 to double
  %125 = call double @pow(double noundef %120, double noundef %124) #4
  %126 = fmul double %119, %125
  %127 = load double, ptr %18, align 8, !tbaa !15
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.basis_func, ptr %128, i32 0, i32 1
  %130 = load i64, ptr %129, align 8, !tbaa !26
  %131 = uitofp i64 %130 to double
  %132 = call double @pow(double noundef %127, double noundef %131) #4
  %133 = fmul double %126, %132
  %134 = load double, ptr %19, align 8, !tbaa !15
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.basis_func, ptr %135, i32 0, i32 2
  %137 = load i64, ptr %136, align 8, !tbaa !27
  %138 = uitofp i64 %137 to double
  %139 = call double @pow(double noundef %134, double noundef %138) #4
  %140 = fmul double %133, %139
  %141 = load double, ptr %34, align 8, !tbaa !15
  %142 = load double, ptr %20, align 8, !tbaa !15
  %143 = fmul double %141, %142
  %144 = fneg double %143
  %145 = call double @exp(double noundef %144) #4
  %146 = fmul double %140, %145
  store double %146, ptr %35, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #4
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.basis_func, ptr %147, i32 0, i32 0
  %149 = load i64, ptr %148, align 8, !tbaa !25
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.basis_func, ptr %150, i32 0, i32 0
  %152 = load i64, ptr %151, align 8, !tbaa !25
  %153 = mul i64 %149, %152
  %154 = uitofp i64 %153 to double
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.basis_func, ptr %155, i32 0, i32 0
  %157 = load i64, ptr %156, align 8, !tbaa !25
  %158 = uitofp i64 %157 to double
  %159 = load double, ptr %34, align 8, !tbaa !15
  %160 = fmul double 4.000000e+00, %159
  %161 = load double, ptr %21, align 8, !tbaa !15
  %162 = call double @llvm.fmuladd.f64(double %160, double %161, double 1.000000e+00)
  %163 = fneg double %158
  %164 = call double @llvm.fmuladd.f64(double %163, double %162, double %154)
  %165 = load double, ptr %34, align 8, !tbaa !15
  %166 = fmul double 2.000000e+00, %165
  %167 = load double, ptr %34, align 8, !tbaa !15
  %168 = fmul double 2.000000e+00, %167
  %169 = load double, ptr %21, align 8, !tbaa !15
  %170 = call double @llvm.fmuladd.f64(double %168, double %169, double -1.000000e+00)
  %171 = fmul double %166, %170
  %172 = load double, ptr %21, align 8, !tbaa !15
  %173 = call double @llvm.fmuladd.f64(double %171, double %172, double %164)
  store double %173, ptr %36, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #4
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.basis_func, ptr %174, i32 0, i32 1
  %176 = load i64, ptr %175, align 8, !tbaa !26
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.basis_func, ptr %177, i32 0, i32 1
  %179 = load i64, ptr %178, align 8, !tbaa !26
  %180 = mul i64 %176, %179
  %181 = uitofp i64 %180 to double
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.basis_func, ptr %182, i32 0, i32 1
  %184 = load i64, ptr %183, align 8, !tbaa !26
  %185 = uitofp i64 %184 to double
  %186 = load double, ptr %34, align 8, !tbaa !15
  %187 = fmul double 4.000000e+00, %186
  %188 = load double, ptr %22, align 8, !tbaa !15
  %189 = call double @llvm.fmuladd.f64(double %187, double %188, double 1.000000e+00)
  %190 = fneg double %185
  %191 = call double @llvm.fmuladd.f64(double %190, double %189, double %181)
  %192 = load double, ptr %34, align 8, !tbaa !15
  %193 = fmul double 2.000000e+00, %192
  %194 = load double, ptr %34, align 8, !tbaa !15
  %195 = fmul double 2.000000e+00, %194
  %196 = load double, ptr %22, align 8, !tbaa !15
  %197 = call double @llvm.fmuladd.f64(double %195, double %196, double -1.000000e+00)
  %198 = fmul double %193, %197
  %199 = load double, ptr %22, align 8, !tbaa !15
  %200 = call double @llvm.fmuladd.f64(double %198, double %199, double %191)
  store double %200, ptr %37, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #4
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.basis_func, ptr %201, i32 0, i32 2
  %203 = load i64, ptr %202, align 8, !tbaa !27
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.basis_func, ptr %204, i32 0, i32 2
  %206 = load i64, ptr %205, align 8, !tbaa !27
  %207 = mul i64 %203, %206
  %208 = uitofp i64 %207 to double
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.basis_func, ptr %209, i32 0, i32 2
  %211 = load i64, ptr %210, align 8, !tbaa !27
  %212 = uitofp i64 %211 to double
  %213 = load double, ptr %34, align 8, !tbaa !15
  %214 = fmul double 4.000000e+00, %213
  %215 = load double, ptr %23, align 8, !tbaa !15
  %216 = call double @llvm.fmuladd.f64(double %214, double %215, double 1.000000e+00)
  %217 = fneg double %212
  %218 = call double @llvm.fmuladd.f64(double %217, double %216, double %208)
  %219 = load double, ptr %34, align 8, !tbaa !15
  %220 = fmul double 2.000000e+00, %219
  %221 = load double, ptr %34, align 8, !tbaa !15
  %222 = fmul double 2.000000e+00, %221
  %223 = load double, ptr %23, align 8, !tbaa !15
  %224 = call double @llvm.fmuladd.f64(double %222, double %223, double -1.000000e+00)
  %225 = fmul double %220, %224
  %226 = load double, ptr %23, align 8, !tbaa !15
  %227 = call double @llvm.fmuladd.f64(double %225, double %226, double %218)
  store double %227, ptr %38, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #4
  %228 = load double, ptr %34, align 8, !tbaa !15
  %229 = fmul double 2.000000e+00, %228
  %230 = load double, ptr %21, align 8, !tbaa !15
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.basis_func, ptr %231, i32 0, i32 0
  %233 = load i64, ptr %232, align 8, !tbaa !25
  %234 = uitofp i64 %233 to double
  %235 = fneg double %234
  %236 = call double @llvm.fmuladd.f64(double %229, double %230, double %235)
  %237 = load double, ptr %34, align 8, !tbaa !15
  %238 = fmul double 2.000000e+00, %237
  %239 = load double, ptr %22, align 8, !tbaa !15
  %240 = load ptr, ptr %9, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.basis_func, ptr %240, i32 0, i32 1
  %242 = load i64, ptr %241, align 8, !tbaa !26
  %243 = uitofp i64 %242 to double
  %244 = fneg double %243
  %245 = call double @llvm.fmuladd.f64(double %238, double %239, double %244)
  %246 = fmul double %236, %245
  store double %246, ptr %39, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #4
  %247 = load double, ptr %34, align 8, !tbaa !15
  %248 = fmul double 2.000000e+00, %247
  %249 = load double, ptr %21, align 8, !tbaa !15
  %250 = load ptr, ptr %9, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.basis_func, ptr %250, i32 0, i32 0
  %252 = load i64, ptr %251, align 8, !tbaa !25
  %253 = uitofp i64 %252 to double
  %254 = fneg double %253
  %255 = call double @llvm.fmuladd.f64(double %248, double %249, double %254)
  %256 = load double, ptr %34, align 8, !tbaa !15
  %257 = fmul double 2.000000e+00, %256
  %258 = load double, ptr %23, align 8, !tbaa !15
  %259 = load ptr, ptr %9, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.basis_func, ptr %259, i32 0, i32 2
  %261 = load i64, ptr %260, align 8, !tbaa !27
  %262 = uitofp i64 %261 to double
  %263 = fneg double %262
  %264 = call double @llvm.fmuladd.f64(double %257, double %258, double %263)
  %265 = fmul double %255, %264
  store double %265, ptr %40, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #4
  %266 = load double, ptr %34, align 8, !tbaa !15
  %267 = fmul double 2.000000e+00, %266
  %268 = load double, ptr %22, align 8, !tbaa !15
  %269 = load ptr, ptr %9, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.basis_func, ptr %269, i32 0, i32 1
  %271 = load i64, ptr %270, align 8, !tbaa !26
  %272 = uitofp i64 %271 to double
  %273 = fneg double %272
  %274 = call double @llvm.fmuladd.f64(double %267, double %268, double %273)
  %275 = load double, ptr %34, align 8, !tbaa !15
  %276 = fmul double 2.000000e+00, %275
  %277 = load double, ptr %23, align 8, !tbaa !15
  %278 = load ptr, ptr %9, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.basis_func, ptr %278, i32 0, i32 2
  %280 = load i64, ptr %279, align 8, !tbaa !27
  %281 = uitofp i64 %280 to double
  %282 = fneg double %281
  %283 = call double @llvm.fmuladd.f64(double %276, double %277, double %282)
  %284 = fmul double %274, %283
  store double %284, ptr %41, align 8, !tbaa !15
  %285 = load double, ptr %36, align 8, !tbaa !15
  %286 = load double, ptr %35, align 8, !tbaa !15
  %287 = fmul double %285, %286
  %288 = load double, ptr %21, align 8, !tbaa !15
  %289 = fdiv double %287, %288
  %290 = load double, ptr %27, align 8, !tbaa !15
  %291 = fadd double %290, %289
  store double %291, ptr %27, align 8, !tbaa !15
  %292 = load double, ptr %37, align 8, !tbaa !15
  %293 = load double, ptr %35, align 8, !tbaa !15
  %294 = fmul double %292, %293
  %295 = load double, ptr %22, align 8, !tbaa !15
  %296 = fdiv double %294, %295
  %297 = load double, ptr %28, align 8, !tbaa !15
  %298 = fadd double %297, %296
  store double %298, ptr %28, align 8, !tbaa !15
  %299 = load double, ptr %38, align 8, !tbaa !15
  %300 = load double, ptr %35, align 8, !tbaa !15
  %301 = fmul double %299, %300
  %302 = load double, ptr %23, align 8, !tbaa !15
  %303 = fdiv double %301, %302
  %304 = load double, ptr %29, align 8, !tbaa !15
  %305 = fadd double %304, %303
  store double %305, ptr %29, align 8, !tbaa !15
  %306 = load double, ptr %39, align 8, !tbaa !15
  %307 = load double, ptr %35, align 8, !tbaa !15
  %308 = fmul double %306, %307
  %309 = load double, ptr %24, align 8, !tbaa !15
  %310 = fdiv double %308, %309
  %311 = load double, ptr %30, align 8, !tbaa !15
  %312 = fadd double %311, %310
  store double %312, ptr %30, align 8, !tbaa !15
  %313 = load double, ptr %40, align 8, !tbaa !15
  %314 = load double, ptr %35, align 8, !tbaa !15
  %315 = fmul double %313, %314
  %316 = load double, ptr %25, align 8, !tbaa !15
  %317 = fdiv double %315, %316
  %318 = load double, ptr %31, align 8, !tbaa !15
  %319 = fadd double %318, %317
  store double %319, ptr %31, align 8, !tbaa !15
  %320 = load double, ptr %41, align 8, !tbaa !15
  %321 = load double, ptr %35, align 8, !tbaa !15
  %322 = fmul double %320, %321
  %323 = load double, ptr %26, align 8, !tbaa !15
  %324 = fdiv double %322, %323
  %325 = load double, ptr %32, align 8, !tbaa !15
  %326 = fadd double %325, %324
  store double %326, ptr %32, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  br label %327

327:                                              ; preds = %100
  %328 = load i64, ptr %33, align 8, !tbaa !20
  %329 = add i64 %328, 1
  store i64 %329, ptr %33, align 8, !tbaa !20
  br label %93, !llvm.loop !28

330:                                              ; preds = %99
  %331 = load double, ptr %27, align 8, !tbaa !15
  %332 = load ptr, ptr %11, align 8, !tbaa !5
  store double %331, ptr %332, align 8, !tbaa !15
  %333 = load double, ptr %28, align 8, !tbaa !15
  %334 = load ptr, ptr %12, align 8, !tbaa !5
  store double %333, ptr %334, align 8, !tbaa !15
  %335 = load double, ptr %29, align 8, !tbaa !15
  %336 = load ptr, ptr %13, align 8, !tbaa !5
  store double %335, ptr %336, align 8, !tbaa !15
  %337 = load double, ptr %30, align 8, !tbaa !15
  %338 = load ptr, ptr %14, align 8, !tbaa !5
  store double %337, ptr %338, align 8, !tbaa !15
  %339 = load double, ptr %31, align 8, !tbaa !15
  %340 = load ptr, ptr %15, align 8, !tbaa !5
  store double %339, ptr %340, align 8, !tbaa !15
  %341 = load double, ptr %32, align 8, !tbaa !15
  %342 = load ptr, ptr %16, align 8, !tbaa !5
  store double %341, ptr %342, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #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 @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  ret void
}

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }

!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, !11, i64 0}
!10 = !{!"vec3d", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!13, !11, i64 64}
!13 = !{!"basis_func", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80}
!14 = !{!"long", !7, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!13, !11, i64 72}
!18 = !{!10, !11, i64 16}
!19 = !{!13, !11, i64 80}
!20 = !{!14, !14, i64 0}
!21 = !{!13, !14, i64 24}
!22 = !{!13, !6, i64 32}
!23 = !{!13, !6, i64 40}
!24 = !{!13, !6, i64 48}
!25 = !{!13, !14, i64 0}
!26 = !{!13, !14, i64 8}
!27 = !{!13, !14, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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 nofree nounwind willreturn memory(write)
declare double @pow(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) #1

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

; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @basis_funcs_second_derivative(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6, ptr nocapture noundef writeonly %7) local_unnamed_addr #2 {
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 80
  %13 = load double, ptr %12, align 8, !tbaa !10
  %14 = fsub double %11, %13
  %15 = fadd double %14, 1.000000e-100
  %16 = load <2 x double>, ptr %1, align 8, !tbaa !14
  %17 = load <2 x double>, ptr %9, align 8, !tbaa !14
  %18 = fsub <2 x double> %16, %17
  %19 = fadd <2 x double> %18, <double 1.000000e-100, double 1.000000e-100>
  %20 = fmul <2 x double> %19, %19
  %21 = extractelement <2 x double> %20, i64 1
  %22 = extractelement <2 x double> %19, i64 0
  %23 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %21)
  %24 = tail call double @llvm.fmuladd.f64(double %15, double %15, double %23)
  %25 = shufflevector <2 x double> %19, <2 x double> poison, <4 x i32> <i32 1, i32 poison, i32 0, i32 poison>
  %26 = insertelement <4 x double> %25, double %15, i64 1
  %27 = shufflevector <4 x double> %26, <4 x double> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 1>
  %28 = shufflevector <4 x double> %26, <4 x double> poison, <4 x i32> <i32 1, i32 2, i32 0, i32 1>
  %29 = fmul <4 x double> %27, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = load i64, ptr %30, align 8, !tbaa !15
  %.not = icmp eq i64 %31, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8
  %32 = getelementptr inbounds i8, ptr %0, i64 32
  %33 = getelementptr inbounds i8, ptr %0, i64 40
  %34 = getelementptr inbounds i8, ptr %0, i64 48
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %.pre = load i64, ptr %0, align 8, !tbaa !16
  %37 = extractelement <4 x double> %29, i64 3
  %38 = extractelement <2 x double> %19, i64 1
  %39 = shufflevector <2 x double> %20, <2 x double> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
  %40 = shufflevector <4 x double> %29, <4 x double> %39, <2 x i32> <i32 3, i32 4>
  br label %48

._crit_edge.loopexit:                             ; preds = %48
  %41 = extractelement <2 x double> %117, i64 1
  %42 = extractelement <2 x double> %117, i64 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %8
  %.0121.lcssa = phi double [ 0.000000e+00, %8 ], [ %41, %._crit_edge.loopexit ]
  %.0.lcssa = phi double [ 0.000000e+00, %8 ], [ %42, %._crit_edge.loopexit ]
  %43 = phi <4 x double> [ zeroinitializer, %8 ], [ %125, %._crit_edge.loopexit ]
  store double %.0.lcssa, ptr %2, align 8, !tbaa !14
  store double %.0121.lcssa, ptr %3, align 8, !tbaa !14
  %44 = extractelement <4 x double> %43, i64 3
  store double %44, ptr %4, align 8, !tbaa !14
  %45 = extractelement <4 x double> %43, i64 2
  store double %45, ptr %5, align 8, !tbaa !14
  %46 = extractelement <4 x double> %43, i64 1
  store double %46, ptr %6, align 8, !tbaa !14
  %47 = extractelement <4 x double> %43, i64 0
  store double %47, ptr %7, align 8, !tbaa !14
  ret void

48:                                               ; preds = %.lr.ph, %48
  %49 = phi i64 [ %.pre, %.lr.ph ], [ %129, %48 ]
  %.0126127 = phi i64 [ 0, %.lr.ph ], [ %126, %48 ]
  %50 = phi <4 x double> [ zeroinitializer, %.lr.ph ], [ %125, %48 ]
  %51 = phi <2 x double> [ zeroinitializer, %.lr.ph ], [ %117, %48 ]
  %52 = load ptr, ptr %32, align 8, !tbaa !17
  %53 = getelementptr inbounds double, ptr %52, i64 %.0126127
  %54 = load double, ptr %53, align 8, !tbaa !14
  %55 = load ptr, ptr %33, align 8, !tbaa !18
  %56 = getelementptr inbounds double, ptr %55, i64 %.0126127
  %57 = load double, ptr %56, align 8, !tbaa !14
  %58 = load ptr, ptr %34, align 8, !tbaa !19
  %59 = getelementptr inbounds double, ptr %58, i64 %.0126127
  %60 = load double, ptr %59, align 8, !tbaa !14
  %61 = fmul double %57, %60
  %62 = uitofp i64 %49 to double
  %63 = tail call double @pow(double noundef %22, double noundef %62) #4
  %64 = fmul double %61, %63
  %65 = load i64, ptr %35, align 8, !tbaa !20
  %66 = uitofp i64 %65 to double
  %67 = tail call double @pow(double noundef %38, double noundef %66) #4
  %68 = fmul double %64, %67
  %69 = load i64, ptr %36, align 8, !tbaa !21
  %70 = uitofp i64 %69 to double
  %71 = tail call double @pow(double noundef %15, double noundef %70) #4
  %72 = fmul double %68, %71
  %73 = fneg double %54
  %74 = fmul double %24, %73
  %75 = tail call double @exp(double noundef %74) #4
  %76 = fmul double %72, %75
  %77 = fmul double %54, 4.000000e+00
  %78 = fmul double %54, 2.000000e+00
  %79 = load i64, ptr %36, align 8, !tbaa !21
  %80 = mul i64 %79, %79
  %81 = uitofp i64 %80 to double
  %82 = uitofp i64 %79 to double
  %83 = tail call double @llvm.fmuladd.f64(double %77, double %37, double 1.000000e+00)
  %84 = fneg double %82
  %85 = tail call double @llvm.fmuladd.f64(double %84, double %83, double %81)
  %86 = tail call double @llvm.fmuladd.f64(double %78, double %37, double -1.000000e+00)
  %87 = fmul double %78, %86
  %88 = tail call double @llvm.fmuladd.f64(double %87, double %37, double %85)
  %89 = load <2 x i64>, ptr %0, align 8, !tbaa !22
  %90 = mul <2 x i64> %89, %89
  %91 = uitofp <2 x i64> %90 to <2 x double>
  %92 = uitofp <2 x i64> %89 to <2 x double>
  %93 = insertelement <2 x double> poison, double %77, i64 0
  %94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
  %95 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %94, <2 x double> %20, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
  %96 = fneg <2 x double> %92
  %97 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %96, <2 x double> %95, <2 x double> %91)
  %98 = insertelement <2 x double> poison, double %78, i64 0
  %99 = shufflevector <2 x double> %98, <2 x double> poison, <2 x i32> zeroinitializer
  %100 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %99, <2 x double> %20, <2 x double> <double -1.000000e+00, double -1.000000e+00>)
  %101 = fmul <2 x double> %99, %100
  %102 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %101, <2 x double> %20, <2 x double> %97)
  %103 = extractelement <2 x double> %96, i64 1
  %104 = tail call double @llvm.fmuladd.f64(double %78, double %21, double %103)
  %105 = shufflevector <2 x double> %96, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
  %106 = insertelement <2 x double> %105, double %84, i64 0
  %107 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %99, <2 x double> %40, <2 x double> %106)
  %108 = extractelement <2 x double> %107, i64 1
  %109 = fmul double %108, %104
  %110 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
  %111 = insertelement <2 x double> %110, double %104, i64 0
  %112 = fmul <2 x double> %107, %111
  %113 = insertelement <2 x double> poison, double %76, i64 0
  %114 = shufflevector <2 x double> %113, <2 x double> poison, <2 x i32> zeroinitializer
  %115 = fmul <2 x double> %114, %102
  %116 = fdiv <2 x double> %115, %20
  %117 = fadd <2 x double> %51, %116
  %118 = insertelement <4 x double> poison, double %76, i64 0
  %119 = shufflevector <4 x double> %118, <4 x double> poison, <4 x i32> zeroinitializer
  %120 = shufflevector <2 x double> %112, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %121 = insertelement <4 x double> %120, double %109, i64 2
  %122 = insertelement <4 x double> %121, double %88, i64 3
  %123 = fmul <4 x double> %119, %122
  %124 = fdiv <4 x double> %123, %29
  %125 = fadd <4 x double> %50, %124
  %126 = add nuw i64 %.0126127, 1
  %127 = load i64, ptr %30, align 8, !tbaa !15
  %128 = icmp ult i64 %126, %127
  %129 = extractelement <2 x i64> %89, i64 0
  br i1 %128, label %48, label %._crit_edge.loopexit, !llvm.loop !23
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nofree nounwind memory(readwrite, inaccessiblemem: write) 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, !7, i64 16}
!6 = !{!"vec3d", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 80}
!11 = !{!"basis_func", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80}
!12 = !{!"long", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!11, !12, i64 24}
!16 = !{!11, !12, i64 0}
!17 = !{!11, !13, i64 32}
!18 = !{!11, !13, i64 40}
!19 = !{!11, !13, i64 48}
!20 = !{!11, !12, i64 8}
!21 = !{!11, !12, i64 16}
!22 = !{!12, !12, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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