; LLVM IR from ThePhysicsGuys/Physics3D :: Physics3D/geometry/shapeBuilder.ll (ZN3P3D12ShapeBuilder8addPointENS_6VectorIfLm3EEEi)

; 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"

%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x float] }
%"struct.P3D::Triangle" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32, i32, i32 }
%"struct.P3D::TriangleNeighbors" = type { %union.anon.2 }
%union.anon.2 = type { %struct.anon.3 }
%struct.anon.3 = type { i32, i32, i32 }
%"class.P3D::ShapeBuilder" = type { ptr, ptr, i32, i32, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeBuilder8addPointENS_6VectorIfLm3EEEi(ptr noundef nonnull align 8 dereferenceable(32) %0, <2 x float> %1, float %2, i32 noundef %3) #0 align 2 {
  %5 = alloca %"struct.P3D::Vector", align 4
  %6 = alloca { <2 x float>, float }, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.P3D::Triangle", align 4
  %14 = alloca %"struct.P3D::TriangleNeighbors", align 4
  %15 = alloca %"struct.P3D::Triangle", align 4
  %16 = alloca %"struct.P3D::Triangle", align 4
  %17 = alloca %"struct.P3D::Triangle", align 4
  %18 = getelementptr inbounds { <2 x float>, float }, ptr %6, i32 0, i32 0
  store <2 x float> %1, ptr %18, align 4
  %19 = getelementptr inbounds { <2 x float>, float }, ptr %6, i32 0, i32 1
  store float %2, ptr %19, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %6, i64 12, i1 false)
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %20 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %21 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 2
  %22 = load i32, ptr %21, align 8, !tbaa !11
  store i32 %22, ptr %9, align 4, !tbaa !9
  %23 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %"struct.P3D::Vector", ptr %24, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %5, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %28 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %28, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %29 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 3
  %30 = load i32, ptr %29, align 4, !tbaa !16
  store i32 %30, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %31 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 3
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  %34 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %"struct.P3D::Triangle", ptr %35, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %38, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %39 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !18
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %40, i64 %42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %43, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #5
  %44 = getelementptr inbounds %"struct.P3D::Triangle", ptr %15, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon.1, ptr %44, i32 0, i32 0
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 0)
  %47 = load i32, ptr %46, align 4, !tbaa !9
  store i32 %47, ptr %45, align 4, !tbaa !19
  %48 = getelementptr inbounds %struct.anon.1, ptr %44, i32 0, i32 1
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 1)
  %50 = load i32, ptr %49, align 4, !tbaa !9
  store i32 %50, ptr %48, align 4, !tbaa !21
  %51 = getelementptr inbounds %struct.anon.1, ptr %44, i32 0, i32 2
  %52 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %52, ptr %51, align 4, !tbaa !22
  %53 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %"struct.P3D::Triangle", ptr %54, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 4 %15, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  %58 = getelementptr inbounds %"struct.P3D::Triangle", ptr %16, i32 0, i32 0
  %59 = getelementptr inbounds %struct.anon.1, ptr %58, i32 0, i32 0
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 1)
  %61 = load i32, ptr %60, align 4, !tbaa !9
  store i32 %61, ptr %59, align 4, !tbaa !19
  %62 = getelementptr inbounds %struct.anon.1, ptr %58, i32 0, i32 1
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 2)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  store i32 %64, ptr %62, align 4, !tbaa !21
  %65 = getelementptr inbounds %struct.anon.1, ptr %58, i32 0, i32 2
  %66 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %66, ptr %65, align 4, !tbaa !22
  %67 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %"struct.P3D::Triangle", ptr %68, i64 %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %71, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #5
  %72 = getelementptr inbounds %"struct.P3D::Triangle", ptr %17, i32 0, i32 0
  %73 = getelementptr inbounds %struct.anon.1, ptr %72, i32 0, i32 0
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 2)
  %75 = load i32, ptr %74, align 4, !tbaa !9
  store i32 %75, ptr %73, align 4, !tbaa !19
  %76 = getelementptr inbounds %struct.anon.1, ptr %72, i32 0, i32 1
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 0)
  %78 = load i32, ptr %77, align 4, !tbaa !9
  store i32 %78, ptr %76, align 4, !tbaa !21
  %79 = getelementptr inbounds %struct.anon.1, ptr %72, i32 0, i32 2
  %80 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %80, ptr %79, align 4, !tbaa !22
  %81 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %"struct.P3D::Triangle", ptr %82, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %85, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #5
  %86 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !11
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %86, align 8, !tbaa !11
  %89 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !16
  %91 = add nsw i32 %90, 2
  store i32 %91, ptr %89, align 4, !tbaa !16
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !18
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %94, i64 %96
  %98 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.anon.3, ptr %98, i32 0, i32 0
  store i32 %92, ptr %99, align 4, !tbaa !15
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !18
  %103 = load i32, ptr %11, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %102, i64 %104
  %106 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %struct.anon.3, ptr %106, i32 0, i32 1
  store i32 %100, ptr %107, align 4, !tbaa !15
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %110 = load ptr, ptr %109, align 8, !tbaa !18
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %110, i64 %112
  %114 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.anon.3, ptr %114, i32 0, i32 0
  store i32 %108, ptr %115, align 4, !tbaa !15
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %118 = load ptr, ptr %117, align 8, !tbaa !18
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %118, i64 %120
  %122 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.anon.3, ptr %122, i32 0, i32 1
  store i32 %116, ptr %123, align 4, !tbaa !15
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = load i32, ptr %12, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %126, i64 %128
  %130 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds %struct.anon.3, ptr %130, i32 0, i32 0
  store i32 %124, ptr %131, align 4, !tbaa !15
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !18
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %134, i64 %136
  %138 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %137, i32 0, i32 0
  %139 = getelementptr inbounds %struct.anon.3, ptr %138, i32 0, i32 1
  store i32 %132, ptr %139, align 4, !tbaa !15
  %140 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %141 = getelementptr inbounds %struct.anon.3, ptr %140, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %144 = load ptr, ptr %143, align 8, !tbaa !18
  %145 = load i32, ptr %10, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %144, i64 %146
  %148 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds %struct.anon.3, ptr %148, i32 0, i32 2
  store i32 %142, ptr %149, align 4, !tbaa !15
  %150 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %151 = getelementptr inbounds %struct.anon.3, ptr %150, i32 0, i32 0
  %152 = load i32, ptr %151, align 4, !tbaa !15
  %153 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %154 = load ptr, ptr %153, align 8, !tbaa !18
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %154, i64 %156
  %158 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %struct.anon.3, ptr %158, i32 0, i32 2
  store i32 %152, ptr %159, align 4, !tbaa !15
  %160 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %161 = getelementptr inbounds %struct.anon.3, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !15
  %163 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %164 = load ptr, ptr %163, align 8, !tbaa !18
  %165 = load i32, ptr %12, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %164, i64 %166
  %168 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds %struct.anon.3, ptr %168, i32 0, i32 2
  store i32 %162, ptr %169, align 4, !tbaa !15
  %170 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %171 = load ptr, ptr %170, align 8, !tbaa !18
  %172 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %173 = getelementptr inbounds %struct.anon.3, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !15
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %171, i64 %175
  %177 = load i32, ptr %8, align 4, !tbaa !9
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %176, i32 noundef %177, i32 noundef %178)
  %180 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !18
  %182 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %183 = getelementptr inbounds %struct.anon.3, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 4, !tbaa !15
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %181, i64 %185
  %187 = load i32, ptr %8, align 4, !tbaa !9
  %188 = load i32, ptr %11, align 4, !tbaa !9
  %189 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %186, i32 noundef %187, i32 noundef %188)
  %190 = getelementptr inbounds %"class.P3D::ShapeBuilder", ptr %20, i32 0, i32 4
  %191 = load ptr, ptr %190, align 8, !tbaa !18
  %192 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %14, i32 0, i32 0
  %193 = getelementptr inbounds %struct.anon.3, ptr %192, i32 0, i32 1
  %194 = load i32, ptr %193, align 4, !tbaa !15
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %191, i64 %195
  %197 = load i32, ptr %8, align 4, !tbaa !9
  %198 = load i32, ptr %12, align 4, !tbaa !9
  %199 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %196, i32 noundef %197, i32 noundef %198)
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) #3 align 2

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

declare noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef) #4

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

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

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


; 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"

%"struct.P3D::Triangle" = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32, i32, i32 }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x float] }
%"struct.P3D::TriangleNeighbors" = type { %union.anon.2 }
%union.anon.2 = type { %struct.anon.3 }
%struct.anon.3 = type { i32, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D12ShapeBuilder8addPointENS_6VectorIfLm3EEEi(ptr nocapture noundef nonnull align 8 dereferenceable(32) %0, <2 x float> %1, float %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = alloca %"struct.P3D::Triangle", align 4
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %0, align 8, !tbaa !11
  %9 = sext i32 %7 to i64
  %10 = getelementptr inbounds %"struct.P3D::Vector", ptr %8, i64 %9
  store <2 x float> %1, ptr %10, align 4
  %.sroa.244.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  store float %2, ptr %.sroa.244.0..sroa_idx, align 4, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %0, i64 20
  %12 = load i32, ptr %11, align 4, !tbaa !13
  %13 = add nsw i32 %12, 1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = sext i32 %3 to i64
  %17 = getelementptr inbounds %"struct.P3D::Triangle", ptr %15, i64 %16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %17, i64 12, i1 false), !tbaa.struct !15
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %19, i64 %16
  %.sroa.07.0.copyload = load i32, ptr %20, align 4
  %.sroa.59.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 4
  %.sroa.59.0.copyload = load i32, ptr %.sroa.59.0..sroa_idx, align 4
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  %.sroa.7.0.copyload = load i32, ptr %.sroa.7.0..sroa_idx, align 4, !tbaa !12
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 0)
  %22 = load i32, ptr %21, align 4, !tbaa !17
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 1)
  %24 = load i32, ptr %23, align 4, !tbaa !17
  %25 = load ptr, ptr %14, align 8, !tbaa !14
  %26 = getelementptr inbounds %"struct.P3D::Triangle", ptr %25, i64 %16
  store i32 %22, ptr %26, align 4
  %.sroa.45.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 4
  store i32 %24, ptr %.sroa.45.0..sroa_idx, align 4
  %.sroa.56.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 8
  store i32 %7, ptr %.sroa.56.0..sroa_idx, align 4, !tbaa !12
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 1)
  %28 = load i32, ptr %27, align 4, !tbaa !17
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 2)
  %30 = load i32, ptr %29, align 4, !tbaa !17
  %31 = load ptr, ptr %14, align 8, !tbaa !14
  %32 = sext i32 %12 to i64
  %33 = getelementptr inbounds %"struct.P3D::Triangle", ptr %31, i64 %32
  store i32 %28, ptr %33, align 4
  %.sroa.42.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 4
  store i32 %30, ptr %.sroa.42.0..sroa_idx, align 4
  %.sroa.53.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 8
  store i32 %7, ptr %.sroa.53.0..sroa_idx, align 4, !tbaa !12
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 2)
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 0)
  %37 = load i32, ptr %36, align 4, !tbaa !17
  %38 = load ptr, ptr %14, align 8, !tbaa !14
  %39 = sext i32 %13 to i64
  %40 = getelementptr inbounds %"struct.P3D::Triangle", ptr %38, i64 %39
  store i32 %35, ptr %40, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 4
  store i32 %37, ptr %.sroa.4.0..sroa_idx, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 8
  store i32 %7, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !12
  %41 = load <2 x i32>, ptr %6, align 8, !tbaa !17
  %42 = add nsw <2 x i32> %41, <i32 1, i32 2>
  store <2 x i32> %42, ptr %6, align 8, !tbaa !17
  %43 = load ptr, ptr %18, align 8, !tbaa !16
  %44 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %43, i64 %16
  store i32 %12, ptr %44, align 4, !tbaa !12
  %45 = load ptr, ptr %18, align 8, !tbaa !16
  %46 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %45, i64 %32, i32 0, i32 0, i32 1
  store i32 %3, ptr %46, align 4, !tbaa !12
  %47 = load ptr, ptr %18, align 8, !tbaa !16
  %48 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %47, i64 %32
  store i32 %13, ptr %48, align 4, !tbaa !12
  %49 = load ptr, ptr %18, align 8, !tbaa !16
  %50 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %49, i64 %39, i32 0, i32 0, i32 1
  store i32 %12, ptr %50, align 4, !tbaa !12
  %51 = load ptr, ptr %18, align 8, !tbaa !16
  %52 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %51, i64 %39
  store i32 %3, ptr %52, align 4, !tbaa !12
  %53 = load ptr, ptr %18, align 8, !tbaa !16
  %54 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %53, i64 %16, i32 0, i32 0, i32 1
  store i32 %13, ptr %54, align 4, !tbaa !12
  %55 = load ptr, ptr %18, align 8, !tbaa !16
  %56 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %55, i64 %16, i32 0, i32 0, i32 2
  store i32 %.sroa.7.0.copyload, ptr %56, align 4, !tbaa !12
  %57 = load ptr, ptr %18, align 8, !tbaa !16
  %58 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %57, i64 %32, i32 0, i32 0, i32 2
  store i32 %.sroa.07.0.copyload, ptr %58, align 4, !tbaa !12
  %59 = load ptr, ptr %18, align 8, !tbaa !16
  %60 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %59, i64 %39, i32 0, i32 0, i32 2
  store i32 %.sroa.59.0.copyload, ptr %60, align 4, !tbaa !12
  %61 = load ptr, ptr %18, align 8, !tbaa !16
  %62 = sext i32 %.sroa.7.0.copyload to i64
  %63 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %61, i64 %62
  %64 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %63, i32 noundef %3, i32 noundef %3)
  %65 = load ptr, ptr %18, align 8, !tbaa !16
  %66 = sext i32 %.sroa.07.0.copyload to i64
  %67 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %65, i64 %66
  %68 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %67, i32 noundef %3, i32 noundef %12)
  %69 = load ptr, ptr %18, align 8, !tbaa !16
  %70 = sext i32 %.sroa.59.0.copyload to i64
  %71 = getelementptr inbounds %"struct.P3D::TriangleNeighbors", ptr %69, i64 %70
  %72 = call noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12) %71, i32 noundef %3, i32 noundef %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  ret void
}

; Function Attrs: mustprogress 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3P3D8TriangleixEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) local_unnamed_addr #3 align 2

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

declare noundef i32 @_ZN3P3D17TriangleNeighbors15replaceNeighborEii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef) local_unnamed_addr #4

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

!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, !10, i64 16}
!6 = !{!"_ZTSN3P3D12ShapeBuilderE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = !{!6, !10, i64 20}
!14 = !{!6, !7, i64 8}
!15 = !{i64 0, i64 12, !12}
!16 = !{!6, !7, i64 24}
!17 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass