; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Grid.ll (ZN6R3Grid19ConnectedComponentsEdiPiS0_S0_)

; 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.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Grid = type { %class.R3Affine, %class.R3Affine, double, double, ptr, [3 x i32], i32, i32, i32 }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #2

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592) %0, double noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #6 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %class.RNArray, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %30, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %46, label %33

33:                                               ; preds = %6
  %34 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 8
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = sext i32 %35 to i64
  %37 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %36, i64 4)
  %38 = extractvalue { i64, i1 } %37, 1
  %39 = extractvalue { i64, i1 } %37, 0
  %40 = select i1 %38, i64 -1, i64 %39
  %41 = call noalias noundef nonnull ptr @_Znam(i64 noundef %40) #10
  store ptr %41, ptr %13, align 8, !tbaa !5
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %33
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.163, i32 noundef 4547, ptr noundef @.str.2)
  br label %45

45:                                               ; preds = %44, %33
  br label %46

46:                                               ; preds = %45, %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %58, %46
  %48 = load i32, ptr %14, align 4, !tbaa !11
  %49 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 8
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %61

53:                                               ; preds = %47
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = load i32, ptr %14, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %54, i64 %56
  store i32 -1, ptr %57, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %53
  %59 = load i32, ptr %14, align 4, !tbaa !11
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %14, align 4, !tbaa !11
  br label %47, !llvm.loop !20

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

62:                                               ; preds = %441, %61
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %64 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %64, ptr %17, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %87, %63
  %66 = load i32, ptr %17, align 4, !tbaa !11
  %67 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 8
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %70, label %90

70:                                               ; preds = %65
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i32, ptr %17, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %71, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !11
  %76 = icmp slt i32 %75, 0
  br i1 %76, label %77, label %87

77:                                               ; preds = %70
  %78 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  %80 = load i32, ptr %17, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = load double, ptr %8, align 8, !tbaa !9
  %85 = fcmp ogt double %83, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %77
  br label %90

87:                                               ; preds = %77, %70
  %88 = load i32, ptr %17, align 4, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %17, align 4, !tbaa !11
  br label %65, !llvm.loop !23

90:                                               ; preds = %86, %65
  %91 = load i32, ptr %17, align 4, !tbaa !11
  %92 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 8
  %93 = load i32, ptr %92, align 4, !tbaa !13
  %94 = icmp sge i32 %91, %93
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  store i32 6, ptr %18, align 4
  br label %439

96:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 0, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #9
  call void @_ZN7RNArrayIPdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %97 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !22
  %99 = load i32, ptr %17, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds double, ptr %98, i64 %100
  %102 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %101)
          to label %103 unwind label %130

103:                                              ; preds = %96
  %104 = load i32, ptr %15, align 4, !tbaa !11
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = load i32, ptr %17, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  store i32 %104, ptr %108, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %409, %103
  %110 = invoke noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %111 unwind label %130

111:                                              ; preds = %109
  %112 = icmp ne i32 %110, 0
  %113 = xor i1 %112, true
  br i1 %113, label %114, label %413

114:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %115 = invoke noundef ptr @_ZNK7RNArrayIPdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %116 unwind label %134

116:                                              ; preds = %114
  store ptr %115, ptr %27, align 8, !tbaa !5
  invoke void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %117 unwind label %134

117:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %118 = load ptr, ptr %27, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !22
  %121 = ptrtoint ptr %118 to i64
  %122 = ptrtoint ptr %120 to i64
  %123 = sub i64 %121, %122
  %124 = sdiv exact i64 %123, 8
  %125 = trunc i64 %124 to i32
  store i32 %125, ptr %28, align 4, !tbaa !11
  %126 = load i32, ptr %28, align 4, !tbaa !11
  %127 = icmp sge i32 %126, 0
  br i1 %127, label %142, label %128

128:                                              ; preds = %117
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.164, i32 noundef 4581, ptr noundef @.str.2)
          to label %129 unwind label %138

129:                                              ; preds = %128
  br label %142

130:                                              ; preds = %109, %96
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %25, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %26, align 4
  br label %442

134:                                              ; preds = %116, %114
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %25, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %26, align 4
  br label %412

138:                                              ; preds = %395, %374, %368, %354, %333, %316, %295, %289, %275, %254, %237, %216, %210, %196, %175, %170, %168, %157, %147, %128
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %25, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %412

142:                                              ; preds = %129, %117
  %143 = load i32, ptr %28, align 4, !tbaa !11
  %144 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 8
  %145 = load i32, ptr %144, align 4, !tbaa !13
  %146 = icmp slt i32 %143, %145
  br i1 %146, label %149, label %147

147:                                              ; preds = %142
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.165, i32 noundef 4582, ptr noundef @.str.2)
          to label %148 unwind label %138

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148, %142
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = load i32, ptr %28, align 4, !tbaa !11
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %150, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !11
  %155 = load i32, ptr %15, align 4, !tbaa !11
  %156 = icmp eq i32 %154, %155
  br i1 %156, label %159, label %157

157:                                              ; preds = %149
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.166, i32 noundef 4583, ptr noundef @.str.2)
          to label %158 unwind label %138

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158, %149
  %160 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !22
  %162 = load i32, ptr %28, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %161, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !9
  %166 = load double, ptr %8, align 8, !tbaa !9
  %167 = fcmp ogt double %165, %166
  br i1 %167, label %170, label %168

168:                                              ; preds = %159
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.167, i32 noundef 4584, ptr noundef @.str.2)
          to label %169 unwind label %138

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169, %159
  %171 = load i32, ptr %28, align 4, !tbaa !11
  invoke void @_ZNK6R3Grid14IndexToIndicesEiRiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %171, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %172 unwind label %138

172:                                              ; preds = %170
  %173 = load i32, ptr %19, align 4, !tbaa !11
  %174 = icmp sgt i32 %173, 0
  br i1 %174, label %175, label %210

175:                                              ; preds = %172
  %176 = load i32, ptr %19, align 4, !tbaa !11
  %177 = sub nsw i32 %176, 1
  %178 = load i32, ptr %20, align 4, !tbaa !11
  %179 = load i32, ptr %21, align 4, !tbaa !11
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %177, i32 noundef %178, i32 noundef %179, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %180 unwind label %138

180:                                              ; preds = %175
  %181 = load ptr, ptr %13, align 8, !tbaa !5
  %182 = load i32, ptr %22, align 4, !tbaa !11
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i32, ptr %181, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !11
  %186 = icmp slt i32 %185, 0
  br i1 %186, label %187, label %209

187:                                              ; preds = %180
  %188 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %189 = load ptr, ptr %188, align 8, !tbaa !22
  %190 = load i32, ptr %22, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds double, ptr %189, i64 %191
  %193 = load double, ptr %192, align 8, !tbaa !9
  %194 = load double, ptr %8, align 8, !tbaa !9
  %195 = fcmp ogt double %193, %194
  br i1 %195, label %196, label %209

196:                                              ; preds = %187
  %197 = load i32, ptr %15, align 4, !tbaa !11
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = load i32, ptr %22, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds i32, ptr %198, i64 %200
  store i32 %197, ptr %201, align 4, !tbaa !11
  %202 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %203 = load ptr, ptr %202, align 8, !tbaa !22
  %204 = load i32, ptr %22, align 4, !tbaa !11
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds double, ptr %203, i64 %205
  %207 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %206)
          to label %208 unwind label %138

208:                                              ; preds = %196
  br label %209

209:                                              ; preds = %208, %187, %180
  br label %210

210:                                              ; preds = %209, %172
  %211 = load i32, ptr %19, align 4, !tbaa !11
  %212 = invoke noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %29)
          to label %213 unwind label %138

213:                                              ; preds = %210
  %214 = sub nsw i32 %212, 1
  %215 = icmp slt i32 %211, %214
  br i1 %215, label %216, label %251

216:                                              ; preds = %213
  %217 = load i32, ptr %19, align 4, !tbaa !11
  %218 = add nsw i32 %217, 1
  %219 = load i32, ptr %20, align 4, !tbaa !11
  %220 = load i32, ptr %21, align 4, !tbaa !11
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %218, i32 noundef %219, i32 noundef %220, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %221 unwind label %138

221:                                              ; preds = %216
  %222 = load ptr, ptr %13, align 8, !tbaa !5
  %223 = load i32, ptr %22, align 4, !tbaa !11
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds i32, ptr %222, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !11
  %227 = icmp slt i32 %226, 0
  br i1 %227, label %228, label %250

228:                                              ; preds = %221
  %229 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %230 = load ptr, ptr %229, align 8, !tbaa !22
  %231 = load i32, ptr %22, align 4, !tbaa !11
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds double, ptr %230, i64 %232
  %234 = load double, ptr %233, align 8, !tbaa !9
  %235 = load double, ptr %8, align 8, !tbaa !9
  %236 = fcmp ogt double %234, %235
  br i1 %236, label %237, label %250

237:                                              ; preds = %228
  %238 = load i32, ptr %15, align 4, !tbaa !11
  %239 = load ptr, ptr %13, align 8, !tbaa !5
  %240 = load i32, ptr %22, align 4, !tbaa !11
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds i32, ptr %239, i64 %241
  store i32 %238, ptr %242, align 4, !tbaa !11
  %243 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %244 = load ptr, ptr %243, align 8, !tbaa !22
  %245 = load i32, ptr %22, align 4, !tbaa !11
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds double, ptr %244, i64 %246
  %248 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %247)
          to label %249 unwind label %138

249:                                              ; preds = %237
  br label %250

250:                                              ; preds = %249, %228, %221
  br label %251

251:                                              ; preds = %250, %213
  %252 = load i32, ptr %20, align 4, !tbaa !11
  %253 = icmp sgt i32 %252, 0
  br i1 %253, label %254, label %289

254:                                              ; preds = %251
  %255 = load i32, ptr %19, align 4, !tbaa !11
  %256 = load i32, ptr %20, align 4, !tbaa !11
  %257 = sub nsw i32 %256, 1
  %258 = load i32, ptr %21, align 4, !tbaa !11
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %255, i32 noundef %257, i32 noundef %258, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %259 unwind label %138

259:                                              ; preds = %254
  %260 = load ptr, ptr %13, align 8, !tbaa !5
  %261 = load i32, ptr %22, align 4, !tbaa !11
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds i32, ptr %260, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !11
  %265 = icmp slt i32 %264, 0
  br i1 %265, label %266, label %288

266:                                              ; preds = %259
  %267 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %268 = load ptr, ptr %267, align 8, !tbaa !22
  %269 = load i32, ptr %22, align 4, !tbaa !11
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds double, ptr %268, i64 %270
  %272 = load double, ptr %271, align 8, !tbaa !9
  %273 = load double, ptr %8, align 8, !tbaa !9
  %274 = fcmp ogt double %272, %273
  br i1 %274, label %275, label %288

275:                                              ; preds = %266
  %276 = load i32, ptr %15, align 4, !tbaa !11
  %277 = load ptr, ptr %13, align 8, !tbaa !5
  %278 = load i32, ptr %22, align 4, !tbaa !11
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds i32, ptr %277, i64 %279
  store i32 %276, ptr %280, align 4, !tbaa !11
  %281 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %282 = load ptr, ptr %281, align 8, !tbaa !22
  %283 = load i32, ptr %22, align 4, !tbaa !11
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds double, ptr %282, i64 %284
  %286 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %285)
          to label %287 unwind label %138

287:                                              ; preds = %275
  br label %288

288:                                              ; preds = %287, %266, %259
  br label %289

289:                                              ; preds = %288, %251
  %290 = load i32, ptr %20, align 4, !tbaa !11
  %291 = invoke noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %29)
          to label %292 unwind label %138

292:                                              ; preds = %289
  %293 = sub nsw i32 %291, 1
  %294 = icmp slt i32 %290, %293
  br i1 %294, label %295, label %330

295:                                              ; preds = %292
  %296 = load i32, ptr %19, align 4, !tbaa !11
  %297 = load i32, ptr %20, align 4, !tbaa !11
  %298 = add nsw i32 %297, 1
  %299 = load i32, ptr %21, align 4, !tbaa !11
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %296, i32 noundef %298, i32 noundef %299, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %300 unwind label %138

300:                                              ; preds = %295
  %301 = load ptr, ptr %13, align 8, !tbaa !5
  %302 = load i32, ptr %22, align 4, !tbaa !11
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds i32, ptr %301, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !11
  %306 = icmp slt i32 %305, 0
  br i1 %306, label %307, label %329

307:                                              ; preds = %300
  %308 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %309 = load ptr, ptr %308, align 8, !tbaa !22
  %310 = load i32, ptr %22, align 4, !tbaa !11
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds double, ptr %309, i64 %311
  %313 = load double, ptr %312, align 8, !tbaa !9
  %314 = load double, ptr %8, align 8, !tbaa !9
  %315 = fcmp ogt double %313, %314
  br i1 %315, label %316, label %329

316:                                              ; preds = %307
  %317 = load i32, ptr %15, align 4, !tbaa !11
  %318 = load ptr, ptr %13, align 8, !tbaa !5
  %319 = load i32, ptr %22, align 4, !tbaa !11
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds i32, ptr %318, i64 %320
  store i32 %317, ptr %321, align 4, !tbaa !11
  %322 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %323 = load ptr, ptr %322, align 8, !tbaa !22
  %324 = load i32, ptr %22, align 4, !tbaa !11
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds double, ptr %323, i64 %325
  %327 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %326)
          to label %328 unwind label %138

328:                                              ; preds = %316
  br label %329

329:                                              ; preds = %328, %307, %300
  br label %330

330:                                              ; preds = %329, %292
  %331 = load i32, ptr %21, align 4, !tbaa !11
  %332 = icmp sgt i32 %331, 0
  br i1 %332, label %333, label %368

333:                                              ; preds = %330
  %334 = load i32, ptr %19, align 4, !tbaa !11
  %335 = load i32, ptr %20, align 4, !tbaa !11
  %336 = load i32, ptr %21, align 4, !tbaa !11
  %337 = sub nsw i32 %336, 1
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %334, i32 noundef %335, i32 noundef %337, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %338 unwind label %138

338:                                              ; preds = %333
  %339 = load ptr, ptr %13, align 8, !tbaa !5
  %340 = load i32, ptr %22, align 4, !tbaa !11
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds i32, ptr %339, i64 %341
  %343 = load i32, ptr %342, align 4, !tbaa !11
  %344 = icmp slt i32 %343, 0
  br i1 %344, label %345, label %367

345:                                              ; preds = %338
  %346 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %347 = load ptr, ptr %346, align 8, !tbaa !22
  %348 = load i32, ptr %22, align 4, !tbaa !11
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds double, ptr %347, i64 %349
  %351 = load double, ptr %350, align 8, !tbaa !9
  %352 = load double, ptr %8, align 8, !tbaa !9
  %353 = fcmp ogt double %351, %352
  br i1 %353, label %354, label %367

354:                                              ; preds = %345
  %355 = load i32, ptr %15, align 4, !tbaa !11
  %356 = load ptr, ptr %13, align 8, !tbaa !5
  %357 = load i32, ptr %22, align 4, !tbaa !11
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds i32, ptr %356, i64 %358
  store i32 %355, ptr %359, align 4, !tbaa !11
  %360 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %361 = load ptr, ptr %360, align 8, !tbaa !22
  %362 = load i32, ptr %22, align 4, !tbaa !11
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds double, ptr %361, i64 %363
  %365 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %364)
          to label %366 unwind label %138

366:                                              ; preds = %354
  br label %367

367:                                              ; preds = %366, %345, %338
  br label %368

368:                                              ; preds = %367, %330
  %369 = load i32, ptr %21, align 4, !tbaa !11
  %370 = invoke noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %29)
          to label %371 unwind label %138

371:                                              ; preds = %368
  %372 = sub nsw i32 %370, 1
  %373 = icmp slt i32 %369, %372
  br i1 %373, label %374, label %409

374:                                              ; preds = %371
  %375 = load i32, ptr %19, align 4, !tbaa !11
  %376 = load i32, ptr %20, align 4, !tbaa !11
  %377 = load i32, ptr %21, align 4, !tbaa !11
  %378 = add nsw i32 %377, 1
  invoke void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %29, i32 noundef %375, i32 noundef %376, i32 noundef %378, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %379 unwind label %138

379:                                              ; preds = %374
  %380 = load ptr, ptr %13, align 8, !tbaa !5
  %381 = load i32, ptr %22, align 4, !tbaa !11
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds i32, ptr %380, i64 %382
  %384 = load i32, ptr %383, align 4, !tbaa !11
  %385 = icmp slt i32 %384, 0
  br i1 %385, label %386, label %408

386:                                              ; preds = %379
  %387 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %388 = load ptr, ptr %387, align 8, !tbaa !22
  %389 = load i32, ptr %22, align 4, !tbaa !11
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds double, ptr %388, i64 %390
  %392 = load double, ptr %391, align 8, !tbaa !9
  %393 = load double, ptr %8, align 8, !tbaa !9
  %394 = fcmp ogt double %392, %393
  br i1 %394, label %395, label %408

395:                                              ; preds = %386
  %396 = load i32, ptr %15, align 4, !tbaa !11
  %397 = load ptr, ptr %13, align 8, !tbaa !5
  %398 = load i32, ptr %22, align 4, !tbaa !11
  %399 = sext i32 %398 to i64
  %400 = getelementptr inbounds i32, ptr %397, i64 %399
  store i32 %396, ptr %400, align 4, !tbaa !11
  %401 = getelementptr inbounds %class.R3Grid, ptr %29, i32 0, i32 4
  %402 = load ptr, ptr %401, align 8, !tbaa !22
  %403 = load i32, ptr %22, align 4, !tbaa !11
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds double, ptr %402, i64 %404
  %406 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %405)
          to label %407 unwind label %138

407:                                              ; preds = %395
  br label %408

408:                                              ; preds = %407, %386, %379
  br label %409

409:                                              ; preds = %408, %371
  %410 = load i32, ptr %23, align 4, !tbaa !11
  %411 = add nsw i32 %410, 1
  store i32 %411, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %109, !llvm.loop !24

412:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  br label %442

413:                                              ; preds = %111
  %414 = load i32, ptr %15, align 4, !tbaa !11
  %415 = load i32, ptr %9, align 4, !tbaa !11
  %416 = icmp slt i32 %414, %415
  br i1 %416, label %417, label %436

417:                                              ; preds = %413
  %418 = load ptr, ptr %10, align 8, !tbaa !5
  %419 = icmp ne ptr %418, null
  br i1 %419, label %420, label %426

420:                                              ; preds = %417
  %421 = load i32, ptr %17, align 4, !tbaa !11
  %422 = load ptr, ptr %10, align 8, !tbaa !5
  %423 = load i32, ptr %15, align 4, !tbaa !11
  %424 = sext i32 %423 to i64
  %425 = getelementptr inbounds i32, ptr %422, i64 %424
  store i32 %421, ptr %425, align 4, !tbaa !11
  br label %426

426:                                              ; preds = %420, %417
  %427 = load ptr, ptr %11, align 8, !tbaa !5
  %428 = icmp ne ptr %427, null
  br i1 %428, label %429, label %435

429:                                              ; preds = %426
  %430 = load i32, ptr %23, align 4, !tbaa !11
  %431 = load ptr, ptr %11, align 8, !tbaa !5
  %432 = load i32, ptr %15, align 4, !tbaa !11
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds i32, ptr %431, i64 %433
  store i32 %430, ptr %434, align 4, !tbaa !11
  br label %435

435:                                              ; preds = %429, %426
  br label %436

436:                                              ; preds = %435, %413
  %437 = load i32, ptr %15, align 4, !tbaa !11
  %438 = add nsw i32 %437, 1
  store i32 %438, ptr %15, align 4, !tbaa !11
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  store i32 0, ptr %18, align 4
  br label %439

439:                                              ; preds = %436, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  %440 = load i32, ptr %18, align 4
  switch i32 %440, label %458 [
    i32 0, label %441
    i32 6, label %443
  ]

441:                                              ; preds = %439
  br label %62, !llvm.loop !25

442:                                              ; preds = %412, %130
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %453

443:                                              ; preds = %439
  %444 = load ptr, ptr %12, align 8, !tbaa !5
  %445 = icmp ne ptr %444, null
  br i1 %445, label %451, label %446

446:                                              ; preds = %443
  %447 = load ptr, ptr %13, align 8, !tbaa !5
  %448 = icmp eq ptr %447, null
  br i1 %448, label %450, label %449

449:                                              ; preds = %446
  call void @_ZdaPv(ptr noundef %447) #11
  br label %450

450:                                              ; preds = %449, %446
  br label %451

451:                                              ; preds = %450, %443
  %452 = load i32, ptr %15, align 4, !tbaa !11
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  ret i32 %452

453:                                              ; preds = %442
  %454 = load ptr, ptr %25, align 8
  %455 = load i32, ptr %26, align 4
  %456 = insertvalue { ptr, i32 } poison, ptr %454, 0
  %457 = insertvalue { ptr, i32 } %456, i32 %455, 1
  resume { ptr, i32 } %457

458:                                              ; preds = %439
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIPdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16)) #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK6R3Grid14IndexToIndicesEiRiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { 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 #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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 588}
!14 = !{!"_ZTS6R3Grid", !15, i64 0, !15, i64 272, !10, i64 544, !10, i64 552, !6, i64 560, !7, i64 568, !12, i64 580, !12, i64 584, !12, i64 588}
!15 = !{!"_ZTS8R3Affine", !16, i64 0, !17, i64 8, !17, i64 136, !18, i64 264}
!16 = !{!"_ZTS16R3Transformation"}
!17 = !{!"_ZTS8R4Matrix", !7, i64 0}
!18 = !{!"_ZTS7RNFlags", !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !6, i64 560}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}


; 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.RNArray = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.167 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #1

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Grid19ConnectedComponentsEdiPiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592) %0, double noundef %1, i32 noundef %2, ptr noundef writeonly %3, ptr noundef writeonly %4, ptr noundef %5) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.RNArray, align 8
  %.not = icmp eq ptr %5, null
  %12 = getelementptr inbounds i8, ptr %0, i64 588
  %13 = load i32, ptr %12, align 4, !tbaa !5
  br i1 %.not, label %14, label %._crit_edge129

14:                                               ; preds = %6
  %15 = sext i32 %13 to i64
  %16 = icmp slt i32 %13, 0
  %17 = shl nsw i64 %15, 2
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #8
  br label %._crit_edge129

._crit_edge129:                                   ; preds = %6, %14
  %.0 = phi ptr [ %19, %14 ], [ %5, %6 ]
  %20 = getelementptr inbounds i8, ptr %0, i64 588
  %21 = icmp sgt i32 %13, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %22 = icmp sgt i32 %26, 0
  br i1 %22, label %.lr.ph104.lr.ph, label %._crit_edge

.lr.ph104.lr.ph:                                  ; preds = %.preheader
  %23 = getelementptr inbounds i8, ptr %0, i64 560
  %.not87 = icmp eq ptr %3, null
  %.not88 = icmp eq ptr %4, null
  %24 = sext i32 %2 to i64
  br label %.lr.ph104

.lr.ph:                                           ; preds = %._crit_edge129, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %._crit_edge129 ]
  %25 = getelementptr inbounds i32, ptr %.0, i64 %indvars.iv
  store i32 -1, ptr %25, align 4, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr %20, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader, !llvm.loop !18

.lr.ph104:                                        ; preds = %.lr.ph104.lr.ph, %217
  %indvars.iv126 = phi i64 [ 0, %.lr.ph104.lr.ph ], [ %indvars.iv.next127, %217 ]
  %29 = phi i32 [ %26, %.lr.ph104.lr.ph ], [ %218, %217 ]
  %30 = load ptr, ptr %23, align 8
  %wide.trip.count = zext nneg i32 %29 to i64
  br label %31

31:                                               ; preds = %.lr.ph104, %39
  %indvars.iv123 = phi i64 [ 0, %.lr.ph104 ], [ %indvars.iv.next124, %39 ]
  %32 = getelementptr inbounds i32, ptr %.0, i64 %indvars.iv123
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %39

35:                                               ; preds = %31
  %36 = getelementptr inbounds double, ptr %30, i64 %indvars.iv123
  %37 = load double, ptr %36, align 8, !tbaa !20
  %38 = fcmp ogt double %37, %1
  br i1 %38, label %40, label %39

39:                                               ; preds = %35, %31
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %31, !llvm.loop !21

40:                                               ; preds = %35
  %41 = trunc nuw nsw i64 %indvars.iv123 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #9
  call void @_ZN7RNArrayIPdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %42 = load ptr, ptr %23, align 8, !tbaa !22
  %43 = and i64 %indvars.iv123, 4294967295
  %44 = getelementptr inbounds double, ptr %42, i64 %43
  %45 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef %44)
          to label %46 unwind label %61

46:                                               ; preds = %40
  %47 = getelementptr inbounds i32, ptr %.0, i64 %43
  %48 = trunc nuw nsw i64 %indvars.iv126 to i32
  store i32 %48, ptr %47, align 4, !tbaa !17
  %49 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %.not86107 = icmp eq i32 %49, 0
  br i1 %.not86107, label %.lr.ph110, label %._crit_edge111

.lr.ph110:                                        ; preds = %46, %207
  %.074108 = phi i32 [ %208, %207 ], [ 0, %46 ]
  %50 = invoke noundef ptr @_ZNK7RNArrayIPdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %51 unwind label %63

51:                                               ; preds = %.lr.ph110
  invoke void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %52 unwind label %63

52:                                               ; preds = %51
  %53 = load ptr, ptr %23, align 8, !tbaa !22
  %54 = ptrtoint ptr %50 to i64
  %55 = ptrtoint ptr %53 to i64
  %56 = sub i64 %54, %55
  %57 = lshr exact i64 %56, 3
  %58 = trunc i64 %57 to i32
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %67, label %60

60:                                               ; preds = %52
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.164, i32 noundef 4581, ptr noundef nonnull @.str.2)
          to label %67 unwind label %65

61:                                               ; preds = %40
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %220

63:                                               ; preds = %51, %.lr.ph110
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %220

65:                                               ; preds = %205, %183, %164, %142, %123, %101, %83, %77, %70, %60
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %220

67:                                               ; preds = %60, %52
  %68 = load i32, ptr %20, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, %58
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.165, i32 noundef 4582, ptr noundef nonnull @.str.2)
          to label %71 unwind label %65

71:                                               ; preds = %70, %67
  %sext = shl i64 %56, 29
  %72 = ashr i64 %sext, 32
  %73 = getelementptr inbounds i32, ptr %.0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !17
  %75 = zext i32 %74 to i64
  %76 = icmp eq i64 %indvars.iv126, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %71
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.166, i32 noundef 4583, ptr noundef nonnull @.str.2)
          to label %78 unwind label %65

78:                                               ; preds = %77, %71
  %79 = load ptr, ptr %23, align 8, !tbaa !22
  %80 = getelementptr inbounds double, ptr %79, i64 %72
  %81 = load double, ptr %80, align 8, !tbaa !20
  %82 = fcmp ogt double %81, %1
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.167, i32 noundef 4584, ptr noundef nonnull @.str.2)
          to label %84 unwind label %65

84:                                               ; preds = %83, %78
  call void @_ZNK6R3Grid14IndexToIndicesEiRiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %58, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %85 = load i32, ptr %7, align 4, !tbaa !17
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %87, label %103

87:                                               ; preds = %84
  %88 = add nsw i32 %85, -1
  %89 = load i32, ptr %8, align 4, !tbaa !17
  %90 = load i32, ptr %9, align 4, !tbaa !17
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %88, i32 noundef %89, i32 noundef %90, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %91 = load i32, ptr %10, align 4, !tbaa !17
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %.0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !17
  %95 = icmp slt i32 %94, 0
  br i1 %95, label %96, label %103

96:                                               ; preds = %87
  %97 = load ptr, ptr %23, align 8, !tbaa !22
  %98 = getelementptr inbounds double, ptr %97, i64 %92
  %99 = load double, ptr %98, align 8, !tbaa !20
  %100 = fcmp ogt double %99, %1
  br i1 %100, label %101, label %103

101:                                              ; preds = %96
  store i32 %48, ptr %93, align 4, !tbaa !17
  %102 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %98)
          to label %103 unwind label %65

103:                                              ; preds = %87, %96, %101, %84
  %104 = load i32, ptr %7, align 4, !tbaa !17
  %105 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %106 = add nsw i32 %105, -1
  %107 = icmp slt i32 %104, %106
  br i1 %107, label %108, label %125

108:                                              ; preds = %103
  %109 = load i32, ptr %7, align 4, !tbaa !17
  %110 = add nsw i32 %109, 1
  %111 = load i32, ptr %8, align 4, !tbaa !17
  %112 = load i32, ptr %9, align 4, !tbaa !17
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %110, i32 noundef %111, i32 noundef %112, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %113 = load i32, ptr %10, align 4, !tbaa !17
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %.0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !17
  %117 = icmp slt i32 %116, 0
  br i1 %117, label %118, label %125

118:                                              ; preds = %108
  %119 = load ptr, ptr %23, align 8, !tbaa !22
  %120 = getelementptr inbounds double, ptr %119, i64 %114
  %121 = load double, ptr %120, align 8, !tbaa !20
  %122 = fcmp ogt double %121, %1
  br i1 %122, label %123, label %125

123:                                              ; preds = %118
  store i32 %48, ptr %115, align 4, !tbaa !17
  %124 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %120)
          to label %125 unwind label %65

125:                                              ; preds = %108, %118, %123, %103
  %126 = load i32, ptr %8, align 4, !tbaa !17
  %127 = icmp sgt i32 %126, 0
  br i1 %127, label %128, label %144

128:                                              ; preds = %125
  %129 = load i32, ptr %7, align 4, !tbaa !17
  %130 = add nsw i32 %126, -1
  %131 = load i32, ptr %9, align 4, !tbaa !17
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %129, i32 noundef %130, i32 noundef %131, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %132 = load i32, ptr %10, align 4, !tbaa !17
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %.0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !17
  %136 = icmp slt i32 %135, 0
  br i1 %136, label %137, label %144

137:                                              ; preds = %128
  %138 = load ptr, ptr %23, align 8, !tbaa !22
  %139 = getelementptr inbounds double, ptr %138, i64 %133
  %140 = load double, ptr %139, align 8, !tbaa !20
  %141 = fcmp ogt double %140, %1
  br i1 %141, label %142, label %144

142:                                              ; preds = %137
  store i32 %48, ptr %134, align 4, !tbaa !17
  %143 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %139)
          to label %144 unwind label %65

144:                                              ; preds = %128, %137, %142, %125
  %145 = load i32, ptr %8, align 4, !tbaa !17
  %146 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %147 = add nsw i32 %146, -1
  %148 = icmp slt i32 %145, %147
  br i1 %148, label %149, label %166

149:                                              ; preds = %144
  %150 = load i32, ptr %7, align 4, !tbaa !17
  %151 = load i32, ptr %8, align 4, !tbaa !17
  %152 = add nsw i32 %151, 1
  %153 = load i32, ptr %9, align 4, !tbaa !17
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %150, i32 noundef %152, i32 noundef %153, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %154 = load i32, ptr %10, align 4, !tbaa !17
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i32, ptr %.0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !17
  %158 = icmp slt i32 %157, 0
  br i1 %158, label %159, label %166

159:                                              ; preds = %149
  %160 = load ptr, ptr %23, align 8, !tbaa !22
  %161 = getelementptr inbounds double, ptr %160, i64 %155
  %162 = load double, ptr %161, align 8, !tbaa !20
  %163 = fcmp ogt double %162, %1
  br i1 %163, label %164, label %166

164:                                              ; preds = %159
  store i32 %48, ptr %156, align 4, !tbaa !17
  %165 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %161)
          to label %166 unwind label %65

166:                                              ; preds = %149, %159, %164, %144
  %167 = load i32, ptr %9, align 4, !tbaa !17
  %168 = icmp sgt i32 %167, 0
  br i1 %168, label %169, label %185

169:                                              ; preds = %166
  %170 = load i32, ptr %7, align 4, !tbaa !17
  %171 = load i32, ptr %8, align 4, !tbaa !17
  %172 = add nsw i32 %167, -1
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %170, i32 noundef %171, i32 noundef %172, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %173 = load i32, ptr %10, align 4, !tbaa !17
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %.0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !17
  %177 = icmp slt i32 %176, 0
  br i1 %177, label %178, label %185

178:                                              ; preds = %169
  %179 = load ptr, ptr %23, align 8, !tbaa !22
  %180 = getelementptr inbounds double, ptr %179, i64 %174
  %181 = load double, ptr %180, align 8, !tbaa !20
  %182 = fcmp ogt double %181, %1
  br i1 %182, label %183, label %185

183:                                              ; preds = %178
  store i32 %48, ptr %175, align 4, !tbaa !17
  %184 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %180)
          to label %185 unwind label %65

185:                                              ; preds = %169, %178, %183, %166
  %186 = load i32, ptr %9, align 4, !tbaa !17
  %187 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %188 = add nsw i32 %187, -1
  %189 = icmp slt i32 %186, %188
  br i1 %189, label %190, label %207

190:                                              ; preds = %185
  %191 = load i32, ptr %7, align 4, !tbaa !17
  %192 = load i32, ptr %8, align 4, !tbaa !17
  %193 = load i32, ptr %9, align 4, !tbaa !17
  %194 = add nsw i32 %193, 1
  call void @_ZNK6R3Grid14IndicesToIndexEiiiRi(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %191, i32 noundef %192, i32 noundef %194, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %195 = load i32, ptr %10, align 4, !tbaa !17
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr %.0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !17
  %199 = icmp slt i32 %198, 0
  br i1 %199, label %200, label %207

200:                                              ; preds = %190
  %201 = load ptr, ptr %23, align 8, !tbaa !22
  %202 = getelementptr inbounds double, ptr %201, i64 %196
  %203 = load double, ptr %202, align 8, !tbaa !20
  %204 = fcmp ogt double %203, %1
  br i1 %204, label %205, label %207

205:                                              ; preds = %200
  store i32 %48, ptr %197, align 4, !tbaa !17
  %206 = invoke noundef ptr @_ZN7RNArrayIPdE6InsertES0_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %202)
          to label %207 unwind label %65

207:                                              ; preds = %190, %200, %205, %185
  %208 = add nuw nsw i32 %.074108, 1
  %209 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %.not86 = icmp eq i32 %209, 0
  br i1 %.not86, label %.lr.ph110, label %._crit_edge111, !llvm.loop !23

._crit_edge111:                                   ; preds = %207, %46
  %.074.lcssa = phi i32 [ 0, %46 ], [ %208, %207 ]
  %210 = icmp slt i64 %indvars.iv126, %24
  br i1 %210, label %211, label %217

211:                                              ; preds = %._crit_edge111
  br i1 %.not87, label %214, label %212

212:                                              ; preds = %211
  %213 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv126
  store i32 %41, ptr %213, align 4, !tbaa !17
  br label %214

214:                                              ; preds = %212, %211
  br i1 %.not88, label %217, label %215

215:                                              ; preds = %214
  %216 = getelementptr inbounds i32, ptr %4, i64 %indvars.iv126
  store i32 %.074.lcssa, ptr %216, align 4, !tbaa !17
  br label %217

217:                                              ; preds = %._crit_edge111, %215, %214
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  %218 = load i32, ptr %20, align 4, !tbaa !5
  %219 = icmp sgt i32 %218, 0
  br i1 %219, label %.lr.ph104, label %._crit_edge.loopexit115

220:                                              ; preds = %63, %65, %61
  %.pn.pn = phi { ptr, i32 } [ %62, %61 ], [ %66, %65 ], [ %64, %63 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  resume { ptr, i32 } %.pn.pn

._crit_edge.loopexit:                             ; preds = %39
  %221 = trunc nuw nsw i64 %indvars.iv126 to i32
  br label %._crit_edge

._crit_edge.loopexit115:                          ; preds = %217
  %222 = trunc nuw i64 %indvars.iv.next127 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge129, %._crit_edge.loopexit115, %._crit_edge.loopexit, %.preheader
  %.077.lcssa = phi i32 [ 0, %.preheader ], [ %221, %._crit_edge.loopexit ], [ %222, %._crit_edge.loopexit115 ], [ 0, %._crit_edge129 ]
  br i1 %.not, label %223, label %224

223:                                              ; preds = %._crit_edge
  call void @_ZdaPv(ptr noundef nonnull %.0) #10
  br label %224

224:                                              ; preds = %223, %._crit_edge
  ret i32 %.077.lcssa
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIPdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK6R3Grid14IndexToIndicesEiRiS0_S0_(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

attributes #0 = { 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 #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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 #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, !16, i64 588}
!6 = !{!"_ZTS6R3Grid", !7, i64 0, !7, i64 272, !14, i64 544, !14, i64 552, !15, i64 560, !10, i64 568, !16, i64 580, !16, i64 584, !16, i64 588}
!7 = !{!"_ZTS8R3Affine", !8, i64 0, !9, i64 8, !9, i64 136, !12, i64 264}
!8 = !{!"_ZTS16R3Transformation"}
!9 = !{!"_ZTS8R4Matrix", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTS7RNFlags", !13, i64 0}
!13 = !{!"long", !10, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!"any pointer", !10, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = !{!16, !16, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !19}
!22 = !{!6, !15, i64 560}
!23 = distinct !{!23, !19}


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