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

; 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 [31623 x i32], align 16
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@s = external dso_local global [10 x i32], align 16
@c = external dso_local global [10 x i32], align 16
@ans = external dso_local global i32, align 4
@vis = external dso_local global [31623 x i8], 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 uwtable
declare dso_local void @_Z3dfsiiii(i32 noundef, i32 noundef, i32 noundef, i32 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 i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %58, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 31623
  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) #4
  br label %61

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [31623 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 [31623 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) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  br label %25

25:                                               ; preds = %53, %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 %37

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

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

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

40:                                               ; preds = %37
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [31623 x i8], ptr @vis, i64 0, i64 %42
  store i8 1, ptr %43, align 1, !tbaa !9
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = srem i32 %44, %48
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %40
  store i32 5, ptr %3, align 4
  br label %56

52:                                               ; preds = %40
  br label %53

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

56:                                               ; preds = %51, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !15

61:                                               ; preds = %11
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %63

63:                                               ; preds = %162, %61
  %64 = load i32, ptr @t, align 4, !tbaa !5
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr @t, align 4, !tbaa !5
  %66 = icmp ne i32 %64, 0
  br i1 %66, label %67, label %165

67:                                               ; preds = %63
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @a, ptr noundef @b)
  %69 = load i32, ptr @a, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @a, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %71 = load i32, ptr @b, align 4, !tbaa !5
  store i32 %71, ptr %6, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %134, %67
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr @tot, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %88

76:                                               ; preds = %72
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = mul nsw i32 %80, %84
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br label %88

88:                                               ; preds = %76, %72
  %89 = phi i1 [ false, %72 ], [ %87, %76 ]
  br i1 %89, label %91, label %90

90:                                               ; preds = %88
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %137

91:                                               ; preds = %88
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = srem i32 %92, %96
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %133

99:                                               ; preds = %91
  %100 = load i32, ptr @cnt, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %101
  store i32 0, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %112, %99
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = srem i32 %104, %108
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %124

111:                                              ; preds = %103
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = sdiv i32 %117, %116
  store i32 %118, ptr %6, align 4, !tbaa !5
  %119 = load i32, ptr @cnt, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %121, align 4, !tbaa !5
  br label %103, !llvm.loop !16

124:                                              ; preds = %103
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr @cnt, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr @cnt, align 4, !tbaa !5
  %131 = sext i32 %129 to i64
  %132 = getelementptr inbounds [10 x i32], ptr @s, i64 0, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %124, %91
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !17

137:                                              ; preds = %90
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = icmp sgt i32 %138, 1
  br i1 %139, label %140, label %149

140:                                              ; preds = %137
  %141 = load i32, ptr @cnt, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %142
  store i32 1, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = load i32, ptr @cnt, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr @cnt, align 4, !tbaa !5
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds [10 x i32], ptr @s, i64 0, i64 %147
  store i32 %144, ptr %148, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %140, %137
  store i32 1, ptr @ans, align 4, !tbaa !5
  call void @_Z3dfsiiii(i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  %150 = load i32, ptr @ans, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = load i32, ptr @b, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = mul nsw i64 %151, %153
  %155 = srem i64 %154, 1000000007
  %156 = trunc i64 %155 to i32
  store i32 %156, ptr @ans, align 4, !tbaa !5
  %157 = load i32, ptr @ans, align 4, !tbaa !5
  %158 = icmp slt i32 %157, 0
  br i1 %158, label %159, label %162

159:                                              ; preds = %149
  %160 = load i32, ptr @ans, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1000000007
  store i32 %161, ptr @ans, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %159, %149
  %163 = load i32, ptr @ans, align 4, !tbaa !5
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %163)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %63, !llvm.loop !18

165:                                              ; preds = %63
  ret i32 0
}

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

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

attributes #0 = { 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 #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 = { 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 [31623 x i32], align 16
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global [10 x i32], align 16
@c = external dso_local local_unnamed_addr global [10 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [31623 x i8], 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 uwtable
declare dso_local void @_Z3dfsiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

1:                                                ; preds = %.critedge
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @t, align 4, !tbaa !5
  %.not48 = icmp eq i32 %3, 0
  br i1 %.not48, label %._crit_edge51, label %.lr.ph50

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

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

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

.lr.ph.preheader:                                 ; preds = %15
  %18 = zext nneg i32 %16 to i64
  %19 = trunc nuw nsw i64 %indvars.iv54 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 ]
  %20 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %indvars.iv
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = mul nsw i32 %21, %19
  %23 = icmp slt i32 %22, 31623
  br i1 %23, label %24, label %.critedge

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

.critedge:                                        ; preds = %.lr.ph, %24, %15
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next55, 31623
  br i1 %exitcond.not, label %1, label %5, !llvm.loop !15

.lr.ph50:                                         ; preds = %1, %60
  %30 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @a, ptr noundef nonnull @b)
  %31 = load i32, ptr @a, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr @a, align 4, !tbaa !5
  %33 = load i32, ptr @b, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph44.preheader, label %.critedge2

.lr.ph44.preheader:                               ; preds = %.lr.ph50
  %wide.trip.count = zext nneg i32 %34 to i64
  br label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %53
  %indvars.iv57 = phi i64 [ 0, %.lr.ph44.preheader ], [ %indvars.iv.next58, %53 ]
  %.02741 = phi i32 [ %33, %.lr.ph44.preheader ], [ %.2, %53 ]
  %36 = phi i32 [ 0, %.lr.ph44.preheader ], [ %54, %53 ]
  %37 = getelementptr inbounds [31623 x i32], ptr @prime, i64 0, i64 %indvars.iv57
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = mul nsw i32 %38, %38
  %.not32 = icmp sgt i32 %39, %.02741
  br i1 %.not32, label %.critedge2, label %42

.critedge2:                                       ; preds = %.lr.ph44, %53, %.lr.ph50
  %40 = phi i32 [ 0, %.lr.ph50 ], [ %54, %53 ], [ %36, %.lr.ph44 ]
  %.027.lcssa = phi i32 [ %33, %.lr.ph50 ], [ %.2, %53 ], [ %.02741, %.lr.ph44 ]
  %41 = icmp sgt i32 %.027.lcssa, 1
  br i1 %41, label %55, label %60

42:                                               ; preds = %.lr.ph44
  %43 = srem i32 %.02741, %38
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %.lr.ph39.preheader, label %53

.lr.ph39.preheader:                               ; preds = %42
  %45 = sext i32 %36 to i64
  %46 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %45
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %.lr.ph39
  %.138 = phi i32 [ %47, %.lr.ph39 ], [ %.02741, %.lr.ph39.preheader ]
  %storemerge37 = phi i32 [ %48, %.lr.ph39 ], [ 0, %.lr.ph39.preheader ]
  %47 = sdiv i32 %.138, %38
  %48 = add nuw nsw i32 %storemerge37, 1
  %49 = srem i32 %47, %38
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %.lr.ph39, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph39
  store i32 %48, ptr %46, align 4, !tbaa !5
  %51 = add nsw i32 %36, 1
  store i32 %51, ptr @cnt, align 4, !tbaa !5
  %52 = getelementptr inbounds [10 x i32], ptr @s, i64 0, i64 %45
  store i32 %38, ptr %52, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %42, %._crit_edge
  %54 = phi i32 [ %51, %._crit_edge ], [ %36, %42 ]
  %.2 = phi i32 [ %47, %._crit_edge ], [ %.02741, %42 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count
  br i1 %exitcond60.not, label %.critedge2, label %.lr.ph44, !llvm.loop !17

55:                                               ; preds = %.critedge2
  %56 = sext i32 %40 to i64
  %57 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %56
  store i32 1, ptr %57, align 4, !tbaa !5
  %58 = add nsw i32 %40, 1
  store i32 %58, ptr @cnt, align 4, !tbaa !5
  %59 = getelementptr inbounds [10 x i32], ptr @s, i64 0, i64 %56
  store i32 %.027.lcssa, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %55, %.critedge2
  store i32 1, ptr @ans, align 4, !tbaa !5
  tail call void @_Z3dfsiiii(i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 1)
  %61 = load i32, ptr @ans, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = load i32, ptr @b, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = mul nsw i64 %64, %62
  %66 = srem i64 %65, 1000000007
  %67 = trunc nsw i64 %66 to i32
  %68 = icmp slt i64 %66, 0
  %69 = add nsw i32 %67, 1000000007
  %spec.select = select i1 %68, i32 %69, i32 %67
  store i32 %spec.select, ptr @ans, align 4, !tbaa !5
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select)
  %71 = load i32, ptr @t, align 4, !tbaa !5
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %71, 0
  br i1 %.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !18

._crit_edge51:                                    ; preds = %60, %1
  ret i32 0
}

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

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

attributes #0 = { 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 #1 = { 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 #2 = { 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: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass