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

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

@sg = external dso_local global [10000001 x i32], align 16
@mx = external dso_local global i32, align 4
@c = external dso_local global [65 x i32], align 16
@vis = external dso_local global [10000001 x [65 x i8]], align 16
@.str = external hidden unnamed_addr constant [7 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_powix(i32 noundef, i64 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 i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca [65 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = 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 8, ptr %3) #5
  br label %13

13:                                               ; preds = %166, %0
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %15 = icmp eq i32 %14, 2
  br i1 %15, label %16, label %169

16:                                               ; preds = %13
  store i32 1, ptr @mx, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @c, i8 0, i64 260, i1 false)
  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 = %128, %16
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sle 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 %131

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [10000001 x [65 x i8]], ptr @vis, i64 0, i64 %24
  %26 = getelementptr inbounds [65 x i8], ptr %25, i64 0, i64 0
  store ptr %26, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 65, ptr %7) #5
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 65, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %62, %22
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 65
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %65

31:                                               ; preds = %27
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %32, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !11, !range !13, !noundef !14
  %37 = trunc i8 %36 to i1
  br i1 %37, label %38, label %61

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %57, %38
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 65
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %60

43:                                               ; preds = %39
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %44, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !11, !range !13, !noundef !14
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %56

50:                                               ; preds = %43
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = xor i32 %51, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [65 x i8], ptr %7, i64 0, i64 %54
  store i8 1, ptr %55, align 1, !tbaa !11
  br label %56

56:                                               ; preds = %50, %43
  br label %57

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

60:                                               ; preds = %42
  br label %61

61:                                               ; preds = %60, %31
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !5
  br label %27, !llvm.loop !17

65:                                               ; preds = %30
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %67
  store i32 0, ptr %68, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %79, %65
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [65 x i8], ptr %7, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !11, !range !13, !noundef !14
  %77 = trunc i8 %76 to i1
  br i1 %77, label %78, label %85

78:                                               ; preds = %69
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %82, align 4, !tbaa !5
  br label %69, !llvm.loop !18

85:                                               ; preds = %69
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [65 x i32], ptr @c, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %91, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %102, %85
  %95 = load i32, ptr @mx, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp sle i32 %95, %99
  br i1 %100, label %101, label %105

101:                                              ; preds = %94
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr @mx, align 4, !tbaa !5
  %104 = shl i32 %103, 1
  store i32 %104, ptr @mx, align 4, !tbaa !5
  br label %94, !llvm.loop !19

105:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = shl i32 %106, 1
  store i32 %107, ptr %10, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %123, %105
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %127

113:                                              ; preds = %108
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10000001 x [65 x i8]], ptr @vis, i64 0, i64 %115
  %117 = load i32, ptr %4, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [65 x i8], ptr %116, i64 0, i64 %121
  store i8 1, ptr %122, align 1, !tbaa !11
  br label %123

123:                                              ; preds = %113
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = add nsw i32 %125, %124
  store i32 %126, ptr %10, align 4, !tbaa !5
  br label %108, !llvm.loop !20

127:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 65, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !21

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

133:                                              ; preds = %148, %131
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = load i32, ptr @mx, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %151

138:                                              ; preds = %133
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [65 x i32], ptr @c, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = load i64, ptr %3, align 8, !tbaa !22
  %144 = call noundef i32 @_Z7mod_powix(i32 noundef %142, i64 noundef %143)
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [65 x i32], ptr @c, i64 0, i64 %146
  store i32 %144, ptr %147, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %138
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %11, align 4, !tbaa !5
  br label %133, !llvm.loop !24

151:                                              ; preds = %137
  %152 = load i32, ptr @mx, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @c, i32 noundef %152, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %153 = load i32, ptr %2, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  %155 = load i64, ptr %3, align 8, !tbaa !22
  %156 = call noundef i32 @_Z7mod_powix(i32 noundef %154, i64 noundef %155)
  %157 = load i32, ptr @c, align 16, !tbaa !5
  %158 = sub nsw i32 %156, %157
  store i32 %158, ptr %12, align 4, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = icmp slt i32 %159, 0
  br i1 %160, label %161, label %164

161:                                              ; preds = %151
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = add nsw i32 %162, 987654321
  br label %166

164:                                              ; preds = %151
  %165 = load i32, ptr %12, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %164, %161
  %167 = phi i32 [ %163, %161 ], [ %165, %164 ]
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %167)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %13, !llvm.loop !25

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

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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = !{!23, !23, i64 0}
!23 = !{!"long long", !7, i64 0}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}


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

@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 [65 x i32], align 16
@vis = external dso_local local_unnamed_addr global [10000001 x [65 x i8]], align 16
@.str = external hidden unnamed_addr constant [7 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_powix(i32 noundef, i64 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 i64, align 8
  %3 = alloca [65 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %.lr.ph64, label %._crit_edge65

.lr.ph64:                                         ; preds = %0, %._crit_edge62
  store i32 1, ptr @mx, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(260) @c, i8 0, i64 260, i1 false)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not53 = icmp slt i32 %6, 2
  br i1 %.not53, label %._crit_edge58, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %.lr.ph64
  %7 = zext nneg i32 %6 to i64
  %8 = add nuw i32 %6, 1
  %wide.trip.count = zext i32 %8 to i64
  br label %.lr.ph57

._crit_edge58:                                    ; preds = %._crit_edge49, %.lr.ph64
  %9 = phi i32 [ 1, %.lr.ph64 ], [ %.lcssa4451, %._crit_edge49 ]
  call void @_Z3FWTPiii(ptr noundef nonnull @c, i32 noundef %9, i32 noundef 1)
  %10 = load i32, ptr @mx, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph61, label %._crit_edge62

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %._crit_edge49
  %indvars.iv78 = phi i64 [ 2, %.lr.ph57.preheader ], [ %indvars.iv.next79, %._crit_edge49 ]
  %indvars.iv76 = phi i32 [ 4, %.lr.ph57.preheader ], [ %indvars.iv.next77, %._crit_edge49 ]
  %.lcssa445254 = phi i32 [ 1, %.lr.ph57.preheader ], [ %.lcssa4451, %._crit_edge49 ]
  %12 = sext i32 %indvars.iv76 to i64
  %13 = getelementptr inbounds [10000001 x [65 x i8]], ptr @vis, i64 0, i64 %indvars.iv78
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(65) %3, i8 0, i64 65, i1 false)
  %14 = getelementptr inbounds i8, ptr %13, i64 64
  br label %15

15:                                               ; preds = %.lr.ph57, %.loopexit
  %indvars.iv69 = phi i64 [ 0, %.lr.ph57 ], [ %indvars.iv.next70, %.loopexit ]
  %16 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv69
  %17 = load i8, ptr %16, align 1, !tbaa !9, !range !11, !noundef !12
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %vector.body, label %.loopexit

vector.body:                                      ; preds = %15, %pred.store.continue120
  %index = phi i64 [ %index.next, %pred.store.continue120 ], [ 0, %15 ]
  %19 = getelementptr inbounds i8, ptr %13, i64 %index
  %wide.load = load <16 x i8>, ptr %19, align 1, !tbaa !9
  %20 = trunc <16 x i8> %wide.load to <16 x i1>
  %21 = extractelement <16 x i1> %20, i64 0
  br i1 %21, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %22 = xor i64 %index, %indvars.iv69
  %23 = and i64 %22, 4294967295
  %24 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %23
  store i8 1, ptr %24, align 1, !tbaa !9
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %25 = extractelement <16 x i1> %20, i64 1
  br i1 %25, label %pred.store.if91, label %pred.store.continue92

pred.store.if91:                                  ; preds = %pred.store.continue
  %26 = or disjoint i64 %index, 1
  %27 = xor i64 %26, %indvars.iv69
  %28 = and i64 %27, 4294967295
  %29 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %28
  store i8 1, ptr %29, align 1, !tbaa !9
  br label %pred.store.continue92

pred.store.continue92:                            ; preds = %pred.store.if91, %pred.store.continue
  %30 = extractelement <16 x i1> %20, i64 2
  br i1 %30, label %pred.store.if93, label %pred.store.continue94

pred.store.if93:                                  ; preds = %pred.store.continue92
  %31 = or disjoint i64 %index, 2
  %32 = xor i64 %31, %indvars.iv69
  %33 = and i64 %32, 4294967295
  %34 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !9
  br label %pred.store.continue94

pred.store.continue94:                            ; preds = %pred.store.if93, %pred.store.continue92
  %35 = extractelement <16 x i1> %20, i64 3
  br i1 %35, label %pred.store.if95, label %pred.store.continue96

pred.store.if95:                                  ; preds = %pred.store.continue94
  %36 = or disjoint i64 %index, 3
  %37 = xor i64 %36, %indvars.iv69
  %38 = and i64 %37, 4294967295
  %39 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %38
  store i8 1, ptr %39, align 1, !tbaa !9
  br label %pred.store.continue96

pred.store.continue96:                            ; preds = %pred.store.if95, %pred.store.continue94
  %40 = extractelement <16 x i1> %20, i64 4
  br i1 %40, label %pred.store.if97, label %pred.store.continue98

pred.store.if97:                                  ; preds = %pred.store.continue96
  %41 = or disjoint i64 %index, 4
  %42 = xor i64 %41, %indvars.iv69
  %43 = and i64 %42, 4294967295
  %44 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %43
  store i8 1, ptr %44, align 1, !tbaa !9
  br label %pred.store.continue98

pred.store.continue98:                            ; preds = %pred.store.if97, %pred.store.continue96
  %45 = extractelement <16 x i1> %20, i64 5
  br i1 %45, label %pred.store.if99, label %pred.store.continue100

pred.store.if99:                                  ; preds = %pred.store.continue98
  %46 = or disjoint i64 %index, 5
  %47 = xor i64 %46, %indvars.iv69
  %48 = and i64 %47, 4294967295
  %49 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %48
  store i8 1, ptr %49, align 1, !tbaa !9
  br label %pred.store.continue100

pred.store.continue100:                           ; preds = %pred.store.if99, %pred.store.continue98
  %50 = extractelement <16 x i1> %20, i64 6
  br i1 %50, label %pred.store.if101, label %pred.store.continue102

pred.store.if101:                                 ; preds = %pred.store.continue100
  %51 = or disjoint i64 %index, 6
  %52 = xor i64 %51, %indvars.iv69
  %53 = and i64 %52, 4294967295
  %54 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %53
  store i8 1, ptr %54, align 1, !tbaa !9
  br label %pred.store.continue102

pred.store.continue102:                           ; preds = %pred.store.if101, %pred.store.continue100
  %55 = extractelement <16 x i1> %20, i64 7
  br i1 %55, label %pred.store.if103, label %pred.store.continue104

pred.store.if103:                                 ; preds = %pred.store.continue102
  %56 = or disjoint i64 %index, 7
  %57 = xor i64 %56, %indvars.iv69
  %58 = and i64 %57, 4294967295
  %59 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %58
  store i8 1, ptr %59, align 1, !tbaa !9
  br label %pred.store.continue104

pred.store.continue104:                           ; preds = %pred.store.if103, %pred.store.continue102
  %60 = extractelement <16 x i1> %20, i64 8
  br i1 %60, label %pred.store.if105, label %pred.store.continue106

pred.store.if105:                                 ; preds = %pred.store.continue104
  %61 = or disjoint i64 %index, 8
  %62 = xor i64 %61, %indvars.iv69
  %63 = and i64 %62, 4294967295
  %64 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %63
  store i8 1, ptr %64, align 1, !tbaa !9
  br label %pred.store.continue106

pred.store.continue106:                           ; preds = %pred.store.if105, %pred.store.continue104
  %65 = extractelement <16 x i1> %20, i64 9
  br i1 %65, label %pred.store.if107, label %pred.store.continue108

pred.store.if107:                                 ; preds = %pred.store.continue106
  %66 = or disjoint i64 %index, 9
  %67 = xor i64 %66, %indvars.iv69
  %68 = and i64 %67, 4294967295
  %69 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %68
  store i8 1, ptr %69, align 1, !tbaa !9
  br label %pred.store.continue108

pred.store.continue108:                           ; preds = %pred.store.if107, %pred.store.continue106
  %70 = extractelement <16 x i1> %20, i64 10
  br i1 %70, label %pred.store.if109, label %pred.store.continue110

pred.store.if109:                                 ; preds = %pred.store.continue108
  %71 = or disjoint i64 %index, 10
  %72 = xor i64 %71, %indvars.iv69
  %73 = and i64 %72, 4294967295
  %74 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %73
  store i8 1, ptr %74, align 1, !tbaa !9
  br label %pred.store.continue110

pred.store.continue110:                           ; preds = %pred.store.if109, %pred.store.continue108
  %75 = extractelement <16 x i1> %20, i64 11
  br i1 %75, label %pred.store.if111, label %pred.store.continue112

pred.store.if111:                                 ; preds = %pred.store.continue110
  %76 = or disjoint i64 %index, 11
  %77 = xor i64 %76, %indvars.iv69
  %78 = and i64 %77, 4294967295
  %79 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %78
  store i8 1, ptr %79, align 1, !tbaa !9
  br label %pred.store.continue112

pred.store.continue112:                           ; preds = %pred.store.if111, %pred.store.continue110
  %80 = extractelement <16 x i1> %20, i64 12
  br i1 %80, label %pred.store.if113, label %pred.store.continue114

pred.store.if113:                                 ; preds = %pred.store.continue112
  %81 = or disjoint i64 %index, 12
  %82 = xor i64 %81, %indvars.iv69
  %83 = and i64 %82, 4294967295
  %84 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %83
  store i8 1, ptr %84, align 1, !tbaa !9
  br label %pred.store.continue114

pred.store.continue114:                           ; preds = %pred.store.if113, %pred.store.continue112
  %85 = extractelement <16 x i1> %20, i64 13
  br i1 %85, label %pred.store.if115, label %pred.store.continue116

pred.store.if115:                                 ; preds = %pred.store.continue114
  %86 = or disjoint i64 %index, 13
  %87 = xor i64 %86, %indvars.iv69
  %88 = and i64 %87, 4294967295
  %89 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %88
  store i8 1, ptr %89, align 1, !tbaa !9
  br label %pred.store.continue116

pred.store.continue116:                           ; preds = %pred.store.if115, %pred.store.continue114
  %90 = extractelement <16 x i1> %20, i64 14
  br i1 %90, label %pred.store.if117, label %pred.store.continue118

pred.store.if117:                                 ; preds = %pred.store.continue116
  %91 = or disjoint i64 %index, 14
  %92 = xor i64 %91, %indvars.iv69
  %93 = and i64 %92, 4294967295
  %94 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %93
  store i8 1, ptr %94, align 1, !tbaa !9
  br label %pred.store.continue118

pred.store.continue118:                           ; preds = %pred.store.if117, %pred.store.continue116
  %95 = extractelement <16 x i1> %20, i64 15
  br i1 %95, label %pred.store.if119, label %pred.store.continue120

pred.store.if119:                                 ; preds = %pred.store.continue118
  %96 = or disjoint i64 %index, 15
  %97 = xor i64 %96, %indvars.iv69
  %98 = and i64 %97, 4294967295
  %99 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %98
  store i8 1, ptr %99, align 1, !tbaa !9
  br label %pred.store.continue120

pred.store.continue120:                           ; preds = %pred.store.if119, %pred.store.continue118
  %index.next = add nuw i64 %index, 16
  %100 = icmp eq i64 %index.next, 64
  br i1 %100, label %.preheader, label %vector.body, !llvm.loop !13

.preheader:                                       ; preds = %pred.store.continue120
  %101 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %102 = trunc nuw i8 %101 to i1
  br i1 %102, label %103, label %.loopexit

103:                                              ; preds = %.preheader
  %104 = and i64 %indvars.iv69, 4294967295
  %105 = xor i64 %104, 64
  %106 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %105
  store i8 1, ptr %106, align 1, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %103, %.preheader, %15
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next70, 65
  br i1 %exitcond72.not, label %.preheader89, label %15, !llvm.loop !17

.preheader89:                                     ; preds = %.loopexit, %.preheader89
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.preheader89 ], [ 0, %.loopexit ]
  %107 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %indvars.iv73
  %108 = load i8, ptr %107, align 1, !tbaa !9, !range !11, !noundef !12
  %109 = trunc nuw i8 %108 to i1
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  br i1 %109, label %.preheader89, label %110, !llvm.loop !18

110:                                              ; preds = %.preheader89
  %111 = getelementptr inbounds [10000001 x i32], ptr @sg, i64 0, i64 %indvars.iv78
  %112 = trunc nuw nsw i64 %indvars.iv73 to i32
  store i32 %112, ptr %111, align 4, !tbaa !5
  %113 = getelementptr inbounds [65 x i32], ptr @c, i64 0, i64 %indvars.iv73
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !5
  %.not3743 = icmp sgt i32 %.lcssa445254, %112
  br i1 %.not3743, label %118, label %.lr.ph

.lr.ph:                                           ; preds = %110, %.lr.ph
  %116 = phi i32 [ %117, %.lr.ph ], [ %.lcssa445254, %110 ]
  %117 = shl i32 %116, 1
  %.not37 = icmp sgt i32 %117, %112
  br i1 %.not37, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph
  store i32 %117, ptr @mx, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %._crit_edge, %110
  %.lcssa4451 = phi i32 [ %117, %._crit_edge ], [ %.lcssa445254, %110 ]
  %indvars.iv78.tr = trunc i64 %indvars.iv78 to i32
  %119 = shl i32 %indvars.iv78.tr, 1
  %.not3845 = icmp sgt i32 %119, %6
  br i1 %.not3845, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %118
  %120 = and i64 %indvars.iv73, 4294967295
  br label %121

._crit_edge49:                                    ; preds = %121, %118
  call void @llvm.lifetime.end.p0(i64 65, ptr nonnull %3) #5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %indvars.iv.next77 = add i32 %indvars.iv76, 2
  %exitcond84.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count
  br i1 %exitcond84.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !20

121:                                              ; preds = %.lr.ph48, %121
  %indvars.iv80 = phi i64 [ %12, %.lr.ph48 ], [ %indvars.iv.next81, %121 ]
  %122 = getelementptr inbounds [10000001 x [65 x i8]], ptr @vis, i64 0, i64 %indvars.iv80, i64 %120
  store i8 1, ptr %122, align 1, !tbaa !9
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, %indvars.iv78
  %.not38 = icmp sgt i64 %indvars.iv.next81, %7
  br i1 %.not38, label %._crit_edge49, label %121, !llvm.loop !21

._crit_edge62:                                    ; preds = %.lr.ph61, %._crit_edge58
  %.lcssa39 = phi i32 [ %10, %._crit_edge58 ], [ %139, %.lr.ph61 ]
  call void @_Z3FWTPiii(ptr noundef nonnull @c, i32 noundef %.lcssa39, i32 noundef -1)
  %123 = load i32, ptr %1, align 4, !tbaa !5
  %124 = add nsw i32 %123, -1
  %125 = load i64, ptr %2, align 8, !tbaa !22
  %126 = call noundef i32 @_Z7mod_powix(i32 noundef %124, i64 noundef %125)
  %127 = load i32, ptr @c, align 16, !tbaa !5
  %128 = sub nsw i32 %126, %127
  %129 = icmp slt i32 %128, 0
  %130 = add nsw i32 %128, 987654321
  %131 = select i1 %129, i32 %130, i32 %128
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %131)
  %133 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %134 = icmp eq i32 %133, 2
  br i1 %134, label %.lr.ph64, label %._crit_edge65, !llvm.loop !24

.lr.ph61:                                         ; preds = %._crit_edge58, %.lr.ph61
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph61 ], [ 0, %._crit_edge58 ]
  %135 = getelementptr inbounds [65 x i32], ptr @c, i64 0, i64 %indvars.iv85
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i64, ptr %2, align 8, !tbaa !22
  %138 = call noundef i32 @_Z7mod_powix(i32 noundef %136, i64 noundef %137)
  store i32 %138, ptr %135, align 4, !tbaa !5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %139 = load i32, ptr @mx, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = icmp slt i64 %indvars.iv.next86, %140
  br i1 %141, label %.lr.ph61, label %._crit_edge62, !llvm.loop !25

._crit_edge65:                                    ; preds = %._crit_edge62, %0
  call void @llvm.lifetime.end.p0(i64 8, 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = !{!23, !23, i64 0}
!23 = !{!"long long", !7, i64 0}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


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