; LLVM IR from osmart/hole2 :: src (sos_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"

@tri_count = external dso_local global i32, align 4
@culled_tri_count = external dso_local global i32, align 4
@max_vertex_length = external dso_local global float, align 4
@stderr = external global ptr, align 8
@dots = external dso_local global [30000 x [7 x double]], align 16
@tri = external dso_local global [30000 x [5 x i32]], align 16
@culled_tri = external dso_local global [30000 x [6 x i32]], align 16
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [23 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind uwtable
define dso_local void @cull_triangles() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %11 = load float, ptr @max_vertex_length, align 4, !tbaa !9
  %12 = load float, ptr @max_vertex_length, align 4, !tbaa !9
  %13 = fmul float %11, %12
  %14 = fpext float %13 to double
  store double %14, ptr %10, align 8, !tbaa !11
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %337, %0
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = load i32, ptr @tri_count, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %19, label %340

19:                                               ; preds = %15
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %21
  %23 = getelementptr inbounds [5 x i32], ptr %22, i64 0, i64 0
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %26
  %28 = getelementptr inbounds [5 x i32], ptr %27, i64 0, i64 1
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %5, align 4, !tbaa !5
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %31
  %33 = getelementptr inbounds [5 x i32], ptr %32, i64 0, i64 2
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %36
  %38 = getelementptr inbounds [7 x double], ptr %37, i64 0, i64 0
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %41
  %43 = getelementptr inbounds [7 x double], ptr %42, i64 0, i64 0
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = fsub double %39, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %47
  %49 = getelementptr inbounds [7 x double], ptr %48, i64 0, i64 0
  %50 = load double, ptr %49, align 8, !tbaa !11
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %52
  %54 = getelementptr inbounds [7 x double], ptr %53, i64 0, i64 0
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = fsub double %50, %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %58
  %60 = getelementptr inbounds [7 x double], ptr %59, i64 0, i64 1
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %63
  %65 = getelementptr inbounds [7 x double], ptr %64, i64 0, i64 1
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = fsub double %61, %66
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %69
  %71 = getelementptr inbounds [7 x double], ptr %70, i64 0, i64 1
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %74
  %76 = getelementptr inbounds [7 x double], ptr %75, i64 0, i64 1
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = fsub double %72, %77
  %79 = fmul double %67, %78
  %80 = call double @llvm.fmuladd.f64(double %45, double %56, double %79)
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %82
  %84 = getelementptr inbounds [7 x double], ptr %83, i64 0, i64 2
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %87
  %89 = getelementptr inbounds [7 x double], ptr %88, i64 0, i64 2
  %90 = load double, ptr %89, align 8, !tbaa !11
  %91 = fsub double %85, %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %93
  %95 = getelementptr inbounds [7 x double], ptr %94, i64 0, i64 2
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %98
  %100 = getelementptr inbounds [7 x double], ptr %99, i64 0, i64 2
  %101 = load double, ptr %100, align 8, !tbaa !11
  %102 = fsub double %96, %101
  %103 = call double @llvm.fmuladd.f64(double %91, double %102, double %80)
  store double %103, ptr %7, align 8, !tbaa !11
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %105
  %107 = getelementptr inbounds [7 x double], ptr %106, i64 0, i64 0
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %110
  %112 = getelementptr inbounds [7 x double], ptr %111, i64 0, i64 0
  %113 = load double, ptr %112, align 8, !tbaa !11
  %114 = fsub double %108, %113
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %116
  %118 = getelementptr inbounds [7 x double], ptr %117, i64 0, i64 0
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %121
  %123 = getelementptr inbounds [7 x double], ptr %122, i64 0, i64 0
  %124 = load double, ptr %123, align 8, !tbaa !11
  %125 = fsub double %119, %124
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %127
  %129 = getelementptr inbounds [7 x double], ptr %128, i64 0, i64 1
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %132
  %134 = getelementptr inbounds [7 x double], ptr %133, i64 0, i64 1
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = fsub double %130, %135
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %138
  %140 = getelementptr inbounds [7 x double], ptr %139, i64 0, i64 1
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %143
  %145 = getelementptr inbounds [7 x double], ptr %144, i64 0, i64 1
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = fsub double %141, %146
  %148 = fmul double %136, %147
  %149 = call double @llvm.fmuladd.f64(double %114, double %125, double %148)
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %151
  %153 = getelementptr inbounds [7 x double], ptr %152, i64 0, i64 2
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = load i32, ptr %4, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %156
  %158 = getelementptr inbounds [7 x double], ptr %157, i64 0, i64 2
  %159 = load double, ptr %158, align 8, !tbaa !11
  %160 = fsub double %154, %159
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %162
  %164 = getelementptr inbounds [7 x double], ptr %163, i64 0, i64 2
  %165 = load double, ptr %164, align 8, !tbaa !11
  %166 = load i32, ptr %4, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %167
  %169 = getelementptr inbounds [7 x double], ptr %168, i64 0, i64 2
  %170 = load double, ptr %169, align 8, !tbaa !11
  %171 = fsub double %165, %170
  %172 = call double @llvm.fmuladd.f64(double %160, double %171, double %149)
  store double %172, ptr %8, align 8, !tbaa !11
  %173 = load i32, ptr %5, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %174
  %176 = getelementptr inbounds [7 x double], ptr %175, i64 0, i64 0
  %177 = load double, ptr %176, align 8, !tbaa !11
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %179
  %181 = getelementptr inbounds [7 x double], ptr %180, i64 0, i64 0
  %182 = load double, ptr %181, align 8, !tbaa !11
  %183 = fsub double %177, %182
  %184 = load i32, ptr %5, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %185
  %187 = getelementptr inbounds [7 x double], ptr %186, i64 0, i64 0
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = load i32, ptr %6, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %190
  %192 = getelementptr inbounds [7 x double], ptr %191, i64 0, i64 0
  %193 = load double, ptr %192, align 8, !tbaa !11
  %194 = fsub double %188, %193
  %195 = load i32, ptr %5, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %196
  %198 = getelementptr inbounds [7 x double], ptr %197, i64 0, i64 1
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = load i32, ptr %6, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %201
  %203 = getelementptr inbounds [7 x double], ptr %202, i64 0, i64 1
  %204 = load double, ptr %203, align 8, !tbaa !11
  %205 = fsub double %199, %204
  %206 = load i32, ptr %5, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %207
  %209 = getelementptr inbounds [7 x double], ptr %208, i64 0, i64 1
  %210 = load double, ptr %209, align 8, !tbaa !11
  %211 = load i32, ptr %6, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %212
  %214 = getelementptr inbounds [7 x double], ptr %213, i64 0, i64 1
  %215 = load double, ptr %214, align 8, !tbaa !11
  %216 = fsub double %210, %215
  %217 = fmul double %205, %216
  %218 = call double @llvm.fmuladd.f64(double %183, double %194, double %217)
  %219 = load i32, ptr %5, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %220
  %222 = getelementptr inbounds [7 x double], ptr %221, i64 0, i64 2
  %223 = load double, ptr %222, align 8, !tbaa !11
  %224 = load i32, ptr %6, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %225
  %227 = getelementptr inbounds [7 x double], ptr %226, i64 0, i64 2
  %228 = load double, ptr %227, align 8, !tbaa !11
  %229 = fsub double %223, %228
  %230 = load i32, ptr %5, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %231
  %233 = getelementptr inbounds [7 x double], ptr %232, i64 0, i64 2
  %234 = load double, ptr %233, align 8, !tbaa !11
  %235 = load i32, ptr %6, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %236
  %238 = getelementptr inbounds [7 x double], ptr %237, i64 0, i64 2
  %239 = load double, ptr %238, align 8, !tbaa !11
  %240 = fsub double %234, %239
  %241 = call double @llvm.fmuladd.f64(double %229, double %240, double %218)
  store double %241, ptr %9, align 8, !tbaa !11
  %242 = load i32, ptr %1, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %243
  %245 = getelementptr inbounds [5 x i32], ptr %244, i64 0, i64 0
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %247
  %249 = getelementptr inbounds [7 x double], ptr %248, i64 0, i64 3
  %250 = load double, ptr %249, align 8, !tbaa !11
  %251 = fcmp olt double %250, 0.000000e+00
  br i1 %251, label %274, label %252

252:                                              ; preds = %19
  %253 = load i32, ptr %1, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %254
  %256 = getelementptr inbounds [5 x i32], ptr %255, i64 0, i64 1
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %258
  %260 = getelementptr inbounds [7 x double], ptr %259, i64 0, i64 3
  %261 = load double, ptr %260, align 8, !tbaa !11
  %262 = fcmp olt double %261, 0.000000e+00
  br i1 %262, label %274, label %263

263:                                              ; preds = %252
  %264 = load i32, ptr %1, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %265
  %267 = getelementptr inbounds [5 x i32], ptr %266, i64 0, i64 2
  %268 = load i32, ptr %267, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %269
  %271 = getelementptr inbounds [7 x double], ptr %270, i64 0, i64 3
  %272 = load double, ptr %271, align 8, !tbaa !11
  %273 = fcmp olt double %272, 0.000000e+00
  br i1 %273, label %274, label %277

274:                                              ; preds = %263, %252, %19
  %275 = load i32, ptr %2, align 4, !tbaa !5
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %2, align 4, !tbaa !5
  br label %337

277:                                              ; preds = %263
  %278 = load double, ptr %7, align 8, !tbaa !11
  %279 = load double, ptr %10, align 8, !tbaa !11
  %280 = fcmp ogt double %278, %279
  br i1 %280, label %289, label %281

281:                                              ; preds = %277
  %282 = load double, ptr %8, align 8, !tbaa !11
  %283 = load double, ptr %10, align 8, !tbaa !11
  %284 = fcmp ogt double %282, %283
  br i1 %284, label %289, label %285

285:                                              ; preds = %281
  %286 = load double, ptr %9, align 8, !tbaa !11
  %287 = load double, ptr %10, align 8, !tbaa !11
  %288 = fcmp ogt double %286, %287
  br i1 %288, label %289, label %292

289:                                              ; preds = %285, %281, %277
  %290 = load i32, ptr %3, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %3, align 4, !tbaa !5
  br label %337

292:                                              ; preds = %285
  %293 = load i32, ptr %1, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %294
  %296 = getelementptr inbounds [5 x i32], ptr %295, i64 0, i64 0
  %297 = load i32, ptr %296, align 4, !tbaa !5
  %298 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %299
  %301 = getelementptr inbounds [6 x i32], ptr %300, i64 0, i64 0
  store i32 %297, ptr %301, align 8, !tbaa !5
  %302 = load i32, ptr %1, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %303
  %305 = getelementptr inbounds [5 x i32], ptr %304, i64 0, i64 1
  %306 = load i32, ptr %305, align 4, !tbaa !5
  %307 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %308
  %310 = getelementptr inbounds [6 x i32], ptr %309, i64 0, i64 1
  store i32 %306, ptr %310, align 4, !tbaa !5
  %311 = load i32, ptr %1, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %312
  %314 = getelementptr inbounds [5 x i32], ptr %313, i64 0, i64 2
  %315 = load i32, ptr %314, align 4, !tbaa !5
  %316 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %317
  %319 = getelementptr inbounds [6 x i32], ptr %318, i64 0, i64 2
  store i32 %315, ptr %319, align 8, !tbaa !5
  %320 = load i32, ptr %1, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %321
  %323 = getelementptr inbounds [5 x i32], ptr %322, i64 0, i64 3
  %324 = load i32, ptr %323, align 4, !tbaa !5
  %325 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %326
  %328 = getelementptr inbounds [6 x i32], ptr %327, i64 0, i64 3
  store i32 %324, ptr %328, align 4, !tbaa !5
  %329 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %330
  %332 = getelementptr inbounds [6 x i32], ptr %331, i64 0, i64 4
  store i32 0, ptr %332, align 8, !tbaa !5
  %333 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr @culled_tri_count, align 4, !tbaa !5
  br label %335

335:                                              ; preds = %292
  br label %336

336:                                              ; preds = %335
  br label %337

337:                                              ; preds = %336, %289, %274
  %338 = load i32, ptr %1, align 4, !tbaa !5
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %1, align 4, !tbaa !5
  br label %15, !llvm.loop !13

340:                                              ; preds = %15
  %341 = load ptr, ptr @stderr, align 8, !tbaa !15
  %342 = load i32, ptr %2, align 4, !tbaa !5
  %343 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %341, ptr noundef @.str.67, i32 noundef %342) #4
  %344 = load ptr, ptr @stderr, align 8, !tbaa !15
  %345 = load i32, ptr %3, align 4, !tbaa !5
  %346 = load float, ptr @max_vertex_length, align 4, !tbaa !9
  %347 = fpext float %346 to double
  %348 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %344, ptr noundef @.str.68, i32 noundef %345, double noundef %347) #4
  %349 = load ptr, ptr @stderr, align 8, !tbaa !15
  %350 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %351 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %349, ptr noundef @.str.69, i32 noundef %350) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


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

@tri_count = external dso_local local_unnamed_addr global i32, align 4
@culled_tri_count = external dso_local local_unnamed_addr global i32, align 4
@max_vertex_length = external dso_local local_unnamed_addr global float, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@dots = external dso_local local_unnamed_addr global [30000 x [7 x double]], align 16
@tri = external dso_local local_unnamed_addr global [30000 x [5 x i32]], align 16
@culled_tri = external dso_local local_unnamed_addr global [30000 x [6 x i32]], align 16
@.str.67 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [23 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nofree nounwind uwtable
define dso_local void @cull_triangles() local_unnamed_addr #2 {
  %1 = load float, ptr @max_vertex_length, align 4, !tbaa !5
  %2 = fmul float %1, %1
  %3 = fpext float %2 to double
  %4 = load i32, ptr @tri_count, align 4, !tbaa !9
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %culled_tri_count.promoted = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %wide.trip.count = zext nneg i32 %4 to i64
  %6 = insertelement <2 x double> poison, double %3, i64 0
  %7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> zeroinitializer
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %90
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %90 ]
  %.05763 = phi i32 [ 0, %.lr.ph.preheader ], [ %.1, %90 ]
  %.05862 = phi i32 [ 0, %.lr.ph.preheader ], [ %.159, %90 ]
  %8 = phi i32 [ %culled_tri_count.promoted, %.lr.ph.preheader ], [ %91, %90 ]
  %9 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %indvars.iv
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %9, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %9, i64 8
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = sext i32 %12 to i64
  %16 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %15
  %17 = load double, ptr %16, align 8, !tbaa !11
  %18 = sext i32 %10 to i64
  %19 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %18
  %20 = load double, ptr %19, align 8, !tbaa !11
  %21 = fsub double %17, %20
  %22 = getelementptr inbounds i8, ptr %16, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %19, i64 8
  %25 = load double, ptr %24, align 8, !tbaa !11
  %26 = fsub double %23, %25
  %27 = fmul double %26, %26
  %28 = tail call double @llvm.fmuladd.f64(double %21, double %21, double %27)
  %29 = getelementptr inbounds i8, ptr %16, i64 16
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %19, i64 16
  %32 = load double, ptr %31, align 8, !tbaa !11
  %33 = fsub double %30, %32
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %33, double %28)
  %35 = sext i32 %14 to i64
  %36 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %35
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %36, i64 8
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %36, i64 16
  %41 = load double, ptr %40, align 8, !tbaa !11
  %42 = insertelement <2 x double> poison, double %17, i64 0
  %43 = insertelement <2 x double> %42, double %37, i64 1
  %44 = insertelement <2 x double> poison, double %37, i64 0
  %45 = insertelement <2 x double> %44, double %20, i64 1
  %46 = fsub <2 x double> %43, %45
  %47 = insertelement <2 x double> poison, double %23, i64 0
  %48 = insertelement <2 x double> %47, double %39, i64 1
  %49 = insertelement <2 x double> poison, double %39, i64 0
  %50 = insertelement <2 x double> %49, double %25, i64 1
  %51 = fsub <2 x double> %48, %50
  %52 = fmul <2 x double> %51, %51
  %53 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %46, <2 x double> %46, <2 x double> %52)
  %54 = insertelement <2 x double> poison, double %30, i64 0
  %55 = insertelement <2 x double> %54, double %41, i64 1
  %56 = insertelement <2 x double> poison, double %41, i64 0
  %57 = insertelement <2 x double> %56, double %32, i64 1
  %58 = fsub <2 x double> %55, %57
  %59 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %58, <2 x double> %53)
  %60 = getelementptr inbounds i8, ptr %19, i64 24
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = fcmp olt double %61, 0.000000e+00
  br i1 %62, label %71, label %63

63:                                               ; preds = %.lr.ph
  %64 = getelementptr inbounds i8, ptr %16, i64 24
  %65 = load double, ptr %64, align 8, !tbaa !11
  %66 = fcmp olt double %65, 0.000000e+00
  br i1 %66, label %71, label %67

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %36, i64 24
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = fcmp olt double %69, 0.000000e+00
  br i1 %70, label %71, label %73

71:                                               ; preds = %67, %63, %.lr.ph
  %72 = add nsw i32 %.05763, 1
  br label %90

73:                                               ; preds = %67
  %74 = fcmp ogt double %34, %3
  %75 = fcmp ogt <2 x double> %59, %7
  %76 = extractelement <2 x i1> %75, i64 1
  %or.cond = select i1 %74, i1 true, i1 %76
  %77 = extractelement <2 x i1> %75, i64 0
  %or.cond61 = select i1 %or.cond, i1 true, i1 %77
  br i1 %or.cond61, label %78, label %80

78:                                               ; preds = %73
  %79 = add nsw i32 %.05862, 1
  br label %90

80:                                               ; preds = %73
  %81 = sext i32 %8 to i64
  %82 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %81
  store i32 %10, ptr %82, align 8, !tbaa !9
  %83 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %81, i64 1
  store i32 %12, ptr %83, align 4, !tbaa !9
  %84 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %81, i64 2
  store i32 %14, ptr %84, align 8, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %9, i64 12
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %81, i64 3
  store i32 %86, ptr %87, align 4, !tbaa !9
  %88 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %81, i64 4
  store i32 0, ptr %88, align 8, !tbaa !9
  %89 = add nsw i32 %8, 1
  store i32 %89, ptr @culled_tri_count, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %80, %78, %71
  %91 = phi i32 [ %8, %71 ], [ %8, %78 ], [ %89, %80 ]
  %.159 = phi i32 [ %.05862, %71 ], [ %79, %78 ], [ %.05862, %80 ]
  %.1 = phi i32 [ %72, %71 ], [ %.05763, %78 ], [ %.05763, %80 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %90, %0
  %.058.lcssa = phi i32 [ 0, %0 ], [ %.159, %90 ]
  %.057.lcssa = phi i32 [ 0, %0 ], [ %.1, %90 ]
  %92 = load ptr, ptr @stderr, align 8, !tbaa !15
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.67, i32 noundef %.057.lcssa) #4
  %94 = load ptr, ptr @stderr, align 8, !tbaa !15
  %95 = load float, ptr @max_vertex_length, align 4, !tbaa !5
  %96 = fpext float %95 to double
  %97 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.68, i32 noundef %.058.lcssa, double noundef %96) #4
  %98 = load ptr, ptr @stderr, align 8, !tbaa !15
  %99 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %100 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.69, i32 noundef %99) #4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { cold 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 = !{!"float", !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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


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