; LLVM IR from Yinxiaoli/iros2015_folding :: src/folding_planner_cmake/project/2dregistration_v2 (mesh2d)

; 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.SHalfEdge = type { ptr, ptr, ptr, ptr, ptr, i32, i32, i8, i8 }
%struct.SVertex = type { ptr, i8, i32, i8, i8 }
%struct.SFace = type { ptr, i32, i8, i8 }

@.str = external hidden unnamed_addr constant [49 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13replaceVertexP7SVertexS0_PK9SHalfEdge(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12edgeCollapseP9SHalfEdgeP7SVertexP5SMesh(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.SHalfEdge, ptr %9, i32 0, i32 1
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp ne ptr %11, %12
  br i1 %13, label %14, label %24

14:                                               ; preds = %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.SHalfEdge, ptr %15, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = getelementptr inbounds %struct.SHalfEdge, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp ne ptr %19, %20
  br i1 %21, label %22, label %24

22:                                               ; preds = %14
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %259

24:                                               ; preds = %14, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %25, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.SHalfEdge, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = icmp ne ptr %28, %29
  br i1 %30, label %31, label %35

31:                                               ; preds = %24
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.SHalfEdge, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  store ptr %34, ptr %8, align 8, !tbaa !5
  br label %41

35:                                               ; preds = %24
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SHalfEdge, ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = getelementptr inbounds %struct.SHalfEdge, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  store ptr %40, ptr %8, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %35, %31
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z13replaceVertexP7SVertexS0_PK9SHalfEdge(ptr noundef %42, ptr noundef %43, ptr noundef %44)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef %45)
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SHalfEdge, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  call void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef %48)
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.SHalfEdge, ptr %49, i32 0, i32 3
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  %52 = getelementptr inbounds %struct.SHalfEdge, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %63

55:                                               ; preds = %41
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.SHalfEdge, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = getelementptr inbounds %struct.SHalfEdge, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SVertex, ptr %61, i32 0, i32 0
  store ptr %60, ptr %62, align 8, !tbaa !16
  br label %73

63:                                               ; preds = %41
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SHalfEdge, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = getelementptr inbounds %struct.SHalfEdge, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds %struct.SHalfEdge, ptr %68, i32 0, i32 3
  %70 = load ptr, ptr %69, align 8, !tbaa !15
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.SVertex, ptr %71, i32 0, i32 0
  store ptr %70, ptr %72, align 8, !tbaa !16
  br label %73

73:                                               ; preds = %63, %55
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.SVertex, ptr %74, i32 0, i32 1
  store i8 1, ptr %75, align 8, !tbaa !18
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef %76)
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.SHalfEdge, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = getelementptr inbounds %struct.SHalfEdge, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.SVertex, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !16
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.SHalfEdge, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  %87 = icmp eq ptr %83, %86
  br i1 %87, label %88, label %122

88:                                               ; preds = %73
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.SHalfEdge, ptr %89, i32 0, i32 3
  %91 = load ptr, ptr %90, align 8, !tbaa !15
  %92 = getelementptr inbounds %struct.SHalfEdge, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !14
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %109

95:                                               ; preds = %88
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.SHalfEdge, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !13
  %99 = getelementptr inbounds %struct.SHalfEdge, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !14
  %101 = getelementptr inbounds %struct.SHalfEdge, ptr %100, i32 0, i32 3
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.SHalfEdge, ptr %103, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds %struct.SHalfEdge, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.SVertex, ptr %107, i32 0, i32 0
  store ptr %102, ptr %108, align 8, !tbaa !16
  br label %121

109:                                              ; preds = %88
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.SHalfEdge, ptr %110, i32 0, i32 3
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = getelementptr inbounds %struct.SHalfEdge, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.SHalfEdge, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !15
  %118 = getelementptr inbounds %struct.SHalfEdge, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.SVertex, ptr %119, i32 0, i32 0
  store ptr %114, ptr %120, align 8, !tbaa !16
  br label %121

121:                                              ; preds = %109, %95
  br label %122

122:                                              ; preds = %121, %73
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.SHalfEdge, ptr %123, i32 0, i32 3
  %125 = load ptr, ptr %124, align 8, !tbaa !15
  %126 = getelementptr inbounds %struct.SHalfEdge, ptr %125, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.SVertex, ptr %127, i32 0, i32 1
  store i8 1, ptr %128, align 8, !tbaa !18
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.SHalfEdge, ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = getelementptr inbounds %struct.SHalfEdge, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef %133)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.SHalfEdge, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %214

138:                                              ; preds = %122
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.SHalfEdge, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !14
  %142 = getelementptr inbounds %struct.SHalfEdge, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !15
  %144 = getelementptr inbounds %struct.SHalfEdge, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct.SVertex, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !16
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.SHalfEdge, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !14
  %151 = getelementptr inbounds %struct.SHalfEdge, ptr %150, i32 0, i32 2
  %152 = load ptr, ptr %151, align 8, !tbaa !13
  %153 = icmp eq ptr %147, %152
  br i1 %153, label %154, label %198

154:                                              ; preds = %138
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.SHalfEdge, ptr %155, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8, !tbaa !14
  %158 = getelementptr inbounds %struct.SHalfEdge, ptr %157, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  %160 = getelementptr inbounds %struct.SHalfEdge, ptr %159, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !14
  %162 = icmp eq ptr %161, null
  br i1 %162, label %163, label %181

163:                                              ; preds = %154
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.SHalfEdge, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !14
  %167 = getelementptr inbounds %struct.SHalfEdge, ptr %166, i32 0, i32 2
  %168 = load ptr, ptr %167, align 8, !tbaa !13
  %169 = getelementptr inbounds %struct.SHalfEdge, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !14
  %171 = getelementptr inbounds %struct.SHalfEdge, ptr %170, i32 0, i32 3
  %172 = load ptr, ptr %171, align 8, !tbaa !15
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.SHalfEdge, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !14
  %176 = getelementptr inbounds %struct.SHalfEdge, ptr %175, i32 0, i32 3
  %177 = load ptr, ptr %176, align 8, !tbaa !15
  %178 = getelementptr inbounds %struct.SHalfEdge, ptr %177, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !9
  %180 = getelementptr inbounds %struct.SVertex, ptr %179, i32 0, i32 0
  store ptr %172, ptr %180, align 8, !tbaa !16
  br label %197

181:                                              ; preds = %154
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.SHalfEdge, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !14
  %185 = getelementptr inbounds %struct.SHalfEdge, ptr %184, i32 0, i32 3
  %186 = load ptr, ptr %185, align 8, !tbaa !15
  %187 = getelementptr inbounds %struct.SHalfEdge, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !14
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.SHalfEdge, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !14
  %192 = getelementptr inbounds %struct.SHalfEdge, ptr %191, i32 0, i32 3
  %193 = load ptr, ptr %192, align 8, !tbaa !15
  %194 = getelementptr inbounds %struct.SHalfEdge, ptr %193, i32 0, i32 1
  %195 = load ptr, ptr %194, align 8, !tbaa !9
  %196 = getelementptr inbounds %struct.SVertex, ptr %195, i32 0, i32 0
  store ptr %188, ptr %196, align 8, !tbaa !16
  br label %197

197:                                              ; preds = %181, %163
  br label %198

198:                                              ; preds = %197, %138
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.SHalfEdge, ptr %199, i32 0, i32 0
  %201 = load ptr, ptr %200, align 8, !tbaa !14
  %202 = getelementptr inbounds %struct.SHalfEdge, ptr %201, i32 0, i32 3
  %203 = load ptr, ptr %202, align 8, !tbaa !15
  %204 = getelementptr inbounds %struct.SHalfEdge, ptr %203, i32 0, i32 1
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  %206 = getelementptr inbounds %struct.SVertex, ptr %205, i32 0, i32 1
  store i8 1, ptr %206, align 8, !tbaa !18
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.SHalfEdge, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !14
  %210 = getelementptr inbounds %struct.SHalfEdge, ptr %209, i32 0, i32 3
  %211 = load ptr, ptr %210, align 8, !tbaa !15
  %212 = getelementptr inbounds %struct.SHalfEdge, ptr %211, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8, !tbaa !9
  call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef %213)
  br label %214

214:                                              ; preds = %198, %122
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.SHalfEdge, ptr %215, i32 0, i32 4
  %217 = load ptr, ptr %216, align 8, !tbaa !19
  %218 = getelementptr inbounds %struct.SFace, ptr %217, i32 0, i32 2
  store i8 0, ptr %218, align 4, !tbaa !20
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.SHalfEdge, ptr %219, i32 0, i32 7
  store i8 0, ptr %220, align 8, !tbaa !22
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.SHalfEdge, ptr %221, i32 0, i32 3
  %223 = load ptr, ptr %222, align 8, !tbaa !15
  %224 = getelementptr inbounds %struct.SHalfEdge, ptr %223, i32 0, i32 7
  store i8 0, ptr %224, align 8, !tbaa !22
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.SHalfEdge, ptr %225, i32 0, i32 2
  %227 = load ptr, ptr %226, align 8, !tbaa !13
  %228 = getelementptr inbounds %struct.SHalfEdge, ptr %227, i32 0, i32 7
  store i8 0, ptr %228, align 8, !tbaa !22
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.SHalfEdge, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !14
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %256

233:                                              ; preds = %214
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.SHalfEdge, ptr %234, i32 0, i32 0
  %236 = load ptr, ptr %235, align 8, !tbaa !14
  %237 = getelementptr inbounds %struct.SHalfEdge, ptr %236, i32 0, i32 4
  %238 = load ptr, ptr %237, align 8, !tbaa !19
  %239 = getelementptr inbounds %struct.SFace, ptr %238, i32 0, i32 2
  store i8 0, ptr %239, align 4, !tbaa !20
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.SHalfEdge, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !14
  %243 = getelementptr inbounds %struct.SHalfEdge, ptr %242, i32 0, i32 7
  store i8 0, ptr %243, align 8, !tbaa !22
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.SHalfEdge, ptr %244, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8, !tbaa !14
  %247 = getelementptr inbounds %struct.SHalfEdge, ptr %246, i32 0, i32 3
  %248 = load ptr, ptr %247, align 8, !tbaa !15
  %249 = getelementptr inbounds %struct.SHalfEdge, ptr %248, i32 0, i32 7
  store i8 0, ptr %249, align 8, !tbaa !22
  %250 = load ptr, ptr %4, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.SHalfEdge, ptr %250, i32 0, i32 0
  %252 = load ptr, ptr %251, align 8, !tbaa !14
  %253 = getelementptr inbounds %struct.SHalfEdge, ptr %252, i32 0, i32 2
  %254 = load ptr, ptr %253, align 8, !tbaa !13
  %255 = getelementptr inbounds %struct.SHalfEdge, ptr %254, i32 0, i32 7
  store i8 0, ptr %255, align 8, !tbaa !22
  br label %256

256:                                              ; preds = %233, %214
  %257 = load ptr, ptr %7, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.SVertex, ptr %257, i32 0, i32 3
  store i8 0, ptr %258, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %259

259:                                              ; preds = %256, %22
  ret void
}

declare i32 @printf(ptr noundef, ...) #3

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

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

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


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

@.str = external hidden unnamed_addr constant [49 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13replaceVertexP7SVertexS0_PK9SHalfEdge(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z12edgeCollapseP9SHalfEdgeP7SVertexP5SMesh(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readnone %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  br i1 %.not, label %13, label %10

10:                                               ; preds = %3
  %.not59 = icmp eq ptr %9, %1
  br i1 %.not59, label %13, label %11

11:                                               ; preds = %10
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %84

13:                                               ; preds = %3, %10
  %.0 = phi ptr [ %5, %10 ], [ %9, %3 ]
  tail call void @_Z13replaceVertexP7SVertexS0_PK9SHalfEdge(ptr noundef %1, ptr noundef %.0, ptr noundef nonnull %0)
  tail call void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef nonnull %0)
  %14 = load ptr, ptr %0, align 8, !tbaa !13
  tail call void @_Z13bondSideEdgesP9SHalfEdge(ptr noundef %14)
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %22

19:                                               ; preds = %13
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  br label %24

22:                                               ; preds = %13
  %23 = getelementptr inbounds i8, ptr %17, i64 24
  br label %24

24:                                               ; preds = %22, %19
  %storemerge.in = phi ptr [ %23, %22 ], [ %21, %19 ]
  %storemerge = load ptr, ptr %storemerge.in, align 8, !tbaa !15
  store ptr %storemerge, ptr %.0, align 8, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %.0, i64 8
  store i8 1, ptr %25, align 8, !tbaa !18
  tail call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef nonnull %.0)
  %26 = load ptr, ptr %15, align 8, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = icmp eq ptr %29, %31
  br i1 %32, label %33, label %40

33:                                               ; preds = %24
  %34 = load ptr, ptr %26, align 8, !tbaa !13
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %.sink.split

36:                                               ; preds = %33
  %37 = load ptr, ptr %31, align 8, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %37, i64 24
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  br label %.sink.split

.sink.split:                                      ; preds = %33, %36
  %.sink = phi ptr [ %39, %36 ], [ %34, %33 ]
  store ptr %.sink, ptr %28, align 8, !tbaa !16
  br label %40

40:                                               ; preds = %.sink.split, %24
  %41 = getelementptr inbounds i8, ptr %28, i64 8
  store i8 1, ptr %41, align 8, !tbaa !18
  tail call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef nonnull %28)
  %42 = load ptr, ptr %0, align 8, !tbaa !13
  %.not61 = icmp eq ptr %42, null
  br i1 %.not61, label %61, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %42, i64 24
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = getelementptr inbounds i8, ptr %42, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !12
  %51 = icmp eq ptr %48, %50
  br i1 %51, label %52, label %59

52:                                               ; preds = %43
  %53 = load ptr, ptr %45, align 8, !tbaa !13
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %.sink.split63

55:                                               ; preds = %52
  %56 = load ptr, ptr %50, align 8, !tbaa !13
  %57 = getelementptr inbounds i8, ptr %56, i64 24
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  br label %.sink.split63

.sink.split63:                                    ; preds = %52, %55
  %.sink64 = phi ptr [ %58, %55 ], [ %53, %52 ]
  store ptr %.sink64, ptr %47, align 8, !tbaa !16
  br label %59

59:                                               ; preds = %.sink.split63, %43
  %60 = getelementptr inbounds i8, ptr %47, i64 8
  store i8 1, ptr %60, align 8, !tbaa !18
  tail call void @_Z21resetHalfEdgeofVertexP7SVertex(ptr noundef nonnull %47)
  %.pre = load ptr, ptr %0, align 8, !tbaa !13
  br label %61

61:                                               ; preds = %59, %40
  %62 = phi ptr [ %.pre, %59 ], [ null, %40 ]
  %63 = getelementptr inbounds i8, ptr %0, i64 32
  %64 = load ptr, ptr %63, align 8, !tbaa !19
  %65 = getelementptr inbounds i8, ptr %64, i64 12
  store i8 0, ptr %65, align 4, !tbaa !20
  %66 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 0, ptr %66, align 8, !tbaa !22
  %67 = load ptr, ptr %15, align 8, !tbaa !14
  %68 = getelementptr inbounds i8, ptr %67, i64 48
  store i8 0, ptr %68, align 8, !tbaa !22
  %69 = load ptr, ptr %30, align 8, !tbaa !12
  %70 = getelementptr inbounds i8, ptr %69, i64 48
  store i8 0, ptr %70, align 8, !tbaa !22
  %.not62 = icmp eq ptr %62, null
  br i1 %.not62, label %82, label %71

71:                                               ; preds = %61
  %72 = getelementptr inbounds i8, ptr %62, i64 32
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = getelementptr inbounds i8, ptr %73, i64 12
  store i8 0, ptr %74, align 4, !tbaa !20
  %75 = getelementptr inbounds i8, ptr %62, i64 48
  store i8 0, ptr %75, align 8, !tbaa !22
  %76 = getelementptr inbounds i8, ptr %62, i64 24
  %77 = load ptr, ptr %76, align 8, !tbaa !14
  %78 = getelementptr inbounds i8, ptr %77, i64 48
  store i8 0, ptr %78, align 8, !tbaa !22
  %79 = getelementptr inbounds i8, ptr %62, i64 16
  %80 = load ptr, ptr %79, align 8, !tbaa !12
  %81 = getelementptr inbounds i8, ptr %80, i64 48
  store i8 0, ptr %81, align 8, !tbaa !22
  br label %82

82:                                               ; preds = %71, %61
  %83 = getelementptr inbounds i8, ptr %1, i64 16
  store i8 0, ptr %83, align 8, !tbaa !23
  br label %84

84:                                               ; preds = %82, %11
  ret void
}

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

attributes #0 = { 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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, !7, i64 8}
!6 = !{!"_ZTS9SHalfEdge", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !11, i64 48, !11, i64 49}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !7, i64 16}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !7, i64 24}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"_ZTS7SVertex", !7, i64 0, !11, i64 8, !10, i64 12, !11, i64 16, !11, i64 17}
!18 = !{!17, !11, i64 8}
!19 = !{!6, !7, i64 32}
!20 = !{!21, !11, i64 12}
!21 = !{!"_ZTS5SFace", !7, i64 0, !10, i64 8, !11, i64 12, !11, i64 13}
!22 = !{!6, !11, i64 48}
!23 = !{!17, !11, i64 16}


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