; LLVM IR from ShahjalalShohag/code-library :: Basics (Prefix Sum 2D)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [1005 x [1005 x i32]], align 16
@pref = external dso_local global [1005 x [1005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %23

23:                                               ; preds = %46, %0
  %24 = load i32, ptr %4, align 4, !tbaa !8
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

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

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

29:                                               ; preds = %42, %28
  %30 = load i32, ptr %6, align 4, !tbaa !8
  %31 = load i32, ptr %3, align 4, !tbaa !8
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %4, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %36
  %38 = load i32, ptr %6, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1005 x i32], ptr %37, i64 0, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %40)
  br label %42

42:                                               ; preds = %34
  %43 = load i32, ptr %6, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !8
  br label %29, !llvm.loop !11

45:                                               ; preds = %33
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %4, align 4, !tbaa !8
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !8
  br label %23, !llvm.loop !13

49:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %107, %49
  %51 = load i32, ptr %7, align 4, !tbaa !8
  %52 = load i32, ptr %2, align 4, !tbaa !8
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %103, %55
  %57 = load i32, ptr %8, align 4, !tbaa !8
  %58 = load i32, ptr %3, align 4, !tbaa !8
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %106

61:                                               ; preds = %56
  %62 = load i32, ptr %7, align 4, !tbaa !8
  %63 = sub nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %64
  %66 = load i32, ptr %8, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1005 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = load i32, ptr %7, align 4, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %71
  %73 = load i32, ptr %8, align 4, !tbaa !8
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1005 x i32], ptr %72, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !8
  %78 = add nsw i32 %69, %77
  %79 = load i32, ptr %7, align 4, !tbaa !8
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %81
  %83 = load i32, ptr %8, align 4, !tbaa !8
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1005 x i32], ptr %82, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !8
  %88 = sub nsw i32 %78, %87
  %89 = load i32, ptr %7, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %90
  %92 = load i32, ptr %8, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1005 x i32], ptr %91, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = add nsw i32 %88, %95
  %97 = load i32, ptr %7, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %98
  %100 = load i32, ptr %8, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1005 x i32], ptr %99, i64 0, i64 %101
  store i32 %96, ptr %102, align 4, !tbaa !8
  br label %103

103:                                              ; preds = %61
  %104 = load i32, ptr %8, align 4, !tbaa !8
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %8, align 4, !tbaa !8
  br label %56, !llvm.loop !14

106:                                              ; preds = %60
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %7, align 4, !tbaa !8
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %7, align 4, !tbaa !8
  br label %50, !llvm.loop !15

110:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
  br label %112

112:                                              ; preds = %116, %110
  %113 = load i32, ptr %9, align 4, !tbaa !8
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %9, align 4, !tbaa !8
  %115 = icmp ne i32 %113, 0
  br i1 %115, label %116, label %159

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %117 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %117, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %119 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %118, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %120 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %119, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !8
  %121 = load i32, ptr %12, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %122
  %124 = load i32, ptr %13, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1005 x i32], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !8
  %128 = load i32, ptr %10, align 4, !tbaa !8
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %130
  %132 = load i32, ptr %13, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1005 x i32], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = sub nsw i32 %127, %135
  %137 = load i32, ptr %12, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %138
  %140 = load i32, ptr %11, align 4, !tbaa !8
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1005 x i32], ptr %139, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = sub nsw i32 %136, %144
  %146 = load i32, ptr %10, align 4, !tbaa !8
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %148
  %150 = load i32, ptr %11, align 4, !tbaa !8
  %151 = sub nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1005 x i32], ptr %149, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !8
  %155 = add nsw i32 %145, %154
  store i32 %155, ptr %14, align 4, !tbaa !8
  %156 = load i32, ptr %14, align 4, !tbaa !8
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %156)
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %157, i8 noundef signext 10)
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %112, !llvm.loop !16

159:                                              ; preds = %112
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %160 = load i32, ptr %1, align 4
  ret i32 %160
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@a = external dso_local global [1005 x [1005 x i32]], align 16
@pref = external dso_local local_unnamed_addr global [1005 x [1005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse 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 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %16 = load i32, ptr %1, align 4, !tbaa !8
  %.not36 = icmp slt i32 %16, 1
  %17 = load i32, ptr %2, align 4
  %18 = icmp slt i32 %17, 1
  %or.cond = select i1 %.not36, i1 true, i1 %18
  br i1 %or.cond, label %._crit_edge44, label %.preheader33

.preheader33:                                     ; preds = %0, %._crit_edge
  %19 = phi i32 [ %24, %._crit_edge ], [ %16, %0 ]
  %20 = phi i32 [ %25, %._crit_edge ], [ %17, %0 ]
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %._crit_edge ], [ 1, %0 ]
  %.not2834 = icmp slt i32 %20, 1
  br i1 %.not2834, label %._crit_edge, label %.lr.ph

.preheader32:                                     ; preds = %._crit_edge
  %.not2542 = icmp slt i32 %24, 1
  br i1 %.not2542, label %._crit_edge44, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader32
  %.pr = load i32, ptr %2, align 4, !tbaa !8
  %.not2738 = icmp slt i32 %.pr, 1
  br i1 %.not2738, label %._crit_edge44, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %21 = add nuw i32 %24, 1
  %wide.trip.count62 = zext i32 %21 to i64
  %.pre66.pre = load i32, ptr @pref, align 16, !tbaa !8
  %22 = zext nneg i32 %.pr to i64
  %xtraiter = and i64 %22, 1
  %23 = icmp eq i32 %.pr, 1
  %unroll_iter = and i64 %22, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader33
  %24 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %19, %.preheader33 ]
  %25 = phi i32 [ %29, %._crit_edge.loopexit ], [ %20, %.preheader33 ]
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %26 = sext i32 %24 to i64
  %.not.not = icmp slt i64 %indvars.iv53, %26
  br i1 %.not.not, label %.preheader33, label %.preheader32, !llvm.loop !11

.lr.ph:                                           ; preds = %.preheader33, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader33 ]
  %27 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %indvars.iv53, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %.not28.not = icmp slt i64 %indvars.iv, %30
  br i1 %.not28.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !14

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge41
  %.pre66 = phi i32 [ %.pre66.pre, %.preheader.preheader ], [ %.pre64, %._crit_edge41 ]
  %indvars.iv59 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next60, %._crit_edge41 ]
  %31 = add nsw i64 %indvars.iv59, -1
  %.phi.trans.insert = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %indvars.iv59, i64 0
  %.pre64 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !8
  br i1 %23, label %._crit_edge41.unr-lcssa, label %.preheader.new

._crit_edge44:                                    ; preds = %._crit_edge41, %0, %.preheader.lr.ph, %.preheader32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %3, align 4, !tbaa !8
  %.not2645 = icmp eq i32 %33, 0
  br i1 %.not2645, label %._crit_edge48, label %.lr.ph47

._crit_edge41.unr-lcssa:                          ; preds = %.preheader.new, %.preheader
  %.unr = phi i32 [ %.pre66, %.preheader ], [ %54, %.preheader.new ]
  %.unr80 = phi i32 [ %.pre64, %.preheader ], [ %59, %.preheader.new ]
  %indvars.iv56.unr = phi i64 [ 1, %.preheader ], [ %indvars.iv.next57.1, %.preheader.new ]
  br i1 %lcmp.mod.not, label %._crit_edge41, label %._crit_edge41.epilog-lcssa

._crit_edge41.epilog-lcssa:                       ; preds = %._crit_edge41.unr-lcssa
  %35 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %31, i64 %indvars.iv56.unr
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = add nsw i32 %.unr80, %36
  %38 = sub i32 %37, %.unr
  %39 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %indvars.iv59, i64 %indvars.iv56.unr
  %40 = load i32, ptr %39, align 4, !tbaa !8
  %41 = add nsw i32 %38, %40
  %42 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %indvars.iv59, i64 %indvars.iv56.unr
  store i32 %41, ptr %42, align 4, !tbaa !8
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.unr-lcssa, %._crit_edge41.epilog-lcssa
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count62
  br i1 %exitcond63.not, label %._crit_edge44, label %.preheader, !llvm.loop !15

.preheader.new:                                   ; preds = %.preheader, %.preheader.new
  %43 = phi i32 [ %54, %.preheader.new ], [ %.pre66, %.preheader ]
  %44 = phi i32 [ %59, %.preheader.new ], [ %.pre64, %.preheader ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57.1, %.preheader.new ], [ 1, %.preheader ]
  %niter = phi i64 [ %niter.next.1, %.preheader.new ], [ 0, %.preheader ]
  %45 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %31, i64 %indvars.iv56
  %46 = load i32, ptr %45, align 4, !tbaa !8
  %47 = add nsw i32 %44, %46
  %48 = sub i32 %47, %43
  %49 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %indvars.iv59, i64 %indvars.iv56
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = add nsw i32 %48, %50
  %52 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %indvars.iv59, i64 %indvars.iv56
  store i32 %51, ptr %52, align 4, !tbaa !8
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %53 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %31, i64 %indvars.iv.next57
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = add nsw i32 %51, %54
  %56 = sub i32 %55, %46
  %57 = getelementptr inbounds [1005 x [1005 x i32]], ptr @a, i64 0, i64 %indvars.iv59, i64 %indvars.iv.next57
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = add nsw i32 %56, %58
  %60 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %indvars.iv59, i64 %indvars.iv.next57
  store i32 %59, ptr %60, align 4, !tbaa !8
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge41.unr-lcssa, label %.preheader.new, !llvm.loop !16

.lr.ph47:                                         ; preds = %._crit_edge44, %.lr.ph47
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %61, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %65 = load i32, ptr %6, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = load i32, ptr %7, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %66, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !8
  %71 = load i32, ptr %4, align 4, !tbaa !8
  %72 = add nsw i32 %71, -1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %73, i64 %68
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = load i32, ptr %5, align 4, !tbaa !8
  %77 = add nsw i32 %76, -1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %66, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = getelementptr inbounds [1005 x [1005 x i32]], ptr @pref, i64 0, i64 %73, i64 %78
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = add i32 %75, %80
  %84 = sub i32 %70, %83
  %85 = add nsw i32 %84, %82
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %85)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %86, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %88 = load i32, ptr %3, align 4, !tbaa !8
  %89 = add nsw i32 %88, -1
  store i32 %89, ptr %3, align 4, !tbaa !8
  %.not26 = icmp eq i32 %88, 0
  br i1 %.not26, label %._crit_edge48, label %.lr.ph47, !llvm.loop !17

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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