; LLVM IR from pentilm/StellarSolver :: BarnesHutParticleSystem/ZN23BarnesHutParticleSystem18collidingDiskModelEPfS0_S0_S_5fb53a47 (i)

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

%"class.std::linear_congruential_engine" = type { i64 }
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<float>::param_type" }
%"struct.std::uniform_real_distribution<float>::param_type" = type { float, float }
%class.BarnesHutParticleSystem = type { %struct.SimulationParameters, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.SimulationParameters = type { i32, i8, i8, i8, i8, float, float, float, float }

; 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: mustprogress uwtable
define dso_local void @_ZN23BarnesHutParticleSystem18collidingDiskModelEPfS0_S0_S0_S0_S0_S0_i(ptr noundef nonnull align 8 dereferenceable(328) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, i32 noundef %8) #1 align 2 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %"class.std::linear_congruential_engine", align 8
  %22 = alloca %"class.std::uniform_real_distribution", align 4
  %23 = alloca %"class.std::uniform_real_distribution", align 4
  %24 = alloca %"class.std::uniform_real_distribution", align 4
  %25 = alloca i32, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store i32 %8, ptr %18, align 4, !tbaa !9
  %33 = load ptr, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store float 1.000000e+00, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store float 0x400921FB60000000, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %22, float noundef 1.500000e+00, float noundef 1.200000e+01)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %23, float noundef 1.000000e+00, float noundef 5.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %34 = load float, ptr %20, align 4, !tbaa !11
  %35 = fmul float 2.000000e+00, %34
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %24, float noundef 0.000000e+00, float noundef %35)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %251, %9
  %37 = load i32, ptr %25, align 4, !tbaa !9
  %38 = load i32, ptr %18, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %254

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %42 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %21)
  store float %42, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %43 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %21)
  store float %43, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %44 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %21)
  store float %44, ptr %28, align 4, !tbaa !11
  %45 = load i32, ptr %25, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %60

47:                                               ; preds = %41
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load i32, ptr %25, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds float, ptr %48, i64 %50
  store float 1.000000e+05, ptr %51, align 4, !tbaa !11
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load i32, ptr %25, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds float, ptr %52, i64 %54
  store float 0.000000e+00, ptr %55, align 4, !tbaa !11
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = load i32, ptr %25, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds float, ptr %56, i64 %58
  store float 0.000000e+00, ptr %59, align 4, !tbaa !11
  br label %138

60:                                               ; preds = %41
  %61 = load i32, ptr %25, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %82

63:                                               ; preds = %60
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = load i32, ptr %25, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds float, ptr %64, i64 %66
  store float 2.500000e+04, ptr %67, align 4, !tbaa !11
  %68 = load float, ptr %26, align 4, !tbaa !11
  %69 = call noundef float @_ZSt3cosf(float noundef %68)
  %70 = fmul float 2.000000e+01, %69
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = load i32, ptr %25, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds float, ptr %71, i64 %73
  store float %70, ptr %74, align 4, !tbaa !11
  %75 = load float, ptr %26, align 4, !tbaa !11
  %76 = call noundef float @_ZSt3sinf(float noundef %75)
  %77 = fmul float 2.000000e+01, %76
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load i32, ptr %25, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds float, ptr %78, i64 %80
  store float %77, ptr %81, align 4, !tbaa !11
  br label %137

82:                                               ; preds = %60
  %83 = load i32, ptr %25, align 4, !tbaa !9
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = mul nsw i32 3, %84
  %86 = sdiv i32 %85, 4
  %87 = icmp sle i32 %83, %86
  br i1 %87, label %88, label %109

88:                                               ; preds = %82
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load i32, ptr %25, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds float, ptr %89, i64 %91
  store float 1.000000e+00, ptr %92, align 4, !tbaa !11
  %93 = load float, ptr %27, align 4, !tbaa !11
  %94 = load float, ptr %26, align 4, !tbaa !11
  %95 = call noundef float @_ZSt3cosf(float noundef %94)
  %96 = fmul float %93, %95
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load i32, ptr %25, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds float, ptr %97, i64 %99
  store float %96, ptr %100, align 4, !tbaa !11
  %101 = load float, ptr %27, align 4, !tbaa !11
  %102 = load float, ptr %26, align 4, !tbaa !11
  %103 = call noundef float @_ZSt3sinf(float noundef %102)
  %104 = fmul float %101, %103
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = load i32, ptr %25, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %105, i64 %107
  store float %104, ptr %108, align 4, !tbaa !11
  br label %136

109:                                              ; preds = %82
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = load i32, ptr %25, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds float, ptr %110, i64 %112
  store float 1.000000e+00, ptr %113, align 4, !tbaa !11
  %114 = load float, ptr %28, align 4, !tbaa !11
  %115 = load float, ptr %26, align 4, !tbaa !11
  %116 = call noundef float @_ZSt3cosf(float noundef %115)
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = getelementptr inbounds float, ptr %117, i64 1
  %119 = load float, ptr %118, align 4, !tbaa !11
  %120 = call float @llvm.fmuladd.f32(float %114, float %116, float %119)
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load i32, ptr %25, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds float, ptr %121, i64 %123
  store float %120, ptr %124, align 4, !tbaa !11
  %125 = load float, ptr %28, align 4, !tbaa !11
  %126 = load float, ptr %26, align 4, !tbaa !11
  %127 = call noundef float @_ZSt3sinf(float noundef %126)
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = getelementptr inbounds float, ptr %128, i64 1
  %130 = load float, ptr %129, align 4, !tbaa !11
  %131 = call float @llvm.fmuladd.f32(float %125, float %127, float %130)
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = load i32, ptr %25, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %132, i64 %134
  store float %131, ptr %135, align 4, !tbaa !11
  br label %136

136:                                              ; preds = %109, %88
  br label %137

137:                                              ; preds = %136, %63
  br label %138

138:                                              ; preds = %137, %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store float 1.000000e+00, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %139 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %33, i32 0, i32 0
  %140 = getelementptr inbounds %struct.SimulationParameters, ptr %139, i32 0, i32 7
  %141 = load float, ptr %140, align 8, !tbaa !13
  %142 = fpext float %141 to double
  %143 = fmul double %142, 1.000000e+05
  %144 = load float, ptr %27, align 4, !tbaa !11
  %145 = fpext float %144 to double
  %146 = fdiv double %143, %145
  %147 = call double @sqrt(double noundef %146) #5
  %148 = fmul double 1.000000e+00, %147
  %149 = fptrunc double %148 to float
  store float %149, ptr %30, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %150 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %33, i32 0, i32 0
  %151 = getelementptr inbounds %struct.SimulationParameters, ptr %150, i32 0, i32 7
  %152 = load float, ptr %151, align 8, !tbaa !13
  %153 = fpext float %152 to double
  %154 = fmul double %153, 2.500000e+04
  %155 = load float, ptr %28, align 4, !tbaa !11
  %156 = fpext float %155 to double
  %157 = fdiv double %154, %156
  %158 = call double @sqrt(double noundef %157) #5
  %159 = fmul double 1.000000e+00, %158
  %160 = fptrunc double %159 to float
  store float %160, ptr %31, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %161 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %33, i32 0, i32 0
  %162 = getelementptr inbounds %struct.SimulationParameters, ptr %161, i32 0, i32 7
  %163 = load float, ptr %162, align 8, !tbaa !13
  %164 = fpext float %163 to double
  %165 = fmul double %164, 1.000000e+05
  %166 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 800)
  %167 = fdiv double %165, %166
  %168 = call double @sqrt(double noundef %167) #5
  %169 = fmul double 1.000000e+00, %168
  %170 = fptrunc double %169 to float
  store float %170, ptr %32, align 4, !tbaa !11
  %171 = load i32, ptr %25, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %173, label %178

173:                                              ; preds = %138
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds float, ptr %174, i64 0
  store float 0.000000e+00, ptr %175, align 4, !tbaa !11
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = getelementptr inbounds float, ptr %176, i64 0
  store float 0.000000e+00, ptr %177, align 4, !tbaa !11
  br label %242

178:                                              ; preds = %138
  %179 = load i32, ptr %25, align 4, !tbaa !9
  %180 = icmp eq i32 %179, 1
  br i1 %180, label %181, label %190

181:                                              ; preds = %178
  %182 = load ptr, ptr %14, align 8, !tbaa !5
  %183 = load i32, ptr %25, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds float, ptr %182, i64 %184
  store float 0.000000e+00, ptr %185, align 4, !tbaa !11
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = load i32, ptr %25, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds float, ptr %186, i64 %188
  store float 0.000000e+00, ptr %189, align 4, !tbaa !11
  br label %241

190:                                              ; preds = %178
  %191 = load i32, ptr %25, align 4, !tbaa !9
  %192 = load i32, ptr %18, align 4, !tbaa !9
  %193 = mul nsw i32 3, %192
  %194 = sdiv i32 %193, 4
  %195 = icmp sle i32 %191, %194
  br i1 %195, label %196, label %218

196:                                              ; preds = %190
  %197 = load float, ptr %29, align 4, !tbaa !11
  %198 = load float, ptr %30, align 4, !tbaa !11
  %199 = fmul float %197, %198
  %200 = load float, ptr %26, align 4, !tbaa !11
  %201 = call noundef float @_ZSt3sinf(float noundef %200)
  %202 = fmul float %199, %201
  %203 = load ptr, ptr %14, align 8, !tbaa !5
  %204 = load i32, ptr %25, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds float, ptr %203, i64 %205
  store float %202, ptr %206, align 4, !tbaa !11
  %207 = load float, ptr %29, align 4, !tbaa !11
  %208 = fneg float %207
  %209 = load float, ptr %30, align 4, !tbaa !11
  %210 = fmul float %208, %209
  %211 = load float, ptr %26, align 4, !tbaa !11
  %212 = call noundef float @_ZSt3cosf(float noundef %211)
  %213 = fmul float %210, %212
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  %215 = load i32, ptr %25, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds float, ptr %214, i64 %216
  store float %213, ptr %217, align 4, !tbaa !11
  br label %240

218:                                              ; preds = %190
  %219 = load float, ptr %29, align 4, !tbaa !11
  %220 = load float, ptr %31, align 4, !tbaa !11
  %221 = fmul float %219, %220
  %222 = load float, ptr %26, align 4, !tbaa !11
  %223 = call noundef float @_ZSt3sinf(float noundef %222)
  %224 = fmul float %221, %223
  %225 = load ptr, ptr %14, align 8, !tbaa !5
  %226 = load i32, ptr %25, align 4, !tbaa !9
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds float, ptr %225, i64 %227
  store float %224, ptr %228, align 4, !tbaa !11
  %229 = load float, ptr %29, align 4, !tbaa !11
  %230 = fneg float %229
  %231 = load float, ptr %31, align 4, !tbaa !11
  %232 = fmul float %230, %231
  %233 = load float, ptr %26, align 4, !tbaa !11
  %234 = call noundef float @_ZSt3cosf(float noundef %233)
  %235 = fmul float %232, %234
  %236 = load ptr, ptr %15, align 8, !tbaa !5
  %237 = load i32, ptr %25, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds float, ptr %236, i64 %238
  store float %235, ptr %239, align 4, !tbaa !11
  br label %240

240:                                              ; preds = %218, %196
  br label %241

241:                                              ; preds = %240, %181
  br label %242

242:                                              ; preds = %241, %173
  %243 = load ptr, ptr %16, align 8, !tbaa !5
  %244 = load i32, ptr %25, align 4, !tbaa !9
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds float, ptr %243, i64 %245
  store float 0.000000e+00, ptr %246, align 4, !tbaa !11
  %247 = load ptr, ptr %17, align 8, !tbaa !5
  %248 = load i32, ptr %25, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds float, ptr %247, i64 %249
  store float 0.000000e+00, ptr %250, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %251

251:                                              ; preds = %242
  %252 = load i32, ptr %25, align 4, !tbaa !9
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr %25, align 4, !tbaa !9
  br label %36, !llvm.loop !18

254:                                              ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { inlinehint mustprogress 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"_ZTS23BarnesHutParticleSystem", !15, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320}
!15 = !{!"_ZTS20SimulationParameters", !16, i64 0, !17, i64 4, !17, i64 5, !17, i64 6, !17, i64 7, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!16 = !{!"_ZTS5Model", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

%"class.std::linear_congruential_engine" = type { i64 }
%"class.std::uniform_real_distribution" = type { %"struct.std::uniform_real_distribution<float>::param_type" }
%"struct.std::uniform_real_distribution<float>::param_type" = type { float, float }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23BarnesHutParticleSystem18collidingDiskModelEPfS0_S0_S0_S0_S0_S0_i(ptr nocapture noundef nonnull readonly align 8 dereferenceable(328) %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef %2, ptr nocapture noundef %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6, ptr nocapture noundef writeonly %7, i32 noundef %8) local_unnamed_addr #1 align 2 {
  %10 = alloca %"class.std::linear_congruential_engine", align 8
  %11 = alloca %"class.std::uniform_real_distribution", align 4
  %12 = alloca %"class.std::uniform_real_distribution", align 4
  %13 = alloca %"class.std::uniform_real_distribution", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %11, float noundef 1.500000e+00, float noundef 1.200000e+01)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef 1.000000e+00, float noundef 5.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  call void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef 0.000000e+00, float noundef 0x401921FB60000000)
  %14 = icmp sgt i32 %8, 0
  br i1 %14, label %15, label %._crit_edge

15:                                               ; preds = %9
  %16 = mul nuw nsw i32 %8, 3
  %17 = lshr i32 %16, 2
  %18 = getelementptr inbounds i8, ptr %2, i64 4
  %19 = getelementptr inbounds i8, ptr %3, i64 4
  %20 = getelementptr inbounds i8, ptr %1, i64 4
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = getelementptr inbounds i8, ptr %4, i64 4
  %23 = getelementptr inbounds i8, ptr %5, i64 4
  %24 = zext nneg i32 %17 to i64
  %wide.trip.count = zext nneg i32 %8 to i64
  %25 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %26 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %27 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  store float 1.000000e+05, ptr %1, align 4, !tbaa !5
  store float 0.000000e+00, ptr %2, align 4, !tbaa !5
  store float 0.000000e+00, ptr %3, align 4, !tbaa !5
  %.pre = load float, ptr %21, align 8, !tbaa !9
  %28 = fpext float %.pre to double
  %29 = fmul double %28, 1.000000e+05
  %30 = fpext float %26 to double
  %31 = fdiv double %29, %30
  %32 = call double @sqrt(double noundef %31) #5
  %33 = load float, ptr %21, align 8, !tbaa !9
  %34 = fpext float %33 to double
  %35 = fmul double %34, 2.500000e+04
  %36 = fpext float %27 to double
  %37 = fdiv double %35, %36
  %38 = call double @sqrt(double noundef %37) #5
  %39 = load float, ptr %21, align 8, !tbaa !9
  %40 = fpext float %39 to double
  %41 = fmul double %40, 1.000000e+05
  %42 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 800)
  %43 = fdiv double %41, %42
  %44 = fcmp olt double %43, 0.000000e+00
  br i1 %44, label %cdce.call.peel, label %46, !prof !16

cdce.call.peel:                                   ; preds = %15
  %45 = call double @sqrt(double noundef %43) #5
  br label %46

46:                                               ; preds = %cdce.call.peel, %15
  store float 0.000000e+00, ptr %4, align 4, !tbaa !5
  store float 0.000000e+00, ptr %5, align 4, !tbaa !5
  store float 0.000000e+00, ptr %6, align 4, !tbaa !5
  store float 0.000000e+00, ptr %7, align 4, !tbaa !5
  %exitcond.peel.not = icmp eq i32 %8, 1
  br i1 %exitcond.peel.not, label %._crit_edge, label %.peel.next.peel

.peel.next.peel:                                  ; preds = %46
  %47 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %48 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %49 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  store float 2.500000e+04, ptr %20, align 4, !tbaa !5
  %50 = call noundef float @_ZSt3cosf(float noundef %47)
  %51 = fmul float %50, 2.000000e+01
  store float %51, ptr %18, align 4, !tbaa !5
  %52 = call noundef float @_ZSt3sinf(float noundef %47)
  %53 = fmul float %52, 2.000000e+01
  store float %53, ptr %19, align 4, !tbaa !5
  %54 = load float, ptr %21, align 8, !tbaa !9
  %55 = fpext float %54 to double
  %56 = fmul double %55, 1.000000e+05
  %57 = fpext float %48 to double
  %58 = fdiv double %56, %57
  %59 = call double @sqrt(double noundef %58) #5
  %60 = load float, ptr %21, align 8, !tbaa !9
  %61 = fpext float %60 to double
  %62 = fmul double %61, 2.500000e+04
  %63 = fpext float %49 to double
  %64 = fdiv double %62, %63
  %65 = call double @sqrt(double noundef %64) #5
  %66 = load float, ptr %21, align 8, !tbaa !9
  %67 = fpext float %66 to double
  %68 = fmul double %67, 1.000000e+05
  %69 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 800)
  %70 = fdiv double %68, %69
  %71 = fcmp olt double %70, 0.000000e+00
  br i1 %71, label %cdce.call.peel85, label %cdce.end.peel, !prof !16

cdce.call.peel85:                                 ; preds = %.peel.next.peel
  %72 = call double @sqrt(double noundef %70) #5
  br label %cdce.end.peel

cdce.end.peel:                                    ; preds = %.peel.next.peel, %cdce.call.peel85
  store float 0.000000e+00, ptr %22, align 4, !tbaa !5
  store float 0.000000e+00, ptr %23, align 4, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %6, i64 4
  store float 0.000000e+00, ptr %73, align 4, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %7, i64 4
  store float 0.000000e+00, ptr %74, align 4, !tbaa !5
  %exitcond.not.peel = icmp eq i32 %8, 2
  br i1 %exitcond.not.peel, label %._crit_edge, label %.peel.next

._crit_edge:                                      ; preds = %cdce.end.peel, %129, %46, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  ret void

.peel.next:                                       ; preds = %cdce.end.peel, %129
  %indvars.iv = phi i64 [ %indvars.iv.next, %129 ], [ 2, %cdce.end.peel ]
  %75 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %76 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %77 = call noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %.not = icmp ugt i64 %indvars.iv, %24
  %78 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  store float 1.000000e+00, ptr %78, align 4, !tbaa !5
  %79 = call noundef float @_ZSt3cosf(float noundef %75)
  br i1 %.not, label %86, label %80

80:                                               ; preds = %.peel.next
  %81 = fmul float %76, %79
  %82 = getelementptr inbounds float, ptr %2, i64 %indvars.iv
  store float %81, ptr %82, align 4, !tbaa !5
  %83 = call noundef float @_ZSt3sinf(float noundef %75)
  %84 = fmul float %76, %83
  %85 = getelementptr inbounds float, ptr %3, i64 %indvars.iv
  store float %84, ptr %85, align 4, !tbaa !5
  br label %94

86:                                               ; preds = %.peel.next
  %87 = load float, ptr %18, align 4, !tbaa !5
  %88 = call float @llvm.fmuladd.f32(float %77, float %79, float %87)
  %89 = getelementptr inbounds float, ptr %2, i64 %indvars.iv
  store float %88, ptr %89, align 4, !tbaa !5
  %90 = call noundef float @_ZSt3sinf(float noundef %75)
  %91 = load float, ptr %19, align 4, !tbaa !5
  %92 = call float @llvm.fmuladd.f32(float %77, float %90, float %91)
  %93 = getelementptr inbounds float, ptr %3, i64 %indvars.iv
  store float %92, ptr %93, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %86, %80
  %95 = load float, ptr %21, align 8, !tbaa !9
  %96 = fpext float %95 to double
  %97 = fmul double %96, 1.000000e+05
  %98 = fpext float %76 to double
  %99 = fdiv double %97, %98
  %100 = call double @sqrt(double noundef %99) #5
  %101 = fptrunc double %100 to float
  %102 = load float, ptr %21, align 8, !tbaa !9
  %103 = fpext float %102 to double
  %104 = fmul double %103, 2.500000e+04
  %105 = fpext float %77 to double
  %106 = fdiv double %104, %105
  %107 = call double @sqrt(double noundef %106) #5
  %108 = fptrunc double %107 to float
  %109 = load float, ptr %21, align 8, !tbaa !9
  %110 = fpext float %109 to double
  %111 = fmul double %110, 1.000000e+05
  %112 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef 800)
  %113 = fdiv double %111, %112
  %114 = fcmp olt double %113, 0.000000e+00
  br i1 %114, label %cdce.call, label %cdce.end, !prof !16

cdce.call:                                        ; preds = %94
  %115 = call double @sqrt(double noundef %113) #5
  br label %cdce.end

cdce.end:                                         ; preds = %94, %cdce.call
  %.not81 = icmp ugt i64 %indvars.iv, %24
  %116 = call noundef float @_ZSt3sinf(float noundef %75)
  %117 = getelementptr inbounds float, ptr %4, i64 %indvars.iv
  %118 = getelementptr inbounds float, ptr %5, i64 %indvars.iv
  br i1 %.not81, label %124, label %119

119:                                              ; preds = %cdce.end
  %120 = fmul float %116, %101
  store float %120, ptr %117, align 4, !tbaa !5
  %121 = fneg float %101
  %122 = call noundef float @_ZSt3cosf(float noundef %75)
  %123 = fmul float %122, %121
  store float %123, ptr %118, align 4, !tbaa !5
  br label %129

124:                                              ; preds = %cdce.end
  %125 = fmul float %116, %108
  store float %125, ptr %117, align 4, !tbaa !5
  %126 = fneg float %108
  %127 = call noundef float @_ZSt3cosf(float noundef %75)
  %128 = fmul float %127, %126
  store float %128, ptr %118, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %124, %119
  %130 = getelementptr inbounds float, ptr %6, i64 %indvars.iv
  store float 0.000000e+00, ptr %130, align 4, !tbaa !5
  %131 = getelementptr inbounds float, ptr %7, i64 %indvars.iv
  store float 0.000000e+00, ptr %131, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.peel.next, !llvm.loop !17
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt26linear_congruential_engineImLm16807ELm0ELm2147483647EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt25uniform_real_distributionIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNSt25uniform_real_distributionIfEclISt26linear_congruential_engineImLm16807ELm0ELm2147483647EEEEfRT_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { inlinehint mustprogress 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTS23BarnesHutParticleSystem", !11, i64 0, !14, i64 24, !14, i64 28, !14, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !15, i64 224, !15, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !15, i64 264, !15, i64 272, !15, i64 280, !15, i64 288, !15, i64 296, !15, i64 304, !15, i64 312, !15, i64 320}
!11 = !{!"_ZTS20SimulationParameters", !12, i64 0, !13, i64 4, !13, i64 5, !13, i64 6, !13, i64 7, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!12 = !{!"_ZTS5Model", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"branch_weights", i32 1, i32 1048575}
!17 = distinct !{!17, !18, !19}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.peeled.count", i32 2}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LibCallsShrinkWrapPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass