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

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

@_ZTV15R3TriangleArray = external dso_local unnamed_addr constant { [74 x ptr] }, align 8

declare void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15R3TriangleArrayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  call void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16)
  store ptr getelementptr inbounds inrange(-16, 576) ({ [74 x ptr] }, ptr @_ZTV15R3TriangleArray, i32 0, i32 0, i32 2), ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 1
  invoke void @_ZN7RNArrayIP16R3TriangleVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %18 unwind label %33

18:                                               ; preds = %2
  %19 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 2
  invoke void @_ZN7RNArrayIP10R3TriangleEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %20 unwind label %37

20:                                               ; preds = %18
  %21 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 3
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.R3TriangleArray, ptr %22, i32 0, i32 3
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %21, ptr noundef nonnull align 8 dereferenceable(56) %23)
          to label %24 unwind label %41

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %68, %24
  %26 = load i32, ptr %7, align 4, !tbaa !11
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %class.R3TriangleArray, ptr %27, i32 0, i32 1
  %29 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %30 unwind label %45

30:                                               ; preds = %25
  %31 = icmp slt i32 %26, %29
  br i1 %31, label %49, label %32

32:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %86

33:                                               ; preds = %2
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %5, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %6, align 4
  br label %184

37:                                               ; preds = %18
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  br label %183

41:                                               ; preds = %20
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %5, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %6, align 4
  br label %182

45:                                               ; preds = %25
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %5, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %6, align 4
  br label %85

49:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.R3TriangleArray, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %7, align 4, !tbaa !11
  %53 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %51, i32 noundef %52)
          to label %54 unwind label %71

54:                                               ; preds = %49
  store ptr %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %55 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #9
          to label %56 unwind label %75

56:                                               ; preds = %54
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %55, ptr noundef nonnull align 8 dereferenceable(100) %57)
          to label %58 unwind label %79

58:                                               ; preds = %56
  store ptr %55, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 1
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = invoke noundef ptr @_ZN7RNArrayIP16R3TriangleVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef %60)
          to label %62 unwind label %75

62:                                               ; preds = %58
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN16R3TriangleVertex13SetSharedFlagEv(ptr noundef nonnull align 8 dereferenceable(100) %63)
          to label %64 unwind label %75

64:                                               ; preds = %62
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load i32, ptr %7, align 4, !tbaa !11
  invoke void @_ZN16R3TriangleVertex7SetMarkEi(ptr noundef nonnull align 8 dereferenceable(100) %65, i32 noundef %66)
          to label %67 unwind label %75

67:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %7, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %7, align 4, !tbaa !11
  br label %25, !llvm.loop !13

71:                                               ; preds = %49
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %5, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %6, align 4
  br label %84

75:                                               ; preds = %64, %62, %58, %54
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  br label %83

79:                                               ; preds = %56
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %5, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %55, i64 noundef 104) #10
  br label %83

83:                                               ; preds = %79, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %84

84:                                               ; preds = %83, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %85

85:                                               ; preds = %84, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %181

86:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %139, %86
  %88 = load i32, ptr %10, align 4, !tbaa !11
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.R3TriangleArray, ptr %89, i32 0, i32 2
  %91 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %90)
          to label %92 unwind label %95

92:                                               ; preds = %87
  %93 = icmp slt i32 %88, %91
  br i1 %93, label %99, label %94

94:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %172

95:                                               ; preds = %87
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  br label %171

99:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %class.R3TriangleArray, ptr %100, i32 0, i32 2
  %102 = load i32, ptr %10, align 4, !tbaa !11
  %103 = invoke noundef ptr @_ZNK7RNArrayIP10R3TriangleE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %101, i32 noundef %102)
          to label %104 unwind label %142

104:                                              ; preds = %99
  store ptr %103, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %105 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 1
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = invoke noundef ptr @_ZNK10R3Triangle2V0Ev(ptr noundef nonnull align 8 dereferenceable(132) %106)
          to label %108 unwind label %146

108:                                              ; preds = %104
  %109 = invoke noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %107)
          to label %110 unwind label %146

110:                                              ; preds = %108
  %111 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %105, i32 noundef %109)
          to label %112 unwind label %146

112:                                              ; preds = %110
  store ptr %111, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %113 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 1
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = invoke noundef ptr @_ZNK10R3Triangle2V1Ev(ptr noundef nonnull align 8 dereferenceable(132) %114)
          to label %116 unwind label %150

116:                                              ; preds = %112
  %117 = invoke noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %115)
          to label %118 unwind label %150

118:                                              ; preds = %116
  %119 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %113, i32 noundef %117)
          to label %120 unwind label %150

120:                                              ; preds = %118
  store ptr %119, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %121 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 1
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = invoke noundef ptr @_ZNK10R3Triangle2V2Ev(ptr noundef nonnull align 8 dereferenceable(132) %122)
          to label %124 unwind label %154

124:                                              ; preds = %120
  %125 = invoke noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %123)
          to label %126 unwind label %154

126:                                              ; preds = %124
  %127 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %121, i32 noundef %125)
          to label %128 unwind label %154

128:                                              ; preds = %126
  store ptr %127, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %129 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 136) #9
          to label %130 unwind label %158

130:                                              ; preds = %128
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN10R3TriangleC1EP16R3TriangleVertexS1_S1_(ptr noundef nonnull align 8 dereferenceable(132) %129, ptr noundef %131, ptr noundef %132, ptr noundef %133)
          to label %134 unwind label %162

134:                                              ; preds = %130
  store ptr %129, ptr %15, align 8, !tbaa !5
  %135 = getelementptr inbounds %class.R3TriangleArray, ptr %16, i32 0, i32 2
  %136 = load ptr, ptr %15, align 8, !tbaa !5
  %137 = invoke noundef ptr @_ZN7RNArrayIP10R3TriangleE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %135, ptr noundef %136)
          to label %138 unwind label %158

138:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %10, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %10, align 4, !tbaa !11
  br label %87, !llvm.loop !15

142:                                              ; preds = %99
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %5, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %6, align 4
  br label %170

146:                                              ; preds = %110, %108, %104
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %5, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %6, align 4
  br label %169

150:                                              ; preds = %118, %116, %112
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %5, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %6, align 4
  br label %168

154:                                              ; preds = %126, %124, %120
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %5, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %6, align 4
  br label %167

158:                                              ; preds = %134, %128
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %5, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %6, align 4
  br label %166

162:                                              ; preds = %130
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %5, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %129, i64 noundef 136) #10
  br label %166

166:                                              ; preds = %162, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %167

167:                                              ; preds = %166, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %168

168:                                              ; preds = %167, %150
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %169

169:                                              ; preds = %168, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %170

170:                                              ; preds = %169, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %171

171:                                              ; preds = %170, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %181

172:                                              ; preds = %94
  %173 = load ptr, ptr %16, align 8, !tbaa !9
  %174 = getelementptr inbounds ptr, ptr %173, i64 71
  %175 = load ptr, ptr %174, align 8
  invoke void %175(ptr noundef nonnull align 8 dereferenceable(96) %16)
          to label %176 unwind label %177

176:                                              ; preds = %172
  ret void

177:                                              ; preds = %172
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %5, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %6, align 4
  br label %181

181:                                              ; preds = %177, %171, %85
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %21) #8
  br label %182

182:                                              ; preds = %181, %41
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #8
  br label %183

183:                                              ; preds = %182, %37
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #8
  br label %184

184:                                              ; preds = %183, %33
  call void @_ZN9R3SurfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br label %185

185:                                              ; preds = %184
  %186 = load ptr, ptr %5, align 8
  %187 = load i32, ptr %6, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

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

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

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

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

declare void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100), ptr noundef nonnull align 8 dereferenceable(100)) unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V0Ev(ptr noundef nonnull align 8 dereferenceable(132)) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V1Ev(ptr noundef nonnull align 8 dereferenceable(132)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V2Ev(ptr noundef nonnull align 8 dereferenceable(132)) #4 align 2

declare void @_ZN10R3TriangleC1EP16R3TriangleVertexS1_S1_(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef, ptr noundef, ptr noundef) unnamed_addr #0

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

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = { 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 }
attributes #9 = { builtin allocsize(0) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !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"

@_ZTV15R3TriangleArray = external dso_local unnamed_addr constant { [74 x ptr] }, align 8

declare void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN15R3TriangleArrayC2ERKS_(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0)
  store ptr getelementptr inbounds inrange(-16, 576) (i8, ptr @_ZTV15R3TriangleArray, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  invoke void @_ZN7RNArrayIP16R3TriangleVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
          to label %4 unwind label %15

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZN7RNArrayIP10R3TriangleEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %6 unwind label %17

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = getelementptr inbounds i8, ptr %1, i64 40
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %7, ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %.preheader50 unwind label %19

.preheader50:                                     ; preds = %6
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %28, %.preheader50
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph54, label %._crit_edge

15:                                               ; preds = %2
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %81

17:                                               ; preds = %4
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %80

19:                                               ; preds = %6
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %79

.lr.ph:                                           ; preds = %.preheader50, %28
  %.03652 = phi i32 [ %29, %28 ], [ 0, %.preheader50 ]
  %21 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef %.03652)
          to label %22 unwind label %32

22:                                               ; preds = %.lr.ph
  %23 = invoke noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #7
          to label %24 unwind label %34

24:                                               ; preds = %22
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %23, ptr noundef nonnull align 8 dereferenceable(100) %21)
          to label %25 unwind label %36

25:                                               ; preds = %24
  %26 = invoke noundef ptr @_ZN7RNArrayIP16R3TriangleVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull %23)
          to label %27 unwind label %34

27:                                               ; preds = %25
  invoke void @_ZN16R3TriangleVertex13SetSharedFlagEv(ptr noundef nonnull align 8 dereferenceable(100) %23)
          to label %28 unwind label %34

28:                                               ; preds = %27
  tail call void @_ZN16R3TriangleVertex7SetMarkEi(ptr noundef nonnull align 8 dereferenceable(100) %21, i32 noundef %.03652)
  %29 = add nuw nsw i32 %.03652, 1
  %30 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph, label %.preheader, !llvm.loop !8

32:                                               ; preds = %.lr.ph
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %78

34:                                               ; preds = %27, %25, %22
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %78

36:                                               ; preds = %24
  %37 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %23, i64 noundef 104) #8
  br label %78

._crit_edge:                                      ; preds = %59, %.preheader
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 568
  %40 = load ptr, ptr %39, align 8
  invoke void %40(ptr noundef nonnull align 8 dereferenceable(96) %0)
          to label %75 unwind label %76

.lr.ph54:                                         ; preds = %.preheader, %59
  %.03753 = phi i32 [ %60, %59 ], [ 0, %.preheader ]
  %41 = invoke noundef ptr @_ZNK7RNArrayIP10R3TriangleE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %.03753)
          to label %42 unwind label %63

42:                                               ; preds = %.lr.ph54
  %43 = tail call noundef ptr @_ZNK10R3Triangle2V0Ev(ptr noundef nonnull align 8 dereferenceable(132) %41)
  %44 = tail call noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %43)
  %45 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %44)
          to label %46 unwind label %65

46:                                               ; preds = %42
  %47 = tail call noundef ptr @_ZNK10R3Triangle2V1Ev(ptr noundef nonnull align 8 dereferenceable(132) %41)
  %48 = tail call noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %47)
  %49 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %48)
          to label %50 unwind label %67

50:                                               ; preds = %46
  %51 = tail call noundef ptr @_ZNK10R3Triangle2V2Ev(ptr noundef nonnull align 8 dereferenceable(132) %41)
  %52 = tail call noundef i32 @_ZNK16R3TriangleVertex4MarkEv(ptr noundef nonnull align 8 dereferenceable(100) %51)
  %53 = invoke noundef ptr @_ZNK7RNArrayIP16R3TriangleVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %52)
          to label %54 unwind label %69

54:                                               ; preds = %50
  %55 = invoke noalias noundef nonnull dereferenceable(136) ptr @_Znwm(i64 noundef 136) #7
          to label %56 unwind label %71

56:                                               ; preds = %54
  invoke void @_ZN10R3TriangleC1EP16R3TriangleVertexS1_S1_(ptr noundef nonnull align 8 dereferenceable(132) %55, ptr noundef %45, ptr noundef %49, ptr noundef %53)
          to label %57 unwind label %73

57:                                               ; preds = %56
  %58 = invoke noundef ptr @_ZN7RNArrayIP10R3TriangleE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %55)
          to label %59 unwind label %71

59:                                               ; preds = %57
  %60 = add nuw nsw i32 %.03753, 1
  %61 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph54, label %._crit_edge, !llvm.loop !10

63:                                               ; preds = %.lr.ph54
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %78

65:                                               ; preds = %42
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %78

67:                                               ; preds = %46
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %78

69:                                               ; preds = %50
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %78

71:                                               ; preds = %57, %54
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %78

73:                                               ; preds = %56
  %74 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %55, i64 noundef 136) #8
  br label %78

75:                                               ; preds = %._crit_edge
  ret void

76:                                               ; preds = %._crit_edge
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %78

78:                                               ; preds = %63, %67, %71, %73, %69, %65, %32, %36, %34, %76
  %.pn43.pn.pn = phi { ptr, i32 } [ %77, %76 ], [ %33, %32 ], [ %35, %34 ], [ %37, %36 ], [ %64, %63 ], [ %66, %65 ], [ %68, %67 ], [ %70, %69 ], [ %72, %71 ], [ %74, %73 ]
  tail call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #9
  br label %79

79:                                               ; preds = %78, %19
  %.pn43.pn.pn.pn = phi { ptr, i32 } [ %.pn43.pn.pn, %78 ], [ %20, %19 ]
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #9
  br label %80

80:                                               ; preds = %79, %17
  %.pn43.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn43.pn.pn.pn, %79 ], [ %18, %17 ]
  tail call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #9
  br label %81

81:                                               ; preds = %80, %15
  %.pn43.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn43.pn.pn.pn.pn, %80 ], [ %16, %15 ]
  tail call void @_ZN9R3SurfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #9
  resume { ptr, i32 } %.pn43.pn.pn.pn.pn.pn
}

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

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

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

declare void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100), ptr noundef nonnull align 8 dereferenceable(100)) unnamed_addr #0

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V0Ev(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V1Ev(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK10R3Triangle2V2Ev(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #3 align 2

declare void @_ZN10R3TriangleC1EP16R3TriangleVertexS1_S1_(ptr noundef nonnull align 8 dereferenceable(132), ptr noundef, ptr noundef, ptr noundef) unnamed_addr #0

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

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #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 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


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