; LLVM IR from jgaeddert/liquid-dsp :: examples (polyfit_comparison_example)

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

@__const.main.x = external hidden unnamed_addr constant [3 x float], align 4
@__const.main.y = external hidden unnamed_addr constant [3 x float], align 4
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [3 x float], align 4
  %3 = alloca [3 x float], align 4
  %4 = alloca [3 x float], align 4
  %5 = alloca [3 x float], align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %2, ptr align 4 @__const.main.x, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 @__const.main.y, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #6
  %13 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 0
  %14 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 0
  %15 = getelementptr inbounds [3 x float], ptr %4, i64 0, i64 0
  %16 = call i32 @polyf_fit(ptr noundef %13, ptr noundef %14, i32 noundef 3, ptr noundef %15, i32 noundef 3)
  %17 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 0
  %18 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 0
  %19 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 0
  %20 = call i32 @polyf_fit_lagrange(ptr noundef %17, ptr noundef %18, i32 noundef 3, ptr noundef %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 51, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !5
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  store ptr %23, ptr %7, align 8
  %24 = alloca float, i64 %22, align 16
  store i64 %22, ptr %8, align 8
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = zext i32 %25 to i64
  %27 = alloca float, i64 %26, align 16
  store i64 %26, ptr %9, align 8
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = alloca float, i64 %29, align 16
  store i64 %29, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %65, %0
  %32 = load i32, ptr %11, align 4, !tbaa !5
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %35, label %68

35:                                               ; preds = %31
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = uitofp i32 %36 to float
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sub i32 %38, 1
  %40 = uitofp i32 %39 to float
  %41 = fdiv float %37, %40
  %42 = fsub float %41, 5.000000e-01
  %43 = fmul float 0x40019999A0000000, %42
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds float, ptr %24, i64 %45
  store float %43, ptr %46, align 4, !tbaa !9
  %47 = getelementptr inbounds [3 x float], ptr %4, i64 0, i64 0
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds float, ptr %24, i64 %49
  %51 = load float, ptr %50, align 4, !tbaa !9
  %52 = call float @polyf_val(ptr noundef %47, i32 noundef 3, float noundef %51)
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds float, ptr %27, i64 %54
  store float %52, ptr %55, align 4, !tbaa !9
  %56 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 0
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds float, ptr %24, i64 %58
  %60 = load float, ptr %59, align 4, !tbaa !9
  %61 = call float @polyf_val(ptr noundef %56, i32 noundef 3, float noundef %60)
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds float, ptr %30, i64 %63
  store float %61, ptr %64, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %35
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = add i32 %66, 1
  store i32 %67, ptr %11, align 4, !tbaa !5
  br label %31, !llvm.loop !11

68:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %69 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %69, ptr %12, align 8, !tbaa !13
  %70 = load ptr, ptr %12, align 8, !tbaa !13
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.2, ptr noundef @.str) #6
  %72 = load ptr, ptr %12, align 8, !tbaa !13
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.3) #6
  %74 = load ptr, ptr %12, align 8, !tbaa !13
  %75 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 0
  %76 = load float, ptr %75, align 4, !tbaa !9
  %77 = fpext float %76 to double
  %78 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 1
  %79 = load float, ptr %78, align 4, !tbaa !9
  %80 = fpext float %79 to double
  %81 = getelementptr inbounds [3 x float], ptr %2, i64 0, i64 2
  %82 = load float, ptr %81, align 4, !tbaa !9
  %83 = fpext float %82 to double
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.4, double noundef %77, double noundef %80, double noundef %83) #6
  %85 = load ptr, ptr %12, align 8, !tbaa !13
  %86 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 0
  %87 = load float, ptr %86, align 4, !tbaa !9
  %88 = fpext float %87 to double
  %89 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 1
  %90 = load float, ptr %89, align 4, !tbaa !9
  %91 = fpext float %90 to double
  %92 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 2
  %93 = load float, ptr %92, align 4, !tbaa !9
  %94 = fpext float %93 to double
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.5, double noundef %88, double noundef %91, double noundef %94) #6
  %96 = load ptr, ptr %12, align 8, !tbaa !13
  %97 = getelementptr inbounds [3 x float], ptr %4, i64 0, i64 0
  %98 = load float, ptr %97, align 4, !tbaa !9
  %99 = fpext float %98 to double
  %100 = getelementptr inbounds [3 x float], ptr %4, i64 0, i64 1
  %101 = load float, ptr %100, align 4, !tbaa !9
  %102 = fpext float %101 to double
  %103 = getelementptr inbounds [3 x float], ptr %4, i64 0, i64 2
  %104 = load float, ptr %103, align 4, !tbaa !9
  %105 = fpext float %104 to double
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.6, double noundef %99, double noundef %102, double noundef %105) #6
  %107 = load ptr, ptr %12, align 8, !tbaa !13
  %108 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 0
  %109 = load float, ptr %108, align 4, !tbaa !9
  %110 = fpext float %109 to double
  %111 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 1
  %112 = load float, ptr %111, align 4, !tbaa !9
  %113 = fpext float %112 to double
  %114 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 2
  %115 = load float, ptr %114, align 4, !tbaa !9
  %116 = fpext float %115 to double
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str.7, double noundef %110, double noundef %113, double noundef %116) #6
  %118 = load ptr, ptr %12, align 8, !tbaa !13
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.8, i32 noundef %119) #6
  %121 = load ptr, ptr %12, align 8, !tbaa !13
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.9) #6
  %123 = load ptr, ptr %12, align 8, !tbaa !13
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.10) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %153, %68
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = icmp ult i32 %126, %127
  br i1 %128, label %129, label %156

129:                                              ; preds = %125
  %130 = load ptr, ptr %12, align 8, !tbaa !13
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = add i32 %131, 1
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %24, i64 %134
  %136 = load float, ptr %135, align 4, !tbaa !9
  %137 = fpext float %136 to double
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = add i32 %138, 1
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds float, ptr %27, i64 %141
  %143 = load float, ptr %142, align 4, !tbaa !9
  %144 = fpext float %143 to double
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = add i32 %145, 1
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = zext i32 %147 to i64
  %149 = getelementptr inbounds float, ptr %30, i64 %148
  %150 = load float, ptr %149, align 4, !tbaa !9
  %151 = fpext float %150 to double
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.11, i32 noundef %132, double noundef %137, i32 noundef %139, double noundef %144, i32 noundef %146, double noundef %151) #6
  br label %153

153:                                              ; preds = %129
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = add i32 %154, 1
  store i32 %155, ptr %11, align 4, !tbaa !5
  br label %125, !llvm.loop !15

156:                                              ; preds = %125
  %157 = load ptr, ptr %12, align 8, !tbaa !13
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %157, ptr noundef @.str.12) #6
  %159 = load ptr, ptr %12, align 8, !tbaa !13
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef @.str.13) #6
  %161 = load ptr, ptr %12, align 8, !tbaa !13
  %162 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %161, ptr noundef @.str.14) #6
  %163 = load ptr, ptr %12, align 8, !tbaa !13
  %164 = call i32 @fclose(ptr noundef %163)
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %166 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %166)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %2) #6
  %167 = load i32, ptr %1, align 4
  ret i32 %167
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @polyf_fit(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

declare i32 @polyf_fit_lagrange(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

declare float @polyf_val(ptr noundef, i32 noundef, float noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

declare i32 @fclose(ptr noundef) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !12}


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

@__const.main.x = external hidden unnamed_addr constant [3 x float], align 4
@__const.main.y = external hidden unnamed_addr constant [3 x float], align 4
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [3 x float], align 4
  %2 = alloca [3 x float], align 4
  %3 = alloca [3 x float], align 4
  %4 = alloca [3 x float], align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.x, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.y, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #6
  %5 = call i32 @polyf_fit(ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef 3, ptr noundef nonnull %3, i32 noundef 3) #6
  %6 = call i32 @polyf_fit_lagrange(ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef 3, ptr noundef nonnull %4) #6
  %7 = call ptr @llvm.stacksave.p0()
  %8 = alloca [51 x float], align 16
  %9 = alloca [51 x float], align 16
  %10 = alloca [51 x float], align 16
  br label %11

11:                                               ; preds = %0, %11
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %11 ]
  %12 = trunc nuw nsw i64 %indvars.iv to i32
  %13 = uitofp nneg i32 %12 to float
  %14 = fdiv float %13, 5.000000e+01
  %15 = fadd float %14, -5.000000e-01
  %16 = fmul float %15, 0x40019999A0000000
  %17 = getelementptr inbounds float, ptr %8, i64 %indvars.iv
  store float %16, ptr %17, align 4, !tbaa !5
  %18 = call float @polyf_val(ptr noundef nonnull %3, i32 noundef 3, float noundef %16) #6
  %19 = getelementptr inbounds float, ptr %9, i64 %indvars.iv
  store float %18, ptr %19, align 4, !tbaa !5
  %20 = call float @polyf_val(ptr noundef nonnull %4, i32 noundef 3, float noundef %16) #6
  %21 = getelementptr inbounds float, ptr %10, i64 %indvars.iv
  store float %20, ptr %21, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 51
  br i1 %exitcond.not, label %22, label %11, !llvm.loop !9

22:                                               ; preds = %11
  %23 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str) #6
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.3) #6
  %26 = load float, ptr %1, align 4, !tbaa !5
  %27 = fpext float %26 to double
  %28 = getelementptr inbounds i8, ptr %1, i64 4
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = fpext float %29 to double
  %31 = getelementptr inbounds i8, ptr %1, i64 8
  %32 = load float, ptr %31, align 4, !tbaa !5
  %33 = fpext float %32 to double
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.4, double noundef %27, double noundef %30, double noundef %33) #6
  %35 = load float, ptr %2, align 4, !tbaa !5
  %36 = fpext float %35 to double
  %37 = getelementptr inbounds i8, ptr %2, i64 4
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = fpext float %38 to double
  %40 = getelementptr inbounds i8, ptr %2, i64 8
  %41 = load float, ptr %40, align 4, !tbaa !5
  %42 = fpext float %41 to double
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.5, double noundef %36, double noundef %39, double noundef %42) #6
  %44 = load float, ptr %3, align 4, !tbaa !5
  %45 = fpext float %44 to double
  %46 = getelementptr inbounds i8, ptr %3, i64 4
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = fpext float %47 to double
  %49 = getelementptr inbounds i8, ptr %3, i64 8
  %50 = load float, ptr %49, align 4, !tbaa !5
  %51 = fpext float %50 to double
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.6, double noundef %45, double noundef %48, double noundef %51) #6
  %53 = load float, ptr %4, align 4, !tbaa !5
  %54 = fpext float %53 to double
  %55 = getelementptr inbounds i8, ptr %4, i64 4
  %56 = load float, ptr %55, align 4, !tbaa !5
  %57 = fpext float %56 to double
  %58 = getelementptr inbounds i8, ptr %4, i64 8
  %59 = load float, ptr %58, align 4, !tbaa !5
  %60 = fpext float %59 to double
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.7, double noundef %54, double noundef %57, double noundef %60) #6
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.8, i32 noundef 51) #6
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.9) #6
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.10) #6
  br label %65

65:                                               ; preds = %22, %65
  %indvars.iv41 = phi i64 [ 0, %22 ], [ %indvars.iv.next42, %65 ]
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %66 = getelementptr inbounds float, ptr %8, i64 %indvars.iv41
  %67 = load float, ptr %66, align 4, !tbaa !5
  %68 = fpext float %67 to double
  %69 = getelementptr inbounds float, ptr %9, i64 %indvars.iv41
  %70 = load float, ptr %69, align 4, !tbaa !5
  %71 = fpext float %70 to double
  %72 = getelementptr inbounds float, ptr %10, i64 %indvars.iv41
  %73 = load float, ptr %72, align 4, !tbaa !5
  %74 = fpext float %73 to double
  %75 = trunc nuw nsw i64 %indvars.iv.next42 to i32
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.11, i32 noundef %75, double noundef %68, i32 noundef %75, double noundef %71, i32 noundef %75, double noundef %74) #6
  %exitcond44.not = icmp eq i64 %indvars.iv.next42, 51
  br i1 %exitcond44.not, label %77, label %65, !llvm.loop !11

77:                                               ; preds = %65
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.12) #6
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.13) #6
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.14) #6
  %81 = call i32 @fclose(ptr noundef %23)
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare i32 @polyf_fit(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @polyf_fit_lagrange(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

declare float @polyf_val(ptr noundef, i32 noundef, float noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass