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

@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
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 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.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = 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.10 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = 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
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %41, %2
  %18 = load i32, ptr %8, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 30000
  br i1 %19, label %20, label %44

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

21:                                               ; preds = %37, %20
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 4
  br i1 %23, label %24, label %40

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

37:                                               ; preds = %24
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %9, align 4, !tbaa !5
  br label %21, !llvm.loop !13

40:                                               ; preds = %21
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  br label %17, !llvm.loop !15

44:                                               ; preds = %17
  br label %45

45:                                               ; preds = %85, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 1
  br i1 %47, label %48, label %56

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

56:                                               ; preds = %48, %45
  %57 = phi i1 [ false, %45 ], [ %55, %48 ]
  br i1 %57, label %58, label %90

58:                                               ; preds = %56
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %59, i64 1
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = load i8, ptr %62, align 1, !tbaa !16
  %64 = sext i8 %63 to i32
  switch i32 %64, label %84 [
    i32 104, label %65
    i32 115, label %66
    i32 109, label %69
    i32 118, label %72
    i32 112, label %75
    i32 114, label %78
    i32 100, label %81
  ]

65:                                               ; preds = %58
  call void @help()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %135

66:                                               ; preds = %58
  store i32 1, ptr @smooth, align 4, !tbaa !5
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.3) #4
  br label %85

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

72:                                               ; preds = %58
  store i32 0, ptr @format, align 4, !tbaa !5
  %73 = load ptr, ptr @stderr, align 8, !tbaa !9
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.5) #4
  br label %85

75:                                               ; preds = %58
  store i32 2, ptr @format, align 4, !tbaa !5
  %76 = load ptr, ptr @stderr, align 8, !tbaa !9
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.6) #4
  br label %85

78:                                               ; preds = %58
  store i32 3, ptr @format, align 4, !tbaa !5
  %79 = load ptr, ptr @stderr, align 8, !tbaa !9
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.7) #4
  br label %85

81:                                               ; preds = %58
  store i32 1, ptr @dump, align 4, !tbaa !5
  %82 = load ptr, ptr @stderr, align 8, !tbaa !9
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.8) #4
  br label %85

84:                                               ; preds = %58
  call void @help()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %135

85:                                               ; preds = %81, %78, %75, %72, %69, %66
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr %4, align 4, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds ptr, ptr %88, i32 1
  store ptr %89, ptr %5, align 8, !tbaa !9
  br label %45, !llvm.loop !17

90:                                               ; preds = %56
  %91 = load i32, ptr @smooth, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %90
  %94 = load ptr, ptr @stderr, align 8, !tbaa !9
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.9) #4
  br label %96

96:                                               ; preds = %93, %90
  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
  %97 = call noalias ptr @malloc(i64 noundef 32) #5
  store ptr %97, ptr @start, align 8, !tbaa !9
  %98 = load ptr, ptr @start, align 8, !tbaa !9
  store ptr %98, ptr @end, align 8, !tbaa !9
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.10) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %112, %96
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = load i32, ptr @max_dots, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %115

105:                                              ; preds = %101
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = call i32 @check_point(i32 noundef %106)
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %111

109:                                              ; preds = %105
  %110 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %110, ptr @start_point, align 4, !tbaa !5
  call void @polygonize()
  br label %111

111:                                              ; preds = %109, %105
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %101, !llvm.loop !18

115:                                              ; preds = %101
  %116 = load ptr, ptr @stderr, align 8, !tbaa !9
  %117 = load i32, ptr @tri_count, align 4, !tbaa !5
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.11, i32 noundef %117) #4
  call void @cull_triangles()
  %119 = load i32, ptr @format, align 4, !tbaa !5
  switch i32 %119, label %132 [
    i32 0, label %120
    i32 1, label %123
    i32 2, label %126
    i32 3, label %129
  ]

120:                                              ; preds = %115
  %121 = load ptr, ptr @stderr, align 8, !tbaa !9
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.12) #4
  call void @vrml_out()
  call void @vrml_end()
  br label %132

123:                                              ; preds = %115
  %124 = load ptr, ptr @stderr, align 8, !tbaa !9
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.13) #4
  call void @molscript_out()
  br label %132

126:                                              ; preds = %115
  %127 = load ptr, ptr @stderr, align 8, !tbaa !9
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.14) #4
  call void @prepi_out()
  br label %132

129:                                              ; preds = %115
  %130 = load ptr, ptr @stderr, align 8, !tbaa !9
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.15) #4
  call void @povray_out()
  br label %132

132:                                              ; preds = %129, %126, %123, %120, %115
  %133 = load ptr, ptr @stderr, align 8, !tbaa !9
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.16) #4
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %135

135:                                              ; preds = %132, %84, %65
  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
  %136 = load i32, ptr %3, align 4
  ret i32 %136
}

; 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 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 @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
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 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.3 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = 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.10 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = 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
  br label %.preheader22

.preheader22:                                     ; preds = %.preheader22, %2
  %indvar = phi i64 [ 0, %2 ], [ %indvar.next.1, %.preheader22 ]
  %9 = mul nuw nsw i64 %indvar, 20
  %scevgep = getelementptr i8, ptr @tri, i64 %9
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep, i8 -1, i64 16, i1 false), !tbaa !9
  %10 = 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 %10, align 16, !tbaa !11
  %11 = 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 %11, align 16, !tbaa !11
  %indvar.next = or disjoint i64 %indvar, 1
  %12 = mul nuw nsw i64 %indvar.next, 20
  %scevgep.1 = getelementptr i8, ptr @tri, i64 %12
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %scevgep.1, i8 -1, i64 16, i1 false), !tbaa !9
  %13 = 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 %13, align 8, !tbaa !11
  %14 = 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 %14, 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 %.preheader22, !llvm.loop !13

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

.lr.ph:                                           ; preds = %.preheader, %31
  %.02026 = phi ptr [ %16, %31 ], [ %1, %.preheader ]
  %.02125 = phi i32 [ %34, %31 ], [ %0, %.preheader ]
  %16 = getelementptr inbounds i8, ptr %.02026, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = load i8, ptr %17, align 1, !tbaa !15
  %19 = icmp eq i8 %18, 45
  br i1 %19, label %20, label %.critedge

20:                                               ; preds = %.lr.ph
  %21 = getelementptr inbounds i8, ptr %17, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !15
  switch i8 %22, label %30 [
    i8 104, label %23
    i8 115, label %24
    i8 109, label %25
    i8 118, label %26
    i8 112, label %27
    i8 114, label %28
    i8 100, label %29
  ]

23:                                               ; preds = %20
  tail call void @help()
  br label %73

24:                                               ; preds = %20
  store i32 1, ptr @smooth, align 4, !tbaa !9
  br label %31

25:                                               ; preds = %20
  store i32 1, ptr @format, align 4, !tbaa !9
  br label %31

26:                                               ; preds = %20
  store i32 0, ptr @format, align 4, !tbaa !9
  br label %31

27:                                               ; preds = %20
  store i32 2, ptr @format, align 4, !tbaa !9
  br label %31

28:                                               ; preds = %20
  store i32 3, ptr @format, align 4, !tbaa !9
  br label %31

29:                                               ; preds = %20
  store i32 1, ptr @dump, align 4, !tbaa !9
  br label %31

30:                                               ; preds = %20
  tail call void @help()
  br label %73

31:                                               ; preds = %29, %28, %27, %26, %25, %24
  %.str.8.sink = phi ptr [ @.str.8, %29 ], [ @.str.7, %28 ], [ @.str.6, %27 ], [ @.str.5, %26 ], [ @.str.4, %25 ], [ @.str.3, %24 ]
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull %.str.8.sink) #4
  %34 = add nsw i32 %.02125, -1
  %35 = icmp sgt i32 %.02125, 2
  br i1 %35, label %.lr.ph, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph, %31, %.preheader
  %36 = load i32, ptr @smooth, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %.critedge
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.9) #4
  br label %41

41:                                               ; preds = %38, %.critedge
  tail call void @read_cord()
  tail call void @cull_coords()
  store i32 0, ptr @start_point, align 4, !tbaa !9
  %42 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #5
  store ptr %42, ptr @start, align 8, !tbaa !5
  store ptr %42, ptr @end, align 8, !tbaa !5
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.10) #4
  %45 = load i32, ptr @max_dots, align 4, !tbaa !9
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph29, label %._crit_edge

.lr.ph29:                                         ; preds = %41, %50
  %.01828 = phi i32 [ %51, %50 ], [ 0, %41 ]
  %47 = tail call i32 @check_point(i32 noundef %.01828)
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %.lr.ph29
  store i32 %.01828, ptr @start_point, align 4, !tbaa !9
  tail call void @polygonize()
  br label %50

50:                                               ; preds = %.lr.ph29, %49
  %51 = add nuw nsw i32 %.01828, 1
  %52 = load i32, ptr @max_dots, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %.lr.ph29, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %50, %41
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = load i32, ptr @tri_count, align 4, !tbaa !9
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.11, i32 noundef %55) #4
  tail call void @cull_triangles()
  %57 = load i32, ptr @format, align 4, !tbaa !9
  switch i32 %57, label %70 [
    i32 0, label %58
    i32 1, label %61
    i32 2, label %64
    i32 3, label %67
  ]

58:                                               ; preds = %._crit_edge
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.12) #4
  tail call void @vrml_out()
  tail call void @vrml_end()
  br label %70

61:                                               ; preds = %._crit_edge
  %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
  tail call void @molscript_out()
  br label %70

64:                                               ; preds = %._crit_edge
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.14) #4
  tail call void @prepi_out()
  br label %70

67:                                               ; preds = %._crit_edge
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.15) #4
  tail call void @povray_out()
  br label %70

70:                                               ; preds = %67, %64, %61, %58, %._crit_edge
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.16) #4
  br label %73

73:                                               ; preds = %70, %30, %23
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, 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 @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 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