; 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.SphObstStr = type { i32, i32, 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
@.str.16 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1
@SphObstObj = external global %struct.SphObstStr, align 8

; 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 @SphObstEvent(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 [4 x double], align 16
  %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, -1000
  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 32, ptr %14) #8
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 32, i1 false)
  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.SphObstStr, ptr @SphObstObj, i32 0, i32 3), 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.SphObstStr, ptr @SphObstObj, i32 0, i32 3), 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.SphObstStr, ptr @SphObstObj, i32 0, i32 3), 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.SphObstStr, ptr @SphObstObj, i32 0, i32 3), 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 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 1
  %90 = load double, ptr %89, align 8, !tbaa !20
  %91 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 1
  %92 = load double, ptr %91, align 8, !tbaa !20
  %93 = fsub double %90, %92
  %94 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  store double %93, ptr %94, align 8, !tbaa !20
  %95 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 2
  %96 = load double, ptr %95, align 16, !tbaa !20
  %97 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 2
  %98 = load double, ptr %97, align 16, !tbaa !20
  %99 = fsub double %96, %98
  %100 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  store double %99, ptr %100, align 16, !tbaa !20
  %101 = getelementptr inbounds [4 x double], ptr %15, i64 0, i64 3
  %102 = load double, ptr %101, align 8, !tbaa !20
  %103 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 3
  %104 = load double, ptr %103, align 8, !tbaa !20
  %105 = fsub double %102, %104
  %106 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  store double %105, ptr %106, align 8, !tbaa !20
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds double, ptr %107, i64 1
  %109 = load double, ptr %108, align 8, !tbaa !20
  %110 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 1
  %111 = load double, ptr %110, align 8, !tbaa !20
  %112 = fsub double %109, %111
  %113 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 1
  store double %112, ptr %113, align 8, !tbaa !20
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds double, ptr %114, i64 2
  %116 = load double, ptr %115, align 8, !tbaa !20
  %117 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 2
  %118 = load double, ptr %117, align 16, !tbaa !20
  %119 = fsub double %116, %118
  %120 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 2
  store double %119, ptr %120, align 16, !tbaa !20
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds double, ptr %121, i64 3
  %123 = load double, ptr %122, align 8, !tbaa !20
  %124 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 3
  %125 = load double, ptr %124, align 8, !tbaa !20
  %126 = fsub double %123, %125
  %127 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 3
  store double %126, ptr %127, align 8, !tbaa !20
  %128 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %129 = load double, ptr %128, align 8, !tbaa !20
  %130 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %131 = load double, ptr %130, align 8, !tbaa !20
  %132 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %133 = load double, ptr %132, align 16, !tbaa !20
  %134 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %135 = load double, ptr %134, align 16, !tbaa !20
  %136 = fmul double %133, %135
  %137 = call double @llvm.fmuladd.f64(double %129, double %131, double %136)
  %138 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %139 = load double, ptr %138, align 8, !tbaa !20
  %140 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %141 = load double, ptr %140, align 8, !tbaa !20
  %142 = call double @llvm.fmuladd.f64(double %139, double %141, double %137)
  store double %142, ptr %7, align 8, !tbaa !20
  %143 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %144 = load double, ptr %143, align 8, !tbaa !20
  %145 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 1
  %146 = load double, ptr %145, align 8, !tbaa !20
  %147 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %148 = load double, ptr %147, align 16, !tbaa !20
  %149 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 2
  %150 = load double, ptr %149, align 16, !tbaa !20
  %151 = fmul double %148, %150
  %152 = call double @llvm.fmuladd.f64(double %144, double %146, double %151)
  %153 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %154 = load double, ptr %153, align 8, !tbaa !20
  %155 = getelementptr inbounds [4 x double], ptr %5, i64 0, i64 3
  %156 = load double, ptr %155, align 8, !tbaa !20
  %157 = call double @llvm.fmuladd.f64(double %154, double %156, double %152)
  store double %157, ptr %6, align 8, !tbaa !20
  %158 = load ptr, ptr %2, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.AtomStr, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !23
  %161 = getelementptr inbounds %struct.PropertyStr, ptr %160, i32 0, i32 7
  %162 = load double, ptr %161, align 8, !tbaa !24
  store double %162, ptr %12, align 8, !tbaa !20
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.AtomStr, ptr %163, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !11
  %166 = getelementptr inbounds %struct.DynamicStr, ptr %165, i32 0, i32 5
  %167 = getelementptr inbounds %struct.InteractionEventStr, ptr %166, i32 0, i32 6
  %168 = load i32, ptr %167, align 4, !tbaa !27
  switch i32 %168, label %170 [
    i32 0, label %169
  ]

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

170:                                              ; preds = %1
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 779)
  call void @exit(i32 noundef 1) #9
  unreachable

172:                                              ; preds = %169
  %173 = load double, ptr %6, align 8, !tbaa !20
  %174 = load i32, ptr %3, align 4, !tbaa !9
  %175 = sitofp i32 %174 to double
  %176 = load double, ptr %6, align 8, !tbaa !20
  %177 = load double, ptr %6, align 8, !tbaa !20
  %178 = load double, ptr %7, align 8, !tbaa !20
  %179 = fmul double 2.000000e+00, %178
  %180 = load double, ptr %11, align 8, !tbaa !20
  %181 = fmul double %179, %180
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.AtomStr, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !23
  %185 = getelementptr inbounds %struct.PropertyStr, ptr %184, i32 0, i32 7
  %186 = load double, ptr %185, align 8, !tbaa !24
  %187 = fdiv double %181, %186
  %188 = fneg double %187
  %189 = call double @llvm.fmuladd.f64(double %176, double %177, double %188)
  %190 = call double @sqrt(double noundef %189) #8
  %191 = fmul double %175, %190
  %192 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %173, double %191)
  %193 = load double, ptr %7, align 8, !tbaa !20
  %194 = fdiv double %192, %193
  store double %194, ptr %10, align 8, !tbaa !20
  %195 = load double, ptr %10, align 8, !tbaa !20
  %196 = call i1 @llvm.is.fpclass.f64(double %195, i32 3)
  %197 = xor i1 %196, true
  %198 = xor i1 %197, true
  %199 = zext i1 %198 to i32
  %200 = sext i32 %199 to i64
  %201 = call i64 @llvm.expect.i64(i64 %200, i64 0)
  %202 = icmp ne i64 %201, 0
  br i1 %202, label %203, label %205

203:                                              ; preds = %172
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 787)
  call void @exit(i32 noundef 1) #9
  unreachable

205:                                              ; preds = %172
  %206 = load double, ptr %10, align 8, !tbaa !20
  %207 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 1
  %208 = load double, ptr %207, align 8, !tbaa !20
  %209 = fmul double %206, %208
  %210 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  store double %209, ptr %210, align 8, !tbaa !20
  %211 = load double, ptr %10, align 8, !tbaa !20
  %212 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 2
  %213 = load double, ptr %212, align 16, !tbaa !20
  %214 = fmul double %211, %213
  %215 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  store double %214, ptr %215, align 16, !tbaa !20
  %216 = load double, ptr %10, align 8, !tbaa !20
  %217 = getelementptr inbounds [4 x double], ptr %8, i64 0, i64 3
  %218 = load double, ptr %217, align 8, !tbaa !20
  %219 = fmul double %216, %218
  %220 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  store double %219, ptr %220, align 8, !tbaa !20
  %221 = load ptr, ptr %13, align 8, !tbaa !5
  %222 = getelementptr inbounds double, ptr %221, i64 1
  %223 = load double, ptr %222, align 8, !tbaa !20
  %224 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  %225 = load double, ptr %224, align 8, !tbaa !20
  %226 = fadd double %223, %225
  %227 = load ptr, ptr %2, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.AtomStr, ptr %227, i32 0, i32 1
  %229 = load ptr, ptr %228, align 8, !tbaa !11
  %230 = getelementptr inbounds %struct.DynamicStr, ptr %229, i32 0, i32 2
  %231 = getelementptr inbounds [4 x double], ptr %230, i64 0, i64 1
  store double %226, ptr %231, align 8, !tbaa !20
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  %233 = getelementptr inbounds double, ptr %232, i64 2
  %234 = load double, ptr %233, align 8, !tbaa !20
  %235 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  %236 = load double, ptr %235, align 16, !tbaa !20
  %237 = fadd double %234, %236
  %238 = load ptr, ptr %2, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.AtomStr, ptr %238, i32 0, i32 1
  %240 = load ptr, ptr %239, align 8, !tbaa !11
  %241 = getelementptr inbounds %struct.DynamicStr, ptr %240, i32 0, i32 2
  %242 = getelementptr inbounds [4 x double], ptr %241, i64 0, i64 2
  store double %237, ptr %242, align 8, !tbaa !20
  %243 = load ptr, ptr %13, align 8, !tbaa !5
  %244 = getelementptr inbounds double, ptr %243, i64 3
  %245 = load double, ptr %244, align 8, !tbaa !20
  %246 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  %247 = load double, ptr %246, align 8, !tbaa !20
  %248 = fadd double %245, %247
  %249 = load ptr, ptr %2, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.AtomStr, ptr %249, i32 0, i32 1
  %251 = load ptr, ptr %250, align 8, !tbaa !11
  %252 = getelementptr inbounds %struct.DynamicStr, ptr %251, i32 0, i32 2
  %253 = getelementptr inbounds [4 x double], ptr %252, i64 0, i64 3
  store double %248, ptr %253, 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 32, 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 16}
!22 = !{!"SphObstStr", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!23 = !{!12, !6, i64 0}
!24 = !{!25, !19, i64 72}
!25 = !{!"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, !26, i64 104, !6, i64 120, !6, i64 128}
!26 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!27 = !{!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.SphObstStr = type { i32, i32, ptr, ptr }

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

; Function Attrs: nounwind uwtable
define dso_local void @SphObstEvent(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, -1000
  %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 @SphObstObj, i64 16), 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 !21
  %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 = fsub double %8, %18
  %24 = fsub double %10, %20
  %25 = fsub double %12, %22
  %26 = getelementptr inbounds i8, ptr %3, i64 56
  %27 = getelementptr inbounds i8, ptr %3, i64 64
  %28 = getelementptr inbounds i8, ptr %3, i64 72
  %29 = getelementptr inbounds i8, ptr %3, i64 172
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %cond = icmp eq i32 %30, 0
  br i1 %cond, label %31, label %52

31:                                               ; preds = %1
  %32 = load ptr, ptr %0, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %32, i64 72
  %34 = load double, ptr %28, align 8, !tbaa !18
  %35 = load double, ptr %26, align 8, !tbaa !18
  %36 = load double, ptr %27, align 8, !tbaa !18
  %37 = fmul double %24, %36
  %38 = tail call double @llvm.fmuladd.f64(double %23, double %35, double %37)
  %39 = tail call double @llvm.fmuladd.f64(double %25, double %34, double %38)
  %40 = fmul double %24, %24
  %41 = tail call double @llvm.fmuladd.f64(double %23, double %23, double %40)
  %42 = tail call double @llvm.fmuladd.f64(double %25, double %25, double %41)
  %43 = fmul double %42, 2.000000e+00
  %44 = load double, ptr %33, align 8, !tbaa !24
  %45 = fmul double %43, -0.000000e+00
  %46 = fdiv double %45, %44
  %47 = tail call double @llvm.fmuladd.f64(double %39, double %39, double %46)
  %48 = tail call double @sqrt(double noundef %47) #5
  %49 = tail call double @llvm.fmuladd.f64(double %39, double -1.000000e+00, double %48)
  %50 = fdiv double %49, %42
  %51 = fcmp uno double %50, 0.000000e+00
  br i1 %51, label %54, label %56, !prof !27

52:                                               ; preds = %1
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef nonnull @.str.1, i32 noundef 779)
  tail call void @exit(i32 noundef 1) #6
  unreachable

54:                                               ; preds = %31
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.1, i32 noundef 787)
  tail call void @exit(i32 noundef 1) #6
  unreachable

56:                                               ; preds = %31
  %57 = fmul double %23, %50
  %58 = fmul double %24, %50
  %59 = fmul double %25, %50
  %60 = load double, ptr %26, align 8, !tbaa !18
  %61 = fadd double %57, %60
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 56
  store double %61, ptr %63, align 8, !tbaa !18
  %64 = load double, ptr %27, align 8, !tbaa !18
  %65 = fadd double %58, %64
  %66 = getelementptr inbounds i8, ptr %62, i64 64
  store double %65, ptr %66, align 8, !tbaa !18
  %67 = load double, ptr %28, align 8, !tbaa !18
  %68 = fadd double %59, %67
  %69 = getelementptr inbounds i8, ptr %62, i64 72
  store double %68, ptr %69, 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 = { nounwind }
attributes #6 = { 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, !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 16}
!20 = !{!"SphObstStr", !13, i64 0, !13, i64 4, !7, i64 8, !7, i64 16}
!21 = !{!7, !7, i64 0}
!22 = !{!11, !13, i64 172}
!23 = !{!6, !7, i64 0}
!24 = !{!25, !17, i64 72}
!25 = !{!"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, !26, i64 104, !7, i64 120, !7, i64 128}
!26 = !{!"AtomSeqStr", !13, i64 0, !13, i64 4, !13, i64 8}
!27 = !{!"branch_weights", !"expected", i32 1, i32 2000}


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