; LLVM IR from tangjz/acm-icpc :: lydsy (2226)

; 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
@vis = external dso_local global [1000001 x i32], align 16
@prime = external dso_local global [1000001 x i32], align 16
@tot = external dso_local global i32, align 4
@sum = external dso_local global i32, align 4
@f = external dso_local global [1000001 x i32], align 16
@s = external dso_local global [1000001 x i32], align 16
@phi = external dso_local global [1000001 x i64], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %109, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 1000001
  br i1 %7, label %8, label %112

8:                                                ; preds = %5
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %29, label %14

14:                                               ; preds = %8
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @tot, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr @tot, align 4, !tbaa !5
  %18 = sext i32 %16 to i64
  %19 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %18
  store i32 %15, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %21
  store i32 %15, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  %25 = sext i32 %24 to i64
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %27
  store i64 %25, ptr %28, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %14, %8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %105, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %42

34:                                               ; preds = %30
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = mul nsw i32 %35, %39
  %41 = icmp slt i32 %40, 1000001
  br label %42

42:                                               ; preds = %34, %30
  %43 = phi i1 [ false, %30 ], [ %41, %34 ]
  br i1 %43, label %44, label %108

44:                                               ; preds = %42
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = mul nsw i32 %49, %53
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %55
  store i32 %48, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = srem i32 %57, %61
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %83

64:                                               ; preds = %44
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %68, %73
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = mul nsw i32 %75, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %81
  store i64 %74, ptr %82, align 8, !tbaa !9
  br label %108

83:                                               ; preds = %44
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = mul nsw i64 %87, %94
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = mul nsw i32 %96, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %102
  store i64 %95, ptr %103, align 8, !tbaa !9
  br label %104

104:                                              ; preds = %83
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !11

108:                                              ; preds = %64, %42
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %2, align 4, !tbaa !5
  br label %5, !llvm.loop !13

112:                                              ; preds = %5
  store i64 1, ptr getelementptr inbounds ([1000001 x i64], ptr @phi, i64 0, i64 1), align 8, !tbaa !9
  store i32 3, ptr %2, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %128, %112
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = icmp slt i32 %114, 1000001
  br i1 %115, label %116, label %131

116:                                              ; preds = %113
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = mul nsw i64 %120, %122
  %124 = ashr i64 %123, 1
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %126
  store i64 %124, ptr %127, align 8, !tbaa !9
  br label %128

128:                                              ; preds = %116
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %2, align 4, !tbaa !5
  br label %113, !llvm.loop !14

131:                                              ; preds = %113
  %132 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %133

133:                                              ; preds = %171, %131
  %134 = load i32, ptr @t, align 4, !tbaa !5
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr @t, align 4, !tbaa !5
  %136 = icmp ne i32 %134, 0
  br i1 %136, label %137, label %174

137:                                              ; preds = %133
  %138 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i64 0, ptr @ans, align 8, !tbaa !9
  store i32 0, ptr @sum, align 4, !tbaa !5
  %139 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %139, ptr %2, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %170, %137
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 1
  br i1 %142, label %143, label %171

143:                                              ; preds = %140
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  store i32 %147, ptr %3, align 4, !tbaa !5
  %148 = load i32, ptr @sum, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr @sum, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %150
  store i32 %147, ptr %151, align 4, !tbaa !5
  %152 = load i32, ptr @sum, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1000001 x i32], ptr @s, i64 0, i64 %153
  store i32 0, ptr %154, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %164, %143
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = srem i32 %156, %157
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %170

160:                                              ; preds = %155
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = load i32, ptr %2, align 4, !tbaa !5
  %163 = sdiv i32 %162, %161
  store i32 %163, ptr %2, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %160
  %165 = load i32, ptr @sum, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1000001 x i32], ptr @s, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %167, align 4, !tbaa !5
  br label %155, !llvm.loop !15

170:                                              ; preds = %155
  br label %140, !llvm.loop !16

171:                                              ; preds = %140
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 1)
  %172 = load i64, ptr @ans, align 8, !tbaa !9
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %172)
  br label %133, !llvm.loop !17

174:                                              ; preds = %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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
@vis = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@prime = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@sum = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@s = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@phi = external dso_local local_unnamed_addr global [1000001 x i64], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(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 %1

1:                                                ; preds = %0, %.critedge
  %indvars.iv63 = phi i64 [ 2, %0 ], [ %indvars.iv.next64, %.critedge ]
  %2 = phi i32 [ %tot.promoted, %0 ], [ %13, %.critedge ]
  %3 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %indvars.iv63
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %.not38 = icmp eq i32 %4, 0
  br i1 %.not38, label %5, label %12

5:                                                ; preds = %1
  %6 = add nsw i32 %2, 1
  store i32 %6, ptr @tot, align 4, !tbaa !5
  %7 = sext i32 %2 to i64
  %8 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %7
  %9 = trunc nuw nsw i64 %indvars.iv63 to i32
  store i32 %9, ptr %8, align 4, !tbaa !5
  store i32 %9, ptr %3, align 4, !tbaa !5
  %10 = add nsw i64 %indvars.iv63, -1
  %11 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %indvars.iv63
  store i64 %10, ptr %11, align 8, !tbaa !9
  br label %12

12:                                               ; preds = %5, %1
  %13 = phi i32 [ %6, %5 ], [ %2, %1 ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %12
  %15 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %indvars.iv63
  %wide.trip.count = zext nneg i32 %13 to i64
  %16 = trunc nuw nsw i64 %indvars.iv63 to i32
  br label %17

17:                                               ; preds = %.lr.ph, %32
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %32 ]
  %18 = getelementptr inbounds [1000001 x i32], ptr @prime, i64 0, i64 %indvars.iv
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = mul nsw i32 %19, %16
  %21 = icmp slt i32 %20, 1000001
  br i1 %21, label %22, label %.critedge

22:                                               ; preds = %17
  %23 = sext i32 %20 to i64
  %24 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %23
  store i32 %19, ptr %24, align 4, !tbaa !5
  %25 = srem i32 %16, %19
  %26 = icmp eq i32 %25, 0
  %27 = load i64, ptr %15, align 8, !tbaa !9
  %28 = sext i32 %19 to i64
  br i1 %26, label %29, label %32

29:                                               ; preds = %22
  %30 = mul nsw i64 %27, %28
  %31 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %23
  store i64 %30, ptr %31, align 8, !tbaa !9
  br label %.critedge

32:                                               ; preds = %22
  %33 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %28
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = mul nsw i64 %34, %27
  %36 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %23
  store i64 %35, ptr %36, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %17, !llvm.loop !11

.critedge:                                        ; preds = %32, %17, %12, %29
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next64, 1000001
  br i1 %exitcond66.not, label %37, label %1, !llvm.loop !13

37:                                               ; preds = %.critedge
  store i64 1, ptr getelementptr inbounds (i8, ptr @phi, i64 8), align 8, !tbaa !9
  br label %38

38:                                               ; preds = %38, %37
  %indvars.iv67 = phi i64 [ 3, %37 ], [ %indvars.iv.next68.1, %38 ]
  %39 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %indvars.iv67
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = mul nsw i64 %40, %indvars.iv67
  %42 = ashr i64 %41, 1
  store i64 %42, ptr %39, align 8, !tbaa !9
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %43 = getelementptr inbounds [1000001 x i64], ptr @phi, i64 0, i64 %indvars.iv.next68
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = mul nsw i64 %44, %indvars.iv.next68
  %46 = ashr i64 %45, 1
  store i64 %46, ptr %43, align 8, !tbaa !9
  %indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2
  %exitcond70.not.1 = icmp eq i64 %indvars.iv.next68.1, 1000001
  br i1 %exitcond70.not.1, label %47, label %38, !llvm.loop !14

47:                                               ; preds = %38
  %48 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %49 = load i32, ptr @t, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr @t, align 4, !tbaa !5
  %.not53 = icmp eq i32 %49, 0
  br i1 %.not53, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %47, %65
  %51 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i64 0, ptr @ans, align 8, !tbaa !9
  store i32 0, ptr @sum, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %.not3749 = icmp eq i32 %52, 1
  br i1 %.not3749, label %65, label %.lr.ph51

.loopexit:                                        ; preds = %.lr.ph47, %.lr.ph51
  %storemerge.lcssa = phi i32 [ 0, %.lr.ph51 ], [ %61, %.lr.ph47 ]
  %.3.lcssa = phi i32 [ %.250, %.lr.ph51 ], [ %60, %.lr.ph47 ]
  store i32 %storemerge.lcssa, ptr %57, align 4, !tbaa !5
  %.not37 = icmp eq i32 %.3.lcssa, 1
  br i1 %.not37, label %._crit_edge, label %.lr.ph51, !llvm.loop !15

.lr.ph51:                                         ; preds = %.lr.ph55, %.loopexit
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %.loopexit ], [ 0, %.lr.ph55 ]
  %.250 = phi i32 [ %.3.lcssa, %.loopexit ], [ %52, %.lr.ph55 ]
  %53 = sext i32 %.250 to i64
  %54 = getelementptr inbounds [1000001 x i32], ptr @vis, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %56 = getelementptr inbounds [1000001 x i32], ptr @f, i64 0, i64 %indvars.iv.next72
  store i32 %55, ptr %56, align 4, !tbaa !5
  %57 = getelementptr inbounds [1000001 x i32], ptr @s, i64 0, i64 %indvars.iv.next72
  %58 = srem i32 %.250, %55
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %.lr.ph47, label %.loopexit

.lr.ph47:                                         ; preds = %.lr.ph51, %.lr.ph47
  %.346 = phi i32 [ %60, %.lr.ph47 ], [ %.250, %.lr.ph51 ]
  %storemerge45 = phi i32 [ %61, %.lr.ph47 ], [ 0, %.lr.ph51 ]
  %60 = sdiv i32 %.346, %55
  %61 = add nuw nsw i32 %storemerge45, 1
  %62 = srem i32 %60, %55
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %.lr.ph47, label %.loopexit, !llvm.loop !16

._crit_edge:                                      ; preds = %.loopexit
  %64 = trunc nuw nsw i64 %indvars.iv.next72 to i32
  store i32 %64, ptr @sum, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %._crit_edge, %.lr.ph55
  tail call void @_Z3dfsii(i32 noundef 1, i32 noundef 1)
  %66 = load i64, ptr @ans, align 8, !tbaa !9
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %66)
  %68 = load i32, ptr @t, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %68, 0
  br i1 %.not, label %._crit_edge56, label %.lr.ph55, !llvm.loop !17

._crit_edge56:                                    ; preds = %65, %47
  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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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