; LLVM IR from tangjz/acm-icpc :: 51nod (1363)

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

@tot = external dso_local global i32, align 4
@prime = external dso_local global [100000 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@seq = external dso_local global [100000 x [2 x i32]], align 16
@ans = external dso_local global i32, align 4
@vis = external dso_local global [100000 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

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

8:                                                ; preds = %65, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 100000
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !9, !range !11, !noundef !12
  %17 = trunc i8 %16 to i1
  br i1 %17, label %24, label %18

18:                                               ; preds = %12
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @tot, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @tot, align 4, !tbaa !5
  %22 = sext i32 %20 to i64
  %23 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %22
  store i32 %19, ptr %23, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %18, %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %60, %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load i32, ptr @tot, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = mul nsw i64 %31, %36
  %38 = icmp slt i64 %37, 100000
  br label %39

39:                                               ; preds = %29, %25
  %40 = phi i1 [ false, %25 ], [ %38, %29 ]
  br i1 %40, label %42, label %41

41:                                               ; preds = %39
  store i32 5, ptr %3, align 4
  br label %63

42:                                               ; preds = %39
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = mul nsw i32 %43, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %49
  store i8 1, ptr %50, align 1, !tbaa !9
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = srem i32 %51, %55
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %42
  store i32 5, ptr %3, align 4
  br label %63

59:                                               ; preds = %42
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %4, align 4, !tbaa !5
  br label %25, !llvm.loop !13

63:                                               ; preds = %58, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !15

68:                                               ; preds = %11
  br label %69

69:                                               ; preds = %162, %68
  %70 = load i32, ptr @t, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr @t, align 4, !tbaa !5
  %72 = icmp ne i32 %70, 0
  br i1 %72, label %73, label %172

73:                                               ; preds = %69
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %75, ptr %5, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %145, %73
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i32, ptr @tot, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %95

80:                                               ; preds = %76
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = mul nsw i64 %85, %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = icmp sle i64 %91, %93
  br label %95

95:                                               ; preds = %80, %76
  %96 = phi i1 [ false, %76 ], [ %94, %80 ]
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %95
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = srem i32 %99, %103
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %144

106:                                              ; preds = %98
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr @cnt, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %112
  %114 = getelementptr inbounds [2 x i32], ptr %113, i64 0, i64 0
  store i32 %110, ptr %114, align 8, !tbaa !5
  %115 = load i32, ptr @cnt, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %116
  %118 = getelementptr inbounds [2 x i32], ptr %117, i64 0, i64 1
  store i32 0, ptr %118, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %134, %106
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = srem i32 %120, %124
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %127, label %141

127:                                              ; preds = %119
  %128 = load i32, ptr @cnt, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %129
  %131 = getelementptr inbounds [2 x i32], ptr %130, i64 0, i64 1
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %131, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %127
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = sdiv i32 %139, %138
  store i32 %140, ptr %5, align 4, !tbaa !5
  br label %119, !llvm.loop !16

141:                                              ; preds = %119
  %142 = load i32, ptr @cnt, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr @cnt, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %141, %98
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %6, align 4, !tbaa !5
  br label %76, !llvm.loop !17

148:                                              ; preds = %97
  %149 = load i32, ptr %5, align 4, !tbaa !5
  %150 = icmp sgt i32 %149, 1
  br i1 %150, label %151, label %162

151:                                              ; preds = %148
  %152 = load i32, ptr %5, align 4, !tbaa !5
  %153 = load i32, ptr @cnt, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %154
  %156 = getelementptr inbounds [2 x i32], ptr %155, i64 0, i64 0
  store i32 %152, ptr %156, align 8, !tbaa !5
  %157 = load i32, ptr @cnt, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr @cnt, align 4, !tbaa !5
  %159 = sext i32 %157 to i64
  %160 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %159
  %161 = getelementptr inbounds [2 x i32], ptr %160, i64 0, i64 1
  store i32 1, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %151, %148
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 1, i32 noundef 1)
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef 1)
  %163 = load i32, ptr @ans, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = load i32, ptr @n, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 %164, %166
  %168 = srem i64 %167, 1000000007
  %169 = trunc i64 %168 to i32
  store i32 %169, ptr @ans, align 4, !tbaa !5
  %170 = load i32, ptr @ans, align 4, !tbaa !5
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %170)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %69, !llvm.loop !18

172:                                              ; preds = %69
  ret i32 0
}

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

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

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [100000 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [100000 x [2 x i32]], align 16
@ans = external dso_local global i32, align 4
@vis = external dso_local local_unnamed_addr global [100000 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %4

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

4:                                                ; preds = %0, %.critedge
  %indvars.iv50 = phi i64 [ 2, %0 ], [ %indvars.iv.next51, %.critedge ]
  %5 = phi i32 [ %tot.promoted, %0 ], [ %15, %.critedge ]
  %6 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %indvars.iv50
  %7 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %14, label %9

9:                                                ; preds = %4
  %10 = add nsw i32 %5, 1
  store i32 %10, ptr @tot, align 4, !tbaa !5
  %11 = sext i32 %5 to i64
  %12 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %11
  %13 = trunc nuw nsw i64 %indvars.iv50 to i32
  store i32 %13, ptr %12, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %9, %4
  %15 = phi i32 [ %10, %9 ], [ %5, %4 ]
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %14
  %17 = zext nneg i32 %15 to i64
  %18 = trunc nuw nsw i64 %indvars.iv50 to i32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %24 ]
  %19 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %indvars.iv
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = mul nsw i64 %indvars.iv50, %21
  %23 = icmp slt i64 %22, 100000
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %.lr.ph
  %25 = mul nsw i32 %20, %18
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100000 x i8], ptr @vis, i64 0, i64 %26
  store i8 1, ptr %27, align 1, !tbaa !9
  %28 = srem i32 %18, %20
  %29 = icmp ne i32 %28, 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = icmp ult i64 %indvars.iv.next, %17
  %or.cond = select i1 %29, i1 %30, i1 false
  br i1 %or.cond, label %.lr.ph, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %.lr.ph, %24, %14
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next51, 100000
  br i1 %exitcond.not, label %.preheader, label %4, !llvm.loop !15

.lr.ph46:                                         ; preds = %.preheader, %64
  %31 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %32 = load i32, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph41.preheader, label %.critedge2

.lr.ph41.preheader:                               ; preds = %.lr.ph46
  %wide.trip.count = zext nneg i32 %33 to i64
  br label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %57
  %indvars.iv53 = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next54, %57 ]
  %.02838 = phi i32 [ %32, %.lr.ph41.preheader ], [ %.2, %57 ]
  %35 = phi i32 [ 0, %.lr.ph41.preheader ], [ %58, %57 ]
  %36 = getelementptr inbounds [100000 x i32], ptr @prime, i64 0, i64 %indvars.iv53
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = mul nsw i64 %38, %38
  %40 = sext i32 %.02838 to i64
  %.not31 = icmp sgt i64 %39, %40
  br i1 %.not31, label %.critedge2, label %43

.critedge2:                                       ; preds = %.lr.ph41, %57, %.lr.ph46
  %41 = phi i32 [ 0, %.lr.ph46 ], [ %58, %57 ], [ %35, %.lr.ph41 ]
  %.028.lcssa = phi i32 [ %32, %.lr.ph46 ], [ %.2, %57 ], [ %.02838, %.lr.ph41 ]
  %42 = icmp sgt i32 %.028.lcssa, 1
  br i1 %42, label %59, label %64

43:                                               ; preds = %.lr.ph41
  %44 = srem i32 %.02838, %37
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %.lr.ph37, label %57

.lr.ph37:                                         ; preds = %43
  %46 = sext i32 %35 to i64
  %47 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %46
  store i32 %37, ptr %47, align 8, !tbaa !5
  %48 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %46, i64 1
  br label %49

49:                                               ; preds = %.lr.ph37, %49
  %50 = phi i32 [ 0, %.lr.ph37 ], [ %51, %49 ]
  %.136 = phi i32 [ %.02838, %.lr.ph37 ], [ %52, %49 ]
  %51 = add nuw nsw i32 %50, 1
  %52 = sdiv i32 %.136, %37
  %53 = srem i32 %52, %37
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %49, label %55, !llvm.loop !16

55:                                               ; preds = %49
  store i32 %51, ptr %48, align 4, !tbaa !5
  %56 = add nsw i32 %35, 1
  store i32 %56, ptr @cnt, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %43, %55
  %58 = phi i32 [ %56, %55 ], [ %35, %43 ]
  %.2 = phi i32 [ %52, %55 ], [ %.02838, %43 ]
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond56.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
  br i1 %exitcond56.not, label %.critedge2, label %.lr.ph41, !llvm.loop !17

59:                                               ; preds = %.critedge2
  %60 = sext i32 %41 to i64
  %61 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %60
  store i32 %.028.lcssa, ptr %61, align 8, !tbaa !5
  %62 = add nsw i32 %41, 1
  store i32 %62, ptr @cnt, align 4, !tbaa !5
  %63 = getelementptr inbounds [100000 x [2 x i32]], ptr @seq, i64 0, i64 %60, i64 1
  store i32 1, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %59, %.critedge2
  tail call void @_Z3dfsiii(i32 noundef 0, i32 noundef 1, i32 noundef 1)
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef 1)
  %65 = load i32, ptr @ans, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = mul nsw i64 %68, %66
  %70 = srem i64 %69, 1000000007
  %71 = trunc nsw i64 %70 to i32
  store i32 %71, ptr @ans, align 4, !tbaa !5
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %71)
  %73 = load i32, ptr @t, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %73, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !18

._crit_edge47:                                    ; preds = %64, %.preheader
  ret i32 0
}

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

; 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 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 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 = { 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" }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass