; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (r8lib)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.147 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.148 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.149 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

23:                                               ; preds = %6
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = sub nsw i32 %24, 3
  %26 = load i32, ptr %10, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %23, %6
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str) #5
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.147) #5
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.148) #5
  call void @exit(i32 noundef 1) #6
  unreachable

35:                                               ; preds = %23
  %36 = load ptr, ptr %8, align 8, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %36, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !11
  store double %40, ptr %15, align 8, !tbaa !11
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %41, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  store double %46, ptr %16, align 8, !tbaa !11
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = add nsw i32 %48, 2
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %47, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !11
  store double %52, ptr %17, align 8, !tbaa !11
  %53 = load double, ptr %16, align 8, !tbaa !11
  %54 = load double, ptr %15, align 8, !tbaa !11
  %55 = fcmp ole double %53, %54
  br i1 %55, label %60, label %56

56:                                               ; preds = %35
  %57 = load double, ptr %17, align 8, !tbaa !11
  %58 = load double, ptr %16, align 8, !tbaa !11
  %59 = fcmp ole double %57, %58
  br i1 %59, label %60, label %76

60:                                               ; preds = %56, %35
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str) #5
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.147) #5
  %65 = load ptr, ptr @stderr, align 8, !tbaa !9
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.149) #5
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = load double, ptr %15, align 8, !tbaa !11
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.150, double noundef %68) #5
  %70 = load ptr, ptr @stderr, align 8, !tbaa !9
  %71 = load double, ptr %16, align 8, !tbaa !11
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.151, double noundef %71) #5
  %73 = load ptr, ptr @stderr, align 8, !tbaa !9
  %74 = load double, ptr %17, align 8, !tbaa !11
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.152, double noundef %74) #5
  call void @exit(i32 noundef 1) #6
  unreachable

76:                                               ; preds = %56
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds double, ptr %77, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !11
  store double %81, ptr %18, align 8, !tbaa !11
  %82 = load ptr, ptr %9, align 8, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %82, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !11
  store double %87, ptr %19, align 8, !tbaa !11
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = add nsw i32 %89, 2
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %88, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  store double %93, ptr %20, align 8, !tbaa !11
  %94 = load double, ptr %19, align 8, !tbaa !11
  %95 = load double, ptr %18, align 8, !tbaa !11
  %96 = fsub double %94, %95
  %97 = load double, ptr %16, align 8, !tbaa !11
  %98 = load double, ptr %15, align 8, !tbaa !11
  %99 = fsub double %97, %98
  %100 = fdiv double %96, %99
  store double %100, ptr %13, align 8, !tbaa !11
  %101 = load double, ptr %20, align 8, !tbaa !11
  %102 = load double, ptr %18, align 8, !tbaa !11
  %103 = fsub double %101, %102
  %104 = load double, ptr %17, align 8, !tbaa !11
  %105 = load double, ptr %15, align 8, !tbaa !11
  %106 = fsub double %104, %105
  %107 = fdiv double %103, %106
  %108 = load double, ptr %19, align 8, !tbaa !11
  %109 = load double, ptr %18, align 8, !tbaa !11
  %110 = fsub double %108, %109
  %111 = load double, ptr %16, align 8, !tbaa !11
  %112 = load double, ptr %15, align 8, !tbaa !11
  %113 = fsub double %111, %112
  %114 = fdiv double %110, %113
  %115 = fsub double %107, %114
  %116 = load double, ptr %17, align 8, !tbaa !11
  %117 = load double, ptr %16, align 8, !tbaa !11
  %118 = fsub double %116, %117
  %119 = fdiv double %115, %118
  store double %119, ptr %14, align 8, !tbaa !11
  %120 = load double, ptr %18, align 8, !tbaa !11
  %121 = load double, ptr %11, align 8, !tbaa !11
  %122 = load double, ptr %15, align 8, !tbaa !11
  %123 = fsub double %121, %122
  %124 = load double, ptr %13, align 8, !tbaa !11
  %125 = load double, ptr %11, align 8, !tbaa !11
  %126 = load double, ptr %16, align 8, !tbaa !11
  %127 = fsub double %125, %126
  %128 = load double, ptr %14, align 8, !tbaa !11
  %129 = call double @llvm.fmuladd.f64(double %127, double %128, double %124)
  %130 = call double @llvm.fmuladd.f64(double %123, double %129, double %120)
  %131 = load ptr, ptr %12, align 8, !tbaa !9
  store double %130, ptr %131, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  ret void
}

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.147 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.148 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.149 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.150 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.151 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.152 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind uwtable
define dso_local void @r8poly2_val2(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3, double noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #3 {
  %7 = icmp slt i32 %3, 0
  %8 = add nsw i32 %0, -3
  %9 = icmp slt i32 %8, %3
  %or.cond = select i1 %7, i1 true, i1 %9
  br i1 %or.cond, label %10, label %17

10:                                               ; preds = %6
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str) #4
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.147) #4
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.148) #4
  tail call void @exit(i32 noundef 1) #5
  unreachable

17:                                               ; preds = %6
  %18 = zext nneg i32 %3 to i64
  %19 = getelementptr inbounds double, ptr %1, i64 %18
  %20 = load double, ptr %19, align 8, !tbaa !9
  %21 = add nuw nsw i32 %3, 1
  %22 = zext nneg i32 %21 to i64
  %23 = getelementptr inbounds double, ptr %1, i64 %22
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = add nuw nsw i32 %3, 2
  %26 = zext nneg i32 %25 to i64
  %27 = getelementptr inbounds double, ptr %1, i64 %26
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = fcmp ugt double %24, %20
  %30 = fcmp ugt double %28, %24
  %or.cond47 = select i1 %29, i1 %30, i1 false
  br i1 %or.cond47, label %44, label %31

31:                                               ; preds = %17
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str) #4
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.147) #4
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.149) #4
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.150, double noundef %20) #4
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.151, double noundef %24) #4
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.152, double noundef %28) #4
  tail call void @exit(i32 noundef 1) #5
  unreachable

44:                                               ; preds = %17
  %45 = getelementptr inbounds double, ptr %2, i64 %18
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds double, ptr %2, i64 %22
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds double, ptr %2, i64 %26
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = insertelement <2 x double> poison, double %28, i64 0
  %52 = insertelement <2 x double> %51, double %24, i64 1
  %53 = insertelement <2 x double> poison, double %20, i64 0
  %54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> zeroinitializer
  %55 = fsub <2 x double> %52, %54
  %56 = insertelement <2 x double> poison, double %50, i64 0
  %57 = insertelement <2 x double> %56, double %48, i64 1
  %58 = insertelement <2 x double> poison, double %46, i64 0
  %59 = shufflevector <2 x double> %58, <2 x double> poison, <2 x i32> zeroinitializer
  %60 = fsub <2 x double> %57, %59
  %61 = fdiv <2 x double> %60, %55
  %62 = extractelement <2 x double> %61, i64 0
  %63 = extractelement <2 x double> %61, i64 1
  %64 = fsub double %62, %63
  %65 = fsub double %28, %24
  %66 = fdiv double %64, %65
  %67 = fsub double %4, %20
  %68 = fsub double %4, %24
  %69 = tail call double @llvm.fmuladd.f64(double %68, double %66, double %63)
  %70 = tail call double @llvm.fmuladd.f64(double %67, double %69, double %46)
  store double %70, ptr %5, align 8, !tbaa !9
  ret void
}

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { cold 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 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass