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

; 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.R3Point = type { [3 x double] }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.153 = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #3 align 2

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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1

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

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

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

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

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

declare void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1

declare void @_Z6RNFailPKcz(ptr noundef, ...) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

declare i32 @fclose(ptr noundef) #1

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

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

32:                                               ; preds = %2
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.58, ptr noundef %33)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %326

34:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %35 unwind label %50

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %206, %49, %35
  %37 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = invoke ptr @fgets(ptr noundef %37, i32 noundef 1024, ptr noundef %38)
          to label %40 unwind label %54

40:                                               ; preds = %36
  %41 = icmp ne ptr %39, null
  br i1 %41, label %42, label %207

42:                                               ; preds = %40
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %8, align 4, !tbaa !9
  %45 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %46 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %47 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %45, ptr noundef @.str.59, ptr noundef %46) #6
  %48 = icmp ne i32 %47, 1
  br i1 %48, label %49, label %58

49:                                               ; preds = %42
  br label %36, !llvm.loop !11

50:                                               ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %13, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %14, align 4
  br label %325

54:                                               ; preds = %319, %109, %105, %36
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %13, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %14, align 4
  br label %324

58:                                               ; preds = %42
  %59 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %60 = call i32 @strcmp(ptr noundef %59, ptr noundef @.str.105) #7
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %101, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %63 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %64 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %65 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %63, ptr noundef @.str.62, ptr noundef %64, ptr noundef %15, ptr noundef %16, ptr noundef %17) #6
  %66 = icmp ne i32 %65, 4
  br i1 %66, label %67, label %75

67:                                               ; preds = %62
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !9
  invoke void (ptr, ...) @_Z6RNFailPKcz(ptr noundef @.str.150, ptr noundef %68, i32 noundef %69)
          to label %70 unwind label %71

70:                                               ; preds = %67
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %88

71:                                               ; preds = %67
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %13, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %14, align 4
  br label %100

75:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %76 = load double, ptr %15, align 8, !tbaa !13
  %77 = load double, ptr %16, align 8, !tbaa !13
  %78 = load double, ptr %17, align 8, !tbaa !13
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %18, double noundef %76, double noundef %77, double noundef %78)
          to label %79 unwind label %91

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %80 = load ptr, ptr %28, align 8, !tbaa !15
  %81 = getelementptr inbounds ptr, ptr %80, i64 4
  %82 = load ptr, ptr %81, align 8
  %83 = invoke noundef ptr %82(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef null)
          to label %84 unwind label %95

84:                                               ; preds = %79
  store ptr %83, ptr %19, align 8, !tbaa !5
  %85 = load ptr, ptr %19, align 8, !tbaa !5
  %86 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef %85)
          to label %87 unwind label %95

87:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  store i32 0, ptr %7, align 4
  br label %88

88:                                               ; preds = %87, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %89 = load i32, ptr %7, align 4
  switch i32 %89, label %323 [
    i32 0, label %90
  ]

90:                                               ; preds = %88
  br label %206

91:                                               ; preds = %75
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %13, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %14, align 4
  br label %99

95:                                               ; preds = %84, %79
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %13, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %99

99:                                               ; preds = %95, %91
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  br label %100

100:                                              ; preds = %99, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %324

101:                                              ; preds = %58
  %102 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %103 = call i32 @strcmp(ptr noundef %102, ptr noundef @.str.151) #7
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %112, label %105

105:                                              ; preds = %101
  %106 = invoke noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %107 unwind label %54

107:                                              ; preds = %105
  %108 = icmp ne i32 %106, 0
  br i1 %108, label %111, label %109

109:                                              ; preds = %107
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.152, i32 noundef 5590, ptr noundef @.str.2)
          to label %110 unwind label %54

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110, %107
  br label %205

112:                                              ; preds = %101
  %113 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %114 = call i32 @strcmp(ptr noundef %113, ptr noundef @.str.153) #7
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %204, label %116

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 2, ptr %20, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %200, %116
  %118 = load i32, ptr %20, align 4, !tbaa !9
  %119 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %120 unwind label %123

120:                                              ; preds = %117
  %121 = icmp slt i32 %118, %119
  br i1 %121, label %127, label %122

122:                                              ; preds = %120
  store i32 4, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %203

123:                                              ; preds = %198, %194, %191, %188, %184, %181, %179, %171, %167, %162, %160, %152, %150, %142, %138, %129, %127, %117
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %13, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %324

127:                                              ; preds = %120
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
          to label %129 unwind label %123

129:                                              ; preds = %127
  %130 = load ptr, ptr %128, align 8, !tbaa !5
  %131 = load i32, ptr %20, align 4, !tbaa !9
  %132 = sub nsw i32 %131, 1
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %132)
          to label %134 unwind label %123

134:                                              ; preds = %129
  %135 = load ptr, ptr %133, align 8, !tbaa !5
  %136 = icmp eq ptr %130, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %134
  br label %200

138:                                              ; preds = %134
  %139 = load i32, ptr %20, align 4, !tbaa !9
  %140 = sub nsw i32 %139, 1
  %141 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %140)
          to label %142 unwind label %123

142:                                              ; preds = %138
  %143 = load ptr, ptr %141, align 8, !tbaa !5
  %144 = load i32, ptr %20, align 4, !tbaa !9
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %144)
          to label %146 unwind label %123

146:                                              ; preds = %142
  %147 = load ptr, ptr %145, align 8, !tbaa !5
  %148 = icmp eq ptr %143, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %146
  br label %200

150:                                              ; preds = %146
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
          to label %152 unwind label %123

152:                                              ; preds = %150
  %153 = load ptr, ptr %151, align 8, !tbaa !5
  %154 = load i32, ptr %20, align 4, !tbaa !9
  %155 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %154)
          to label %156 unwind label %123

156:                                              ; preds = %152
  %157 = load ptr, ptr %155, align 8, !tbaa !5
  %158 = icmp eq ptr %153, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %156
  br label %200

160:                                              ; preds = %156
  %161 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
          to label %162 unwind label %123

162:                                              ; preds = %160
  %163 = load ptr, ptr %161, align 8, !tbaa !5
  %164 = load i32, ptr %20, align 4, !tbaa !9
  %165 = sub nsw i32 %164, 1
  %166 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %165)
          to label %167 unwind label %123

167:                                              ; preds = %162
  %168 = load ptr, ptr %166, align 8, !tbaa !5
  %169 = load i32, ptr %20, align 4, !tbaa !9
  %170 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %169)
          to label %171 unwind label %123

171:                                              ; preds = %167
  %172 = load ptr, ptr %170, align 8, !tbaa !5
  %173 = load ptr, ptr %28, align 8, !tbaa !15
  %174 = getelementptr inbounds ptr, ptr %173, i64 9
  %175 = load ptr, ptr %174, align 8
  %176 = invoke noundef ptr %175(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %163, ptr noundef %168, ptr noundef %172, ptr noundef null)
          to label %177 unwind label %123

177:                                              ; preds = %171
  %178 = icmp ne ptr %176, null
  br i1 %178, label %198, label %179

179:                                              ; preds = %177
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
          to label %181 unwind label %123

181:                                              ; preds = %179
  %182 = load ptr, ptr %180, align 8, !tbaa !5
  %183 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %182)
          to label %184 unwind label %123

184:                                              ; preds = %181
  %185 = load i32, ptr %20, align 4, !tbaa !9
  %186 = sub nsw i32 %185, 1
  %187 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %186)
          to label %188 unwind label %123

188:                                              ; preds = %184
  %189 = load ptr, ptr %187, align 8, !tbaa !5
  %190 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %189)
          to label %191 unwind label %123

191:                                              ; preds = %188
  %192 = load i32, ptr %20, align 4, !tbaa !9
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %192)
          to label %194 unwind label %123

194:                                              ; preds = %191
  %195 = load ptr, ptr %193, align 8, !tbaa !5
  %196 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %195)
          to label %197 unwind label %123

197:                                              ; preds = %194
  br label %198

198:                                              ; preds = %197, %177
  invoke void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
          to label %199 unwind label %123

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199, %159, %149, %137
  %201 = load i32, ptr %20, align 4, !tbaa !9
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %20, align 4, !tbaa !9
  br label %117, !llvm.loop !17

203:                                              ; preds = %122
  br label %204

204:                                              ; preds = %203, %112
  br label %205

205:                                              ; preds = %204, %111
  br label %206

206:                                              ; preds = %205, %90
  br label %36, !llvm.loop !11

207:                                              ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %312, %207
  %209 = load i32, ptr %21, align 4, !tbaa !9
  %210 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %211 unwind label %215

211:                                              ; preds = %208
  %212 = sub nsw i32 %210, 3
  %213 = icmp sle i32 %209, %212
  br i1 %213, label %219, label %214

214:                                              ; preds = %211
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %319

215:                                              ; preds = %208
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %13, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %14, align 4
  br label %318

219:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %220 = load i32, ptr %21, align 4, !tbaa !9
  %221 = add nsw i32 %220, 0
  %222 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %221)
          to label %223 unwind label %284

223:                                              ; preds = %219
  store ptr %222, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %224 = load i32, ptr %21, align 4, !tbaa !9
  %225 = add nsw i32 %224, 1
  %226 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %225)
          to label %227 unwind label %288

227:                                              ; preds = %223
  store ptr %226, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %228 = load i32, ptr %21, align 4, !tbaa !9
  %229 = add nsw i32 %228, 2
  %230 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %12, i32 noundef %229)
          to label %231 unwind label %292

231:                                              ; preds = %227
  store ptr %230, ptr %24, align 8, !tbaa !5
  %232 = load ptr, ptr %22, align 8, !tbaa !5
  %233 = load ptr, ptr %23, align 8, !tbaa !5
  %234 = load ptr, ptr %24, align 8, !tbaa !5
  %235 = load ptr, ptr %28, align 8, !tbaa !15
  %236 = getelementptr inbounds ptr, ptr %235, i64 9
  %237 = load ptr, ptr %236, align 8
  %238 = invoke noundef ptr %237(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %232, ptr noundef %233, ptr noundef %234, ptr noundef null)
          to label %239 unwind label %292

239:                                              ; preds = %231
  %240 = icmp ne ptr %238, null
  br i1 %240, label %311, label %241

241:                                              ; preds = %239
  %242 = load ptr, ptr %22, align 8, !tbaa !5
  %243 = load ptr, ptr %24, align 8, !tbaa !5
  %244 = load ptr, ptr %23, align 8, !tbaa !5
  %245 = load ptr, ptr %28, align 8, !tbaa !15
  %246 = getelementptr inbounds ptr, ptr %245, i64 9
  %247 = load ptr, ptr %246, align 8
  %248 = invoke noundef ptr %247(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %242, ptr noundef %243, ptr noundef %244, ptr noundef null)
          to label %249 unwind label %292

249:                                              ; preds = %241
  %250 = icmp ne ptr %248, null
  br i1 %250, label %310, label %251

251:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %252 = load ptr, ptr %22, align 8, !tbaa !5
  %253 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %252)
          to label %254 unwind label %296

254:                                              ; preds = %251
  %255 = load ptr, ptr %28, align 8, !tbaa !15
  %256 = getelementptr inbounds ptr, ptr %255, i64 4
  %257 = load ptr, ptr %256, align 8
  %258 = invoke noundef ptr %257(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef nonnull align 8 dereferenceable(24) %253, ptr noundef null)
          to label %259 unwind label %296

259:                                              ; preds = %254
  store ptr %258, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %260 = load ptr, ptr %23, align 8, !tbaa !5
  %261 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %260)
          to label %262 unwind label %300

262:                                              ; preds = %259
  %263 = load ptr, ptr %28, align 8, !tbaa !15
  %264 = getelementptr inbounds ptr, ptr %263, i64 4
  %265 = load ptr, ptr %264, align 8
  %266 = invoke noundef ptr %265(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef nonnull align 8 dereferenceable(24) %261, ptr noundef null)
          to label %267 unwind label %300

267:                                              ; preds = %262
  store ptr %266, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %268 = load ptr, ptr %24, align 8, !tbaa !5
  %269 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %268)
          to label %270 unwind label %304

270:                                              ; preds = %267
  %271 = load ptr, ptr %28, align 8, !tbaa !15
  %272 = getelementptr inbounds ptr, ptr %271, i64 4
  %273 = load ptr, ptr %272, align 8
  %274 = invoke noundef ptr %273(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef nonnull align 8 dereferenceable(24) %269, ptr noundef null)
          to label %275 unwind label %304

275:                                              ; preds = %270
  store ptr %274, ptr %27, align 8, !tbaa !5
  %276 = load ptr, ptr %25, align 8, !tbaa !5
  %277 = load ptr, ptr %26, align 8, !tbaa !5
  %278 = load ptr, ptr %27, align 8, !tbaa !5
  %279 = load ptr, ptr %28, align 8, !tbaa !15
  %280 = getelementptr inbounds ptr, ptr %279, i64 9
  %281 = load ptr, ptr %280, align 8
  %282 = invoke noundef ptr %281(ptr noundef nonnull align 8 dereferenceable(272) %28, ptr noundef %276, ptr noundef %277, ptr noundef %278, ptr noundef null)
          to label %283 unwind label %304

283:                                              ; preds = %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %310

284:                                              ; preds = %219
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %13, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %14, align 4
  br label %317

288:                                              ; preds = %223
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %13, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %14, align 4
  br label %316

292:                                              ; preds = %241, %231, %227
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %13, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %14, align 4
  br label %315

296:                                              ; preds = %254, %251
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %13, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %14, align 4
  br label %309

300:                                              ; preds = %262, %259
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %13, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %14, align 4
  br label %308

304:                                              ; preds = %275, %270, %267
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %13, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %308

308:                                              ; preds = %304, %300
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %309

309:                                              ; preds = %308, %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %315

310:                                              ; preds = %283, %249
  br label %311

311:                                              ; preds = %310, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %312

312:                                              ; preds = %311
  %313 = load i32, ptr %21, align 4, !tbaa !9
  %314 = add nsw i32 %313, 3
  store i32 %314, ptr %21, align 4, !tbaa !9
  br label %208, !llvm.loop !18

315:                                              ; preds = %309, %292
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %316

316:                                              ; preds = %315, %288
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %317

317:                                              ; preds = %316, %284
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %318

318:                                              ; preds = %317, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %324

319:                                              ; preds = %214
  %320 = load ptr, ptr %6, align 8, !tbaa !5
  %321 = invoke i32 @fclose(ptr noundef %320)
          to label %322 unwind label %54

322:                                              ; preds = %319
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %323

323:                                              ; preds = %322, %88
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %326

324:                                              ; preds = %318, %123, %100, %54
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #6
  br label %325

325:                                              ; preds = %324, %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %328

326:                                              ; preds = %323, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %327 = load i32, ptr %3, align 4
  ret i32 %327

328:                                              ; preds = %325
  %329 = load ptr, ptr %13, align 8
  %330 = load i32, ptr %14, align 4
  %331 = insertvalue { ptr, i32 } poison, ptr %329, 0
  %332 = insertvalue { ptr, i32 } %331, i32 %330, 1
  resume { ptr, i32 } %332
}

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nounwind willreturn memory(read) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

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


; 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 }
%class.R3Point = type { [3 x double] }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.153 = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #3 align 2

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

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1

; 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 @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Mesh11ReadSTLFileEPKc(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca [1024 x i8], align 16
  %5 = alloca %class.RNArray, align 8
  %6 = alloca %class.RNArray, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.57)
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %12, label %13

12:                                               ; preds = %2
  tail call void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.58, ptr noundef %1)
  br label %180

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  invoke void @_ZN7RNArrayIP12R3MeshVertexEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %.preheader82 unwind label %18

.preheader82:                                     ; preds = %13
  %14 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %11)
  %.not5888 = icmp eq ptr %14, null
  br i1 %.not5888, label %.preheader, label %.lr.ph90

.preheader:                                       ; preds = %.backedge, %.preheader82
  %15 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %.not5991 = icmp slt i32 %15, 3
  br i1 %.not5991, label %._crit_edge, label %.lr.ph93

.lr.ph90:                                         ; preds = %.preheader82, %.backedge
  %.04089 = phi i32 [ %16, %.backedge ], [ 0, %.preheader82 ]
  %16 = add nuw nsw i32 %.04089, 1
  %17 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.59, ptr noundef nonnull %4) #7
  %.not67 = icmp eq i32 %17, 1
  br i1 %.not67, label %22, label %.backedge

18:                                               ; preds = %13
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %179

20:                                               ; preds = %51
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %178

22:                                               ; preds = %.lr.ph90
  %23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.105) #8
  %.not68 = icmp eq i32 %23, 0
  br i1 %.not68, label %24, label %47

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %25 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.62, ptr noundef nonnull %4, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9) #7
  %.not69 = icmp eq i32 %25, 4
  br i1 %.not69, label %29, label %26

26:                                               ; preds = %24
  invoke void (ptr, ...) @_Z6RNFailPKcz(ptr noundef nonnull @.str.150, ptr noundef %1, i32 noundef %16)
          to label %40 unwind label %27

27:                                               ; preds = %26
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %46

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  %30 = load double, ptr %7, align 8, !tbaa !5
  %31 = load double, ptr %8, align 8, !tbaa !5
  %32 = load double, ptr %9, align 8, !tbaa !5
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %10, double noundef %30, double noundef %31, double noundef %32)
          to label %33 unwind label %41

33:                                               ; preds = %29
  %34 = load ptr, ptr %0, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 32
  %36 = load ptr, ptr %35, align 8
  %37 = invoke noundef ptr %36(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef null)
          to label %38 unwind label %43

38:                                               ; preds = %33
  %39 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef %37)
          to label %.thread unwind label %43

.thread:                                          ; preds = %38
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %.backedge

40:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %177

41:                                               ; preds = %29
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %38, %33
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %45

45:                                               ; preds = %43, %41
  %.pn70 = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %46

46:                                               ; preds = %45, %27
  %.pn72 = phi { ptr, i32 } [ %28, %27 ], [ %.pn70, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %178

47:                                               ; preds = %22
  %48 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.151) #8
  %.not74 = icmp eq i32 %48, 0
  br i1 %.not74, label %49, label %52

49:                                               ; preds = %47
  %50 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %.not75 = icmp eq i32 %50, 0
  br i1 %.not75, label %51, label %.backedge

51:                                               ; preds = %49
  invoke void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.152, i32 noundef 5590, ptr noundef nonnull @.str.2)
          to label %.backedge unwind label %20

52:                                               ; preds = %47
  %53 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.153) #8
  %.not76 = icmp eq i32 %53, 0
  br i1 %.not76, label %.preheader81, label %.backedge

.preheader81:                                     ; preds = %52
  %54 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %55 = icmp sgt i32 %54, 2
  br i1 %55, label %.lr.ph, label %.backedge

56:                                               ; preds = %112, %109, %107, %104, %102, %99, %97, %90, %87, %84, %82, %76, %74, %68, %66, %59, %.lr.ph
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %178

.lr.ph:                                           ; preds = %.preheader81, %113
  %.05587 = phi i32 [ %114, %113 ], [ 2, %.preheader81 ]
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %59 unwind label %56

59:                                               ; preds = %.lr.ph
  %60 = load ptr, ptr %58, align 8, !tbaa !11
  %61 = add nsw i32 %.05587, -1
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %61)
          to label %63 unwind label %56

63:                                               ; preds = %59
  %64 = load ptr, ptr %62, align 8, !tbaa !11
  %65 = icmp eq ptr %60, %64
  br i1 %65, label %113, label %66

66:                                               ; preds = %63
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %61)
          to label %68 unwind label %56

68:                                               ; preds = %66
  %69 = load ptr, ptr %67, align 8, !tbaa !11
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.05587)
          to label %71 unwind label %56

71:                                               ; preds = %68
  %72 = load ptr, ptr %70, align 8, !tbaa !11
  %73 = icmp eq ptr %69, %72
  br i1 %73, label %113, label %74

74:                                               ; preds = %71
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %76 unwind label %56

76:                                               ; preds = %74
  %77 = load ptr, ptr %75, align 8, !tbaa !11
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.05587)
          to label %79 unwind label %56

79:                                               ; preds = %76
  %80 = load ptr, ptr %78, align 8, !tbaa !11
  %81 = icmp eq ptr %77, %80
  br i1 %81, label %113, label %82

82:                                               ; preds = %79
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %84 unwind label %56

84:                                               ; preds = %82
  %85 = load ptr, ptr %83, align 8, !tbaa !11
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %61)
          to label %87 unwind label %56

87:                                               ; preds = %84
  %88 = load ptr, ptr %86, align 8, !tbaa !11
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.05587)
          to label %90 unwind label %56

90:                                               ; preds = %87
  %91 = load ptr, ptr %89, align 8, !tbaa !11
  %92 = load ptr, ptr %0, align 8, !tbaa !9
  %93 = getelementptr inbounds i8, ptr %92, i64 72
  %94 = load ptr, ptr %93, align 8
  %95 = invoke noundef ptr %94(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %85, ptr noundef %88, ptr noundef %91, ptr noundef null)
          to label %96 unwind label %56

96:                                               ; preds = %90
  %.not77 = icmp eq ptr %95, null
  br i1 %.not77, label %97, label %112

97:                                               ; preds = %96
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %99 unwind label %56

99:                                               ; preds = %97
  %100 = load ptr, ptr %98, align 8, !tbaa !11
  %101 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %100)
          to label %102 unwind label %56

102:                                              ; preds = %99
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %61)
          to label %104 unwind label %56

104:                                              ; preds = %102
  %105 = load ptr, ptr %103, align 8, !tbaa !11
  %106 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %105)
          to label %107 unwind label %56

107:                                              ; preds = %104
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN7RNArrayIP12R3MeshVertexEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.05587)
          to label %109 unwind label %56

109:                                              ; preds = %107
  %110 = load ptr, ptr %108, align 8, !tbaa !11
  %111 = invoke noundef ptr @_ZN7RNArrayIP12R3MeshVertexE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %110)
          to label %112 unwind label %56

112:                                              ; preds = %109, %96
  invoke void @_ZN8RNVArray5EmptyEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %113 unwind label %56

113:                                              ; preds = %112, %79, %71, %63
  %114 = add nuw nsw i32 %.05587, 1
  %115 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %.lr.ph, label %.backedge, !llvm.loop !13

.backedge:                                        ; preds = %113, %52, %49, %51, %.thread, %.preheader81, %.lr.ph90
  %117 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef nonnull %11)
  %.not58 = icmp eq ptr %117, null
  br i1 %.not58, label %.preheader, label %.lr.ph90, !llvm.loop !15

._crit_edge:                                      ; preds = %173, %.preheader
  %118 = call i32 @fclose(ptr noundef nonnull %11)
  br label %177

.lr.ph93:                                         ; preds = %.preheader, %173
  %.05692 = phi i32 [ %174, %173 ], [ 0, %.preheader ]
  %119 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %.05692)
          to label %120 unwind label %161

120:                                              ; preds = %.lr.ph93
  %121 = add nuw nsw i32 %.05692, 1
  %122 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %121)
          to label %123 unwind label %163

123:                                              ; preds = %120
  %124 = add nuw nsw i32 %.05692, 2
  %125 = invoke noundef ptr @_ZNK7RNArrayIP12R3MeshVertexE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %6, i32 noundef %124)
          to label %126 unwind label %165

126:                                              ; preds = %123
  %127 = load ptr, ptr %0, align 8, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %127, i64 72
  %129 = load ptr, ptr %128, align 8
  %130 = invoke noundef ptr %129(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %119, ptr noundef %122, ptr noundef %125, ptr noundef null)
          to label %131 unwind label %165

131:                                              ; preds = %126
  %.not60 = icmp eq ptr %130, null
  br i1 %.not60, label %132, label %173

132:                                              ; preds = %131
  %133 = load ptr, ptr %0, align 8, !tbaa !9
  %134 = getelementptr inbounds i8, ptr %133, i64 72
  %135 = load ptr, ptr %134, align 8
  %136 = invoke noundef ptr %135(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %119, ptr noundef %125, ptr noundef %122, ptr noundef null)
          to label %137 unwind label %165

137:                                              ; preds = %132
  %.not61 = icmp eq ptr %136, null
  br i1 %.not61, label %138, label %173

138:                                              ; preds = %137
  %139 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %119)
  %140 = load ptr, ptr %0, align 8, !tbaa !9
  %141 = getelementptr inbounds i8, ptr %140, i64 32
  %142 = load ptr, ptr %141, align 8
  %143 = invoke noundef ptr %142(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %139, ptr noundef null)
          to label %144 unwind label %167

144:                                              ; preds = %138
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %122)
  %146 = load ptr, ptr %0, align 8, !tbaa !9
  %147 = getelementptr inbounds i8, ptr %146, i64 32
  %148 = load ptr, ptr %147, align 8
  %149 = invoke noundef ptr %148(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %145, ptr noundef null)
          to label %150 unwind label %169

150:                                              ; preds = %144
  %151 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Mesh14VertexPositionEPK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %125)
  %152 = load ptr, ptr %0, align 8, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %152, i64 32
  %154 = load ptr, ptr %153, align 8
  %155 = invoke noundef ptr %154(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull align 8 dereferenceable(24) %151, ptr noundef null)
          to label %156 unwind label %171

156:                                              ; preds = %150
  %157 = load ptr, ptr %0, align 8, !tbaa !9
  %158 = getelementptr inbounds i8, ptr %157, i64 72
  %159 = load ptr, ptr %158, align 8
  %160 = invoke noundef ptr %159(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %143, ptr noundef %149, ptr noundef %155, ptr noundef null)
          to label %173 unwind label %171

161:                                              ; preds = %.lr.ph93
  %162 = landingpad { ptr, i32 }
          cleanup
  br label %178

163:                                              ; preds = %120
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %178

165:                                              ; preds = %132, %126, %123
  %166 = landingpad { ptr, i32 }
          cleanup
  br label %178

167:                                              ; preds = %138
  %168 = landingpad { ptr, i32 }
          cleanup
  br label %178

169:                                              ; preds = %144
  %170 = landingpad { ptr, i32 }
          cleanup
  br label %178

171:                                              ; preds = %156, %150
  %172 = landingpad { ptr, i32 }
          cleanup
  br label %178

173:                                              ; preds = %156, %137, %131
  %174 = add nuw nsw i32 %.05692, 3
  %175 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %176 = add nsw i32 %175, -3
  %.not59 = icmp sgt i32 %174, %176
  br i1 %.not59, label %._crit_edge, label %.lr.ph93, !llvm.loop !16

177:                                              ; preds = %40, %._crit_edge
  %.3 = phi i32 [ 0, %40 ], [ 1, %._crit_edge ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  br label %180

178:                                              ; preds = %161, %165, %169, %171, %167, %163, %56, %46, %20
  %.pn78 = phi { ptr, i32 } [ %57, %56 ], [ %21, %20 ], [ %.pn72, %46 ], [ %162, %161 ], [ %164, %163 ], [ %166, %165 ], [ %168, %167 ], [ %172, %171 ], [ %170, %169 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  br label %179

179:                                              ; preds = %178, %18
  %.pn78.pn = phi { ptr, i32 } [ %.pn78, %178 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn78.pn

180:                                              ; preds = %177, %12
  %.4 = phi i32 [ %.3, %177 ], [ 0, %12 ]
  ret i32 %.4
}

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 = { nofree 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

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


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