; LLVM IR from tangjz/acm-icpc :: projecteuler (560)

; 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
@pr = external dso_local global [10000001 x i32], align 16
@d = external dso_local global [10000001 x i32], align 16
@sg = external dso_local global [10000001 x i32], align 16
@mx = external dso_local global i32, align 4
@c = external dso_local global [10000001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(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 nounwind uwtable
declare dso_local void @_Z3FWTPiii(ptr noundef, i32 noundef, i32 noundef) #0

; 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
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  br label %9

9:                                                ; preds = %136, %0
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %11 = icmp eq i32 %10, 2
  br i1 %11, label %12, label %140

12:                                               ; preds = %9
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @d, i8 0, i64 40000004, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @c, i8 0, i64 40000004, i1 false)
  store i32 1, ptr getelementptr inbounds ([10000001 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([10000001 x i32], ptr @sg, i64 0, i64 1), align 4, !tbaa !5
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 1
  %15 = zext i1 %14 to i32
  %16 = shl i32 1, %15
  store i32 %16, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %113, %12
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %47, label %28

28:                                               ; preds = %22
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @tot, align 4, !tbaa !5
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %35
  store i32 %29, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 2
  br i1 %38, label %39, label %40

39:                                               ; preds = %28
  br label %42

40:                                               ; preds = %28
  %41 = load i32, ptr @tot, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %40, %39
  %43 = phi i32 [ 0, %39 ], [ %41, %40 ]
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  br label %58

47:                                               ; preds = %22
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %47, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  br label %59

59:                                               ; preds = %88, %58
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = mul nsw i32 %60, %64
  store i32 %65, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %59
  store i32 7, ptr %5, align 4
  br label %91

69:                                               ; preds = %59
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !5
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp eq i32 %80, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %69
  store i32 7, ptr %5, align 4
  br label %91

87:                                               ; preds = %69
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %6, align 4, !tbaa !5
  br label %59, !llvm.loop !9

91:                                               ; preds = %86, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10000001 x i32], ptr @c, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %98, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %109, %92
  %102 = load i32, ptr @mx, align 4, !tbaa !5
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp sle i32 %102, %106
  br i1 %107, label %108, label %112

108:                                              ; preds = %101
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr @mx, align 4, !tbaa !5
  %111 = shl i32 %110, 1
  store i32 %111, ptr @mx, align 4, !tbaa !5
  br label %101, !llvm.loop !11

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !12

116:                                              ; preds = %21
  %117 = load i32, ptr @mx, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @c, i32 noundef %117, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %133, %116
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = load i32, ptr @mx, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %136

123:                                              ; preds = %118
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [10000001 x i32], ptr @c, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = call noundef i32 @_Z7mod_powii(i32 noundef %127, i32 noundef %128)
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10000001 x i32], ptr @c, i64 0, i64 %131
  store i32 %129, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %123
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %8, align 4, !tbaa !5
  br label %118, !llvm.loop !13

136:                                              ; preds = %122
  %137 = load i32, ptr @mx, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @c, i32 noundef %137, i32 noundef -1)
  %138 = load i32, ptr @c, align 16, !tbaa !5
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %138)
  br label %9, !llvm.loop !14

140:                                              ; preds = %9
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %141 = load i32, ptr %1, align 4
  ret i32 %141
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@d = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@sg = external dso_local local_unnamed_addr global [10000001 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local global [10000001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3FWTPiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %4 = icmp eq i32 %3, 2
  br i1 %4, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %0, %._crit_edge48
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000004) @d, i8 0, i64 40000004, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000004) @c, i8 0, i64 40000004, i1 false)
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @sg, i64 4), align 4, !tbaa !5
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 1
  %7 = zext i1 %6 to i32
  %8 = shl nuw nsw i32 1, %7
  store i32 %8, ptr @mx, align 4, !tbaa !5
  %9 = icmp sgt i32 %5, 2
  br i1 %9, label %.lr.ph43.preheader, label %._crit_edge44

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

._crit_edge44:                                    ; preds = %51, %.lr.ph50
  %10 = phi i32 [ %8, %.lr.ph50 ], [ %.lcssa3638, %51 ]
  call void @_Z3FWTPiii(ptr noundef nonnull @c, i32 noundef %10, i32 noundef 1)
  %11 = load i32, ptr @mx, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph47, label %._crit_edge48

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %51
  %indvars.iv55 = phi i64 [ 2, %.lr.ph43.preheader ], [ %indvars.iv.next56, %51 ]
  %13 = phi i32 [ 0, %.lr.ph43.preheader ], [ %29, %51 ]
  %.lcssa363940 = phi i32 [ %8, %.lr.ph43.preheader ], [ %.lcssa3638, %51 ]
  %14 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %indvars.iv55
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %16, label %23

16:                                               ; preds = %.lr.ph43
  %17 = trunc nuw nsw i64 %indvars.iv55 to i32
  store i32 %17, ptr %14, align 4, !tbaa !5
  %18 = add nsw i32 %13, 1
  store i32 %18, ptr @tot, align 4, !tbaa !5
  %19 = sext i32 %13 to i64
  %20 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %19
  store i32 %17, ptr %20, align 4, !tbaa !5
  %21 = icmp eq i64 %indvars.iv55, 2
  %22 = select i1 %21, i32 0, i32 %18
  br label %27

23:                                               ; preds = %.lr.ph43
  %24 = sext i32 %15 to i64
  %25 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %.pre = trunc nuw nsw i64 %indvars.iv55 to i32
  br label %27

27:                                               ; preds = %23, %16
  %.pre-phi = phi i32 [ %.pre, %23 ], [ %17, %16 ]
  %28 = phi i32 [ %26, %23 ], [ %22, %16 ]
  %29 = phi i32 [ %13, %23 ], [ %18, %16 ]
  %30 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %indvars.iv55
  store i32 %28, ptr %30, align 4
  %31 = load i32, ptr @pr, align 16, !tbaa !5
  %32 = mul nsw i32 %31, %.pre-phi
  %33 = icmp slt i32 %32, %5
  br i1 %33, label %.lr.ph, label %._crit_edge

34:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds [10000001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = mul nsw i32 %36, %.pre-phi
  %38 = icmp slt i32 %37, %5
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %27, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 0, %27 ]
  %39 = phi i32 [ %37, %34 ], [ %32, %27 ]
  %40 = phi i32 [ %36, %34 ], [ %31, %27 ]
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [10000001 x i32], ptr @d, i64 0, i64 %41
  store i32 %40, ptr %42, align 4, !tbaa !5
  %43 = load i32, ptr %14, align 4, !tbaa !5
  %44 = icmp eq i32 %43, %40
  br i1 %44, label %._crit_edge, label %34

._crit_edge:                                      ; preds = %34, %.lr.ph, %27
  %45 = sext i32 %28 to i64
  %46 = getelementptr inbounds [10000001 x i32], ptr @c, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %.not2932 = icmp sgt i32 %.lcssa363940, %28
  br i1 %.not2932, label %51, label %.lr.ph34

.lr.ph34:                                         ; preds = %._crit_edge, %.lr.ph34
  %49 = phi i32 [ %50, %.lr.ph34 ], [ %.lcssa363940, %._crit_edge ]
  %50 = shl i32 %49, 1
  %.not29 = icmp sgt i32 %50, %28
  br i1 %.not29, label %._crit_edge35, label %.lr.ph34, !llvm.loop !11

._crit_edge35:                                    ; preds = %.lr.ph34
  store i32 %50, ptr @mx, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %._crit_edge35, %._crit_edge
  %.lcssa3638 = phi i32 [ %50, %._crit_edge35 ], [ %.lcssa363940, %._crit_edge ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge44, label %.lr.ph43, !llvm.loop !12

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge44
  %.lcssa = phi i32 [ %11, %._crit_edge44 ], [ %60, %.lr.ph47 ]
  call void @_Z3FWTPiii(ptr noundef nonnull @c, i32 noundef %.lcssa, i32 noundef -1)
  %52 = load i32, ptr @c, align 16, !tbaa !5
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %52)
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %55 = icmp eq i32 %54, 2
  br i1 %55, label %.lr.ph50, label %._crit_edge51, !llvm.loop !13

.lr.ph47:                                         ; preds = %._crit_edge44, %.lr.ph47
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph47 ], [ 0, %._crit_edge44 ]
  %56 = getelementptr inbounds [10000001 x i32], ptr @c, i64 0, i64 %indvars.iv58
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = call noundef i32 @_Z7mod_powii(i32 noundef %57, i32 noundef %58)
  store i32 %59, ptr %56, align 4, !tbaa !5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %60 = load i32, ptr @mx, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next59, %61
  br i1 %62, label %.lr.ph47, label %._crit_edge48, !llvm.loop !14

._crit_edge51:                                    ; preds = %._crit_edge48, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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