; LLVM IR from niessner/Matterport :: code/gaps/apps/mpview/mp.ll (ZN7MPHouse12ReadMeshFileEPKc)

; 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.RNMap.22 = type { ptr }
%struct.MPHouse = type { %class.RNArray.0, %class.RNArray.1, %class.RNArray.2, %class.RNArray.3, %class.RNArray.4, %class.RNArray.5, %class.RNArray.6, %class.RNArray.7, %class.RNArray.8, %class.RNArray.9, %class.RGBDConfiguration, ptr, ptr, %class.R3Box, ptr, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.RNArray.1 = type { %class.RNVArray }
%class.RNArray.2 = type { %class.RNVArray }
%class.RNArray.3 = type { %class.RNVArray }
%class.RNArray.4 = type { %class.RNVArray }
%class.RNArray.5 = type { %class.RNVArray }
%class.RNArray.6 = type { %class.RNVArray }
%class.RNArray.7 = type { %class.RNVArray }
%class.RNArray.8 = type { %class.RNVArray }
%class.RNArray.9 = type { %class.RNVArray }
%class.RGBDConfiguration = type { ptr, %class.RNArray.10, %class.RNArray.11, ptr, ptr, ptr, ptr, %class.R3Box }
%class.RNArray.10 = type { %class.RNVArray }
%class.RNArray.11 = type { %class.RNVArray }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Point = type { [3 x double] }
%struct.MPSegment = type <{ ptr, i32, [4 x i8], ptr, i32, [4 x i8], ptr, %class.RNArray.12, double, %class.R3Point, %class.R3Box, i32, [4 x i8] }>
%class.RNArray.12 = type { %class.RNVArray }

@stderr = external global ptr, align 8
@.str.67 = external hidden unnamed_addr constant [32 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) #5 align 2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #6

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7MPHouse12ReadMeshFileEPKc(ptr noundef nonnull align 8 dereferenceable(376) %0, ptr noundef %1) #2 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 %class.RNMap.22, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 272) #9
  invoke void @_ZN6R3MeshC1Ev(ptr noundef nonnull align 8 dereferenceable(272) %17)
          to label %18 unwind label %27

18:                                               ; preds = %2
  %19 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  store ptr %17, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = icmp ne ptr %21, null
  br i1 %22, label %31, label %23

23:                                               ; preds = %18
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.67, ptr noundef %25) #10
  store i32 0, ptr %3, align 4
  br label %162

27:                                               ; preds = %2
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %6, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 272) #11
  br label %164

31:                                               ; preds = %18
  %32 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %33, align 8, !tbaa !30
  %36 = getelementptr inbounds ptr, ptr %35, i64 48
  %37 = load ptr, ptr %36, align 8
  %38 = call noundef i32 %37(ptr noundef nonnull align 8 dereferenceable(272) %33, ptr noundef %34)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %49, label %40

40:                                               ; preds = %31
  %41 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = icmp eq ptr %42, null
  br i1 %43, label %48, label %44

44:                                               ; preds = %40
  %45 = load ptr, ptr %42, align 8, !tbaa !30
  %46 = getelementptr inbounds ptr, ptr %45, i64 1
  %47 = load ptr, ptr %46, align 8
  call void %47(ptr noundef nonnull align 8 dereferenceable(272) %42) #10
  br label %48

48:                                               ; preds = %44, %40
  store i32 0, ptr %3, align 4
  br label %162

49:                                               ; preds = %31
  %50 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 3
  %51 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %53, label %157

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  call void @_ZN5RNMapIiP9MPSegmentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  store i32 0, ptr %9, align 4, !tbaa !32
  br label %54

54:                                               ; preds = %75, %53
  %55 = load i32, ptr %9, align 4, !tbaa !32
  %56 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 3
  %57 = invoke noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %56)
          to label %58 unwind label %61

58:                                               ; preds = %54
  %59 = icmp slt i32 %55, %57
  br i1 %59, label %65, label %60

60:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  br label %83

61:                                               ; preds = %54
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  br label %82

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %66 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 3
  %67 = load i32, ptr %9, align 4, !tbaa !32
  %68 = invoke noundef ptr @_ZNK7RNArrayIP9MPSegmentE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %66, i32 noundef %67)
          to label %69 unwind label %78

69:                                               ; preds = %65
  store ptr %68, ptr %10, align 8, !tbaa !5
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.MPSegment, ptr %70, i32 0, i32 11
  %72 = load i32, ptr %71, align 8, !tbaa !33
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN5RNMapIiP9MPSegmentE6InsertEiS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %72, ptr noundef %73)
          to label %74 unwind label %78

74:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %9, align 4, !tbaa !32
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %9, align 4, !tbaa !32
  br label %54, !llvm.loop !37

78:                                               ; preds = %69, %65
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  br label %82

82:                                               ; preds = %78, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  br label %156

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

84:                                               ; preds = %149, %83
  %85 = load i32, ptr %11, align 4, !tbaa !32
  %86 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = invoke noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %87)
          to label %89 unwind label %92

89:                                               ; preds = %84
  %90 = icmp slt i32 %85, %88
  br i1 %90, label %96, label %91

91:                                               ; preds = %89
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %155

92:                                               ; preds = %84
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %6, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %7, align 4
  br label %154

96:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %97 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = load i32, ptr %11, align 4, !tbaa !32
  %100 = invoke noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %98, i32 noundef %99)
          to label %101 unwind label %110

101:                                              ; preds = %96
  store ptr %100, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  %102 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = invoke noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %103, ptr noundef %104)
          to label %106 unwind label %114

106:                                              ; preds = %101
  store i32 %105, ptr %14, align 4, !tbaa !32
  %107 = load i32, ptr %14, align 4, !tbaa !32
  %108 = icmp slt i32 %107, 0
  br i1 %108, label %109, label %118

109:                                              ; preds = %106
  store i32 7, ptr %12, align 4
  br label %146

110:                                              ; preds = %96
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %6, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %7, align 4
  br label %153

114:                                              ; preds = %101
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %6, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %7, align 4
  br label %152

118:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  store ptr null, ptr %15, align 8, !tbaa !5
  %119 = load i32, ptr %14, align 4, !tbaa !32
  %120 = invoke noundef i32 @_ZNK5RNMapIiP9MPSegmentE4FindEiPS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %119, ptr noundef %15)
          to label %121 unwind label %141

121:                                              ; preds = %118
  %122 = icmp ne i32 %120, 0
  br i1 %122, label %123, label %145

123:                                              ; preds = %121
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.MPSegment, ptr %124, i32 0, i32 10
  %126 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %127, ptr noundef %128)
          to label %130 unwind label %141

130:                                              ; preds = %123
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %125, ptr noundef nonnull align 8 dereferenceable(56) %129)
          to label %131 unwind label %141

131:                                              ; preds = %130
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.MPSegment, ptr %132, i32 0, i32 7
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = invoke noundef ptr @_ZN7RNArrayIP10R3MeshFaceE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %133, ptr noundef %134)
          to label %136 unwind label %141

136:                                              ; preds = %131
  %137 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = load ptr, ptr %15, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.MPSegment, ptr %139, i32 0, i32 6
  store ptr %138, ptr %140, align 8, !tbaa !39
  br label %145

141:                                              ; preds = %131, %130, %123, %118
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %6, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  br label %152

145:                                              ; preds = %136, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  store i32 0, ptr %12, align 4
  br label %146

146:                                              ; preds = %145, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  %147 = load i32, ptr %12, align 4
  switch i32 %147, label %169 [
    i32 0, label %148
    i32 7, label %149
  ]

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148, %146
  %150 = load i32, ptr %11, align 4, !tbaa !32
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %11, align 4, !tbaa !32
  br label %84, !llvm.loop !40

152:                                              ; preds = %141, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  br label %153

153:                                              ; preds = %152, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %154

154:                                              ; preds = %153, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %156

155:                                              ; preds = %91
  call void @_ZN5RNMapIiP9MPSegmentED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %157

156:                                              ; preds = %154, %82
  call void @_ZN5RNMapIiP9MPSegmentED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %164

157:                                              ; preds = %155, %49
  %158 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 13
  %159 = getelementptr inbounds %struct.MPHouse, ptr %16, i32 0, i32 12
  %160 = load ptr, ptr %159, align 8, !tbaa !9
  %161 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh4BBoxEv(ptr noundef nonnull align 8 dereferenceable(272) %160)
  call void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %158, ptr noundef nonnull align 8 dereferenceable(56) %161)
  store i32 1, ptr %3, align 4
  br label %162

162:                                              ; preds = %157, %48, %23
  %163 = load i32, ptr %3, align 4
  ret i32 %163

164:                                              ; preds = %156, %27
  %165 = load ptr, ptr %6, align 8
  %166 = load i32, ptr %7, align 4
  %167 = insertvalue { ptr, i32 } poison, ptr %165, 0
  %168 = insertvalue { ptr, i32 } %167, i32 %166, 1
  resume { ptr, i32 } %168

169:                                              ; preds = %146
  unreachable
}

declare void @_ZN6R3MeshC1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #0 align 2

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

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh4BBoxEv(ptr noundef nonnull align 8 dereferenceable(272)) #0 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 296}
!10 = !{!"_ZTS7MPHouse", !11, i64 0, !14, i64 16, !15, i64 32, !16, i64 48, !17, i64 64, !18, i64 80, !19, i64 96, !20, i64 112, !21, i64 128, !22, i64 144, !23, i64 160, !6, i64 288, !6, i64 296, !26, i64 304, !6, i64 360, !6, i64 368}
!11 = !{!"_ZTS7RNArrayIP7MPImageE", !12, i64 0}
!12 = !{!"_ZTS8RNVArray", !6, i64 0, !13, i64 8, !13, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS7RNArrayIP10MPPanoramaE", !12, i64 0}
!15 = !{!"_ZTS7RNArrayIP10MPCategoryE", !12, i64 0}
!16 = !{!"_ZTS7RNArrayIP9MPSegmentE", !12, i64 0}
!17 = !{!"_ZTS7RNArrayIP8MPObjectE", !12, i64 0}
!18 = !{!"_ZTS7RNArrayIP8MPVertexE", !12, i64 0}
!19 = !{!"_ZTS7RNArrayIP9MPSurfaceE", !12, i64 0}
!20 = !{!"_ZTS7RNArrayIP8MPRegionE", !12, i64 0}
!21 = !{!"_ZTS7RNArrayIP8MPPortalE", !12, i64 0}
!22 = !{!"_ZTS7RNArrayIP7MPLevelE", !12, i64 0}
!23 = !{!"_ZTS17RGBDConfiguration", !24, i64 8, !25, i64 24, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !26, i64 72}
!24 = !{!"_ZTS7RNArrayIP9RGBDImageE", !12, i64 0}
!25 = !{!"_ZTS7RNArrayIP11RGBDSurfaceE", !12, i64 0}
!26 = !{!"_ZTS5R3Box", !27, i64 0, !29, i64 8, !29, i64 32}
!27 = !{!"_ZTS7R3Solid", !28, i64 0}
!28 = !{!"_ZTS7R3Shape"}
!29 = !{!"_ZTS7R3Point", !7, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, i64 0}
!32 = !{!13, !13, i64 0}
!33 = !{!34, !13, i64 144}
!34 = !{!"_ZTS9MPSegment", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !35, i64 40, !36, i64 56, !29, i64 64, !26, i64 88, !13, i64 144}
!35 = !{!"_ZTS7RNArrayIP10R3MeshFaceE", !12, i64 0}
!36 = !{!"double", !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!34, !6, i64 32}
!40 = distinct !{!40, !38}


; 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.RNMap.22 = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272), i32 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN7MPHouse12ReadMeshFileEPKc(ptr noundef nonnull align 8 dereferenceable(376) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNMap.22, align 8
  %4 = alloca ptr, align 8
  %5 = tail call noalias noundef nonnull dereferenceable(272) ptr @_Znwm(i64 noundef 272) #8
  invoke void @_ZN6R3MeshC1Ev(ptr noundef nonnull align 8 dereferenceable(272) %5)
          to label %6 unwind label %12

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 296
  store ptr %5, ptr %7, align 8, !tbaa !5
  %8 = load ptr, ptr %5, align 8, !tbaa !29
  %9 = getelementptr inbounds i8, ptr %8, i64 384
  %10 = load ptr, ptr %9, align 8
  %11 = tail call noundef i32 %10(ptr noundef nonnull align 8 dereferenceable(272) %5, ptr noundef %1)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %14, label %21

12:                                               ; preds = %2
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %5, i64 noundef 272) #9
  br label %80

14:                                               ; preds = %6
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %79, label %17

17:                                               ; preds = %14
  %18 = load ptr, ptr %15, align 8, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load ptr, ptr %19, align 8
  tail call void %20(ptr noundef nonnull align 8 dereferenceable(272) %15) #10
  br label %79

21:                                               ; preds = %6
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  %23 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %75

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  call void @_ZN5RNMapIiP9MPSegmentEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %26 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %35, %25
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %28)
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph33, label %._crit_edge

.lr.ph:                                           ; preds = %25, %35
  %.02331 = phi i32 [ %36, %35 ], [ 0, %25 ]
  %31 = invoke noundef ptr @_ZNK7RNArrayIP9MPSegmentE3KthEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %.02331)
          to label %32 unwind label %39

32:                                               ; preds = %.lr.ph
  %33 = getelementptr inbounds i8, ptr %31, i64 144
  %34 = load i32, ptr %33, align 8, !tbaa !31
  invoke void @_ZN5RNMapIiP9MPSegmentE6InsertEiS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %34, ptr noundef nonnull %31)
          to label %35 unwind label %39

35:                                               ; preds = %32
  %36 = add nuw nsw i32 %.02331, 1
  %37 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %.preheader, !llvm.loop !35

39:                                               ; preds = %32, %.lr.ph
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %74

._crit_edge:                                      ; preds = %69, %.preheader
  call void @_ZN5RNMapIiP9MPSegmentED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %75

.lr.ph33:                                         ; preds = %.preheader, %69
  %.01932 = phi i32 [ %70, %69 ], [ 0, %.preheader ]
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK6R3Mesh4FaceEi(ptr noundef nonnull align 8 dereferenceable(272) %41, i32 noundef %.01932)
          to label %43 unwind label %47

43:                                               ; preds = %.lr.ph33
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = call noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %44, ptr noundef %42)
  %46 = icmp slt i32 %45, 0
  br i1 %46, label %69, label %49

47:                                               ; preds = %.lr.ph33
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %74

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  store ptr null, ptr %4, align 8, !tbaa !37
  %50 = invoke noundef i32 @_ZNK5RNMapIiP9MPSegmentE4FindEiPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %45, ptr noundef nonnull %4)
          to label %51 unwind label %66

51:                                               ; preds = %49
  %.not26 = icmp eq i32 %50, 0
  br i1 %.not26, label %68, label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %4, align 8, !tbaa !37
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %54, ptr noundef %42)
          to label %56 unwind label %66

56:                                               ; preds = %52
  %57 = getelementptr inbounds i8, ptr %53, i64 88
  invoke void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %57, ptr noundef nonnull align 8 dereferenceable(56) %55)
          to label %58 unwind label %66

58:                                               ; preds = %56
  %59 = load ptr, ptr %4, align 8, !tbaa !37
  %60 = getelementptr inbounds i8, ptr %59, i64 40
  %61 = invoke noundef ptr @_ZN7RNArrayIP10R3MeshFaceE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef %42)
          to label %62 unwind label %66

62:                                               ; preds = %58
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load ptr, ptr %4, align 8, !tbaa !37
  %65 = getelementptr inbounds i8, ptr %64, i64 32
  store ptr %63, ptr %65, align 8, !tbaa !38
  br label %68

66:                                               ; preds = %58, %56, %52, %49
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  br label %74

68:                                               ; preds = %62, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  br label %69

69:                                               ; preds = %43, %68
  %70 = add nuw nsw i32 %.01932, 1
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = call noundef i32 @_ZNK6R3Mesh6NFacesEv(ptr noundef nonnull align 8 dereferenceable(272) %71)
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %.lr.ph33, label %._crit_edge, !llvm.loop !39

74:                                               ; preds = %47, %66, %39
  %.pn28 = phi { ptr, i32 } [ %40, %39 ], [ %67, %66 ], [ %48, %47 ]
  call void @_ZN5RNMapIiP9MPSegmentED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %80

75:                                               ; preds = %._crit_edge, %21
  %76 = getelementptr inbounds i8, ptr %0, i64 304
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh4BBoxEv(ptr noundef nonnull align 8 dereferenceable(272) %77)
  call void @_ZN5R3Box5UnionERKS_(ptr noundef nonnull align 8 dereferenceable(56) %76, ptr noundef nonnull align 8 dereferenceable(56) %78)
  br label %79

79:                                               ; preds = %14, %17, %75
  %.0 = phi i32 [ 1, %75 ], [ 0, %17 ], [ 0, %14 ]
  ret i32 %.0

80:                                               ; preds = %74, %12
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %74 ], [ %13, %12 ]
  resume { ptr, i32 } %.pn28.pn
}

declare void @_ZN6R3MeshC1Ev(ptr noundef nonnull align 8 dereferenceable(272)) unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Mesh12FaceMaterialEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #0 align 2

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

declare noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh8FaceBBoxEPK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272), ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5RNMapIiP9MPSegmentED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNK6R3Mesh4BBoxEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }
attributes #10 = { 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, !9, i64 296}
!6 = !{!"_ZTS7MPHouse", !7, i64 0, !13, i64 16, !14, i64 32, !15, i64 48, !16, i64 64, !17, i64 80, !18, i64 96, !19, i64 112, !20, i64 128, !21, i64 144, !22, i64 160, !9, i64 288, !9, i64 296, !25, i64 304, !9, i64 360, !9, i64 368}
!7 = !{!"_ZTS7RNArrayIP7MPImageE", !8, i64 0}
!8 = !{!"_ZTS8RNVArray", !9, i64 0, !12, i64 8, !12, i64 12}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"_ZTS7RNArrayIP10MPPanoramaE", !8, i64 0}
!14 = !{!"_ZTS7RNArrayIP10MPCategoryE", !8, i64 0}
!15 = !{!"_ZTS7RNArrayIP9MPSegmentE", !8, i64 0}
!16 = !{!"_ZTS7RNArrayIP8MPObjectE", !8, i64 0}
!17 = !{!"_ZTS7RNArrayIP8MPVertexE", !8, i64 0}
!18 = !{!"_ZTS7RNArrayIP9MPSurfaceE", !8, i64 0}
!19 = !{!"_ZTS7RNArrayIP8MPRegionE", !8, i64 0}
!20 = !{!"_ZTS7RNArrayIP8MPPortalE", !8, i64 0}
!21 = !{!"_ZTS7RNArrayIP7MPLevelE", !8, i64 0}
!22 = !{!"_ZTS17RGBDConfiguration", !23, i64 8, !24, i64 24, !9, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !25, i64 72}
!23 = !{!"_ZTS7RNArrayIP9RGBDImageE", !8, i64 0}
!24 = !{!"_ZTS7RNArrayIP11RGBDSurfaceE", !8, i64 0}
!25 = !{!"_ZTS5R3Box", !26, i64 0, !28, i64 8, !28, i64 32}
!26 = !{!"_ZTS7R3Solid", !27, i64 0}
!27 = !{!"_ZTS7R3Shape"}
!28 = !{!"_ZTS7R3Point", !10, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !11, i64 0}
!31 = !{!32, !12, i64 144}
!32 = !{!"_ZTS9MPSegment", !9, i64 0, !12, i64 8, !9, i64 16, !12, i64 24, !9, i64 32, !33, i64 40, !34, i64 56, !28, i64 64, !25, i64 88, !12, i64 144}
!33 = !{!"_ZTS7RNArrayIP10R3MeshFaceE", !8, i64 0}
!34 = !{!"double", !10, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!9, !9, i64 0}
!38 = !{!32, !9, i64 32}
!39 = distinct !{!39, !36}


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