; LLVM IR from alexzheng42/sDMD :: src (Events)

; 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.FlowStr = type { i32, %struct.ConstVStr, %struct.ForceStr, %struct.ChargeStr }
%struct.ConstVStr = type { [4 x double] }
%struct.ForceStr = type { [4 x double], ptr, ptr }
%struct.ChargeStr = type { i32, i32, ptr, ptr, ptr, ptr }
%struct.AtomStr = type { ptr, ptr }
%struct.DynamicStr = type { [4 x i32], [4 x double], [4 x double], %struct.HBStr, %struct.HBNeighborStr, %struct.InteractionEventStr }
%struct.HBStr = type { i32, i32, i8, i32 }
%struct.HBNeighborStr = type { [5 x i32], i32, i32 }
%struct.InteractionEventStr = type { i32, i64, i64, double, double, i32, i32 }
%struct.PropertyStr = type { [8 x i8], [2 x [16 x i8]], [8 x i8], i32, i32, i32, double, double, [3 x double], %struct.AtomSeqStr, ptr, ptr }
%struct.AtomSeqStr = type { i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@flow = external global %struct.FlowStr, align 8
@.str.16 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 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 uwtable
define dso_local void @ChargeEvent(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [4 x double], align 16
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca [4 x double], align 16
  %9 = alloca [4 x double], align 16
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [4 x double], align 16
  %16 = alloca [4 x double], align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.AtomStr, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct.DynamicStr, ptr %19, i32 0, i32 5
  %21 = getelementptr inbounds %struct.InteractionEventStr, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !13
  %23 = sdiv i32 %22, -100
  store i32 %23, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #8
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 32, i1 false)
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.AtomStr, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.DynamicStr, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds [4 x double], ptr %27, i64 0, i64 0
  %29 = load double, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 0
  store double %29, ptr %30, align 16, !tbaa !20
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.AtomStr, ptr %31, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds %struct.DynamicStr, ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds [4 x double], ptr %34, i64 0, i64 1
  %36 = load double, ptr %35, align 8, !tbaa !20
  %37 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 1
  store double %36, ptr %37, align 8, !tbaa !20
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.AtomStr, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.DynamicStr, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds [4 x double], ptr %41, i64 0, i64 2
  %43 = load double, ptr %42, align 8, !tbaa !20
  %44 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 2
  store double %43, ptr %44, align 16, !tbaa !20
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.AtomStr, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  %48 = getelementptr inbounds %struct.DynamicStr, ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds [4 x double], ptr %48, i64 0, i64 3
  %50 = load double, ptr %49, align 8, !tbaa !20
  %51 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 3
  store double %50, ptr %51, align 8, !tbaa !20
  %52 = load ptr, ptr getelementptr inbounds (%struct.ChargeStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 3), i32 0, i32 2), align 8, !tbaa !21
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %56, i64 0
  %58 = load double, ptr %57, align 8, !tbaa !20
  %59 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 0
  store double %58, ptr %59, align 16, !tbaa !20
  %60 = load ptr, ptr getelementptr inbounds (%struct.ChargeStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 3), i32 0, i32 2), align 8, !tbaa !21
  %61 = load i32, ptr %4, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds double, ptr %64, i64 1
  %66 = load double, ptr %65, align 8, !tbaa !20
  %67 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 1
  store double %66, ptr %67, align 8, !tbaa !20
  %68 = load ptr, ptr getelementptr inbounds (%struct.ChargeStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 3), i32 0, i32 2), align 8, !tbaa !21
  %69 = load i32, ptr %4, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %68, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = getelementptr inbounds double, ptr %72, i64 2
  %74 = load double, ptr %73, align 8, !tbaa !20
  %75 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 2
  store double %74, ptr %75, align 16, !tbaa !20
  %76 = load ptr, ptr getelementptr inbounds (%struct.ChargeStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 3), i32 0, i32 2), align 8, !tbaa !21
  %77 = load i32, ptr %4, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds double, ptr %80, i64 3
  %82 = load double, ptr %81, align 8, !tbaa !20
  %83 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 3
  store double %82, ptr %83, align 8, !tbaa !20
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.AtomStr, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !11
  %87 = getelementptr inbounds %struct.DynamicStr, ptr %86, i32 0, i32 2
  %88 = getelementptr inbounds [4 x double], ptr %87, i64 0, i64 0
  store ptr %88, ptr %13, align 8, !tbaa !5
  %89 = load ptr, ptr getelementptr inbounds (%struct.ChargeStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 3), i32 0, i32 3), align 8, !tbaa !26
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  store ptr %93, ptr %14, align 8, !tbaa !5
  %94 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 1
  %95 = load double, ptr %94, align 8, !tbaa !20
  %96 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 1
  %97 = load double, ptr %96, align 8, !tbaa !20
  %98 = fsub double %95, %97
  %99 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  store double %98, ptr %99, align 8, !tbaa !20
  %100 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 2
  %101 = load double, ptr %100, align 16, !tbaa !20
  %102 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 2
  %103 = load double, ptr %102, align 16, !tbaa !20
  %104 = fsub double %101, %103
  %105 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  store double %104, ptr %105, align 16, !tbaa !20
  %106 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 3
  %107 = load double, ptr %106, align 8, !tbaa !20
  %108 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 3
  %109 = load double, ptr %108, align 8, !tbaa !20
  %110 = fsub double %107, %109
  %111 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  store double %110, ptr %111, align 8, !tbaa !20
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds double, ptr %112, i64 1
  %114 = load double, ptr %113, align 8, !tbaa !20
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = getelementptr inbounds double, ptr %115, i64 1
  %117 = load double, ptr %116, align 8, !tbaa !20
  %118 = fsub double %114, %117
  %119 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 1
  store double %118, ptr %119, align 8, !tbaa !20
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds double, ptr %120, i64 2
  %122 = load double, ptr %121, align 8, !tbaa !20
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  %124 = getelementptr inbounds double, ptr %123, i64 2
  %125 = load double, ptr %124, align 8, !tbaa !20
  %126 = fsub double %122, %125
  %127 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 2
  store double %126, ptr %127, align 16, !tbaa !20
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds double, ptr %128, i64 3
  %130 = load double, ptr %129, align 8, !tbaa !20
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = getelementptr inbounds double, ptr %131, i64 3
  %133 = load double, ptr %132, align 8, !tbaa !20
  %134 = fsub double %130, %133
  %135 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 3
  store double %134, ptr %135, align 8, !tbaa !20
  %136 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %137 = load double, ptr %136, align 8, !tbaa !20
  %138 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %139 = load double, ptr %138, align 8, !tbaa !20
  %140 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %141 = load double, ptr %140, align 16, !tbaa !20
  %142 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %143 = load double, ptr %142, align 16, !tbaa !20
  %144 = fmul double %141, %143
  %145 = call double @llvm.fmuladd.f64(double %137, double %139, double %144)
  %146 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %147 = load double, ptr %146, align 8, !tbaa !20
  %148 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %149 = load double, ptr %148, align 8, !tbaa !20
  %150 = call double @llvm.fmuladd.f64(double %147, double %149, double %145)
  store double %150, ptr %7, align 8, !tbaa !20
  %151 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %152 = load double, ptr %151, align 8, !tbaa !20
  %153 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 1
  %154 = load double, ptr %153, align 8, !tbaa !20
  %155 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %156 = load double, ptr %155, align 16, !tbaa !20
  %157 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 2
  %158 = load double, ptr %157, align 16, !tbaa !20
  %159 = fmul double %156, %158
  %160 = call double @llvm.fmuladd.f64(double %152, double %154, double %159)
  %161 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %162 = load double, ptr %161, align 8, !tbaa !20
  %163 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 3
  %164 = load double, ptr %163, align 8, !tbaa !20
  %165 = call double @llvm.fmuladd.f64(double %162, double %164, double %160)
  store double %165, ptr %6, align 8, !tbaa !20
  %166 = load ptr, ptr %2, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.AtomStr, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !27
  %169 = getelementptr inbounds %struct.PropertyStr, ptr %168, i32 0, i32 7
  %170 = load double, ptr %169, align 8, !tbaa !28
  store double %170, ptr %12, align 8, !tbaa !20
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.AtomStr, ptr %171, i32 0, i32 1
  %173 = load ptr, ptr %172, align 8, !tbaa !11
  %174 = getelementptr inbounds %struct.DynamicStr, ptr %173, i32 0, i32 5
  %175 = getelementptr inbounds %struct.InteractionEventStr, ptr %174, i32 0, i32 4
  %176 = load double, ptr %175, align 8, !tbaa !31
  store double %176, ptr %11, align 8, !tbaa !20
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.AtomStr, ptr %177, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds %struct.DynamicStr, ptr %179, i32 0, i32 5
  %181 = getelementptr inbounds %struct.InteractionEventStr, ptr %180, i32 0, i32 6
  %182 = load i32, ptr %181, align 4, !tbaa !32
  switch i32 %182, label %213 [
    i32 4, label %183
    i32 5, label %198
  ]

183:                                              ; preds = %1
  %184 = load double, ptr %6, align 8, !tbaa !20
  %185 = load double, ptr %6, align 8, !tbaa !20
  %186 = load double, ptr %7, align 8, !tbaa !20
  %187 = fmul double 2.000000e+00, %186
  %188 = load double, ptr %11, align 8, !tbaa !20
  %189 = fmul double %187, %188
  %190 = load double, ptr %12, align 8, !tbaa !20
  %191 = fdiv double %189, %190
  %192 = fneg double %191
  %193 = call double @llvm.fmuladd.f64(double %184, double %185, double %192)
  %194 = fcmp ole double %193, 0.000000e+00
  br i1 %194, label %195, label %196

195:                                              ; preds = %183
  store double 0.000000e+00, ptr %11, align 8, !tbaa !20
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %197

196:                                              ; preds = %183
  store i32 -1, ptr %3, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %196, %195
  br label %215

198:                                              ; preds = %1
  %199 = load double, ptr %6, align 8, !tbaa !20
  %200 = load double, ptr %6, align 8, !tbaa !20
  %201 = load double, ptr %7, align 8, !tbaa !20
  %202 = fmul double 2.000000e+00, %201
  %203 = load double, ptr %11, align 8, !tbaa !20
  %204 = fmul double %202, %203
  %205 = load double, ptr %12, align 8, !tbaa !20
  %206 = fdiv double %204, %205
  %207 = fneg double %206
  %208 = call double @llvm.fmuladd.f64(double %199, double %200, double %207)
  %209 = fcmp ole double %208, 0.000000e+00
  br i1 %209, label %210, label %211

210:                                              ; preds = %198
  store double 0.000000e+00, ptr %11, align 8, !tbaa !20
  store i32 -1, ptr %3, align 4, !tbaa !9
  br label %212

211:                                              ; preds = %198
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %212

212:                                              ; preds = %211, %210
  br label %215

213:                                              ; preds = %1
  %214 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 733)
  call void @exit(i32 noundef 1) #9
  unreachable

215:                                              ; preds = %212, %197
  %216 = load double, ptr %6, align 8, !tbaa !20
  %217 = load i32, ptr %3, align 4, !tbaa !9
  %218 = sitofp i32 %217 to double
  %219 = load double, ptr %6, align 8, !tbaa !20
  %220 = load double, ptr %6, align 8, !tbaa !20
  %221 = load double, ptr %7, align 8, !tbaa !20
  %222 = fmul double 2.000000e+00, %221
  %223 = load double, ptr %11, align 8, !tbaa !20
  %224 = fmul double %222, %223
  %225 = load ptr, ptr %2, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.AtomStr, ptr %225, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !27
  %228 = getelementptr inbounds %struct.PropertyStr, ptr %227, i32 0, i32 7
  %229 = load double, ptr %228, align 8, !tbaa !28
  %230 = fdiv double %224, %229
  %231 = fneg double %230
  %232 = call double @llvm.fmuladd.f64(double %219, double %220, double %231)
  %233 = call double @sqrt(double noundef %232) #8
  %234 = fmul double %218, %233
  %235 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %216, double %234)
  %236 = load double, ptr %7, align 8, !tbaa !20
  %237 = fdiv double %235, %236
  store double %237, ptr %10, align 8, !tbaa !20
  %238 = load double, ptr %10, align 8, !tbaa !20
  %239 = call i1 @llvm.is.fpclass.f64(double %238, i32 3)
  %240 = xor i1 %239, true
  %241 = xor i1 %240, true
  %242 = zext i1 %241 to i32
  %243 = sext i32 %242 to i64
  %244 = call i64 @llvm.expect.i64(i64 %243, i64 0)
  %245 = icmp ne i64 %244, 0
  br i1 %245, label %246, label %248

246:                                              ; preds = %215
  %247 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 741)
  call void @exit(i32 noundef 1) #9
  unreachable

248:                                              ; preds = %215
  %249 = load double, ptr %10, align 8, !tbaa !20
  %250 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %251 = load double, ptr %250, align 8, !tbaa !20
  %252 = fmul double %249, %251
  %253 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  store double %252, ptr %253, align 8, !tbaa !20
  %254 = load double, ptr %10, align 8, !tbaa !20
  %255 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %256 = load double, ptr %255, align 16, !tbaa !20
  %257 = fmul double %254, %256
  %258 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  store double %257, ptr %258, align 16, !tbaa !20
  %259 = load double, ptr %10, align 8, !tbaa !20
  %260 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %261 = load double, ptr %260, align 8, !tbaa !20
  %262 = fmul double %259, %261
  %263 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  store double %262, ptr %263, align 8, !tbaa !20
  %264 = load ptr, ptr %13, align 8, !tbaa !5
  %265 = getelementptr inbounds double, ptr %264, i64 1
  %266 = load double, ptr %265, align 8, !tbaa !20
  %267 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  %268 = load double, ptr %267, align 8, !tbaa !20
  %269 = fadd double %266, %268
  %270 = load ptr, ptr %2, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.AtomStr, ptr %270, i32 0, i32 1
  %272 = load ptr, ptr %271, align 8, !tbaa !11
  %273 = getelementptr inbounds %struct.DynamicStr, ptr %272, i32 0, i32 2
  %274 = getelementptr inbounds [4 x double], ptr %273, i64 0, i64 1
  store double %269, ptr %274, align 8, !tbaa !20
  %275 = load ptr, ptr %13, align 8, !tbaa !5
  %276 = getelementptr inbounds double, ptr %275, i64 2
  %277 = load double, ptr %276, align 8, !tbaa !20
  %278 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  %279 = load double, ptr %278, align 16, !tbaa !20
  %280 = fadd double %277, %279
  %281 = load ptr, ptr %2, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.AtomStr, ptr %281, i32 0, i32 1
  %283 = load ptr, ptr %282, align 8, !tbaa !11
  %284 = getelementptr inbounds %struct.DynamicStr, ptr %283, i32 0, i32 2
  %285 = getelementptr inbounds [4 x double], ptr %284, i64 0, i64 2
  store double %280, ptr %285, align 8, !tbaa !20
  %286 = load ptr, ptr %13, align 8, !tbaa !5
  %287 = getelementptr inbounds double, ptr %286, i64 3
  %288 = load double, ptr %287, align 8, !tbaa !20
  %289 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  %290 = load double, ptr %289, align 8, !tbaa !20
  %291 = fadd double %288, %290
  %292 = load ptr, ptr %2, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.AtomStr, ptr %292, i32 0, i32 1
  %294 = load ptr, ptr %293, align 8, !tbaa !11
  %295 = getelementptr inbounds %struct.DynamicStr, ptr %294, i32 0, i32 2
  %296 = getelementptr inbounds [4 x double], ptr %295, i64 0, i64 3
  store double %291, ptr %296, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  ret void
}

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; 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 willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #4

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f64(double, i32 immarg) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { noreturn 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 #4 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn 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 8}
!12 = !{!"AtomStr", !6, i64 0, !6, i64 8}
!13 = !{!14, !10, i64 128}
!14 = !{!"DynamicStr", !7, i64 0, !7, i64 16, !7, i64 48, !15, i64 80, !16, i64 96, !17, i64 128}
!15 = !{!"HBStr", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 12}
!16 = !{!"HBNeighborStr", !7, i64 0, !10, i64 20, !10, i64 24}
!17 = !{!"InteractionEventStr", !10, i64 0, !18, i64 8, !18, i64 16, !19, i64 24, !19, i64 32, !10, i64 40, !10, i64 44}
!18 = !{!"long", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!19, !19, i64 0}
!21 = !{!22, !6, i64 96}
!22 = !{!"FlowStr", !10, i64 0, !23, i64 8, !24, i64 40, !25, i64 88}
!23 = !{!"ConstVStr", !7, i64 0}
!24 = !{!"ForceStr", !7, i64 0, !6, i64 32, !6, i64 40}
!25 = !{!"ChargeStr", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!26 = !{!22, !6, i64 104}
!27 = !{!12, !6, i64 0}
!28 = !{!29, !19, i64 72}
!29 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !19, i64 64, !19, i64 72, !7, i64 80, !30, i64 104, !6, i64 120, !6, i64 128}
!30 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!31 = !{!14, !19, i64 160}
!32 = !{!14, !10, i64 172}


; 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.FlowStr = type { i32, %struct.ConstVStr, %struct.ForceStr, %struct.ChargeStr }
%struct.ConstVStr = type { [4 x double] }
%struct.ForceStr = type { [4 x double], ptr, ptr }
%struct.ChargeStr = type { i32, i32, ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@flow = external local_unnamed_addr global %struct.FlowStr, align 8
@.str.16 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ChargeEvent(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 128
  %5 = load i32, ptr %4, align 8, !tbaa !10
  %6 = sdiv i32 %5, -100
  %7 = getelementptr inbounds i8, ptr %3, i64 24
  %8 = load double, ptr %7, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %3, i64 32
  %10 = load double, ptr %9, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %3, i64 40
  %12 = load double, ptr %11, align 8, !tbaa !18
  %13 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 96), align 8, !tbaa !19
  %14 = sext i32 %6 to i64
  %15 = getelementptr inbounds ptr, ptr %13, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !24
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load double, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %16, i64 16
  %20 = load double, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %16, i64 24
  %22 = load double, ptr %21, align 8, !tbaa !18
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 104), align 8, !tbaa !25
  %24 = getelementptr inbounds ptr, ptr %23, i64 %14
  %25 = load ptr, ptr %24, align 8, !tbaa !24
  %26 = fsub double %8, %18
  %27 = fsub double %10, %20
  %28 = fsub double %12, %22
  %29 = getelementptr inbounds i8, ptr %3, i64 56
  %30 = load double, ptr %29, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %25, i64 8
  %32 = load double, ptr %31, align 8, !tbaa !18
  %33 = fsub double %30, %32
  %34 = getelementptr inbounds i8, ptr %3, i64 64
  %35 = load double, ptr %34, align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %25, i64 16
  %37 = load double, ptr %36, align 8, !tbaa !18
  %38 = fsub double %35, %37
  %39 = getelementptr inbounds i8, ptr %3, i64 72
  %40 = load double, ptr %39, align 8, !tbaa !18
  %41 = getelementptr inbounds i8, ptr %25, i64 24
  %42 = load double, ptr %41, align 8, !tbaa !18
  %43 = fsub double %40, %42
  %44 = fmul double %27, %27
  %45 = tail call double @llvm.fmuladd.f64(double %26, double %26, double %44)
  %46 = tail call double @llvm.fmuladd.f64(double %28, double %28, double %45)
  %47 = fmul double %27, %38
  %48 = tail call double @llvm.fmuladd.f64(double %26, double %33, double %47)
  %49 = tail call double @llvm.fmuladd.f64(double %28, double %43, double %48)
  %50 = load ptr, ptr %0, align 8, !tbaa !26
  %51 = getelementptr inbounds i8, ptr %50, i64 72
  %52 = load double, ptr %51, align 8, !tbaa !27
  %53 = getelementptr inbounds i8, ptr %3, i64 160
  %54 = load double, ptr %53, align 8, !tbaa !30
  %55 = getelementptr inbounds i8, ptr %3, i64 172
  %56 = load i32, ptr %55, align 4, !tbaa !31
  switch i32 %56, label %69 [
    i32 4, label %57
    i32 5, label %63
  ]

57:                                               ; preds = %1
  %58 = fmul double %46, -2.000000e+00
  %59 = fmul double %58, %54
  %60 = fdiv double %59, %52
  %61 = tail call double @llvm.fmuladd.f64(double %49, double %49, double %60)
  %62 = fcmp ugt double %61, 0.000000e+00
  %. = select i1 %62, double %54, double 0.000000e+00
  %.70 = select i1 %62, double -1.000000e+00, double 1.000000e+00
  br label %71

63:                                               ; preds = %1
  %64 = fmul double %46, -2.000000e+00
  %65 = fmul double %64, %54
  %66 = fdiv double %65, %52
  %67 = tail call double @llvm.fmuladd.f64(double %49, double %49, double %66)
  %68 = fcmp ugt double %67, 0.000000e+00
  %.71 = select i1 %68, double %54, double 0.000000e+00
  %.72 = select i1 %68, double 1.000000e+00, double -1.000000e+00
  br label %71

69:                                               ; preds = %1
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull @.str.1, i32 noundef 733)
  tail call void @exit(i32 noundef 1) #5
  unreachable

71:                                               ; preds = %63, %57
  %.pre-phi = phi double [ %64, %63 ], [ %58, %57 ]
  %.069 = phi double [ %.71, %63 ], [ %., %57 ]
  %.0 = phi double [ %.72, %63 ], [ %.70, %57 ]
  %72 = fmul double %.pre-phi, %.069
  %73 = fdiv double %72, %52
  %74 = tail call double @llvm.fmuladd.f64(double %49, double %49, double %73)
  %75 = tail call double @sqrt(double noundef %74) #6
  %76 = fmul double %.0, %75
  %77 = tail call double @llvm.fmuladd.f64(double %49, double -1.000000e+00, double %76)
  %78 = fdiv double %77, %46
  %79 = fcmp uno double %78, 0.000000e+00
  br i1 %79, label %80, label %82, !prof !32

80:                                               ; preds = %71
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.1, i32 noundef 741)
  tail call void @exit(i32 noundef 1) #5
  unreachable

82:                                               ; preds = %71
  %83 = fmul double %26, %78
  %84 = fmul double %27, %78
  %85 = fmul double %28, %78
  %86 = load double, ptr %29, align 8, !tbaa !18
  %87 = fadd double %83, %86
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 56
  store double %87, ptr %89, align 8, !tbaa !18
  %90 = load double, ptr %34, align 8, !tbaa !18
  %91 = fadd double %84, %90
  %92 = getelementptr inbounds i8, ptr %88, i64 64
  store double %91, ptr %92, align 8, !tbaa !18
  %93 = load double, ptr %39, align 8, !tbaa !18
  %94 = fadd double %85, %93
  %95 = getelementptr inbounds i8, ptr %88, i64 72
  store double %94, ptr %95, align 8, !tbaa !18
  ret void
}

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

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

attributes #0 = { 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 #1 = { 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 #2 = { noreturn 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { noreturn nounwind }
attributes #6 = { 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 = !{!"AtomStr", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !13, i64 128}
!11 = !{!"DynamicStr", !8, i64 0, !8, i64 16, !8, i64 48, !12, i64 80, !14, i64 96, !15, i64 128}
!12 = !{!"HBStr", !13, i64 0, !13, i64 4, !8, i64 8, !13, i64 12}
!13 = !{!"int", !8, i64 0}
!14 = !{!"HBNeighborStr", !8, i64 0, !13, i64 20, !13, i64 24}
!15 = !{!"InteractionEventStr", !13, i64 0, !16, i64 8, !16, i64 16, !17, i64 24, !17, i64 32, !13, i64 40, !13, i64 44}
!16 = !{!"long", !8, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!20, !7, i64 96}
!20 = !{!"FlowStr", !13, i64 0, !21, i64 8, !22, i64 40, !23, i64 88}
!21 = !{!"ConstVStr", !8, i64 0}
!22 = !{!"ForceStr", !8, i64 0, !7, i64 32, !7, i64 40}
!23 = !{!"ChargeStr", !13, i64 0, !13, i64 4, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!24 = !{!7, !7, i64 0}
!25 = !{!20, !7, i64 104}
!26 = !{!6, !7, i64 0}
!27 = !{!28, !17, i64 72}
!28 = !{!"PropertyStr", !8, i64 0, !8, i64 8, !8, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !17, i64 64, !17, i64 72, !8, i64 80, !29, i64 104, !7, i64 120, !7, i64 128}
!29 = !{!"AtomSeqStr", !13, i64 0, !13, i64 4, !13, i64 8}
!30 = !{!11, !17, i64 160}
!31 = !{!11, !13, i64 172}
!32 = !{!"branch_weights", !"expected", i32 1, i32 2000}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass