; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/ASC/1/Problem E (E)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@m = external dso_local global [32 x [32 x i32]], align 16
@n = external dso_local global i32, align 4
@exponent = external dso_local global %"class.std::vector", align 8
@k = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5readNv() #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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4fastv() #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %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 = load ptr, ptr @stdin, align 8, !tbaa !5
  %15 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %14)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  %17 = call ptr @freopen(ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef %16)
  call void @_Z5readNv()
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef @k, ptr noundef @p)
  %19 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @exponent) #5
  %20 = icmp eq i64 %19, 1
  br i1 %20, label %21, label %28

21:                                               ; preds = %0
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @exponent, i64 noundef 0) #5
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  %26 = load i32, ptr @k, align 4, !tbaa !9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %26)
  store i32 0, ptr %1, align 4
  br label %143

28:                                               ; preds = %21, %0
  %29 = load i32, ptr @k, align 4, !tbaa !9
  %30 = shl i32 1, %29
  store i32 %30, ptr @n, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %110, %28
  %32 = load i32, ptr %2, align 4, !tbaa !9
  %33 = load i32, ptr @n, align 4, !tbaa !9
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

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

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

37:                                               ; preds = %106, %36
  %38 = load i32, ptr %4, align 4, !tbaa !9
  %39 = load i32, ptr @n, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 1, ptr %5, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %91, %42
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = load i32, ptr @k, align 4, !tbaa !9
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 8, ptr %3, align 4
  br label %94

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %49 = load i32, ptr %2, align 4, !tbaa !9
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = shl i32 1, %51
  %53 = and i32 %49, %52
  %54 = icmp sgt i32 %53, 0
  %55 = zext i1 %54 to i32
  store i32 %55, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %56 = load i32, ptr %2, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = shl i32 1, %57
  %59 = and i32 %56, %58
  %60 = icmp sgt i32 %59, 0
  %61 = zext i1 %60 to i32
  store i32 %61, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %62 = load i32, ptr %4, align 4, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = sub nsw i32 %63, 1
  %65 = shl i32 1, %64
  %66 = and i32 %62, %65
  %67 = icmp sgt i32 %66, 0
  %68 = zext i1 %67 to i32
  store i32 %68, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %69 = load i32, ptr %4, align 4, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = shl i32 1, %70
  %72 = and i32 %69, %71
  %73 = icmp sgt i32 %72, 0
  %74 = zext i1 %73 to i32
  store i32 %74, ptr %10, align 4, !tbaa !9
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %87

78:                                               ; preds = %48
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = icmp eq i32 %79, %80
  br i1 %81, label %82, label %87

82:                                               ; preds = %78
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = icmp eq i32 %83, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  store i8 0, ptr %5, align 1, !tbaa !11
  store i32 8, ptr %3, align 4
  br label %88

87:                                               ; preds = %82, %78, %48
  store i32 0, ptr %3, align 4
  br label %88

88:                                               ; preds = %87, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  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
  %89 = load i32, ptr %3, align 4
  switch i32 %89, label %94 [
    i32 0, label %90
  ]

90:                                               ; preds = %88
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !9
  br label %43, !llvm.loop !13

94:                                               ; preds = %88, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %95

95:                                               ; preds = %94
  %96 = load i8, ptr %5, align 1, !tbaa !11, !range !15, !noundef !16
  %97 = trunc i8 %96 to i1
  %98 = zext i1 %97 to i64
  %99 = select i1 %97, i32 1, i32 0
  %100 = load i32, ptr %2, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %101
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [32 x i32], ptr %102, i64 0, i64 %104
  store i32 %99, ptr %105, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  br label %106

106:                                              ; preds = %95
  %107 = load i32, ptr %4, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %4, align 4, !tbaa !9
  br label %37, !llvm.loop !17

109:                                              ; preds = %41
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %2, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %2, align 4, !tbaa !9
  br label %31, !llvm.loop !18

113:                                              ; preds = %35
  call void @_Z4fastv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %137, %113
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = load i32, ptr @n, align 4, !tbaa !9
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

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

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %133, %119
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = load i32, ptr @n, align 4, !tbaa !9
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

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

125:                                              ; preds = %120
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %127
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [32 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %132)
  br label %133

133:                                              ; preds = %125
  %134 = load i32, ptr %13, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %13, align 4, !tbaa !9
  br label %120, !llvm.loop !19

136:                                              ; preds = %124
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %12, align 4, !tbaa !9
  br label %114, !llvm.loop !20

140:                                              ; preds = %118
  %141 = load i32, ptr %11, align 4, !tbaa !9
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %141)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %143

143:                                              ; preds = %140, %25
  %144 = load i32, ptr %1, align 4
  ret i32 %144
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@m = external dso_local local_unnamed_addr global [32 x [32 x i32]], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@exponent = external dso_local global %"class.std::vector", align 8
@k = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5readNv() local_unnamed_addr #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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4fastv() local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = load ptr, ptr @stdin, align 8, !tbaa !5
  %3 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %2)
  %4 = load ptr, ptr @stdout, align 8, !tbaa !5
  %5 = tail call ptr @freopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef %4)
  tail call void @_Z5readNv()
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @k, ptr noundef nonnull @p)
  %7 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @exponent) #7
  %8 = icmp eq i64 %7, 1
  br i1 %8, label %9, label %16

9:                                                ; preds = %0
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @exponent, i64 noundef 0) #7
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %16

13:                                               ; preds = %9
  %14 = load i32, ptr @k, align 4, !tbaa !9
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %14)
  br label %63

16:                                               ; preds = %9, %0
  %17 = load i32, ptr @k, align 4, !tbaa !9
  %18 = shl nuw i32 1, %17
  store i32 %18, ptr @n, align 4, !tbaa !9
  %.not = icmp eq i32 %17, 31
  br i1 %.not, label %._crit_edge, label %.preheader45.lr.ph

.preheader45.lr.ph:                               ; preds = %16
  %19 = icmp sgt i32 %17, 1
  %smax73 = tail call i32 @llvm.smax.i32(i32 %18, i32 1)
  %wide.trip.count79 = zext nneg i32 %smax73 to i64
  br i1 %19, label %.preheader45.us.us, label %.preheader45.us.preheader

.preheader45.us.preheader:                        ; preds = %.preheader45.lr.ph
  %min.iters.check = icmp slt i32 %18, 8
  %n.vec = and i64 %wide.trip.count79, 2147483640
  %exitcond.not = icmp slt i32 %18, 2
  %exitcond.not.1 = icmp eq i32 %17, 1
  br label %.preheader45.us

.preheader45.us.us:                               ; preds = %.preheader45.lr.ph, %._crit_edge51.split.us.us.us
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %._crit_edge51.split.us.us.us ], [ 0, %.preheader45.lr.ph ]
  %20 = trunc nuw nsw i64 %indvars.iv76 to i32
  br label %.preheader44.us.us.us

.preheader44.us.us.us:                            ; preds = %._crit_edge.us.us.us, %.preheader45.us.us
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %._crit_edge.us.us.us ], [ 0, %.preheader45.us.us ]
  %21 = trunc nuw nsw i64 %indvars.iv70 to i32
  br label %22

22:                                               ; preds = %22, %.preheader44.us.us.us
  %.03647.us.us.us = phi i32 [ 1, %.preheader44.us.us.us ], [ %35, %22 ]
  %.03746.us.us.us = phi i8 [ 1, %.preheader44.us.us.us ], [ %.1.us.us.us, %22 ]
  %23 = add nsw i32 %.03647.us.us.us, -1
  %24 = lshr i32 %20, %23
  %25 = and i32 %24, 1
  %26 = lshr i32 %20, %.03647.us.us.us
  %27 = and i32 %26, 1
  %28 = lshr i32 %21, %23
  %29 = and i32 %28, 1
  %30 = lshr i32 %21, %.03647.us.us.us
  %31 = and i32 %30, 1
  %32 = icmp ne i32 %25, %27
  %33 = icmp ne i32 %27, %29
  %or.cond.not43.us.us.us = select i1 %32, i1 true, i1 %33
  %34 = icmp ne i32 %29, %31
  %or.cond40.not.us.us.us = select i1 %or.cond.not43.us.us.us, i1 true, i1 %34
  %.1.us.us.us = select i1 %or.cond40.not.us.us.us, i8 %.03746.us.us.us, i8 0
  %35 = add nuw nsw i32 %.03647.us.us.us, 1
  %36 = icmp slt i32 %35, %17
  %or.cond = select i1 %or.cond40.not.us.us.us, i1 %36, i1 false
  br i1 %or.cond, label %22, label %._crit_edge.us.us.us, !llvm.loop !11

._crit_edge.us.us.us:                             ; preds = %22
  %37 = and i8 %.1.us.us.us, 1
  %38 = zext nneg i8 %37 to i32
  %39 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv76, i64 %indvars.iv70
  store i32 %38, ptr %39, align 4, !tbaa !9
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count79
  br i1 %exitcond75.not, label %._crit_edge51.split.us.us.us, label %.preheader44.us.us.us, !llvm.loop !13

._crit_edge51.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
  br i1 %exitcond80.not, label %._crit_edge, label %.preheader45.us.us, !llvm.loop !14

.preheader45.us:                                  ; preds = %.preheader45.us.preheader, %._crit_edge51.split.us56
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge51.split.us56 ], [ 0, %.preheader45.us.preheader ]
  br i1 %min.iters.check, label %.preheader44.us54, label %vector.body

vector.body:                                      ; preds = %.preheader45.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader45.us ]
  %40 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 %index
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %40, align 16, !tbaa !9
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %41, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 8
  %42 = icmp eq i64 %index.next, %n.vec
  br i1 %42, label %._crit_edge51.split.us56, label %vector.body, !llvm.loop !15

.preheader44.us54:                                ; preds = %.preheader45.us
  %43 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 0
  store i32 1, ptr %43, align 16, !tbaa !9
  br i1 %exitcond.not, label %._crit_edge51.split.us56, label %.preheader44.us54.1, !llvm.loop !18

.preheader44.us54.1:                              ; preds = %.preheader44.us54
  %44 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 1
  store i32 1, ptr %44, align 4, !tbaa !9
  br i1 %exitcond.not.1, label %._crit_edge51.split.us56, label %.preheader44.us54.2, !llvm.loop !18

.preheader44.us54.2:                              ; preds = %.preheader44.us54.1
  %45 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 2
  store i32 1, ptr %45, align 8, !tbaa !9
  %46 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 3
  store i32 1, ptr %46, align 4, !tbaa !9
  %47 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 4
  store i32 1, ptr %47, align 16, !tbaa !9
  %48 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 5
  store i32 1, ptr %48, align 4, !tbaa !9
  %49 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv65, i64 6
  store i32 1, ptr %49, align 8, !tbaa !9
  br label %._crit_edge51.split.us56

._crit_edge51.split.us56:                         ; preds = %vector.body, %.preheader44.us54, %.preheader44.us54.1, %.preheader44.us54.2
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count79
  br i1 %exitcond69.not, label %._crit_edge, label %.preheader45.us, !llvm.loop !14

._crit_edge:                                      ; preds = %._crit_edge51.split.us56, %._crit_edge51.split.us.us.us, %16
  tail call void @_Z4fastv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !9
  %50 = load i32, ptr @n, align 4, !tbaa !9
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.preheader, label %._crit_edge61

.preheader:                                       ; preds = %._crit_edge, %._crit_edge59
  %52 = phi i32 [ %56, %._crit_edge59 ], [ %50, %._crit_edge ]
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %._crit_edge59 ], [ 0, %._crit_edge ]
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph, label %.preheader.._crit_edge59_crit_edge

.preheader.._crit_edge59_crit_edge:               ; preds = %.preheader
  %.pre87 = sext i32 %52 to i64
  br label %._crit_edge59

._crit_edge61.loopexit:                           ; preds = %._crit_edge59
  %.pre = load i32, ptr %1, align 4, !tbaa !9
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit, %._crit_edge
  %54 = phi i32 [ %.pre, %._crit_edge61.loopexit ], [ 0, %._crit_edge ]
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %54)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %63

._crit_edge59:                                    ; preds = %.lr.ph, %.preheader.._crit_edge59_crit_edge
  %.pre-phi = phi i64 [ %.pre87, %.preheader.._crit_edge59_crit_edge ], [ %61, %.lr.ph ]
  %56 = phi i32 [ %52, %.preheader.._crit_edge59_crit_edge ], [ %60, %.lr.ph ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %57 = icmp slt i64 %indvars.iv.next85, %.pre-phi
  br i1 %57, label %.preheader, label %._crit_edge61.loopexit, !llvm.loop !19

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph ], [ 0, %.preheader ]
  %58 = getelementptr inbounds [32 x [32 x i32]], ptr @m, i64 0, i64 %indvars.iv84, i64 %indvars.iv81
  %59 = load i32, ptr %58, align 4, !tbaa !9
  call void @_Z3addRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %59)
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %60 = load i32, ptr @n, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next82, %61
  br i1 %62, label %.lr.ph, label %._crit_edge59, !llvm.loop !21

63:                                               ; preds = %._crit_edge61, %13
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 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 #5 = { "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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12, !17, !16}
!19 = distinct !{!19, !12, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = distinct !{!21, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass