; LLVM IR from osmart/hole2 :: src/retired_routines (surface)

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

@culled_tri_count = external dso_local global i32, align 4
@smooth = external dso_local global i32, align 4
@dump = external dso_local global i32, align 4
@dots = external dso_local global [30000 x [7 x double]], align 16
@culled_tri = external dso_local global [30000 x [6 x i32]], align 16
@stdout = external global ptr, align 8
@.str.55 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [3 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: nounwind uwtable
define dso_local void @molscript_out() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %6 = load i32, ptr @smooth, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %8, label %16

8:                                                ; preds = %0
  %9 = load i32, ptr @dump, align 4, !tbaa !5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %16

11:                                               ; preds = %8
  %12 = load ptr, ptr @stdout, align 8, !tbaa !9
  %13 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %14 = mul nsw i32 %13, 3
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef @.str.55, i32 noundef %14) #3
  br label %16

16:                                               ; preds = %11, %8, %0
  %17 = load i32, ptr @smooth, align 4, !tbaa !5
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %19, label %27

19:                                               ; preds = %16
  %20 = load i32, ptr @dump, align 4, !tbaa !5
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %27

22:                                               ; preds = %19
  %23 = load ptr, ptr @stdout, align 8, !tbaa !9
  %24 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %25 = mul nsw i32 %24, 3
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.56, i32 noundef %25) #3
  br label %27

27:                                               ; preds = %22, %19, %16
  %28 = load i32, ptr @dump, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %38

30:                                               ; preds = %27
  %31 = load i32, ptr @smooth, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %38

33:                                               ; preds = %30
  %34 = load ptr, ptr @stdout, align 8, !tbaa !9
  %35 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %36 = mul nsw i32 %35, 3
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.57, i32 noundef %36) #3
  br label %38

38:                                               ; preds = %33, %30, %27
  %39 = load i32, ptr @dump, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %49

41:                                               ; preds = %38
  %42 = load i32, ptr @smooth, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %49

44:                                               ; preds = %41
  %45 = load ptr, ptr @stdout, align 8, !tbaa !9
  %46 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %47 = mul nsw i32 %46, 3
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.58, i32 noundef %47) #3
  br label %49

49:                                               ; preds = %44, %41, %38
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %160, %49
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = load i32, ptr @culled_tri_count, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %163

54:                                               ; preds = %50
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %156, %54
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = icmp slt i32 %56, 3
  br i1 %57, label %58, label %159

58:                                               ; preds = %55
  %59 = load ptr, ptr @stdout, align 8, !tbaa !9
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %61
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [6 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %67
  %69 = getelementptr inbounds [7 x double], ptr %68, i64 0, i64 0
  %70 = load double, ptr %69, align 8, !tbaa !11
  %71 = load i32, ptr %1, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %72
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [6 x i32], ptr %73, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %78
  %80 = getelementptr inbounds [7 x double], ptr %79, i64 0, i64 1
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %83
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [6 x i32], ptr %84, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %89
  %91 = getelementptr inbounds [7 x double], ptr %90, i64 0, i64 2
  %92 = load double, ptr %91, align 8, !tbaa !11
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.59, double noundef %70, double noundef %81, double noundef %92) #3
  %94 = load i32, ptr @smooth, align 4, !tbaa !5
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %132

96:                                               ; preds = %58
  %97 = load ptr, ptr @stdout, align 8, !tbaa !9
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %99
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [6 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, 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 4
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %110
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [6 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, 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 5
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = load i32, ptr %1, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %121
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [6 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, 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 6
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.59, double noundef %108, double noundef %119, double noundef %130) #3
  br label %132

132:                                              ; preds = %96, %58
  %133 = load i32, ptr @dump, align 4, !tbaa !5
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %153

135:                                              ; preds = %132
  %136 = load i32, ptr %1, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %137
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [6 x i32], ptr %138, i64 0, i64 %140
  %142 = load i32, ptr %141, 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 3
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = fptosi double %146 to i32
  call void @colour_conv(i32 noundef %147, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %148 = load ptr, ptr @stdout, align 8, !tbaa !9
  %149 = load double, ptr %3, align 8, !tbaa !11
  %150 = load double, ptr %4, align 8, !tbaa !11
  %151 = load double, ptr %5, align 8, !tbaa !11
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.59, double noundef %149, double noundef %150, double noundef %151) #3
  br label %153

153:                                              ; preds = %135, %132
  %154 = load ptr, ptr @stdout, align 8, !tbaa !9
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.60) #3
  br label %156

156:                                              ; preds = %153
  %157 = load i32, ptr %2, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %2, align 4, !tbaa !5
  br label %55, !llvm.loop !13

159:                                              ; preds = %55
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %1, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %1, align 4, !tbaa !5
  br label %50, !llvm.loop !15

163:                                              ; preds = %50
  %164 = load ptr, ptr @stdout, align 8, !tbaa !9
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.61) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

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

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 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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

@culled_tri_count = external dso_local local_unnamed_addr global i32, align 4
@smooth = external dso_local local_unnamed_addr global i32, align 4
@dump = external dso_local local_unnamed_addr global i32, align 4
@dots = external dso_local local_unnamed_addr global [30000 x [7 x double]], align 16
@culled_tri = external dso_local local_unnamed_addr global [30000 x [6 x i32]], align 16
@stdout = external local_unnamed_addr global ptr, align 8
@.str.55 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @molscript_out() local_unnamed_addr #2 {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = load i32, ptr @smooth, align 4
  %5 = icmp eq i32 %4, 0
  %6 = load i32, ptr @dump, align 4
  %7 = icmp eq i32 %6, 0
  %or.cond = select i1 %5, i1 %7, i1 false
  br i1 %or.cond, label %8, label %13

8:                                                ; preds = %0
  %9 = load ptr, ptr @stdout, align 8, !tbaa !5
  %10 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %11 = mul nsw i32 %10, 3
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.55, i32 noundef %11) #3
  %.pre = load i32, ptr @smooth, align 4
  %.pre30 = load i32, ptr @dump, align 4
  br label %13

13:                                               ; preds = %8, %0
  %14 = phi i32 [ %.pre30, %8 ], [ %6, %0 ]
  %15 = phi i32 [ %.pre, %8 ], [ %4, %0 ]
  %16 = icmp eq i32 %15, 1
  %17 = icmp eq i32 %14, 0
  %or.cond3 = select i1 %16, i1 %17, i1 false
  br i1 %or.cond3, label %18, label %23

18:                                               ; preds = %13
  %19 = load ptr, ptr @stdout, align 8, !tbaa !5
  %20 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %21 = mul nsw i32 %20, 3
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.56, i32 noundef %21) #3
  %.pre31 = load i32, ptr @dump, align 4, !tbaa !9
  %.pre32 = load i32, ptr @smooth, align 4
  br label %23

23:                                               ; preds = %18, %13
  %24 = phi i32 [ %.pre32, %18 ], [ %15, %13 ]
  %25 = phi i32 [ %.pre31, %18 ], [ %14, %13 ]
  %26 = icmp eq i32 %25, 1
  %27 = icmp eq i32 %24, 0
  %or.cond5 = select i1 %26, i1 %27, i1 false
  br i1 %or.cond5, label %28, label %33

28:                                               ; preds = %23
  %29 = load ptr, ptr @stdout, align 8, !tbaa !5
  %30 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %31 = mul nsw i32 %30, 3
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.57, i32 noundef %31) #3
  %.pre33 = load i32, ptr @dump, align 4, !tbaa !9
  %.pre34 = load i32, ptr @smooth, align 4
  br label %33

33:                                               ; preds = %28, %23
  %34 = phi i32 [ %.pre34, %28 ], [ %24, %23 ]
  %35 = phi i32 [ %.pre33, %28 ], [ %25, %23 ]
  %36 = icmp eq i32 %35, 1
  %37 = icmp eq i32 %34, 1
  %or.cond7 = select i1 %36, i1 %37, i1 false
  br i1 %or.cond7, label %38, label %43

38:                                               ; preds = %33
  %39 = load ptr, ptr @stdout, align 8, !tbaa !5
  %40 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %41 = mul nsw i32 %40, 3
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.58, i32 noundef %41) #3
  br label %43

43:                                               ; preds = %38, %33
  %44 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.preheader, label %._crit_edge

.preheader:                                       ; preds = %43, %169
  %indvars.iv = phi i64 [ %indvars.iv.next, %169 ], [ 0, %43 ]
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %indvars.iv, i64 0
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = getelementptr inbounds i8, ptr %50, i64 8
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %50, i64 16
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.59, double noundef %51, double noundef %53, double noundef %55) #3
  %57 = load i32, ptr @smooth, align 4, !tbaa !9
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %71

59:                                               ; preds = %.preheader
  %60 = load ptr, ptr @stdout, align 8, !tbaa !5
  %61 = load i32, ptr %47, align 8, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %62
  %64 = getelementptr inbounds i8, ptr %63, i64 32
  %65 = load double, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds i8, ptr %63, i64 40
  %67 = load double, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds i8, ptr %63, i64 48
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.59, double noundef %65, double noundef %67, double noundef %69) #3
  br label %71

71:                                               ; preds = %59, %.preheader
  %72 = load i32, ptr @dump, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %85

74:                                               ; preds = %71
  %75 = load i32, ptr %47, align 8, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %76, i64 3
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fptosi double %78 to i32
  call void @colour_conv(i32 noundef %79, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %80 = load ptr, ptr @stdout, align 8, !tbaa !5
  %81 = load double, ptr %1, align 8, !tbaa !11
  %82 = load double, ptr %2, align 8, !tbaa !11
  %83 = load double, ptr %3, align 8, !tbaa !11
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.59, double noundef %81, double noundef %82, double noundef %83) #3
  br label %85

85:                                               ; preds = %74, %71
  %86 = load ptr, ptr @stdout, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.60) #3
  %88 = load ptr, ptr @stdout, align 8, !tbaa !5
  %89 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %indvars.iv, i64 1
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = getelementptr inbounds i8, ptr %92, i64 8
  %95 = load double, ptr %94, align 8, !tbaa !11
  %96 = getelementptr inbounds i8, ptr %92, i64 16
  %97 = load double, ptr %96, align 8, !tbaa !11
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.59, double noundef %93, double noundef %95, double noundef %97) #3
  %99 = load i32, ptr @smooth, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %113

101:                                              ; preds = %85
  %102 = load ptr, ptr @stdout, align 8, !tbaa !5
  %103 = load i32, ptr %89, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %104
  %106 = getelementptr inbounds i8, ptr %105, i64 32
  %107 = load double, ptr %106, align 8, !tbaa !11
  %108 = getelementptr inbounds i8, ptr %105, i64 40
  %109 = load double, ptr %108, align 8, !tbaa !11
  %110 = getelementptr inbounds i8, ptr %105, i64 48
  %111 = load double, ptr %110, align 8, !tbaa !11
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef nonnull @.str.59, double noundef %107, double noundef %109, double noundef %111) #3
  br label %113

113:                                              ; preds = %101, %85
  %114 = load i32, ptr @dump, align 4, !tbaa !9
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %127

116:                                              ; preds = %113
  %117 = load i32, ptr %89, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %118, i64 3
  %120 = load double, ptr %119, align 8, !tbaa !11
  %121 = fptosi double %120 to i32
  call void @colour_conv(i32 noundef %121, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %122 = load ptr, ptr @stdout, align 8, !tbaa !5
  %123 = load double, ptr %1, align 8, !tbaa !11
  %124 = load double, ptr %2, align 8, !tbaa !11
  %125 = load double, ptr %3, align 8, !tbaa !11
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.59, double noundef %123, double noundef %124, double noundef %125) #3
  br label %127

127:                                              ; preds = %116, %113
  %128 = load ptr, ptr @stdout, align 8, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef nonnull @.str.60) #3
  %130 = load ptr, ptr @stdout, align 8, !tbaa !5
  %131 = getelementptr inbounds [30000 x [6 x i32]], ptr @culled_tri, i64 0, i64 %indvars.iv, i64 2
  %132 = load i32, ptr %131, align 8, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %133
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = getelementptr inbounds i8, ptr %134, i64 8
  %137 = load double, ptr %136, align 8, !tbaa !11
  %138 = getelementptr inbounds i8, ptr %134, i64 16
  %139 = load double, ptr %138, align 8, !tbaa !11
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.59, double noundef %135, double noundef %137, double noundef %139) #3
  %141 = load i32, ptr @smooth, align 4, !tbaa !9
  %142 = icmp eq i32 %141, 1
  br i1 %142, label %143, label %155

143:                                              ; preds = %127
  %144 = load ptr, ptr @stdout, align 8, !tbaa !5
  %145 = load i32, ptr %131, align 8, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %146
  %148 = getelementptr inbounds i8, ptr %147, i64 32
  %149 = load double, ptr %148, align 8, !tbaa !11
  %150 = getelementptr inbounds i8, ptr %147, i64 40
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = getelementptr inbounds i8, ptr %147, i64 48
  %153 = load double, ptr %152, align 8, !tbaa !11
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str.59, double noundef %149, double noundef %151, double noundef %153) #3
  br label %155

155:                                              ; preds = %143, %127
  %156 = load i32, ptr @dump, align 4, !tbaa !9
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %169

158:                                              ; preds = %155
  %159 = load i32, ptr %131, align 8, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %160, i64 3
  %162 = load double, ptr %161, align 8, !tbaa !11
  %163 = fptosi double %162 to i32
  call void @colour_conv(i32 noundef %163, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %164 = load ptr, ptr @stdout, align 8, !tbaa !5
  %165 = load double, ptr %1, align 8, !tbaa !11
  %166 = load double, ptr %2, align 8, !tbaa !11
  %167 = load double, ptr %3, align 8, !tbaa !11
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef nonnull @.str.59, double noundef %165, double noundef %166, double noundef %167) #3
  br label %169

169:                                              ; preds = %158, %155
  %170 = load ptr, ptr @stdout, align 8, !tbaa !5
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef nonnull @.str.60) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %172 = load i32, ptr @culled_tri_count, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = icmp slt i64 %indvars.iv.next, %173
  br i1 %174, label %.preheader, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %169, %43
  %175 = load ptr, ptr @stdout, align 8, !tbaa !5
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef nonnull @.str.61) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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