; LLVM IR from Discngine/fpocket :: src (energy)

; 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.s_mm_atom_type_a = type { [2 x i8], float, float }
%struct.s_grid = type { ptr, ptr, i32, i32, i32, float }
%struct.s_atm = type { i32, float, float, float, float, float, float, float, [5 x i8], [7 x i8], [16 x i8], [16 x i8], [3 x i8], [8 x i8], i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, i8, i8, float, float, float, float, i16, ptr, i32 }

@mm_atom_type_ST = external hidden constant [35 x %struct.s_mm_atom_type_a], align 16
@stderr = external global ptr, align 8
@.str.18 = external hidden unnamed_addr constant [79 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @set_energies_to_grid_point(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) #3 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i16, align 2
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca double, align 8
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store float 0.000000e+00, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store float 0.000000e+00, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store float 0.000000e+00, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %33 = load ptr, ptr %13, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.s_grid, ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds float, ptr %35, i64 0
  %37 = load float, ptr %36, align 4, !tbaa !11
  %38 = load ptr, ptr %13, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.s_grid, ptr %38, i32 0, i32 5
  %40 = load float, ptr %39, align 4, !tbaa !15
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = sitofp i32 %41 to float
  %43 = call float @llvm.fmuladd.f32(float %40, float %42, float %37)
  store float %43, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %44 = load ptr, ptr %13, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.s_grid, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = getelementptr inbounds float, ptr %46, i64 1
  %48 = load float, ptr %47, align 4, !tbaa !11
  %49 = load ptr, ptr %13, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.s_grid, ptr %49, i32 0, i32 5
  %51 = load float, ptr %50, align 4, !tbaa !15
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sitofp i32 %52 to float
  %54 = call float @llvm.fmuladd.f32(float %51, float %53, float %48)
  store float %54, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %55 = load ptr, ptr %13, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.s_grid, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %58 = getelementptr inbounds float, ptr %57, i64 2
  %59 = load float, ptr %58, align 4, !tbaa !11
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.s_grid, ptr %60, i32 0, i32 5
  %62 = load float, ptr %61, align 4, !tbaa !15
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = sitofp i32 %63 to float
  %65 = call float @llvm.fmuladd.f32(float %62, float %64, float %59)
  store float %65, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store double 0x3F60477813D6DA3E, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store float 3.100000e+02, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store float 0.000000e+00, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store float 0.000000e+00, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store float 0x40539999A0000000, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store float 0xC0211AE140000000, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store float 0x3F6DB65EC0000000, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store float 0x401F22B6A0000000, ptr %30, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %66 = load float, ptr %27, align 4, !tbaa !11
  %67 = load float, ptr %28, align 4, !tbaa !11
  %68 = fsub float %66, %67
  store float %68, ptr %31, align 4, !tbaa !11
  store i16 0, ptr %15, align 2, !tbaa !18
  br label %69

69:                                               ; preds = %320, %7
  %70 = load i16, ptr %15, align 2, !tbaa !18
  %71 = sext i16 %70 to i32
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %74, label %323

74:                                               ; preds = %69
  %75 = load ptr, ptr %11, align 8, !tbaa !9
  %76 = load i16, ptr %15, align 2, !tbaa !18
  %77 = sext i16 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.s_atm, ptr %79, i32 0, i32 34
  %81 = load i16, ptr %80, align 4, !tbaa !20
  %82 = sext i16 %81 to i32
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %295

84:                                               ; preds = %74
  %85 = load ptr, ptr %11, align 8, !tbaa !9
  %86 = load i16, ptr %15, align 2, !tbaa !18
  %87 = sext i16 %86 to i64
  %88 = getelementptr inbounds ptr, ptr %85, i64 %87
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.s_atm, ptr %89, i32 0, i32 32
  %91 = load float, ptr %90, align 4, !tbaa !22
  %92 = fpext float %91 to double
  %93 = fdiv double %92, 1.822230e+01
  %94 = fptrunc double %93 to float
  store float %94, ptr %26, align 4, !tbaa !11
  %95 = load float, ptr %19, align 4, !tbaa !11
  %96 = load float, ptr %20, align 4, !tbaa !11
  %97 = load float, ptr %21, align 4, !tbaa !11
  %98 = load ptr, ptr %11, align 8, !tbaa !9
  %99 = load i16, ptr %15, align 2, !tbaa !18
  %100 = sext i16 %99 to i64
  %101 = getelementptr inbounds ptr, ptr %98, i64 %100
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.s_atm, ptr %102, i32 0, i32 5
  %104 = load float, ptr %103, align 4, !tbaa !23
  %105 = load ptr, ptr %11, align 8, !tbaa !9
  %106 = load i16, ptr %15, align 2, !tbaa !18
  %107 = sext i16 %106 to i64
  %108 = getelementptr inbounds ptr, ptr %105, i64 %107
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.s_atm, ptr %109, i32 0, i32 6
  %111 = load float, ptr %110, align 8, !tbaa !24
  %112 = load ptr, ptr %11, align 8, !tbaa !9
  %113 = load i16, ptr %15, align 2, !tbaa !18
  %114 = sext i16 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.s_atm, ptr %116, i32 0, i32 7
  %118 = load float, ptr %117, align 4, !tbaa !25
  %119 = call float @dist(float noundef %95, float noundef %96, float noundef %97, float noundef %104, float noundef %111, float noundef %118)
  store float %119, ptr %16, align 4, !tbaa !11
  %120 = load float, ptr %16, align 4, !tbaa !11
  %121 = fpext float %120 to double
  %122 = fcmp olt double %121, 1.400000e+00
  br i1 %122, label %123, label %160

123:                                              ; preds = %84
  %124 = load ptr, ptr %14, align 8, !tbaa !9
  %125 = getelementptr inbounds %struct.s_grid, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !26
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %126, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds ptr, ptr %130, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds float, ptr %134, i64 %136
  %138 = load float, ptr %137, align 4, !tbaa !11
  %139 = fpext float %138 to double
  %140 = fadd double %139, 1.000000e+02
  %141 = fptrunc double %140 to float
  store float %141, ptr %137, align 4, !tbaa !11
  %142 = load ptr, ptr %13, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.s_grid, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !26
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds ptr, ptr %148, i64 %150
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds float, ptr %152, i64 %154
  %156 = load float, ptr %155, align 4, !tbaa !11
  %157 = fpext float %156 to double
  %158 = fadd double %157, 0.000000e+00
  %159 = fptrunc double %158 to float
  store float %159, ptr %155, align 4, !tbaa !11
  store i32 1, ptr %32, align 4
  br label %324

160:                                              ; preds = %84
  %161 = load ptr, ptr %11, align 8, !tbaa !9
  %162 = load i16, ptr %15, align 2, !tbaa !18
  %163 = sext i16 %162 to i64
  %164 = getelementptr inbounds ptr, ptr %161, i64 %163
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct.s_atm, ptr %165, i32 0, i32 31
  %167 = load float, ptr %166, align 8, !tbaa !27
  %168 = fpext float %167 to double
  %169 = fadd double %168, 1.400000e+00
  %170 = load float, ptr getelementptr inbounds (%struct.s_mm_atom_type_a, ptr getelementptr inbounds ([35 x %struct.s_mm_atom_type_a], ptr @mm_atom_type_ST, i64 0, i64 34), i32 0, i32 1), align 4, !tbaa !28
  %171 = fpext float %170 to double
  %172 = fmul double %169, %171
  %173 = call double @sqrt(double noundef %172) #5
  %174 = fptrunc double %173 to float
  store float %174, ptr %17, align 4, !tbaa !11
  %175 = load ptr, ptr %11, align 8, !tbaa !9
  %176 = load i16, ptr %15, align 2, !tbaa !18
  %177 = sext i16 %176 to i64
  %178 = getelementptr inbounds ptr, ptr %175, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = getelementptr inbounds %struct.s_atm, ptr %179, i32 0, i32 33
  %181 = load float, ptr %180, align 8, !tbaa !30
  %182 = load float, ptr getelementptr inbounds (%struct.s_mm_atom_type_a, ptr @mm_atom_type_ST, i32 0, i32 2), align 8, !tbaa !31
  %183 = fmul float %181, %182
  %184 = fpext float %183 to double
  %185 = call double @sqrt(double noundef %184) #5
  %186 = fptrunc double %185 to float
  store float %186, ptr %18, align 4, !tbaa !11
  %187 = load float, ptr %18, align 4, !tbaa !11
  %188 = fpext float %187 to double
  %189 = fmul double 4.000000e+00, %188
  %190 = load float, ptr %17, align 4, !tbaa !11
  %191 = load float, ptr %16, align 4, !tbaa !11
  %192 = fdiv float %190, %191
  %193 = fpext float %192 to double
  %194 = call double @pow(double noundef %193, double noundef 1.200000e+01) #5
  %195 = load float, ptr %17, align 4, !tbaa !11
  %196 = load float, ptr %16, align 4, !tbaa !11
  %197 = fdiv float %195, %196
  %198 = fpext float %197 to double
  %199 = call double @pow(double noundef %198, double noundef 6.000000e+00) #5
  %200 = fsub double %194, %199
  %201 = fmul double %189, %200
  %202 = fptrunc double %201 to float
  store float %202, ptr %24, align 4, !tbaa !11
  %203 = load float, ptr %26, align 4, !tbaa !11
  %204 = fpext float %203 to double
  %205 = load float, ptr %16, align 4, !tbaa !11
  %206 = fpext float %205 to double
  %207 = load float, ptr %28, align 4, !tbaa !11
  %208 = fpext float %207 to double
  %209 = load float, ptr %31, align 4, !tbaa !11
  %210 = fpext float %209 to double
  %211 = load float, ptr %30, align 4, !tbaa !11
  %212 = fpext float %211 to double
  %213 = load float, ptr %29, align 4, !tbaa !11
  %214 = fneg float %213
  %215 = load float, ptr %31, align 4, !tbaa !11
  %216 = fmul float %214, %215
  %217 = load float, ptr %16, align 4, !tbaa !11
  %218 = fmul float %216, %217
  %219 = fpext float %218 to double
  %220 = call double @exp(double noundef %219) #5
  %221 = call double @llvm.fmuladd.f64(double %212, double %220, double 1.000000e+00)
  %222 = fdiv double %210, %221
  %223 = fadd double %208, %222
  %224 = fmul double %206, %223
  %225 = fdiv double %204, %224
  %226 = fptrunc double %225 to float
  store float %226, ptr %25, align 4, !tbaa !11
  %227 = load float, ptr %24, align 4, !tbaa !11
  %228 = fneg float %227
  %229 = fpext float %228 to double
  %230 = load double, ptr %22, align 8, !tbaa !16
  %231 = load float, ptr %23, align 4, !tbaa !11
  %232 = fpext float %231 to double
  %233 = fmul double %230, %232
  %234 = fdiv double %229, %233
  %235 = call double @exp(double noundef %234) #5
  %236 = load float, ptr %24, align 4, !tbaa !11
  %237 = fpext float %236 to double
  %238 = load ptr, ptr %14, align 8, !tbaa !9
  %239 = getelementptr inbounds %struct.s_grid, ptr %238, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !26
  %241 = load i32, ptr %8, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds ptr, ptr %240, i64 %242
  %244 = load ptr, ptr %243, align 8, !tbaa !9
  %245 = load i32, ptr %9, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds ptr, ptr %244, i64 %246
  %248 = load ptr, ptr %247, align 8, !tbaa !9
  %249 = load i32, ptr %10, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds float, ptr %248, i64 %250
  %252 = load float, ptr %251, align 4, !tbaa !11
  %253 = fpext float %252 to double
  %254 = call double @llvm.fmuladd.f64(double %235, double %237, double %253)
  %255 = fptrunc double %254 to float
  store float %255, ptr %251, align 4, !tbaa !11
  %256 = load float, ptr %26, align 4, !tbaa !11
  %257 = fpext float %256 to double
  %258 = fcmp une double %257, 0.000000e+00
  br i1 %258, label %259, label %293

259:                                              ; preds = %160
  %260 = load float, ptr %16, align 4, !tbaa !11
  %261 = fpext float %260 to double
  %262 = fcmp olt double %261, 8.500000e+00
  br i1 %262, label %263, label %293

263:                                              ; preds = %259
  %264 = load float, ptr %25, align 4, !tbaa !11
  %265 = fneg float %264
  %266 = fpext float %265 to double
  %267 = load double, ptr %22, align 8, !tbaa !16
  %268 = load float, ptr %23, align 4, !tbaa !11
  %269 = fpext float %268 to double
  %270 = fmul double %267, %269
  %271 = fdiv double %266, %270
  %272 = call double @exp(double noundef %271) #5
  %273 = load float, ptr %25, align 4, !tbaa !11
  %274 = fpext float %273 to double
  %275 = load ptr, ptr %13, align 8, !tbaa !9
  %276 = getelementptr inbounds %struct.s_grid, ptr %275, i32 0, i32 0
  %277 = load ptr, ptr %276, align 8, !tbaa !26
  %278 = load i32, ptr %8, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds ptr, ptr %277, i64 %279
  %281 = load ptr, ptr %280, align 8, !tbaa !9
  %282 = load i32, ptr %9, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds ptr, ptr %281, i64 %283
  %285 = load ptr, ptr %284, align 8, !tbaa !9
  %286 = load i32, ptr %10, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds float, ptr %285, i64 %287
  %289 = load float, ptr %288, align 4, !tbaa !11
  %290 = fpext float %289 to double
  %291 = call double @llvm.fmuladd.f64(double %272, double %274, double %290)
  %292 = fptrunc double %291 to float
  store float %292, ptr %288, align 4, !tbaa !11
  br label %293

293:                                              ; preds = %263, %259, %160
  br label %294

294:                                              ; preds = %293
  br label %319

295:                                              ; preds = %74
  %296 = load ptr, ptr @stderr, align 8, !tbaa !9
  %297 = load ptr, ptr %11, align 8, !tbaa !9
  %298 = load i16, ptr %15, align 2, !tbaa !18
  %299 = sext i16 %298 to i64
  %300 = getelementptr inbounds ptr, ptr %297, i64 %299
  %301 = load ptr, ptr %300, align 8, !tbaa !9
  %302 = getelementptr inbounds %struct.s_atm, ptr %301, i32 0, i32 12
  %303 = getelementptr inbounds [3 x i8], ptr %302, i64 0, i64 0
  %304 = load ptr, ptr %11, align 8, !tbaa !9
  %305 = load i16, ptr %15, align 2, !tbaa !18
  %306 = sext i16 %305 to i64
  %307 = getelementptr inbounds ptr, ptr %304, i64 %306
  %308 = load ptr, ptr %307, align 8, !tbaa !9
  %309 = getelementptr inbounds %struct.s_atm, ptr %308, i32 0, i32 13
  %310 = getelementptr inbounds [8 x i8], ptr %309, i64 0, i64 0
  %311 = load ptr, ptr %11, align 8, !tbaa !9
  %312 = load i16, ptr %15, align 2, !tbaa !18
  %313 = sext i16 %312 to i64
  %314 = getelementptr inbounds ptr, ptr %311, i64 %313
  %315 = load ptr, ptr %314, align 8, !tbaa !9
  %316 = getelementptr inbounds %struct.s_atm, ptr %315, i32 0, i32 16
  %317 = load i32, ptr %316, align 8, !tbaa !32
  %318 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %296, ptr noundef @.str.18, ptr noundef %303, ptr noundef %310, i32 noundef %317) #5
  br label %319

319:                                              ; preds = %295, %294
  br label %320

320:                                              ; preds = %319
  %321 = load i16, ptr %15, align 2, !tbaa !18
  %322 = add i16 %321, 1
  store i16 %322, ptr %15, align 2, !tbaa !18
  br label %69, !llvm.loop !33

323:                                              ; preds = %69
  store i32 1, ptr %32, align 4
  br label %324

324:                                              ; preds = %323, %123
  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 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #5
  ret void
}

declare float @dist(float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #4

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"s_grid", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !12, i64 28}
!15 = !{!14, !12, i64 28}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = !{!21, !19, i64 164}
!21 = !{!"s_atm", !6, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !7, i64 32, !7, i64 37, !7, i64 44, !7, i64 60, !7, i64 76, !7, i64 79, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !7, i64 144, !7, i64 145, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !19, i64 164, !10, i64 168, !6, i64 176}
!22 = !{!21, !12, i64 156}
!23 = !{!21, !12, i64 20}
!24 = !{!21, !12, i64 24}
!25 = !{!21, !12, i64 28}
!26 = !{!14, !10, i64 0}
!27 = !{!21, !12, i64 152}
!28 = !{!29, !12, i64 4}
!29 = !{!"s_mm_atom_type_a", !7, i64 0, !12, i64 4, !12, i64 8}
!30 = !{!21, !12, i64 160}
!31 = !{!29, !12, i64 8}
!32 = !{!21, !6, i64 96}
!33 = distinct !{!33, !34}
!34 = !{!"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"

%struct.s_mm_atom_type_a = type { [2 x i8], float, float }

@mm_atom_type_ST = external hidden local_unnamed_addr constant [35 x %struct.s_mm_atom_type_a], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.18 = external hidden unnamed_addr constant [79 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @set_energies_to_grid_point(i32 noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6) local_unnamed_addr #2 {
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = load float, ptr %9, align 4, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %5, i64 28
  %12 = load float, ptr %11, align 4, !tbaa !13
  %13 = sitofp i32 %0 to float
  %14 = tail call float @llvm.fmuladd.f32(float %12, float %13, float %10)
  %15 = getelementptr inbounds i8, ptr %9, i64 4
  %16 = load float, ptr %15, align 4, !tbaa !12
  %17 = sitofp i32 %1 to float
  %18 = tail call float @llvm.fmuladd.f32(float %12, float %17, float %16)
  %19 = getelementptr inbounds i8, ptr %9, i64 8
  %20 = load float, ptr %19, align 4, !tbaa !12
  %21 = sitofp i32 %2 to float
  %22 = tail call float @llvm.fmuladd.f32(float %12, float %21, float %20)
  %23 = icmp sgt i32 %4, 0
  br i1 %23, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %7
  %24 = load float, ptr getelementptr inbounds (i8, ptr @mm_atom_type_ST, i64 412), align 4
  %25 = fpext float %24 to double
  %26 = load float, ptr getelementptr inbounds (i8, ptr @mm_atom_type_ST, i64 8), align 8
  %27 = sext i32 %0 to i64
  %28 = sext i32 %1 to i64
  %29 = sext i32 %2 to i64
  br label %30

30:                                               ; preds = %.lr.ph, %141
  %.077 = phi i16 [ 0, %.lr.ph ], [ %142, %141 ]
  %31 = sext i16 %.077 to i64
  %32 = getelementptr inbounds ptr, ptr %3, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %34 = getelementptr inbounds i8, ptr %33, i64 164
  %35 = load i16, ptr %34, align 4, !tbaa !15
  %36 = icmp eq i16 %35, 1
  br i1 %36, label %37, label %134

37:                                               ; preds = %30
  %38 = getelementptr inbounds i8, ptr %33, i64 156
  %39 = load float, ptr %38, align 4, !tbaa !18
  %40 = getelementptr inbounds i8, ptr %33, i64 20
  %41 = load float, ptr %40, align 4, !tbaa !19
  %42 = getelementptr inbounds i8, ptr %33, i64 24
  %43 = load float, ptr %42, align 8, !tbaa !20
  %44 = getelementptr inbounds i8, ptr %33, i64 28
  %45 = load float, ptr %44, align 4, !tbaa !21
  %46 = tail call float @dist(float noundef %14, float noundef %18, float noundef %22, float noundef %41, float noundef %43, float noundef %45) #5
  %47 = fpext float %46 to double
  %48 = fcmp olt double %47, 1.400000e+00
  br i1 %48, label %49, label %66

49:                                               ; preds = %37
  %50 = load ptr, ptr %6, align 8, !tbaa !22
  %51 = getelementptr inbounds ptr, ptr %50, i64 %27
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds ptr, ptr %52, i64 %28
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds float, ptr %54, i64 %29
  %56 = load float, ptr %55, align 4, !tbaa !12
  %57 = fadd float %56, 1.000000e+02
  store float %57, ptr %55, align 4, !tbaa !12
  %58 = load ptr, ptr %5, align 8, !tbaa !22
  %59 = getelementptr inbounds ptr, ptr %58, i64 %27
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = getelementptr inbounds ptr, ptr %60, i64 %28
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = getelementptr inbounds float, ptr %62, i64 %29
  %64 = load float, ptr %63, align 4, !tbaa !12
  %65 = fadd float %64, 0.000000e+00
  store float %65, ptr %63, align 4, !tbaa !12
  br label %.loopexit

66:                                               ; preds = %37
  %67 = fpext float %39 to double
  %68 = fdiv double %67, 1.822230e+01
  %69 = fptrunc double %68 to float
  %70 = load ptr, ptr %32, align 8, !tbaa !14
  %71 = getelementptr inbounds i8, ptr %70, i64 152
  %72 = load float, ptr %71, align 8, !tbaa !23
  %73 = fpext float %72 to double
  %74 = fadd double %73, 1.400000e+00
  %75 = fmul double %74, %25
  %76 = tail call double @sqrt(double noundef %75) #5
  %77 = fptrunc double %76 to float
  %78 = load ptr, ptr %32, align 8, !tbaa !14
  %79 = getelementptr inbounds i8, ptr %78, i64 160
  %80 = load float, ptr %79, align 8, !tbaa !24
  %81 = fmul float %80, %26
  %sqrtf = tail call float @sqrtf(float noundef %81) #4
  %82 = fpext float %sqrtf to double
  %83 = fmul double %82, 4.000000e+00
  %84 = fdiv float %77, %46
  %85 = fpext float %84 to double
  %86 = tail call double @pow(double noundef %85, double noundef 1.200000e+01) #5
  %87 = tail call double @pow(double noundef %85, double noundef 6.000000e+00) #5
  %88 = fsub double %86, %87
  %89 = fmul double %83, %88
  %90 = fptrunc double %89 to float
  %91 = fmul float %46, 0xBFD42F21C0000000
  %92 = fpext float %91 to double
  %93 = tail call double @exp(double noundef %92) #5
  %94 = fneg float %90
  %95 = fpext float %94 to double
  %96 = fdiv double %95, 0x3FE3B68B68062C47
  %97 = tail call double @exp(double noundef %96) #5
  %98 = fpext float %90 to double
  %99 = load ptr, ptr %6, align 8, !tbaa !22
  %100 = getelementptr inbounds ptr, ptr %99, i64 %27
  %101 = load ptr, ptr %100, align 8, !tbaa !14
  %102 = getelementptr inbounds ptr, ptr %101, i64 %28
  %103 = load ptr, ptr %102, align 8, !tbaa !14
  %104 = getelementptr inbounds float, ptr %103, i64 %29
  %105 = load float, ptr %104, align 4, !tbaa !12
  %106 = fpext float %105 to double
  %107 = tail call double @llvm.fmuladd.f64(double %97, double %98, double %106)
  %108 = fptrunc double %107 to float
  store float %108, ptr %104, align 4, !tbaa !12
  %109 = fcmp une float %69, 0.000000e+00
  %110 = fcmp olt float %46, 8.500000e+00
  %or.cond = and i1 %109, %110
  br i1 %or.cond, label %111, label %141

111:                                              ; preds = %66
  %112 = fpext float %69 to double
  %113 = tail call double @llvm.fmuladd.f64(double %93, double 0x401F22B6A0000000, double 1.000000e+00)
  %114 = fdiv double 0x4055BCF5C0000000, %113
  %115 = fadd double %114, 0xC0211AE140000000
  %116 = fmul double %115, %47
  %117 = fdiv double %112, %116
  %118 = fptrunc double %117 to float
  %119 = fneg float %118
  %120 = fpext float %119 to double
  %121 = fdiv double %120, 0x3FE3B68B68062C47
  %122 = tail call double @exp(double noundef %121) #5
  %123 = fpext float %118 to double
  %124 = load ptr, ptr %5, align 8, !tbaa !22
  %125 = getelementptr inbounds ptr, ptr %124, i64 %27
  %126 = load ptr, ptr %125, align 8, !tbaa !14
  %127 = getelementptr inbounds ptr, ptr %126, i64 %28
  %128 = load ptr, ptr %127, align 8, !tbaa !14
  %129 = getelementptr inbounds float, ptr %128, i64 %29
  %130 = load float, ptr %129, align 4, !tbaa !12
  %131 = fpext float %130 to double
  %132 = tail call double @llvm.fmuladd.f64(double %122, double %123, double %131)
  %133 = fptrunc double %132 to float
  store float %133, ptr %129, align 4, !tbaa !12
  br label %141

134:                                              ; preds = %30
  %135 = load ptr, ptr @stderr, align 8, !tbaa !14
  %136 = getelementptr inbounds i8, ptr %33, i64 76
  %137 = getelementptr inbounds i8, ptr %33, i64 79
  %138 = getelementptr inbounds i8, ptr %33, i64 96
  %139 = load i32, ptr %138, align 8, !tbaa !25
  %140 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef nonnull @.str.18, ptr noundef nonnull %136, ptr noundef nonnull %137, i32 noundef %139) #6
  br label %141

141:                                              ; preds = %134, %66, %111
  %142 = add i16 %.077, 1
  %143 = sext i16 %142 to i32
  %144 = icmp slt i32 %143, %4
  br i1 %144, label %30, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %141, %7, %49
  ret void
}

declare float @dist(float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #3

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

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

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

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

declare float @sqrtf(float) local_unnamed_addr

attributes #0 = { nofree 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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold 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 8}
!6 = !{!"s_grid", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !11, i64 28}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!6, !11, i64 28}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !17, i64 164}
!16 = !{!"s_atm", !10, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !8, i64 32, !8, i64 37, !8, i64 44, !8, i64 60, !8, i64 76, !8, i64 79, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !8, i64 144, !8, i64 145, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !17, i64 164, !7, i64 168, !10, i64 176}
!17 = !{!"short", !8, i64 0}
!18 = !{!16, !11, i64 156}
!19 = !{!16, !11, i64 20}
!20 = !{!16, !11, i64 24}
!21 = !{!16, !11, i64 28}
!22 = !{!6, !7, i64 0}
!23 = !{!16, !11, i64 152}
!24 = !{!16, !11, i64 160}
!25 = !{!16, !10, i64 96}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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