; LLVM IR from tangjz/acm-icpc :: codeforces/complete/1466E.ll (Z5solvev)

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

@_ZZ5solvevE3cnt = external hidden global [61 x i32], align 16
@_ZZ5solvevE3upp = external hidden global [61 x i32], align 16
@_ZZ5solvevE1a = external hidden global [500001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %59, %0
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %62

21:                                               ; preds = %16
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i64, ptr @_ZZ5solvevE1a, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [500001 x i64], ptr @_ZZ5solvevE1a, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !9
  store i64 %29, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %53, %21
  %31 = load i64, ptr %5, align 8, !tbaa !9
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %58

34:                                               ; preds = %30
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp eq i32 %35, %36
  br i1 %37, label %38, label %43

38:                                               ; preds = %34
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %41
  store i32 0, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %38, %34
  %44 = load i64, ptr %5, align 8, !tbaa !9
  %45 = and i64 %44, 1
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = add nsw i64 %50, %45
  %52 = trunc i64 %51 to i32
  store i32 %52, ptr %48, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %43
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !5
  %56 = load i64, ptr %5, align 8, !tbaa !9
  %57 = ashr i64 %56, 1
  store i64 %57, ptr %5, align 8, !tbaa !9
  br label %30, !llvm.loop !11

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

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

62:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %94, %62
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %97

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = zext i32 %69 to i64
  %71 = shl i64 1, %70
  %72 = srem i64 %71, 1000000007
  store i64 %72, ptr %8, align 8, !tbaa !9
  %73 = load i64, ptr %8, align 8, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %73, %78
  %80 = srem i64 %79, 1000000007
  %81 = trunc i64 %80 to i32
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %83
  store i32 %81, ptr %84, align 4, !tbaa !5
  %85 = load i64, ptr %8, align 8, !tbaa !9
  %86 = load i32, ptr %1, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %85, %87
  %89 = srem i64 %88, 1000000007
  %90 = trunc i64 %89 to i32
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3upp, i64 0, i64 %92
  store i32 %90, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %94

94:                                               ; preds = %68
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %7, align 4, !tbaa !5
  br label %63, !llvm.loop !14

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

98:                                               ; preds = %148, %97
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = load i32, ptr %1, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %151

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [500001 x i64], ptr @_ZZ5solvevE1a, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !9
  store i64 %107, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %132, %103
  %109 = load i32, ptr %14, align 4, !tbaa !5
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

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

113:                                              ; preds = %108
  %114 = load i64, ptr %13, align 8, !tbaa !9
  %115 = and i64 %114, 1
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %126

117:                                              ; preds = %113
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  call void @_Z6modIncRii(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %121)
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3upp, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  call void @_Z6modIncRii(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef %125)
  br label %131

126:                                              ; preds = %113
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  call void @_Z6modIncRii(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef %130)
  br label %131

131:                                              ; preds = %126, %117
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %14, align 4, !tbaa !5
  %135 = load i64, ptr %13, align 8, !tbaa !9
  %136 = ashr i64 %135, 1
  store i64 %136, ptr %13, align 8, !tbaa !9
  br label %108, !llvm.loop !15

137:                                              ; preds = %112
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = mul nsw i64 %141, %143
  %145 = add nsw i64 %139, %144
  %146 = srem i64 %145, 1000000007
  %147 = trunc i64 %146 to i32
  store i32 %147, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %148

148:                                              ; preds = %137
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %10, align 4, !tbaa !5
  br label %98, !llvm.loop !16

151:                                              ; preds = %102
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %152)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

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

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

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

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

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { inlinehint 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 #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}


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

@_ZZ5solvevE3cnt = external hidden local_unnamed_addr global [61 x i32], align 16
@_ZZ5solvevE3upp = external hidden local_unnamed_addr global [61 x i32], align 16
@_ZZ5solvevE1a = external hidden global [500001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph49, label %._crit_edge62

.preheader42:                                     ; preds = %._crit_edge
  %7 = icmp sgt i32 %.1.lcssa, 0
  br i1 %7, label %.lr.ph53, label %.preheader

.lr.ph53:                                         ; preds = %.preheader42
  %8 = sext i32 %13 to i64
  %wide.trip.count = zext nneg i32 %.1.lcssa to i64
  br label %52

.lr.ph49:                                         ; preds = %0, %._crit_edge
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %._crit_edge ], [ 0, %0 ]
  %.03747 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %0 ]
  %9 = getelementptr inbounds i64, ptr @_ZZ5solvevE1a, i64 %indvars.iv68
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %9)
  %11 = load i64, ptr %9, align 8, !tbaa !9
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %22, %.lr.ph49
  %.1.lcssa = phi i32 [ %.03747, %.lr.ph49 ], [ %.2, %22 ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next69, %14
  br i1 %15, label %.lr.ph49, label %.preheader42, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph49, %22
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %.lr.ph49 ]
  %.145 = phi i32 [ %.2, %22 ], [ %.03747, %.lr.ph49 ]
  %.04043 = phi i64 [ %28, %22 ], [ %11, %.lr.ph49 ]
  %16 = zext i32 %.145 to i64
  %17 = icmp eq i64 %indvars.iv, %16
  br i1 %17, label %18, label %22

18:                                               ; preds = %.lr.ph
  %19 = add nsw i32 %.145, 1
  %20 = sext i32 %.145 to i64
  %21 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %20
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %18, %.lr.ph
  %.2 = phi i32 [ %19, %18 ], [ %.145, %.lr.ph ]
  %23 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %indvars.iv
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = trunc i64 %.04043 to i32
  %26 = and i32 %25, 1
  %27 = add i32 %24, %26
  store i32 %27, ptr %23, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = lshr i64 %.04043, 1
  %.not = icmp ult i64 %.04043, 2
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

.preheader:                                       ; preds = %52, %.preheader42
  %29 = phi i1 [ false, %.preheader42 ], [ %7, %52 ]
  %30 = icmp sgt i32 %13, 0
  %brmerge.not = and i1 %30, %29
  br i1 %brmerge.not, label %.lr.ph57.us.preheader, label %._crit_edge62

.lr.ph57.us.preheader:                            ; preds = %.preheader
  %wide.trip.count78 = zext nneg i32 %.1.lcssa to i64
  br label %.lr.ph57.us

.lr.ph57.us:                                      ; preds = %.lr.ph57.us.preheader, %._crit_edge58.us
  %indvars.iv80 = phi i64 [ 0, %.lr.ph57.us.preheader ], [ %indvars.iv.next81, %._crit_edge58.us ]
  %.03659.us = phi i64 [ 0, %.lr.ph57.us.preheader ], [ %48, %._crit_edge58.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %31 = getelementptr inbounds [500001 x i64], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv80
  %32 = load i64, ptr %31, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %.lr.ph57.us, %40
  %indvars.iv75 = phi i64 [ 0, %.lr.ph57.us ], [ %indvars.iv.next76, %40 ]
  %.03454.us = phi i64 [ %32, %.lr.ph57.us ], [ %41, %40 ]
  %34 = and i64 %.03454.us, 1
  %.not.us = icmp eq i64 %34, 0
  %35 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %indvars.iv75
  %36 = load i32, ptr %35, align 4, !tbaa !5
  br i1 %.not.us, label %40, label %37

37:                                               ; preds = %33
  call void @_Z6modIncRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %36)
  %38 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3upp, i64 0, i64 %indvars.iv75
  %39 = load i32, ptr %38, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %33, %37
  %.sink = phi i32 [ %39, %37 ], [ %36, %33 ]
  call void @_Z6modIncRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %.sink)
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %41 = ashr i64 %.03454.us, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge58.us, label %33, !llvm.loop !14

._crit_edge58.us:                                 ; preds = %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %45, %43
  %47 = add nsw i64 %46, %.03659.us
  %48 = srem i64 %47, 1000000007
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next81, %50
  br i1 %51, label %.lr.ph57.us, label %._crit_edge62.loopexit, !llvm.loop !15

52:                                               ; preds = %.lr.ph53, %52
  %indvars.iv71 = phi i64 [ 0, %.lr.ph53 ], [ %indvars.iv.next72, %52 ]
  %53 = shl nuw i64 1, %indvars.iv71
  %54 = srem i64 %53, 1000000007
  %55 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3cnt, i64 0, i64 %indvars.iv71
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul nsw i64 %54, %57
  %59 = srem i64 %58, 1000000007
  %60 = trunc nsw i64 %59 to i32
  store i32 %60, ptr %55, align 4, !tbaa !5
  %61 = mul nsw i64 %54, %8
  %62 = srem i64 %61, 1000000007
  %63 = trunc nsw i64 %62 to i32
  %64 = getelementptr inbounds [61 x i32], ptr @_ZZ5solvevE3upp, i64 0, i64 %indvars.iv71
  store i32 %63, ptr %64, align 4, !tbaa !5
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %52, !llvm.loop !16

._crit_edge62.loopexit:                           ; preds = %._crit_edge58.us
  %65 = trunc nsw i64 %48 to i32
  br label %._crit_edge62

._crit_edge62:                                    ; preds = %.preheader, %0, %._crit_edge62.loopexit
  %.036.lcssa = phi i32 [ 0, %.preheader ], [ %65, %._crit_edge62.loopexit ], [ 0, %0 ]
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.036.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void
}

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

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

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

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

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

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 = { 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 #3 = { inlinehint 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 #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}


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