; LLVM IR from tangjz/acm-icpc :: hdu (6750)

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

@f = external dso_local global [1000001 x i32], 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z1sx(i64 noundef) #0

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([1000001 x i32], ptr @f, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %46, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 1000001
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  store i32 %20, ptr %4, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %35, %17
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 1000001
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %39

25:                                               ; preds = %21
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sub nsw i32 %33, %29
  store i32 %34, ptr %32, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %25
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr %4, align 4, !tbaa !5
  br label %21, !llvm.loop !9

39:                                               ; preds = %24
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = mul nsw i32 %44, %40
  store i32 %45, ptr %43, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %39
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

49:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  br label %51

51:                                               ; preds = %145, %49
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %5, align 4, !tbaa !5
  %54 = icmp ne i32 %52, 0
  br i1 %54, label %55, label %148

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %57 = load i64, ptr %6, align 8, !tbaa !12
  %58 = sitofp i64 %57 to x86_fp80
  %59 = call x86_fp80 @sqrtl(x86_fp80 noundef %58) #6
  %60 = call noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef %59)
  %61 = fptosi x86_fp80 %60 to i32
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %71, %55
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = mul nsw i64 %64, %66
  %68 = load i64, ptr %6, align 8, !tbaa !12
  %69 = icmp sle i64 %67, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %62
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !5
  br label %62, !llvm.loop !14

74:                                               ; preds = %62
  br label %75

75:                                               ; preds = %84, %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %77, %79
  %81 = load i64, ptr %6, align 8, !tbaa !12
  %82 = icmp sgt i64 %80, %81
  br i1 %82, label %83, label %87

83:                                               ; preds = %75
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %8, align 4, !tbaa !5
  br label %75, !llvm.loop !15

87:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %136, %87
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %139

93:                                               ; preds = %88
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  br label %136

100:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %101 = load i64, ptr %6, align 8, !tbaa !12
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = sdiv i64 %101, %103
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = sdiv i64 %104, %106
  store i64 %107, ptr %12, align 8, !tbaa !12
  %108 = load i64, ptr %9, align 8, !tbaa !12
  %109 = load i64, ptr %12, align 8, !tbaa !12
  %110 = icmp ne i64 %108, %109
  br i1 %110, label %111, label %115

111:                                              ; preds = %100
  %112 = load i64, ptr %12, align 8, !tbaa !12
  store i64 %112, ptr %9, align 8, !tbaa !12
  %113 = load i64, ptr %12, align 8, !tbaa !12
  %114 = call noundef i32 @_Z1sx(i64 noundef %113)
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %111, %100
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %135

121:                                              ; preds = %115
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = mul nsw i64 %128, %130
  %132 = add nsw i64 %123, %131
  %133 = srem i64 %132, 1000000007
  %134 = trunc i64 %133 to i32
  store i32 %134, ptr %7, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %121, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %136

136:                                              ; preds = %135, %99
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %11, align 4, !tbaa !5
  br label %88, !llvm.loop !16

139:                                              ; preds = %92
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1000000007
  store i32 %144, ptr %7, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %142, %139
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %146)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %51, !llvm.loop !17

148:                                              ; preds = %51
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %149 = load i32, ptr %1, align 4
  ret i32 %149
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef) #4

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #5

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

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

@f = external dso_local local_unnamed_addr global [1000001 x i32], 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z1sx(i64 noundef) local_unnamed_addr #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  store i32 1, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  br label %7

3:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  store i32 %6, ptr %1, align 4, !tbaa !5
  %.not63 = icmp eq i32 %5, 0
  br i1 %.not63, label %._crit_edge66, label %.lr.ph65

7:                                                ; preds = %0, %._crit_edge
  %indvars.iv67 = phi i64 [ 1, %0 ], [ %indvars.iv.next68, %._crit_edge ]
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %._crit_edge ]
  %8 = icmp ult i64 %indvars.iv67, 500001
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %9 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv67
  br label %14

._crit_edge:                                      ; preds = %14, %7
  %10 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv67
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = trunc nuw nsw i64 %indvars.iv67 to i32
  %13 = mul nsw i32 %11, %12
  store i32 %13, ptr %10, align 4, !tbaa !5
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not = icmp eq i64 %indvars.iv.next68, 1000001
  br i1 %exitcond.not, label %3, label %7, !llvm.loop !9

14:                                               ; preds = %.lr.ph, %14
  %indvars.iv69 = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next70, %14 ]
  %15 = load i32, ptr %9, align 4, !tbaa !5
  %16 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv69
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = sub nsw i32 %17, %15
  store i32 %18, ptr %16, align 4, !tbaa !5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, %indvars.iv67
  %19 = icmp ult i64 %indvars.iv.next70, 1000001
  br i1 %19, label %14, label %._crit_edge, !llvm.loop !11

.lr.ph65:                                         ; preds = %3, %._crit_edge62.thread
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %21 = load i64, ptr %2, align 8, !tbaa !12
  %22 = sitofp i64 %21 to x86_fp80
  %23 = call x86_fp80 @sqrtl(x86_fp80 noundef %22) #6
  %24 = call noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef %23)
  %25 = fptosi x86_fp80 %24 to i32
  %26 = load i64, ptr %2, align 8, !tbaa !12
  %27 = sext i32 %25 to i64
  br label %28

28:                                               ; preds = %28, %.lr.ph65
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %28 ], [ %27, %.lr.ph65 ]
  %29 = mul nsw i64 %indvars.iv73, %indvars.iv73
  %.not48 = icmp sgt i64 %29, %26
  %indvars.iv.next74 = add nsw i64 %indvars.iv73, 1
  br i1 %.not48, label %.preheader53, label %28, !llvm.loop !14

.preheader53:                                     ; preds = %28, %.preheader53
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.preheader53 ], [ %indvars.iv73, %28 ]
  %30 = mul nsw i64 %indvars.iv76, %indvars.iv76
  %31 = icmp sgt i64 %30, %26
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, -1
  br i1 %31, label %.preheader53, label %.preheader, !llvm.loop !15

.preheader:                                       ; preds = %.preheader53
  %.not4956 = icmp slt i64 %indvars.iv76, 1
  br i1 %.not4956, label %._crit_edge62.thread, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %.preheader
  %sext = shl i64 %indvars.iv76, 32
  %32 = ashr exact i64 %sext, 32
  br label %.lr.ph61

._crit_edge62:                                    ; preds = %55
  %33 = icmp slt i32 %.243.fr, 0
  %34 = add nsw i32 %.243.fr, 1000000007
  %spec.select = select i1 %33, i32 %34, i32 %.243.fr
  br label %._crit_edge62.thread

._crit_edge62.thread:                             ; preds = %._crit_edge62, %.preheader
  %35 = phi i32 [ 0, %.preheader ], [ %spec.select, %._crit_edge62 ]
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !16

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %55
  %indvars.iv79 = phi i64 [ 1, %.lr.ph61.preheader ], [ %indvars.iv.next80, %55 ]
  %.03559 = phi i32 [ 0, %.lr.ph61.preheader ], [ %.2, %55 ]
  %.03658 = phi i64 [ 0, %.lr.ph61.preheader ], [ %.238, %55 ]
  %.04157 = phi i32 [ 0, %.lr.ph61.preheader ], [ %.243.fr, %55 ]
  %39 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv79
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not50 = icmp eq i32 %40, 0
  br i1 %.not50, label %55, label %41

41:                                               ; preds = %.lr.ph61
  %42 = load i64, ptr %2, align 8, !tbaa !12
  %43 = sdiv i64 %42, %indvars.iv79
  %44 = sdiv i64 %43, %indvars.iv79
  %.not51 = icmp eq i64 %.03658, %44
  br i1 %.not51, label %.thread, label %45

45:                                               ; preds = %41
  %46 = call noundef i32 @_Z1sx(i64 noundef %44)
  %.pre = load i32, ptr %39, align 4, !tbaa !5
  %.not52 = icmp eq i32 %.pre, 0
  br i1 %.not52, label %55, label %.thread

.thread:                                          ; preds = %41, %45
  %.188 = phi i32 [ %46, %45 ], [ %.03559, %41 ]
  %.13787 = phi i64 [ %44, %45 ], [ %.03658, %41 ]
  %47 = phi i32 [ %.pre, %45 ], [ %40, %41 ]
  %48 = sext i32 %.04157 to i64
  %49 = sext i32 %47 to i64
  %50 = sext i32 %.188 to i64
  %51 = mul nsw i64 %49, %50
  %52 = add nsw i64 %51, %48
  %53 = srem i64 %52, 1000000007
  %54 = trunc nsw i64 %53 to i32
  br label %55

55:                                               ; preds = %45, %.thread, %.lr.ph61
  %.243 = phi i32 [ %.04157, %.lr.ph61 ], [ %54, %.thread ], [ %.04157, %45 ]
  %.238 = phi i64 [ %.03658, %.lr.ph61 ], [ %.13787, %.thread ], [ %44, %45 ]
  %.2 = phi i32 [ %.03559, %.lr.ph61 ], [ %.188, %.thread ], [ %46, %45 ]
  %.243.fr = freeze i32 %.243
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %.not49.not = icmp slt i64 %indvars.iv79, %32
  br i1 %.not49.not, label %.lr.ph61, label %._crit_edge62, !llvm.loop !17

._crit_edge66:                                    ; preds = %._crit_edge62.thread, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4ceile(x86_fp80 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare x86_fp80 @sqrtl(x86_fp80 noundef) local_unnamed_addr #5

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass