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

@.str.1054 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1055 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1056 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1057 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1058 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.1059 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.1060 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1061 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1062 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1063 = external hidden unnamed_addr constant [43 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 @poolinit(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @enforcequality(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  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 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.behavior, ptr %7, i32 0, i32 28
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %10 = icmp ne i32 %9, 0
  br i1 %10, label %13, label %11

11:                                               ; preds = %2
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.1054)
  br label %13

13:                                               ; preds = %11, %2
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.mesh, ptr %14, i32 0, i32 4
  call void @poolinit(ptr noundef %15, i32 noundef 24, i32 noundef 252, i32 noundef 252, i32 noundef 0)
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.behavior, ptr %16, i32 0, i32 29
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %13
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.1055)
  br label %22

22:                                               ; preds = %20, %13
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @tallyencs(ptr noundef %23, ptr noundef %24)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.behavior, ptr %25, i32 0, i32 29
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %37

29:                                               ; preds = %22
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mesh, ptr %30, i32 0, i32 4
  %32 = getelementptr inbounds %struct.memorypool, ptr %31, i32 0, i32 10
  %33 = load i64, ptr %32, align 8, !tbaa !14
  %34 = icmp sgt i64 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %29
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.1056)
  br label %37

37:                                               ; preds = %35, %29, %22
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  call void @splitencsegs(ptr noundef %38, ptr noundef %39, i32 noundef 0)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.behavior, ptr %40, i32 0, i32 34
  %42 = load double, ptr %41, align 8, !tbaa !19
  %43 = fcmp ogt double %42, 0.000000e+00
  br i1 %43, label %59, label %44

44:                                               ; preds = %37
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.behavior, ptr %45, i32 0, i32 3
  %47 = load i32, ptr %46, align 4, !tbaa !20
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %59, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.behavior, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 8, !tbaa !21
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %49
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.behavior, ptr %55, i32 0, i32 5
  %57 = load i32, ptr %56, align 4, !tbaa !22
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %126

59:                                               ; preds = %54, %49, %44, %37
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.mesh, ptr %60, i32 0, i32 5
  call void @poolinit(ptr noundef %61, i32 noundef 48, i32 noundef 4092, i32 noundef 4092, i32 noundef 0)
  store i32 0, ptr %6, align 4, !tbaa !23
  br label %62

62:                                               ; preds = %71, %59
  %63 = load i32, ptr %6, align 4, !tbaa !23
  %64 = icmp slt i32 %63, 4096
  br i1 %64, label %65, label %74

65:                                               ; preds = %62
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.mesh, ptr %66, i32 0, i32 8
  %68 = load i32, ptr %6, align 4, !tbaa !23
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4096 x ptr], ptr %67, i64 0, i64 %69
  store ptr null, ptr %70, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %65
  %72 = load i32, ptr %6, align 4, !tbaa !23
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !23
  br label %62, !llvm.loop !24

74:                                               ; preds = %62
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.mesh, ptr %75, i32 0, i32 11
  store i32 -1, ptr %76, align 8, !tbaa !26
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  call void @tallyfaces(ptr noundef %77, ptr noundef %78)
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.mesh, ptr %79, i32 0, i32 6
  call void @poolinit(ptr noundef %80, i32 noundef 16, i32 noundef 252, i32 noundef 252, i32 noundef 0)
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.mesh, ptr %81, i32 0, i32 36
  store i32 1, ptr %82, align 4, !tbaa !27
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.behavior, ptr %83, i32 0, i32 29
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %74
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.1057)
  br label %89

89:                                               ; preds = %87, %74
  br label %90

90:                                               ; preds = %124, %89
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mesh, ptr %91, i32 0, i32 5
  %93 = getelementptr inbounds %struct.memorypool, ptr %92, i32 0, i32 10
  %94 = load i64, ptr %93, align 8, !tbaa !28
  %95 = icmp sgt i64 %94, 0
  br i1 %95, label %96, label %101

96:                                               ; preds = %90
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.mesh, ptr %97, i32 0, i32 29
  %99 = load i32, ptr %98, align 8, !tbaa !29
  %100 = icmp ne i32 %99, 0
  br label %101

101:                                              ; preds = %96, %90
  %102 = phi i1 [ false, %90 ], [ %100, %96 ]
  br i1 %102, label %103, label %125

103:                                              ; preds = %101
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = call ptr @dequeuebadtriang(ptr noundef %104)
  store ptr %105, ptr %5, align 8, !tbaa !5
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  call void @splittriangle(ptr noundef %106, ptr noundef %107, ptr noundef %108)
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mesh, ptr %109, i32 0, i32 4
  %111 = getelementptr inbounds %struct.memorypool, ptr %110, i32 0, i32 10
  %112 = load i64, ptr %111, align 8, !tbaa !14
  %113 = icmp sgt i64 %112, 0
  br i1 %113, label %114, label %120

114:                                              ; preds = %103
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  call void @enqueuebadtriang(ptr noundef %115, ptr noundef %116, ptr noundef %117)
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  call void @splitencsegs(ptr noundef %118, ptr noundef %119, i32 noundef 1)
  br label %124

120:                                              ; preds = %103
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.mesh, ptr %121, i32 0, i32 5
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  call void @pooldealloc(ptr noundef %122, ptr noundef %123)
  br label %124

124:                                              ; preds = %120, %114
  br label %90, !llvm.loop !30

125:                                              ; preds = %101
  br label %126

126:                                              ; preds = %125, %54
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.behavior, ptr %127, i32 0, i32 28
  %129 = load i32, ptr %128, align 8, !tbaa !9
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %166, label %131

131:                                              ; preds = %126
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.behavior, ptr %132, i32 0, i32 22
  %134 = load i32, ptr %133, align 8, !tbaa !31
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %166

136:                                              ; preds = %131
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.mesh, ptr %137, i32 0, i32 4
  %139 = getelementptr inbounds %struct.memorypool, ptr %138, i32 0, i32 10
  %140 = load i64, ptr %139, align 8, !tbaa !14
  %141 = icmp sgt i64 %140, 0
  br i1 %141, label %142, label %166

142:                                              ; preds = %136
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.mesh, ptr %143, i32 0, i32 29
  %145 = load i32, ptr %144, align 8, !tbaa !29
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %147, label %166

147:                                              ; preds = %142
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.1058)
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.mesh, ptr %149, i32 0, i32 4
  %151 = getelementptr inbounds %struct.memorypool, ptr %150, i32 0, i32 10
  %152 = load i64, ptr %151, align 8, !tbaa !14
  %153 = icmp eq i64 %152, 1
  br i1 %153, label %154, label %156

154:                                              ; preds = %147
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.1059)
  br label %162

156:                                              ; preds = %147
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mesh, ptr %157, i32 0, i32 4
  %159 = getelementptr inbounds %struct.memorypool, ptr %158, i32 0, i32 10
  %160 = load i64, ptr %159, align 8, !tbaa !14
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.1060, i64 noundef %160)
  br label %162

162:                                              ; preds = %156, %154
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.1061)
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.1062)
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.1063)
  br label %166

166:                                              ; preds = %162, %142, %136, %131, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, 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 112}
!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 = !{!10, !11, i64 116}
!14 = !{!15, !17, i64 416}
!15 = !{!"mesh", !16, i64 0, !16, i64 88, !16, i64 176, !16, i64 264, !16, i64 352, !16, i64 440, !16, i64 528, !16, 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, !17, i64 82704, !11, i64 82712, !11, i64 82716, !11, i64 82720, !17, 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, !17, i64 82776, !17, i64 82784, !17, i64 82792, !17, i64 82800, !17, i64 82808, !17, i64 82816, !17, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !6, i64 82872, !6, i64 82880, !18, i64 82888}
!16 = !{!"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, !17, i64 64, !17, i64 72, !11, i64 80, !11, i64 84}
!17 = !{!"long", !7, i64 0}
!18 = !{!"otri", !6, i64 0, !11, i64 8}
!19 = !{!10, !12, i64 136}
!20 = !{!10, !11, i64 12}
!21 = !{!10, !11, i64 16}
!22 = !{!10, !11, i64 20}
!23 = !{!11, !11, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!15, !11, i64 82624}
!27 = !{!15, !11, i64 82764}
!28 = !{!15, !17, i64 504}
!29 = !{!15, !11, i64 82736}
!30 = distinct !{!30, !25}
!31 = !{!10, !11, i64 88}


; 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.1054 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1055 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1056 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1057 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1058 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.1059 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.1060 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1061 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1062 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.1063 = external hidden unnamed_addr constant [43 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local void @poolinit(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @dequeuebadtriang(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @splitencsegs(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @enforcequality(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 112
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %7

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1054)
  br label %7

7:                                                ; preds = %5, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 352
  tail call void @poolinit(ptr noundef nonnull %8, i32 noundef 24, i32 noundef 252, i32 noundef 252, i32 noundef 0)
  %9 = getelementptr inbounds i8, ptr %1, i64 116
  %10 = load i32, ptr %9, align 4, !tbaa !11
  %.not44 = icmp eq i32 %10, 0
  br i1 %.not44, label %13, label %11

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

13:                                               ; preds = %11, %7
  tail call void @tallyencs(ptr noundef %0, ptr noundef nonnull %1)
  %14 = load i32, ptr %9, align 4, !tbaa !11
  %.not45 = icmp eq i32 %14, 0
  br i1 %.not45, label %21, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 416
  %17 = load i64, ptr %16, align 8, !tbaa !12
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %15
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1056)
  br label %21

21:                                               ; preds = %19, %15, %13
  tail call void @splitencsegs(ptr noundef %0, ptr noundef nonnull %1, i32 noundef 0)
  %22 = getelementptr inbounds i8, ptr %1, i64 136
  %23 = load double, ptr %22, align 8, !tbaa !18
  %24 = fcmp ogt double %23, 0.000000e+00
  br i1 %24, label %34, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %1, i64 12
  %27 = load i32, ptr %26, align 4, !tbaa !19
  %.not46 = icmp eq i32 %27, 0
  br i1 %.not46, label %28, label %34

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  %30 = load i32, ptr %29, align 8, !tbaa !20
  %.not47 = icmp eq i32 %30, 0
  br i1 %.not47, label %31, label %34

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %1, i64 20
  %33 = load i32, ptr %32, align 4, !tbaa !21
  %.not48 = icmp eq i32 %33, 0
  br i1 %.not48, label %.critedge, label %34

34:                                               ; preds = %31, %28, %25, %21
  %35 = getelementptr inbounds i8, ptr %0, i64 440
  tail call void @poolinit(ptr noundef nonnull %35, i32 noundef 48, i32 noundef 4092, i32 noundef 4092, i32 noundef 0)
  %36 = getelementptr inbounds i8, ptr %0, i64 704
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32768) %36, i8 0, i64 32768, i1 false), !tbaa !22
  %37 = getelementptr inbounds i8, ptr %0, i64 82624
  store i32 -1, ptr %37, align 8, !tbaa !23
  tail call void @tallyfaces(ptr noundef %0, ptr noundef nonnull %1)
  %38 = getelementptr inbounds i8, ptr %0, i64 528
  tail call void @poolinit(ptr noundef nonnull %38, i32 noundef 16, i32 noundef 252, i32 noundef 252, i32 noundef 0)
  %39 = getelementptr inbounds i8, ptr %0, i64 82764
  store i32 1, ptr %39, align 4, !tbaa !24
  %40 = load i32, ptr %9, align 4, !tbaa !11
  %.not49 = icmp eq i32 %40, 0
  br i1 %.not49, label %43, label %41

41:                                               ; preds = %34
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1057)
  br label %43

43:                                               ; preds = %41, %34
  %44 = getelementptr inbounds i8, ptr %0, i64 82736
  %45 = getelementptr inbounds i8, ptr %0, i64 504
  %46 = load i64, ptr %45, align 8, !tbaa !25
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %43
  %48 = getelementptr inbounds i8, ptr %0, i64 416
  br label %49

49:                                               ; preds = %.lr.ph, %57
  %50 = load i32, ptr %44, align 8, !tbaa !26
  %.not50 = icmp eq i32 %50, 0
  br i1 %.not50, label %.critedge, label %51

51:                                               ; preds = %49
  %52 = tail call ptr @dequeuebadtriang(ptr noundef nonnull %0)
  tail call void @splittriangle(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %52)
  %53 = load i64, ptr %48, align 8, !tbaa !12
  %54 = icmp sgt i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  tail call void @enqueuebadtriang(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %52)
  tail call void @splitencsegs(ptr noundef nonnull %0, ptr noundef %1, i32 noundef 1)
  br label %57

56:                                               ; preds = %51
  tail call void @pooldealloc(ptr noundef nonnull %35, ptr noundef %52)
  br label %57

57:                                               ; preds = %56, %55
  %58 = load i64, ptr %45, align 8, !tbaa !25
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %49, label %.critedge, !llvm.loop !27

.critedge:                                        ; preds = %57, %49, %43, %31
  %60 = load i32, ptr %3, align 8, !tbaa !5
  %.not51 = icmp eq i32 %60, 0
  br i1 %.not51, label %61, label %84

61:                                               ; preds = %.critedge
  %62 = getelementptr inbounds i8, ptr %1, i64 88
  %63 = load i32, ptr %62, align 8, !tbaa !29
  %.not52 = icmp eq i32 %63, 0
  br i1 %.not52, label %84, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %0, i64 416
  %66 = load i64, ptr %65, align 8, !tbaa !12
  %67 = icmp sgt i64 %66, 0
  br i1 %67, label %68, label %84

68:                                               ; preds = %64
  %69 = getelementptr inbounds i8, ptr %0, i64 82736
  %70 = load i32, ptr %69, align 8, !tbaa !26
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %84

72:                                               ; preds = %68
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1058)
  %74 = load i64, ptr %65, align 8, !tbaa !12
  %75 = icmp eq i64 %74, 1
  br i1 %75, label %76, label %78

76:                                               ; preds = %72
  %77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1059)
  br label %80

78:                                               ; preds = %72
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1060, i64 noundef %74)
  br label %80

80:                                               ; preds = %78, %76
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1061)
  %82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1062)
  %83 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1063)
  br label %84

84:                                               ; preds = %80, %68, %64, %61, %.critedge
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { 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 #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 112}
!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 116}
!12 = !{!13, !16, i64 416}
!13 = !{!"mesh", !14, i64 0, !14, i64 88, !14, i64 176, !14, i64 264, !14, i64 352, !14, i64 440, !14, i64 528, !14, i64 616, !8, i64 704, !8, i64 33472, !8, i64 66240, !7, i64 82624, !15, 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, !16, i64 82704, !7, i64 82712, !7, i64 82716, !7, i64 82720, !16, 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, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !16, i64 82816, !16, i64 82824, !15, i64 82832, !15, i64 82840, !15, i64 82848, !15, i64 82856, !15, i64 82864, !15, i64 82872, !15, i64 82880, !17, i64 82888}
!14 = !{!"memorypool", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !16, i64 64, !16, i64 72, !7, i64 80, !7, i64 84}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"otri", !15, i64 0, !7, i64 8}
!18 = !{!6, !10, i64 136}
!19 = !{!6, !7, i64 12}
!20 = !{!6, !7, i64 16}
!21 = !{!6, !7, i64 20}
!22 = !{!15, !15, i64 0}
!23 = !{!13, !7, i64 82624}
!24 = !{!13, !7, i64 82764}
!25 = !{!13, !16, i64 504}
!26 = !{!13, !7, i64 82736}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !7, i64 88}


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