; LLVM IR from upupming/algorithm :: CCCC-GPLT/L2-018. 多项式A除以B (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 [3 x i8], align 1
@c1 = external dso_local global [3000 x double], align 16
@c2 = external dso_local global [3000 x double], align 16
@c3 = external dso_local global [3000 x double], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9printPolyPdi(ptr noundef, i32 noundef) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 -1, ptr %6, align 4, !tbaa !5
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %35, %0
  %16 = load i32, ptr %7, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %38

20:                                               ; preds = %15
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp sgt i32 %22, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %20
  %26 = load i32, ptr %5, align 4, !tbaa !5
  br label %29

27:                                               ; preds = %20
  %28 = load i32, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %27, %25
  %30 = phi i32 [ %26, %25 ], [ %28, %27 ]
  store i32 %30, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %32
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %33)
  br label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %7, align 4, !tbaa !5
  br label %15, !llvm.loop !9

38:                                               ; preds = %19
  %39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %60, %38
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %63

45:                                               ; preds = %40
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %50, label %52

50:                                               ; preds = %45
  %51 = load i32, ptr %6, align 4, !tbaa !5
  br label %54

52:                                               ; preds = %45
  %53 = load i32, ptr %4, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %52, %50
  %55 = phi i32 [ %51, %50 ], [ %53, %52 ]
  store i32 %55, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %57
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %58)
  br label %60

60:                                               ; preds = %54
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !5
  br label %40, !llvm.loop !11

63:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %64 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %64, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %65 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %65, ptr %10, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %120, %63
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = icmp sge i32 %67, %68
  br i1 %69, label %70, label %121

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %72
  %74 = load double, ptr %73, align 8, !tbaa !12
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !12
  %79 = fdiv double %74, %78
  store double %79, ptr %11, align 8, !tbaa !12
  %80 = load double, ptr %11, align 8, !tbaa !12
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sub nsw i32 %81, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [3000 x double], ptr @c3, i64 0, i64 %84
  store double %80, ptr %85, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %86 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %86, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %87 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %104, %70
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = icmp sge i32 %89, 0
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %109

92:                                               ; preds = %88
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !12
  %97 = load double, ptr %11, align 8, !tbaa !12
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !12
  %102 = fneg double %96
  %103 = call double @llvm.fmuladd.f64(double %102, double %97, double %101)
  store double %103, ptr %100, align 8, !tbaa !12
  br label %104

104:                                              ; preds = %92
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %13, align 4, !tbaa !5
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %12, align 4, !tbaa !5
  br label %88, !llvm.loop !14

109:                                              ; preds = %91
  br label %110

110:                                              ; preds = %117, %109
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !12
  %115 = call noundef double @_ZSt3absd(double noundef %114)
  %116 = fcmp olt double %115, 0x3EB0C6F7A0B5ED8D
  br i1 %116, label %117, label %120

117:                                              ; preds = %110
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = add nsw i32 %118, -1
  store i32 %119, ptr %9, align 4, !tbaa !5
  br label %110, !llvm.loop !15

120:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %66, !llvm.loop !16

121:                                              ; preds = %66
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sub nsw i32 %122, %123
  call void @_Z9printPolyPdi(ptr noundef @c3, i32 noundef %124)
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %126 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z9printPolyPdi(ptr noundef @c1, i32 noundef %126)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 #2 = { mustprogress 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 = { "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 norecurse 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


; 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 [3 x i8], align 1
@c1 = external dso_local global [3000 x double], align 16
@c2 = external dso_local global [3000 x double], align 16
@c3 = external dso_local global [3000 x double], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9printPolyPdi(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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.030.lcssa = phi i32 [ -1, %0 ], [ %12, %.lr.ph ]
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph41, label %.preheader35.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03037 = phi i32 [ %12, %.lr.ph ], [ -1, %0 ]
  %.03436 = phi i32 [ %16, %.lr.ph ], [ 0, %0 ]
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %11 = load i32, ptr %3, align 4
  %12 = call i32 @llvm.smax.i32(i32 %.03037, i32 %11)
  %13 = sext i32 %11 to i64
  %14 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %13
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %14)
  %16 = add nuw nsw i32 %.03436, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader35:                                     ; preds = %.lr.ph41
  %.not47 = icmp slt i32 %.030.lcssa, %58
  br i1 %.not47, label %._crit_edge50, label %.lr.ph49

.preheader35.thread:                              ; preds = %._crit_edge
  %.not4766 = icmp slt i32 %.030.lcssa, -1
  br i1 %.not4766, label %._crit_edge50, label %.preheader.preheader

.lr.ph49:                                         ; preds = %.preheader35
  %19 = sext i32 %58 to i64
  %20 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %19
  %21 = icmp sgt i32 %58, -1
  br i1 %21, label %.lr.ph46.us.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader35.thread, %.lr.ph49
  %22 = phi ptr [ %20, %.lr.ph49 ], [ getelementptr inbounds (i8, ptr @c2, i64 -8), %.preheader35.thread ]
  %.031.lcssa6770 = phi i32 [ %58, %.lr.ph49 ], [ -1, %.preheader35.thread ]
  br label %.preheader

.lr.ph46.us.preheader:                            ; preds = %.lr.ph49
  %23 = zext nneg i32 %58 to i64
  %24 = add nuw nsw i64 %23, 1
  %min.iters.check = icmp ult i32 %58, 3
  %n.vec = and i64 %24, 4294967292
  %ind.end79 = sub nsw i64 %23, %n.vec
  %cmp.n = icmp eq i64 %24, %n.vec
  br label %.lr.ph46.us

.lr.ph46.us:                                      ; preds = %.lr.ph46.us.preheader, %.loopexit.us
  %.03248.us = phi i32 [ %55, %.loopexit.us ], [ %.030.lcssa, %.lr.ph46.us.preheader ]
  %25 = sext i32 %.03248.us to i64
  %26 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = load double, ptr %20, align 8, !tbaa !11
  %29 = fdiv double %27, %28
  %30 = sub nsw i32 %.03248.us, %58
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [3000 x double], ptr @c3, i64 0, i64 %31
  store double %29, ptr %32, align 8, !tbaa !11
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph46.us
  %indvars.iv57.ph = phi i64 [ %25, %.lr.ph46.us ], [ %ind.end, %middle.block ]
  %indvars.iv55.ph = phi i64 [ %23, %.lr.ph46.us ], [ %ind.end79, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph46.us
  %ind.end = sub nsw i64 %25, %n.vec
  %broadcast.splatinsert = insertelement <2 x double> poison, double %29, i64 0
  %33 = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %34 = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %25, %index
  %offset.idx81 = sub i64 %23, %index
  %35 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %offset.idx81
  %36 = getelementptr inbounds i8, ptr %35, i64 -8
  %37 = getelementptr inbounds i8, ptr %35, i64 -24
  %wide.load = load <2 x double>, ptr %36, align 8, !tbaa !11
  %wide.load82 = load <2 x double>, ptr %37, align 8, !tbaa !11
  %38 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %offset.idx
  %39 = getelementptr inbounds i8, ptr %38, i64 -8
  %40 = getelementptr inbounds i8, ptr %38, i64 -24
  %wide.load84 = load <2 x double>, ptr %39, align 8, !tbaa !11
  %wide.load86 = load <2 x double>, ptr %40, align 8, !tbaa !11
  %41 = fneg <2 x double> %wide.load
  %reverse88 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %41, <2 x double> %33, <2 x double> %wide.load84)
  store <2 x double> %reverse88, ptr %39, align 8, !tbaa !11
  %42 = fneg <2 x double> %wide.load82
  %reverse89 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %34, <2 x double> %wide.load86)
  store <2 x double> %reverse89, ptr %40, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..preheader_crit_edge.us.preheader, label %scalar.ph.preheader

..preheader_crit_edge.us.preheader:               ; preds = %scalar.ph, %middle.block
  br label %..preheader_crit_edge.us

..preheader_crit_edge.us:                         ; preds = %..preheader_crit_edge.us.preheader, %..preheader_crit_edge.us
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %..preheader_crit_edge.us ], [ %25, %..preheader_crit_edge.us.preheader ]
  %44 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %indvars.iv62
  %45 = load double, ptr %44, align 8, !tbaa !11
  %46 = call noundef double @_ZSt3absd(double noundef %45)
  %47 = fcmp olt double %46, 0x3EB0C6F7A0B5ED8D
  %indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
  br i1 %47, label %..preheader_crit_edge.us, label %.loopexit.us, !llvm.loop !16

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %scalar.ph ], [ %indvars.iv57.ph, %scalar.ph.preheader ]
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %scalar.ph ], [ %indvars.iv55.ph, %scalar.ph.preheader ]
  %48 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %indvars.iv55
  %49 = load double, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %indvars.iv57
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = fneg double %49
  %53 = call double @llvm.fmuladd.f64(double %52, double %29, double %51)
  store double %53, ptr %50, align 8, !tbaa !11
  %indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, -1
  %54 = icmp sgt i64 %indvars.iv55, 0
  br i1 %54, label %scalar.ph, label %..preheader_crit_edge.us.preheader, !llvm.loop !17

.loopexit.us:                                     ; preds = %..preheader_crit_edge.us
  %55 = trunc nsw i64 %indvars.iv62 to i32
  %.not.us = icmp sgt i32 %58, %55
  br i1 %.not.us, label %._crit_edge50, label %.lr.ph46.us, !llvm.loop !18

.lr.ph41:                                         ; preds = %._crit_edge, %.lr.ph41
  %.03139 = phi i32 [ %58, %.lr.ph41 ], [ -1, %._crit_edge ]
  %.03338 = phi i32 [ %62, %.lr.ph41 ], [ 0, %._crit_edge ]
  %56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %57 = load i32, ptr %3, align 4
  %58 = call i32 @llvm.smax.i32(i32 %.03139, i32 %57)
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [3000 x double], ptr @c2, i64 0, i64 %59
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %60)
  %62 = add nuw nsw i32 %.03338, 1
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %.lr.ph41, label %.preheader35, !llvm.loop !19

.loopexit:                                        ; preds = %74
  %65 = trunc nsw i64 %indvars.iv to i32
  %.not = icmp sgt i32 %.031.lcssa6770, %65
  br i1 %.not, label %._crit_edge50, label %.preheader, !llvm.loop !18

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %.03248 = phi i32 [ %65, %.loopexit ], [ %.030.lcssa, %.preheader.preheader ]
  %66 = sext i32 %.03248 to i64
  %67 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !11
  %69 = load double, ptr %22, align 8, !tbaa !11
  %70 = fdiv double %68, %69
  %71 = sub nsw i32 %.03248, %.031.lcssa6770
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [3000 x double], ptr @c3, i64 0, i64 %72
  store double %70, ptr %73, align 8, !tbaa !11
  br label %74

74:                                               ; preds = %74, %.preheader
  %indvars.iv = phi i64 [ %indvars.iv.next, %74 ], [ %66, %.preheader ]
  %75 = getelementptr inbounds [3000 x double], ptr @c1, i64 0, i64 %indvars.iv
  %76 = load double, ptr %75, align 8, !tbaa !11
  %77 = call noundef double @_ZSt3absd(double noundef %76)
  %78 = fcmp olt double %77, 0x3EB0C6F7A0B5ED8D
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  br i1 %78, label %74, label %.loopexit, !llvm.loop !16

._crit_edge50:                                    ; preds = %.loopexit, %.loopexit.us, %.preheader35.thread, %.preheader35
  %.031.lcssa68 = phi i32 [ %58, %.preheader35 ], [ -1, %.preheader35.thread ], [ %58, %.loopexit.us ], [ %.031.lcssa6770, %.loopexit ]
  %.032.lcssa = phi i32 [ %.030.lcssa, %.preheader35 ], [ %.030.lcssa, %.preheader35.thread ], [ %55, %.loopexit.us ], [ %65, %.loopexit ]
  %79 = sub nsw i32 %.030.lcssa, %.031.lcssa68
  call void @_Z9printPolyPdi(ptr noundef nonnull @c3, i32 noundef %79)
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @_Z9printPolyPdi(ptr noundef nonnull @c1, i32 noundef %.032.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 #2 = { mustprogress 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 = { mustprogress norecurse 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15, !14}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,VectorCombinePass