; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1043F)

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

@n = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@c = external dso_local global [300001 x i32], align 16
@inv = external dso_local global [2 x [300001 x i32]], align 16
@_ZL3mod = external hidden constant [2 x i32], align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checki(i32 noundef) #0

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

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

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

14:                                               ; preds = %63, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 2
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2 x i32], ptr @_ZL3mod, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %22, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 %24
  %26 = getelementptr inbounds [300001 x i32], ptr %25, i64 0, i64 1
  store i32 1, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %59, %18
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 300001
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %27
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sdiv i32 %33, %34
  %36 = sext i32 %35 to i64
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = srem i32 %40, %41
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [300001 x i32], ptr %39, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = mul nsw i64 %36, %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = srem i64 %47, %49
  %51 = trunc i64 %50 to i32
  %52 = sub nsw i32 %32, %51
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 %54
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [300001 x i32], ptr %55, i64 0, i64 %57
  store i32 %52, ptr %58, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %31
  %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 %27, !llvm.loop !9

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

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

66:                                               ; preds = %17
  %67 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %85, %66
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %74 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %8)
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %77, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %80, i32 noundef %81)
  store i32 %82, ptr %6, align 4, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %85

85:                                               ; preds = %73
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !5
  br label %68, !llvm.loop !12

88:                                               ; preds = %72
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 1
  br i1 %90, label %91, label %93

91:                                               ; preds = %88
  %92 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %148

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %123, %93
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = load i32, ptr @mx, align 4, !tbaa !5
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = add nsw i32 %100, %101
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %118, %99
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = load i32, ptr @mx, align 4, !tbaa !5
  %106 = icmp sle i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %122

108:                                              ; preds = %103
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = add nsw i32 %116, %112
  store i32 %117, ptr %115, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %108
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = add nsw i32 %120, %119
  store i32 %121, ptr %10, align 4, !tbaa !5
  br label %103, !llvm.loop !13

122:                                              ; preds = %107
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %9, align 4, !tbaa !5
  br label %94, !llvm.loop !14

126:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %127 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %127, ptr %12, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %144, %126
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %145

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = load i32, ptr %12, align 4, !tbaa !5
  %135 = add nsw i32 %133, %134
  %136 = ashr i32 %135, 1
  store i32 %136, ptr %13, align 4, !tbaa !5
  %137 = load i32, ptr %13, align 4, !tbaa !5
  %138 = call noundef zeroext i1 @_Z5checki(i32 noundef %137)
  br i1 %138, label %139, label %141

139:                                              ; preds = %132
  %140 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %140, ptr %12, align 4, !tbaa !5
  br label %144

141:                                              ; preds = %132
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %11, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %141, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %128, !llvm.loop !15

145:                                              ; preds = %128
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %146)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %148

148:                                              ; preds = %145, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %149 = load i32, ptr %1, align 4
  ret i32 %149
}

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

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

; 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 @puts(ptr noundef) #3

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}


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

@n = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@c = external dso_local local_unnamed_addr global [300001 x i32], align 16
@inv = external dso_local local_unnamed_addr global [2 x [300001 x i32]], align 16
@_ZL3mod = external hidden local_unnamed_addr constant [2 x i32], align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5checki(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = load i32, ptr @_ZL3mod, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  %3 = sext i32 %2 to i64
  br label %25

4:                                                ; preds = %25
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3mod, i64 4), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 1200008), align 8, !tbaa !5
  %6 = sext i32 %5 to i64
  br label %7

7:                                                ; preds = %7, %4
  %indvars.iv.1 = phi i64 [ 2, %4 ], [ %indvars.iv.next.1, %7 ]
  %8 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %9 = sdiv i32 %5, %8
  %10 = sext i32 %9 to i64
  %11 = srem i32 %5, %8
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 1, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = mul nsw i64 %15, %10
  %17 = srem i64 %16, %6
  %18 = trunc nsw i64 %17 to i32
  %19 = sub nsw i32 %5, %18
  %20 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 1, i64 %indvars.iv.1
  store i32 %19, ptr %20, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, 300001
  br i1 %exitcond.1.not, label %21, label %7, !llvm.loop !9

21:                                               ; preds = %7
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %.preheader47

25:                                               ; preds = %0, %25
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %25 ]
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  %27 = sdiv i32 %2, %26
  %28 = sext i32 %27 to i64
  %29 = srem i32 %2, %26
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = mul nsw i64 %33, %28
  %35 = srem i64 %34, %3
  %36 = trunc nsw i64 %35 to i32
  %37 = sub nsw i32 %2, %36
  %38 = getelementptr inbounds [2 x [300001 x i32]], ptr @inv, i64 0, i64 0, i64 %indvars.iv
  store i32 %37, ptr %38, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 300001
  br i1 %exitcond.not, label %4, label %25, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %39 = icmp sgt i32 %49, 1
  br i1 %39, label %55, label %.preheader47

.preheader47:                                     ; preds = %21, %._crit_edge
  %.lcssa83 = phi i32 [ %53, %._crit_edge ], [ %23, %21 ]
  %40 = load i32, ptr @mx, align 4, !tbaa !5
  %.not58 = icmp slt i32 %40, 1
  br i1 %.not58, label %.preheader, label %.lr.ph60.preheader

.lr.ph60.preheader:                               ; preds = %.preheader47
  %41 = zext nneg i32 %40 to i64
  %42 = add nuw i32 %40, 1
  %wide.trip.count = zext i32 %42 to i64
  br label %.lr.ph60

.lr.ph:                                           ; preds = %21, %.lr.ph
  %.04251 = phi i32 [ %52, %.lr.ph ], [ 0, %21 ]
  %.04350 = phi i32 [ %49, %.lr.ph ], [ 0, %21 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %49 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %.04350, i32 noundef %44)
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %51 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %51, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %52 = add nuw nsw i32 %.04251, 1
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !11

55:                                               ; preds = %._crit_edge
  %56 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %72

.preheader:                                       ; preds = %._crit_edge57, %.preheader47
  %57 = icmp sgt i32 %.lcssa83, 1
  br i1 %57, label %.lr.ph63, label %._crit_edge64

.lr.ph60:                                         ; preds = %.lr.ph60.preheader, %._crit_edge57
  %indvars.iv74 = phi i64 [ 1, %.lr.ph60.preheader ], [ %indvars.iv.next75, %._crit_edge57 ]
  %indvars.iv72 = phi i64 [ 2, %.lr.ph60.preheader ], [ %indvars.iv.next73, %._crit_edge57 ]
  %58 = shl nuw nsw i64 %indvars.iv74, 1
  %.not4653 = icmp ugt i64 %58, %41
  br i1 %.not4653, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph60
  %59 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %indvars.iv74
  %.promoted = load i32, ptr %59, align 4, !tbaa !5
  br label %60

._crit_edge57:                                    ; preds = %60, %.lr.ph60
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 2
  %exitcond80.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
  br i1 %exitcond80.not, label %.preheader, label %.lr.ph60, !llvm.loop !12

60:                                               ; preds = %.lr.ph56, %60
  %indvars.iv76 = phi i64 [ %indvars.iv72, %.lr.ph56 ], [ %indvars.iv.next77, %60 ]
  %61 = phi i32 [ %.promoted, %.lr.ph56 ], [ %64, %60 ]
  %62 = getelementptr inbounds [300001 x i32], ptr @c, i64 0, i64 %indvars.iv76
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %61, %63
  store i32 %64, ptr %59, align 4, !tbaa !5
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, %indvars.iv74
  %65 = trunc nuw i64 %indvars.iv.next77 to i32
  %.not46 = icmp slt i32 %40, %65
  br i1 %.not46, label %._crit_edge57, label %60, !llvm.loop !13

.lr.ph63:                                         ; preds = %.preheader, %.lr.ph63
  %.03762 = phi i32 [ %.1, %.lr.ph63 ], [ %.lcssa83, %.preheader ]
  %.03861 = phi i32 [ %.139, %.lr.ph63 ], [ 1, %.preheader ]
  %66 = add nuw nsw i32 %.03762, %.03861
  %67 = lshr i32 %66, 1
  %68 = call noundef zeroext i1 @_Z5checki(i32 noundef %67)
  %69 = add nuw nsw i32 %67, 1
  %.139 = select i1 %68, i32 %.03861, i32 %69
  %.1 = select i1 %68, i32 %67, i32 %.03762
  %70 = icmp slt i32 %.139, %.1
  br i1 %70, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

._crit_edge64:                                    ; preds = %.lr.ph63, %.preheader
  %.038.lcssa = phi i32 [ 1, %.preheader ], [ %.139, %.lr.ph63 ]
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.038.lcssa)
  br label %72

72:                                               ; preds = %._crit_edge64, %55
  ret i32 0
}

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

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

; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}


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