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

@max_dots = external dso_local global i32, align 4
@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
@start_point = external dso_local global i32, align 4
@format = external dso_local global i32, align 4
@max_vertex_length = external dso_local global float, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@dots = external dso_local global [30000 x [7 x double]], align 16
@tri = external dso_local global [30000 x [5 x i32]], align 16
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@start = external dso_local global ptr, align 8
@end = external dso_local global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef @.str) #4
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef @.str.1) #4
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str.2) #4
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.3) #4
  %19 = load ptr, ptr @stderr, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.4) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %45, %2
  %22 = load i32, ptr %8, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 30000
  br i1 %23, label %24, label %48

24:                                               ; preds = %21
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %41, %24
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 4
  br i1 %27, label %28, label %44

28:                                               ; preds = %25
  %29 = load i32, ptr %8, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %30
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [7 x double], ptr %31, i64 0, i64 %33
  store double -1.000000e+00, ptr %34, align 8, !tbaa !11
  %35 = load i32, ptr %8, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [30000 x [5 x i32]], ptr @tri, i64 0, i64 %36
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [5 x i32], ptr %37, i64 0, i64 %39
  store i32 -1, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %28
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !5
  br label %25, !llvm.loop !13

44:                                               ; preds = %25
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %8, align 4, !tbaa !5
  br label %21, !llvm.loop !15

48:                                               ; preds = %21
  br label %49

49:                                               ; preds = %101, %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 1
  br i1 %51, label %52, label %60

52:                                               ; preds = %49
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %53, i64 1
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %55, i64 0
  %57 = load i8, ptr %56, align 1, !tbaa !16
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %58, 45
  br label %60

60:                                               ; preds = %52, %49
  %61 = phi i1 [ false, %49 ], [ %59, %52 ]
  br i1 %61, label %62, label %106

62:                                               ; preds = %60
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %63, i64 1
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %65, i64 1
  %67 = load i8, ptr %66, align 1, !tbaa !16
  %68 = sext i8 %67 to i32
  switch i32 %68, label %100 [
    i32 104, label %69
    i32 115, label %70
    i32 109, label %73
    i32 108, label %76
    i32 112, label %79
    i32 114, label %82
    i32 100, label %85
    i32 118, label %88
    i32 88, label %91
  ]

69:                                               ; preds = %62
  call void @help()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %158

70:                                               ; preds = %62
  store i32 1, ptr @smooth, align 4, !tbaa !5
  %71 = load ptr, ptr @stderr, align 8, !tbaa !9
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.5) #4
  br label %101

73:                                               ; preds = %62
  store i32 1, ptr @format, align 4, !tbaa !5
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.6) #4
  br label %101

76:                                               ; preds = %62
  store i32 0, ptr @format, align 4, !tbaa !5
  %77 = load ptr, ptr @stderr, align 8, !tbaa !9
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.7) #4
  br label %101

79:                                               ; preds = %62
  store i32 2, ptr @format, align 4, !tbaa !5
  %80 = load ptr, ptr @stderr, align 8, !tbaa !9
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.8) #4
  br label %101

82:                                               ; preds = %62
  store i32 3, ptr @format, align 4, !tbaa !5
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.9) #4
  br label %101

85:                                               ; preds = %62
  store i32 1, ptr @dump, align 4, !tbaa !5
  %86 = load ptr, ptr @stderr, align 8, !tbaa !9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.10) #4
  br label %101

88:                                               ; preds = %62
  store i32 4, ptr @format, align 4, !tbaa !5
  %89 = load ptr, ptr @stderr, align 8, !tbaa !9
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.11) #4
  br label %101

91:                                               ; preds = %62
  %92 = load ptr, ptr %5, align 8, !tbaa !9
  %93 = getelementptr inbounds ptr, ptr %92, i64 2
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %94, ptr noundef @.str.12, ptr noundef @max_vertex_length) #4
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %4, align 4, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !9
  %99 = getelementptr inbounds ptr, ptr %98, i32 1
  store ptr %99, ptr %5, align 8, !tbaa !9
  br label %101

100:                                              ; preds = %62
  call void @help()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %158

101:                                              ; preds = %91, %88, %85, %82, %79, %76, %73, %70
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %4, align 4, !tbaa !5
  %104 = load ptr, ptr %5, align 8, !tbaa !9
  %105 = getelementptr inbounds ptr, ptr %104, i32 1
  store ptr %105, ptr %5, align 8, !tbaa !9
  br label %49, !llvm.loop !17

106:                                              ; preds = %60
  %107 = load i32, ptr @smooth, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %106
  %110 = load ptr, ptr @stderr, align 8, !tbaa !9
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.13) #4
  br label %112

112:                                              ; preds = %109, %106
  call void @read_cord()
  call void @cull_coords()
  store i32 0, ptr %6, align 4, !tbaa !5
  store i32 0, ptr @start_point, align 4, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !5
  %113 = call noalias ptr @malloc(i64 noundef 32) #5
  store ptr %113, ptr @start, align 8, !tbaa !9
  %114 = load ptr, ptr @start, align 8, !tbaa !9
  store ptr %114, ptr @end, align 8, !tbaa !9
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.14) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %128, %112
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = load i32, ptr @max_dots, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %121, label %131

121:                                              ; preds = %117
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = call i32 @check_point(i32 noundef %122)
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %127

125:                                              ; preds = %121
  %126 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %126, ptr @start_point, align 4, !tbaa !5
  call void @polygonize()
  br label %127

127:                                              ; preds = %125, %121
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %7, align 4, !tbaa !5
  br label %117, !llvm.loop !18

131:                                              ; preds = %117
  %132 = load ptr, ptr @stderr, align 8, !tbaa !9
  %133 = load i32, ptr @tri_count, align 4, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.15, i32 noundef %133) #4
  call void @cull_triangles()
  %135 = load i32, ptr @smooth, align 4, !tbaa !5
  %136 = icmp eq i32 %135, 1
  br i1 %136, label %137, label %138

137:                                              ; preds = %131
  call void @reorder_triangle()
  br label %138

138:                                              ; preds = %137, %131
  %139 = load i32, ptr @format, align 4, !tbaa !5
  switch i32 %139, label %155 [
    i32 0, label %140
    i32 1, label %143
    i32 2, label %146
    i32 3, label %149
    i32 4, label %152
  ]

140:                                              ; preds = %138
  %141 = load ptr, ptr @stderr, align 8, !tbaa !9
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.16) #4
  call void @vrml_out()
  call void @vrml_end()
  br label %155

143:                                              ; preds = %138
  %144 = load ptr, ptr @stderr, align 8, !tbaa !9
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.17) #4
  call void @molscript_out()
  br label %155

146:                                              ; preds = %138
  %147 = load ptr, ptr @stderr, align 8, !tbaa !9
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.18) #4
  call void @prepi_out()
  br label %155

149:                                              ; preds = %138
  %150 = load ptr, ptr @stderr, align 8, !tbaa !9
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef @.str.19) #4
  call void @povray_out()
  br label %155

152:                                              ; preds = %138
  %153 = load ptr, ptr @stderr, align 8, !tbaa !9
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.20) #4
  call void @vmd_out()
  br label %155

155:                                              ; preds = %152, %149, %146, %143, %140, %138
  %156 = load ptr, ptr @stderr, align 8, !tbaa !9
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.21) #4
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %158

158:                                              ; preds = %155, %100, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %159 = load i32, ptr %3, align 4
  ret i32 %159
}

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

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @read_cord() #0

; Function Attrs: nounwind uwtable
declare dso_local void @polygonize() #0

; Function Attrs: nounwind uwtable
declare dso_local void @vrml_out() #0

; Function Attrs: nounwind uwtable
declare dso_local void @vrml_end() #0

; Function Attrs: nounwind uwtable
declare dso_local void @molscript_out() #0

; Function Attrs: nounwind uwtable
declare dso_local void @cull_triangles() #0

; Function Attrs: nounwind uwtable
declare dso_local void @cull_coords() #0

; Function Attrs: nounwind uwtable
declare dso_local void @prepi_out() #0

; Function Attrs: nounwind uwtable
declare dso_local void @povray_out() #0

; Function Attrs: nounwind uwtable
declare dso_local void @vmd_out() #0

; Function Attrs: nounwind uwtable
declare dso_local void @reorder_triangle() #0

; Function Attrs: nounwind uwtable
declare dso_local void @help() #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind allocsize(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 }
attributes #5 = { nounwind allocsize(0) }

!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}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !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"

@max_dots = external dso_local local_unnamed_addr global i32, align 4
@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
@start_point = external dso_local local_unnamed_addr global i32, align 4
@format = external dso_local local_unnamed_addr global i32, align 4
@max_vertex_length = external dso_local global float, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@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
@.str.5 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@start = external dso_local local_unnamed_addr global ptr, align 8
@end = external dso_local local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr @stderr, align 8, !tbaa !5
  %4 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str) #4
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.1) #4
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.2) #4
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.3) #4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.4) #4
  br label %.preheader26

.preheader26:                                     ; preds = %.preheader26, %2
  %indvar = phi i64 [ 0, %2 ], [ %indvar.next.1, %.preheader26 ]
  %13 = mul nuw nsw i64 %indvar, 20
  %scevgep = getelementptr i8, ptr @tri, i64 %13
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep, i8 -1, i64 16, i1 false), !tbaa !9
  %14 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %indvar, i64 0
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr %14, align 16, !tbaa !11
  %15 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %indvar, i64 2
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr %15, align 16, !tbaa !11
  %indvar.next = or disjoint i64 %indvar, 1
  %16 = mul nuw nsw i64 %indvar.next, 20
  %scevgep.1 = getelementptr i8, ptr @tri, i64 %16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %scevgep.1, i8 -1, i64 16, i1 false), !tbaa !9
  %17 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %indvar.next, i64 0
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds [30000 x [7 x double]], ptr @dots, i64 0, i64 %indvar.next, i64 2
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr %18, align 8, !tbaa !11
  %indvar.next.1 = add nuw nsw i64 %indvar, 2
  %exitcond.not.1 = icmp eq i64 %indvar.next.1, 30000
  br i1 %exitcond.not.1, label %.preheader, label %.preheader26, !llvm.loop !13

.preheader:                                       ; preds = %.preheader26
  %19 = icmp sgt i32 %0, 1
  br i1 %19, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader, %55
  %.02330 = phi ptr [ %57, %55 ], [ %1, %.preheader ]
  %.02429 = phi i32 [ %56, %55 ], [ %0, %.preheader ]
  %20 = getelementptr inbounds i8, ptr %.02330, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = load i8, ptr %21, align 1, !tbaa !15
  %23 = icmp eq i8 %22, 45
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %21, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !15
  switch i8 %26, label %54 [
    i8 104, label %27
    i8 115, label %28
    i8 109, label %31
    i8 108, label %34
    i8 112, label %37
    i8 114, label %40
    i8 100, label %43
    i8 118, label %46
    i8 88, label %49
  ]

27:                                               ; preds = %24
  tail call void @help()
  br label %103

28:                                               ; preds = %24
  store i32 1, ptr @smooth, align 4, !tbaa !9
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.5) #4
  br label %55

31:                                               ; preds = %24
  store i32 1, ptr @format, align 4, !tbaa !9
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.6) #4
  br label %55

34:                                               ; preds = %24
  store i32 0, ptr @format, align 4, !tbaa !9
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.7) #4
  br label %55

37:                                               ; preds = %24
  store i32 2, ptr @format, align 4, !tbaa !9
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.8) #4
  br label %55

40:                                               ; preds = %24
  store i32 3, ptr @format, align 4, !tbaa !9
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.9) #4
  br label %55

43:                                               ; preds = %24
  store i32 1, ptr @dump, align 4, !tbaa !9
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.10) #4
  br label %55

46:                                               ; preds = %24
  store i32 4, ptr @format, align 4, !tbaa !9
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.11) #4
  br label %55

49:                                               ; preds = %24
  %50 = getelementptr inbounds i8, ptr %.02330, i64 16
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %51, ptr noundef nonnull @.str.12, ptr noundef nonnull @max_vertex_length) #5
  %53 = add nsw i32 %.02429, -1
  br label %55

54:                                               ; preds = %24
  tail call void @help()
  br label %103

55:                                               ; preds = %49, %46, %43, %40, %37, %34, %31, %28
  %.125 = phi i32 [ %53, %49 ], [ %.02429, %46 ], [ %.02429, %43 ], [ %.02429, %40 ], [ %.02429, %37 ], [ %.02429, %34 ], [ %.02429, %31 ], [ %.02429, %28 ]
  %.1 = phi ptr [ %20, %49 ], [ %.02330, %46 ], [ %.02330, %43 ], [ %.02330, %40 ], [ %.02330, %37 ], [ %.02330, %34 ], [ %.02330, %31 ], [ %.02330, %28 ]
  %56 = add nsw i32 %.125, -1
  %57 = getelementptr inbounds i8, ptr %.1, i64 8
  %58 = icmp sgt i32 %.125, 2
  br i1 %58, label %.lr.ph, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph, %55, %.preheader
  %59 = load i32, ptr @smooth, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %.critedge
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.13) #4
  br label %64

64:                                               ; preds = %61, %.critedge
  tail call void @read_cord()
  tail call void @cull_coords()
  store i32 0, ptr @start_point, align 4, !tbaa !9
  %65 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #6
  store ptr %65, ptr @start, align 8, !tbaa !5
  store ptr %65, ptr @end, align 8, !tbaa !5
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.14) #4
  %68 = load i32, ptr @max_dots, align 4, !tbaa !9
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph33, label %._crit_edge

.lr.ph33:                                         ; preds = %64, %73
  %.02132 = phi i32 [ %74, %73 ], [ 0, %64 ]
  %70 = tail call i32 @check_point(i32 noundef %.02132)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %.lr.ph33
  store i32 %.02132, ptr @start_point, align 4, !tbaa !9
  tail call void @polygonize()
  br label %73

73:                                               ; preds = %.lr.ph33, %72
  %74 = add nuw nsw i32 %.02132, 1
  %75 = load i32, ptr @max_dots, align 4, !tbaa !9
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %.lr.ph33, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %73, %64
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = load i32, ptr @tri_count, align 4, !tbaa !9
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.15, i32 noundef %78) #4
  tail call void @cull_triangles()
  %80 = load i32, ptr @smooth, align 4, !tbaa !9
  %81 = icmp eq i32 %80, 1
  br i1 %81, label %82, label %83

82:                                               ; preds = %._crit_edge
  tail call void @reorder_triangle()
  br label %83

83:                                               ; preds = %82, %._crit_edge
  %84 = load i32, ptr @format, align 4, !tbaa !9
  switch i32 %84, label %100 [
    i32 0, label %85
    i32 1, label %88
    i32 2, label %91
    i32 3, label %94
    i32 4, label %97
  ]

85:                                               ; preds = %83
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.16) #4
  tail call void @vrml_out()
  tail call void @vrml_end()
  br label %100

88:                                               ; preds = %83
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.17) #4
  tail call void @molscript_out()
  br label %100

91:                                               ; preds = %83
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.18) #4
  tail call void @prepi_out()
  br label %100

94:                                               ; preds = %83
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.19) #4
  tail call void @povray_out()
  br label %100

97:                                               ; preds = %83
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.20) #4
  tail call void @vmd_out()
  br label %100

100:                                              ; preds = %97, %94, %91, %88, %85, %83
  %101 = load ptr, ptr @stderr, align 8, !tbaa !5
  %102 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str.21) #4
  br label %103

103:                                              ; preds = %100, %54, %27
  ret i32 0
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_point(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @read_cord() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @polygonize() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @vrml_out() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @vrml_end() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @molscript_out() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @cull_triangles() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @cull_coords() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @prepi_out() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @povray_out() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @vmd_out() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @reorder_triangle() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @help() local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind willreturn memory(argmem: write) }
attributes #4 = { cold nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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