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

; 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.R3MeshEdge = type { ptr, [2 x ptr], [2 x ptr], double, i32, %class.RNFlags, double, i32, ptr }
%class.R3MeshVertex = type { ptr, %class.RNArray.0, %class.R3Point, %class.R3Vector, %class.R2Point, %class.RNRgb, double, i32, %class.RNFlags, double, i32, ptr }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }
%class.R2Point = type { [2 x double] }
%class.RNRgb = 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.22 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [42 x i8], align 1

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

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6R3Mesh8SwapEdgeEP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) unnamed_addr #5 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [2 x ptr], align 16
  %7 = alloca [2 x ptr], align 16
  %8 = alloca i32, align 4
  %9 = alloca [2 x [2 x ptr]], align 16
  %10 = alloca [2 x ptr], align 16
  %11 = alloca %class.RNFlags, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #8
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %class.R3MeshEdge, ptr %13, i32 0, i32 1
  %15 = getelementptr inbounds [2 x ptr], ptr %14, i64 0, i64 0
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  store ptr %16, ptr %17, align 16, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %class.R3MeshEdge, ptr %18, i32 0, i32 1
  %20 = getelementptr inbounds [2 x ptr], ptr %19, i64 0, i64 1
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  store ptr %21, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.R3MeshEdge, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds [2 x ptr], ptr %24, i64 0, i64 0
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  store ptr %26, ptr %27, align 16, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %class.R3MeshEdge, ptr %28, i32 0, i32 2
  %30 = getelementptr inbounds [2 x ptr], ptr %29, i64 0, i64 1
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  store ptr %31, ptr %32, align 8, !tbaa !5
  %33 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %34 = load ptr, ptr %33, align 16, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %40

36:                                               ; preds = %2
  %37 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %41, label %40

40:                                               ; preds = %36, %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %207

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 16, i1 false)
  %42 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %43 = load ptr, ptr %42, align 16, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %46 = load ptr, ptr %45, align 16, !tbaa !5
  %47 = call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %43, ptr noundef %44, ptr noundef %46)
  %48 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %49 = getelementptr inbounds [2 x ptr], ptr %48, i64 0, i64 0
  store ptr %47, ptr %49, align 16, !tbaa !5
  %50 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %54 = load ptr, ptr %53, align 16, !tbaa !5
  %55 = call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %51, ptr noundef %52, ptr noundef %54)
  %56 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %57 = getelementptr inbounds [2 x ptr], ptr %56, i64 0, i64 1
  store ptr %55, ptr %57, align 8, !tbaa !5
  %58 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %59 = getelementptr inbounds [2 x ptr], ptr %58, i64 0, i64 1
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %60, ptr noundef %62)
  %64 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  store ptr %63, ptr %64, align 16, !tbaa !5
  %65 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %66 = load ptr, ptr %65, align 16, !tbaa !5
  %67 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %68 = getelementptr inbounds [2 x ptr], ptr %67, i64 0, i64 0
  %69 = load ptr, ptr %68, align 16, !tbaa !5
  %70 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %71 = load ptr, ptr %70, align 16, !tbaa !5
  %72 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %69, ptr noundef %71)
  %73 = icmp eq ptr %66, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %41
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 2146, ptr noundef @.str.2)
  br label %75

75:                                               ; preds = %74, %41
  %76 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %77 = load ptr, ptr %76, align 16, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %77, ptr noundef %78, ptr noundef %80)
  %82 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %83 = getelementptr inbounds [2 x ptr], ptr %82, i64 0, i64 0
  store ptr %81, ptr %83, align 16, !tbaa !5
  %84 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %85, ptr noundef %86, ptr noundef %88)
  %90 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %91 = getelementptr inbounds [2 x ptr], ptr %90, i64 0, i64 1
  store ptr %89, ptr %91, align 8, !tbaa !5
  %92 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %93 = getelementptr inbounds [2 x ptr], ptr %92, i64 0, i64 1
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %94, ptr noundef %96)
  %98 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  store ptr %97, ptr %98, align 8, !tbaa !5
  %99 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %102 = getelementptr inbounds [2 x ptr], ptr %101, i64 0, i64 0
  %103 = load ptr, ptr %102, align 16, !tbaa !5
  %104 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %105 = load ptr, ptr %104, align 16, !tbaa !5
  %106 = call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %103, ptr noundef %105)
  %107 = icmp eq ptr %100, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %75
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.23, i32 noundef 2150, ptr noundef @.str.2)
  br label %109

109:                                              ; preds = %108, %75
  %110 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %111 = load ptr, ptr %110, align 16, !tbaa !5
  %112 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = call noundef ptr @_ZNK6R3Mesh19EdgeBetweenVerticesEPK12R3MeshVertexS2_(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %111, ptr noundef %113)
  %115 = icmp ne ptr %114, null
  br i1 %115, label %116, label %117

116:                                              ; preds = %109
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %206

117:                                              ; preds = %109
  %118 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %119 = load ptr, ptr %118, align 16, !tbaa !5
  %120 = getelementptr inbounds %class.R3MeshVertex, ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN7RNArrayIP10R3MeshEdgeE6RemoveES1_(ptr noundef nonnull align 8 dereferenceable(16) %120, ptr noundef %121)
  %122 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  %124 = getelementptr inbounds %class.R3MeshVertex, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN7RNArrayIP10R3MeshEdgeE6RemoveES1_(ptr noundef nonnull align 8 dereferenceable(16) %124, ptr noundef %125)
  %126 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %127 = load ptr, ptr %126, align 16, !tbaa !5
  %128 = getelementptr inbounds %class.R3MeshVertex, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %128, ptr noundef %129)
  %131 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = getelementptr inbounds %class.R3MeshVertex, ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %133, ptr noundef %134)
  %136 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %137 = load ptr, ptr %136, align 16, !tbaa !5
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %class.R3MeshEdge, ptr %138, i32 0, i32 1
  %140 = getelementptr inbounds [2 x ptr], ptr %139, i64 0, i64 0
  store ptr %137, ptr %140, align 8, !tbaa !5
  %141 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %class.R3MeshEdge, ptr %143, i32 0, i32 1
  %145 = getelementptr inbounds [2 x ptr], ptr %144, i64 0, i64 1
  store ptr %142, ptr %145, align 8, !tbaa !5
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %class.R3MeshEdge, ptr %146, i32 0, i32 3
  store double 0.000000e+00, ptr %147, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 0)
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %class.R3MeshEdge, ptr %148, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %149, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  %150 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %151 = load ptr, ptr %150, align 16, !tbaa !5
  %152 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %153 = load ptr, ptr %152, align 16, !tbaa !5
  %154 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %155 = load ptr, ptr %154, align 8, !tbaa !5
  %156 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 1
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %160 = getelementptr inbounds [2 x ptr], ptr %159, i64 0, i64 1
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %163 = getelementptr inbounds [2 x ptr], ptr %162, i64 0, i64 1
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = load ptr, ptr %12, align 8, !tbaa !17
  %166 = getelementptr inbounds ptr, ptr %165, i64 79
  %167 = load ptr, ptr %166, align 8
  call void %167(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %151, ptr noundef %153, ptr noundef %155, ptr noundef %157, ptr noundef %158, ptr noundef %161, ptr noundef %164)
  %168 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %169 = load ptr, ptr %168, align 16, !tbaa !5
  %170 = load ptr, ptr %12, align 8, !tbaa !17
  %171 = getelementptr inbounds ptr, ptr %170, i64 77
  %172 = load ptr, ptr %171, align 8
  call void %172(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %169)
  %173 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 0
  %174 = load ptr, ptr %173, align 16, !tbaa !5
  %175 = load ptr, ptr %12, align 8, !tbaa !17
  %176 = getelementptr inbounds ptr, ptr %175, i64 78
  %177 = load ptr, ptr %176, align 8
  call void %177(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %174)
  %178 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %179 = load ptr, ptr %178, align 8, !tbaa !5
  %180 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 1
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  %182 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  %183 = load ptr, ptr %182, align 16, !tbaa !5
  %184 = getelementptr inbounds [2 x ptr], ptr %6, i64 0, i64 0
  %185 = load ptr, ptr %184, align 16, !tbaa !5
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 0
  %188 = getelementptr inbounds [2 x ptr], ptr %187, i64 0, i64 0
  %189 = load ptr, ptr %188, align 16, !tbaa !5
  %190 = getelementptr inbounds [2 x [2 x ptr]], ptr %9, i64 0, i64 1
  %191 = getelementptr inbounds [2 x ptr], ptr %190, i64 0, i64 0
  %192 = load ptr, ptr %191, align 16, !tbaa !5
  %193 = load ptr, ptr %12, align 8, !tbaa !17
  %194 = getelementptr inbounds ptr, ptr %193, i64 79
  %195 = load ptr, ptr %194, align 8
  call void %195(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %179, ptr noundef %181, ptr noundef %183, ptr noundef %185, ptr noundef %186, ptr noundef %189, ptr noundef %192)
  %196 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = load ptr, ptr %12, align 8, !tbaa !17
  %199 = getelementptr inbounds ptr, ptr %198, i64 77
  %200 = load ptr, ptr %199, align 8
  call void %200(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %197)
  %201 = getelementptr inbounds [2 x ptr], ptr %7, i64 0, i64 1
  %202 = load ptr, ptr %201, align 8, !tbaa !5
  %203 = load ptr, ptr %12, align 8, !tbaa !17
  %204 = getelementptr inbounds ptr, ptr %203, i64 78
  %205 = load ptr, ptr %204, align 8
  call void %205(ptr noundef nonnull align 8 dereferenceable(272) %12, ptr noundef %202)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %206

206:                                              ; preds = %117, %116
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  br label %207

207:                                              ; preds = %206, %40
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #8
  %208 = load i32, ptr %3, align 4
  ret i32 %208
}

; 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) #7

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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, !11, i64 40}
!10 = !{!"_ZTS10R3MeshEdge", !7, i64 8, !7, i64 24, !11, i64 40, !12, i64 48, !13, i64 56, !11, i64 64, !12, i64 72, !6, i64 80}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS7RNFlags", !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i64 0, i64 8, !16}
!16 = !{!14, !14, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, 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 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6R3Mesh8SwapEdgeEP10R3MeshEdge(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca %class.RNFlags, align 8
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = icmp ne ptr %9, null
  %13 = icmp ne ptr %11, null
  %or.cond = select i1 %12, i1 %13, i1 false
  br i1 %or.cond, label %14, label %58

14:                                               ; preds = %2
  %15 = tail call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %5, ptr noundef nonnull %1, ptr noundef nonnull %9)
  %16 = tail call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %7, ptr noundef nonnull %1, ptr noundef nonnull %9)
  %17 = tail call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %16, ptr noundef %7)
  %18 = tail call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %15, ptr noundef %5)
  %19 = icmp eq ptr %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %14
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.22, i32 noundef 2146, ptr noundef nonnull @.str.2)
  br label %21

21:                                               ; preds = %20, %14
  %22 = tail call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %5, ptr noundef nonnull %1, ptr noundef nonnull %11)
  %23 = tail call noundef ptr @_ZNK6R3Mesh16EdgeAcrossVertexEPK12R3MeshVertexPK10R3MeshEdgePK10R3MeshFace(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %7, ptr noundef nonnull %1, ptr noundef nonnull %11)
  %24 = tail call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %23, ptr noundef %7)
  %25 = tail call noundef ptr @_ZNK6R3Mesh16VertexAcrossEdgeEPK10R3MeshEdgePK12R3MeshVertex(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %22, ptr noundef %5)
  %26 = icmp eq ptr %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %21
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.23, i32 noundef 2150, ptr noundef nonnull @.str.2)
  br label %28

28:                                               ; preds = %27, %21
  %29 = tail call noundef ptr @_ZNK6R3Mesh19EdgeBetweenVerticesEPK12R3MeshVertexS2_(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef %17, ptr noundef %24)
  %.not = icmp eq ptr %29, null
  br i1 %.not, label %30, label %58

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %5, i64 8
  tail call void @_ZN7RNArrayIP10R3MeshEdgeE6RemoveES1_(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull %1)
  %32 = getelementptr inbounds i8, ptr %7, i64 8
  tail call void @_ZN7RNArrayIP10R3MeshEdgeE6RemoveES1_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull %1)
  %33 = getelementptr inbounds i8, ptr %17, i64 8
  %34 = tail call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull %1)
  %35 = getelementptr inbounds i8, ptr %24, i64 8
  %36 = tail call noundef ptr @_ZN7RNArrayIP10R3MeshEdgeE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull %1)
  store ptr %17, ptr %4, align 8, !tbaa !5
  store ptr %24, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %1, i64 40
  store double 0.000000e+00, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN7RNFlagsC2Em(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef 0)
  %38 = getelementptr inbounds i8, ptr %1, i64 56
  %39 = load i64, ptr %3, align 8, !tbaa !15
  store i64 %39, ptr %38, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %40 = load ptr, ptr %0, align 8, !tbaa !16
  %41 = getelementptr inbounds i8, ptr %40, i64 632
  %42 = load ptr, ptr %41, align 8
  call void %42(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %9, ptr noundef %17, ptr noundef %24, ptr noundef %7, ptr noundef nonnull %1, ptr noundef %23, ptr noundef %16)
  %43 = load ptr, ptr %0, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %43, i64 616
  %45 = load ptr, ptr %44, align 8
  call void %45(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %9)
  %46 = load ptr, ptr %0, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %46, i64 624
  %48 = load ptr, ptr %47, align 8
  call void %48(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %9)
  %49 = load ptr, ptr %0, align 8, !tbaa !16
  %50 = getelementptr inbounds i8, ptr %49, i64 632
  %51 = load ptr, ptr %50, align 8
  call void %51(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %11, ptr noundef %24, ptr noundef %17, ptr noundef %5, ptr noundef nonnull %1, ptr noundef %15, ptr noundef %22)
  %52 = load ptr, ptr %0, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %52, i64 616
  %54 = load ptr, ptr %53, align 8
  call void %54(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %11)
  %55 = load ptr, ptr %0, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %55, i64 624
  %57 = load ptr, ptr %56, align 8
  call void %57(ptr noundef nonnull align 8 dereferenceable(272) %0, ptr noundef nonnull %11)
  br label %58

58:                                               ; preds = %30, %28, %2
  %.1 = phi i32 [ 0, %2 ], [ 1, %30 ], [ 0, %28 ]
  ret i32 %.1
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !11, i64 40}
!10 = !{!"_ZTS10R3MeshEdge", !7, i64 8, !7, i64 24, !11, i64 40, !12, i64 48, !13, i64 56, !11, i64 64, !12, i64 72, !6, i64 80}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS7RNFlags", !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}


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