; LLVM IR from tangjz/acm-icpc :: hdu (6455)

; 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
@Mul = 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 [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = 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) #6
  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) #6
  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) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %78, %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) #6
  br label %81

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

33:                                               ; preds = %74, %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) #6
  br label %77

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
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = mul nsw i32 %59, %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [71 x [71 x i32]], ptr @Mul, i64 0, i64 %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [71 x i32], ptr %64, i64 0, i64 %66
  store i32 %61, ptr %67, align 4, !tbaa !5
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [71 x [71 x i32]], ptr @Mul, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [71 x i32], ptr %70, i64 0, i64 %72
  store i32 %61, ptr %73, align 4, !tbaa !5
  br label %74

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

77:                                               ; preds = %36
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !12

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

83:                                               ; preds = %203, %81
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = load i32, ptr @t, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %206

88:                                               ; preds = %83
  %89 = 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) #6
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %132, %88
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp sle i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %135

95:                                               ; preds = %90
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %97
  %99 = load i32, ptr @mod, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = srem i32 %99, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [71 x i32], ptr %98, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 1
  br i1 %105, label %106, label %107

106:                                              ; preds = %95
  br label %109

107:                                              ; preds = %95
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 56, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

108:                                              ; No predecessors!
  br label %109

109:                                              ; preds = %108, %106
  %110 = load i32, ptr @mod, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = load i32, ptr @mod, align 4, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sdiv i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = load i32, ptr @mod, align 4, !tbaa !5
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = srem i32 %116, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = mul nsw i64 %115, %122
  %124 = load i32, ptr @mod, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = srem i64 %123, %125
  %127 = sub nsw i64 %111, %126
  %128 = trunc i64 %127 to i32
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %130
  store i32 %128, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %109
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !13

135:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = load i32, ptr @n, align 4, !tbaa !5
  %138 = sub nsw i32 %137, 1
  %139 = mul nsw i32 %136, %138
  %140 = sdiv i32 %139, 2
  store i32 %140, ptr %8, align 4, !tbaa !5
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = mul i64 %143, 4
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 %144, 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) #6
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  store i32 %146, ptr %9, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %196, %135
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = icmp sge i32 %148, 0
  br i1 %149, label %151, label %150

150:                                              ; preds = %147
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %199

151:                                              ; preds = %147
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = add nsw i32 %160, %156
  store i32 %161, ptr %159, align 4, !tbaa !5
  %162 = load i32, ptr @mod, align 4, !tbaa !5
  %163 = icmp sge i32 %161, %162
  br i1 %163, label %164, label %172

164:                                              ; preds = %151
  %165 = load i32, ptr @mod, align 4, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sub nsw i32 %169, %165
  store i32 %170, ptr %168, align 4, !tbaa !5
  %171 = icmp ne i32 %170, 0
  br label %172

172:                                              ; preds = %164, %151
  %173 = phi i1 [ false, %151 ], [ %171, %164 ]
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = add nsw i32 %182, %178
  store i32 %183, ptr %181, align 4, !tbaa !5
  %184 = load i32, ptr @mod, align 4, !tbaa !5
  %185 = icmp sge i32 %183, %184
  br i1 %185, label %186, label %194

186:                                              ; preds = %172
  %187 = load i32, ptr @mod, align 4, !tbaa !5
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = sub nsw i32 %191, %187
  store i32 %192, ptr %190, align 4, !tbaa !5
  %193 = icmp ne i32 %192, 0
  br label %194

194:                                              ; preds = %186, %172
  %195 = phi i1 [ false, %172 ], [ %193, %186 ]
  br label %196

196:                                              ; preds = %194
  %197 = load i32, ptr %9, align 4, !tbaa !5
  %198 = add nsw i32 %197, -1
  store i32 %198, ptr %9, align 4, !tbaa !5
  br label %147, !llvm.loop !14

199:                                              ; preds = %150
  %200 = load i32, ptr %6, align 4, !tbaa !5
  %201 = load i32, ptr @f, align 16, !tbaa !5
  %202 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %200, i32 noundef %201)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %203

203:                                              ; preds = %199
  %204 = load i32, ptr %6, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %6, align 4, !tbaa !5
  br label %83, !llvm.loop !15

206:                                              ; preds = %87
  ret i32 0
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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 = { noreturn 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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
@Mul = 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 [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [62 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = 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.iv75 = phi i64 [ %indvars.iv.next76, %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
  %.not69 = icmp slt i32 %10, 1
  br i1 %.not69, label %._crit_edge73, label %.lr.ph72

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

12:                                               ; preds = %.preheader, %12
  %indvars.iv77 = phi i64 [ %indvars.iv75, %.preheader ], [ %indvars.iv.next78, %12 ]
  %13 = sub nuw nsw i64 %indvars.iv77, %indvars.iv75
  %14 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv75, 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.iv77, i64 %indvars.iv75
  store i32 %15, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv75, i64 %indvars.iv77
  store i32 %15, ptr %17, align 4, !tbaa !5
  %18 = mul nuw nsw i64 %indvars.iv77, %indvars.iv75
  %19 = getelementptr inbounds [71 x [71 x i32]], ptr @Mul, i64 0, i64 %indvars.iv77, i64 %indvars.iv75
  %20 = trunc nsw i64 %18 to i32
  store i32 %20, ptr %19, align 4, !tbaa !5
  %21 = getelementptr inbounds [71 x [71 x i32]], ptr @Mul, i64 0, i64 %indvars.iv75, i64 %indvars.iv77
  store i32 %20, ptr %21, align 4, !tbaa !5
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next78, 71
  br i1 %exitcond80.not, label %11, label %12, !llvm.loop !12

._crit_edge73:                                    ; preds = %._crit_edge68, %8
  ret i32 0

.lr.ph72:                                         ; preds = %8, %._crit_edge68
  %.04570 = phi i32 [ %57, %._crit_edge68 ], [ 1, %8 ]
  %22 = 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
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %.not5361 = icmp slt i32 %23, 2
  br i1 %.not5361, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph72
  %24 = load i32, ptr @mod, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = add nuw i32 %23, 1
  %wide.trip.count = zext i32 %26 to i64
  br label %36

._crit_edge:                                      ; preds = %45, %.lr.ph72
  %27 = add nsw i32 %23, -1
  %28 = mul nsw i32 %27, %23
  %29 = sdiv i32 %28, 2
  %30 = add nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = shl nsw i64 %31, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 0, i64 %32, 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)
  %33 = icmp sgt i32 %28, 1
  br i1 %33, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %._crit_edge
  %34 = load i32, ptr @mod, align 4, !tbaa !5
  %35 = zext nneg i32 %29 to i64
  %.phi.trans.insert = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %35
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %59

36:                                               ; preds = %.lr.ph, %45
  %indvars.iv83 = phi i64 [ 2, %.lr.ph ], [ %indvars.iv.next84, %45 ]
  %37 = trunc nuw nsw i64 %indvars.iv83 to i32
  %38 = srem i32 %24, %37
  %39 = sdiv i32 %24, %37
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [71 x [71 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv83, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 56, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

45:                                               ; preds = %36
  %46 = sext i32 %39 to i64
  %47 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %40
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul nsw i64 %49, %46
  %51 = srem i64 %50, %25
  %52 = trunc nsw i64 %51 to i32
  %53 = sub i32 %24, %52
  %54 = getelementptr inbounds [2417 x i32], ptr @inv, i64 0, i64 %indvars.iv83
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
  br i1 %exitcond86.not, label %._crit_edge, label %36, !llvm.loop !13

._crit_edge68:                                    ; preds = %59, %._crit_edge
  %55 = load i32, ptr @f, align 16, !tbaa !5
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.04570, i32 noundef %55)
  %57 = add nuw nsw i32 %.04570, 1
  %58 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04570, %58
  br i1 %.not.not, label %.lr.ph72, label %._crit_edge73, !llvm.loop !14

59:                                               ; preds = %.lr.ph67, %59
  %60 = phi i32 [ %.pre, %.lr.ph67 ], [ %spec.select, %59 ]
  %indvars.iv87 = phi i64 [ %35, %.lr.ph67 ], [ %indvars.iv.next88, %59 ]
  %indvars.iv.next88 = add nsw i64 %indvars.iv87, -1
  %61 = getelementptr inbounds [2417 x i32], ptr @f, i64 0, i64 %indvars.iv.next88
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, %60
  %.not54 = icmp slt i32 %63, %34
  %64 = select i1 %.not54, i32 0, i32 %34
  %spec.select90 = sub nsw i32 %63, %64
  %65 = add nsw i32 %spec.select90, %60
  %.not55 = icmp slt i32 %65, %34
  %66 = select i1 %.not55, i32 0, i32 %34
  %spec.select = sub nsw i32 %65, %66
  store i32 %spec.select, ptr %61, align 4, !tbaa !5
  %67 = icmp ugt i64 %indvars.iv87, 1
  br i1 %67, label %59, label %._crit_edge68, !llvm.loop !15
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) 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 #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 = { noreturn 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 = { noreturn 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}


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