; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-10-11 (D - Dudu, the Possum - lzy)

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

@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@ans = external dso_local global double, align 8
@x = external dso_local global double, align 8
@c = external dso_local global double, align 8
@s = external dso_local global [609 x double], align 16
@w = external dso_local global [609 x double], align 16
@p = external dso_local global [19 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

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

9:                                                ; preds = %117, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @T, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %120

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %14
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr @k, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %29

21:                                               ; preds = %16
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds double, ptr @p, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !9

29:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %54, %29
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sle i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %57

35:                                               ; preds = %30
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %38
  store double 0.000000e+00, ptr %39, align 8, !tbaa !11
  br label %40

40:                                               ; preds = %44, %35
  %41 = load i32, ptr @q, align 4, !tbaa !5
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr @q, align 4, !tbaa !5
  %43 = icmp ne i32 %41, 0
  br i1 %43, label %44, label %53

44:                                               ; preds = %40
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @c, ptr noundef @x)
  %46 = load double, ptr @c, align 8, !tbaa !11
  %47 = load double, ptr @x, align 8, !tbaa !11
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = call double @llvm.fmuladd.f64(double %46, double %47, double %51)
  store double %52, ptr %50, align 8, !tbaa !11
  br label %40, !llvm.loop !13

53:                                               ; preds = %40
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %5, align 4, !tbaa !5
  br label %30, !llvm.loop !14

57:                                               ; preds = %34
  store double 1.000000e+00, ptr getelementptr inbounds ([609 x double], ptr @s, i64 0, i64 1), align 8, !tbaa !11
  %58 = load double, ptr getelementptr inbounds ([609 x double], ptr @w, i64 0, i64 1), align 8, !tbaa !11
  store double %58, ptr @ans, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %109, %57
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %112

64:                                               ; preds = %59
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %66
  store double 0.000000e+00, ptr %67, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %95, %64
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr @k, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %72, label %76

72:                                               ; preds = %68
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br label %76

76:                                               ; preds = %72, %68
  %77 = phi i1 [ false, %68 ], [ %75, %72 ]
  br i1 %77, label %79, label %78

78:                                               ; preds = %76
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %98

79:                                               ; preds = %76
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !11
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [19 x double], ptr @p, i64 0, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !11
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = call double @llvm.fmuladd.f64(double %85, double %89, double %93)
  store double %94, ptr %92, align 8, !tbaa !11
  br label %95

95:                                               ; preds = %79
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %7, align 4, !tbaa !5
  br label %68, !llvm.loop !15

98:                                               ; preds = %78
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %100
  %102 = load double, ptr %101, align 8, !tbaa !11
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = load double, ptr @ans, align 8, !tbaa !11
  %108 = call double @llvm.fmuladd.f64(double %102, double %106, double %107)
  store double %108, ptr @ans, align 8, !tbaa !11
  br label %109

109:                                              ; preds = %98
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %6, align 4, !tbaa !5
  br label %59, !llvm.loop !16

112:                                              ; preds = %63
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %113)
  %115 = load double, ptr @ans, align 8, !tbaa !11
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, double noundef %115)
  br label %117

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

120:                                              ; preds = %13
  ret i32 0
}

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

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

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

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

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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"

@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global double, align 8
@x = external dso_local global double, align 8
@c = external dso_local global double, align 8
@s = external dso_local local_unnamed_addr global [609 x double], align 16
@w = external dso_local local_unnamed_addr global [609 x double], align 16
@p = external dso_local global [19 x double], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @T)
  %2 = load i32, ptr @T, align 4, !tbaa !5
  %.not49 = icmp slt i32 %2, 1
  br i1 %.not49, label %._crit_edge53, label %.lr.ph52

._crit_edge53:                                    ; preds = %69, %0
  ret i32 0

.lr.ph52:                                         ; preds = %0, %69
  %.02650 = phi i32 [ %73, %69 ], [ 1, %0 ]
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @k)
  %4 = load i32, ptr @k, align 4, !tbaa !5
  %.not2731 = icmp slt i32 %4, 1
  br i1 %.not2731, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %.lr.ph52
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not2835 = icmp slt i32 %5, 1
  br i1 %.not2835, label %._crit_edge38.thread, label %.lr.ph37

._crit_edge38.thread:                             ; preds = %.preheader
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @s, i64 8), align 8, !tbaa !9
  %6 = load double, ptr getelementptr inbounds (i8, ptr @w, i64 8), align 8, !tbaa !9
  br label %.sink.split

.lr.ph:                                           ; preds = %.lr.ph52, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph52 ]
  %7 = getelementptr inbounds double, ptr @p, i64 %indvars.iv
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i32, ptr @k, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %.not27.not = icmp slt i64 %indvars.iv, %10
  br i1 %.not27.not, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge38:                                    ; preds = %._crit_edge
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @s, i64 8), align 8, !tbaa !9
  %11 = load double, ptr getelementptr inbounds (i8, ptr @w, i64 8), align 8, !tbaa !9
  store double %11, ptr @ans, align 8, !tbaa !9
  %.not2943 = icmp slt i32 %63, 2
  br i1 %.not2943, label %69, label %.lr.ph46

.lr.ph46:                                         ; preds = %._crit_edge38
  %12 = load i32, ptr @k, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph41.us.preheader, label %.lr.ph46.split.preheader

.lr.ph46.split.preheader:                         ; preds = %.lr.ph46
  %14 = add nsw i32 %63, -1
  %15 = zext nneg i32 %14 to i64
  %16 = shl nuw nsw i64 %15, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @s, i64 16), i8 0, i64 %16, i1 false), !tbaa !9
  %17 = add nuw i32 %63, 1
  %wide.trip.count = zext i32 %17 to i64
  %18 = add nsw i64 %wide.trip.count, -2
  %19 = add nsw i64 %wide.trip.count, -3
  %xtraiter = and i64 %18, 3
  %20 = icmp ult i64 %19, 3
  br i1 %20, label %.sink.split.loopexit86.unr-lcssa, label %.lr.ph46.split.preheader.new

.lr.ph46.split.preheader.new:                     ; preds = %.lr.ph46.split.preheader
  %unroll_iter = and i64 %18, -4
  br label %.lr.ph46.split

.lr.ph41.us.preheader:                            ; preds = %.lr.ph46
  %21 = add nsw i32 %12, -1
  %22 = add nsw i32 %63, -2
  %23 = zext i32 %21 to i64
  br label %.lr.ph41.us

.lr.ph41.us:                                      ; preds = %.lr.ph41.us.preheader, %._crit_edge42.us
  %indvar = phi i64 [ 0, %.lr.ph41.us.preheader ], [ %indvar.next, %._crit_edge42.us ]
  %indvars.iv72 = phi i64 [ 2, %.lr.ph41.us.preheader ], [ %indvars.iv.next73, %._crit_edge42.us ]
  %indvars.iv68 = phi i32 [ 0, %.lr.ph41.us.preheader ], [ %indvars.iv.next69, %._crit_edge42.us ]
  %24 = phi double [ %11, %.lr.ph41.us.preheader ], [ %51, %._crit_edge42.us ]
  %umin91 = tail call i64 @llvm.umin.i64(i64 %indvar, i64 %23)
  %25 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %indvars.iv72
  store double 0.000000e+00, ptr %25, align 8, !tbaa !9
  %26 = icmp eq i64 %umin91, 0
  br i1 %26, label %._crit_edge42.us.unr-lcssa, label %.lr.ph41.us.new

.lr.ph41.us.new:                                  ; preds = %.lr.ph41.us
  %27 = add nuw nsw i64 %umin91, 1
  %unroll_iter97 = and i64 %27, 8589934590
  br label %28

28:                                               ; preds = %28, %.lr.ph41.us.new
  %indvars.iv65 = phi i64 [ 1, %.lr.ph41.us.new ], [ %indvars.iv.next66.1, %28 ]
  %29 = phi double [ 0.000000e+00, %.lr.ph41.us.new ], [ %41, %28 ]
  %niter98 = phi i64 [ 0, %.lr.ph41.us.new ], [ %niter98.next.1, %28 ]
  %30 = sub nsw i64 %indvars.iv72, %indvars.iv65
  %31 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds [19 x double], ptr @p, i64 0, i64 %indvars.iv65
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double %29)
  store double %35, ptr %25, align 8, !tbaa !9
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %36 = sub nsw i64 %indvars.iv72, %indvars.iv.next66
  %37 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds [19 x double], ptr @p, i64 0, i64 %indvars.iv.next66
  %40 = load double, ptr %39, align 8, !tbaa !9
  %41 = tail call double @llvm.fmuladd.f64(double %38, double %40, double %35)
  store double %41, ptr %25, align 8, !tbaa !9
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %niter98.next.1 = add i64 %niter98, 2
  %niter98.ncmp.1 = icmp eq i64 %niter98.next.1, %unroll_iter97
  br i1 %niter98.ncmp.1, label %._crit_edge42.us.unr-lcssa, label %28, !llvm.loop !13

._crit_edge42.us.unr-lcssa:                       ; preds = %28, %.lr.ph41.us
  %.lcssa88.ph = phi double [ poison, %.lr.ph41.us ], [ %41, %28 ]
  %indvars.iv65.unr = phi i64 [ 1, %.lr.ph41.us ], [ %indvars.iv.next66.1, %28 ]
  %.unr94 = phi double [ 0.000000e+00, %.lr.ph41.us ], [ %41, %28 ]
  %42 = and i64 %umin91, 1
  %lcmp.mod95.not.not = icmp eq i64 %42, 0
  br i1 %lcmp.mod95.not.not, label %._crit_edge42.us.epilog-lcssa, label %._crit_edge42.us

._crit_edge42.us.epilog-lcssa:                    ; preds = %._crit_edge42.us.unr-lcssa
  %43 = sub nsw i64 %indvars.iv72, %indvars.iv65.unr
  %44 = getelementptr inbounds [609 x double], ptr @s, i64 0, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds [19 x double], ptr @p, i64 0, i64 %indvars.iv65.unr
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = tail call double @llvm.fmuladd.f64(double %45, double %47, double %.unr94)
  store double %48, ptr %25, align 8, !tbaa !9
  br label %._crit_edge42.us

._crit_edge42.us:                                 ; preds = %._crit_edge42.us.unr-lcssa, %._crit_edge42.us.epilog-lcssa
  %.lcssa88 = phi double [ %.lcssa88.ph, %._crit_edge42.us.unr-lcssa ], [ %48, %._crit_edge42.us.epilog-lcssa ]
  %49 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv72
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = tail call double @llvm.fmuladd.f64(double %.lcssa88, double %50, double %24)
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %indvars.iv.next69 = add nuw nsw i32 %indvars.iv68, 1
  %exitcond75.not = icmp eq i32 %indvars.iv68, %22
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond75.not, label %.sink.split, label %.lr.ph41.us, !llvm.loop !14

.lr.ph37:                                         ; preds = %.preheader, %._crit_edge
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %._crit_edge ], [ 1, %.preheader ]
  %52 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %53 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv59
  store double 0.000000e+00, ptr %53, align 8, !tbaa !9
  %54 = load i32, ptr @q, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr @q, align 4, !tbaa !5
  %.not3033 = icmp eq i32 %54, 0
  br i1 %.not3033, label %._crit_edge, label %.lr.ph34

.lr.ph34:                                         ; preds = %.lr.ph37, %.lr.ph34
  %56 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @c, ptr noundef nonnull @x)
  %57 = load double, ptr @c, align 8, !tbaa !9
  %58 = load double, ptr @x, align 8, !tbaa !9
  %59 = load double, ptr %53, align 8, !tbaa !9
  %60 = tail call double @llvm.fmuladd.f64(double %57, double %58, double %59)
  store double %60, ptr %53, align 8, !tbaa !9
  %61 = load i32, ptr @q, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr @q, align 4, !tbaa !5
  %.not30 = icmp eq i32 %61, 0
  br i1 %.not30, label %._crit_edge, label %.lr.ph34, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph34, %.lr.ph37
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not28.not = icmp slt i64 %indvars.iv59, %64
  br i1 %.not28.not, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16

.sink.split.loopexit86.unr-lcssa:                 ; preds = %.lr.ph46.split, %.lr.ph46.split.preheader
  %.lcssa87.ph = phi double [ poison, %.lr.ph46.split.preheader ], [ %87, %.lr.ph46.split ]
  %indvars.iv62.unr = phi i64 [ 2, %.lr.ph46.split.preheader ], [ %indvars.iv.next63.3, %.lr.ph46.split ]
  %.unr = phi double [ %11, %.lr.ph46.split.preheader ], [ %87, %.lr.ph46.split ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.sink.split, label %.lr.ph46.split.epil

.lr.ph46.split.epil:                              ; preds = %.sink.split.loopexit86.unr-lcssa, %.lr.ph46.split.epil
  %indvars.iv62.epil = phi i64 [ %indvars.iv.next63.epil, %.lr.ph46.split.epil ], [ %indvars.iv62.unr, %.sink.split.loopexit86.unr-lcssa ]
  %65 = phi double [ %68, %.lr.ph46.split.epil ], [ %.unr, %.sink.split.loopexit86.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph46.split.epil ], [ 0, %.sink.split.loopexit86.unr-lcssa ]
  %66 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv62.epil
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = tail call double @llvm.fmuladd.f64(double %67, double 0.000000e+00, double %65)
  %indvars.iv.next63.epil = add nuw nsw i64 %indvars.iv62.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.sink.split, label %.lr.ph46.split.epil, !llvm.loop !17

.sink.split:                                      ; preds = %.sink.split.loopexit86.unr-lcssa, %.lr.ph46.split.epil, %._crit_edge42.us, %._crit_edge38.thread
  %.sink = phi double [ %6, %._crit_edge38.thread ], [ %51, %._crit_edge42.us ], [ %.lcssa87.ph, %.sink.split.loopexit86.unr-lcssa ], [ %68, %.lr.ph46.split.epil ]
  store double %.sink, ptr @ans, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %.sink.split, %._crit_edge38
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.02650)
  %71 = load double, ptr @ans, align 8, !tbaa !9
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, double noundef %71)
  %73 = add nuw nsw i32 %.02650, 1
  %74 = load i32, ptr @T, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02650, %74
  br i1 %.not.not, label %.lr.ph52, label %._crit_edge53, !llvm.loop !19

.lr.ph46.split:                                   ; preds = %.lr.ph46.split, %.lr.ph46.split.preheader.new
  %indvars.iv62 = phi i64 [ 2, %.lr.ph46.split.preheader.new ], [ %indvars.iv.next63.3, %.lr.ph46.split ]
  %75 = phi double [ %11, %.lr.ph46.split.preheader.new ], [ %87, %.lr.ph46.split ]
  %niter = phi i64 [ 0, %.lr.ph46.split.preheader.new ], [ %niter.next.3, %.lr.ph46.split ]
  %76 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv62
  %77 = load double, ptr %76, align 16, !tbaa !9
  %78 = tail call double @llvm.fmuladd.f64(double %77, double 0.000000e+00, double %75)
  %indvars.iv.next63 = or disjoint i64 %indvars.iv62, 1
  %79 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv.next63
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = tail call double @llvm.fmuladd.f64(double %80, double 0.000000e+00, double %78)
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %82 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv.next63.1
  %83 = load double, ptr %82, align 16, !tbaa !9
  %84 = tail call double @llvm.fmuladd.f64(double %83, double 0.000000e+00, double %81)
  %indvars.iv.next63.2 = add nuw nsw i64 %indvars.iv62, 3
  %85 = getelementptr inbounds [609 x double], ptr @w, i64 0, i64 %indvars.iv.next63.2
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = tail call double @llvm.fmuladd.f64(double %86, double 0.000000e+00, double %84)
  %indvars.iv.next63.3 = add nuw nsw i64 %indvars.iv62, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.sink.split.loopexit86.unr-lcssa, label %.lr.ph46.split, !llvm.loop !14
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4

attributes #0 = { mustprogress nofree norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass