; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Graphics/R3Scene.ll (ZNK7R3Scene10LoadLightsERK5R3Boxii)

; 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.R3Sphere = type { %class.R3Solid, %class.R3Point, double }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Scene = type { ptr, %class.RNArray, %class.RNArray.0, %class.RNArray.1, %class.RNArray.2, %class.RNArray.3, %class.RNArray.4, %class.RNSymbolTable, %class.R3Viewer, %class.RNRgb, %class.RNRgb, ptr, ptr, ptr }
%class.RNArray = type { %class.RNVArray }
%class.RNArray.1 = type { %class.RNVArray }
%class.RNArray.2 = type { %class.RNVArray }
%class.RNArray.3 = type { %class.RNVArray }
%class.RNArray.4 = type { %class.RNVArray }
%class.RNSymbolTable = type { %class.RNMap }
%class.RNMap = type { ptr }
%class.R3Viewer = type { ptr, %class.R3Camera, %class.R2Viewport }
%class.R3Camera = type { %class.R3CoordSystem, double, double, double, double, double, ptr }
%class.R3CoordSystem = type { %class.R3Point, %class.R3Triad }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R2Viewport = type { i32, i32, i32, i32 }
%class.RNRgb = type { [3 x double] }

@RN_EPSILON = external global double, align 8

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK7R3Scene5LightEi(ptr noundef nonnull align 8 dereferenceable(352), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7R3Scene10LoadLightsERK5R3Boxii(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %class.R3Sphere, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca %class.R3Point, align 8
  %21 = alloca double, align 8
  %22 = alloca %class.RNArray.0, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %28 = load ptr, ptr %6, align 8
  %29 = call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %28)
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %4
  store i32 1, ptr %5, align 4
  br label %246

32:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = sub nsw i32 %33, %34
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %10, align 4, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %245

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %41 = call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %28)
  %42 = sext i32 %41 to i64
  %43 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %42, i64 8)
  %44 = extractvalue { i64, i1 } %43, 1
  %45 = extractvalue { i64, i1 } %43, 0
  %46 = select i1 %44, i64 -1, i64 %45
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef %46) #10
  store ptr %47, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %58, %40
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %28)
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %61

53:                                               ; preds = %48
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %54, i64 %56
  store double 0.000000e+00, ptr %57, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %53
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %13, align 4, !tbaa !9
  br label %48, !llvm.loop !13

61:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %127, %61
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %28)
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %132

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = call noundef ptr @_ZNK7R3Scene5LightEi(ptr noundef nonnull align 8 dereferenceable(352) %28, i32 noundef %68)
  store ptr %69, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #9
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds ptr, ptr %71, i64 10
  %73 = load ptr, ptr %72, align 8
  call void %73(ptr dead_on_unwind writable sret(%class.R3Sphere) align 8 %16, ptr noundef nonnull align 8 dereferenceable(76) %70, double noundef 1.000000e-03)
  %74 = invoke noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %75 unwind label %81

75:                                               ; preds = %67
  %76 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %77 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %74, double noundef %76)
          to label %78 unwind label %81

78:                                               ; preds = %75
  %79 = icmp ne i32 %77, 0
  br i1 %79, label %80, label %85

80:                                               ; preds = %78
  store i32 7, ptr %11, align 4
  br label %124

81:                                               ; preds = %75, %67
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %17, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %18, align 4
  br label %131

85:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #9
  invoke void @_ZNK8R3Sphere8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %20, ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %86 unwind label %97

86:                                               ; preds = %85
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = invoke noundef double @_Z10R3DistanceRK7R3PointRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(56) %87)
          to label %89 unwind label %97

89:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #9
  store double %88, ptr %19, align 8, !tbaa !11
  %90 = load double, ptr %19, align 8, !tbaa !11
  %91 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  %92 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %90, double noundef %91)
          to label %93 unwind label %101

93:                                               ; preds = %89
  %94 = icmp ne i32 %92, 0
  br i1 %94, label %95, label %105

95:                                               ; preds = %93
  %96 = load double, ptr @RN_EPSILON, align 8, !tbaa !11
  store double %96, ptr %19, align 8, !tbaa !11
  br label %105

97:                                               ; preds = %86, %85
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %17, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #9
  br label %130

101:                                              ; preds = %89
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %17, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %18, align 4
  br label %130

105:                                              ; preds = %95, %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %106 = invoke noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %107 unwind label %113

107:                                              ; preds = %105
  %108 = load double, ptr %19, align 8, !tbaa !11
  %109 = fdiv double %106, %108
  store double %109, ptr %21, align 8, !tbaa !11
  %110 = load double, ptr %21, align 8, !tbaa !11
  %111 = fcmp olt double %110, 1.000000e+00
  br i1 %111, label %112, label %117

112:                                              ; preds = %107
  store i32 7, ptr %11, align 4
  br label %123

113:                                              ; preds = %105
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %17, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %130

117:                                              ; preds = %107
  %118 = load double, ptr %21, align 8, !tbaa !11
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  store double %118, ptr %122, align 8, !tbaa !11
  store i32 0, ptr %11, align 4
  br label %123

123:                                              ; preds = %117, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %124

124:                                              ; preds = %123, %80
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  %125 = load i32, ptr %11, align 4
  switch i32 %125, label %253 [
    i32 0, label %126
    i32 7, label %127
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126, %124
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %14, align 4, !tbaa !9
  br label %62, !llvm.loop !17

130:                                              ; preds = %113, %101, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %131

131:                                              ; preds = %130, %81
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %244

132:                                              ; preds = %66
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #9
  %133 = getelementptr inbounds %class.R3Scene, ptr %28, i32 0, i32 2
  call void @_ZN7RNArrayIP7R3LightEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %133)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %197, %132
  %135 = load i32, ptr %23, align 4, !tbaa !9
  %136 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %137 unwind label %140

137:                                              ; preds = %134
  %138 = icmp slt i32 %135, %136
  br i1 %138, label %144, label %139

139:                                              ; preds = %137
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %201

140:                                              ; preds = %134
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %17, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %18, align 4
  br label %200

144:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %145 = load i32, ptr %23, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %24, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %193, %144
  %148 = load i32, ptr %24, align 4, !tbaa !9
  %149 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %150 unwind label %153

150:                                              ; preds = %147
  %151 = icmp slt i32 %148, %149
  br i1 %151, label %157, label %152

152:                                              ; preds = %150
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %196

153:                                              ; preds = %169, %147
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %17, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %200

157:                                              ; preds = %150
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load i32, ptr %24, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds double, ptr %158, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !11
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  %164 = load i32, ptr %23, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !11
  %168 = fcmp olt double %162, %167
  br i1 %168, label %169, label %192

169:                                              ; preds = %157
  %170 = load i32, ptr %23, align 4, !tbaa !9
  %171 = load i32, ptr %24, align 4, !tbaa !9
  invoke void @_ZN8RNVArray4SwapEii(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %170, i32 noundef %171)
          to label %172 unwind label %153

172:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  %173 = load ptr, ptr %12, align 8, !tbaa !5
  %174 = load i32, ptr %23, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %173, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !11
  store double %177, ptr %25, align 8, !tbaa !11
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = load i32, ptr %24, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds double, ptr %178, i64 %180
  %182 = load double, ptr %181, align 8, !tbaa !11
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = load i32, ptr %23, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds double, ptr %183, i64 %185
  store double %182, ptr %186, align 8, !tbaa !11
  %187 = load double, ptr %25, align 8, !tbaa !11
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  %189 = load i32, ptr %24, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %188, i64 %190
  store double %187, ptr %191, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  br label %192

192:                                              ; preds = %172, %157
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %24, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %24, align 4, !tbaa !9
  br label %147, !llvm.loop !18

196:                                              ; preds = %152
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %23, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %23, align 4, !tbaa !9
  br label %134, !llvm.loop !19

200:                                              ; preds = %153, %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %243

201:                                              ; preds = %139
  %202 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN8RNVArray8TruncateEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %202)
          to label %203 unwind label %210

203:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %204

204:                                              ; preds = %230, %203
  %205 = load i32, ptr %26, align 4, !tbaa !9
  %206 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %207 unwind label %214

207:                                              ; preds = %204
  %208 = icmp slt i32 %205, %206
  br i1 %208, label %218, label %209

209:                                              ; preds = %207
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %238

210:                                              ; preds = %201
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %17, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %18, align 4
  br label %243

214:                                              ; preds = %204
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %17, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %18, align 4
  br label %237

218:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %219 = load i32, ptr %26, align 4, !tbaa !9
  %220 = invoke noundef ptr @_ZNK7RNArrayIP7R3LightE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %219)
          to label %221 unwind label %233

221:                                              ; preds = %218
  store ptr %220, ptr %27, align 8, !tbaa !5
  %222 = load ptr, ptr %27, align 8, !tbaa !5
  %223 = load i32, ptr %8, align 4, !tbaa !9
  %224 = load i32, ptr %26, align 4, !tbaa !9
  %225 = add nsw i32 %223, %224
  %226 = load ptr, ptr %222, align 8, !tbaa !15
  %227 = getelementptr inbounds ptr, ptr %226, i64 14
  %228 = load ptr, ptr %227, align 8
  invoke void %228(ptr noundef nonnull align 8 dereferenceable(76) %222, i32 noundef %225)
          to label %229 unwind label %233

229:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %230

230:                                              ; preds = %229
  %231 = load i32, ptr %26, align 4, !tbaa !9
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %26, align 4, !tbaa !9
  br label %204, !llvm.loop !20

233:                                              ; preds = %221, %218
  %234 = landingpad { ptr, i32 }
          cleanup
  %235 = extractvalue { ptr, i32 } %234, 0
  store ptr %235, ptr %17, align 8
  %236 = extractvalue { ptr, i32 } %234, 1
  store i32 %236, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %237

237:                                              ; preds = %233, %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  br label %243

238:                                              ; preds = %209
  %239 = load ptr, ptr %12, align 8, !tbaa !5
  %240 = icmp eq ptr %239, null
  br i1 %240, label %242, label %241

241:                                              ; preds = %238
  call void @_ZdaPv(ptr noundef %239) #11
  br label %242

242:                                              ; preds = %241, %238
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %245

243:                                              ; preds = %237, %210, %200
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #9
  br label %244

244:                                              ; preds = %243, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %248

245:                                              ; preds = %242, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %246

246:                                              ; preds = %245, %31
  %247 = load i32, ptr %5, align 4
  ret i32 %247

248:                                              ; preds = %244
  %249 = load ptr, ptr %17, align 8
  %250 = load i32, ptr %18, align 4
  %251 = insertvalue { ptr, i32 } poison, ptr %249, 0
  %252 = insertvalue { ptr, i32 } %251, i32 %250, 1
  resume { ptr, i32 } %252

253:                                              ; preds = %124
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

declare noundef double @_Z10R3DistanceRK7R3PointRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56)) #6

declare void @_ZNK8R3Sphere8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP7R3LightEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

declare void @_ZN8RNVArray4SwapEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #6

declare void @_ZN8RNVArray8TruncateEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP7R3LightE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

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

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #8

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #8

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 #6 = { "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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


; 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.R3Sphere = type { %class.R3Solid, %class.R3Point, double }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

@RN_EPSILON = external local_unnamed_addr global double, align 8

declare i32 @__gxx_personality_v0(...)

; 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: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK7R3Scene5LightEi(ptr noundef nonnull align 8 dereferenceable(352), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZNK7R3Scene10LoadLightsERK5R3Boxii(ptr noundef nonnull align 8 dereferenceable(352) %0, ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.R3Sphere, align 8
  %6 = alloca %class.R3Point, align 8
  %7 = alloca %class.RNArray.0, align 8
  %8 = tail call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %105, label %10

10:                                               ; preds = %4
  %11 = sub nsw i32 %3, %2
  %12 = add nsw i32 %11, 1
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %105, label %14

14:                                               ; preds = %10
  %15 = tail call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %16 = zext nneg i32 %15 to i64
  %17 = icmp slt i32 %15, 0
  %18 = shl nuw nsw i64 %16, 3
  %19 = select i1 %17, i64 -1, i64 %18
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %19) #8
  %21 = tail call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %.preheader68

.preheader68:                                     ; preds = %.lr.ph, %14
  %23 = tail call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph71, label %._crit_edge

.lr.ph:                                           ; preds = %14, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %14 ]
  %25 = getelementptr inbounds double, ptr %20, i64 %indvars.iv
  store double 0.000000e+00, ptr %25, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = tail call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader68, !llvm.loop !9

._crit_edge:                                      ; preds = %60, %.preheader68
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #9
  %29 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN7RNArrayIP7R3LightEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %30 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph77, label %._crit_edge78

.lr.ph71:                                         ; preds = %.preheader68, %60
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %60 ], [ 0, %.preheader68 ]
  %32 = trunc nuw nsw i64 %indvars.iv83 to i32
  %33 = call noundef ptr @_ZNK7R3Scene5LightEi(ptr noundef nonnull align 8 dereferenceable(352) %0, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #9
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %34, i64 80
  %36 = load ptr, ptr %35, align 8
  call void %36(ptr dead_on_unwind nonnull writable sret(%class.R3Sphere) align 8 %5, ptr noundef nonnull align 8 dereferenceable(76) %33, double noundef 1.000000e-03)
  %37 = call noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %38 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %39 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %37, double noundef %38)
          to label %40 unwind label %41

40:                                               ; preds = %.lr.ph71
  %.not = icmp eq i32 %39, 0
  br i1 %.not, label %43, label %60

41:                                               ; preds = %.lr.ph71
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %64

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  invoke void @_ZNK8R3Sphere8CentroidEv(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %44 unwind label %54

44:                                               ; preds = %43
  %45 = invoke noundef double @_Z10R3DistanceRK7R3PointRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(56) %1)
          to label %46 unwind label %54

46:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  %47 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %48 = invoke noundef i32 @_Z8RNIsZerodd(double noundef %45, double noundef %47)
          to label %49 unwind label %56

49:                                               ; preds = %46
  %.not67 = icmp eq i32 %48, 0
  %50 = load double, ptr @RN_EPSILON, align 8
  %.053 = select i1 %.not67, double %45, double %50
  %51 = call noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  %52 = fdiv double %51, %.053
  %53 = fcmp olt double %52, 1.000000e+00
  br i1 %53, label %60, label %58

54:                                               ; preds = %44, %43
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  br label %64

56:                                               ; preds = %46
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %64

58:                                               ; preds = %49
  %59 = getelementptr inbounds double, ptr %20, i64 %indvars.iv83
  store double %52, ptr %59, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %58, %49, %40
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #9
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %61 = call noundef i32 @_ZNK7R3Scene7NLightsEv(ptr noundef nonnull align 8 dereferenceable(352) %0)
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next84, %62
  br i1 %63, label %.lr.ph71, label %._crit_edge, !llvm.loop !13

64:                                               ; preds = %54, %56, %41
  %.pn63.pn = phi { ptr, i32 } [ %42, %41 ], [ %57, %56 ], [ %55, %54 ]
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #9
  br label %104

.loopexit:                                        ; preds = %85, %.lr.ph77
  %65 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next92, %66
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  br i1 %67, label %.lr.ph77, label %._crit_edge78, !llvm.loop !14

._crit_edge78:                                    ; preds = %.loopexit, %._crit_edge
  invoke void @_ZN8RNVArray8TruncateEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %12)
          to label %.preheader unwind label %89

.preheader:                                       ; preds = %._crit_edge78
  %68 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph80, label %._crit_edge81

.lr.ph77:                                         ; preds = %._crit_edge, %.loopexit
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.loopexit ], [ 0, %._crit_edge ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.loopexit ], [ 1, %._crit_edge ]
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %70 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next92, %71
  br i1 %72, label %.lr.ph74, label %.loopexit

.lr.ph74:                                         ; preds = %.lr.ph77
  %73 = getelementptr inbounds double, ptr %20, i64 %indvars.iv91
  %74 = trunc nuw nsw i64 %indvars.iv91 to i32
  br label %77

75:                                               ; preds = %82
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %103

77:                                               ; preds = %.lr.ph74, %85
  %indvars.iv88 = phi i64 [ %indvars.iv86, %.lr.ph74 ], [ %indvars.iv.next89, %85 ]
  %78 = getelementptr inbounds double, ptr %20, i64 %indvars.iv88
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = load double, ptr %73, align 8, !tbaa !5
  %81 = fcmp olt double %79, %80
  br i1 %81, label %82, label %85

82:                                               ; preds = %77
  %83 = trunc nuw nsw i64 %indvars.iv88 to i32
  invoke void @_ZN8RNVArray4SwapEii(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %74, i32 noundef %83)
          to label %84 unwind label %75

84:                                               ; preds = %82
  store double %79, ptr %73, align 8, !tbaa !5
  store double %80, ptr %78, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %77, %84
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %86 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %87 = trunc nuw i64 %indvars.iv.next89 to i32
  %88 = icmp sgt i32 %86, %87
  br i1 %88, label %77, label %.loopexit, !llvm.loop !15

89:                                               ; preds = %._crit_edge78
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %103

.lr.ph80:                                         ; preds = %.preheader, %97
  %.04979 = phi i32 [ %98, %97 ], [ 0, %.preheader ]
  %91 = invoke noundef ptr @_ZNK7RNArrayIP7R3LightE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.04979)
          to label %92 unwind label %101

92:                                               ; preds = %.lr.ph80
  %93 = add nsw i32 %.04979, %2
  %94 = load ptr, ptr %91, align 8, !tbaa !11
  %95 = getelementptr inbounds i8, ptr %94, i64 112
  %96 = load ptr, ptr %95, align 8
  invoke void %96(ptr noundef nonnull align 8 dereferenceable(76) %91, i32 noundef %93)
          to label %97 unwind label %101

97:                                               ; preds = %92
  %98 = add nuw nsw i32 %.04979, 1
  %99 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %.lr.ph80, label %._crit_edge81, !llvm.loop !16

101:                                              ; preds = %92, %.lr.ph80
  %102 = landingpad { ptr, i32 }
          cleanup
  br label %103

._crit_edge81:                                    ; preds = %97, %.preheader
  call void @_ZdaPv(ptr noundef nonnull %20) #10
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  br label %105

103:                                              ; preds = %101, %89, %75
  %.pn = phi { ptr, i32 } [ %76, %75 ], [ %102, %101 ], [ %90, %89 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #9
  br label %104

104:                                              ; preds = %103, %64
  %.pn63.pn.pn = phi { ptr, i32 } [ %.pn63.pn, %64 ], [ %.pn, %103 ]
  resume { ptr, i32 } %.pn63.pn.pn

105:                                              ; preds = %._crit_edge81, %10, %4
  ret i32 1
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Sphere6RadiusEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

declare noundef double @_Z10R3DistanceRK7R3PointRK5R3Box(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #5

declare void @_ZNK8R3Sphere8CentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIP7R3LightEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

declare void @_ZN8RNVArray4SwapEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #5

declare void @_ZN8RNVArray8TruncateEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIP7R3LightE3KthEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: nounwind
declare void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { nobuiltin allocsize(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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass