; LLVM IR from tangjz/acm-icpc :: lydsy (5535)

; 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
@m = external dso_local global i32, align 4
@c = external dso_local global [19 x [1000001 x i32]], align 16
@buf = external dso_local global [1000001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = 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 i8, align 1
  %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
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @buf)
  store i32 0, ptr @m, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %23, %0
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = shl i32 2, %18
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %22, label %26

22:                                               ; preds = %17
  br label %23

23:                                               ; preds = %22
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @m, align 4, !tbaa !5
  br label %17, !llvm.loop !9

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

27:                                               ; preds = %85, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %38, %44
  %46 = zext i1 %45 to i8
  store i8 %46, ptr %4, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %81, %33
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %47
  %53 = load i8, ptr %4, align 1, !tbaa !12, !range !14, !noundef !15
  %54 = trunc i8 %53 to i1
  %55 = zext i1 %54 to i32
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = shl i32 1, %57
  %59 = icmp slt i32 %56, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  br label %72

61:                                               ; preds = %52
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %63
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = shl i32 1, %66
  %68 = sub nsw i32 %65, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1000001 x i32], ptr %64, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %61, %60
  %73 = phi i32 [ 0, %60 ], [ %71, %61 ]
  %74 = add nsw i32 %55, %73
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %76
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1000001 x i32], ptr %77, i64 0, i64 %79
  store i32 %74, ptr %80, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %72
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %5, align 4, !tbaa !5
  br label %47, !llvm.loop !16

84:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !17

88:                                               ; preds = %32
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  br label %90

90:                                               ; preds = %171, %88
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr @n, align 4, !tbaa !5
  %93 = icmp ne i32 %91, 0
  br i1 %93, label %94, label %176

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sub nsw i32 %96, %97
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !5
  store i32 0, ptr @m, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %106, %94
  %101 = load i32, ptr @m, align 4, !tbaa !5
  %102 = shl i32 1, %101
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %109

105:                                              ; preds = %100
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr @m, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr @m, align 4, !tbaa !5
  br label %100, !llvm.loop !18

109:                                              ; preds = %100
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr @m, align 4, !tbaa !5
  %112 = shl i32 1, %111
  %113 = icmp eq i32 %110, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  br label %117

115:                                              ; preds = %109
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 19, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

116:                                              ; No predecessors!
  br label %117

117:                                              ; preds = %116, %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %168, %117
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = load i32, ptr @m, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

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

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = shl i32 1, %127
  %129 = sub nsw i32 %125, %128
  store i32 %129, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = sub nsw i32 %130, %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = ashr i32 %132, %133
  store i32 %134, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = shl i32 %136, %137
  %139 = add nsw i32 %135, %138
  store i32 %139, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %141
  %143 = load i32, ptr %13, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1000001 x i32], ptr %142, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %123
  br label %158

150:                                              ; preds = %123
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %152
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1000001 x i32], ptr %153, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %150, %149
  %159 = phi i32 [ 0, %149 ], [ %157, %150 ]
  %160 = sub nsw i32 %146, %159
  store i32 %160, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = load i32, ptr %14, align 4, !tbaa !5
  %163 = sub nsw i32 %161, %162
  store i32 %163, ptr %15, align 4, !tbaa !5
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = add nsw i32 %166, %165
  store i32 %167, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %168

168:                                              ; preds = %158
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %10, align 4, !tbaa !5
  br label %118, !llvm.loop !19

171:                                              ; preds = %122
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  %174 = ashr i32 %173, 1
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %174)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %90, !llvm.loop !20

176:                                              ; preds = %90
  ret i32 0
}

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

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

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

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

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

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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 }
attributes #6 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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
@m = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local local_unnamed_addr global [19 x [1000001 x i32]], align 16
@buf = external dso_local global [1000001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [64 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = 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
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @buf)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %7, %0
  %storemerge = phi i32 [ 0, %0 ], [ %9, %7 ]
  %8 = shl i32 2, %storemerge
  %.not = icmp sgt i32 %8, %6
  %9 = add nuw nsw i32 %storemerge, 1
  br i1 %.not, label %.preheader43, label %7, !llvm.loop !9

.preheader43:                                     ; preds = %7
  store i32 %storemerge, ptr @m, align 4, !tbaa !5
  %10 = icmp sgt i32 %6, 1
  %11 = icmp ugt i32 %storemerge, 1
  %or.cond = and i1 %10, %11
  br i1 %or.cond, label %.lr.ph.us.preheader, label %._crit_edge

.lr.ph.us.preheader:                              ; preds = %.preheader43
  %12 = add nsw i32 %6, -1
  %wide.trip.count67 = zext nneg i32 %12 to i64
  %wide.trip.count = zext nneg i32 %storemerge to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv62 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next63, %..loopexit_crit_edge.us ]
  %indvars.iv60 = phi i64 [ 1, %.lr.ph.us.preheader ], [ %indvars.iv.next61, %..loopexit_crit_edge.us ]
  %13 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %indvars.iv62
  %14 = load i8, ptr %13, align 1, !tbaa !11
  %15 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %indvars.iv60
  %16 = load i8, ptr %15, align 1, !tbaa !11
  %17 = icmp eq i8 %14, %16
  %18 = zext i1 %17 to i32
  %19 = trunc nuw nsw i64 %indvars.iv62 to i32
  br label %20

20:                                               ; preds = %.lr.ph.us, %30
  %indvars.iv = phi i64 [ 1, %.lr.ph.us ], [ %indvars.iv.next, %30 ]
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  %22 = shl nuw i32 1, %21
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv62, %23
  br i1 %24, label %30, label %25

25:                                               ; preds = %20
  %26 = sub nsw i32 %19, %22
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %indvars.iv, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %25, %20
  %31 = phi i32 [ %29, %25 ], [ 0, %20 ]
  %32 = add nsw i32 %31, %18
  %33 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %indvars.iv, i64 %indvars.iv62
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %..loopexit_crit_edge.us, label %20, !llvm.loop !12

..loopexit_crit_edge.us:                          ; preds = %30
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count67
  br i1 %exitcond68.not, label %._crit_edge, label %.lr.ph.us, !llvm.loop !13

._crit_edge:                                      ; preds = %..loopexit_crit_edge.us, %.preheader43
  %34 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr @n, align 4, !tbaa !5
  %.not4052 = icmp eq i32 %35, 0
  br i1 %.not4052, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge, %._crit_edge51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sub nsw i32 %38, %39
  br label %41

41:                                               ; preds = %41, %.lr.ph54
  %42 = phi i32 [ 0, %.lr.ph54 ], [ %44, %41 ]
  %43 = shl nuw i32 1, %42
  %.not42 = icmp sgt i32 %43, %40
  %44 = add nuw nsw i32 %42, 1
  br i1 %.not42, label %45, label %41, !llvm.loop !14

45:                                               ; preds = %41
  %46 = add nsw i32 %40, 1
  store i32 %42, ptr @m, align 4, !tbaa !5
  %47 = icmp eq i32 %46, %43
  br i1 %47, label %.preheader, label %49

.preheader:                                       ; preds = %45
  %48 = icmp ugt i32 %42, 1
  br i1 %48, label %.lr.ph, label %._crit_edge51

49:                                               ; preds = %45
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 19, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #6
  unreachable

._crit_edge51:                                    ; preds = %74, %.preheader
  %.034.lcssa = phi i32 [ 0, %.preheader ], [ %80, %74 ]
  %50 = add nsw i32 %.034.lcssa, 1
  %51 = ashr i32 %50, 1
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %51)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr @n, align 4, !tbaa !5
  %.not40 = icmp eq i32 %53, 0
  br i1 %.not40, label %._crit_edge55, label %.lr.ph54, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader, %74
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %74 ], [ 1, %.preheader ]
  %.03449 = phi i32 [ %80, %74 ], [ 0, %.preheader ]
  %55 = load i32, ptr %1, align 4, !tbaa !5
  %56 = trunc i64 %indvars.iv69 to i32
  %57 = add i32 %56, -1
  %.neg = shl nsw i32 -1, %57
  %58 = add i32 %.neg, -1
  %59 = add i32 %58, %55
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = sub nsw i32 %60, %59
  %62 = trunc nuw nsw i64 %indvars.iv69 to i32
  %63 = ashr i32 %61, %62
  %64 = shl i32 %63, %62
  %65 = add nsw i32 %64, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %indvars.iv69, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp slt i32 %59, 0
  br i1 %69, label %74, label %70

70:                                               ; preds = %.lr.ph
  %71 = zext nneg i32 %59 to i64
  %72 = getelementptr inbounds [19 x [1000001 x i32]], ptr @c, i64 0, i64 %indvars.iv69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %.lr.ph, %70
  %75 = phi i32 [ %73, %70 ], [ 0, %.lr.ph ]
  %76 = sub nsw i32 %68, %75
  store i32 %76, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %77 = sub nsw i32 %63, %76
  store i32 %77, ptr %4, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %79, %.03449
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next70, %82
  br i1 %83, label %.lr.ph, label %._crit_edge51, !llvm.loop !16

._crit_edge55:                                    ; preds = %._crit_edge51, %._crit_edge
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_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 #1

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 }
attributes #6 = { 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 = !{!7, !7, i64 0}
!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,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass