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

@.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.1088 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1089 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1090 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1091 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1092 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1093 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1094 = external hidden unnamed_addr constant [35 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 @subsegtraverse(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 @writepoly(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8) #1 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca %struct.osub, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !9
  store ptr %5, ptr %15, align 8, !tbaa !5
  store i32 %6, ptr %16, align 4, !tbaa !9
  store i32 %7, ptr %17, align 4, !tbaa !9
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.behavior, ptr %26, i32 0, i32 28
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %33, label %30

30:                                               ; preds = %9
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.1078, ptr noundef %31)
  br label %33

33:                                               ; preds = %30, %9
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = call noalias ptr @fopen(ptr noundef %34, ptr noundef @.str.1079)
  store ptr %35, ptr %19, align 8, !tbaa !5
  %36 = load ptr, ptr %19, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %33
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.1080, ptr noundef %39)
  call void @triexit(i32 noundef 1)
  br label %41

41:                                               ; preds = %38, %33
  %42 = load ptr, ptr %19, align 8, !tbaa !5
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mesh, ptr %43, i32 0, i32 25
  %45 = load i32, ptr %44, align 8, !tbaa !14
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.mesh, ptr %46, i32 0, i32 26
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.behavior, ptr %49, i32 0, i32 15
  %51 = load i32, ptr %50, align 4, !tbaa !20
  %52 = sub nsw i32 1, %51
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.1088, i32 noundef 0, i32 noundef %45, i32 noundef %48, i32 noundef %52) #4
  %54 = load ptr, ptr %19, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mesh, ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds %struct.memorypool, ptr %56, i32 0, i32 10
  %58 = load i64, ptr %57, align 8, !tbaa !21
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.behavior, ptr %59, i32 0, i32 15
  %61 = load i32, ptr %60, align 4, !tbaa !20
  %62 = sub nsw i32 1, %61
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.1089, i64 noundef %58, i32 noundef %62) #4
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.mesh, ptr %64, i32 0, i32 1
  call void @traversalinit(ptr noundef %65)
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = call ptr @subsegtraverse(ptr noundef %66)
  %68 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  store ptr %67, ptr %68, align 8, !tbaa !22
  %69 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 1
  store i32 0, ptr %69, align 8, !tbaa !24
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.behavior, ptr %70, i32 0, i32 10
  %72 = load i32, ptr %71, align 8, !tbaa !25
  %73 = sext i32 %72 to i64
  store i64 %73, ptr %25, align 8, !tbaa !26
  br label %74

74:                                               ; preds = %139, %41
  %75 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !22
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %145

78:                                               ; preds = %74
  %79 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !24
  %83 = add nsw i32 2, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %80, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  store ptr %86, ptr %23, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !22
  %89 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !24
  %91 = sub nsw i32 3, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %88, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  store ptr %94, ptr %24, align 8, !tbaa !5
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.behavior, ptr %95, i32 0, i32 15
  %97 = load i32, ptr %96, align 4, !tbaa !20
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %117

99:                                               ; preds = %78
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  %101 = load i64, ptr %25, align 8, !tbaa !26
  %102 = load ptr, ptr %23, align 8, !tbaa !5
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.mesh, ptr %103, i32 0, i32 30
  %105 = load i32, ptr %104, align 4, !tbaa !27
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr %102, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = load ptr, ptr %24, align 8, !tbaa !5
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.mesh, ptr %110, i32 0, i32 30
  %112 = load i32, ptr %111, align 4, !tbaa !27
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %109, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.1090, i64 noundef %101, i32 noundef %108, i32 noundef %115) #4
  br label %139

117:                                              ; preds = %78
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = load i64, ptr %25, align 8, !tbaa !26
  %120 = load ptr, ptr %23, align 8, !tbaa !5
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.mesh, ptr %121, i32 0, i32 30
  %123 = load i32, ptr %122, align 4, !tbaa !27
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i32, ptr %120, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = load ptr, ptr %24, align 8, !tbaa !5
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.mesh, ptr %128, i32 0, i32 30
  %130 = load i32, ptr %129, align 4, !tbaa !27
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %127, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !9
  %134 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !22
  %136 = getelementptr inbounds ptr, ptr %135, i64 8
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.1091, i64 noundef %119, i32 noundef %126, i32 noundef %133, i32 noundef %137) #4
  br label %139

139:                                              ; preds = %117, %99
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = call ptr @subsegtraverse(ptr noundef %140)
  %142 = getelementptr inbounds %struct.osub, ptr %22, i32 0, i32 0
  store ptr %141, ptr %142, align 8, !tbaa !22
  %143 = load i64, ptr %25, align 8, !tbaa !26
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %25, align 8, !tbaa !26
  br label %74, !llvm.loop !28

145:                                              ; preds = %74
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.1092, i32 noundef %147) #4
  %149 = load i32, ptr %14, align 4, !tbaa !9
  %150 = icmp sgt i32 %149, 0
  br i1 %150, label %151, label %181

151:                                              ; preds = %145
  store i64 0, ptr %20, align 8, !tbaa !26
  br label %152

152:                                              ; preds = %177, %151
  %153 = load i64, ptr %20, align 8, !tbaa !26
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = icmp slt i64 %153, %155
  br i1 %156, label %157, label %180

157:                                              ; preds = %152
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.behavior, ptr %159, i32 0, i32 10
  %161 = load i32, ptr %160, align 8, !tbaa !25
  %162 = sext i32 %161 to i64
  %163 = load i64, ptr %20, align 8, !tbaa !26
  %164 = add nsw i64 %162, %163
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  %166 = load i64, ptr %20, align 8, !tbaa !26
  %167 = mul nsw i64 2, %166
  %168 = getelementptr inbounds double, ptr %165, i64 %167
  %169 = load double, ptr %168, align 8, !tbaa !30
  %170 = load ptr, ptr %13, align 8, !tbaa !5
  %171 = load i64, ptr %20, align 8, !tbaa !26
  %172 = mul nsw i64 2, %171
  %173 = add nsw i64 %172, 1
  %174 = getelementptr inbounds double, ptr %170, i64 %173
  %175 = load double, ptr %174, align 8, !tbaa !30
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef @.str.1093, i64 noundef %164, double noundef %169, double noundef %175) #4
  br label %177

177:                                              ; preds = %157
  %178 = load i64, ptr %20, align 8, !tbaa !26
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %20, align 8, !tbaa !26
  br label %152, !llvm.loop !31

180:                                              ; preds = %152
  br label %181

181:                                              ; preds = %180, %145
  %182 = load i32, ptr %16, align 4, !tbaa !9
  %183 = icmp sgt i32 %182, 0
  br i1 %183, label %184, label %229

184:                                              ; preds = %181
  %185 = load ptr, ptr %19, align 8, !tbaa !5
  %186 = load i32, ptr %16, align 4, !tbaa !9
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.1092, i32 noundef %186) #4
  store i64 0, ptr %21, align 8, !tbaa !26
  br label %188

188:                                              ; preds = %225, %184
  %189 = load i64, ptr %21, align 8, !tbaa !26
  %190 = load i32, ptr %16, align 4, !tbaa !9
  %191 = sext i32 %190 to i64
  %192 = icmp slt i64 %189, %191
  br i1 %192, label %193, label %228

193:                                              ; preds = %188
  %194 = load ptr, ptr %19, align 8, !tbaa !5
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.behavior, ptr %195, i32 0, i32 10
  %197 = load i32, ptr %196, align 8, !tbaa !25
  %198 = sext i32 %197 to i64
  %199 = load i64, ptr %21, align 8, !tbaa !26
  %200 = add nsw i64 %198, %199
  %201 = load ptr, ptr %15, align 8, !tbaa !5
  %202 = load i64, ptr %21, align 8, !tbaa !26
  %203 = mul nsw i64 4, %202
  %204 = getelementptr inbounds double, ptr %201, i64 %203
  %205 = load double, ptr %204, align 8, !tbaa !30
  %206 = load ptr, ptr %15, align 8, !tbaa !5
  %207 = load i64, ptr %21, align 8, !tbaa !26
  %208 = mul nsw i64 4, %207
  %209 = add nsw i64 %208, 1
  %210 = getelementptr inbounds double, ptr %206, i64 %209
  %211 = load double, ptr %210, align 8, !tbaa !30
  %212 = load ptr, ptr %15, align 8, !tbaa !5
  %213 = load i64, ptr %21, align 8, !tbaa !26
  %214 = mul nsw i64 4, %213
  %215 = add nsw i64 %214, 2
  %216 = getelementptr inbounds double, ptr %212, i64 %215
  %217 = load double, ptr %216, align 8, !tbaa !30
  %218 = load ptr, ptr %15, align 8, !tbaa !5
  %219 = load i64, ptr %21, align 8, !tbaa !26
  %220 = mul nsw i64 4, %219
  %221 = add nsw i64 %220, 3
  %222 = getelementptr inbounds double, ptr %218, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !30
  %224 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.1094, i64 noundef %200, double noundef %205, double noundef %211, double noundef %217, double noundef %223) #4
  br label %225

225:                                              ; preds = %193
  %226 = load i64, ptr %21, align 8, !tbaa !26
  %227 = add nsw i64 %226, 1
  store i64 %227, ptr %21, align 8, !tbaa !26
  br label %188, !llvm.loop !32

228:                                              ; preds = %188
  br label %229

229:                                              ; preds = %228, %181
  %230 = load ptr, ptr %19, align 8, !tbaa !5
  %231 = load i32, ptr %17, align 4, !tbaa !9
  %232 = load ptr, ptr %18, align 8, !tbaa !5
  call void @finishfile(ptr noundef %230, i32 noundef %231, ptr noundef %232)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #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, !10, i64 82712}
!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 = !{!15, !10, i64 82716}
!20 = !{!12, !10, i64 60}
!21 = !{!15, !17, i64 152}
!22 = !{!23, !6, i64 0}
!23 = !{!"osub", !6, i64 0, !10, i64 8}
!24 = !{!23, !10, i64 8}
!25 = !{!12, !10, i64 40}
!26 = !{!17, !17, i64 0}
!27 = !{!15, !10, i64 82740}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!13, !13, i64 0}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !29}


; 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.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.1088 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1089 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1090 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1091 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1092 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1093 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1094 = external hidden unnamed_addr constant [35 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 @subsegtraverse(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 @writepoly(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr nocapture noundef readonly %5, i32 noundef %6, i32 noundef %7, ptr noundef %8) local_unnamed_addr #0 {
  %10 = getelementptr inbounds i8, ptr %1, i64 112
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %14

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

14:                                               ; preds = %12, %9
  %15 = tail call noalias ptr @fopen(ptr noundef %2, ptr noundef nonnull @.str.1079)
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %19

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

19:                                               ; preds = %17, %14
  %20 = getelementptr inbounds i8, ptr %0, i64 82712
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %0, i64 82716
  %23 = load i32, ptr %22, align 4, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %1, i64 60
  %25 = load i32, ptr %24, align 4, !tbaa !18
  %26 = sub nsw i32 1, %25
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1088, i32 noundef 0, i32 noundef %21, i32 noundef %23, i32 noundef %26) #2
  %28 = getelementptr inbounds i8, ptr %0, i64 88
  %29 = getelementptr inbounds i8, ptr %0, i64 152
  %30 = load i64, ptr %29, align 8, !tbaa !19
  %31 = load i32, ptr %24, align 4, !tbaa !18
  %32 = sub nsw i32 1, %31
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1089, i64 noundef %30, i32 noundef %32) #2
  tail call void @traversalinit(ptr noundef nonnull %28)
  %34 = tail call ptr @subsegtraverse(ptr noundef %0)
  %35 = getelementptr inbounds i8, ptr %1, i64 40
  %.not7073 = icmp eq ptr %34, null
  br i1 %.not7073, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %19
  %36 = load i32, ptr %35, align 8, !tbaa !20
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %0, i64 82740
  br label %39

39:                                               ; preds = %.lr.ph, %57
  %.075 = phi i64 [ %37, %.lr.ph ], [ %59, %57 ]
  %.sroa.0.074 = phi ptr [ %34, %.lr.ph ], [ %58, %57 ]
  %40 = getelementptr inbounds i8, ptr %.sroa.0.074, i64 16
  %41 = load ptr, ptr %40, align 8, !tbaa !21
  %42 = getelementptr inbounds i8, ptr %.sroa.0.074, i64 24
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  %44 = load i32, ptr %24, align 4, !tbaa !18
  %.not71 = icmp eq i32 %44, 0
  %45 = load i32, ptr %38, align 4, !tbaa !22
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %41, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !23
  %49 = getelementptr inbounds i32, ptr %43, i64 %46
  %50 = load i32, ptr %49, align 4, !tbaa !23
  br i1 %.not71, label %53, label %51

51:                                               ; preds = %39
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1090, i64 noundef %.075, i32 noundef %48, i32 noundef %50) #2
  br label %57

53:                                               ; preds = %39
  %54 = getelementptr inbounds i8, ptr %.sroa.0.074, i64 64
  %55 = load i32, ptr %54, align 4, !tbaa !23
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1091, i64 noundef %.075, i32 noundef %48, i32 noundef %50, i32 noundef %55) #2
  br label %57

57:                                               ; preds = %53, %51
  %58 = tail call ptr @subsegtraverse(ptr noundef nonnull %0)
  %59 = add nsw i64 %.075, 1
  %.not70 = icmp eq ptr %58, null
  br i1 %.not70, label %._crit_edge, label %39, !llvm.loop !24

._crit_edge:                                      ; preds = %57, %19
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1092, i32 noundef %4) #2
  %61 = icmp sgt i32 %4, 0
  br i1 %61, label %.preheader, label %.loopexit72

.preheader:                                       ; preds = %._crit_edge
  %62 = zext nneg i32 %4 to i64
  br label %63

63:                                               ; preds = %.preheader, %63
  %.06676 = phi i64 [ 0, %.preheader ], [ %74, %63 ]
  %64 = load i32, ptr %35, align 8, !tbaa !20
  %65 = sext i32 %64 to i64
  %66 = add nsw i64 %.06676, %65
  %67 = shl nuw nsw i64 %.06676, 1
  %68 = getelementptr inbounds double, ptr %3, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !26
  %70 = or disjoint i64 %67, 1
  %71 = getelementptr inbounds double, ptr %3, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !26
  %73 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1093, i64 noundef %66, double noundef %69, double noundef %72) #2
  %74 = add nuw nsw i64 %.06676, 1
  %exitcond.not = icmp eq i64 %74, %62
  br i1 %exitcond.not, label %.loopexit72, label %63, !llvm.loop !27

.loopexit72:                                      ; preds = %63, %._crit_edge
  %75 = icmp sgt i32 %6, 0
  br i1 %75, label %76, label %.loopexit

76:                                               ; preds = %.loopexit72
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1092, i32 noundef %6) #2
  %78 = zext nneg i32 %6 to i64
  br label %79

79:                                               ; preds = %76, %79
  %.06777 = phi i64 [ 0, %76 ], [ %96, %79 ]
  %80 = load i32, ptr %35, align 8, !tbaa !20
  %81 = sext i32 %80 to i64
  %82 = add nsw i64 %.06777, %81
  %83 = shl nuw nsw i64 %.06777, 2
  %84 = getelementptr inbounds double, ptr %5, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !26
  %86 = or disjoint i64 %83, 1
  %87 = getelementptr inbounds double, ptr %5, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !26
  %89 = or disjoint i64 %83, 2
  %90 = getelementptr inbounds double, ptr %5, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !26
  %92 = or disjoint i64 %83, 3
  %93 = getelementptr inbounds double, ptr %5, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !26
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1094, i64 noundef %82, double noundef %85, double noundef %88, double noundef %91, double noundef %94) #2
  %96 = add nuw nsw i64 %.06777, 1
  %exitcond78.not = icmp eq i64 %96, %78
  br i1 %exitcond78.not, label %.loopexit, label %79, !llvm.loop !28

.loopexit:                                        ; preds = %79, %.loopexit72
  tail call void @finishfile(ptr noundef %15, i32 noundef %7, ptr noundef %8)
  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, !7, i64 82712}
!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 = !{!12, !7, i64 82716}
!18 = !{!6, !7, i64 60}
!19 = !{!12, !15, i64 152}
!20 = !{!6, !7, i64 40}
!21 = !{!14, !14, i64 0}
!22 = !{!12, !7, i64 82740}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !10, i64 0}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}


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