; LLVM IR from MIT-SPARK/Kimera-VIO :: third_party/triangle/src (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, float, float, float, float }
%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, float, float, float, float, float, 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.110 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @trimalloc(i32 noundef) #0

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

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

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

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

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

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

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

22:                                               ; preds = %20, %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %36

26:                                               ; preds = %22
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.mesh, ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %struct.memorypool, ptr %28, i32 0, i32 10
  %30 = load i64, ptr %29, align 8, !tbaa !13
  %31 = mul nsw i64 %30, 3
  %32 = mul i64 %31, 4
  %33 = trunc i64 %32 to i32
  %34 = call ptr @trimalloc(i32 noundef %33)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %34, ptr %35, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %26, %22
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  store ptr %38, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !18
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mesh, ptr %39, i32 0, i32 0
  call void @traversalinit(ptr noundef %40)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call ptr @triangletraverse(ptr noundef %41)
  %43 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  store ptr %42, ptr %43, align 8, !tbaa !19
  %44 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  store i32 0, ptr %44, align 8, !tbaa !20
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.behavior, ptr %45, i32 0, i32 10
  %47 = load i32, ptr %46, align 4, !tbaa !21
  %48 = sext i32 %47 to i64
  store i64 %48, ptr %11, align 8, !tbaa !22
  br label %49

49:                                               ; preds = %53, %36
  %50 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %64

53:                                               ; preds = %49
  %54 = load i64, ptr %11, align 8, !tbaa !22
  %55 = trunc i64 %54 to i32
  %56 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = getelementptr inbounds ptr, ptr %57, i64 6
  store i32 %55, ptr %58, align 4, !tbaa !18
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = call ptr @triangletraverse(ptr noundef %59)
  %61 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  store ptr %60, ptr %61, align 8, !tbaa !19
  %62 = load i64, ptr %11, align 8, !tbaa !22
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %11, align 8, !tbaa !22
  br label %49, !llvm.loop !23

64:                                               ; preds = %49
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.mesh, ptr %65, i32 0, i32 48
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  %68 = getelementptr inbounds ptr, ptr %67, i64 6
  store i32 -1, ptr %68, align 4, !tbaa !18
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mesh, ptr %69, i32 0, i32 0
  call void @traversalinit(ptr noundef %70)
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call ptr @triangletraverse(ptr noundef %71)
  %73 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  store ptr %72, ptr %73, align 8, !tbaa !19
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.behavior, ptr %74, i32 0, i32 10
  %76 = load i32, ptr %75, align 4, !tbaa !21
  %77 = sext i32 %76 to i64
  store i64 %77, ptr %11, align 8, !tbaa !22
  br label %78

78:                                               ; preds = %82, %64
  %79 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !19
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %181

82:                                               ; preds = %78
  %83 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  store i32 1, ptr %83, align 8, !tbaa !20
  %84 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !20
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds ptr, ptr %85, i64 %88
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  store ptr %90, ptr %15, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = ptrtoint ptr %91 to i64
  %93 = and i64 %92, 3
  %94 = trunc i64 %93 to i32
  %95 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  store i32 %94, ptr %95, align 8, !tbaa !20
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = ptrtoint ptr %96 to i64
  %98 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !20
  %100 = sext i32 %99 to i64
  %101 = xor i64 %97, %100
  %102 = inttoptr i64 %101 to ptr
  %103 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  store ptr %102, ptr %103, align 8, !tbaa !19
  %104 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !19
  %106 = getelementptr inbounds ptr, ptr %105, i64 6
  %107 = load i32, ptr %106, align 4, !tbaa !18
  store i32 %107, ptr %12, align 4, !tbaa !18
  %108 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  store i32 2, ptr %108, align 8, !tbaa !20
  %109 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %112 = load i32, ptr %111, align 8, !tbaa !20
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds ptr, ptr %110, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  store ptr %115, ptr %15, align 8, !tbaa !5
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  %117 = ptrtoint ptr %116 to i64
  %118 = and i64 %117, 3
  %119 = trunc i64 %118 to i32
  %120 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  store i32 %119, ptr %120, align 8, !tbaa !20
  %121 = load ptr, ptr %15, align 8, !tbaa !5
  %122 = ptrtoint ptr %121 to i64
  %123 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  %124 = load i32, ptr %123, align 8, !tbaa !20
  %125 = sext i32 %124 to i64
  %126 = xor i64 %122, %125
  %127 = inttoptr i64 %126 to ptr
  %128 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  store ptr %127, ptr %128, align 8, !tbaa !19
  %129 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !19
  %131 = getelementptr inbounds ptr, ptr %130, i64 6
  %132 = load i32, ptr %131, align 4, !tbaa !18
  store i32 %132, ptr %13, align 4, !tbaa !18
  %133 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  store i32 0, ptr %133, align 8, !tbaa !20
  %134 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !19
  %136 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !20
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds ptr, ptr %135, i64 %138
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  store ptr %140, ptr %15, align 8, !tbaa !5
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  %142 = ptrtoint ptr %141 to i64
  %143 = and i64 %142, 3
  %144 = trunc i64 %143 to i32
  %145 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  store i32 %144, ptr %145, align 8, !tbaa !20
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = ptrtoint ptr %146 to i64
  %148 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 1
  %149 = load i32, ptr %148, align 8, !tbaa !20
  %150 = sext i32 %149 to i64
  %151 = xor i64 %147, %150
  %152 = inttoptr i64 %151 to ptr
  %153 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  store ptr %152, ptr %153, align 8, !tbaa !19
  %154 = getelementptr inbounds %struct.otri, ptr %10, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !19
  %156 = getelementptr inbounds ptr, ptr %155, i64 6
  %157 = load i32, ptr %156, align 4, !tbaa !18
  store i32 %157, ptr %14, align 4, !tbaa !18
  %158 = load i32, ptr %12, align 4, !tbaa !18
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = load i32, ptr %8, align 4, !tbaa !18
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %8, align 4, !tbaa !18
  %162 = sext i32 %160 to i64
  %163 = getelementptr inbounds i32, ptr %159, i64 %162
  store i32 %158, ptr %163, align 4, !tbaa !18
  %164 = load i32, ptr %13, align 4, !tbaa !18
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = load i32, ptr %8, align 4, !tbaa !18
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %8, align 4, !tbaa !18
  %168 = sext i32 %166 to i64
  %169 = getelementptr inbounds i32, ptr %165, i64 %168
  store i32 %164, ptr %169, align 4, !tbaa !18
  %170 = load i32, ptr %14, align 4, !tbaa !18
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = load i32, ptr %8, align 4, !tbaa !18
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %8, align 4, !tbaa !18
  %174 = sext i32 %172 to i64
  %175 = getelementptr inbounds i32, ptr %171, i64 %174
  store i32 %170, ptr %175, align 4, !tbaa !18
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = call ptr @triangletraverse(ptr noundef %176)
  %178 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  store ptr %177, ptr %178, align 8, !tbaa !19
  %179 = load i64, ptr %11, align 8, !tbaa !22
  %180 = add nsw i64 %179, 1
  store i64 %180, ptr %11, align 8, !tbaa !22
  br label %78, !llvm.loop !26

181:                                              ; preds = %78
  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 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 140, !12, i64 144, !12, i64 148}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !16, i64 64}
!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 82644, !12, i64 82648, !12, i64 82652, !12, i64 82656, !11, i64 82660, !11, i64 82664, !11, i64 82668, !11, i64 82672, !11, i64 82676, !11, i64 82680, !16, i64 82688, !11, i64 82696, !11, i64 82700, !11, i64 82704, !16, i64 82712, !11, i64 82720, !11, i64 82724, !11, i64 82728, !11, i64 82732, !11, i64 82736, !11, i64 82740, !11, i64 82744, !11, i64 82748, !11, i64 82752, !16, i64 82760, !16, i64 82768, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !6, i64 82816, !6, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !17, i64 82872}
!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 = !{!17, !6, i64 0}
!20 = !{!17, !11, i64 8}
!21 = !{!10, !11, i64 40}
!22 = !{!16, !16, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!14, !6, i64 82840}
!26 = distinct !{!26, !24}


; 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.110 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @trimalloc(i32 noundef) local_unnamed_addr #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 @traversalinit(ptr noundef) local_unnamed_addr #0

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

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

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

8:                                                ; preds = %6, %3
  %9 = load ptr, ptr %2, align 8, !tbaa !11
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %17

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = load i64, ptr %12, align 8, !tbaa !13
  %14 = trunc i64 %13 to i32
  %15 = mul i32 %14, 12
  %16 = tail call ptr @trimalloc(i32 noundef %15)
  store ptr %16, ptr %2, align 8, !tbaa !11
  br label %17

17:                                               ; preds = %11, %8
  %18 = phi ptr [ %16, %11 ], [ %9, %8 ]
  tail call void @traversalinit(ptr noundef %0)
  %19 = tail call ptr @triangletraverse(ptr noundef %0)
  %.not4446 = icmp eq ptr %19, null
  br i1 %.not4446, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %17
  %20 = getelementptr inbounds i8, ptr %1, i64 40
  %21 = load i32, ptr %20, align 4, !tbaa !18
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.sroa.015.048 = phi ptr [ %23, %.lr.ph ], [ %19, %.lr.ph.preheader ]
  %.04347 = phi i32 [ %24, %.lr.ph ], [ %21, %.lr.ph.preheader ]
  %22 = getelementptr inbounds i8, ptr %.sroa.015.048, i64 48
  store i32 %.04347, ptr %22, align 4, !tbaa !19
  %23 = tail call ptr @triangletraverse(ptr noundef %0)
  %24 = add i32 %.04347, 1
  %.not44 = icmp eq ptr %23, null
  br i1 %.not44, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %17
  %25 = getelementptr inbounds i8, ptr %0, i64 82840
  %26 = load ptr, ptr %25, align 8, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %26, i64 48
  store i32 -1, ptr %27, align 4, !tbaa !19
  tail call void @traversalinit(ptr noundef %0)
  %28 = tail call ptr @triangletraverse(ptr noundef %0)
  %invariant.gep = getelementptr inbounds i8, ptr %18, i64 8
  %.not4549 = icmp eq ptr %28, null
  br i1 %.not4549, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %._crit_edge, %.lr.ph53
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph53 ], [ 0, %._crit_edge ]
  %.sroa.015.150 = phi ptr [ %51, %.lr.ph53 ], [ %28, %._crit_edge ]
  %29 = getelementptr inbounds i8, ptr %.sroa.015.150, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = ptrtoint ptr %30 to i64
  %32 = and i64 %31, -4
  %33 = inttoptr i64 %32 to ptr
  %34 = getelementptr inbounds i8, ptr %33, i64 48
  %35 = load i32, ptr %34, align 4, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %.sroa.015.150, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = ptrtoint ptr %37 to i64
  %39 = and i64 %38, -4
  %40 = inttoptr i64 %39 to ptr
  %41 = getelementptr inbounds i8, ptr %40, i64 48
  %42 = load i32, ptr %41, align 4, !tbaa !19
  %43 = load ptr, ptr %.sroa.015.150, align 8, !tbaa !11
  %44 = ptrtoint ptr %43 to i64
  %45 = and i64 %44, -4
  %46 = inttoptr i64 %45 to ptr
  %47 = getelementptr inbounds i8, ptr %46, i64 48
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
  store i32 %35, ptr %49, align 4, !tbaa !19
  %50 = getelementptr i8, ptr %49, i64 4
  store i32 %42, ptr %50, align 4, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 3
  %gep = getelementptr inbounds i32, ptr %invariant.gep, i64 %indvars.iv
  store i32 %48, ptr %gep, align 4, !tbaa !19
  %51 = tail call ptr @triangletraverse(ptr noundef %0)
  %.not45 = icmp eq ptr %51, null
  br i1 %.not45, label %._crit_edge54, label %.lr.ph53, !llvm.loop !23

._crit_edge54:                                    ; preds = %.lr.ph53, %._crit_edge
  ret void
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 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 140, !10, i64 144, !10, i64 148}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !16, i64 64}
!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, !8, i64 704, !8, i64 33472, !8, i64 66240, !7, i64 82624, !12, i64 82632, !10, i64 82640, !10, i64 82644, !10, i64 82648, !10, i64 82652, !10, i64 82656, !7, i64 82660, !7, i64 82664, !7, i64 82668, !7, i64 82672, !7, i64 82676, !7, i64 82680, !16, i64 82688, !7, i64 82696, !7, i64 82700, !7, i64 82704, !16, i64 82712, !7, i64 82720, !7, i64 82724, !7, i64 82728, !7, i64 82732, !7, i64 82736, !7, i64 82740, !7, i64 82744, !7, i64 82748, !7, i64 82752, !16, i64 82760, !16, i64 82768, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !12, i64 82816, !12, i64 82824, !12, i64 82832, !12, i64 82840, !12, i64 82848, !12, i64 82856, !12, i64 82864, !17, i64 82872}
!15 = !{!"memorypool", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, 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}
!16 = !{!"long", !8, i64 0}
!17 = !{!"otri", !12, i64 0, !7, i64 8}
!18 = !{!6, !7, i64 40}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !12, i64 82840}
!23 = distinct !{!23, !21}


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