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

@.str.976 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.977 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.978 = external hidden unnamed_addr constant [26 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: nounwind uwtable
declare dso_local ptr @trimalloc(i32 noundef) #1

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @removeghosts(ptr noundef, ptr noundef, ptr noundef) #1

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

15:                                               ; preds = %2
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.976)
  br label %17

17:                                               ; preds = %15, %2
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.mesh, ptr %18, i32 0, i32 18
  %20 = load i32, ptr %19, align 8, !tbaa !13
  %21 = mul nsw i32 %20, 8
  %22 = call ptr @trimalloc(i32 noundef %21)
  store ptr %22, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mesh, ptr %23, i32 0, i32 2
  call void @traversalinit(ptr noundef %24)
  store i32 0, ptr %9, align 4, !tbaa !18
  br label %25

25:                                               ; preds = %38, %17
  %26 = load i32, ptr %9, align 4, !tbaa !18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.mesh, ptr %27, i32 0, i32 18
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %31, label %41

31:                                               ; preds = %25
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = call ptr @vertextraverse(ptr noundef %32)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load i32, ptr %9, align 4, !tbaa !18
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %34, i64 %36
  store ptr %33, ptr %37, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %31
  %39 = load i32, ptr %9, align 4, !tbaa !18
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %9, align 4, !tbaa !18
  br label %25, !llvm.loop !19

41:                                               ; preds = %25
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mesh, ptr %43, i32 0, i32 18
  %45 = load i32, ptr %44, align 8, !tbaa !13
  call void @vertexsort(ptr noundef %42, i32 noundef %45)
  store i32 0, ptr %9, align 4, !tbaa !18
  store i32 1, ptr %10, align 4, !tbaa !18
  br label %46

46:                                               ; preds = %134, %41
  %47 = load i32, ptr %10, align 4, !tbaa !18
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.mesh, ptr %48, i32 0, i32 18
  %50 = load i32, ptr %49, align 8, !tbaa !13
  %51 = icmp slt i32 %47, %50
  br i1 %51, label %52, label %137

52:                                               ; preds = %46
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !18
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds double, ptr %57, i64 0
  %59 = load double, ptr %58, align 8, !tbaa !21
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !18
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds double, ptr %64, i64 0
  %66 = load double, ptr %65, align 8, !tbaa !21
  %67 = fcmp oeq double %59, %66
  br i1 %67, label %68, label %121

68:                                               ; preds = %52
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !18
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %69, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %73, i64 1
  %75 = load double, ptr %74, align 8, !tbaa !21
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !18
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds double, ptr %80, i64 1
  %82 = load double, ptr %81, align 8, !tbaa !21
  %83 = fcmp oeq double %75, %82
  br i1 %83, label %84, label %121

84:                                               ; preds = %68
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.behavior, ptr %85, i32 0, i32 28
  %87 = load i32, ptr %86, align 8, !tbaa !22
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %105, label %89

89:                                               ; preds = %84
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load i32, ptr %10, align 4, !tbaa !18
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds double, ptr %94, i64 0
  %96 = load double, ptr %95, align 8, !tbaa !21
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !18
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds ptr, ptr %97, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds double, ptr %101, i64 1
  %103 = load double, ptr %102, align 8, !tbaa !21
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.977, double noundef %96, double noundef %103)
  br label %105

105:                                              ; preds = %89, %84
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !18
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mesh, ptr %111, i32 0, i32 30
  %113 = load i32, ptr %112, align 4, !tbaa !23
  %114 = add nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %110, i64 %115
  store i32 -32767, ptr %116, align 4, !tbaa !18
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.mesh, ptr %117, i32 0, i32 23
  %119 = load i32, ptr %118, align 4, !tbaa !24
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !24
  br label %133

121:                                              ; preds = %68, %52
  %122 = load i32, ptr %9, align 4, !tbaa !18
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !18
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !18
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %124, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !18
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  store ptr %128, ptr %132, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %121, %105
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %10, align 4, !tbaa !18
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %10, align 4, !tbaa !18
  br label %46, !llvm.loop !25

137:                                              ; preds = %46
  %138 = load i32, ptr %9, align 4, !tbaa !18
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !18
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.behavior, ptr %140, i32 0, i32 25
  %142 = load i32, ptr %141, align 4, !tbaa !26
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %166

144:                                              ; preds = %137
  %145 = load i32, ptr %9, align 4, !tbaa !18
  %146 = ashr i32 %145, 1
  store i32 %146, ptr %8, align 4, !tbaa !18
  %147 = load i32, ptr %9, align 4, !tbaa !18
  %148 = load i32, ptr %8, align 4, !tbaa !18
  %149 = sub nsw i32 %147, %148
  %150 = icmp sge i32 %149, 2
  br i1 %150, label %151, label %165

151:                                              ; preds = %144
  %152 = load i32, ptr %8, align 4, !tbaa !18
  %153 = icmp sge i32 %152, 2
  br i1 %153, label %154, label %157

154:                                              ; preds = %151
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = load i32, ptr %8, align 4, !tbaa !18
  call void @alternateaxes(ptr noundef %155, i32 noundef %156, i32 noundef 1)
  br label %157

157:                                              ; preds = %154, %151
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = load i32, ptr %8, align 4, !tbaa !18
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds ptr, ptr %158, i64 %160
  %162 = load i32, ptr %9, align 4, !tbaa !18
  %163 = load i32, ptr %8, align 4, !tbaa !18
  %164 = sub nsw i32 %162, %163
  call void @alternateaxes(ptr noundef %161, i32 noundef %164, i32 noundef 1)
  br label %165

165:                                              ; preds = %157, %144
  br label %166

166:                                              ; preds = %165, %137
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.behavior, ptr %167, i32 0, i32 29
  %169 = load i32, ptr %168, align 4, !tbaa !9
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %173

171:                                              ; preds = %166
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.978)
  br label %173

173:                                              ; preds = %171, %166
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = load i32, ptr %9, align 4, !tbaa !18
  call void @divconqrecurse(ptr noundef %174, ptr noundef %175, ptr noundef %176, i32 noundef %177, i32 noundef 0, ptr noundef %6, ptr noundef %7)
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  call void @trifree(ptr noundef %178)
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = call i64 @removeghosts(ptr noundef %179, ptr noundef %180, ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %5) #3
  ret i64 %181
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 116}
!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 = !{!14, !11, i64 82680}
!14 = !{!"mesh", !15, i64 0, !15, i64 88, !15, i64 176, !15, i64 264, !15, i64 352, !15, i64 440, !15, i64 528, !15, 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, !16, i64 82704, !11, i64 82712, !11, i64 82716, !11, i64 82720, !16, 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, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !16, i64 82816, !16, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !6, i64 82872, !6, i64 82880, !17, i64 82888}
!15 = !{!"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, !16, i64 64, !16, i64 72, !11, i64 80, !11, i64 84}
!16 = !{!"long", !7, i64 0}
!17 = !{!"otri", !6, i64 0, !11, i64 8}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !12, i64 0}
!22 = !{!10, !11, i64 112}
!23 = !{!14, !11, i64 82740}
!24 = !{!14, !11, i64 82700}
!25 = distinct !{!25, !20}
!26 = !{!10, !11, i64 100}


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

@.str.976 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.977 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.978 = external hidden unnamed_addr constant [26 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: nounwind uwtable
declare dso_local ptr @trimalloc(i32 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @divconqdelaunay(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %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 116
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %9, label %7

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

9:                                                ; preds = %7, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 82680
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = shl nsw i32 %11, 3
  %13 = tail call ptr @trimalloc(i32 noundef %12)
  %14 = getelementptr inbounds i8, ptr %0, i64 176
  tail call void @traversalinit(ptr noundef nonnull %14)
  %15 = load i32, ptr %10, align 8, !tbaa !11
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %9 ]
  %17 = tail call ptr @vertextraverse(ptr noundef nonnull %0)
  %18 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv
  store ptr %17, ptr %18, align 8, !tbaa !17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr %10, align 8, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %9
  %.lcssa = phi i32 [ %15, %9 ], [ %19, %.lr.ph ]
  tail call void @vertexsort(ptr noundef %13, i32 noundef %.lcssa)
  %22 = load i32, ptr %10, align 8, !tbaa !11
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %1, i64 112
  %25 = getelementptr inbounds i8, ptr %0, i64 82740
  %26 = getelementptr inbounds i8, ptr %0, i64 82700
  br label %27

27:                                               ; preds = %.lr.ph68, %59
  %28 = phi i32 [ %22, %.lr.ph68 ], [ %60, %59 ]
  %indvars.iv73 = phi i64 [ 1, %.lr.ph68 ], [ %indvars.iv.next74, %59 ]
  %.165 = phi i32 [ 0, %.lr.ph68 ], [ %.2, %59 ]
  %29 = sext i32 %.165 to i64
  %30 = getelementptr inbounds ptr, ptr %13, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = load double, ptr %31, align 8, !tbaa !20
  %33 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv73
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  %35 = load double, ptr %34, align 8, !tbaa !20
  %36 = fcmp oeq double %32, %35
  br i1 %36, label %37, label %55

37:                                               ; preds = %27
  %38 = getelementptr inbounds i8, ptr %31, i64 8
  %39 = load double, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %34, i64 8
  %41 = load double, ptr %40, align 8, !tbaa !20
  %42 = fcmp oeq double %39, %41
  br i1 %42, label %43, label %55

43:                                               ; preds = %37
  %44 = load i32, ptr %24, align 8, !tbaa !21
  %.not63 = icmp eq i32 %44, 0
  br i1 %.not63, label %45, label %47

45:                                               ; preds = %43
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.977, double noundef %35, double noundef %41)
  %.pre = load ptr, ptr %33, align 8, !tbaa !17
  br label %47

47:                                               ; preds = %45, %43
  %48 = phi ptr [ %.pre, %45 ], [ %34, %43 ]
  %49 = load i32, ptr %25, align 4, !tbaa !22
  %50 = sext i32 %49 to i64
  %51 = getelementptr i32, ptr %48, i64 %50
  %52 = getelementptr i8, ptr %51, i64 4
  store i32 -32767, ptr %52, align 4, !tbaa !23
  %53 = load i32, ptr %26, align 4, !tbaa !24
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %26, align 4, !tbaa !24
  %.pre76 = load i32, ptr %10, align 8, !tbaa !11
  br label %59

55:                                               ; preds = %37, %27
  %56 = add nsw i32 %.165, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %13, i64 %57
  store ptr %34, ptr %58, align 8, !tbaa !17
  br label %59

59:                                               ; preds = %47, %55
  %60 = phi i32 [ %.pre76, %47 ], [ %28, %55 ]
  %.2 = phi i32 [ %.165, %47 ], [ %56, %55 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next74, %61
  br i1 %62, label %27, label %._crit_edge69.loopexit, !llvm.loop !25

._crit_edge69.loopexit:                           ; preds = %59
  %63 = add nsw i32 %.2, 1
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %._crit_edge69.loopexit, %._crit_edge
  %.1.lcssa = phi i32 [ 1, %._crit_edge ], [ %63, %._crit_edge69.loopexit ]
  %64 = getelementptr inbounds i8, ptr %1, i64 100
  %65 = load i32, ptr %64, align 4, !tbaa !26
  %.not61 = icmp eq i32 %65, 0
  br i1 %.not61, label %76, label %66

66:                                               ; preds = %._crit_edge69
  %67 = ashr i32 %.1.lcssa, 1
  %68 = sub nsw i32 %.1.lcssa, %67
  %69 = icmp sgt i32 %68, 1
  br i1 %69, label %70, label %76

70:                                               ; preds = %66
  %71 = icmp sgt i32 %67, 1
  br i1 %71, label %72, label %73

72:                                               ; preds = %70
  tail call void @alternateaxes(ptr noundef %13, i32 noundef %67, i32 noundef 1)
  br label %73

73:                                               ; preds = %72, %70
  %74 = sext i32 %67 to i64
  %75 = getelementptr inbounds ptr, ptr %13, i64 %74
  tail call void @alternateaxes(ptr noundef %75, i32 noundef %68, i32 noundef 1)
  br label %76

76:                                               ; preds = %66, %73, %._crit_edge69
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %.not62 = icmp eq i32 %77, 0
  br i1 %.not62, label %80, label %78

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

80:                                               ; preds = %78, %76
  call void @divconqrecurse(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %13, i32 noundef %.1.lcssa, i32 noundef 0, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @trifree(ptr noundef %13)
  %81 = call i64 @removeghosts(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %3)
  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 i64 %81
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 116}
!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 = !{!12, !7, i64 82680}
!12 = !{!"mesh", !13, i64 0, !13, i64 88, !13, i64 176, !13, i64 264, !13, i64 352, !13, i64 440, !13, i64 528, !13, 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, !15, i64 82704, !7, i64 82712, !7, i64 82716, !7, i64 82720, !15, 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, !15, i64 82776, !15, i64 82784, !15, i64 82792, !15, i64 82800, !15, i64 82808, !15, i64 82816, !15, i64 82824, !14, i64 82832, !14, i64 82840, !14, i64 82848, !14, i64 82856, !14, i64 82864, !14, i64 82872, !14, i64 82880, !16, i64 82888}
!13 = !{!"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, !15, i64 64, !15, i64 72, !7, i64 80, !7, i64 84}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!"otri", !14, i64 0, !7, i64 8}
!17 = !{!14, !14, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!10, !10, i64 0}
!21 = !{!6, !7, i64 112}
!22 = !{!12, !7, i64 82740}
!23 = !{!7, !7, i64 0}
!24 = !{!12, !7, i64 82700}
!25 = distinct !{!25, !19}
!26 = !{!6, !7, i64 100}


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