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

; 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
@pw = external dso_local global [100010 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@pre1x = external dso_local global i32, align 4
@pre1y = external dso_local global i32, align 4
@pre2x = external dso_local global i32, align 4
@pre2y = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@.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 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
  store i32 0, ptr %1, align 4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  store i32 1, ptr @pw, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %32, %0
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp slt i32 %7, 100010
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %35

10:                                               ; preds = %6
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = sub nsw i32 %11, 1
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = shl i32 %15, 1
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %18
  store i32 %16, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp sge i32 %23, 1000000007
  br i1 %24, label %25, label %31

25:                                               ; preds = %10
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1000000007
  store i32 %30, ptr %28, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %25, %10
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %6, !llvm.loop !9

35:                                               ; preds = %9
  br label %36

36:                                               ; preds = %142, %35
  %37 = load i32, ptr @t, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr @t, align 4, !tbaa !5
  %39 = icmp ne i32 %37, 0
  br i1 %39, label %40, label %145

40:                                               ; preds = %36
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @pre2y, align 4, !tbaa !5
  store i32 0, ptr @pre2x, align 4, !tbaa !5
  store i32 0, ptr @pre1y, align 4, !tbaa !5
  store i32 0, ptr @pre1x, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 500000004, ptr %4, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %134, %40
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp sle i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %142

47:                                               ; preds = %42
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @x, ptr noundef @y)
  %49 = load i32, ptr @ans, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = load i32, ptr @x, align 4, !tbaa !5
  %57 = load i32, ptr @y, align 4, !tbaa !5
  %58 = load i32, ptr @pre2x, align 4, !tbaa !5
  %59 = load i32, ptr @pre2y, align 4, !tbaa !5
  %60 = call noundef i32 @_Z3detiiii(i32 noundef %56, i32 noundef %57, i32 noundef %58, i32 noundef %59)
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %55, %61
  %63 = srem i64 %62, 1000000007
  %64 = trunc i64 %63 to i32
  %65 = call noundef i32 @_Z7mod_addii(i32 noundef %49, i32 noundef %64)
  store i32 %65, ptr @ans, align 4, !tbaa !5
  %66 = load i32, ptr @ans, align 4, !tbaa !5
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = icmp eq i32 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %47
  br label %79

71:                                               ; preds = %47
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sub nsw i32 %72, %73
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %71, %70
  %80 = phi i32 [ 500000004, %70 ], [ %78, %71 ]
  %81 = sext i32 %80 to i64
  %82 = load i32, ptr @pre1x, align 4, !tbaa !5
  %83 = load i32, ptr @pre1y, align 4, !tbaa !5
  %84 = load i32, ptr @x, align 4, !tbaa !5
  %85 = load i32, ptr @y, align 4, !tbaa !5
  %86 = call noundef i32 @_Z3detiiii(i32 noundef %82, i32 noundef %83, i32 noundef %84, i32 noundef %85)
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %81, %87
  %89 = srem i64 %88, 1000000007
  %90 = trunc i64 %89 to i32
  %91 = call noundef i32 @_Z7mod_addii(i32 noundef %66, i32 noundef %90)
  store i32 %91, ptr @ans, align 4, !tbaa !5
  %92 = load i32, ptr @pre1x, align 4, !tbaa !5
  %93 = load i32, ptr @x, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = mul nsw i64 %94, %99
  %101 = srem i64 %100, 1000000007
  %102 = trunc i64 %101 to i32
  %103 = call noundef i32 @_Z7mod_addii(i32 noundef %92, i32 noundef %102)
  store i32 %103, ptr @pre1x, align 4, !tbaa !5
  %104 = load i32, ptr @pre1y, align 4, !tbaa !5
  %105 = load i32, ptr @y, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = mul nsw i64 %106, %111
  %113 = srem i64 %112, 1000000007
  %114 = trunc i64 %113 to i32
  %115 = call noundef i32 @_Z7mod_addii(i32 noundef %104, i32 noundef %114)
  store i32 %115, ptr @pre1y, align 4, !tbaa !5
  %116 = load i32, ptr @pre2x, align 4, !tbaa !5
  %117 = load i32, ptr @x, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = mul nsw i64 %118, %120
  %122 = srem i64 %121, 1000000007
  %123 = trunc i64 %122 to i32
  %124 = call noundef i32 @_Z7mod_addii(i32 noundef %116, i32 noundef %123)
  store i32 %124, ptr @pre2x, align 4, !tbaa !5
  %125 = load i32, ptr @pre2y, align 4, !tbaa !5
  %126 = load i32, ptr @y, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = mul nsw i64 %127, %129
  %131 = srem i64 %130, 1000000007
  %132 = trunc i64 %131 to i32
  %133 = call noundef i32 @_Z7mod_addii(i32 noundef %125, i32 noundef %132)
  store i32 %133, ptr @pre2y, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %79
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %3, align 4, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = mul nsw i64 %138, 500000004
  %140 = srem i64 %139, 1000000007
  %141 = trunc i64 %140 to i32
  store i32 %141, ptr %4, align 4, !tbaa !5
  br label %42, !llvm.loop !11

142:                                              ; preds = %46
  %143 = load i32, ptr @ans, align 4, !tbaa !5
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %143)
  br label %36, !llvm.loop !12

145:                                              ; preds = %36
  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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_addii(i32 noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z3detiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

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 = { 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 #4 = { inlinehint 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 #5 = { 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 = distinct !{!12, !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
@pw = external dso_local local_unnamed_addr global [100010 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@pre1x = external dso_local local_unnamed_addr global i32, align 4
@pre1y = external dso_local local_unnamed_addr global i32, align 4
@pre2x = external dso_local local_unnamed_addr global i32, align 4
@pre2y = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@.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 norecurse 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)
  store i32 1, ptr @pw, align 16, !tbaa !5
  br label %4

.preheader:                                       ; preds = %4
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not25 = icmp eq i32 %2, 0
  br i1 %.not25, label %._crit_edge27, label %.lr.ph26

4:                                                ; preds = %10, %0
  %5 = phi i32 [ 1, %0 ], [ %spec.select.1, %10 ]
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next.1, %10 ]
  %6 = shl i32 %5, 1
  %7 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %indvars.iv
  %8 = icmp sgt i32 %6, 1000000006
  %9 = add nsw i32 %6, -1000000007
  %spec.select = select i1 %8, i32 %9, i32 %6
  store i32 %spec.select, ptr %7, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 100010
  br i1 %exitcond.not, label %.preheader, label %10, !llvm.loop !9

10:                                               ; preds = %4
  %11 = shl i32 %spec.select, 1
  %12 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %indvars.iv.next
  %13 = icmp sgt i32 %11, 1000000006
  %14 = add nsw i32 %11, -1000000007
  %spec.select.1 = select i1 %13, i32 %14, i32 %11
  store i32 %spec.select.1, ptr %12, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %4

.lr.ph26:                                         ; preds = %.preheader, %._crit_edge
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr @pre2y, align 4, !tbaa !5
  store i32 0, ptr @pre2x, align 4, !tbaa !5
  store i32 0, ptr @pre1y, align 4, !tbaa !5
  store i32 0, ptr @pre1x, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %.not2022 = icmp slt i32 %16, 1
  br i1 %.not2022, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %47
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph26
  %17 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ 0, %.lr.ph26 ]
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
  %19 = load i32, ptr @t, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %._crit_edge27, label %.lr.ph26, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph26, %47
  %indvars.iv29 = phi i64 [ %indvars.iv.next30, %47 ], [ 1, %.lr.ph26 ]
  %.024 = phi i64 [ %94, %47 ], [ 500000004, %.lr.ph26 ]
  %21 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @x, ptr noundef nonnull @y)
  %22 = load i32, ptr @ans, align 4, !tbaa !5
  %23 = add nsw i64 %indvars.iv29, -1
  %24 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i32, ptr @x, align 4, !tbaa !5
  %28 = load i32, ptr @y, align 4, !tbaa !5
  %29 = load i32, ptr @pre2x, align 4, !tbaa !5
  %30 = load i32, ptr @pre2y, align 4, !tbaa !5
  %31 = tail call noundef i32 @_Z3detiiii(i32 noundef %27, i32 noundef %28, i32 noundef %29, i32 noundef %30)
  %32 = sext i32 %31 to i64
  %33 = mul nsw i64 %32, %26
  %34 = srem i64 %33, 1000000007
  %35 = trunc nsw i64 %34 to i32
  %36 = tail call noundef i32 @_Z7mod_addii(i32 noundef %22, i32 noundef %35)
  store i32 %36, ptr @ans, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = zext i32 %37 to i64
  %39 = icmp eq i64 %indvars.iv29, %38
  br i1 %39, label %47, label %40

40:                                               ; preds = %.lr.ph
  %41 = trunc i64 %indvars.iv29 to i32
  %42 = xor i32 %41, -1
  %43 = add i32 %37, %42
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %.lr.ph, %40
  %48 = phi i32 [ %46, %40 ], [ 500000004, %.lr.ph ]
  %49 = sext i32 %48 to i64
  %50 = load i32, ptr @pre1x, align 4, !tbaa !5
  %51 = load i32, ptr @pre1y, align 4, !tbaa !5
  %52 = load i32, ptr @x, align 4, !tbaa !5
  %53 = load i32, ptr @y, align 4, !tbaa !5
  %54 = tail call noundef i32 @_Z3detiiii(i32 noundef %50, i32 noundef %51, i32 noundef %52, i32 noundef %53)
  %55 = sext i32 %54 to i64
  %56 = mul nsw i64 %55, %49
  %57 = srem i64 %56, 1000000007
  %58 = trunc nsw i64 %57 to i32
  %59 = tail call noundef i32 @_Z7mod_addii(i32 noundef %36, i32 noundef %58)
  store i32 %59, ptr @ans, align 4, !tbaa !5
  %60 = load i32, ptr @pre1x, align 4, !tbaa !5
  %61 = load i32, ptr @x, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i32], ptr @pw, i64 0, i64 %indvars.iv29
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = mul nsw i64 %65, %62
  %67 = srem i64 %66, 1000000007
  %68 = trunc nsw i64 %67 to i32
  %69 = tail call noundef i32 @_Z7mod_addii(i32 noundef %60, i32 noundef %68)
  store i32 %69, ptr @pre1x, align 4, !tbaa !5
  %70 = load i32, ptr @pre1y, align 4, !tbaa !5
  %71 = load i32, ptr @y, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = load i32, ptr %63, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = mul nsw i64 %74, %72
  %76 = srem i64 %75, 1000000007
  %77 = trunc nsw i64 %76 to i32
  %78 = tail call noundef i32 @_Z7mod_addii(i32 noundef %70, i32 noundef %77)
  store i32 %78, ptr @pre1y, align 4, !tbaa !5
  %79 = load i32, ptr @pre2x, align 4, !tbaa !5
  %80 = load i32, ptr @x, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = mul nsw i64 %.024, %81
  %83 = srem i64 %82, 1000000007
  %84 = trunc nsw i64 %83 to i32
  %85 = tail call noundef i32 @_Z7mod_addii(i32 noundef %79, i32 noundef %84)
  store i32 %85, ptr @pre2x, align 4, !tbaa !5
  %86 = load i32, ptr @pre2y, align 4, !tbaa !5
  %87 = load i32, ptr @y, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = mul nsw i64 %.024, %88
  %90 = srem i64 %89, 1000000007
  %91 = trunc nsw i64 %90 to i32
  %92 = tail call noundef i32 @_Z7mod_addii(i32 noundef %86, i32 noundef %91)
  store i32 %92, ptr @pre2y, align 4, !tbaa !5
  %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
  %93 = mul nuw nsw i64 %.024, 500000004
  %94 = urem i64 %93, 1000000007
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %.not20.not = icmp slt i64 %indvars.iv29, %96
  br i1 %.not20.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge27:                                    ; preds = %._crit_edge, %.preheader
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_addii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z3detiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 = { 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 #3 = { inlinehint 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" }

!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 = distinct !{!12, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass