; LLVM IR from pentilm/StellarSolver :: BarnesHutParticleSystem.ll (ZN23BarnesHutParticleSystemD2Ev)

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

@.str = external hidden unnamed_addr constant [83 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #1

declare i32 @cudaFree(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN23BarnesHutParticleSystemD2Ev(ptr noundef nonnull align 8 dereferenceable(328) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 4
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %1
  call void @_ZdlPvm(ptr noundef %5, i64 noundef 4) #5
  br label %8

8:                                                ; preds = %7, %1
  %9 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 5
  %10 = load ptr, ptr %9, align 8, !tbaa !16
  %11 = icmp eq ptr %10, null
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  call void @_ZdlPvm(ptr noundef %10, i64 noundef 4) #5
  br label %13

13:                                               ; preds = %12, %8
  %14 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 6
  %15 = load ptr, ptr %14, align 8, !tbaa !17
  %16 = icmp eq ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 4) #5
  br label %18

18:                                               ; preds = %17, %13
  %19 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 7
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = icmp eq ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 4) #5
  br label %23

23:                                               ; preds = %22, %18
  %24 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 8
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = icmp eq ptr %25, null
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @_ZdaPv(ptr noundef %25) #5
  br label %28

28:                                               ; preds = %27, %23
  %29 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 9
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = icmp eq ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @_ZdaPv(ptr noundef %30) #5
  br label %33

33:                                               ; preds = %32, %28
  %34 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 10
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = icmp eq ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @_ZdaPv(ptr noundef %35) #5
  br label %38

38:                                               ; preds = %37, %33
  %39 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 11
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = icmp eq ptr %40, null
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @_ZdaPv(ptr noundef %40) #5
  br label %43

43:                                               ; preds = %42, %38
  %44 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 12
  %45 = load ptr, ptr %44, align 8, !tbaa !23
  %46 = icmp eq ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @_ZdaPv(ptr noundef %45) #5
  br label %48

48:                                               ; preds = %47, %43
  %49 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 13
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  %51 = icmp eq ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  call void @_ZdaPv(ptr noundef %50) #5
  br label %53

53:                                               ; preds = %52, %48
  %54 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 14
  %55 = load ptr, ptr %54, align 8, !tbaa !25
  %56 = icmp eq ptr %55, null
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  call void @_ZdaPv(ptr noundef %55) #5
  br label %58

58:                                               ; preds = %57, %53
  %59 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 15
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = icmp eq ptr %60, null
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @_ZdaPv(ptr noundef %60) #5
  br label %63

63:                                               ; preds = %62, %58
  %64 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 16
  %65 = load ptr, ptr %64, align 8, !tbaa !27
  %66 = icmp eq ptr %65, null
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @_ZdaPv(ptr noundef %65) #5
  br label %68

68:                                               ; preds = %67, %63
  %69 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 17
  %70 = load ptr, ptr %69, align 8, !tbaa !28
  %71 = icmp eq ptr %70, null
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @_ZdaPv(ptr noundef %70) #5
  br label %73

73:                                               ; preds = %72, %68
  %74 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 18
  %75 = load ptr, ptr %74, align 8, !tbaa !29
  %76 = icmp eq ptr %75, null
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @_ZdaPv(ptr noundef %75) #5
  br label %78

78:                                               ; preds = %77, %73
  %79 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 38
  %80 = load ptr, ptr %79, align 8, !tbaa !30
  %81 = icmp eq ptr %80, null
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @_ZdaPv(ptr noundef %80) #5
  br label %83

83:                                               ; preds = %82, %78
  %84 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 19
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  %86 = invoke i32 @cudaFree(ptr noundef %85)
          to label %87 unwind label %176

87:                                               ; preds = %83
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %86, ptr noundef @.str, i32 noundef 268, i1 noundef zeroext true)
          to label %88 unwind label %176

88:                                               ; preds = %87
  %89 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 20
  %90 = load ptr, ptr %89, align 8, !tbaa !32
  %91 = invoke i32 @cudaFree(ptr noundef %90)
          to label %92 unwind label %176

92:                                               ; preds = %88
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %91, ptr noundef @.str, i32 noundef 269, i1 noundef zeroext true)
          to label %93 unwind label %176

93:                                               ; preds = %92
  %94 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 21
  %95 = load ptr, ptr %94, align 8, !tbaa !33
  %96 = invoke i32 @cudaFree(ptr noundef %95)
          to label %97 unwind label %176

97:                                               ; preds = %93
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %96, ptr noundef @.str, i32 noundef 270, i1 noundef zeroext true)
          to label %98 unwind label %176

98:                                               ; preds = %97
  %99 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 22
  %100 = load ptr, ptr %99, align 8, !tbaa !34
  %101 = invoke i32 @cudaFree(ptr noundef %100)
          to label %102 unwind label %176

102:                                              ; preds = %98
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %101, ptr noundef @.str, i32 noundef 271, i1 noundef zeroext true)
          to label %103 unwind label %176

103:                                              ; preds = %102
  %104 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 23
  %105 = load ptr, ptr %104, align 8, !tbaa !35
  %106 = invoke i32 @cudaFree(ptr noundef %105)
          to label %107 unwind label %176

107:                                              ; preds = %103
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %106, ptr noundef @.str, i32 noundef 273, i1 noundef zeroext true)
          to label %108 unwind label %176

108:                                              ; preds = %107
  %109 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 24
  %110 = load ptr, ptr %109, align 8, !tbaa !36
  %111 = invoke i32 @cudaFree(ptr noundef %110)
          to label %112 unwind label %176

112:                                              ; preds = %108
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %111, ptr noundef @.str, i32 noundef 274, i1 noundef zeroext true)
          to label %113 unwind label %176

113:                                              ; preds = %112
  %114 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 25
  %115 = load ptr, ptr %114, align 8, !tbaa !37
  %116 = invoke i32 @cudaFree(ptr noundef %115)
          to label %117 unwind label %176

117:                                              ; preds = %113
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %116, ptr noundef @.str, i32 noundef 275, i1 noundef zeroext true)
          to label %118 unwind label %176

118:                                              ; preds = %117
  %119 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 26
  %120 = load ptr, ptr %119, align 8, !tbaa !38
  %121 = invoke i32 @cudaFree(ptr noundef %120)
          to label %122 unwind label %176

122:                                              ; preds = %118
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %121, ptr noundef @.str, i32 noundef 276, i1 noundef zeroext true)
          to label %123 unwind label %176

123:                                              ; preds = %122
  %124 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 27
  %125 = load ptr, ptr %124, align 8, !tbaa !39
  %126 = invoke i32 @cudaFree(ptr noundef %125)
          to label %127 unwind label %176

127:                                              ; preds = %123
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %126, ptr noundef @.str, i32 noundef 277, i1 noundef zeroext true)
          to label %128 unwind label %176

128:                                              ; preds = %127
  %129 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 28
  %130 = load ptr, ptr %129, align 8, !tbaa !40
  %131 = invoke i32 @cudaFree(ptr noundef %130)
          to label %132 unwind label %176

132:                                              ; preds = %128
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %131, ptr noundef @.str, i32 noundef 278, i1 noundef zeroext true)
          to label %133 unwind label %176

133:                                              ; preds = %132
  %134 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 29
  %135 = load ptr, ptr %134, align 8, !tbaa !41
  %136 = invoke i32 @cudaFree(ptr noundef %135)
          to label %137 unwind label %176

137:                                              ; preds = %133
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %136, ptr noundef @.str, i32 noundef 279, i1 noundef zeroext true)
          to label %138 unwind label %176

138:                                              ; preds = %137
  %139 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 30
  %140 = load ptr, ptr %139, align 8, !tbaa !42
  %141 = invoke i32 @cudaFree(ptr noundef %140)
          to label %142 unwind label %176

142:                                              ; preds = %138
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %141, ptr noundef @.str, i32 noundef 281, i1 noundef zeroext true)
          to label %143 unwind label %176

143:                                              ; preds = %142
  %144 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 31
  %145 = load ptr, ptr %144, align 8, !tbaa !43
  %146 = invoke i32 @cudaFree(ptr noundef %145)
          to label %147 unwind label %176

147:                                              ; preds = %143
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %146, ptr noundef @.str, i32 noundef 282, i1 noundef zeroext true)
          to label %148 unwind label %176

148:                                              ; preds = %147
  %149 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 32
  %150 = load ptr, ptr %149, align 8, !tbaa !44
  %151 = invoke i32 @cudaFree(ptr noundef %150)
          to label %152 unwind label %176

152:                                              ; preds = %148
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %151, ptr noundef @.str, i32 noundef 283, i1 noundef zeroext true)
          to label %153 unwind label %176

153:                                              ; preds = %152
  %154 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 33
  %155 = load ptr, ptr %154, align 8, !tbaa !45
  %156 = invoke i32 @cudaFree(ptr noundef %155)
          to label %157 unwind label %176

157:                                              ; preds = %153
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %156, ptr noundef @.str, i32 noundef 284, i1 noundef zeroext true)
          to label %158 unwind label %176

158:                                              ; preds = %157
  %159 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 34
  %160 = load ptr, ptr %159, align 8, !tbaa !46
  %161 = invoke i32 @cudaFree(ptr noundef %160)
          to label %162 unwind label %176

162:                                              ; preds = %158
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %161, ptr noundef @.str, i32 noundef 285, i1 noundef zeroext true)
          to label %163 unwind label %176

163:                                              ; preds = %162
  %164 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 35
  %165 = load ptr, ptr %164, align 8, !tbaa !47
  %166 = invoke i32 @cudaFree(ptr noundef %165)
          to label %167 unwind label %176

167:                                              ; preds = %163
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %166, ptr noundef @.str, i32 noundef 287, i1 noundef zeroext true)
          to label %168 unwind label %176

168:                                              ; preds = %167
  %169 = getelementptr inbounds %class.BarnesHutParticleSystem, ptr %3, i32 0, i32 39
  %170 = load ptr, ptr %169, align 8, !tbaa !48
  %171 = invoke i32 @cudaFree(ptr noundef %170)
          to label %172 unwind label %176

172:                                              ; preds = %168
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %171, ptr noundef @.str, i32 noundef 289, i1 noundef zeroext true)
          to label %173 unwind label %176

173:                                              ; preds = %172
  %174 = invoke i32 @cudaDeviceSynchronize()
          to label %175 unwind label %176

175:                                              ; preds = %173
  ret void

176:                                              ; preds = %173, %172, %168, %167, %163, %162, %158, %157, %153, %152, %148, %147, %143, %142, %138, %137, %133, %132, %128, %127, %123, %122, %118, %117, %113, %112, %108, %107, %103, %102, %98, %97, %93, %92, %88, %87, %83
  %177 = landingpad { ptr, i32 }
          catch ptr null
  %178 = extractvalue { ptr, i32 } %177, 0
  call void @__clang_call_terminate(ptr %178) #6
  unreachable
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

declare i32 @cudaDeviceSynchronize() #2

attributes #0 = { inlinehint 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 #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 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 = { noinline noreturn nounwind uwtable "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 = { builtin nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 40}
!10 = !{!"_ZTS23BarnesHutParticleSystem", !11, i64 0, !15, i64 24, !15, i64 28, !15, 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}
!11 = !{!"_ZTS20SimulationParameters", !12, i64 0, !13, i64 4, !13, i64 5, !13, i64 6, !13, i64 7, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!12 = !{!"_ZTS5Model", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !6, i64 48}
!17 = !{!10, !6, i64 56}
!18 = !{!10, !6, i64 64}
!19 = !{!10, !6, i64 72}
!20 = !{!10, !6, i64 80}
!21 = !{!10, !6, i64 88}
!22 = !{!10, !6, i64 96}
!23 = !{!10, !6, i64 104}
!24 = !{!10, !6, i64 112}
!25 = !{!10, !6, i64 120}
!26 = !{!10, !6, i64 128}
!27 = !{!10, !6, i64 136}
!28 = !{!10, !6, i64 144}
!29 = !{!10, !6, i64 152}
!30 = !{!10, !6, i64 312}
!31 = !{!10, !6, i64 160}
!32 = !{!10, !6, i64 168}
!33 = !{!10, !6, i64 176}
!34 = !{!10, !6, i64 184}
!35 = !{!10, !6, i64 192}
!36 = !{!10, !6, i64 200}
!37 = !{!10, !6, i64 208}
!38 = !{!10, !6, i64 216}
!39 = !{!10, !6, i64 224}
!40 = !{!10, !6, i64 232}
!41 = !{!10, !6, i64 240}
!42 = !{!10, !6, i64 248}
!43 = !{!10, !6, i64 256}
!44 = !{!10, !6, i64 264}
!45 = !{!10, !6, i64 272}
!46 = !{!10, !6, i64 280}
!47 = !{!10, !6, i64 288}
!48 = !{!10, !6, i64 320}


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

@.str = external hidden unnamed_addr constant [83 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #1

declare i32 @cudaFree(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN23BarnesHutParticleSystemD2Ev(ptr nocapture noundef nonnull readonly align 8 dereferenceable(328) %0) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = icmp eq ptr %3, null
  br i1 %4, label %6, label %5

5:                                                ; preds = %1
  tail call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 4) #5
  br label %6

6:                                                ; preds = %5, %1
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = icmp eq ptr %8, null
  br i1 %9, label %11, label %10

10:                                               ; preds = %6
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 4) #5
  br label %11

11:                                               ; preds = %10, %6
  %12 = getelementptr inbounds i8, ptr %0, i64 56
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = icmp eq ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 4) #5
  br label %16

16:                                               ; preds = %15, %11
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %19 = icmp eq ptr %18, null
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  tail call void @_ZdlPvm(ptr noundef nonnull %18, i64 noundef 4) #5
  br label %21

21:                                               ; preds = %20, %16
  %22 = getelementptr inbounds i8, ptr %0, i64 72
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = icmp eq ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  tail call void @_ZdaPv(ptr noundef nonnull %23) #5
  br label %26

26:                                               ; preds = %25, %21
  %27 = getelementptr inbounds i8, ptr %0, i64 80
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = icmp eq ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  tail call void @_ZdaPv(ptr noundef nonnull %28) #5
  br label %31

31:                                               ; preds = %30, %26
  %32 = getelementptr inbounds i8, ptr %0, i64 88
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = icmp eq ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  tail call void @_ZdaPv(ptr noundef nonnull %33) #5
  br label %36

36:                                               ; preds = %35, %31
  %37 = getelementptr inbounds i8, ptr %0, i64 96
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = icmp eq ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  tail call void @_ZdaPv(ptr noundef nonnull %38) #5
  br label %41

41:                                               ; preds = %40, %36
  %42 = getelementptr inbounds i8, ptr %0, i64 104
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %44 = icmp eq ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  tail call void @_ZdaPv(ptr noundef nonnull %43) #5
  br label %46

46:                                               ; preds = %45, %41
  %47 = getelementptr inbounds i8, ptr %0, i64 112
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = icmp eq ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  tail call void @_ZdaPv(ptr noundef nonnull %48) #5
  br label %51

51:                                               ; preds = %50, %46
  %52 = getelementptr inbounds i8, ptr %0, i64 120
  %53 = load ptr, ptr %52, align 8, !tbaa !24
  %54 = icmp eq ptr %53, null
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  tail call void @_ZdaPv(ptr noundef nonnull %53) #5
  br label %56

56:                                               ; preds = %55, %51
  %57 = getelementptr inbounds i8, ptr %0, i64 128
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = icmp eq ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  tail call void @_ZdaPv(ptr noundef nonnull %58) #5
  br label %61

61:                                               ; preds = %60, %56
  %62 = getelementptr inbounds i8, ptr %0, i64 136
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = icmp eq ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  tail call void @_ZdaPv(ptr noundef nonnull %63) #5
  br label %66

66:                                               ; preds = %65, %61
  %67 = getelementptr inbounds i8, ptr %0, i64 144
  %68 = load ptr, ptr %67, align 8, !tbaa !27
  %69 = icmp eq ptr %68, null
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  tail call void @_ZdaPv(ptr noundef nonnull %68) #5
  br label %71

71:                                               ; preds = %70, %66
  %72 = getelementptr inbounds i8, ptr %0, i64 152
  %73 = load ptr, ptr %72, align 8, !tbaa !28
  %74 = icmp eq ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  tail call void @_ZdaPv(ptr noundef nonnull %73) #5
  br label %76

76:                                               ; preds = %75, %71
  %77 = getelementptr inbounds i8, ptr %0, i64 312
  %78 = load ptr, ptr %77, align 8, !tbaa !29
  %79 = icmp eq ptr %78, null
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  tail call void @_ZdaPv(ptr noundef nonnull %78) #5
  br label %81

81:                                               ; preds = %80, %76
  %82 = getelementptr inbounds i8, ptr %0, i64 160
  %83 = load ptr, ptr %82, align 8, !tbaa !30
  %84 = invoke i32 @cudaFree(ptr noundef %83)
          to label %85 unwind label %174

85:                                               ; preds = %81
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %84, ptr noundef nonnull @.str, i32 noundef 268, i1 noundef zeroext true)
          to label %86 unwind label %174

86:                                               ; preds = %85
  %87 = getelementptr inbounds i8, ptr %0, i64 168
  %88 = load ptr, ptr %87, align 8, !tbaa !31
  %89 = invoke i32 @cudaFree(ptr noundef %88)
          to label %90 unwind label %174

90:                                               ; preds = %86
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %89, ptr noundef nonnull @.str, i32 noundef 269, i1 noundef zeroext true)
          to label %91 unwind label %174

91:                                               ; preds = %90
  %92 = getelementptr inbounds i8, ptr %0, i64 176
  %93 = load ptr, ptr %92, align 8, !tbaa !32
  %94 = invoke i32 @cudaFree(ptr noundef %93)
          to label %95 unwind label %174

95:                                               ; preds = %91
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %94, ptr noundef nonnull @.str, i32 noundef 270, i1 noundef zeroext true)
          to label %96 unwind label %174

96:                                               ; preds = %95
  %97 = getelementptr inbounds i8, ptr %0, i64 184
  %98 = load ptr, ptr %97, align 8, !tbaa !33
  %99 = invoke i32 @cudaFree(ptr noundef %98)
          to label %100 unwind label %174

100:                                              ; preds = %96
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %99, ptr noundef nonnull @.str, i32 noundef 271, i1 noundef zeroext true)
          to label %101 unwind label %174

101:                                              ; preds = %100
  %102 = getelementptr inbounds i8, ptr %0, i64 192
  %103 = load ptr, ptr %102, align 8, !tbaa !34
  %104 = invoke i32 @cudaFree(ptr noundef %103)
          to label %105 unwind label %174

105:                                              ; preds = %101
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %104, ptr noundef nonnull @.str, i32 noundef 273, i1 noundef zeroext true)
          to label %106 unwind label %174

106:                                              ; preds = %105
  %107 = getelementptr inbounds i8, ptr %0, i64 200
  %108 = load ptr, ptr %107, align 8, !tbaa !35
  %109 = invoke i32 @cudaFree(ptr noundef %108)
          to label %110 unwind label %174

110:                                              ; preds = %106
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %109, ptr noundef nonnull @.str, i32 noundef 274, i1 noundef zeroext true)
          to label %111 unwind label %174

111:                                              ; preds = %110
  %112 = getelementptr inbounds i8, ptr %0, i64 208
  %113 = load ptr, ptr %112, align 8, !tbaa !36
  %114 = invoke i32 @cudaFree(ptr noundef %113)
          to label %115 unwind label %174

115:                                              ; preds = %111
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %114, ptr noundef nonnull @.str, i32 noundef 275, i1 noundef zeroext true)
          to label %116 unwind label %174

116:                                              ; preds = %115
  %117 = getelementptr inbounds i8, ptr %0, i64 216
  %118 = load ptr, ptr %117, align 8, !tbaa !37
  %119 = invoke i32 @cudaFree(ptr noundef %118)
          to label %120 unwind label %174

120:                                              ; preds = %116
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %119, ptr noundef nonnull @.str, i32 noundef 276, i1 noundef zeroext true)
          to label %121 unwind label %174

121:                                              ; preds = %120
  %122 = getelementptr inbounds i8, ptr %0, i64 224
  %123 = load ptr, ptr %122, align 8, !tbaa !38
  %124 = invoke i32 @cudaFree(ptr noundef %123)
          to label %125 unwind label %174

125:                                              ; preds = %121
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %124, ptr noundef nonnull @.str, i32 noundef 277, i1 noundef zeroext true)
          to label %126 unwind label %174

126:                                              ; preds = %125
  %127 = getelementptr inbounds i8, ptr %0, i64 232
  %128 = load ptr, ptr %127, align 8, !tbaa !39
  %129 = invoke i32 @cudaFree(ptr noundef %128)
          to label %130 unwind label %174

130:                                              ; preds = %126
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %129, ptr noundef nonnull @.str, i32 noundef 278, i1 noundef zeroext true)
          to label %131 unwind label %174

131:                                              ; preds = %130
  %132 = getelementptr inbounds i8, ptr %0, i64 240
  %133 = load ptr, ptr %132, align 8, !tbaa !40
  %134 = invoke i32 @cudaFree(ptr noundef %133)
          to label %135 unwind label %174

135:                                              ; preds = %131
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %134, ptr noundef nonnull @.str, i32 noundef 279, i1 noundef zeroext true)
          to label %136 unwind label %174

136:                                              ; preds = %135
  %137 = getelementptr inbounds i8, ptr %0, i64 248
  %138 = load ptr, ptr %137, align 8, !tbaa !41
  %139 = invoke i32 @cudaFree(ptr noundef %138)
          to label %140 unwind label %174

140:                                              ; preds = %136
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %139, ptr noundef nonnull @.str, i32 noundef 281, i1 noundef zeroext true)
          to label %141 unwind label %174

141:                                              ; preds = %140
  %142 = getelementptr inbounds i8, ptr %0, i64 256
  %143 = load ptr, ptr %142, align 8, !tbaa !42
  %144 = invoke i32 @cudaFree(ptr noundef %143)
          to label %145 unwind label %174

145:                                              ; preds = %141
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %144, ptr noundef nonnull @.str, i32 noundef 282, i1 noundef zeroext true)
          to label %146 unwind label %174

146:                                              ; preds = %145
  %147 = getelementptr inbounds i8, ptr %0, i64 264
  %148 = load ptr, ptr %147, align 8, !tbaa !43
  %149 = invoke i32 @cudaFree(ptr noundef %148)
          to label %150 unwind label %174

150:                                              ; preds = %146
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %149, ptr noundef nonnull @.str, i32 noundef 283, i1 noundef zeroext true)
          to label %151 unwind label %174

151:                                              ; preds = %150
  %152 = getelementptr inbounds i8, ptr %0, i64 272
  %153 = load ptr, ptr %152, align 8, !tbaa !44
  %154 = invoke i32 @cudaFree(ptr noundef %153)
          to label %155 unwind label %174

155:                                              ; preds = %151
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %154, ptr noundef nonnull @.str, i32 noundef 284, i1 noundef zeroext true)
          to label %156 unwind label %174

156:                                              ; preds = %155
  %157 = getelementptr inbounds i8, ptr %0, i64 280
  %158 = load ptr, ptr %157, align 8, !tbaa !45
  %159 = invoke i32 @cudaFree(ptr noundef %158)
          to label %160 unwind label %174

160:                                              ; preds = %156
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %159, ptr noundef nonnull @.str, i32 noundef 285, i1 noundef zeroext true)
          to label %161 unwind label %174

161:                                              ; preds = %160
  %162 = getelementptr inbounds i8, ptr %0, i64 288
  %163 = load ptr, ptr %162, align 8, !tbaa !46
  %164 = invoke i32 @cudaFree(ptr noundef %163)
          to label %165 unwind label %174

165:                                              ; preds = %161
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %164, ptr noundef nonnull @.str, i32 noundef 287, i1 noundef zeroext true)
          to label %166 unwind label %174

166:                                              ; preds = %165
  %167 = getelementptr inbounds i8, ptr %0, i64 320
  %168 = load ptr, ptr %167, align 8, !tbaa !47
  %169 = invoke i32 @cudaFree(ptr noundef %168)
          to label %170 unwind label %174

170:                                              ; preds = %166
  invoke void @_Z9gpuAssert9cudaErrorPKcib(i32 noundef %169, ptr noundef nonnull @.str, i32 noundef 289, i1 noundef zeroext true)
          to label %171 unwind label %174

171:                                              ; preds = %170
  %172 = invoke i32 @cudaDeviceSynchronize()
          to label %173 unwind label %174

173:                                              ; preds = %171
  ret void

174:                                              ; preds = %171, %170, %166, %165, %161, %160, %156, %155, %151, %150, %146, %145, %141, %140, %136, %135, %131, %130, %126, %125, %121, %120, %116, %115, %111, %110, %106, %105, %101, %100, %96, %95, %91, %90, %86, %85, %81
  %175 = landingpad { ptr, i32 }
          catch ptr null
  %176 = extractvalue { ptr, i32 } %175, 0
  tail call void @__clang_call_terminate(ptr %176) #6
  unreachable
}

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

declare i32 @cudaDeviceSynchronize() local_unnamed_addr #2

attributes #0 = { inlinehint 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 #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 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 = { noinline noreturn nounwind uwtable "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 = { builtin nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !14, i64 40}
!6 = !{!"_ZTS23BarnesHutParticleSystem", !7, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !14, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272, !14, i64 280, !14, i64 288, !14, i64 296, !14, i64 304, !14, i64 312, !14, i64 320}
!7 = !{!"_ZTS20SimulationParameters", !8, i64 0, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!8 = !{!"_ZTS5Model", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!6, !14, i64 48}
!16 = !{!6, !14, i64 56}
!17 = !{!6, !14, i64 64}
!18 = !{!6, !14, i64 72}
!19 = !{!6, !14, i64 80}
!20 = !{!6, !14, i64 88}
!21 = !{!6, !14, i64 96}
!22 = !{!6, !14, i64 104}
!23 = !{!6, !14, i64 112}
!24 = !{!6, !14, i64 120}
!25 = !{!6, !14, i64 128}
!26 = !{!6, !14, i64 136}
!27 = !{!6, !14, i64 144}
!28 = !{!6, !14, i64 152}
!29 = !{!6, !14, i64 312}
!30 = !{!6, !14, i64 160}
!31 = !{!6, !14, i64 168}
!32 = !{!6, !14, i64 176}
!33 = !{!6, !14, i64 184}
!34 = !{!6, !14, i64 192}
!35 = !{!6, !14, i64 200}
!36 = !{!6, !14, i64 208}
!37 = !{!6, !14, i64 216}
!38 = !{!6, !14, i64 224}
!39 = !{!6, !14, i64 232}
!40 = !{!6, !14, i64 240}
!41 = !{!6, !14, i64 248}
!42 = !{!6, !14, i64 256}
!43 = !{!6, !14, i64 264}
!44 = !{!6, !14, i64 272}
!45 = !{!6, !14, i64 280}
!46 = !{!6, !14, i64 288}
!47 = !{!6, !14, i64 320}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass