; LLVM IR from ETH3D/dataset-pipeline :: thirdparty/cork/cork/isct (triangle)

; 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.otri = type { ptr, i32 }
%struct.behavior = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8] }
%struct.mesh = type { %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, [4096 x ptr], [4096 x ptr], [4096 x i32], i32, ptr, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.otri }
%struct.memorypool = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i64, i32, i32 }

@plus1mod3 = external dso_local global [3 x i32], align 4
@minus1mod3 = external dso_local global [3 x i32], align 4
@.str.921 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.922 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.923 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.924 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.925 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.926 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.927 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.928 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.929 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.930 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.931 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.932 = external hidden unnamed_addr constant [42 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

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

; Function Attrs: nounwind uwtable
declare dso_local void @printtriangle(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @traversalinit(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @triangletraverse(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local double @counterclockwise(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @checkmesh(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.otri, align 8
  %6 = alloca %struct.otri, align 8
  %7 = alloca %struct.otri, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.behavior, ptr %16, i32 0, i32 21
  %18 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %18, ptr %14, align 4, !tbaa !13
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.behavior, ptr %19, i32 0, i32 21
  store i32 0, ptr %20, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.behavior, ptr %21, i32 0, i32 28
  %23 = load i32, ptr %22, align 8, !tbaa !14
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %27, label %25

25:                                               ; preds = %2
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.921)
  br label %27

27:                                               ; preds = %25, %2
  store i32 0, ptr %13, align 4, !tbaa !13
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.mesh, ptr %28, i32 0, i32 0
  call void @traversalinit(ptr noundef %29)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call ptr @triangletraverse(ptr noundef %30)
  %32 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  store ptr %31, ptr %32, align 8, !tbaa !15
  br label %33

33:                                               ; preds = %215, %27
  %34 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %219

37:                                               ; preds = %33
  %38 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  store i32 0, ptr %38, align 8, !tbaa !17
  br label %39

39:                                               ; preds = %211, %37
  %40 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %41 = load i32, ptr %40, align 8, !tbaa !17
  %42 = icmp slt i32 %41, 3
  br i1 %42, label %43, label %215

43:                                               ; preds = %39
  %44 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = add nsw i32 %50, 3
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %45, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  store ptr %54, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !17
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !13
  %62 = add nsw i32 %61, 3
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %56, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %65, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !17
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %92

69:                                               ; preds = %43
  %70 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !17
  %74 = add nsw i32 %73, 3
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %71, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  store ptr %77, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = call double @counterclockwise(ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82)
  %84 = fcmp ole double %83, 0.000000e+00
  br i1 %84, label %85, label %91

85:                                               ; preds = %69
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.922)
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  call void @printtriangle(ptr noundef %87, ptr noundef %88, ptr noundef %5)
  %89 = load i32, ptr %13, align 4, !tbaa !13
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !13
  br label %91

91:                                               ; preds = %85, %69
  br label %92

92:                                               ; preds = %91, %43
  %93 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %96 = load i32, ptr %95, align 8, !tbaa !17
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %94, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  store ptr %99, ptr %15, align 8, !tbaa !5
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = ptrtoint ptr %100 to i64
  %102 = and i64 %101, 3
  %103 = trunc i64 %102 to i32
  %104 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 1
  store i32 %103, ptr %104, align 8, !tbaa !17
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = ptrtoint ptr %105 to i64
  %107 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 1
  %108 = load i32, ptr %107, align 8, !tbaa !17
  %109 = sext i32 %108 to i64
  %110 = xor i64 %106, %109
  %111 = inttoptr i64 %110 to ptr
  %112 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 0
  store ptr %111, ptr %112, align 8, !tbaa !15
  %113 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !15
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.mesh, ptr %115, i32 0, i32 48
  %117 = load ptr, ptr %116, align 8, !tbaa !18
  %118 = icmp ne ptr %114, %117
  br i1 %118, label %119, label %210

119:                                              ; preds = %92
  %120 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !15
  %122 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 1
  %123 = load i32, ptr %122, align 8, !tbaa !17
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %121, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  store ptr %126, ptr %15, align 8, !tbaa !5
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = ptrtoint ptr %127 to i64
  %129 = and i64 %128, 3
  %130 = trunc i64 %129 to i32
  %131 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 1
  store i32 %130, ptr %131, align 8, !tbaa !17
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = ptrtoint ptr %132 to i64
  %134 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !17
  %136 = sext i32 %135 to i64
  %137 = xor i64 %133, %136
  %138 = inttoptr i64 %137 to ptr
  %139 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 0
  store ptr %138, ptr %139, align 8, !tbaa !15
  %140 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !15
  %142 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !15
  %144 = icmp ne ptr %141, %143
  br i1 %144, label %151, label %145

145:                                              ; preds = %119
  %146 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %147 = load i32, ptr %146, align 8, !tbaa !17
  %148 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 1
  %149 = load i32, ptr %148, align 8, !tbaa !17
  %150 = icmp ne i32 %147, %149
  br i1 %150, label %151, label %169

151:                                              ; preds = %145, %119
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.923)
  %153 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !15
  %155 = getelementptr inbounds %struct.otri, ptr %7, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !15
  %157 = icmp eq ptr %154, %156
  br i1 %157, label %158, label %160

158:                                              ; preds = %151
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.924)
  br label %160

160:                                              ; preds = %158, %151
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.925)
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  call void @printtriangle(ptr noundef %162, ptr noundef %163, ptr noundef %5)
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.926)
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  call void @printtriangle(ptr noundef %165, ptr noundef %166, ptr noundef %6)
  %167 = load i32, ptr %13, align 4, !tbaa !13
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %13, align 4, !tbaa !13
  br label %169

169:                                              ; preds = %160, %145
  %170 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !15
  %172 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 1
  %173 = load i32, ptr %172, align 8, !tbaa !17
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !13
  %177 = add nsw i32 %176, 3
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %171, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  store ptr %180, ptr %11, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !15
  %183 = getelementptr inbounds %struct.otri, ptr %6, i32 0, i32 1
  %184 = load i32, ptr %183, align 8, !tbaa !17
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !13
  %188 = add nsw i32 %187, 3
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds ptr, ptr %182, i64 %189
  %191 = load ptr, ptr %190, align 8, !tbaa !5
  store ptr %191, ptr %12, align 8, !tbaa !5
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = icmp ne ptr %192, %193
  br i1 %194, label %199, label %195

195:                                              ; preds = %169
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = load ptr, ptr %11, align 8, !tbaa !5
  %198 = icmp ne ptr %196, %197
  br i1 %198, label %199, label %209

199:                                              ; preds = %195, %169
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.927)
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.928)
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  call void @printtriangle(ptr noundef %202, ptr noundef %203, ptr noundef %5)
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str.929)
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  call void @printtriangle(ptr noundef %205, ptr noundef %206, ptr noundef %6)
  %207 = load i32, ptr %13, align 4, !tbaa !13
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %13, align 4, !tbaa !13
  br label %209

209:                                              ; preds = %199, %195
  br label %210

210:                                              ; preds = %209, %92
  br label %211

211:                                              ; preds = %210
  %212 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 1
  %213 = load i32, ptr %212, align 8, !tbaa !17
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %212, align 8, !tbaa !17
  br label %39, !llvm.loop !22

215:                                              ; preds = %39
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = call ptr @triangletraverse(ptr noundef %216)
  %218 = getelementptr inbounds %struct.otri, ptr %5, i32 0, i32 0
  store ptr %217, ptr %218, align 8, !tbaa !15
  br label %33, !llvm.loop !24

219:                                              ; preds = %33
  %220 = load i32, ptr %13, align 4, !tbaa !13
  %221 = icmp eq i32 %220, 0
  br i1 %221, label %222, label %230

222:                                              ; preds = %219
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.behavior, ptr %223, i32 0, i32 28
  %225 = load i32, ptr %224, align 8, !tbaa !14
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %229, label %227

227:                                              ; preds = %222
  %228 = call i32 (ptr, ...) @printf(ptr noundef @.str.930)
  br label %229

229:                                              ; preds = %227, %222
  br label %239

230:                                              ; preds = %219
  %231 = load i32, ptr %13, align 4, !tbaa !13
  %232 = icmp eq i32 %231, 1
  br i1 %232, label %233, label %235

233:                                              ; preds = %230
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.931)
  br label %238

235:                                              ; preds = %230
  %236 = load i32, ptr %13, align 4, !tbaa !13
  %237 = call i32 (ptr, ...) @printf(ptr noundef @.str.932, i32 noundef %236)
  br label %238

238:                                              ; preds = %235, %233
  br label %239

239:                                              ; preds = %238, %229
  %240 = load i32, ptr %14, align 4, !tbaa !13
  %241 = load ptr, ptr %4, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.behavior, ptr %241, i32 0, i32 21
  store i32 %240, ptr %242, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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/C++ TBAA"}
!9 = !{!10, !11, i64 84}
!10 = !{!"behavior", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !7, i64 168, !7, i64 2216, !7, i64 4264, !7, i64 6312, !7, i64 8360, !7, i64 10408, !7, i64 12456, !7, i64 14504, !7, i64 16552, !7, i64 18600, !7, i64 20648, !7, i64 22696}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 112}
!15 = !{!16, !6, i64 0}
!16 = !{!"otri", !6, i64 0, !11, i64 8}
!17 = !{!16, !11, i64 8}
!18 = !{!19, !6, i64 82856}
!19 = !{!"mesh", !20, i64 0, !20, i64 88, !20, i64 176, !20, i64 264, !20, i64 352, !20, i64 440, !20, i64 528, !20, i64 616, !7, i64 704, !7, i64 33472, !7, i64 66240, !11, i64 82624, !6, i64 82632, !12, i64 82640, !12, i64 82648, !12, i64 82656, !12, i64 82664, !12, i64 82672, !11, i64 82680, !11, i64 82684, !11, i64 82688, !11, i64 82692, !11, i64 82696, !11, i64 82700, !21, i64 82704, !11, i64 82712, !11, i64 82716, !11, i64 82720, !21, i64 82728, !11, i64 82736, !11, i64 82740, !11, i64 82744, !11, i64 82748, !11, i64 82752, !11, i64 82756, !11, i64 82760, !11, i64 82764, !11, i64 82768, !21, i64 82776, !21, i64 82784, !21, i64 82792, !21, i64 82800, !21, i64 82808, !21, i64 82816, !21, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !6, i64 82872, !6, i64 82880, !16, i64 82888}
!20 = !{!"memorypool", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !21, i64 64, !21, i64 72, !11, i64 80, !11, i64 84}
!21 = !{!"long", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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.otri = type { ptr, i32 }

@plus1mod3 = external dso_local local_unnamed_addr global [3 x i32], align 4
@minus1mod3 = external dso_local local_unnamed_addr global [3 x i32], align 4
@.str.921 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.922 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.923 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.924 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.925 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.926 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.927 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.928 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.929 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.930 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.931 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.932 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @printtriangle(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @traversalinit(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @triangletraverse(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local double @counterclockwise(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @checkmesh(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.otri, align 8
  %4 = alloca %struct.otri, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %5 = getelementptr inbounds i8, ptr %1, i64 84
  %6 = load i32, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 112
  %8 = load i32, ptr %7, align 8, !tbaa !11
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %11

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

11:                                               ; preds = %9, %2
  tail call void @traversalinit(ptr noundef %0)
  %12 = tail call ptr @triangletraverse(ptr noundef %0)
  store ptr %12, ptr %3, align 8, !tbaa !12
  %.not4253 = icmp eq ptr %12, null
  br i1 %.not4253, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %11
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = getelementptr inbounds i8, ptr %4, i64 8
  %15 = getelementptr inbounds i8, ptr %0, i64 82856
  br label %16

16:                                               ; preds = %.lr.ph, %98
  %.054 = phi i32 [ 0, %.lr.ph ], [ %.4, %98 ]
  store i32 0, ptr %13, align 8, !tbaa !15
  br label %17

17:                                               ; preds = %16, %94
  %.152 = phi i32 [ %.054, %16 ], [ %.4, %94 ]
  %storemerge4451 = phi i32 [ 0, %16 ], [ %96, %94 ]
  %18 = load ptr, ptr %3, align 8, !tbaa !12
  %19 = sext i32 %storemerge4451 to i64
  %20 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !16
  %22 = sext i32 %21 to i64
  %23 = getelementptr ptr, ptr %18, i64 %22
  %24 = getelementptr i8, ptr %23, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %19
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = sext i32 %27 to i64
  %29 = getelementptr ptr, ptr %18, i64 %28
  %30 = getelementptr i8, ptr %29, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = icmp eq i32 %storemerge4451, 0
  br i1 %32, label %33, label %41

33:                                               ; preds = %17
  %34 = getelementptr inbounds i8, ptr %18, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = call double @counterclockwise(ptr noundef %0, ptr noundef %1, ptr noundef %25, ptr noundef %31, ptr noundef %35)
  %37 = fcmp ugt double %36, 0.000000e+00
  br i1 %37, label %41, label %38

38:                                               ; preds = %33
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.922)
  call void @printtriangle(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %3)
  %40 = add nsw i32 %.152, 1
  br label %41

41:                                               ; preds = %33, %38, %17
  %.2 = phi i32 [ %40, %38 ], [ %.152, %33 ], [ %.152, %17 ]
  %42 = load ptr, ptr %3, align 8, !tbaa !12
  %43 = load i32, ptr %13, align 8, !tbaa !15
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  %47 = ptrtoint ptr %46 to i64
  %48 = trunc i64 %47 to i32
  %49 = and i32 %48, 3
  store i32 %49, ptr %14, align 8, !tbaa !15
  %50 = and i64 %47, -4
  %51 = inttoptr i64 %50 to ptr
  store ptr %51, ptr %4, align 8, !tbaa !12
  %52 = load ptr, ptr %15, align 8, !tbaa !18
  %.not45 = icmp eq ptr %52, %51
  br i1 %.not45, label %94, label %53

53:                                               ; preds = %41
  %54 = and i64 %47, 3
  %55 = getelementptr inbounds ptr, ptr %51, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = ptrtoint ptr %56 to i64
  %58 = and i64 %57, -4
  %59 = inttoptr i64 %58 to ptr
  %.not46 = icmp eq ptr %42, %59
  %60 = trunc i64 %57 to i32
  %61 = and i32 %60, 3
  %.not47 = icmp eq i32 %43, %61
  %or.cond = and i1 %.not46, %.not47
  br i1 %or.cond, label %72, label %62

62:                                               ; preds = %53
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.923)
  %64 = load ptr, ptr %3, align 8, !tbaa !12
  %65 = icmp eq ptr %64, %59
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.924)
  br label %68

68:                                               ; preds = %66, %62
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.925)
  call void @printtriangle(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %3)
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.926)
  call void @printtriangle(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4)
  %71 = add nsw i32 %.2, 1
  %.pre = load ptr, ptr %4, align 8, !tbaa !12
  %.pre55 = load i32, ptr %14, align 8, !tbaa !15
  br label %72

72:                                               ; preds = %53, %68
  %73 = phi i32 [ %.pre55, %68 ], [ %49, %53 ]
  %74 = phi ptr [ %.pre, %68 ], [ %51, %53 ]
  %.3 = phi i32 [ %71, %68 ], [ %.2, %53 ]
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !16
  %78 = sext i32 %77 to i64
  %79 = getelementptr ptr, ptr %74, i64 %78
  %80 = getelementptr i8, ptr %79, i64 24
  %81 = load ptr, ptr %80, align 8, !tbaa !17
  %.not48 = icmp eq ptr %25, %81
  br i1 %.not48, label %82, label %89

82:                                               ; preds = %72
  %83 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %75
  %84 = load i32, ptr %83, align 4, !tbaa !16
  %85 = sext i32 %84 to i64
  %86 = getelementptr ptr, ptr %74, i64 %85
  %87 = getelementptr i8, ptr %86, i64 24
  %88 = load ptr, ptr %87, align 8, !tbaa !17
  %.not49 = icmp eq ptr %31, %88
  br i1 %.not49, label %94, label %89

89:                                               ; preds = %82, %72
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.927)
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.928)
  call void @printtriangle(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %3)
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.929)
  call void @printtriangle(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %4)
  %93 = add nsw i32 %.3, 1
  br label %94

94:                                               ; preds = %41, %89, %82
  %.4 = phi i32 [ %93, %89 ], [ %.3, %82 ], [ %.2, %41 ]
  %95 = load i32, ptr %13, align 8, !tbaa !15
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %13, align 8, !tbaa !15
  %97 = icmp slt i32 %95, 2
  br i1 %97, label %17, label %98, !llvm.loop !22

98:                                               ; preds = %94
  %99 = call ptr @triangletraverse(ptr noundef nonnull %0)
  store ptr %99, ptr %3, align 8, !tbaa !12
  %.not42 = icmp eq ptr %99, null
  br i1 %.not42, label %._crit_edge, label %16, !llvm.loop !24

._crit_edge:                                      ; preds = %98
  switch i32 %.4, label %105 [
    i32 0, label %._crit_edge.thread
    i32 1, label %103
  ]

._crit_edge.thread:                               ; preds = %11, %._crit_edge
  %100 = load i32, ptr %7, align 8, !tbaa !11
  %.not43 = icmp eq i32 %100, 0
  br i1 %.not43, label %101, label %107

101:                                              ; preds = %._crit_edge.thread
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.930)
  br label %107

103:                                              ; preds = %._crit_edge
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.931)
  br label %107

105:                                              ; preds = %._crit_edge
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.932, i32 noundef %.4)
  br label %107

107:                                              ; preds = %103, %105, %._crit_edge.thread, %101
  store i32 %6, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { 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 #3 = { 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, !7, i64 84}
!6 = !{!"behavior", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !8, i64 168, !8, i64 2216, !8, i64 4264, !8, i64 6312, !8, i64 8360, !8, i64 10408, !8, i64 12456, !8, i64 14504, !8, i64 16552, !8, i64 18600, !8, i64 20648, !8, i64 22696}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!6, !7, i64 112}
!12 = !{!13, !14, i64 0}
!13 = !{!"otri", !14, i64 0, !7, i64 8}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!13, !7, i64 8}
!16 = !{!7, !7, i64 0}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !14, i64 82856}
!19 = !{!"mesh", !20, i64 0, !20, i64 88, !20, i64 176, !20, i64 264, !20, i64 352, !20, i64 440, !20, i64 528, !20, i64 616, !8, i64 704, !8, i64 33472, !8, i64 66240, !7, i64 82624, !14, i64 82632, !10, i64 82640, !10, i64 82648, !10, i64 82656, !10, i64 82664, !10, i64 82672, !7, i64 82680, !7, i64 82684, !7, i64 82688, !7, i64 82692, !7, i64 82696, !7, i64 82700, !21, i64 82704, !7, i64 82712, !7, i64 82716, !7, i64 82720, !21, i64 82728, !7, i64 82736, !7, i64 82740, !7, i64 82744, !7, i64 82748, !7, i64 82752, !7, i64 82756, !7, i64 82760, !7, i64 82764, !7, i64 82768, !21, i64 82776, !21, i64 82784, !21, i64 82792, !21, i64 82800, !21, i64 82808, !21, i64 82816, !21, i64 82824, !14, i64 82832, !14, i64 82840, !14, i64 82848, !14, i64 82856, !14, i64 82864, !14, i64 82872, !14, i64 82880, !13, i64 82888}
!20 = !{!"memorypool", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !21, i64 64, !21, i64 72, !7, i64 80, !7, i64 84}
!21 = !{!"long", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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