; 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.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 }

@targetpackfrac = external dso_local global double, align 8
@composition = external dso_local global double, align 8
@sizeratio = external dso_local global double, align 8
@growthspeed = external dso_local global double, align 8
@maxt = external dso_local global double, align 8
@particles = external dso_local global [100000 x %struct.sparticle], align 16
@xsize = external dso_local global double, align 8
@ysize = external dso_local global double, align 8
@zsize = external dso_local global double, align 8
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@cxsize = external dso_local global double, align 8
@cysize = external dso_local global double, align 8
@czsize = external dso_local global double, align 8
@celllist = external dso_local global [75 x [75 x [75 x ptr]]], align 16

; 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: nounwind uwtable
declare dso_local double @genrand_real2() #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @randomparticles() #1 {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %8 = load double, ptr @composition, align 8, !tbaa !5
  store double %8, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %9 = load double, ptr @sizeratio, align 8, !tbaa !5
  store double %9, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %10 = load double, ptr %1, align 8, !tbaa !5
  %11 = load double, ptr %1, align 8, !tbaa !5
  %12 = fsub double 1.000000e+00, %11
  %13 = load double, ptr %2, align 8, !tbaa !5
  %14 = fmul double %12, %13
  %15 = load double, ptr %2, align 8, !tbaa !5
  %16 = fmul double %14, %15
  %17 = load double, ptr %2, align 8, !tbaa !5
  %18 = call double @llvm.fmuladd.f64(double %16, double %17, double %10)
  %19 = fmul double 0x40E990FC14F85A34, %18
  %20 = load double, ptr @targetpackfrac, align 8, !tbaa !5
  %21 = fdiv double %19, %20
  store double %21, ptr %3, align 8, !tbaa !5
  %22 = load double, ptr %3, align 8, !tbaa !5
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, double noundef %22)
  %24 = load double, ptr %3, align 8, !tbaa !5
  %25 = call double @cbrt(double noundef %24) #7
  store double %25, ptr @xsize, align 8, !tbaa !5
  %26 = load double, ptr @xsize, align 8, !tbaa !5
  store double %26, ptr @ysize, align 8, !tbaa !5
  %27 = load double, ptr @ysize, align 8, !tbaa !5
  store double %27, ptr @zsize, align 8, !tbaa !5
  call void @initcelllist()
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %44, %0
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = icmp slt i32 %29, 100000
  br i1 %30, label %31, label %47

31:                                               ; preds = %28
  %32 = load i32, ptr %4, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %33
  %35 = getelementptr inbounds %struct.sparticle, ptr %34, i32 0, i32 0
  store double 0.000000e+00, ptr %35, align 16, !tbaa !11
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.sparticle, ptr %38, i32 0, i32 1
  store double 0.000000e+00, ptr %39, align 8, !tbaa !14
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.sparticle, ptr %42, i32 0, i32 2
  store double 0.000000e+00, ptr %43, align 16, !tbaa !15
  br label %44

44:                                               ; preds = %31
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %4, align 4, !tbaa !9
  br label %28, !llvm.loop !16

47:                                               ; preds = %28
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %256, %47
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 100000
  br i1 %50, label %51, label %259

51:                                               ; preds = %48
  %52 = load i32, ptr %4, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %53
  store ptr %54, ptr %5, align 8, !tbaa !18
  %55 = load ptr, ptr %5, align 8, !tbaa !18
  %56 = getelementptr inbounds %struct.sparticle, ptr %55, i32 0, i32 14
  store double 1.000000e+00, ptr %56, align 8, !tbaa !19
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = sitofp i32 %57 to double
  %59 = load double, ptr %1, align 8, !tbaa !5
  %60 = call double @llvm.fmuladd.f64(double %59, double 1.000000e+05, double -1.000000e-08)
  %61 = fcmp oge double %58, %60
  br i1 %61, label %62, label %66

62:                                               ; preds = %51
  %63 = load double, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !18
  %65 = getelementptr inbounds %struct.sparticle, ptr %64, i32 0, i32 14
  store double %63, ptr %65, align 8, !tbaa !19
  br label %66

66:                                               ; preds = %62, %51
  %67 = load ptr, ptr %5, align 8, !tbaa !18
  %68 = getelementptr inbounds %struct.sparticle, ptr %67, i32 0, i32 14
  %69 = load double, ptr %68, align 8, !tbaa !19
  %70 = fmul double %69, 5.000000e-01
  store double %70, ptr %68, align 8, !tbaa !19
  %71 = load ptr, ptr %5, align 8, !tbaa !18
  %72 = getelementptr inbounds %struct.sparticle, ptr %71, i32 0, i32 14
  %73 = load double, ptr %72, align 8, !tbaa !19
  %74 = fmul double 5.000000e-01, %73
  %75 = load ptr, ptr %5, align 8, !tbaa !18
  %76 = getelementptr inbounds %struct.sparticle, ptr %75, i32 0, i32 13
  store double %74, ptr %76, align 8, !tbaa !20
  %77 = load ptr, ptr %5, align 8, !tbaa !18
  %78 = getelementptr inbounds %struct.sparticle, ptr %77, i32 0, i32 15
  store double 1.000000e+00, ptr %78, align 8, !tbaa !21
  %79 = load ptr, ptr %5, align 8, !tbaa !18
  %80 = getelementptr inbounds %struct.sparticle, ptr %79, i32 0, i32 28
  store i8 0, ptr %80, align 4, !tbaa !22
  %81 = load ptr, ptr %5, align 8, !tbaa !18
  %82 = getelementptr inbounds %struct.sparticle, ptr %81, i32 0, i32 14
  %83 = load double, ptr %82, align 8, !tbaa !19
  %84 = fcmp olt double %83, 5.000000e-01
  br i1 %84, label %85, label %88

85:                                               ; preds = %66
  %86 = load ptr, ptr %5, align 8, !tbaa !18
  %87 = getelementptr inbounds %struct.sparticle, ptr %86, i32 0, i32 28
  store i8 1, ptr %87, align 4, !tbaa !22
  br label %88

88:                                               ; preds = %85, %66
  %89 = load i32, ptr %4, align 4, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !18
  %91 = getelementptr inbounds %struct.sparticle, ptr %90, i32 0, i32 27
  store i32 %89, ptr %91, align 8, !tbaa !23
  %92 = load double, ptr @growthspeed, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !18
  %94 = getelementptr inbounds %struct.sparticle, ptr %93, i32 0, i32 13
  %95 = load double, ptr %94, align 8, !tbaa !20
  %96 = fmul double %92, %95
  %97 = load ptr, ptr %5, align 8, !tbaa !18
  %98 = getelementptr inbounds %struct.sparticle, ptr %97, i32 0, i32 9
  store double %96, ptr %98, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %99 = load ptr, ptr %5, align 8, !tbaa !18
  %100 = getelementptr inbounds %struct.sparticle, ptr %99, i32 0, i32 14
  %101 = load double, ptr %100, align 8, !tbaa !19
  %102 = load ptr, ptr %5, align 8, !tbaa !18
  %103 = getelementptr inbounds %struct.sparticle, ptr %102, i32 0, i32 13
  %104 = load double, ptr %103, align 8, !tbaa !20
  %105 = fsub double %101, %104
  %106 = load ptr, ptr %5, align 8, !tbaa !18
  %107 = getelementptr inbounds %struct.sparticle, ptr %106, i32 0, i32 9
  %108 = load double, ptr %107, align 8, !tbaa !24
  %109 = fdiv double %105, %108
  store double %109, ptr %6, align 8, !tbaa !5
  %110 = load double, ptr %6, align 8, !tbaa !5
  %111 = fcmp olt double %110, 0.000000e+00
  br i1 %111, label %112, label %114

112:                                              ; preds = %88
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %114

114:                                              ; preds = %112, %88
  %115 = load double, ptr @maxt, align 8, !tbaa !5
  %116 = fcmp olt double %115, 0.000000e+00
  br i1 %116, label %121, label %117

117:                                              ; preds = %114
  %118 = load double, ptr @maxt, align 8, !tbaa !5
  %119 = load double, ptr %6, align 8, !tbaa !5
  %120 = fcmp ogt double %118, %119
  br i1 %120, label %121, label %123

121:                                              ; preds = %117, %114
  %122 = load double, ptr %6, align 8, !tbaa !5
  store double %122, ptr @maxt, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %121, %117
  br label %124

124:                                              ; preds = %164, %123
  %125 = call double @genrand_real2()
  %126 = load double, ptr @xsize, align 8, !tbaa !5
  %127 = fmul double %125, %126
  %128 = load ptr, ptr %5, align 8, !tbaa !18
  %129 = getelementptr inbounds %struct.sparticle, ptr %128, i32 0, i32 0
  store double %127, ptr %129, align 8, !tbaa !11
  %130 = call double @genrand_real2()
  %131 = load double, ptr @ysize, align 8, !tbaa !5
  %132 = fmul double %130, %131
  %133 = load ptr, ptr %5, align 8, !tbaa !18
  %134 = getelementptr inbounds %struct.sparticle, ptr %133, i32 0, i32 1
  store double %132, ptr %134, align 8, !tbaa !14
  %135 = call double @genrand_real2()
  %136 = load double, ptr @zsize, align 8, !tbaa !5
  %137 = fmul double %135, %136
  %138 = load ptr, ptr %5, align 8, !tbaa !18
  %139 = getelementptr inbounds %struct.sparticle, ptr %138, i32 0, i32 2
  store double %137, ptr %139, align 8, !tbaa !15
  %140 = load ptr, ptr %5, align 8, !tbaa !18
  %141 = getelementptr inbounds %struct.sparticle, ptr %140, i32 0, i32 0
  %142 = load double, ptr %141, align 8, !tbaa !11
  %143 = load double, ptr @cxsize, align 8, !tbaa !5
  %144 = fdiv double %142, %143
  %145 = fptoui double %144 to i8
  %146 = load ptr, ptr %5, align 8, !tbaa !18
  %147 = getelementptr inbounds %struct.sparticle, ptr %146, i32 0, i32 17
  store i8 %145, ptr %147, align 1, !tbaa !25
  %148 = load ptr, ptr %5, align 8, !tbaa !18
  %149 = getelementptr inbounds %struct.sparticle, ptr %148, i32 0, i32 1
  %150 = load double, ptr %149, align 8, !tbaa !14
  %151 = load double, ptr @cysize, align 8, !tbaa !5
  %152 = fdiv double %150, %151
  %153 = fptoui double %152 to i8
  %154 = load ptr, ptr %5, align 8, !tbaa !18
  %155 = getelementptr inbounds %struct.sparticle, ptr %154, i32 0, i32 18
  store i8 %153, ptr %155, align 2, !tbaa !26
  %156 = load ptr, ptr %5, align 8, !tbaa !18
  %157 = getelementptr inbounds %struct.sparticle, ptr %156, i32 0, i32 2
  %158 = load double, ptr %157, align 8, !tbaa !15
  %159 = load double, ptr @czsize, align 8, !tbaa !5
  %160 = fdiv double %158, %159
  %161 = fptoui double %160 to i8
  %162 = load ptr, ptr %5, align 8, !tbaa !18
  %163 = getelementptr inbounds %struct.sparticle, ptr %162, i32 0, i32 19
  store i8 %161, ptr %163, align 1, !tbaa !27
  br label %164

164:                                              ; preds = %124
  %165 = load ptr, ptr %5, align 8, !tbaa !18
  %166 = call i32 @overlaplist(ptr noundef %165, i32 noundef 0)
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %124, label %168, !llvm.loop !28

168:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %169 = load ptr, ptr %5, align 8, !tbaa !18
  %170 = getelementptr inbounds %struct.sparticle, ptr %169, i32 0, i32 15
  %171 = load double, ptr %170, align 8, !tbaa !21
  %172 = call double @sqrt(double noundef %171) #6
  %173 = fdiv double 1.000000e+00, %172
  store double %173, ptr %7, align 8, !tbaa !5
  %174 = load ptr, ptr %5, align 8, !tbaa !18
  %175 = getelementptr inbounds %struct.sparticle, ptr %174, i32 0, i32 0
  %176 = load double, ptr %175, align 8, !tbaa !11
  %177 = load ptr, ptr %5, align 8, !tbaa !18
  %178 = getelementptr inbounds %struct.sparticle, ptr %177, i32 0, i32 6
  store double %176, ptr %178, align 8, !tbaa !29
  %179 = load ptr, ptr %5, align 8, !tbaa !18
  %180 = getelementptr inbounds %struct.sparticle, ptr %179, i32 0, i32 1
  %181 = load double, ptr %180, align 8, !tbaa !14
  %182 = load ptr, ptr %5, align 8, !tbaa !18
  %183 = getelementptr inbounds %struct.sparticle, ptr %182, i32 0, i32 7
  store double %181, ptr %183, align 8, !tbaa !30
  %184 = load ptr, ptr %5, align 8, !tbaa !18
  %185 = getelementptr inbounds %struct.sparticle, ptr %184, i32 0, i32 2
  %186 = load double, ptr %185, align 8, !tbaa !15
  %187 = load ptr, ptr %5, align 8, !tbaa !18
  %188 = getelementptr inbounds %struct.sparticle, ptr %187, i32 0, i32 8
  store double %186, ptr %188, align 8, !tbaa !31
  %189 = call double @genrand_real2()
  %190 = fsub double %189, 5.000000e-01
  %191 = load double, ptr %7, align 8, !tbaa !5
  %192 = fdiv double %190, %191
  %193 = load ptr, ptr %5, align 8, !tbaa !18
  %194 = getelementptr inbounds %struct.sparticle, ptr %193, i32 0, i32 3
  store double %192, ptr %194, align 8, !tbaa !32
  %195 = call double @genrand_real2()
  %196 = fsub double %195, 5.000000e-01
  %197 = load double, ptr %7, align 8, !tbaa !5
  %198 = fdiv double %196, %197
  %199 = load ptr, ptr %5, align 8, !tbaa !18
  %200 = getelementptr inbounds %struct.sparticle, ptr %199, i32 0, i32 4
  store double %198, ptr %200, align 8, !tbaa !33
  %201 = call double @genrand_real2()
  %202 = fsub double %201, 5.000000e-01
  %203 = load double, ptr %7, align 8, !tbaa !5
  %204 = fdiv double %202, %203
  %205 = load ptr, ptr %5, align 8, !tbaa !18
  %206 = getelementptr inbounds %struct.sparticle, ptr %205, i32 0, i32 5
  store double %204, ptr %206, align 8, !tbaa !34
  %207 = load ptr, ptr %5, align 8, !tbaa !18
  %208 = getelementptr inbounds %struct.sparticle, ptr %207, i32 0, i32 12
  store double 0.000000e+00, ptr %208, align 8, !tbaa !35
  %209 = load ptr, ptr %5, align 8, !tbaa !18
  %210 = getelementptr inbounds %struct.sparticle, ptr %209, i32 0, i32 17
  %211 = load i8, ptr %210, align 1, !tbaa !25
  %212 = zext i8 %211 to i64
  %213 = getelementptr inbounds [75 x [75 x [75 x ptr]]], ptr @celllist, i64 0, i64 %212
  %214 = load ptr, ptr %5, align 8, !tbaa !18
  %215 = getelementptr inbounds %struct.sparticle, ptr %214, i32 0, i32 18
  %216 = load i8, ptr %215, align 2, !tbaa !26
  %217 = zext i8 %216 to i64
  %218 = getelementptr inbounds [75 x [75 x ptr]], ptr %213, i64 0, i64 %217
  %219 = load ptr, ptr %5, align 8, !tbaa !18
  %220 = getelementptr inbounds %struct.sparticle, ptr %219, i32 0, i32 19
  %221 = load i8, ptr %220, align 1, !tbaa !27
  %222 = zext i8 %221 to i64
  %223 = getelementptr inbounds [75 x ptr], ptr %218, i64 0, i64 %222
  %224 = load ptr, ptr %223, align 8, !tbaa !18
  %225 = load ptr, ptr %5, align 8, !tbaa !18
  %226 = getelementptr inbounds %struct.sparticle, ptr %225, i32 0, i32 26
  store ptr %224, ptr %226, align 8, !tbaa !36
  %227 = load ptr, ptr %5, align 8, !tbaa !18
  %228 = getelementptr inbounds %struct.sparticle, ptr %227, i32 0, i32 26
  %229 = load ptr, ptr %228, align 8, !tbaa !36
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %237

231:                                              ; preds = %168
  %232 = load ptr, ptr %5, align 8, !tbaa !18
  %233 = load ptr, ptr %5, align 8, !tbaa !18
  %234 = getelementptr inbounds %struct.sparticle, ptr %233, i32 0, i32 26
  %235 = load ptr, ptr %234, align 8, !tbaa !36
  %236 = getelementptr inbounds %struct.sparticle, ptr %235, i32 0, i32 25
  store ptr %232, ptr %236, align 8, !tbaa !37
  br label %237

237:                                              ; preds = %231, %168
  %238 = load ptr, ptr %5, align 8, !tbaa !18
  %239 = load ptr, ptr %5, align 8, !tbaa !18
  %240 = getelementptr inbounds %struct.sparticle, ptr %239, i32 0, i32 17
  %241 = load i8, ptr %240, align 1, !tbaa !25
  %242 = zext i8 %241 to i64
  %243 = getelementptr inbounds [75 x [75 x [75 x ptr]]], ptr @celllist, i64 0, i64 %242
  %244 = load ptr, ptr %5, align 8, !tbaa !18
  %245 = getelementptr inbounds %struct.sparticle, ptr %244, i32 0, i32 18
  %246 = load i8, ptr %245, align 2, !tbaa !26
  %247 = zext i8 %246 to i64
  %248 = getelementptr inbounds [75 x [75 x ptr]], ptr %243, i64 0, i64 %247
  %249 = load ptr, ptr %5, align 8, !tbaa !18
  %250 = getelementptr inbounds %struct.sparticle, ptr %249, i32 0, i32 19
  %251 = load i8, ptr %250, align 1, !tbaa !27
  %252 = zext i8 %251 to i64
  %253 = getelementptr inbounds [75 x ptr], ptr %248, i64 0, i64 %252
  store ptr %238, ptr %253, align 8, !tbaa !18
  %254 = load ptr, ptr %5, align 8, !tbaa !18
  %255 = getelementptr inbounds %struct.sparticle, ptr %254, i32 0, i32 25
  store ptr null, ptr %255, align 8, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %256

256:                                              ; preds = %237
  %257 = load i32, ptr %4, align 4, !tbaa !9
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %4, align 4, !tbaa !9
  br label %48, !llvm.loop !38

259:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

; Function Attrs: nounwind willreturn memory(none)
declare double @cbrt(double noundef) #4

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @initcelllist() #1

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(none) "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 "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 #6 = { nounwind }
attributes #7 = { nounwind 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, !6, i64 0}
!6 = !{!"double", !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 0}
!12 = !{!"sparticle", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !7, i64 80, !7, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !7, i64 312, !7, i64 313, !7, i64 314, !7, i64 315, !10, i64 316, !10, i64 320, !10, i64 324, !13, i64 328, !10, i64 336, !13, i64 344, !13, i64 352, !10, i64 360, !7, i64 364}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !6, i64 296}
!20 = !{!12, !6, i64 288}
!21 = !{!12, !6, i64 304}
!22 = !{!12, !7, i64 364}
!23 = !{!12, !10, i64 360}
!24 = !{!12, !6, i64 72}
!25 = !{!12, !7, i64 313}
!26 = !{!12, !7, i64 314}
!27 = !{!12, !7, i64 315}
!28 = distinct !{!28, !17}
!29 = !{!12, !6, i64 48}
!30 = !{!12, !6, i64 56}
!31 = !{!12, !6, i64 64}
!32 = !{!12, !6, i64 24}
!33 = !{!12, !6, i64 32}
!34 = !{!12, !6, i64 40}
!35 = !{!12, !6, i64 280}
!36 = !{!12, !13, i64 352}
!37 = !{!12, !13, i64 344}
!38 = distinct !{!38, !17}


; 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.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 }

@targetpackfrac = external dso_local local_unnamed_addr global double, align 8
@composition = external dso_local local_unnamed_addr global double, align 8
@sizeratio = external dso_local local_unnamed_addr global double, align 8
@growthspeed = external dso_local local_unnamed_addr global double, align 8
@maxt = external dso_local local_unnamed_addr global double, align 8
@particles = external dso_local global [100000 x %struct.sparticle], align 16
@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
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@cxsize = external dso_local local_unnamed_addr global double, align 8
@cysize = external dso_local local_unnamed_addr global double, align 8
@czsize = external dso_local local_unnamed_addr global double, align 8
@celllist = external dso_local local_unnamed_addr global [75 x [75 x [75 x ptr]]], align 16

; Function Attrs: nounwind uwtable
declare dso_local double @genrand_real2() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @randomparticles() local_unnamed_addr #0 {
  %1 = load double, ptr @composition, align 8, !tbaa !5
  %2 = load double, ptr @sizeratio, align 8, !tbaa !5
  %3 = fsub double 1.000000e+00, %1
  %4 = fmul double %3, %2
  %5 = fmul double %2, %4
  %6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %1)
  %7 = fmul double %6, 0x40E990FC14F85A34
  %8 = load double, ptr @targetpackfrac, align 8, !tbaa !5
  %9 = fdiv double %7, %8
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, double noundef %9)
  %11 = tail call double @cbrt(double noundef %9) #6
  store double %11, ptr @xsize, align 8, !tbaa !5
  store double %11, ptr @ysize, align 8, !tbaa !5
  store double %11, ptr @zsize, align 8, !tbaa !5
  tail call void @initcelllist()
  br label %14

.preheader:                                       ; preds = %14
  %12 = tail call double @llvm.fmuladd.f64(double %1, double 1.000000e+05, double -1.000000e-08)
  %13 = fmul double %2, 5.000000e-01
  br label %23

14:                                               ; preds = %14, %0
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next.7, %14 ]
  %15 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %15, i8 0, i64 24, i1 false)
  %16 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %16, i8 0, i64 24, i1 false)
  %17 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.1
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %17, i8 0, i64 24, i1 false)
  %18 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.2
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %18, i8 0, i64 24, i1 false)
  %19 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.3
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %19, i8 0, i64 24, i1 false)
  %20 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.4
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %20, i8 0, i64 24, i1 false)
  %21 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.5
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %21, i8 0, i64 24, i1 false)
  %22 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv.next.6
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %exitcond.not.7 = icmp eq i64 %indvars.iv.next.7, 100000
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %22, i8 0, i64 24, i1 false)
  br i1 %exitcond.not.7, label %.preheader, label %14, !llvm.loop !9

23:                                               ; preds = %.preheader, %109
  %indvars.iv82 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next83, %109 ]
  %24 = getelementptr inbounds [100000 x %struct.sparticle], ptr @particles, i64 0, i64 %indvars.iv82
  %25 = getelementptr inbounds i8, ptr %24, i64 296
  %26 = trunc nuw nsw i64 %indvars.iv82 to i32
  %27 = uitofp nneg i32 %26 to double
  %28 = fcmp ugt double %12, %27
  %29 = select i1 %28, double 5.000000e-01, double %13
  store double %29, ptr %25, align 8, !tbaa !11
  %30 = fmul double %29, 5.000000e-01
  %31 = getelementptr inbounds i8, ptr %24, i64 288
  store double %30, ptr %31, align 16, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %24, i64 304
  store double 1.000000e+00, ptr %32, align 16, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %24, i64 364
  %34 = fcmp olt double %29, 5.000000e-01
  %storemerge = zext i1 %34 to i8
  store i8 %storemerge, ptr %33, align 4, !tbaa !17
  %35 = getelementptr inbounds i8, ptr %24, i64 360
  store i32 %26, ptr %35, align 8, !tbaa !18
  %36 = load double, ptr @growthspeed, align 8, !tbaa !5
  %37 = fmul double %30, %36
  %38 = getelementptr inbounds i8, ptr %24, i64 72
  store double %37, ptr %38, align 8, !tbaa !19
  %39 = fsub double %29, %30
  %40 = fdiv double %39, %37
  %41 = fcmp olt double %40, 0.000000e+00
  br i1 %41, label %42, label %44

42:                                               ; preds = %23
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %44

44:                                               ; preds = %42, %23
  %45 = load double, ptr @maxt, align 8, !tbaa !5
  %46 = fcmp olt double %45, 0.000000e+00
  %47 = fcmp ogt double %45, %40
  %or.cond = or i1 %46, %47
  br i1 %or.cond, label %48, label %49

48:                                               ; preds = %44
  store double %40, ptr @maxt, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %44, %48
  %50 = getelementptr inbounds i8, ptr %24, i64 8
  %51 = getelementptr inbounds i8, ptr %24, i64 16
  %52 = getelementptr inbounds i8, ptr %24, i64 313
  %53 = getelementptr inbounds i8, ptr %24, i64 314
  %54 = getelementptr inbounds i8, ptr %24, i64 315
  br label %55

55:                                               ; preds = %55, %49
  %56 = tail call double @genrand_real2()
  %57 = load double, ptr @xsize, align 8, !tbaa !5
  %58 = fmul double %56, %57
  store double %58, ptr %24, align 16, !tbaa !20
  %59 = tail call double @genrand_real2()
  %60 = load double, ptr @ysize, align 8, !tbaa !5
  %61 = fmul double %59, %60
  store double %61, ptr %50, align 8, !tbaa !21
  %62 = tail call double @genrand_real2()
  %63 = load double, ptr @zsize, align 8, !tbaa !5
  %64 = fmul double %62, %63
  store double %64, ptr %51, align 16, !tbaa !22
  %65 = load double, ptr %24, align 16, !tbaa !20
  %66 = load double, ptr @cxsize, align 8, !tbaa !5
  %67 = fdiv double %65, %66
  %68 = fptoui double %67 to i8
  store i8 %68, ptr %52, align 1, !tbaa !23
  %69 = load double, ptr %50, align 8, !tbaa !21
  %70 = load double, ptr @cysize, align 8, !tbaa !5
  %71 = fdiv double %69, %70
  %72 = fptoui double %71 to i8
  store i8 %72, ptr %53, align 2, !tbaa !24
  %73 = load double, ptr @czsize, align 8, !tbaa !5
  %74 = fdiv double %64, %73
  %75 = fptoui double %74 to i8
  store i8 %75, ptr %54, align 1, !tbaa !25
  %76 = tail call i32 @overlaplist(ptr noundef nonnull %24, i32 noundef 0)
  %.not = icmp eq i32 %76, 0
  br i1 %.not, label %77, label %55, !llvm.loop !26

77:                                               ; preds = %55
  %78 = load double, ptr %32, align 16, !tbaa !16
  %79 = tail call double @sqrt(double noundef %78) #7
  %80 = fdiv double 1.000000e+00, %79
  %81 = getelementptr inbounds i8, ptr %24, i64 48
  %82 = load <2 x double>, ptr %24, align 16, !tbaa !5
  store <2 x double> %82, ptr %81, align 16, !tbaa !5
  %83 = load double, ptr %51, align 16, !tbaa !22
  %84 = getelementptr inbounds i8, ptr %24, i64 64
  store double %83, ptr %84, align 16, !tbaa !27
  %85 = tail call double @genrand_real2()
  %86 = fadd double %85, -5.000000e-01
  %87 = fdiv double %86, %80
  %88 = getelementptr inbounds i8, ptr %24, i64 24
  store double %87, ptr %88, align 8, !tbaa !28
  %89 = tail call double @genrand_real2()
  %90 = fadd double %89, -5.000000e-01
  %91 = fdiv double %90, %80
  %92 = getelementptr inbounds i8, ptr %24, i64 32
  store double %91, ptr %92, align 16, !tbaa !29
  %93 = tail call double @genrand_real2()
  %94 = fadd double %93, -5.000000e-01
  %95 = fdiv double %94, %80
  %96 = getelementptr inbounds i8, ptr %24, i64 40
  store double %95, ptr %96, align 8, !tbaa !30
  %97 = getelementptr inbounds i8, ptr %24, i64 280
  store double 0.000000e+00, ptr %97, align 8, !tbaa !31
  %98 = load i8, ptr %52, align 1, !tbaa !23
  %99 = zext i8 %98 to i64
  %100 = load i8, ptr %53, align 2, !tbaa !24
  %101 = zext i8 %100 to i64
  %102 = load i8, ptr %54, align 1, !tbaa !25
  %103 = zext i8 %102 to i64
  %104 = getelementptr inbounds [75 x [75 x [75 x ptr]]], ptr @celllist, i64 0, i64 %99, i64 %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !32
  %106 = getelementptr inbounds i8, ptr %24, i64 352
  store ptr %105, ptr %106, align 16, !tbaa !33
  %.not74 = icmp eq ptr %105, null
  br i1 %.not74, label %109, label %107

107:                                              ; preds = %77
  %108 = getelementptr inbounds i8, ptr %105, i64 344
  store ptr %24, ptr %108, align 8, !tbaa !34
  br label %109

109:                                              ; preds = %107, %77
  store ptr %24, ptr %104, align 8, !tbaa !32
  %110 = getelementptr inbounds i8, ptr %24, i64 344
  store ptr null, ptr %110, align 8, !tbaa !34
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next83, 100000
  br i1 %exitcond85.not, label %111, label %23, !llvm.loop !35

111:                                              ; preds = %109
  ret void
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare double @cbrt(double noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @initcelllist() local_unnamed_addr #0

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

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn memory(none) }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 296}
!12 = !{!"sparticle", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !7, i64 80, !7, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !7, i64 312, !7, i64 313, !7, i64 314, !7, i64 315, !13, i64 316, !13, i64 320, !13, i64 324, !14, i64 328, !13, i64 336, !14, i64 344, !14, i64 352, !13, i64 360, !7, i64 364}
!13 = !{!"int", !7, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!12, !6, i64 288}
!16 = !{!12, !6, i64 304}
!17 = !{!12, !7, i64 364}
!18 = !{!12, !13, i64 360}
!19 = !{!12, !6, i64 72}
!20 = !{!12, !6, i64 0}
!21 = !{!12, !6, i64 8}
!22 = !{!12, !6, i64 16}
!23 = !{!12, !7, i64 313}
!24 = !{!12, !7, i64 314}
!25 = !{!12, !7, i64 315}
!26 = distinct !{!26, !10}
!27 = !{!12, !6, i64 64}
!28 = !{!12, !6, i64 24}
!29 = !{!12, !6, i64 32}
!30 = !{!12, !6, i64 40}
!31 = !{!12, !6, i64 280}
!32 = !{!14, !14, i64 0}
!33 = !{!12, !14, i64 352}
!34 = !{!12, !14, i64 344}
!35 = distinct !{!35, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass