; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101955H)

; 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
@mod = external dso_local global i32, align 4
@f = external dso_local global [2417 x i32], align 16
@inv = external dso_local global [2417 x i32], align 16
@Gcd = external dso_local global [71 x [71 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiiiib(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #0

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

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

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

10:                                               ; preds = %23, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 71
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %26

14:                                               ; preds = %10
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %17
  %19 = getelementptr inbounds [71 x i32], ptr %18, i64 0, i64 0
  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 [71 x i32], ptr @Gcd, i64 0, i64 %21
  store i32 %15, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %14
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

26:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %63, %26
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 71
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %32, ptr %5, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %59, %31
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 71
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %33
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sub nsw i32 %41, %42
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [71 x i32], ptr %40, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [71 x i32], ptr %49, i64 0, i64 %51
  store i32 %46, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %54
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [71 x i32], ptr %55, i64 0, i64 %57
  store i32 %46, ptr %58, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %37
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %5, align 4, !tbaa !5
  br label %33, !llvm.loop !11

62:                                               ; preds = %36
  br label %63

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

66:                                               ; preds = %30
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %174, %66
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr @t, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %177

73:                                               ; preds = %68
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @mod)
  store i32 1, ptr getelementptr inbounds ([2417 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %103, %73
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %106

80:                                               ; preds = %75
  %81 = load i32, ptr @mod, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = load i32, ptr @mod, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sdiv i32 %83, %84
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr @mod, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = srem i32 %87, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %86, %93
  %95 = load i32, ptr @mod, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = srem i64 %94, %96
  %98 = sub nsw i64 %82, %97
  %99 = trunc i64 %98 to i32
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %80
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %7, align 4, !tbaa !5
  br label %75, !llvm.loop !13

106:                                              ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = mul nsw i32 %107, %109
  %111 = sdiv i32 %110, 2
  store i32 %111, ptr %8, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = mul i64 %114, 4
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 %115, i1 false)
  call void @_Z3dfsiiiiib(i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %167, %106
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = icmp sge i32 %119, 0
  br i1 %120, label %122, label %121

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

122:                                              ; preds = %118
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, %127
  store i32 %132, ptr %130, align 4, !tbaa !5
  %133 = load i32, ptr @mod, align 4, !tbaa !5
  %134 = icmp sge i32 %132, %133
  br i1 %134, label %135, label %143

135:                                              ; preds = %122
  %136 = load i32, ptr @mod, align 4, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sub nsw i32 %140, %136
  store i32 %141, ptr %139, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br label %143

143:                                              ; preds = %135, %122
  %144 = phi i1 [ false, %122 ], [ %142, %135 ]
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, %149
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = load i32, ptr @mod, align 4, !tbaa !5
  %156 = icmp sge i32 %154, %155
  br i1 %156, label %157, label %165

157:                                              ; preds = %143
  %158 = load i32, ptr @mod, align 4, !tbaa !5
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sub nsw i32 %162, %158
  store i32 %163, ptr %161, align 4, !tbaa !5
  %164 = icmp ne i32 %163, 0
  br label %165

165:                                              ; preds = %157, %143
  %166 = phi i1 [ false, %143 ], [ %164, %157 ]
  br label %167

167:                                              ; preds = %165
  %168 = load i32, ptr %9, align 4, !tbaa !5
  %169 = add nsw i32 %168, -1
  store i32 %169, ptr %9, align 4, !tbaa !5
  br label %118, !llvm.loop !14

170:                                              ; preds = %121
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = load i32, ptr @f, align 16, !tbaa !5
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %171, i32 noundef %172)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %174

174:                                              ; preds = %170
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %6, align 4, !tbaa !5
  br label %68, !llvm.loop !15

177:                                              ; preds = %72
  ret i32 0
}

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 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}
!15 = distinct !{!15, !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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@mod = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [2417 x i32], align 16
@inv = external dso_local local_unnamed_addr global [2417 x i32], align 16
@Gcd = external dso_local local_unnamed_addr global [71 x [71 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiiiib(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  br label %1

1:                                                ; preds = %1, %0
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next.1, %1 ]
  %2 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv
  %3 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %3, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds [71 x i32], ptr @Gcd, i64 0, i64 %indvars.iv
  store i32 %3, ptr %4, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %5 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv.next
  %6 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %6, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds [71 x i32], ptr @Gcd, i64 0, i64 %indvars.iv.next
  store i32 %6, ptr %7, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 71
  br i1 %exitcond.not.1, label %.preheader, label %1, !llvm.loop !9

.preheader:                                       ; preds = %1, %11
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %11 ], [ 1, %1 ]
  br label %12

8:                                                ; preds = %11
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %.not60 = icmp slt i32 %10, 1
  br i1 %.not60, label %._crit_edge64, label %.lr.ph63

11:                                               ; preds = %12
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next67, 71
  br i1 %exitcond73.not, label %8, label %.preheader, !llvm.loop !11

12:                                               ; preds = %.preheader, %12
  %indvars.iv68 = phi i64 [ %indvars.iv66, %.preheader ], [ %indvars.iv.next69, %12 ]
  %13 = sub nuw nsw i64 %indvars.iv68, %indvars.iv66
  %14 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv66, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv68, i64 %indvars.iv66
  store i32 %15, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv66, i64 %indvars.iv68
  store i32 %15, ptr %17, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, 71
  br i1 %exitcond71.not, label %11, label %12, !llvm.loop !12

._crit_edge64:                                    ; preds = %._crit_edge59, %8
  ret i32 0

.lr.ph63:                                         ; preds = %8, %._crit_edge59
  %.03761 = phi i32 [ %48, %._crit_edge59 ], [ 1, %8 ]
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @mod)
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %.not4552 = icmp slt i32 %19, 2
  br i1 %.not4552, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph63
  %20 = load i32, ptr @mod, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = add nuw i32 %19, 1
  %wide.trip.count = zext i32 %22 to i64
  br label %32

._crit_edge:                                      ; preds = %32, %.lr.ph63
  %23 = add nsw i32 %19, -1
  %24 = mul nsw i32 %23, %19
  %25 = sdiv i32 %24, 2
  %26 = add nsw i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = shl nsw i64 %27, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 0, i64 %28, i1 false)
  tail call void @_Z3dfsiiiiib(i32 noundef 0, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i1 noundef zeroext false)
  %29 = icmp sgt i32 %24, 1
  br i1 %29, label %.lr.ph58, label %._crit_edge59

.lr.ph58:                                         ; preds = %._crit_edge
  %30 = load i32, ptr @mod, align 4, !tbaa !5
  %31 = zext nneg i32 %25 to i64
  %.phi.trans.insert = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %31
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %50

32:                                               ; preds = %.lr.ph, %32
  %indvars.iv74 = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next75, %32 ]
  %33 = trunc nuw nsw i64 %indvars.iv74 to i32
  %34 = sdiv i32 %20, %33
  %35 = sext i32 %34 to i64
  %36 = srem i32 %20, %33
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = mul nsw i64 %40, %35
  %42 = srem i64 %41, %21
  %43 = trunc nsw i64 %42 to i32
  %44 = sub i32 %20, %43
  %45 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %indvars.iv74
  store i32 %44, ptr %45, align 4, !tbaa !5
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
  br i1 %exitcond77.not, label %._crit_edge, label %32, !llvm.loop !13

._crit_edge59:                                    ; preds = %50, %._crit_edge
  %46 = load i32, ptr @f, align 16, !tbaa !5
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.03761, i32 noundef %46)
  %48 = add nuw nsw i32 %.03761, 1
  %49 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03761, %49
  br i1 %.not.not, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

50:                                               ; preds = %.lr.ph58, %50
  %51 = phi i32 [ %.pre, %.lr.ph58 ], [ %spec.select, %50 ]
  %indvars.iv78 = phi i64 [ %31, %.lr.ph58 ], [ %indvars.iv.next79, %50 ]
  %indvars.iv.next79 = add nsw i64 %indvars.iv78, -1
  %52 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %indvars.iv.next79
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, %51
  %.not46 = icmp slt i32 %54, %30
  %55 = select i1 %.not46, i32 0, i32 %30
  %spec.select81 = sub nsw i32 %54, %55
  %56 = add nsw i32 %spec.select81, %51
  %.not47 = icmp slt i32 %56, %30
  %57 = select i1 %.not47, i32 0, i32 %30
  %spec.select = sub nsw i32 %56, %57
  store i32 %spec.select, ptr %52, align 4, !tbaa !5
  %58 = icmp ugt i64 %indvars.iv78, 1
  br i1 %58, label %50, label %._crit_edge59, !llvm.loop !15
}

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

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

; 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" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!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}
!15 = distinct !{!15, !10}


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