; LLVM IR from tangjz/acm-icpc :: 51nod (1301)

; 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
@f = external dso_local global [2 x [2 x [2049 x i32]]], align 16
@.str = external hidden unnamed_addr constant [5 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
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %16 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %16, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %22, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %21, label %25

21:                                               ; preds = %17
  br label %22

22:                                               ; preds = %21
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = shl i32 %23, 1
  store i32 %24, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !9

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

26:                                               ; preds = %195, %25
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %33
  %35 = getelementptr inbounds [2 x [2049 x i32]], ptr %34, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %35, i8 0, i64 16392, i1 false)
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %37
  %39 = getelementptr inbounds [2 x [2049 x i32]], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds [2049 x i32], ptr %39, i64 0, i64 0
  store i32 1, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %170, %31
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %173

46:                                               ; preds = %41
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = xor i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = xor i32 %49, 1
  store i32 %50, ptr %8, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %52
  %54 = getelementptr inbounds [2 x [2049 x i32]], ptr %53, i64 0, i64 0
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %56
  %58 = getelementptr inbounds [2 x [2049 x i32]], ptr %57, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %54, ptr align 8 %58, i64 16392, i1 false)
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %62, label %107

62:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %103, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %106

68:                                               ; preds = %63
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %70
  %72 = getelementptr inbounds [2 x [2049 x i32]], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [2049 x i32], ptr %72, i64 0, i64 %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %77
  %79 = getelementptr inbounds [2 x [2049 x i32]], ptr %78, i64 0, i64 0
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = xor i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2049 x i32], ptr %79, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %75, i32 noundef %85)
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %87
  %89 = getelementptr inbounds [2 x [2049 x i32]], ptr %88, i64 0, i64 1
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [2049 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %94
  %96 = getelementptr inbounds [2 x [2049 x i32]], ptr %95, i64 0, i64 1
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = xor i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [2049 x i32], ptr %96, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %92, i32 noundef %102)
  br label %103

103:                                              ; preds = %68
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !5
  br label %63, !llvm.loop !11

106:                                              ; preds = %67
  br label %107

107:                                              ; preds = %106, %46
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = load i32, ptr @m, align 4, !tbaa !5
  %110 = icmp sle i32 %108, %109
  br i1 %110, label %111, label %169

111:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = and i32 %112, %113
  %115 = icmp ne i32 %114, 0
  %116 = xor i1 %115, true
  %117 = xor i1 %116, true
  %118 = zext i1 %117 to i32
  store i32 %118, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %165, %111
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %168

124:                                              ; preds = %119
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %126
  %128 = getelementptr inbounds [2 x [2049 x i32]], ptr %127, i64 0, i64 0
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2049 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %133
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2 x [2049 x i32]], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = load i32, ptr %12, align 4, !tbaa !5
  %140 = xor i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [2049 x i32], ptr %137, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %131, i32 noundef %143)
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %145
  %147 = getelementptr inbounds [2 x [2049 x i32]], ptr %146, i64 0, i64 1
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [2049 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %152
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = icmp ne i32 %154, 0
  %156 = xor i1 %155, true
  %157 = zext i1 %156 to i64
  %158 = getelementptr inbounds [2 x [2049 x i32]], ptr %153, i64 0, i64 %157
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = xor i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [2049 x i32], ptr %158, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %150, i32 noundef %164)
  br label %165

165:                                              ; preds = %124
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %12, align 4, !tbaa !5
  br label %119, !llvm.loop !12

168:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %169

169:                                              ; preds = %168, %107
  br label %170

170:                                              ; preds = %169
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %9, align 4, !tbaa !5
  br label %41, !llvm.loop !13

173:                                              ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %174 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %174, ptr %13, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %191, %173
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = load i32, ptr %5, align 4, !tbaa !5
  %179 = add nsw i32 %177, %178
  %180 = icmp slt i32 %176, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %175
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %194

182:                                              ; preds = %175
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %184
  %186 = getelementptr inbounds [2 x [2049 x i32]], ptr %185, i64 0, i64 1
  %187 = load i32, ptr %13, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [2049 x i32], ptr %186, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef %190)
  br label %191

191:                                              ; preds = %182
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %13, align 4, !tbaa !5
  br label %175, !llvm.loop !14

194:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %5, align 4, !tbaa !5
  %197 = shl i32 %196, 1
  store i32 %197, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !15

198:                                              ; preds = %30
  %199 = load i32, ptr %4, align 4, !tbaa !5
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %199)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %201 = load i32, ptr %1, align 4
  ret i32 %201
}

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: 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)) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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
@m = external dso_local global i32, align 4
@f = external dso_local global [2 x [2 x [2049 x i32]]], align 16
@.str = external hidden unnamed_addr constant [5 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
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %3 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %4 = load i32, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %5, %0
  %.060 = phi i32 [ 1, %0 ], [ %6, %5 ]
  %.not = icmp sgt i32 %.060, %4
  %6 = shl i32 %.060, 1
  br i1 %.not, label %.preheader69, label %5, !llvm.loop !9

.preheader69:                                     ; preds = %5
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %.not6282 = icmp slt i32 %7, 1
  br i1 %.not6282, label %._crit_edge, label %.lr.ph84

.lr.ph84:                                         ; preds = %.preheader69
  %.not6373 = icmp slt i32 %4, 1
  %8 = icmp slt i32 %.060, 1
  %9 = icmp slt i32 %.060, 1
  br i1 %.not6373, label %.preheader67.us, label %.lr.ph78.preheader

.lr.ph78.preheader:                               ; preds = %.lr.ph84
  %wide.trip.count = zext nneg i32 %.060 to i64
  %wide.trip.count91 = zext nneg i32 %.060 to i64
  br label %.lr.ph78

.preheader67.us:                                  ; preds = %.lr.ph84, %.loopexit68.us
  %10 = phi i32 [ %16, %.loopexit68.us ], [ %7, %.lr.ph84 ]
  %.05983.us = phi i32 [ %11, %.loopexit68.us ], [ 1, %.lr.ph84 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16392) @f, i8 0, i64 16392, i1 false)
  store i32 1, ptr @f, align 16, !tbaa !5
  %11 = shl nsw i32 %.05983.us, 1
  %12 = icmp slt i32 %.05983.us, %11
  br i1 %12, label %.lr.ph80.us.preheader, label %.loopexit68.us

.lr.ph80.us.preheader:                            ; preds = %.preheader67.us
  %13 = sext i32 %.05983.us to i64
  br label %.lr.ph80.us

.lr.ph80.us:                                      ; preds = %.lr.ph80.us.preheader, %.lr.ph80.us
  %indvars.iv98 = phi i64 [ %13, %.lr.ph80.us.preheader ], [ %indvars.iv.next99, %.lr.ph80.us ]
  %14 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 0, i64 1, i64 %indvars.iv98
  %15 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %15)
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, 1
  %lftr.wideiv101 = trunc i64 %indvars.iv.next99 to i32
  %exitcond102.not = icmp eq i32 %11, %lftr.wideiv101
  br i1 %exitcond102.not, label %.loopexit68.us.loopexit, label %.lr.ph80.us, !llvm.loop !11

.loopexit68.us.loopexit:                          ; preds = %.lr.ph80.us
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.loopexit68.us

.loopexit68.us:                                   ; preds = %.loopexit68.us.loopexit, %.preheader67.us
  %16 = phi i32 [ %.pre, %.loopexit68.us.loopexit ], [ %10, %.preheader67.us ]
  %.not62.us = icmp sgt i32 %11, %16
  br i1 %.not62.us, label %._crit_edge, label %.preheader67.us, !llvm.loop !12

.loopexit68:                                      ; preds = %61, %..preheader67_crit_edge
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %.not62 = icmp sgt i32 %20, %17
  br i1 %.not62, label %._crit_edge, label %.lr.ph78, !llvm.loop !12

._crit_edge:                                      ; preds = %.loopexit68, %.loopexit68.us, %.preheader69
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %.loopexit68
  %.05983 = phi i32 [ %20, %.loopexit68 ], [ 1, %.lr.ph78.preheader ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16392) @f, i8 0, i64 16392, i1 false)
  store i32 1, ptr @f, align 16, !tbaa !5
  br label %23

..preheader67_crit_edge:                          ; preds = %.loopexit
  %20 = shl nsw i32 %.05983, 1
  %21 = icmp slt i32 %.05983, %20
  br i1 %21, label %.lr.ph80, label %.loopexit68

.lr.ph80:                                         ; preds = %..preheader67_crit_edge
  %22 = sext i32 %.05983 to i64
  br label %61

23:                                               ; preds = %.lr.ph78, %.loopexit
  %.05676 = phi i32 [ 1, %.lr.ph78 ], [ %60, %.loopexit ]
  %.05775 = phi i32 [ 1, %.lr.ph78 ], [ %25, %.loopexit ]
  %.05874 = phi i32 [ 0, %.lr.ph78 ], [ %24, %.loopexit ]
  %24 = xor i32 %.05874, 1
  %25 = xor i32 %.05775, 1
  %26 = zext nneg i32 %24 to i64
  %27 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %26
  %28 = zext nneg i32 %25 to i64
  %29 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %28
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16392) %27, ptr noundef nonnull align 8 dereferenceable(16392) %29, i64 16392, i1 false)
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %.not64 = icmp sgt i32 %.05676, %30
  %brmerge = or i1 %.not64, %8
  br i1 %brmerge, label %.loopexit66, label %.lr.ph

.lr.ph:                                           ; preds = %23
  %31 = getelementptr inbounds i8, ptr %27, i64 8196
  %32 = getelementptr inbounds i8, ptr %29, i64 8196
  br label %33

33:                                               ; preds = %.lr.ph, %33
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %33 ]
  %34 = getelementptr inbounds [2049 x i32], ptr %27, i64 0, i64 %indvars.iv
  %35 = trunc nuw nsw i64 %indvars.iv to i32
  %36 = xor i32 %.05676, %35
  %37 = zext nneg i32 %36 to i64
  %38 = getelementptr inbounds [2049 x i32], ptr %29, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %34, i32 noundef %39)
  %40 = getelementptr inbounds [2049 x i32], ptr %31, i64 0, i64 %indvars.iv
  %41 = getelementptr inbounds [2049 x i32], ptr %32, i64 0, i64 %37
  %42 = load i32, ptr %41, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %40, i32 noundef %42)
  %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 %.loopexit66, label %33, !llvm.loop !13

.loopexit66:                                      ; preds = %33, %23
  %43 = load i32, ptr @m, align 4, !tbaa !5
  %.not65 = icmp sgt i32 %.05676, %43
  %brmerge105 = or i1 %.not65, %9
  br i1 %brmerge105, label %.loopexit, label %.lr.ph72

.lr.ph72:                                         ; preds = %.loopexit66
  %44 = and i32 %.05676, %.05983
  %45 = icmp ne i32 %44, 0
  %46 = xor i1 %45, true
  %47 = zext i1 %45 to i64
  %48 = getelementptr inbounds i8, ptr %27, i64 8196
  %49 = zext i1 %46 to i64
  br label %50

50:                                               ; preds = %.lr.ph72, %50
  %indvars.iv88 = phi i64 [ 0, %.lr.ph72 ], [ %indvars.iv.next89, %50 ]
  %51 = getelementptr inbounds [2049 x i32], ptr %27, i64 0, i64 %indvars.iv88
  %52 = trunc nuw nsw i64 %indvars.iv88 to i32
  %53 = xor i32 %.05676, %52
  %54 = zext nneg i32 %53 to i64
  %55 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %28, i64 %47, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %51, i32 noundef %56)
  %57 = getelementptr inbounds [2049 x i32], ptr %48, i64 0, i64 %indvars.iv88
  %58 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %28, i64 %49, i64 %54
  %59 = load i32, ptr %58, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %57, i32 noundef %59)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
  br i1 %exitcond92.not, label %.loopexit, label %50, !llvm.loop !14

.loopexit:                                        ; preds = %50, %.loopexit66
  %60 = add nuw i32 %.05676, 1
  %exitcond93.not = icmp eq i32 %.05676, %4
  br i1 %exitcond93.not, label %..preheader67_crit_edge, label %23, !llvm.loop !15

61:                                               ; preds = %.lr.ph80, %61
  %indvars.iv94 = phi i64 [ %22, %.lr.ph80 ], [ %indvars.iv.next95, %61 ]
  %62 = getelementptr inbounds [2 x [2 x [2049 x i32]]], ptr @f, i64 0, i64 %26, i64 1, i64 %indvars.iv94
  %63 = load i32, ptr %62, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %63)
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next95 to i32
  %exitcond97.not = icmp eq i32 %20, %lftr.wideiv
  br i1 %exitcond97.not, label %.loopexit68, label %61, !llvm.loop !11
}

; 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: 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 #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

; 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass