; LLVM IR from Mithreindeir/VelocityRaptor :: VelocityRaptor/src (vrParticleSystem)

; 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.vrVec2 = type { float, float }
%struct.vrParticleSystem = type { ptr, float, float, float, float, float, float, float, %struct.vrVec2, ptr }
%struct.vrArray = type { ptr, i32, i32, i32, i32 }
%struct.vrParticle = type { %struct.vrVec2, %struct.vrVec2, %struct.vrVec2, %struct.vrVec2, %struct.vrVec2, float, float, float, float, float, float, float, %struct.vrColor }
%struct.vrColor = type { float, float, float }

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

declare <2 x float> @vrVect(float noundef, float noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

declare <2 x float> @vrScale(<2 x float>, float noundef) #1

declare <2 x float> @vrSub(<2 x float>, <2 x float>) #1

declare <2 x float> @vrAdd(<2 x float>, <2 x float>) #1

; Function Attrs: nounwind uwtable
define dso_local void @vrParticleSystemDoubleDensity(ptr noundef %0, float noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.vrVec2, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca %struct.vrVec2, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %struct.vrVec2, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca %struct.vrVec2, align 4
  %26 = alloca %struct.vrVec2, align 4
  %27 = alloca %struct.vrVec2, align 4
  %28 = alloca %struct.vrVec2, align 4
  %29 = alloca %struct.vrVec2, align 4
  %30 = alloca %struct.vrVec2, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store float -1.000000e+04, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store float -1.000000e+04, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %296, %2
  %32 = load i32, ptr %7, align 4, !tbaa !11
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.vrParticleSystem, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds %struct.vrArray, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !16
  %38 = icmp slt i32 %32, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %31
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %299

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.vrParticleSystem, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = getelementptr inbounds %struct.vrArray, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load i32, ptr %7, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %145, %40
  %51 = load i32, ptr %10, align 4, !tbaa !11
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.vrParticleSystem, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = getelementptr inbounds %struct.vrArray, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 8, !tbaa !16
  %57 = icmp slt i32 %51, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %50
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %148

59:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.vrParticleSystem, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = getelementptr inbounds %struct.vrArray, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  %65 = load i32, ptr %10, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds ptr, ptr %64, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  store ptr %68, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.vrParticle, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.vrParticle, ptr %71, i32 0, i32 0
  %73 = load <2 x float>, ptr %70, align 4
  %74 = load <2 x float>, ptr %72, align 4
  %75 = call <2 x float> @vrSub(<2 x float> %73, <2 x float> %74)
  store <2 x float> %75, ptr %12, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %76 = load <2 x float>, ptr %12, align 4
  %77 = call float @vrLengthSqr(<2 x float> %76)
  store float %77, ptr %13, align 4, !tbaa !9
  %78 = load float, ptr %13, align 4, !tbaa !9
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.vrParticle, ptr %79, i32 0, i32 8
  %81 = load float, ptr %80, align 4, !tbaa !19
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.vrParticle, ptr %82, i32 0, i32 8
  %84 = load float, ptr %83, align 4, !tbaa !19
  %85 = fmul float %81, %84
  %86 = fcmp ogt float %78, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %59
  store i32 7, ptr %8, align 4
  br label %142

88:                                               ; preds = %59
  %89 = load float, ptr %13, align 4, !tbaa !9
  %90 = fpext float %89 to double
  %91 = call double @sqrt(double noundef %90) #6
  %92 = fptrunc double %91 to float
  store float %92, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %93 = load float, ptr %13, align 4, !tbaa !9
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.vrParticle, ptr %94, i32 0, i32 8
  %96 = load float, ptr %95, align 4, !tbaa !19
  %97 = fdiv float %93, %96
  store float %97, ptr %14, align 4, !tbaa !9
  %98 = load float, ptr %14, align 4, !tbaa !9
  %99 = fcmp olt float %98, 1.000000e+00
  br i1 %99, label %100, label %121

100:                                              ; preds = %88
  %101 = load float, ptr %14, align 4, !tbaa !9
  %102 = fsub float 1.000000e+00, %101
  %103 = fpext float %102 to double
  %104 = call double @pow(double noundef %103, double noundef 2.000000e+00) #6
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.vrParticle, ptr %105, i32 0, i32 5
  %107 = load float, ptr %106, align 4, !tbaa !22
  %108 = fpext float %107 to double
  %109 = fadd double %108, %104
  %110 = fptrunc double %109 to float
  store float %110, ptr %106, align 4, !tbaa !22
  %111 = load float, ptr %14, align 4, !tbaa !9
  %112 = fsub float 1.000000e+00, %111
  %113 = fpext float %112 to double
  %114 = call double @pow(double noundef %113, double noundef 3.000000e+00) #6
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.vrParticle, ptr %115, i32 0, i32 10
  %117 = load float, ptr %116, align 4, !tbaa !23
  %118 = fpext float %117 to double
  %119 = fadd double %118, %114
  %120 = fptrunc double %119 to float
  store float %120, ptr %116, align 4, !tbaa !23
  br label %121

121:                                              ; preds = %100, %88
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.vrParticle, ptr %122, i32 0, i32 5
  %124 = load float, ptr %123, align 4, !tbaa !22
  %125 = load float, ptr %5, align 4, !tbaa !9
  %126 = fcmp ogt float %124, %125
  br i1 %126, label %127, label %131

127:                                              ; preds = %121
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.vrParticle, ptr %128, i32 0, i32 5
  %130 = load float, ptr %129, align 4, !tbaa !22
  store float %130, ptr %5, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %127, %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.vrParticle, ptr %132, i32 0, i32 2
  %134 = load <2 x float>, ptr %133, align 4
  %135 = call float @vrLengthSqr(<2 x float> %134)
  store float %135, ptr %15, align 4, !tbaa !9
  %136 = load float, ptr %15, align 4, !tbaa !9
  %137 = load float, ptr %6, align 4, !tbaa !9
  %138 = fcmp ogt float %136, %137
  br i1 %138, label %139, label %141

139:                                              ; preds = %131
  %140 = load float, ptr %15, align 4, !tbaa !9
  store float %140, ptr %6, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %139, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  store i32 0, ptr %8, align 4
  br label %142

142:                                              ; preds = %141, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %143 = load i32, ptr %8, align 4
  switch i32 %143, label %300 [
    i32 0, label %144
    i32 7, label %145
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144, %142
  %146 = load i32, ptr %10, align 4, !tbaa !11
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !11
  br label %50, !llvm.loop !24

148:                                              ; preds = %58
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.vrParticleSystem, ptr %149, i32 0, i32 3
  %151 = load float, ptr %150, align 8, !tbaa !26
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.vrParticle, ptr %152, i32 0, i32 5
  %154 = load float, ptr %153, align 4, !tbaa !22
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.vrParticleSystem, ptr %155, i32 0, i32 1
  %157 = load float, ptr %156, align 8, !tbaa !27
  %158 = fsub float %154, %157
  %159 = fmul float %151, %158
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.vrParticle, ptr %160, i32 0, i32 6
  store float %159, ptr %161, align 4, !tbaa !28
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.vrParticleSystem, ptr %162, i32 0, i32 2
  %164 = load float, ptr %163, align 4, !tbaa !29
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.vrParticle, ptr %165, i32 0, i32 10
  %167 = load float, ptr %166, align 4, !tbaa !23
  %168 = fmul float %164, %167
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.vrParticle, ptr %169, i32 0, i32 11
  store float %168, ptr %170, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %171 = call <2 x float> @vrVect(float noundef 0.000000e+00, float noundef 0.000000e+00)
  store <2 x float> %171, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %172

172:                                              ; preds = %285, %148
  %173 = load i32, ptr %17, align 4, !tbaa !11
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.vrParticleSystem, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !13
  %177 = getelementptr inbounds %struct.vrArray, ptr %176, i32 0, i32 1
  %178 = load i32, ptr %177, align 8, !tbaa !16
  %179 = icmp slt i32 %173, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %172
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %288

181:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.vrParticleSystem, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !13
  %185 = getelementptr inbounds %struct.vrArray, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !18
  %187 = load i32, ptr %17, align 4, !tbaa !11
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds ptr, ptr %186, i64 %188
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  store ptr %190, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %191 = load ptr, ptr %18, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.vrParticle, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.vrParticle, ptr %193, i32 0, i32 0
  %195 = load <2 x float>, ptr %192, align 4
  %196 = load <2 x float>, ptr %194, align 4
  %197 = call <2 x float> @vrSub(<2 x float> %195, <2 x float> %196)
  store <2 x float> %197, ptr %19, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %198 = load <2 x float>, ptr %19, align 4
  %199 = call float @vrLengthSqr(<2 x float> %198)
  store float %199, ptr %20, align 4, !tbaa !9
  %200 = load float, ptr %20, align 4, !tbaa !9
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.vrParticle, ptr %201, i32 0, i32 8
  %203 = load float, ptr %202, align 4, !tbaa !19
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.vrParticle, ptr %204, i32 0, i32 8
  %206 = load float, ptr %205, align 4, !tbaa !19
  %207 = fmul float %203, %206
  %208 = fcmp ogt float %200, %207
  br i1 %208, label %209, label %210

209:                                              ; preds = %181
  store i32 10, ptr %8, align 4
  br label %282

210:                                              ; preds = %181
  %211 = load float, ptr %20, align 4, !tbaa !9
  %212 = fpext float %211 to double
  %213 = call double @sqrt(double noundef %212) #6
  %214 = fptrunc double %213 to float
  store float %214, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %215 = load float, ptr %20, align 4, !tbaa !9
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.vrParticle, ptr %216, i32 0, i32 8
  %218 = load float, ptr %217, align 4, !tbaa !19
  %219 = fdiv float %215, %218
  %220 = fsub float 1.000000e+00, %219
  store float %220, ptr %21, align 4, !tbaa !9
  %221 = load float, ptr %20, align 4, !tbaa !9
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.vrParticle, ptr %222, i32 0, i32 8
  %224 = load float, ptr %223, align 4, !tbaa !19
  %225 = fcmp ole float %221, %224
  br i1 %225, label %226, label %281

226:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %227 = load ptr, ptr %9, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.vrParticle, ptr %227, i32 0, i32 6
  %229 = load float, ptr %228, align 4, !tbaa !28
  %230 = load ptr, ptr %18, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.vrParticle, ptr %230, i32 0, i32 6
  %232 = load float, ptr %231, align 4, !tbaa !28
  %233 = fadd float %229, %232
  store float %233, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.vrParticle, ptr %234, i32 0, i32 11
  %236 = load float, ptr %235, align 4, !tbaa !30
  %237 = load ptr, ptr %18, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.vrParticle, ptr %237, i32 0, i32 11
  %239 = load float, ptr %238, align 4, !tbaa !30
  %240 = fadd float %236, %239
  store float %240, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %241 = load float, ptr %22, align 4, !tbaa !9
  %242 = load float, ptr %21, align 4, !tbaa !9
  %243 = load float, ptr %23, align 4, !tbaa !9
  %244 = load float, ptr %21, align 4, !tbaa !9
  %245 = load float, ptr %21, align 4, !tbaa !9
  %246 = fmul float %244, %245
  %247 = fmul float %243, %246
  %248 = call float @llvm.fmuladd.f32(float %241, float %242, float %247)
  %249 = load float, ptr %4, align 4, !tbaa !9
  %250 = load float, ptr %4, align 4, !tbaa !9
  %251 = fmul float %249, %250
  %252 = fmul float %248, %251
  store float %252, ptr %24, align 4, !tbaa !9
  %253 = load float, ptr %20, align 4, !tbaa !9
  %254 = fcmp une float %253, 0.000000e+00
  br i1 %254, label %255, label %280

255:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %256 = load float, ptr %20, align 4, !tbaa !9
  %257 = fpext float %256 to double
  %258 = fdiv double 1.000000e+00, %257
  %259 = fptrunc double %258 to float
  %260 = load <2 x float>, ptr %19, align 4
  %261 = call <2 x float> @vrScale(<2 x float> %260, float noundef %259)
  store <2 x float> %261, ptr %25, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  %262 = load float, ptr %24, align 4, !tbaa !9
  %263 = fdiv float %262, 2.000000e+00
  store float %263, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %264 = load float, ptr %24, align 4, !tbaa !9
  %265 = load <2 x float>, ptr %19, align 4
  %266 = call <2 x float> @vrScale(<2 x float> %265, float noundef %264)
  store <2 x float> %266, ptr %27, align 4
  %267 = load <2 x float>, ptr %16, align 4
  %268 = load <2 x float>, ptr %27, align 4
  %269 = call <2 x float> @vrSub(<2 x float> %267, <2 x float> %268)
  store <2 x float> %269, ptr %26, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %26, i64 8, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  %270 = load ptr, ptr %18, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.vrParticle, ptr %270, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %272 = load ptr, ptr %18, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.vrParticle, ptr %272, i32 0, i32 0
  %274 = load float, ptr %24, align 4, !tbaa !9
  %275 = load <2 x float>, ptr %19, align 4
  %276 = call <2 x float> @vrScale(<2 x float> %275, float noundef %274)
  store <2 x float> %276, ptr %29, align 4
  %277 = load <2 x float>, ptr %273, align 4
  %278 = load <2 x float>, ptr %29, align 4
  %279 = call <2 x float> @vrAdd(<2 x float> %277, <2 x float> %278)
  store <2 x float> %279, ptr %28, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %271, ptr align 4 %28, i64 8, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %280

280:                                              ; preds = %255, %226
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %281

281:                                              ; preds = %280, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  store i32 0, ptr %8, align 4
  br label %282

282:                                              ; preds = %281, %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %283 = load i32, ptr %8, align 4
  switch i32 %283, label %300 [
    i32 0, label %284
    i32 10, label %285
  ]

284:                                              ; preds = %282
  br label %285

285:                                              ; preds = %284, %282
  %286 = load i32, ptr %17, align 4, !tbaa !11
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %17, align 4, !tbaa !11
  br label %172, !llvm.loop !32

288:                                              ; preds = %180
  %289 = load ptr, ptr %9, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.vrParticle, ptr %289, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %291 = load ptr, ptr %9, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.vrParticle, ptr %291, i32 0, i32 0
  %293 = load <2 x float>, ptr %292, align 4
  %294 = load <2 x float>, ptr %16, align 4
  %295 = call <2 x float> @vrAdd(<2 x float> %293, <2 x float> %294)
  store <2 x float> %295, ptr %30, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %290, ptr align 4 %30, i64 8, i1 false), !tbaa.struct !31
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %296

296:                                              ; preds = %288
  %297 = load i32, ptr %7, align 4, !tbaa !11
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %7, align 4, !tbaa !11
  br label %31, !llvm.loop !33

299:                                              ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void

300:                                              ; preds = %282, %142
  unreachable
}

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

declare float @vrLengthSqr(<2 x float>) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nounwind uwtable "min-legal-vector-width"="64" "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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"vrParticleSystem", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !15, i64 36, !6, i64 48}
!15 = !{!"vrVec2", !10, i64 0, !10, i64 4}
!16 = !{!17, !12, i64 8}
!17 = !{!"vrArray", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!18 = !{!17, !6, i64 0}
!19 = !{!20, !10, i64 52}
!20 = !{!"vrParticle", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !21, i64 68}
!21 = !{!"vrColor", !10, i64 0, !10, i64 4, !10, i64 8}
!22 = !{!20, !10, i64 40}
!23 = !{!20, !10, i64 60}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!14, !10, i64 16}
!27 = !{!14, !10, i64 8}
!28 = !{!20, !10, i64 44}
!29 = !{!14, !10, i64 12}
!30 = !{!20, !10, i64 64}
!31 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!32 = distinct !{!32, !25}
!33 = distinct !{!33, !25}


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

declare <2 x float> @vrVect(float noundef, float noundef) local_unnamed_addr #0

declare <2 x float> @vrScale(<2 x float>, float noundef) local_unnamed_addr #0

declare <2 x float> @vrSub(<2 x float>, <2 x float>) local_unnamed_addr #0

declare <2 x float> @vrAdd(<2 x float>, <2 x float>) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @vrParticleSystemDoubleDensity(ptr nocapture noundef readonly %0, float noundef %1) local_unnamed_addr #1 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !12
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph111, label %._crit_edge112

.lr.ph111:                                        ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 12
  %10 = fmul float %1, %1
  br label %11

._crit_edge112:                                   ; preds = %._crit_edge105, %2
  ret void

11:                                               ; preds = %.lr.ph111, %._crit_edge105
  %12 = phi i32 [ %5, %.lr.ph111 ], [ %81, %._crit_edge105 ]
  %indvars.iv117 = phi i64 [ 0, %.lr.ph111 ], [ %indvars.iv.next118, %._crit_edge105 ]
  %13 = phi ptr [ %3, %.lr.ph111 ], [ %79, %._crit_edge105 ]
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv117
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = icmp sgt i32 %12, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %11
  %18 = getelementptr inbounds i8, ptr %16, i64 52
  %19 = getelementptr inbounds i8, ptr %16, i64 40
  %20 = getelementptr inbounds i8, ptr %16, i64 60
  %21 = getelementptr inbounds i8, ptr %16, i64 16
  br label %40

._crit_edge:                                      ; preds = %71, %11
  %22 = load float, ptr %7, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %16, i64 40
  %24 = load float, ptr %23, align 4, !tbaa !18
  %25 = load float, ptr %8, align 8, !tbaa !21
  %26 = fsub float %24, %25
  %27 = fmul float %22, %26
  %28 = getelementptr inbounds i8, ptr %16, i64 44
  store float %27, ptr %28, align 4, !tbaa !22
  %29 = load float, ptr %9, align 4, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %16, i64 60
  %31 = load float, ptr %30, align 4, !tbaa !24
  %32 = fmul float %29, %31
  %33 = getelementptr inbounds i8, ptr %16, i64 64
  store float %32, ptr %33, align 4, !tbaa !25
  %34 = tail call <2 x float> @vrVect(float noundef 0.000000e+00, float noundef 0.000000e+00) #4
  %35 = load ptr, ptr %0, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !12
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph104, label %._crit_edge105

.lr.ph104:                                        ; preds = %._crit_edge
  %39 = getelementptr inbounds i8, ptr %16, i64 52
  br label %84

40:                                               ; preds = %.lr.ph, %71
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %71 ]
  %41 = phi ptr [ %13, %.lr.ph ], [ %72, %71 ]
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  %45 = load <2 x float>, ptr %16, align 4
  %46 = load <2 x float>, ptr %44, align 4
  %47 = tail call <2 x float> @vrSub(<2 x float> %45, <2 x float> %46) #4
  %48 = tail call float @vrLengthSqr(<2 x float> %47) #4
  %49 = load float, ptr %18, align 4, !tbaa !26
  %50 = fmul float %49, %49
  %51 = fcmp ogt float %48, %50
  br i1 %51, label %71, label %52

52:                                               ; preds = %40
  %sqrtf96 = tail call float @sqrtf(float noundef %48) #2
  %53 = load float, ptr %18, align 4, !tbaa !26
  %54 = fdiv float %sqrtf96, %53
  %55 = fcmp olt float %54, 1.000000e+00
  br i1 %55, label %56, label %68

56:                                               ; preds = %52
  %57 = fsub float 1.000000e+00, %54
  %58 = fpext float %57 to double
  %square = fmul double %58, %58
  %59 = load float, ptr %19, align 4, !tbaa !18
  %60 = fpext float %59 to double
  %61 = fadd double %square, %60
  %62 = fptrunc double %61 to float
  store float %62, ptr %19, align 4, !tbaa !18
  %63 = tail call double @pow(double noundef %58, double noundef 3.000000e+00) #4
  %64 = load float, ptr %20, align 4, !tbaa !24
  %65 = fpext float %64 to double
  %66 = fadd double %63, %65
  %67 = fptrunc double %66 to float
  store float %67, ptr %20, align 4, !tbaa !24
  br label %68

68:                                               ; preds = %56, %52
  %69 = load <2 x float>, ptr %21, align 4
  %70 = tail call float @vrLengthSqr(<2 x float> %69) #4
  br label %71

71:                                               ; preds = %40, %68
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %72 = load ptr, ptr %0, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  %74 = load i32, ptr %73, align 8, !tbaa !12
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next, %75
  br i1 %76, label %40, label %._crit_edge, !llvm.loop !27

._crit_edge105:                                   ; preds = %123, %._crit_edge
  %.sroa.030.0.lcssa = phi <2 x float> [ %34, %._crit_edge ], [ %.sroa.030.3, %123 ]
  %77 = load <2 x float>, ptr %16, align 4
  %78 = tail call <2 x float> @vrAdd(<2 x float> %77, <2 x float> %.sroa.030.0.lcssa) #4
  store <2 x float> %78, ptr %16, align 4
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %79 = load ptr, ptr %0, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = load i32, ptr %80, align 8, !tbaa !12
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next118, %82
  br i1 %83, label %11, label %._crit_edge112, !llvm.loop !29

84:                                               ; preds = %.lr.ph104, %123
  %indvars.iv114 = phi i64 [ 0, %.lr.ph104 ], [ %indvars.iv.next115, %123 ]
  %85 = phi ptr [ %35, %.lr.ph104 ], [ %124, %123 ]
  %.sroa.030.0102 = phi <2 x float> [ %34, %.lr.ph104 ], [ %.sroa.030.3, %123 ]
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %87 = getelementptr inbounds ptr, ptr %86, i64 %indvars.iv114
  %88 = load ptr, ptr %87, align 8, !tbaa !16
  %89 = load <2 x float>, ptr %88, align 4
  %90 = load <2 x float>, ptr %16, align 4
  %91 = tail call <2 x float> @vrSub(<2 x float> %89, <2 x float> %90) #4
  %92 = tail call float @vrLengthSqr(<2 x float> %91) #4
  %93 = load float, ptr %39, align 4, !tbaa !26
  %94 = fmul float %93, %93
  %95 = fcmp ogt float %92, %94
  br i1 %95, label %123, label %96

96:                                               ; preds = %84
  %sqrtf = tail call float @sqrtf(float noundef %92) #2
  %97 = load float, ptr %39, align 4, !tbaa !26
  %98 = fcmp ole float %sqrtf, %97
  %99 = fcmp une float %sqrtf, 0.000000e+00
  %or.cond = and i1 %99, %98
  br i1 %or.cond, label %100, label %123

100:                                              ; preds = %96
  %101 = load float, ptr %28, align 4, !tbaa !22
  %102 = getelementptr inbounds i8, ptr %88, i64 44
  %103 = load float, ptr %102, align 4, !tbaa !22
  %104 = fadd float %101, %103
  %105 = fdiv float %sqrtf, %97
  %106 = fsub float 1.000000e+00, %105
  %107 = load float, ptr %33, align 4, !tbaa !25
  %108 = getelementptr inbounds i8, ptr %88, i64 64
  %109 = load float, ptr %108, align 4, !tbaa !25
  %110 = fadd float %107, %109
  %111 = fmul float %106, %106
  %112 = fmul float %111, %110
  %113 = tail call float @llvm.fmuladd.f32(float %104, float %106, float %112)
  %114 = fmul float %10, %113
  %115 = fdiv float 1.000000e+00, %sqrtf
  %116 = tail call <2 x float> @vrScale(<2 x float> %91, float noundef %115) #4
  %117 = fmul float %114, 5.000000e-01
  %118 = tail call <2 x float> @vrScale(<2 x float> %116, float noundef %117) #4
  %119 = tail call <2 x float> @vrSub(<2 x float> %.sroa.030.0102, <2 x float> %118) #4
  %120 = tail call <2 x float> @vrScale(<2 x float> %116, float noundef %117) #4
  %121 = load <2 x float>, ptr %88, align 4
  %122 = tail call <2 x float> @vrAdd(<2 x float> %121, <2 x float> %120) #4
  store <2 x float> %122, ptr %88, align 4
  br label %123

123:                                              ; preds = %96, %100, %84
  %.sroa.030.3 = phi <2 x float> [ %.sroa.030.0102, %84 ], [ %.sroa.030.0102, %96 ], [ %119, %100 ]
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %124 = load ptr, ptr %0, align 8, !tbaa !5
  %125 = getelementptr inbounds i8, ptr %124, i64 8
  %126 = load i32, ptr %125, align 8, !tbaa !12
  %127 = sext i32 %126 to i64
  %128 = icmp slt i64 %indvars.iv.next115, %127
  br i1 %128, label %84, label %._crit_edge105, !llvm.loop !30
}

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

declare float @vrLengthSqr(<2 x float>) local_unnamed_addr #0

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

declare float @sqrtf(float) local_unnamed_addr

attributes #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 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 0}
!6 = !{!"vrParticleSystem", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 36, !7, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"vrVec2", !10, i64 0, !10, i64 4}
!12 = !{!13, !14, i64 8}
!13 = !{!"vrArray", !7, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!14 = !{!"int", !8, i64 0}
!15 = !{!13, !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !10, i64 16}
!18 = !{!19, !10, i64 40}
!19 = !{!"vrParticle", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !20, i64 68}
!20 = !{!"vrColor", !10, i64 0, !10, i64 4, !10, i64 8}
!21 = !{!6, !10, i64 8}
!22 = !{!19, !10, i64 44}
!23 = !{!6, !10, i64 12}
!24 = !{!19, !10, i64 60}
!25 = !{!19, !10, i64 64}
!26 = !{!19, !10, i64 52}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}


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