; LLVM IR from FSmallenburg/EDMD :: Grow (mdgrow)

; 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.sevent = type { double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32 }
%struct.sparticle = type { double, double, double, double, double, double, double, double, double, double, [24 x ptr], i8, double, double, double, double, i8, i8, i8, i8, i32, i32, i32, ptr, i32, ptr, ptr, i32, i8 }

@time = external dso_local global double, align 8
@dvtot = external dso_local global double, align 8
@colcounter = external dso_local global i32, align 4
@xsize = external dso_local global double, align 8
@ysize = external dso_local global double, align 8
@zsize = external dso_local global double, align 8
@hx = external dso_local global double, align 8
@hy = external dso_local global double, align 8
@hz = external dso_local global double, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @update(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @removeevent(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @collision(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sevent, ptr %22, i32 0, i32 0
  %24 = load double, ptr %23, align 8, !tbaa !9
  store double %24, ptr @time, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sevent, ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !14
  store ptr %27, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.sevent, ptr %28, i32 0, i32 5
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  store ptr %30, ptr %4, align 8, !tbaa !5
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  call void @update(ptr noundef %31)
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  call void @removeevent(ptr noundef %32)
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.sevent, ptr %33, i32 0, i32 10
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.sparticle, ptr %36, i32 0, i32 24
  %38 = load i32, ptr %37, align 8, !tbaa !17
  %39 = icmp ne i32 %35, %38
  br i1 %39, label %40, label %42

40:                                               ; preds = %1
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  call void @findcollisions(ptr noundef %41)
  store i32 1, ptr %5, align 4
  br label %277

42:                                               ; preds = %1
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  call void @update(ptr noundef %43)
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.sparticle, ptr %44, i32 0, i32 24
  %46 = load i32, ptr %45, align 8, !tbaa !17
  %47 = add i32 %46, 1
  store i32 %47, ptr %45, align 8, !tbaa !17
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.sparticle, ptr %48, i32 0, i32 24
  %50 = load i32, ptr %49, align 8, !tbaa !17
  %51 = add i32 %50, 1
  store i32 %51, ptr %49, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sparticle, ptr %52, i32 0, i32 15
  %54 = load double, ptr %53, align 8, !tbaa !19
  store double %54, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.sparticle, ptr %55, i32 0, i32 13
  %57 = load double, ptr %56, align 8, !tbaa !20
  store double %57, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.sparticle, ptr %58, i32 0, i32 15
  %60 = load double, ptr %59, align 8, !tbaa !19
  store double %60, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.sparticle, ptr %61, i32 0, i32 13
  %63 = load double, ptr %62, align 8, !tbaa !20
  store double %63, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %64 = load double, ptr %7, align 8, !tbaa !13
  %65 = load double, ptr %9, align 8, !tbaa !13
  %66 = fadd double %64, %65
  store double %66, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %67 = load double, ptr %10, align 8, !tbaa !13
  %68 = fdiv double 1.000000e+00, %67
  store double %68, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.sparticle, ptr %69, i32 0, i32 0
  %71 = load double, ptr %70, align 8, !tbaa !21
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.sparticle, ptr %72, i32 0, i32 0
  %74 = load double, ptr %73, align 8, !tbaa !21
  %75 = fsub double %71, %74
  store double %75, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.sparticle, ptr %76, i32 0, i32 1
  %78 = load double, ptr %77, align 8, !tbaa !22
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sparticle, ptr %79, i32 0, i32 1
  %81 = load double, ptr %80, align 8, !tbaa !22
  %82 = fsub double %78, %81
  store double %82, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.sparticle, ptr %83, i32 0, i32 2
  %85 = load double, ptr %84, align 8, !tbaa !23
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.sparticle, ptr %86, i32 0, i32 2
  %88 = load double, ptr %87, align 8, !tbaa !23
  %89 = fsub double %85, %88
  store double %89, ptr %14, align 8, !tbaa !13
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.sparticle, ptr %90, i32 0, i32 16
  %92 = load i8, ptr %91, align 8, !tbaa !24
  %93 = icmp ne i8 %92, 0
  br i1 %93, label %94, label %149

94:                                               ; preds = %42
  %95 = load double, ptr %12, align 8, !tbaa !13
  %96 = load double, ptr @hx, align 8, !tbaa !13
  %97 = fcmp ogt double %95, %96
  br i1 %97, label %98, label %102

98:                                               ; preds = %94
  %99 = load double, ptr @xsize, align 8, !tbaa !13
  %100 = load double, ptr %12, align 8, !tbaa !13
  %101 = fsub double %100, %99
  store double %101, ptr %12, align 8, !tbaa !13
  br label %112

102:                                              ; preds = %94
  %103 = load double, ptr %12, align 8, !tbaa !13
  %104 = load double, ptr @hx, align 8, !tbaa !13
  %105 = fneg double %104
  %106 = fcmp olt double %103, %105
  br i1 %106, label %107, label %111

107:                                              ; preds = %102
  %108 = load double, ptr @xsize, align 8, !tbaa !13
  %109 = load double, ptr %12, align 8, !tbaa !13
  %110 = fadd double %109, %108
  store double %110, ptr %12, align 8, !tbaa !13
  br label %111

111:                                              ; preds = %107, %102
  br label %112

112:                                              ; preds = %111, %98
  %113 = load double, ptr %13, align 8, !tbaa !13
  %114 = load double, ptr @hy, align 8, !tbaa !13
  %115 = fcmp ogt double %113, %114
  br i1 %115, label %116, label %120

116:                                              ; preds = %112
  %117 = load double, ptr @ysize, align 8, !tbaa !13
  %118 = load double, ptr %13, align 8, !tbaa !13
  %119 = fsub double %118, %117
  store double %119, ptr %13, align 8, !tbaa !13
  br label %130

120:                                              ; preds = %112
  %121 = load double, ptr %13, align 8, !tbaa !13
  %122 = load double, ptr @hy, align 8, !tbaa !13
  %123 = fneg double %122
  %124 = fcmp olt double %121, %123
  br i1 %124, label %125, label %129

125:                                              ; preds = %120
  %126 = load double, ptr @ysize, align 8, !tbaa !13
  %127 = load double, ptr %13, align 8, !tbaa !13
  %128 = fadd double %127, %126
  store double %128, ptr %13, align 8, !tbaa !13
  br label %129

129:                                              ; preds = %125, %120
  br label %130

130:                                              ; preds = %129, %116
  %131 = load double, ptr %14, align 8, !tbaa !13
  %132 = load double, ptr @hz, align 8, !tbaa !13
  %133 = fcmp ogt double %131, %132
  br i1 %133, label %134, label %138

134:                                              ; preds = %130
  %135 = load double, ptr @zsize, align 8, !tbaa !13
  %136 = load double, ptr %14, align 8, !tbaa !13
  %137 = fsub double %136, %135
  store double %137, ptr %14, align 8, !tbaa !13
  br label %148

138:                                              ; preds = %130
  %139 = load double, ptr %14, align 8, !tbaa !13
  %140 = load double, ptr @hz, align 8, !tbaa !13
  %141 = fneg double %140
  %142 = fcmp olt double %139, %141
  br i1 %142, label %143, label %147

143:                                              ; preds = %138
  %144 = load double, ptr @zsize, align 8, !tbaa !13
  %145 = load double, ptr %14, align 8, !tbaa !13
  %146 = fadd double %145, %144
  store double %146, ptr %14, align 8, !tbaa !13
  br label %147

147:                                              ; preds = %143, %138
  br label %148

148:                                              ; preds = %147, %134
  br label %149

149:                                              ; preds = %148, %42
  %150 = load double, ptr %11, align 8, !tbaa !13
  %151 = load double, ptr %12, align 8, !tbaa !13
  %152 = fmul double %151, %150
  store double %152, ptr %12, align 8, !tbaa !13
  %153 = load double, ptr %11, align 8, !tbaa !13
  %154 = load double, ptr %13, align 8, !tbaa !13
  %155 = fmul double %154, %153
  store double %155, ptr %13, align 8, !tbaa !13
  %156 = load double, ptr %11, align 8, !tbaa !13
  %157 = load double, ptr %14, align 8, !tbaa !13
  %158 = fmul double %157, %156
  store double %158, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.sparticle, ptr %159, i32 0, i32 3
  %161 = load double, ptr %160, align 8, !tbaa !25
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.sparticle, ptr %162, i32 0, i32 3
  %164 = load double, ptr %163, align 8, !tbaa !25
  %165 = fsub double %161, %164
  store double %165, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.sparticle, ptr %166, i32 0, i32 4
  %168 = load double, ptr %167, align 8, !tbaa !26
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.sparticle, ptr %169, i32 0, i32 4
  %171 = load double, ptr %170, align 8, !tbaa !26
  %172 = fsub double %168, %171
  store double %172, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.sparticle, ptr %173, i32 0, i32 5
  %175 = load double, ptr %174, align 8, !tbaa !27
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.sparticle, ptr %176, i32 0, i32 5
  %178 = load double, ptr %177, align 8, !tbaa !27
  %179 = fsub double %175, %178
  store double %179, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.sparticle, ptr %180, i32 0, i32 9
  %182 = load double, ptr %181, align 8, !tbaa !28
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.sparticle, ptr %183, i32 0, i32 9
  %185 = load double, ptr %184, align 8, !tbaa !28
  %186 = fadd double %182, %185
  store double %186, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %187 = load double, ptr %12, align 8, !tbaa !13
  %188 = load double, ptr %15, align 8, !tbaa !13
  %189 = load double, ptr %13, align 8, !tbaa !13
  %190 = load double, ptr %16, align 8, !tbaa !13
  %191 = fmul double %189, %190
  %192 = call double @llvm.fmuladd.f64(double %187, double %188, double %191)
  %193 = load double, ptr %14, align 8, !tbaa !13
  %194 = load double, ptr %17, align 8, !tbaa !13
  %195 = call double @llvm.fmuladd.f64(double %193, double %194, double %192)
  %196 = load double, ptr %18, align 8, !tbaa !13
  %197 = fsub double %195, %196
  store double %197, ptr %19, align 8, !tbaa !13
  %198 = load double, ptr %6, align 8, !tbaa !13
  %199 = load double, ptr %8, align 8, !tbaa !13
  %200 = fadd double %198, %199
  %201 = fdiv double 1.000000e+00, %200
  %202 = load double, ptr %19, align 8, !tbaa !13
  %203 = fmul double %202, %201
  store double %203, ptr %19, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %204 = load double, ptr %19, align 8, !tbaa !13
  %205 = fmul double 2.000000e+00, %204
  %206 = load double, ptr %8, align 8, !tbaa !13
  %207 = fmul double %205, %206
  store double %207, ptr %20, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %208 = load double, ptr %19, align 8, !tbaa !13
  %209 = fmul double 2.000000e+00, %208
  %210 = load double, ptr %6, align 8, !tbaa !13
  %211 = fmul double %209, %210
  store double %211, ptr %21, align 8, !tbaa !13
  %212 = load double, ptr %6, align 8, !tbaa !13
  %213 = fmul double 2.000000e+00, %212
  %214 = load double, ptr %8, align 8, !tbaa !13
  %215 = fmul double %213, %214
  %216 = load double, ptr %19, align 8, !tbaa !13
  %217 = load double, ptr @dvtot, align 8, !tbaa !13
  %218 = call double @llvm.fmuladd.f64(double %215, double %216, double %217)
  store double %218, ptr @dvtot, align 8, !tbaa !13
  %219 = load double, ptr %20, align 8, !tbaa !13
  %220 = load double, ptr %12, align 8, !tbaa !13
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.sparticle, ptr %221, i32 0, i32 3
  %223 = load double, ptr %222, align 8, !tbaa !25
  %224 = fneg double %219
  %225 = call double @llvm.fmuladd.f64(double %224, double %220, double %223)
  store double %225, ptr %222, align 8, !tbaa !25
  %226 = load double, ptr %20, align 8, !tbaa !13
  %227 = load double, ptr %13, align 8, !tbaa !13
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.sparticle, ptr %228, i32 0, i32 4
  %230 = load double, ptr %229, align 8, !tbaa !26
  %231 = fneg double %226
  %232 = call double @llvm.fmuladd.f64(double %231, double %227, double %230)
  store double %232, ptr %229, align 8, !tbaa !26
  %233 = load double, ptr %20, align 8, !tbaa !13
  %234 = load double, ptr %14, align 8, !tbaa !13
  %235 = load ptr, ptr %3, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.sparticle, ptr %235, i32 0, i32 5
  %237 = load double, ptr %236, align 8, !tbaa !27
  %238 = fneg double %233
  %239 = call double @llvm.fmuladd.f64(double %238, double %234, double %237)
  store double %239, ptr %236, align 8, !tbaa !27
  %240 = load double, ptr %21, align 8, !tbaa !13
  %241 = load double, ptr %12, align 8, !tbaa !13
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.sparticle, ptr %242, i32 0, i32 3
  %244 = load double, ptr %243, align 8, !tbaa !25
  %245 = call double @llvm.fmuladd.f64(double %240, double %241, double %244)
  store double %245, ptr %243, align 8, !tbaa !25
  %246 = load double, ptr %21, align 8, !tbaa !13
  %247 = load double, ptr %13, align 8, !tbaa !13
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.sparticle, ptr %248, i32 0, i32 4
  %250 = load double, ptr %249, align 8, !tbaa !26
  %251 = call double @llvm.fmuladd.f64(double %246, double %247, double %250)
  store double %251, ptr %249, align 8, !tbaa !26
  %252 = load double, ptr %21, align 8, !tbaa !13
  %253 = load double, ptr %14, align 8, !tbaa !13
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.sparticle, ptr %254, i32 0, i32 5
  %256 = load double, ptr %255, align 8, !tbaa !27
  %257 = call double @llvm.fmuladd.f64(double %252, double %253, double %256)
  store double %257, ptr %255, align 8, !tbaa !27
  %258 = load i32, ptr @colcounter, align 4, !tbaa !29
  %259 = add i32 %258, 1
  store i32 %259, ptr @colcounter, align 4, !tbaa !29
  %260 = load ptr, ptr %4, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.sparticle, ptr %260, i32 0, i32 23
  %262 = load ptr, ptr %261, align 8, !tbaa !30
  %263 = icmp ne ptr %262, null
  br i1 %263, label %264, label %274

264:                                              ; preds = %149
  %265 = load ptr, ptr %4, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.sparticle, ptr %265, i32 0, i32 23
  %267 = load ptr, ptr %266, align 8, !tbaa !30
  %268 = load ptr, ptr %2, align 8, !tbaa !5
  %269 = icmp ne ptr %267, %268
  br i1 %269, label %270, label %274

270:                                              ; preds = %264
  %271 = load ptr, ptr %4, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.sparticle, ptr %271, i32 0, i32 23
  %273 = load ptr, ptr %272, align 8, !tbaa !30
  call void @removeevent(ptr noundef %273)
  br label %274

274:                                              ; preds = %270, %264, %149
  %275 = load ptr, ptr %3, align 8, !tbaa !5
  call void @findcollisions(ptr noundef %275)
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  call void @findcollisions(ptr noundef %276)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  store i32 0, ptr %5, align 4
  br label %277

277:                                              ; preds = %274, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %278 = load i32, ptr %5, align 4
  switch i32 %278, label %280 [
    i32 0, label %279
    i32 1, label %279
  ]

279:                                              ; preds = %277, %277
  ret void

280:                                              ; preds = %277
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local void @findcollisions(ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"sevent", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !7, i64 64, !12, i64 68, !12, i64 72}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 32}
!15 = !{!10, !6, i64 40}
!16 = !{!10, !12, i64 72}
!17 = !{!18, !12, i64 336}
!18 = !{!"sparticle", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !7, i64 80, !7, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !7, i64 312, !7, i64 313, !7, i64 314, !7, i64 315, !12, i64 316, !12, i64 320, !12, i64 324, !6, i64 328, !12, i64 336, !6, i64 344, !6, i64 352, !12, i64 360, !7, i64 364}
!19 = !{!18, !11, i64 304}
!20 = !{!18, !11, i64 288}
!21 = !{!18, !11, i64 0}
!22 = !{!18, !11, i64 8}
!23 = !{!18, !11, i64 16}
!24 = !{!18, !7, i64 312}
!25 = !{!18, !11, i64 24}
!26 = !{!18, !11, i64 32}
!27 = !{!18, !11, i64 40}
!28 = !{!18, !11, i64 72}
!29 = !{!12, !12, i64 0}
!30 = !{!18, !6, i64 328}


; 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"

@time = external dso_local local_unnamed_addr global double, align 8
@dvtot = external dso_local local_unnamed_addr global double, align 8
@colcounter = external dso_local local_unnamed_addr global i32, align 4
@xsize = external dso_local local_unnamed_addr global double, align 8
@ysize = external dso_local local_unnamed_addr global double, align 8
@zsize = external dso_local local_unnamed_addr global double, align 8
@hx = external dso_local local_unnamed_addr global double, align 8
@hy = external dso_local local_unnamed_addr global double, align 8
@hz = external dso_local local_unnamed_addr global double, align 8

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

; Function Attrs: nounwind uwtable
declare dso_local void @update(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @removeevent(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @collision(ptr noundef %0) local_unnamed_addr #1 {
  %2 = load double, ptr %0, align 8, !tbaa !5
  store double %2, ptr @time, align 8, !tbaa !12
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = load ptr, ptr %3, align 8, !tbaa !13
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = load ptr, ptr %5, align 8, !tbaa !14
  tail call void @update(ptr noundef %4)
  tail call void @removeevent(ptr noundef nonnull %0)
  %7 = getelementptr inbounds i8, ptr %0, i64 72
  %8 = load i32, ptr %7, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %6, i64 336
  %10 = load i32, ptr %9, align 8, !tbaa !16
  %.not = icmp eq i32 %8, %10
  br i1 %.not, label %12, label %11

11:                                               ; preds = %1
  tail call void @findcollisions(ptr noundef %4)
  br label %139

12:                                               ; preds = %1
  tail call void @update(ptr noundef nonnull %6)
  %13 = getelementptr inbounds i8, ptr %4, i64 336
  %14 = load i32, ptr %13, align 8, !tbaa !16
  %15 = add i32 %14, 1
  store i32 %15, ptr %13, align 8, !tbaa !16
  %16 = load i32, ptr %9, align 8, !tbaa !16
  %17 = add i32 %16, 1
  store i32 %17, ptr %9, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %4, i64 304
  %19 = load double, ptr %18, align 8, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %4, i64 288
  %21 = load double, ptr %20, align 8, !tbaa !19
  %22 = getelementptr inbounds i8, ptr %6, i64 304
  %23 = load double, ptr %22, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %6, i64 288
  %25 = load double, ptr %24, align 8, !tbaa !19
  %26 = fadd double %21, %25
  %27 = fdiv double 1.000000e+00, %26
  %28 = load <2 x double>, ptr %4, align 8, !tbaa !12
  %29 = load <2 x double>, ptr %6, align 8, !tbaa !12
  %30 = fsub <2 x double> %28, %29
  %31 = getelementptr inbounds i8, ptr %4, i64 16
  %32 = load double, ptr %31, align 8, !tbaa !20
  %33 = getelementptr inbounds i8, ptr %6, i64 16
  %34 = load double, ptr %33, align 8, !tbaa !20
  %35 = fsub double %32, %34
  %36 = getelementptr inbounds i8, ptr %4, i64 312
  %37 = load i8, ptr %36, align 8, !tbaa !21
  %.not105 = icmp eq i8 %37, 0
  br i1 %.not105, label %80, label %38

38:                                               ; preds = %12
  %39 = load double, ptr @hx, align 8, !tbaa !12
  %40 = extractelement <2 x double> %30, i64 0
  %41 = fcmp ogt double %40, %39
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  %43 = load double, ptr @xsize, align 8, !tbaa !12
  %44 = fsub double %40, %43
  br label %51

45:                                               ; preds = %38
  %46 = fneg double %39
  %47 = fcmp olt double %40, %46
  br i1 %47, label %48, label %51

48:                                               ; preds = %45
  %49 = load double, ptr @xsize, align 8, !tbaa !12
  %50 = fadd double %40, %49
  br label %51

51:                                               ; preds = %45, %48, %42
  %.0 = phi double [ %44, %42 ], [ %50, %48 ], [ %40, %45 ]
  %52 = load double, ptr @hy, align 8, !tbaa !12
  %53 = extractelement <2 x double> %30, i64 1
  %54 = fcmp ogt double %53, %52
  br i1 %54, label %55, label %58

55:                                               ; preds = %51
  %56 = load double, ptr @ysize, align 8, !tbaa !12
  %57 = fsub double %53, %56
  br label %64

58:                                               ; preds = %51
  %59 = fneg double %52
  %60 = fcmp olt double %53, %59
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = load double, ptr @ysize, align 8, !tbaa !12
  %63 = fadd double %53, %62
  br label %64

64:                                               ; preds = %58, %61, %55
  %.092 = phi double [ %57, %55 ], [ %63, %61 ], [ %53, %58 ]
  %65 = load double, ptr @hz, align 8, !tbaa !12
  %66 = fcmp ogt double %35, %65
  br i1 %66, label %67, label %72

67:                                               ; preds = %64
  %68 = load double, ptr @zsize, align 8, !tbaa !12
  %69 = fsub double %35, %68
  %70 = insertelement <2 x double> poison, double %.0, i64 0
  %71 = insertelement <2 x double> %70, double %.092, i64 1
  br label %80

72:                                               ; preds = %64
  %73 = fneg double %65
  %74 = fcmp olt double %35, %73
  %75 = insertelement <2 x double> poison, double %.0, i64 0
  %76 = insertelement <2 x double> %75, double %.092, i64 1
  br i1 %74, label %77, label %80

77:                                               ; preds = %72
  %78 = load double, ptr @zsize, align 8, !tbaa !12
  %79 = fadd double %35, %78
  br label %80

80:                                               ; preds = %67, %77, %72, %12
  %.094 = phi double [ %69, %67 ], [ %79, %77 ], [ %35, %72 ], [ %35, %12 ]
  %81 = phi <2 x double> [ %71, %67 ], [ %76, %77 ], [ %76, %72 ], [ %30, %12 ]
  %82 = insertelement <2 x double> poison, double %27, i64 0
  %83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
  %84 = fmul <2 x double> %83, %81
  %85 = fmul double %27, %.094
  %86 = getelementptr inbounds i8, ptr %4, i64 24
  %87 = getelementptr inbounds i8, ptr %6, i64 24
  %88 = load double, ptr %87, align 8, !tbaa !22
  %89 = getelementptr inbounds i8, ptr %6, i64 32
  %90 = load double, ptr %89, align 8, !tbaa !23
  %91 = getelementptr inbounds i8, ptr %4, i64 40
  %92 = load double, ptr %91, align 8, !tbaa !24
  %93 = getelementptr inbounds i8, ptr %6, i64 40
  %94 = load double, ptr %93, align 8, !tbaa !24
  %95 = fsub double %92, %94
  %96 = getelementptr inbounds i8, ptr %4, i64 72
  %97 = load double, ptr %96, align 8, !tbaa !25
  %98 = getelementptr inbounds i8, ptr %6, i64 72
  %99 = load double, ptr %98, align 8, !tbaa !25
  %100 = fadd double %97, %99
  %101 = fadd double %19, %23
  %102 = fdiv double 1.000000e+00, %101
  %103 = fmul double %19, 2.000000e+00
  %104 = fmul double %103, %23
  %105 = load double, ptr @dvtot, align 8, !tbaa !12
  %106 = load <2 x double>, ptr %86, align 8, !tbaa !12
  %107 = extractelement <2 x double> %106, i64 0
  %108 = fsub double %107, %88
  %109 = extractelement <2 x double> %106, i64 1
  %110 = fsub double %109, %90
  %111 = extractelement <2 x double> %84, i64 1
  %112 = fmul double %111, %110
  %113 = extractelement <2 x double> %84, i64 0
  %114 = tail call double @llvm.fmuladd.f64(double %113, double %108, double %112)
  %115 = tail call double @llvm.fmuladd.f64(double %85, double %95, double %114)
  %116 = fsub double %115, %100
  %117 = fmul double %102, %116
  %118 = fmul double %117, 2.000000e+00
  %119 = fmul double %19, %118
  %120 = tail call double @llvm.fmuladd.f64(double %104, double %117, double %105)
  store double %120, ptr @dvtot, align 8, !tbaa !12
  %121 = fneg double %118
  %122 = fmul double %23, %121
  %123 = insertelement <2 x double> poison, double %122, i64 0
  %124 = shufflevector <2 x double> %123, <2 x double> poison, <2 x i32> zeroinitializer
  %125 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %124, <2 x double> %84, <2 x double> %106)
  store <2 x double> %125, ptr %86, align 8, !tbaa !12
  %126 = tail call double @llvm.fmuladd.f64(double %122, double %85, double %92)
  store double %126, ptr %91, align 8, !tbaa !24
  %127 = load <2 x double>, ptr %87, align 8, !tbaa !12
  %128 = insertelement <2 x double> poison, double %119, i64 0
  %129 = shufflevector <2 x double> %128, <2 x double> poison, <2 x i32> zeroinitializer
  %130 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %129, <2 x double> %84, <2 x double> %127)
  store <2 x double> %130, ptr %87, align 8, !tbaa !12
  %131 = load double, ptr %93, align 8, !tbaa !24
  %132 = tail call double @llvm.fmuladd.f64(double %119, double %85, double %131)
  store double %132, ptr %93, align 8, !tbaa !24
  %133 = load i32, ptr @colcounter, align 4, !tbaa !26
  %134 = add i32 %133, 1
  store i32 %134, ptr @colcounter, align 4, !tbaa !26
  %135 = getelementptr inbounds i8, ptr %6, i64 328
  %136 = load ptr, ptr %135, align 8, !tbaa !27
  %.not106 = icmp eq ptr %136, null
  %.not107 = icmp eq ptr %136, %0
  %or.cond = or i1 %.not106, %.not107
  br i1 %or.cond, label %138, label %137

137:                                              ; preds = %80
  tail call void @removeevent(ptr noundef nonnull %136)
  br label %138

138:                                              ; preds = %137, %80
  tail call void @findcollisions(ptr noundef nonnull %4)
  tail call void @findcollisions(ptr noundef nonnull %6)
  br label %139

139:                                              ; preds = %138, %11
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @findcollisions(ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 0}
!6 = !{!"sevent", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !8, i64 64, !11, i64 68, !11, i64 72}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !10, i64 40}
!15 = !{!6, !11, i64 72}
!16 = !{!17, !11, i64 336}
!17 = !{!"sparticle", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !8, i64 80, !8, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !8, i64 312, !8, i64 313, !8, i64 314, !8, i64 315, !11, i64 316, !11, i64 320, !11, i64 324, !10, i64 328, !11, i64 336, !10, i64 344, !10, i64 352, !11, i64 360, !8, i64 364}
!18 = !{!17, !7, i64 304}
!19 = !{!17, !7, i64 288}
!20 = !{!17, !7, i64 16}
!21 = !{!17, !8, i64 312}
!22 = !{!17, !7, i64 24}
!23 = !{!17, !7, i64 32}
!24 = !{!17, !7, i64 40}
!25 = !{!17, !7, i64 72}
!26 = !{!11, !11, i64 0}
!27 = !{!17, !10, i64 328}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass