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

; 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.RNFlags = type { i64 }
%class.R3Triangle = type <{ %class.R3Surface, [3 x ptr], %class.R3Plane, %class.R3Box, %class.RNFlags, i32, [4 x i8] }>
%class.R3Surface = type { %class.R3Shape }
%class.R3Shape = type { ptr }
%class.R3Plane = type { %class.R3Vector, double }
%class.R3Vector = type { [3 x double] }
%class.R3Box = type { %class.R3Solid, %class.R3Point, %class.R3Point }
%class.R3Solid = type { %class.R3Shape }
%class.R3Point = type { [3 x double] }

@_ZTV10R3Triangle = external dso_local unnamed_addr constant { [76 x ptr] }, align 8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10R3TriangleC2ERKS_(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(132) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  %9 = alloca %class.RNFlags, align 8
  %10 = alloca %class.RNFlags, align 8
  %11 = alloca %class.RNFlags, align 8
  %12 = alloca %class.RNFlags, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  call void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
  store ptr getelementptr inbounds inrange(-16, 592) ({ [76 x ptr] }, ptr @_ZTV10R3Triangle, i32 0, i32 0, i32 2), ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.R3Triangle, ptr %15, i32 0, i32 2
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %17 unwind label %57

17:                                               ; preds = %2
  %18 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 3
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.R3Triangle, ptr %19, i32 0, i32 3
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %18, ptr noundef nonnull align 8 dereferenceable(56) %20)
          to label %21 unwind label %57

21:                                               ; preds = %17
  %22 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 4
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.R3Triangle, ptr %23, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %24, i64 8, i1 false), !tbaa.struct !11
  %25 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.R3Triangle, ptr %26, i32 0, i32 5
  %28 = load i32, ptr %27, align 8, !tbaa !14
  store i32 %28, ptr %25, align 8, !tbaa !14
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.R3Triangle, ptr %29, i32 0, i32 1
  %31 = getelementptr inbounds [3 x ptr], ptr %30, i64 0, i64 0
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  br i1 %33, label %34, label %48

34:                                               ; preds = %21
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.R3Triangle, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds [3 x ptr], ptr %36, i64 0, i64 0
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = invoke i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %38)
          to label %40 unwind label %61

40:                                               ; preds = %34
  %41 = getelementptr inbounds %class.RNFlags, ptr %7, i32 0, i32 0
  store i64 %39, ptr %41, align 8
  invoke void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 4096)
          to label %42 unwind label %61

42:                                               ; preds = %40
  %43 = getelementptr inbounds %class.RNFlags, ptr %8, i32 0, i32 0
  %44 = load i64, ptr %43, align 8
  %45 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 %44)
          to label %46 unwind label %61

46:                                               ; preds = %42
  %47 = icmp ne i32 %45, 0
  br label %48

48:                                               ; preds = %46, %21
  %49 = phi i1 [ true, %21 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br i1 %49, label %50, label %65

50:                                               ; preds = %48
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %class.R3Triangle, ptr %51, i32 0, i32 1
  %53 = getelementptr inbounds [3 x ptr], ptr %52, i64 0, i64 0
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %56 = getelementptr inbounds [3 x ptr], ptr %55, i64 0, i64 0
  store ptr %54, ptr %56, align 8, !tbaa !5
  br label %83

57:                                               ; preds = %17, %2
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  br label %183

61:                                               ; preds = %42, %40, %34
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %5, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  br label %182

65:                                               ; preds = %48
  %66 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #10
          to label %67 unwind label %75

67:                                               ; preds = %65
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %class.R3Triangle, ptr %68, i32 0, i32 1
  %70 = getelementptr inbounds [3 x ptr], ptr %69, i64 0, i64 0
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %66, ptr noundef nonnull align 8 dereferenceable(100) %71)
          to label %72 unwind label %79

72:                                               ; preds = %67
  %73 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %74 = getelementptr inbounds [3 x ptr], ptr %73, i64 0, i64 0
  store ptr %66, ptr %74, align 8, !tbaa !5
  br label %83

75:                                               ; preds = %177, %163, %116, %65
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %5, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %6, align 4
  br label %182

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

83:                                               ; preds = %72, %50
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %class.R3Triangle, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds [3 x ptr], ptr %85, i64 0, i64 1
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  br i1 %88, label %89, label %103

89:                                               ; preds = %83
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %class.R3Triangle, ptr %90, i32 0, i32 1
  %92 = getelementptr inbounds [3 x ptr], ptr %91, i64 0, i64 1
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = invoke i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %93)
          to label %95 unwind label %112

95:                                               ; preds = %89
  %96 = getelementptr inbounds %class.RNFlags, ptr %9, i32 0, i32 0
  store i64 %94, ptr %96, align 8
  invoke void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef 4096)
          to label %97 unwind label %112

97:                                               ; preds = %95
  %98 = getelementptr inbounds %class.RNFlags, ptr %10, i32 0, i32 0
  %99 = load i64, ptr %98, align 8
  %100 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 %99)
          to label %101 unwind label %112

101:                                              ; preds = %97
  %102 = icmp ne i32 %100, 0
  br label %103

103:                                              ; preds = %101, %83
  %104 = phi i1 [ true, %83 ], [ %102, %101 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br i1 %104, label %105, label %116

105:                                              ; preds = %103
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %class.R3Triangle, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds [3 x ptr], ptr %107, i64 0, i64 1
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %111 = getelementptr inbounds [3 x ptr], ptr %110, i64 0, i64 1
  store ptr %109, ptr %111, align 8, !tbaa !5
  br label %130

112:                                              ; preds = %97, %95, %89
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %5, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %182

116:                                              ; preds = %103
  %117 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #10
          to label %118 unwind label %75

118:                                              ; preds = %116
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %class.R3Triangle, ptr %119, i32 0, i32 1
  %121 = getelementptr inbounds [3 x ptr], ptr %120, i64 0, i64 1
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %117, ptr noundef nonnull align 8 dereferenceable(100) %122)
          to label %123 unwind label %126

123:                                              ; preds = %118
  %124 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %125 = getelementptr inbounds [3 x ptr], ptr %124, i64 0, i64 1
  store ptr %117, ptr %125, align 8, !tbaa !5
  br label %130

126:                                              ; preds = %118
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %5, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %117, i64 noundef 104) #11
  br label %182

130:                                              ; preds = %123, %105
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %class.R3Triangle, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds [3 x ptr], ptr %132, i64 0, i64 2
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  br i1 %135, label %136, label %150

136:                                              ; preds = %130
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %class.R3Triangle, ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds [3 x ptr], ptr %138, i64 0, i64 2
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  %141 = invoke i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %140)
          to label %142 unwind label %159

142:                                              ; preds = %136
  %143 = getelementptr inbounds %class.RNFlags, ptr %11, i32 0, i32 0
  store i64 %141, ptr %143, align 8
  invoke void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef 4096)
          to label %144 unwind label %159

144:                                              ; preds = %142
  %145 = getelementptr inbounds %class.RNFlags, ptr %12, i32 0, i32 0
  %146 = load i64, ptr %145, align 8
  %147 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 %146)
          to label %148 unwind label %159

148:                                              ; preds = %144
  %149 = icmp ne i32 %147, 0
  br label %150

150:                                              ; preds = %148, %130
  %151 = phi i1 [ true, %130 ], [ %149, %148 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br i1 %151, label %152, label %163

152:                                              ; preds = %150
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %class.R3Triangle, ptr %153, i32 0, i32 1
  %155 = getelementptr inbounds [3 x ptr], ptr %154, i64 0, i64 2
  %156 = load ptr, ptr %155, align 8, !tbaa !5
  %157 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %158 = getelementptr inbounds [3 x ptr], ptr %157, i64 0, i64 2
  store ptr %156, ptr %158, align 8, !tbaa !5
  br label %177

159:                                              ; preds = %144, %142, %136
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %5, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %182

163:                                              ; preds = %150
  %164 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 104) #10
          to label %165 unwind label %75

165:                                              ; preds = %163
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %class.R3Triangle, ptr %166, i32 0, i32 1
  %168 = getelementptr inbounds [3 x ptr], ptr %167, i64 0, i64 2
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %164, ptr noundef nonnull align 8 dereferenceable(100) %169)
          to label %170 unwind label %173

170:                                              ; preds = %165
  %171 = getelementptr inbounds %class.R3Triangle, ptr %13, i32 0, i32 1
  %172 = getelementptr inbounds [3 x ptr], ptr %171, i64 0, i64 2
  store ptr %164, ptr %172, align 8, !tbaa !5
  br label %177

173:                                              ; preds = %165
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %5, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %164, i64 noundef 104) #11
  br label %182

177:                                              ; preds = %170, %152
  %178 = load ptr, ptr %13, align 8, !tbaa !9
  %179 = getelementptr inbounds ptr, ptr %178, i64 73
  %180 = load ptr, ptr %179, align 8
  invoke void %180(ptr noundef nonnull align 8 dereferenceable(132) %13)
          to label %181 unwind label %75

181:                                              ; preds = %177
  ret void

182:                                              ; preds = %173, %159, %126, %112, %79, %75, %61
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %18) #9
  br label %183

183:                                              ; preds = %182, %57
  call void @_ZN9R3SurfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  br label %184

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100)) #0 align 2

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

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

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

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

declare void @_ZN16R3TriangleVertexC1ERKS_(ptr, ptr)

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{i64 0, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !25, i64 128}
!15 = !{!"_ZTS10R3Triangle", !16, i64 0, !7, i64 8, !18, i64 32, !21, i64 64, !24, i64 120, !25, i64 128}
!16 = !{!"_ZTS9R3Surface", !17, i64 0}
!17 = !{!"_ZTS7R3Shape"}
!18 = !{!"_ZTS7R3Plane", !19, i64 0, !20, i64 24}
!19 = !{!"_ZTS8R3Vector", !7, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!"_ZTS5R3Box", !22, i64 0, !23, i64 8, !23, i64 32}
!22 = !{!"_ZTS7R3Solid", !17, i64 0}
!23 = !{!"_ZTS7R3Point", !7, i64 0}
!24 = !{!"_ZTS7RNFlags", !13, i64 0}
!25 = !{!"int", !7, i64 0}


; 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.RNFlags = type { i64 }

@_ZTV10R3Triangle = external dso_local unnamed_addr constant { [76 x ptr] }, align 8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) unnamed_addr #0 align 2

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

declare void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10R3TriangleC2ERKS_(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(132) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.RNFlags, align 8
  %4 = alloca %class.RNFlags, align 8
  %5 = alloca %class.RNFlags, align 8
  %6 = alloca %class.RNFlags, align 8
  %7 = alloca %class.RNFlags, align 8
  %8 = alloca %class.RNFlags, align 8
  tail call void @_ZN9R3SurfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0)
  store ptr getelementptr inbounds inrange(-16, 592) (i8, ptr @_ZTV10R3Triangle, i64 16), ptr %0, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = getelementptr inbounds i8, ptr %1, i64 32
  invoke void @_ZN7R3PlaneC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %11 unwind label %28

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = getelementptr inbounds i8, ptr %1, i64 64
  invoke void @_ZN5R3BoxC1ERKS_(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 8 dereferenceable(56) %13)
          to label %14 unwind label %28

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 120
  %16 = getelementptr inbounds i8, ptr %1, i64 120
  %17 = load i64, ptr %16, align 8, !tbaa !8
  store i64 %17, ptr %15, align 8, !tbaa !8
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  %19 = getelementptr inbounds i8, ptr %1, i64 128
  %20 = load i32, ptr %19, align 8, !tbaa !11
  store i32 %20, ptr %18, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %1, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %.not = icmp eq ptr %22, null
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  br i1 %.not, label %.critedge, label %23

23:                                               ; preds = %14
  %24 = tail call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %22)
  store i64 %24, ptr %3, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef 4096)
  %25 = load i64, ptr %4, align 8
  %26 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 %25)
          to label %27 unwind label %30

27:                                               ; preds = %23
  %.not24 = icmp eq i32 %26, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br i1 %.not24, label %32, label %._crit_edge

._crit_edge:                                      ; preds = %27
  %.pre = load ptr, ptr %21, align 8, !tbaa !23
  br label %40

.critedge:                                        ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %40

28:                                               ; preds = %11, %2
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %81

30:                                               ; preds = %23
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %80

32:                                               ; preds = %27
  %33 = invoke noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #9
          to label %34 unwind label %36

34:                                               ; preds = %32
  %35 = load ptr, ptr %21, align 8, !tbaa !23
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %33, ptr noundef nonnull align 8 dereferenceable(100) %35)
          to label %40 unwind label %38

36:                                               ; preds = %74, %68, %51, %32
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %80

38:                                               ; preds = %34
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %33, i64 noundef 104) #10
  br label %80

40:                                               ; preds = %34, %.critedge, %._crit_edge
  %.sink = phi ptr [ %.pre, %._crit_edge ], [ null, %.critedge ], [ %33, %34 ]
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %.sink, ptr %41, align 8, !tbaa !23
  %42 = getelementptr inbounds i8, ptr %1, i64 16
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  %.not25 = icmp eq ptr %43, null
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  br i1 %.not25, label %.critedge2, label %44

44:                                               ; preds = %40
  %45 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %43)
  store i64 %45, ptr %5, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef 4096)
  %46 = load i64, ptr %6, align 8
  %47 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 %46)
          to label %48 unwind label %49

48:                                               ; preds = %44
  %.not26 = icmp eq i32 %47, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br i1 %.not26, label %51, label %._crit_edge31

._crit_edge31:                                    ; preds = %48
  %.pre32 = load ptr, ptr %42, align 8, !tbaa !23
  br label %57

.critedge2:                                       ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %57

49:                                               ; preds = %44
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %80

51:                                               ; preds = %48
  %52 = invoke noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #9
          to label %53 unwind label %36

53:                                               ; preds = %51
  %54 = load ptr, ptr %42, align 8, !tbaa !23
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %52, ptr noundef nonnull align 8 dereferenceable(100) %54)
          to label %57 unwind label %55

55:                                               ; preds = %53
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %52, i64 noundef 104) #10
  br label %80

57:                                               ; preds = %53, %.critedge2, %._crit_edge31
  %.sink36 = phi ptr [ %.pre32, %._crit_edge31 ], [ null, %.critedge2 ], [ %52, %53 ]
  %58 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %.sink36, ptr %58, align 8, !tbaa !23
  %59 = getelementptr inbounds i8, ptr %1, i64 24
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %.not27 = icmp eq ptr %60, null
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  br i1 %.not27, label %.critedge4, label %61

61:                                               ; preds = %57
  %62 = call i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100) %60)
  store i64 %62, ptr %7, align 8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef 4096)
  %63 = load i64, ptr %8, align 8
  %64 = invoke noundef i32 @_ZNK7RNFlagsixES_(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 %63)
          to label %65 unwind label %66

65:                                               ; preds = %61
  %.not28 = icmp eq i32 %64, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  br i1 %.not28, label %68, label %._crit_edge33

._crit_edge33:                                    ; preds = %65
  %.pre34 = load ptr, ptr %59, align 8, !tbaa !23
  br label %74

.critedge4:                                       ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  br label %74

66:                                               ; preds = %61
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  br label %80

68:                                               ; preds = %65
  %69 = invoke noalias noundef nonnull dereferenceable(104) ptr @_Znwm(i64 noundef 104) #9
          to label %70 unwind label %36

70:                                               ; preds = %68
  %71 = load ptr, ptr %59, align 8, !tbaa !23
  invoke void @_ZN16R3TriangleVertexC1ERKS_(ptr noundef nonnull align 8 dereferenceable(100) %69, ptr noundef nonnull align 8 dereferenceable(100) %71)
          to label %74 unwind label %72

72:                                               ; preds = %70
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %69, i64 noundef 104) #10
  br label %80

74:                                               ; preds = %70, %.critedge4, %._crit_edge33
  %.sink38 = phi ptr [ %.pre34, %._crit_edge33 ], [ null, %.critedge4 ], [ %69, %70 ]
  %75 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %.sink38, ptr %75, align 8, !tbaa !23
  %76 = load ptr, ptr %0, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 584
  %78 = load ptr, ptr %77, align 8
  invoke void %78(ptr noundef nonnull align 8 dereferenceable(132) %0)
          to label %79 unwind label %36

79:                                               ; preds = %74
  ret void

80:                                               ; preds = %72, %66, %55, %49, %38, %36, %30
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %73, %72 ], [ %67, %66 ], [ %56, %55 ], [ %50, %49 ], [ %39, %38 ], [ %31, %30 ]
  call void @_ZN7R3SolidD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %12) #8
  br label %81

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i64 @_ZNK16R3TriangleVertex5FlagsEv(ptr noundef nonnull align 8 dereferenceable(100)) local_unnamed_addr #0 align 2

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

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

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

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

declare void @_ZN16R3TriangleVertexC1ERKS_(ptr, ptr) local_unnamed_addr

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !22, i64 128}
!12 = !{!"_ZTS10R3Triangle", !13, i64 0, !10, i64 8, !15, i64 32, !18, i64 64, !21, i64 120, !22, i64 128}
!13 = !{!"_ZTS9R3Surface", !14, i64 0}
!14 = !{!"_ZTS7R3Shape"}
!15 = !{!"_ZTS7R3Plane", !16, i64 0, !17, i64 24}
!16 = !{!"_ZTS8R3Vector", !10, i64 0}
!17 = !{!"double", !10, i64 0}
!18 = !{!"_ZTS5R3Box", !19, i64 0, !20, i64 8, !20, i64 32}
!19 = !{!"_ZTS7R3Solid", !14, i64 0}
!20 = !{!"_ZTS7R3Point", !10, i64 0}
!21 = !{!"_ZTS7RNFlags", !9, i64 0}
!22 = !{!"int", !10, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass