; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1034A)

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

@ptot = external dso_local global i32, align 4
@d = external dso_local global [15000001 x i32], align 16
@pr = external dso_local global [1875001 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [300001 x i32], align 16
@c = external dso_local global [15000001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %65, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 15000001
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %68

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %31, label %22

22:                                               ; preds = %16
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !5
  %27 = load i32, ptr @ptot, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @ptot, align 4, !tbaa !5
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %29
  store i32 %23, ptr %30, align 4, !tbaa !5
  br label %31

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

32:                                               ; preds = %60, %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = mul nsw i32 %33, %37
  store i32 %38, ptr %5, align 4, !tbaa !5
  %39 = icmp slt i32 %38, 15000001
  br i1 %39, label %41, label %40

40:                                               ; preds = %32
  store i32 5, ptr %3, align 4
  br label %63

41:                                               ; preds = %32
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %47
  store i32 %45, ptr %48, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %52, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %41
  store i32 5, ptr %3, align 4
  br label %63

59:                                               ; preds = %41
  br label %60

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

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

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !11

68:                                               ; preds = %15
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %86, %68
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %89

75:                                               ; preds = %70
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr @a, i64 %77
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %78)
  %80 = load i32, ptr @m, align 4, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %80, i32 noundef %84)
  store i32 %85, ptr @m, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %75
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %70, !llvm.loop !12

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

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

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

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr @m, align 4, !tbaa !5
  %101 = sdiv i32 %99, %100
  store i32 %101, ptr %8, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %128, %95
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = icmp sgt i32 %103, 1
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %129

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [15000001 x i32], ptr @c, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %124, %106
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = icmp eq i32 %120, %121
  br i1 %122, label %123, label %128

123:                                              ; preds = %116
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sdiv i32 %126, %125
  store i32 %127, ptr %8, align 4, !tbaa !5
  br label %116, !llvm.loop !13

128:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %102, !llvm.loop !14

129:                                              ; preds = %105
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !15

133:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %134

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

138:                                              ; preds = %134
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %162

139:                                              ; preds = %134
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [15000001 x i32], ptr @c, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr @n, align 4, !tbaa !5
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %149, label %158

149:                                              ; preds = %139
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [15000001 x i32], ptr @c, i64 0, i64 %154
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %155)
  %157 = load i32, ptr %156, align 4, !tbaa !5
  store i32 %157, ptr %10, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %149, %139
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !5
  br label %134, !llvm.loop !16

162:                                              ; preds = %138
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %169

165:                                              ; preds = %162
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = load i32, ptr %10, align 4, !tbaa !5
  %168 = sub nsw i32 %166, %167
  br label %170

169:                                              ; preds = %162
  br label %170

170:                                              ; preds = %169, %165
  %171 = phi i32 [ %168, %165 ], [ -1, %169 ]
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %171)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %173 = load i32, ptr %1, align 4
  ret i32 %173
}

; 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef, i32 noundef) #3

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

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

attributes #0 = { 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 #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 = { 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 = { 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 #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}
!16 = distinct !{!16, !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"

@ptot = external dso_local local_unnamed_addr global i32, align 4
@d = external dso_local local_unnamed_addr global [15000001 x i32], align 16
@pr = external dso_local local_unnamed_addr global [1875001 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [300001 x i32], align 16
@c = external dso_local global [15000001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %ptot.promoted = load i32, ptr @ptot, align 4, !tbaa !5
  br label %6

2:                                                ; preds = %._crit_edge
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph44, label %._crit_edge55

6:                                                ; preds = %0, %._crit_edge
  %indvars.iv63 = phi i64 [ 2, %0 ], [ %indvars.iv.next64, %._crit_edge ]
  %7 = phi i32 [ %ptot.promoted, %0 ], [ %15, %._crit_edge ]
  %8 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %indvars.iv63
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %.not38 = icmp eq i32 %9, 0
  %10 = trunc nuw nsw i64 %indvars.iv63 to i32
  br i1 %.not38, label %11, label %._crit_edge78

11:                                               ; preds = %6
  store i32 %10, ptr %8, align 4, !tbaa !5
  %12 = add nsw i32 %7, 1
  store i32 %12, ptr @ptot, align 4, !tbaa !5
  %13 = sext i32 %7 to i64
  %14 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %13
  store i32 %10, ptr %14, align 4, !tbaa !5
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %6, %11
  %15 = phi i32 [ %12, %11 ], [ %7, %6 ]
  %16 = load i32, ptr @pr, align 16, !tbaa !5
  %17 = mul nsw i32 %16, %10
  %18 = icmp slt i32 %17, 15000001
  br i1 %18, label %.lr.ph, label %._crit_edge

19:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = mul nsw i32 %21, %10
  %23 = icmp slt i32 %22, 15000001
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge78, %19
  %indvars.iv = phi i64 [ %indvars.iv.next, %19 ], [ 0, %._crit_edge78 ]
  %24 = phi i32 [ %22, %19 ], [ %17, %._crit_edge78 ]
  %25 = phi i32 [ %21, %19 ], [ %16, %._crit_edge78 ]
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %26
  store i32 %25, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = icmp eq i32 %28, %25
  br i1 %29, label %._crit_edge, label %19

._crit_edge:                                      ; preds = %19, %.lr.ph, %._crit_edge78
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, 15000001
  br i1 %exitcond.not, label %2, label %6, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph44
  %30 = icmp sgt i32 %37, 0
  br i1 %30, label %.lr.ph54, label %._crit_edge55

.lr.ph54:                                         ; preds = %.preheader
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %wide.trip.count = zext nneg i32 %37 to i64
  br label %42

.lr.ph44:                                         ; preds = %2, %.lr.ph44
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph44 ], [ 0, %2 ]
  %32 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv66
  %33 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %32)
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = load i32, ptr %32, align 4, !tbaa !5
  %36 = tail call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %34, i32 noundef %35)
  store i32 %36, ptr @m, align 4, !tbaa !5
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %37 = load i32, ptr @n, align 4
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next67, %38
  br i1 %39, label %.lr.ph44, label %.preheader, !llvm.loop !12

._crit_edge55:                                    ; preds = %._crit_edge52, %2, %.preheader
  %.pre7681 = phi i32 [ %37, %.preheader ], [ %4, %2 ], [ %37, %._crit_edge52 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  %40 = load i32, ptr @ptot, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph58, label %._crit_edge59.thread

42:                                               ; preds = %.lr.ph54, %._crit_edge52
  %indvars.iv69 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next70, %._crit_edge52 ]
  %43 = getelementptr inbounds [300001 x i32], ptr @a, i64 0, i64 %indvars.iv69
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sdiv i32 %44, %31
  %46 = icmp sgt i32 %45, 1
  br i1 %46, label %.lr.ph47.preheader, label %._crit_edge52

.loopexit:                                        ; preds = %.lr.ph47
  %47 = icmp sgt i32 %55, 1
  br i1 %47, label %.lr.ph47.preheader, label %._crit_edge52, !llvm.loop !13

._crit_edge52:                                    ; preds = %.loopexit, %42
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond72.not, label %._crit_edge55, label %42, !llvm.loop !14

.lr.ph47.preheader:                               ; preds = %42, %.loopexit
  %.03149 = phi i32 [ %55, %.loopexit ], [ %45, %42 ]
  %48 = zext nneg i32 %.03149 to i64
  %49 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [15000001 x i32], ptr @c, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !5
  br label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph47.preheader, %.lr.ph47
  %.145 = phi i32 [ %55, %.lr.ph47 ], [ %.03149, %.lr.ph47.preheader ]
  %55 = sdiv i32 %.145, %50
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [15000001 x i32], ptr @d, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp eq i32 %58, %50
  br i1 %59, label %.lr.ph47, label %.loopexit, !llvm.loop !15

._crit_edge59:                                    ; preds = %76
  %.not = icmp eq i32 %.fr, 0
  %60 = sub nsw i32 %79, %.fr
  br i1 %.not, label %._crit_edge59.thread, label %61

._crit_edge59.thread:                             ; preds = %._crit_edge55, %._crit_edge59
  br label %61

61:                                               ; preds = %._crit_edge59, %._crit_edge59.thread
  %62 = phi i32 [ -1, %._crit_edge59.thread ], [ %60, %._crit_edge59 ]
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %62)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph58:                                         ; preds = %._crit_edge55, %76
  %64 = phi i32 [ %.fr, %76 ], [ 0, %._crit_edge55 ]
  %65 = phi i32 [ %78, %76 ], [ %40, %._crit_edge55 ]
  %66 = phi i32 [ %79, %76 ], [ %.pre7681, %._crit_edge55 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %76 ], [ 0, %._crit_edge55 ]
  %67 = getelementptr inbounds [1875001 x i32], ptr @pr, i64 0, i64 %indvars.iv73
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [15000001 x i32], ptr @c, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp slt i32 %71, %66
  br i1 %72, label %73, label %76

73:                                               ; preds = %.lr.ph58
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %70)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %1, align 4, !tbaa !5
  %.pre = load i32, ptr @n, align 4
  %.pre77 = load i32, ptr @ptot, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %.lr.ph58, %73
  %77 = phi i32 [ %64, %.lr.ph58 ], [ %75, %73 ]
  %78 = phi i32 [ %65, %.lr.ph58 ], [ %.pre77, %73 ]
  %79 = phi i32 [ %66, %.lr.ph58 ], [ %.pre, %73 ]
  %.fr = freeze i32 %77
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %80 = sext i32 %78 to i64
  %81 = icmp slt i64 %indvars.iv.next74, %80
  br i1 %81, label %.lr.ph58, label %._crit_edge59, !llvm.loop !16
}

; 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

attributes #0 = { 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 #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 = { 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 = { 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 #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}
!16 = distinct !{!16, !10}


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