; 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.225 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1078 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1079 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1080 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1083 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1085 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1086 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1087 = external hidden unnamed_addr constant [37 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 void @triexit(i32 noundef) #1

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

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

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

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

25:                                               ; preds = %5
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.1078, ptr noundef %26)
  br label %28

28:                                               ; preds = %25, %5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noalias ptr @fopen(ptr noundef %29, ptr noundef @.str.1079)
  store ptr %30, ptr %11, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %36

33:                                               ; preds = %28
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.1080, ptr noundef %34)
  call void @triexit(i32 noundef 1)
  br label %36

36:                                               ; preds = %33, %28
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.mesh, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %struct.memorypool, ptr %39, i32 0, i32 10
  %41 = load i64, ptr %40, align 8, !tbaa !14
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.behavior, ptr %42, i32 0, i32 31
  %44 = load i32, ptr %43, align 4, !tbaa !19
  %45 = add nsw i32 %44, 1
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.behavior, ptr %46, i32 0, i32 31
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = add nsw i32 %48, 2
  %50 = mul nsw i32 %45, %49
  %51 = sdiv i32 %50, 2
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.mesh, ptr %52, i32 0, i32 27
  %54 = load i32, ptr %53, align 8, !tbaa !20
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.1085, i64 noundef %41, i32 noundef %51, i32 noundef %54) #4
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.mesh, ptr %56, i32 0, i32 0
  call void @traversalinit(ptr noundef %57)
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = call ptr @triangletraverse(ptr noundef %58)
  %60 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %59, ptr %60, align 8, !tbaa !21
  %61 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 0, ptr %61, align 8, !tbaa !22
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.behavior, ptr %62, i32 0, i32 10
  %64 = load i32, ptr %63, align 8, !tbaa !23
  %65 = sext i32 %64 to i64
  store i64 %65, ptr %19, align 8, !tbaa !24
  br label %66

66:                                               ; preds = %225, %36
  %67 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %233

70:                                               ; preds = %66
  %71 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %74 = load i32, ptr %73, align 8, !tbaa !22
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = add nsw i32 %77, 3
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %72, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  store ptr %81, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !22
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = add nsw i32 %88, 3
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %83, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  store ptr %92, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  %95 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %96 = load i32, ptr %95, align 8, !tbaa !22
  %97 = add nsw i32 %96, 3
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds ptr, ptr %94, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  store ptr %100, ptr %15, align 8, !tbaa !5
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.behavior, ptr %101, i32 0, i32 31
  %103 = load i32, ptr %102, align 4, !tbaa !19
  %104 = icmp eq i32 %103, 1
  br i1 %104, label %105, label %130

105:                                              ; preds = %70
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load i64, ptr %19, align 8, !tbaa !24
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mesh, ptr %109, i32 0, i32 30
  %111 = load i32, ptr %110, align 4, !tbaa !25
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %108, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = load ptr, ptr %14, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mesh, ptr %116, i32 0, i32 30
  %118 = load i32, ptr %117, align 4, !tbaa !25
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %115, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.mesh, ptr %123, i32 0, i32 30
  %125 = load i32, ptr %124, align 4, !tbaa !25
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %122, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.1086, i64 noundef %107, i32 noundef %114, i32 noundef %121, i32 noundef %128) #4
  br label %202

130:                                              ; preds = %70
  %131 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.mesh, ptr %133, i32 0, i32 32
  %135 = load i32, ptr %134, align 4, !tbaa !26
  %136 = add nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %132, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  store ptr %139, ptr %16, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !21
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.mesh, ptr %142, i32 0, i32 32
  %144 = load i32, ptr %143, align 4, !tbaa !26
  %145 = add nsw i32 %144, 2
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %141, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  store ptr %148, ptr %17, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !21
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mesh, ptr %151, i32 0, i32 32
  %153 = load i32, ptr %152, align 4, !tbaa !26
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds ptr, ptr %150, i64 %154
  %156 = load ptr, ptr %155, align 8, !tbaa !5
  store ptr %156, ptr %18, align 8, !tbaa !5
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = load i64, ptr %19, align 8, !tbaa !24
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.mesh, ptr %160, i32 0, i32 30
  %162 = load i32, ptr %161, align 4, !tbaa !25
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr %159, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !9
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.mesh, ptr %167, i32 0, i32 30
  %169 = load i32, ptr %168, align 4, !tbaa !25
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %166, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = load ptr, ptr %15, align 8, !tbaa !5
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.mesh, ptr %174, i32 0, i32 30
  %176 = load i32, ptr %175, align 4, !tbaa !25
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i32, ptr %173, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.mesh, ptr %181, i32 0, i32 30
  %183 = load i32, ptr %182, align 4, !tbaa !25
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds i32, ptr %180, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = load ptr, ptr %17, align 8, !tbaa !5
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.mesh, ptr %188, i32 0, i32 30
  %190 = load i32, ptr %189, align 4, !tbaa !25
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds i32, ptr %187, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !9
  %194 = load ptr, ptr %18, align 8, !tbaa !5
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.mesh, ptr %195, i32 0, i32 30
  %197 = load i32, ptr %196, align 4, !tbaa !25
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %194, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %157, ptr noundef @.str.1087, i64 noundef %158, i32 noundef %165, i32 noundef %172, i32 noundef %179, i32 noundef %186, i32 noundef %193, i32 noundef %200) #4
  br label %202

202:                                              ; preds = %130, %105
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %222, %202
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.mesh, ptr %205, i32 0, i32 27
  %207 = load i32, ptr %206, align 8, !tbaa !20
  %208 = icmp slt i32 %204, %207
  br i1 %208, label %209, label %225

209:                                              ; preds = %203
  %210 = load ptr, ptr %11, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !21
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.mesh, ptr %213, i32 0, i32 33
  %215 = load i32, ptr %214, align 8, !tbaa !27
  %216 = load i32, ptr %20, align 4, !tbaa !9
  %217 = add nsw i32 %215, %216
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds double, ptr %212, i64 %218
  %220 = load double, ptr %219, align 8, !tbaa !28
  %221 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.1083, double noundef %220) #4
  br label %222

222:                                              ; preds = %209
  %223 = load i32, ptr %20, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %20, align 4, !tbaa !9
  br label %203, !llvm.loop !29

225:                                              ; preds = %203
  %226 = load ptr, ptr %11, align 8, !tbaa !5
  %227 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %226, ptr noundef @.str.225) #4
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = call ptr @triangletraverse(ptr noundef %228)
  %230 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %229, ptr %230, align 8, !tbaa !21
  %231 = load i64, ptr %19, align 8, !tbaa !24
  %232 = add nsw i64 %231, 1
  store i64 %232, ptr %19, align 8, !tbaa !24
  br label %66, !llvm.loop !31

233:                                              ; preds = %66
  %234 = load ptr, ptr %11, align 8, !tbaa !5
  %235 = load i32, ptr %9, align 4, !tbaa !9
  %236 = load ptr, ptr %10, align 8, !tbaa !5
  call void @finishfile(ptr noundef %234, i32 noundef %235, ptr noundef %236)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 112}
!12 = !{!"behavior", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !13, i64 136, !13, i64 144, !13, i64 152, !13, 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}
!13 = !{!"double", !7, i64 0}
!14 = !{!15, !17, i64 64}
!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, !10, i64 82624, !6, i64 82632, !13, i64 82640, !13, i64 82648, !13, i64 82656, !13, i64 82664, !13, i64 82672, !10, i64 82680, !10, i64 82684, !10, i64 82688, !10, i64 82692, !10, i64 82696, !10, i64 82700, !17, i64 82704, !10, i64 82712, !10, i64 82716, !10, i64 82720, !17, i64 82728, !10, i64 82736, !10, i64 82740, !10, i64 82744, !10, i64 82748, !10, i64 82752, !10, i64 82756, !10, i64 82760, !10, i64 82764, !10, 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, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !17, i64 64, !17, i64 72, !10, i64 80, !10, i64 84}
!17 = !{!"long", !7, i64 0}
!18 = !{!"otri", !6, i64 0, !10, i64 8}
!19 = !{!12, !10, i64 124}
!20 = !{!15, !10, i64 82720}
!21 = !{!18, !6, i64 0}
!22 = !{!18, !10, i64 8}
!23 = !{!12, !10, i64 40}
!24 = !{!17, !17, i64 0}
!25 = !{!15, !10, i64 82740}
!26 = !{!15, !10, i64 82748}
!27 = !{!15, !10, i64 82752}
!28 = !{!13, !13, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


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

@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.225 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1078 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1079 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1080 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1083 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1085 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1086 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.1087 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @triexit(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: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

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

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

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

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

10:                                               ; preds = %8, %5
  %11 = tail call noalias ptr @fopen(ptr noundef %2, ptr noundef nonnull @.str.1079)
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %15

13:                                               ; preds = %10
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1080, ptr noundef %2)
  tail call void @triexit(i32 noundef 1)
  br label %15

15:                                               ; preds = %13, %10
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %1, i64 124
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = add nsw i32 %19, 1
  %21 = add nsw i32 %19, 2
  %22 = mul nsw i32 %20, %21
  %23 = sdiv i32 %22, 2
  %24 = getelementptr inbounds i8, ptr %0, i64 82720
  %25 = load i32, ptr %24, align 8, !tbaa !18
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1085, i64 noundef %17, i32 noundef %23, i32 noundef %25) #2
  tail call void @traversalinit(ptr noundef %0)
  %27 = tail call ptr @triangletraverse(ptr noundef %0)
  %.not6062 = icmp eq ptr %27, null
  br i1 %.not6062, label %._crit_edge67, label %.lr.ph66

.lr.ph66:                                         ; preds = %15
  %28 = getelementptr inbounds i8, ptr %1, i64 40
  %29 = load i32, ptr %28, align 8, !tbaa !19
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %0, i64 82748
  %32 = getelementptr inbounds i8, ptr %0, i64 82740
  %33 = getelementptr inbounds i8, ptr %0, i64 82752
  br label %34

34:                                               ; preds = %.lr.ph66, %._crit_edge
  %.05964 = phi i64 [ %30, %.lr.ph66 ], [ %101, %._crit_edge ]
  %.sroa.0.063 = phi ptr [ %27, %.lr.ph66 ], [ %100, %._crit_edge ]
  %35 = load i32, ptr @plus1mod3, align 4, !tbaa !20
  %36 = add nsw i32 %35, 3
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds ptr, ptr %.sroa.0.063, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = load i32, ptr @minus1mod3, align 4, !tbaa !20
  %41 = add nsw i32 %40, 3
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %.sroa.0.063, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %.sroa.0.063, i64 24
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = load i32, ptr %18, align 4, !tbaa !17
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %49, label %59

49:                                               ; preds = %34
  %50 = load i32, ptr %32, align 4, !tbaa !22
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %39, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !20
  %54 = getelementptr inbounds i32, ptr %44, i64 %51
  %55 = load i32, ptr %54, align 4, !tbaa !20
  %56 = getelementptr inbounds i32, ptr %46, i64 %51
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1086, i64 noundef %.05964, i32 noundef %53, i32 noundef %55, i32 noundef %57) #2
  br label %87

59:                                               ; preds = %34
  %60 = load i32, ptr %31, align 4, !tbaa !23
  %61 = add nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %.sroa.0.063, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !21
  %65 = add nsw i32 %60, 2
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds ptr, ptr %.sroa.0.063, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = sext i32 %60 to i64
  %70 = getelementptr inbounds ptr, ptr %.sroa.0.063, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = load i32, ptr %32, align 4, !tbaa !22
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %39, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !20
  %76 = getelementptr inbounds i32, ptr %44, i64 %73
  %77 = load i32, ptr %76, align 4, !tbaa !20
  %78 = getelementptr inbounds i32, ptr %46, i64 %73
  %79 = load i32, ptr %78, align 4, !tbaa !20
  %80 = getelementptr inbounds i32, ptr %64, i64 %73
  %81 = load i32, ptr %80, align 4, !tbaa !20
  %82 = getelementptr inbounds i32, ptr %68, i64 %73
  %83 = load i32, ptr %82, align 4, !tbaa !20
  %84 = getelementptr inbounds i32, ptr %71, i64 %73
  %85 = load i32, ptr %84, align 4, !tbaa !20
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1087, i64 noundef %.05964, i32 noundef %75, i32 noundef %77, i32 noundef %79, i32 noundef %81, i32 noundef %83, i32 noundef %85) #2
  br label %87

87:                                               ; preds = %59, %49
  %88 = load i32, ptr %24, align 8, !tbaa !18
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %87, %.lr.ph
  %.061 = phi i32 [ %96, %.lr.ph ], [ 0, %87 ]
  %90 = load i32, ptr %33, align 8, !tbaa !24
  %91 = add nsw i32 %90, %.061
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds double, ptr %.sroa.0.063, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !25
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1083, double noundef %94) #2
  %96 = add nuw nsw i32 %.061, 1
  %97 = load i32, ptr %24, align 8, !tbaa !18
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %.lr.ph, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph, %87
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.225) #2
  %100 = tail call ptr @triangletraverse(ptr noundef nonnull %0)
  %101 = add nsw i64 %.05964, 1
  %.not60 = icmp eq ptr %100, null
  br i1 %.not60, label %._crit_edge67, label %34, !llvm.loop !28

._crit_edge67:                                    ; preds = %._crit_edge, %15
  tail call void @finishfile(ptr noundef %11, i32 noundef %3, ptr noundef %4)
  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" }
attributes #2 = { 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 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 = !{!12, !15, i64 64}
!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 = !{!6, !7, i64 124}
!18 = !{!12, !7, i64 82720}
!19 = !{!6, !7, i64 40}
!20 = !{!7, !7, i64 0}
!21 = !{!14, !14, i64 0}
!22 = !{!12, !7, i64 82740}
!23 = !{!12, !7, i64 82748}
!24 = !{!12, !7, i64 82752}
!25 = !{!10, !10, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


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