; LLVM IR from P-py/c-numerical-methods :: lagrange (main)

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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @allocInts(ptr noundef %3, i32 noundef 1)
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  call void @storeDegree(ptr noundef %10)
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr %4, align 4, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocDoubles(ptr noundef %5, i32 noundef %14)
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  call void @storeXValue(ptr noundef %15)
  %16 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocKnownPoints(ptr noundef %2, i32 noundef %16)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = load i32, ptr %4, align 4, !tbaa !9
  call void @storeKnownPoints(ptr noundef %17, i32 noundef %18)
  call void @cleanConsoleOutput()
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !9
  call void @chartKnownPoints(ptr noundef %19, i32 noundef %20)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %22)
  %24 = load i32, ptr %4, align 4, !tbaa !9
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %24)
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %27)
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = load i32, ptr %29, align 4, !tbaa !9
  call void @allocDoubles(ptr noundef %6, i32 noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %74, %0
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load double, ptr %32, align 8, !tbaa !11
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @calculateLagrangePolynomials(double noundef %33, ptr noundef %34, ptr noundef %35, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %50, %31
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = load i32, ptr %4, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %53

42:                                               ; preds = %37
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds double, ptr %44, i64 %46
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %43, double noundef %48)
  br label %50

50:                                               ; preds = %42
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %8, align 4, !tbaa !9
  br label %37, !llvm.loop !13

53:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = call double @calculateResult(ptr noundef %54, ptr noundef %55, ptr noundef %56)
  store double %57, ptr %9, align 8, !tbaa !11
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = load double, ptr %58, align 8, !tbaa !11
  %60 = load double, ptr %9, align 8, !tbaa !11
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %59, double noundef %60)
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.9, ptr noundef %7)
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %69, label %73

69:                                               ; preds = %53
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.11, ptr noundef %71)
  br label %73

73:                                               ; preds = %69, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 2
  br i1 %76, label %31, label %77, !llvm.loop !15

77:                                               ; preds = %74
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  call void @freeAll(ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %81)
  call void @exit(i32 noundef 0) #5
  unreachable
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @storeDegree(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @storeXValue(ptr noundef) #0

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

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

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local void @calculateLagrangePolynomials(double noundef, ptr noundef, ptr noundef, ptr 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 double @calculateResult(ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local void @freeAll(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @cleanConsoleOutput() #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 = { "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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"}
!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"

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  store ptr null, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @allocInts(ptr noundef nonnull %2, i32 noundef 1)
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  call void @storeDegree(ptr noundef %6)
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %.fr = freeze i32 %8
  %9 = add i32 %.fr, 1
  call void @allocDoubles(ptr noundef nonnull %3, i32 noundef %9)
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  call void @storeXValue(ptr noundef %10)
  call void @allocKnownPoints(ptr noundef nonnull %1, i32 noundef %9)
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  call void @storeKnownPoints(ptr noundef %11, i32 noundef %9)
  call void @cleanConsoleOutput()
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  call void @chartKnownPoints(ptr noundef %12, i32 noundef %9)
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = load double, ptr %17, align 8, !tbaa !11
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %18)
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = load i32, ptr %20, align 4, !tbaa !9
  call void @allocDoubles(ptr noundef nonnull %4, i32 noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  %.not11 = icmp slt i32 %.fr, 0
  br i1 %.not11, label %.split.us, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext i32 %9 to i64
  br label %.lr.ph

.split.us:                                        ; preds = %0, %45
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  call void @calculateLagrangePolynomials(double noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %1, align 8, !tbaa !5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = call double @calculateResult(ptr noundef %27, ptr noundef %28, ptr noundef %29)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load double, ptr %31, align 8, !tbaa !11
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %32, double noundef %30)
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %5)
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %45

41:                                               ; preds = %.split.us
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.11, ptr noundef %43)
  %.pr.us = load i32, ptr %5, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %41, %.split.us
  %46 = phi i32 [ %.pr.us, %41 ], [ %39, %.split.us ]
  %.not10.us = icmp eq i32 %46, 2
  br i1 %.not10.us, label %.split14.us, label %.split.us, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.preheader, %76
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = load ptr, ptr %1, align 8, !tbaa !5
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  call void @calculateLagrangePolynomials(double noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef %51)
  br label %66

._crit_edge:                                      ; preds = %66
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call double @calculateResult(ptr noundef %52, ptr noundef %53, ptr noundef %54)
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load double, ptr %56, align 8, !tbaa !11
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %57, double noundef %55)
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %5)
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %72, label %76

66:                                               ; preds = %.lr.ph, %66
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %66 ]
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds double, ptr %67, i64 %indvars.iv
  %69 = load double, ptr %68, align 8, !tbaa !11
  %70 = trunc nuw nsw i64 %indvars.iv to i32
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %70, double noundef %69)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %66, !llvm.loop !15

72:                                               ; preds = %._crit_edge
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.11, ptr noundef %74)
  %.pr = load i32, ptr %5, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %72, %._crit_edge
  %77 = phi i32 [ %.pr, %72 ], [ %64, %._crit_edge ]
  %.not10 = icmp eq i32 %77, 2
  br i1 %.not10, label %.split14.us, label %.lr.ph, !llvm.loop !13

.split14.us:                                      ; preds = %76, %45
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %1, align 8, !tbaa !5
  call void @freeAll(ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %81)
  call void @exit(i32 noundef 0) #6
  unreachable
}

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local double @calculateResult(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @cleanConsoleOutput() local_unnamed_addr #2

attributes #0 = { noreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { noreturn 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 #5 = { nounwind }
attributes #6 = { noreturn 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"}
!15 = distinct !{!15, !14}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass