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

; 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.HypersphericalInterpolationStructure = type { i32, double, double, i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ClosedModY(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @hyperspherical_Hermite3_interpolation_vector_dPhi(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca [2 x double], align 16
  %18 = alloca [3 x double], align 16
  %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 ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca ptr, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %44, i32 0, i32 5
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr %46, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !9
  store i32 %50, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store double 0.000000e+00, ptr %14, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store double 0.000000e+00, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #4
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store double 0.000000e+00, ptr %19, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store double 0.000000e+00, ptr %20, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store double 0.000000e+00, ptr %21, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store double 0.000000e+00, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %51, i32 0, i32 9
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  store ptr %53, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %54, i32 0, i32 10
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  store ptr %56, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !17
  store i32 %59, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %60 = load i32, ptr %13, align 4, !tbaa !9
  %61 = sitofp i32 %60 to double
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = sitofp i32 %62 to double
  %64 = fadd double %63, 1.000000e+00
  %65 = fmul double %61, %64
  store double %65, ptr %27, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %66, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !18
  store double %68, ptr %28, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %69 = load double, ptr %28, align 8, !tbaa !14
  %70 = load double, ptr %28, align 8, !tbaa !14
  %71 = fmul double %69, %70
  store double %71, ptr %29, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #4
  store i32 0, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #4
  store i32 1, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #4
  store i32 1, ptr %43, align 4, !tbaa !9
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %72, i32 0, i32 8
  %74 = load ptr, ptr %73, align 8, !tbaa !19
  store ptr %74, ptr %30, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %75, i32 0, i32 2
  %77 = load double, ptr %76, align 8, !tbaa !20
  store double %77, ptr %33, align 8, !tbaa !14
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %78, i32 0, i32 7
  %80 = load i32, ptr %79, align 8, !tbaa !21
  store i32 %80, ptr %38, align 4, !tbaa !9
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %81, i32 0, i32 11
  %83 = load ptr, ptr %82, align 8, !tbaa !22
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = load i32, ptr %38, align 4, !tbaa !9
  %86 = mul nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %83, i64 %87
  store ptr %88, ptr %40, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %89, i32 0, i32 12
  %91 = load ptr, ptr %90, align 8, !tbaa !23
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = load i32, ptr %38, align 4, !tbaa !9
  %94 = mul nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %91, i64 %95
  store ptr %96, ptr %41, align 8, !tbaa !5
  %97 = load ptr, ptr %30, align 8, !tbaa !5
  %98 = getelementptr inbounds double, ptr %97, i64 0
  %99 = load double, ptr %98, align 8, !tbaa !14
  store double %99, ptr %31, align 8, !tbaa !14
  %100 = load ptr, ptr %30, align 8, !tbaa !5
  %101 = load i32, ptr %38, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %100, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !14
  store double %105, ptr %32, align 8, !tbaa !14
  %106 = load double, ptr %32, align 8, !tbaa !14
  store double %106, ptr %34, align 8, !tbaa !14
  %107 = load double, ptr %31, align 8, !tbaa !14
  store double %107, ptr %35, align 8, !tbaa !14
  %108 = load double, ptr %31, align 8, !tbaa !14
  store double %108, ptr %36, align 8, !tbaa !14
  store i32 0, ptr %37, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %317, %6
  %110 = load i32, ptr %37, align 4, !tbaa !9
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %113, label %320

113:                                              ; preds = %109
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = load i32, ptr %37, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %114, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !14
  store double %118, ptr %16, align 8, !tbaa !14
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !17
  %122 = icmp eq i32 %121, 1
  br i1 %122, label %123, label %131

123:                                              ; preds = %113
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.HypersphericalInterpolationStructure, ptr %125, i32 0, i32 1
  %127 = load double, ptr %126, align 8, !tbaa !18
  %128 = fadd double %127, 2.000000e-01
  %129 = fptosi double %128 to i32
  %130 = call i32 @ClosedModY(i32 noundef %124, i32 noundef %129, ptr noundef %16, ptr noundef %42, ptr noundef %43)
  br label %131

131:                                              ; preds = %123, %113
  %132 = load double, ptr %16, align 8, !tbaa !14
  %133 = load double, ptr %31, align 8, !tbaa !14
  %134 = fcmp olt double %132, %133
  br i1 %134, label %139, label %135

135:                                              ; preds = %131
  %136 = load double, ptr %16, align 8, !tbaa !14
  %137 = load double, ptr %32, align 8, !tbaa !14
  %138 = fcmp ogt double %136, %137
  br i1 %138, label %139, label %144

139:                                              ; preds = %135, %131
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = load i32, ptr %37, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds double, ptr %140, i64 %142
  store double 0.000000e+00, ptr %143, align 8, !tbaa !14
  br label %317

144:                                              ; preds = %135
  %145 = load double, ptr %16, align 8, !tbaa !14
  %146 = load double, ptr %35, align 8, !tbaa !14
  %147 = fcmp ogt double %145, %146
  br i1 %147, label %152, label %148

148:                                              ; preds = %144
  %149 = load double, ptr %16, align 8, !tbaa !14
  %150 = load double, ptr %34, align 8, !tbaa !14
  %151 = fcmp olt double %149, %150
  br i1 %151, label %152, label %286

152:                                              ; preds = %148, %144
  %153 = load double, ptr %16, align 8, !tbaa !14
  %154 = load double, ptr %36, align 8, !tbaa !14
  %155 = fcmp ogt double %153, %154
  br i1 %155, label %160, label %156

156:                                              ; preds = %152
  %157 = load double, ptr %16, align 8, !tbaa !14
  %158 = load double, ptr %34, align 8, !tbaa !14
  %159 = fcmp olt double %157, %158
  br i1 %159, label %160, label %192

160:                                              ; preds = %156, %152
  %161 = load double, ptr %16, align 8, !tbaa !14
  %162 = load double, ptr %31, align 8, !tbaa !14
  %163 = fsub double %161, %162
  %164 = load double, ptr %33, align 8, !tbaa !14
  %165 = fdiv double %163, %164
  %166 = fptosi double %165 to i32
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %39, align 4, !tbaa !9
  %168 = load i32, ptr %39, align 4, !tbaa !9
  %169 = icmp slt i32 1, %168
  br i1 %169, label %170, label %172

170:                                              ; preds = %160
  %171 = load i32, ptr %39, align 4, !tbaa !9
  br label %173

172:                                              ; preds = %160
  br label %173

173:                                              ; preds = %172, %170
  %174 = phi i32 [ %171, %170 ], [ 1, %172 ]
  store i32 %174, ptr %39, align 4, !tbaa !9
  %175 = load i32, ptr %38, align 4, !tbaa !9
  %176 = sub nsw i32 %175, 1
  %177 = load i32, ptr %39, align 4, !tbaa !9
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %179, label %182

179:                                              ; preds = %173
  %180 = load i32, ptr %38, align 4, !tbaa !9
  %181 = sub nsw i32 %180, 1
  br label %184

182:                                              ; preds = %173
  %183 = load i32, ptr %39, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %182, %179
  %185 = phi i32 [ %181, %179 ], [ %183, %182 ]
  store i32 %185, ptr %39, align 4, !tbaa !9
  %186 = load ptr, ptr %41, align 8, !tbaa !5
  %187 = load i32, ptr %39, align 4, !tbaa !9
  %188 = sub nsw i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds double, ptr %186, i64 %189
  %191 = load double, ptr %190, align 8, !tbaa !14
  store double %191, ptr %19, align 8, !tbaa !14
  br label %196

192:                                              ; preds = %156
  %193 = load i32, ptr %39, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %39, align 4, !tbaa !9
  %195 = load double, ptr %15, align 8, !tbaa !14
  store double %195, ptr %19, align 8, !tbaa !14
  br label %196

196:                                              ; preds = %192, %184
  %197 = load ptr, ptr %30, align 8, !tbaa !5
  %198 = load i32, ptr %39, align 4, !tbaa !9
  %199 = sub nsw i32 %198, 1
  %200 = icmp slt i32 0, %199
  br i1 %200, label %201, label %204

201:                                              ; preds = %196
  %202 = load i32, ptr %39, align 4, !tbaa !9
  %203 = sub nsw i32 %202, 1
  br label %205

204:                                              ; preds = %196
  br label %205

205:                                              ; preds = %204, %201
  %206 = phi i32 [ %203, %201 ], [ 0, %204 ]
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %197, i64 %207
  %209 = load double, ptr %208, align 8, !tbaa !14
  store double %209, ptr %34, align 8, !tbaa !14
  %210 = load ptr, ptr %30, align 8, !tbaa !5
  %211 = load i32, ptr %39, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds double, ptr %210, i64 %212
  %214 = load double, ptr %213, align 8, !tbaa !14
  store double %214, ptr %35, align 8, !tbaa !14
  %215 = load ptr, ptr %30, align 8, !tbaa !5
  %216 = load i32, ptr %38, align 4, !tbaa !9
  %217 = sub nsw i32 %216, 1
  %218 = load i32, ptr %39, align 4, !tbaa !9
  %219 = add nsw i32 %218, 1
  %220 = icmp slt i32 %217, %219
  br i1 %220, label %221, label %224

221:                                              ; preds = %205
  %222 = load i32, ptr %38, align 4, !tbaa !9
  %223 = sub nsw i32 %222, 1
  br label %227

224:                                              ; preds = %205
  %225 = load i32, ptr %39, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  br label %227

227:                                              ; preds = %224, %221
  %228 = phi i32 [ %223, %221 ], [ %226, %224 ]
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds double, ptr %215, i64 %229
  %231 = load double, ptr %230, align 8, !tbaa !14
  store double %231, ptr %36, align 8, !tbaa !14
  %232 = load ptr, ptr %40, align 8, !tbaa !5
  %233 = load i32, ptr %39, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds double, ptr %232, i64 %234
  %236 = load double, ptr %235, align 8, !tbaa !14
  store double %236, ptr %14, align 8, !tbaa !14
  %237 = load ptr, ptr %41, align 8, !tbaa !5
  %238 = load i32, ptr %39, align 4, !tbaa !9
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds double, ptr %237, i64 %239
  %241 = load double, ptr %240, align 8, !tbaa !14
  store double %241, ptr %15, align 8, !tbaa !14
  %242 = load ptr, ptr %25, align 8, !tbaa !5
  %243 = load i32, ptr %39, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds double, ptr %242, i64 %244
  %246 = load double, ptr %245, align 8, !tbaa !14
  store double %246, ptr %21, align 8, !tbaa !14
  %247 = load ptr, ptr %24, align 8, !tbaa !5
  %248 = load i32, ptr %39, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds double, ptr %247, i64 %249
  %251 = load double, ptr %250, align 8, !tbaa !14
  store double %251, ptr %22, align 8, !tbaa !14
  %252 = load double, ptr %22, align 8, !tbaa !14
  %253 = load double, ptr %22, align 8, !tbaa !14
  %254 = fmul double %252, %253
  store double %254, ptr %23, align 8, !tbaa !14
  %255 = load double, ptr %15, align 8, !tbaa !14
  %256 = fmul double -2.000000e+00, %255
  %257 = load double, ptr %21, align 8, !tbaa !14
  %258 = load double, ptr %14, align 8, !tbaa !14
  %259 = load double, ptr %27, align 8, !tbaa !14
  %260 = load double, ptr %23, align 8, !tbaa !14
  %261 = fdiv double %259, %260
  %262 = load double, ptr %29, align 8, !tbaa !14
  %263 = fsub double %261, %262
  %264 = load i32, ptr %26, align 4, !tbaa !9
  %265 = sitofp i32 %264 to double
  %266 = fadd double %263, %265
  %267 = fmul double %258, %266
  %268 = call double @llvm.fmuladd.f64(double %256, double %257, double %267)
  store double %268, ptr %20, align 8, !tbaa !14
  %269 = load double, ptr %20, align 8, !tbaa !14
  %270 = fneg double %269
  %271 = load double, ptr %33, align 8, !tbaa !14
  %272 = load double, ptr %19, align 8, !tbaa !14
  %273 = fmul double 2.000000e+00, %272
  %274 = fneg double %273
  %275 = call double @llvm.fmuladd.f64(double %270, double %271, double %274)
  %276 = load double, ptr %15, align 8, !tbaa !14
  %277 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %276, double %275)
  %278 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  store double %277, ptr %278, align 16, !tbaa !14
  %279 = load double, ptr %20, align 8, !tbaa !14
  %280 = load double, ptr %33, align 8, !tbaa !14
  %281 = load double, ptr %19, align 8, !tbaa !14
  %282 = call double @llvm.fmuladd.f64(double %279, double %280, double %281)
  %283 = load double, ptr %15, align 8, !tbaa !14
  %284 = fsub double %282, %283
  %285 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  store double %284, ptr %285, align 8, !tbaa !14
  br label %286

286:                                              ; preds = %227, %148
  %287 = load double, ptr %16, align 8, !tbaa !14
  %288 = load double, ptr %34, align 8, !tbaa !14
  %289 = fsub double %287, %288
  %290 = load double, ptr %33, align 8, !tbaa !14
  %291 = fdiv double %289, %290
  %292 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 0
  store double %291, ptr %292, align 16, !tbaa !14
  %293 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 0
  %294 = load double, ptr %293, align 16, !tbaa !14
  %295 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 0
  %296 = load double, ptr %295, align 16, !tbaa !14
  %297 = fmul double %294, %296
  %298 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 1
  store double %297, ptr %298, align 8, !tbaa !14
  %299 = load double, ptr %19, align 8, !tbaa !14
  %300 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %301 = load double, ptr %300, align 16, !tbaa !14
  %302 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 0
  %303 = load double, ptr %302, align 16, !tbaa !14
  %304 = call double @llvm.fmuladd.f64(double %301, double %303, double %299)
  %305 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  %306 = load double, ptr %305, align 8, !tbaa !14
  %307 = getelementptr inbounds [2 x double], ptr %17, i64 0, i64 1
  %308 = load double, ptr %307, align 8, !tbaa !14
  %309 = call double @llvm.fmuladd.f64(double %306, double %308, double %304)
  %310 = load i32, ptr %43, align 4, !tbaa !9
  %311 = sitofp i32 %310 to double
  %312 = fmul double %309, %311
  %313 = load ptr, ptr %11, align 8, !tbaa !5
  %314 = load i32, ptr %37, align 4, !tbaa !9
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds double, ptr %313, i64 %315
  store double %312, ptr %316, align 8, !tbaa !14
  br label %317

317:                                              ; preds = %286, %139
  %318 = load i32, ptr %37, align 4, !tbaa !9
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %37, align 4, !tbaa !9
  br label %109, !llvm.loop !24

320:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #4
  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 4, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  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 4, 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 24, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret i32 0
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"HypersphericalInterpolationStructure", !10, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 28, !6, i64 32, !6, i64 40, !10, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 64}
!16 = !{!12, !6, i64 72}
!17 = !{!12, !10, i64 0}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !6, i64 56}
!20 = !{!12, !13, i64 16}
!21 = !{!12, !10, i64 48}
!22 = !{!12, !6, i64 80}
!23 = !{!12, !6, i64 88}
!24 = distinct !{!24, !25}
!25 = !{!"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 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ClosedModY(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @hyperspherical_Hermite3_interpolation_vector_dPhi(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef readnone %5) local_unnamed_addr #2 {
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = sext i32 %2 to i64
  %13 = getelementptr inbounds i32, ptr %11, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %0, i64 72
  %18 = load ptr, ptr %17, align 8, !tbaa !14
  %19 = load i32, ptr %0, align 8, !tbaa !15
  %20 = sitofp i32 %14 to double
  %21 = fadd double %20, 1.000000e+00
  %22 = fmul double %21, %20
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load double, ptr %23, align 8, !tbaa !16
  %25 = fmul double %24, %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 1, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  store i32 1, ptr %9, align 4, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  %27 = load ptr, ptr %26, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load double, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %0, i64 48
  %31 = load i32, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %0, i64 80
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = mul nsw i32 %31, %2
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds double, ptr %33, i64 %35
  %37 = getelementptr inbounds i8, ptr %0, i64 88
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds double, ptr %38, i64 %35
  %40 = load double, ptr %27, align 8, !tbaa !22
  %41 = add nsw i32 %31, -1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds double, ptr %27, i64 %42
  %44 = load double, ptr %43, align 8, !tbaa !22
  %invariant.gep = getelementptr i8, ptr %39, i64 -8
  %invariant.gep118 = getelementptr i8, ptr %27, i64 -8
  %45 = icmp sgt i32 %1, 0
  br i1 %45, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %46 = sitofp i32 %19 to double
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %47

47:                                               ; preds = %.lr.ph, %118
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %118 ]
  %.0128 = phi double [ 0.000000e+00, %.lr.ph ], [ %.2, %118 ]
  %.096127 = phi i32 [ 0, %.lr.ph ], [ %.3, %118 ]
  %.0100125 = phi double [ %40, %.lr.ph ], [ %.2102, %118 ]
  %.0103124 = phi double [ %40, %.lr.ph ], [ %.2105, %118 ]
  %.0106123 = phi double [ %44, %.lr.ph ], [ %.2108, %118 ]
  %.sroa.0.0122 = phi double [ 0.000000e+00, %.lr.ph ], [ %.sroa.0.2, %118 ]
  %.sroa.5.0121 = phi double [ 0.000000e+00, %.lr.ph ], [ %.sroa.5.2, %118 ]
  %.0109120 = phi double [ 0.000000e+00, %.lr.ph ], [ %.3112, %118 ]
  %48 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %49 = load double, ptr %48, align 8, !tbaa !22
  store double %49, ptr %7, align 8, !tbaa !22
  %50 = load i32, ptr %0, align 8, !tbaa !15
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %52, label %57

52:                                               ; preds = %47
  %53 = load double, ptr %23, align 8, !tbaa !16
  %54 = fadd double %53, 2.000000e-01
  %55 = fptosi double %54 to i32
  %56 = call i32 @ClosedModY(i32 noundef %14, i32 noundef %55, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %.pre = load double, ptr %7, align 8, !tbaa !22
  br label %57

57:                                               ; preds = %52, %47
  %58 = phi double [ %.pre, %52 ], [ %49, %47 ]
  %59 = fcmp olt double %58, %40
  %60 = fcmp ogt double %58, %44
  %or.cond = select i1 %59, i1 true, i1 %60
  br i1 %or.cond, label %118, label %61

61:                                               ; preds = %57
  %62 = fcmp ogt double %58, %.0103124
  %63 = fcmp olt double %58, %.0106123
  %or.cond116 = select i1 %62, i1 true, i1 %63
  br i1 %or.cond116, label %64, label %109

64:                                               ; preds = %61
  %65 = fcmp ogt double %58, %.0100125
  %or.cond117 = select i1 %65, i1 true, i1 %63
  br i1 %or.cond117, label %66, label %75

66:                                               ; preds = %64
  %67 = fsub double %58, %40
  %68 = fdiv double %67, %29
  %69 = fptosi double %68 to i32
  %70 = call i32 @llvm.smax.i32(i32 %69, i32 0)
  %71 = add nuw nsw i32 %70, 1
  %72 = call i32 @llvm.smin.i32(i32 %41, i32 %71)
  %73 = sext i32 %72 to i64
  %gep = getelementptr double, ptr %invariant.gep, i64 %73
  %74 = load double, ptr %gep, align 8, !tbaa !22
  br label %77

75:                                               ; preds = %64
  %76 = add nsw i32 %.096127, 1
  %.pre130 = sext i32 %76 to i64
  br label %77

77:                                               ; preds = %75, %66
  %.pre-phi = phi i64 [ %.pre130, %75 ], [ %73, %66 ]
  %.1110 = phi double [ %.0128, %75 ], [ %74, %66 ]
  %.197 = phi i32 [ %76, %75 ], [ %72, %66 ]
  %78 = call i32 @llvm.smax.i32(i32 %.197, i32 1)
  %79 = zext nneg i32 %78 to i64
  %gep119 = getelementptr double, ptr %invariant.gep118, i64 %79
  %80 = load double, ptr %gep119, align 8, !tbaa !22
  %81 = getelementptr inbounds double, ptr %27, i64 %.pre-phi
  %82 = load double, ptr %81, align 8, !tbaa !22
  %83 = add nsw i32 %.197, 1
  %84 = call i32 @llvm.smin.i32(i32 %41, i32 %83)
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %27, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !22
  %88 = getelementptr inbounds double, ptr %36, i64 %.pre-phi
  %89 = load double, ptr %88, align 8, !tbaa !22
  %90 = getelementptr inbounds double, ptr %39, i64 %.pre-phi
  %91 = load double, ptr %90, align 8, !tbaa !22
  %92 = getelementptr inbounds double, ptr %18, i64 %.pre-phi
  %93 = load double, ptr %92, align 8, !tbaa !22
  %94 = getelementptr inbounds double, ptr %16, i64 %.pre-phi
  %95 = load double, ptr %94, align 8, !tbaa !22
  %96 = fmul double %95, %95
  %97 = fmul double %91, -2.000000e+00
  %98 = fdiv double %22, %96
  %99 = fsub double %98, %25
  %100 = fadd double %99, %46
  %101 = fmul double %89, %100
  %102 = call double @llvm.fmuladd.f64(double %97, double %93, double %101)
  %103 = fneg double %102
  %104 = fmul double %.1110, -2.000000e+00
  %105 = call double @llvm.fmuladd.f64(double %103, double %29, double %104)
  %106 = call double @llvm.fmuladd.f64(double %91, double 2.000000e+00, double %105)
  %107 = call double @llvm.fmuladd.f64(double %102, double %29, double %.1110)
  %108 = fsub double %107, %91
  br label %109

109:                                              ; preds = %61, %77
  %.2111 = phi double [ %.1110, %77 ], [ %.0109120, %61 ]
  %.sroa.5.1 = phi double [ %108, %77 ], [ %.sroa.5.0121, %61 ]
  %.sroa.0.1 = phi double [ %106, %77 ], [ %.sroa.0.0122, %61 ]
  %.1107 = phi double [ %80, %77 ], [ %.0106123, %61 ]
  %.1104 = phi double [ %82, %77 ], [ %.0103124, %61 ]
  %.1101 = phi double [ %87, %77 ], [ %.0100125, %61 ]
  %.298 = phi i32 [ %.197, %77 ], [ %.096127, %61 ]
  %.1 = phi double [ %91, %77 ], [ %.0128, %61 ]
  %110 = fsub double %58, %.1107
  %111 = fdiv double %110, %29
  %112 = fmul double %111, %111
  %113 = call double @llvm.fmuladd.f64(double %.sroa.0.1, double %111, double %.2111)
  %114 = call double @llvm.fmuladd.f64(double %.sroa.5.1, double %112, double %113)
  %115 = load i32, ptr %9, align 4, !tbaa !12
  %116 = sitofp i32 %115 to double
  %117 = fmul double %114, %116
  br label %118

118:                                              ; preds = %57, %109
  %.sink = phi double [ %117, %109 ], [ 0.000000e+00, %57 ]
  %.3112 = phi double [ %.2111, %109 ], [ %.0109120, %57 ]
  %.sroa.5.2 = phi double [ %.sroa.5.1, %109 ], [ %.sroa.5.0121, %57 ]
  %.sroa.0.2 = phi double [ %.sroa.0.1, %109 ], [ %.sroa.0.0122, %57 ]
  %.2108 = phi double [ %.1107, %109 ], [ %.0106123, %57 ]
  %.2105 = phi double [ %.1104, %109 ], [ %.0103124, %57 ]
  %.2102 = phi double [ %.1101, %109 ], [ %.0100125, %57 ]
  %.3 = phi i32 [ %.298, %109 ], [ %.096127, %57 ]
  %.2 = phi double [ %.1, %109 ], [ %.0128, %57 ]
  %119 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  store double %.sink, ptr %119, align 8, !tbaa !22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %47, !llvm.loop !23

._crit_edge:                                      ; preds = %118, %6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  ret i32 0
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 32}
!6 = !{!"HypersphericalInterpolationStructure", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !11, i64 32, !11, i64 40, !7, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !11, i64 64}
!14 = !{!6, !11, i64 72}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !10, i64 8}
!17 = !{!6, !11, i64 56}
!18 = !{!6, !10, i64 16}
!19 = !{!6, !7, i64 48}
!20 = !{!6, !11, i64 80}
!21 = !{!6, !11, i64 88}
!22 = !{!10, !10, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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