; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/MC (mc)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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 }

@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1TB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@l1 = external dso_local global i32, align 4
@l2 = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = 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 [1001 x [1001 x i32]], align 16
  %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
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4008004, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  br label %10

10:                                               ; preds = %122, %0
  %11 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef 0)
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = sext i8 %12 to i32
  %14 = icmp ne i32 %13, 35
  br i1 %14, label %15, label %141

15:                                               ; preds = %10
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11)
  %17 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11) #5
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr @l1, align 4, !tbaa !8
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11) #5
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr @l2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %21

21:                                               ; preds = %31, %15
  %22 = load i32, ptr %4, align 4, !tbaa !8
  %23 = load i32, ptr @l1, align 4, !tbaa !8
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %34

26:                                               ; preds = %21
  %27 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 0
  %28 = load i32, ptr %4, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1001 x i32], ptr %27, i64 0, i64 %29
  store i32 0, ptr %30, align 4, !tbaa !8
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !8
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !8
  br label %21, !llvm.loop !10

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %35

35:                                               ; preds = %45, %34
  %36 = load i32, ptr %5, align 4, !tbaa !8
  %37 = load i32, ptr @l2, align 4, !tbaa !8
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %48

40:                                               ; preds = %35
  %41 = load i32, ptr %5, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %42
  %44 = getelementptr inbounds [1001 x i32], ptr %43, i64 0, i64 0
  store i32 0, ptr %44, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %40
  %46 = load i32, ptr %5, align 4, !tbaa !8
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !8
  br label %35, !llvm.loop !12

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

49:                                               ; preds = %119, %48
  %50 = load i32, ptr %6, align 4, !tbaa !8
  %51 = load i32, ptr @l1, align 4, !tbaa !8
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %122

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

55:                                               ; preds = %115, %54
  %56 = load i32, ptr %8, align 4, !tbaa !8
  %57 = load i32, ptr @l2, align 4, !tbaa !8
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %55
  %61 = load i32, ptr %6, align 4, !tbaa !8
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %63)
  %65 = load i8, ptr %64, align 1, !tbaa !5
  %66 = sext i8 %65 to i32
  %67 = load i32, ptr %8, align 4, !tbaa !8
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11, i64 noundef %69)
  %71 = load i8, ptr %70, align 1, !tbaa !5
  %72 = sext i8 %71 to i32
  %73 = icmp eq i32 %66, %72
  br i1 %73, label %74, label %91

74:                                               ; preds = %60
  %75 = load i32, ptr %6, align 4, !tbaa !8
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %77
  %79 = load i32, ptr %8, align 4, !tbaa !8
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1001 x i32], ptr %78, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %86
  %88 = load i32, ptr %8, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1001 x i32], ptr %87, i64 0, i64 %89
  store i32 %84, ptr %90, align 4, !tbaa !8
  br label %114

91:                                               ; preds = %60
  %92 = load i32, ptr %6, align 4, !tbaa !8
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %94
  %96 = load i32, ptr %8, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1001 x i32], ptr %95, i64 0, i64 %97
  %99 = load i32, ptr %6, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %100
  %102 = load i32, ptr %8, align 4, !tbaa !8
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1001 x i32], ptr %101, i64 0, i64 %104
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %98, ptr noundef nonnull align 4 dereferenceable(4) %105)
  %107 = load i32, ptr %106, align 4, !tbaa !8
  %108 = load i32, ptr %6, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %109
  %111 = load i32, ptr %8, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1001 x i32], ptr %110, i64 0, i64 %112
  store i32 %107, ptr %113, align 4, !tbaa !8
  br label %114

114:                                              ; preds = %91, %74
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %8, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %8, align 4, !tbaa !8
  br label %55, !llvm.loop !13

118:                                              ; preds = %59
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %6, align 4, !tbaa !8
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !8
  br label %49, !llvm.loop !14

122:                                              ; preds = %53
  %123 = load i32, ptr @l1, align 4, !tbaa !8
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1001 x [1001 x i32]], ptr %2, i64 0, i64 %124
  %126 = load i32, ptr @l2, align 4, !tbaa !8
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [1001 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !8
  store i32 %129, ptr %3, align 4, !tbaa !8
  %130 = load i32, ptr @l1, align 4, !tbaa !8
  %131 = load i32, ptr %3, align 4, !tbaa !8
  %132 = sub nsw i32 %130, %131
  %133 = mul nsw i32 %132, 15
  %134 = load i32, ptr @l2, align 4, !tbaa !8
  %135 = load i32, ptr %3, align 4, !tbaa !8
  %136 = sub nsw i32 %134, %135
  %137 = mul nsw i32 %136, 30
  %138 = add nsw i32 %133, %137
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  br label %10, !llvm.loop !15

141:                                              ; preds = %10
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4008004, ptr %2) #5
  %142 = load i32, ptr %1, align 4
  ret i32 %142
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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)) #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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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 }

@_Z1SB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1TB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@l1 = external dso_local local_unnamed_addr global i32, align 4
@l2 = external dso_local local_unnamed_addr global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [1001 x [1001 x i32]], align 16
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4008004, ptr nonnull %1) #7
  %3 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef 0)
  %4 = load i8, ptr %3, align 1, !tbaa !5
  %.not46 = icmp eq i8 %4, 35
  br i1 %.not46, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %0, %._crit_edge45
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11)
  %6 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11) #7
  %7 = trunc i64 %6 to i32
  store i32 %7, ptr @l1, align 4, !tbaa !8
  %8 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11) #7
  %9 = trunc i64 %8 to i32
  store i32 %9, ptr @l2, align 4, !tbaa !8
  %10 = load i32, ptr @l1, align 4, !tbaa !8
  %.not2935 = icmp slt i32 %10, 0
  br i1 %.not2935, label %.preheader34, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph48
  %11 = add nuw i32 %10, 1
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %12, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %1, i8 0, i64 %13, i1 false), !tbaa !8
  br label %.preheader34

.preheader34:                                     ; preds = %.lr.ph.preheader, %.lr.ph48
  %.not3037 = icmp slt i32 %9, 0
  br i1 %.not3037, label %.preheader33, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %.preheader34
  %14 = add nuw nsw i64 %8, 1
  %wide.trip.count = and i64 %14, 4294967295
  %15 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 3
  %16 = icmp ult i64 %15, 3
  br i1 %16, label %.preheader33.loopexit.unr-lcssa, label %.lr.ph39.preheader.new

.lr.ph39.preheader.new:                           ; preds = %.lr.ph39.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph39

.preheader33.loopexit.unr-lcssa:                  ; preds = %.lr.ph39, %.lr.ph39.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph39.preheader ], [ %indvars.iv.next.3, %.lr.ph39 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader33, label %.lr.ph39.epil

.lr.ph39.epil:                                    ; preds = %.preheader33.loopexit.unr-lcssa, %.lr.ph39.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph39.epil ], [ %indvars.iv.unr, %.preheader33.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph39.epil ], [ 0, %.preheader33.loopexit.unr-lcssa ]
  %17 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv.epil
  store i32 0, ptr %17, align 4, !tbaa !8
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader33, label %.lr.ph39.epil, !llvm.loop !10

.preheader33:                                     ; preds = %.preheader33.loopexit.unr-lcssa, %.lr.ph39.epil, %.preheader34
  %.not3143 = icmp slt i32 %10, 1
  %18 = icmp slt i32 %9, 1
  %or.cond = or i1 %.not3143, %18
  br i1 %or.cond, label %._crit_edge45, label %.preheader

.lr.ph39:                                         ; preds = %.lr.ph39, %.lr.ph39.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph39.preheader.new ], [ %indvars.iv.next.3, %.lr.ph39 ]
  %niter = phi i64 [ 0, %.lr.ph39.preheader.new ], [ %niter.next.3, %.lr.ph39 ]
  %19 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv
  store i32 0, ptr %19, align 16, !tbaa !8
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %20 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %20, align 4, !tbaa !8
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %21 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv.next.1
  store i32 0, ptr %21, align 8, !tbaa !8
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %22 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv.next.2
  store i32 0, ptr %22, align 4, !tbaa !8
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader33.loopexit.unr-lcssa, label %.lr.ph39, !llvm.loop !12

.preheader:                                       ; preds = %.preheader33, %._crit_edge
  %23 = phi i32 [ %40, %._crit_edge ], [ %10, %.preheader33 ]
  %24 = phi i32 [ %41, %._crit_edge ], [ %9, %.preheader33 ]
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %._crit_edge ], [ 1, %.preheader33 ]
  %.not3240 = icmp slt i32 %24, 1
  br i1 %.not3240, label %._crit_edge, label %.lr.ph42

.lr.ph42:                                         ; preds = %.preheader
  %25 = add nsw i64 %indvars.iv57, -1
  br label %43

._crit_edge45:                                    ; preds = %._crit_edge, %.preheader33
  %26 = phi i32 [ %9, %.preheader33 ], [ %41, %._crit_edge ]
  %.lcssa = phi i32 [ %10, %.preheader33 ], [ %40, %._crit_edge ]
  %27 = sext i32 %.lcssa to i64
  %28 = sext i32 %26 to i64
  %29 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %27, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = sub nsw i32 %.lcssa, %30
  %32 = mul nsw i32 %31, 15
  %33 = sub nsw i32 %26, %30
  %34 = mul nsw i32 %33, 30
  %35 = add nsw i32 %32, %34
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %35)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11)
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef 0)
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %.not = icmp eq i8 %39, 35
  br i1 %.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %59
  %.pre = load i32, ptr @l1, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %40 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %23, %.preheader ]
  %41 = phi i32 [ %61, %._crit_edge.loopexit ], [ %24, %.preheader ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %42 = sext i32 %40 to i64
  %.not31.not = icmp slt i64 %indvars.iv57, %42
  br i1 %.not31.not, label %.preheader, label %._crit_edge45, !llvm.loop !15

43:                                               ; preds = %.lr.ph42, %59
  %indvars.iv54 = phi i64 [ 1, %.lr.ph42 ], [ %indvars.iv.next55, %59 ]
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1SB5cxx11, i64 noundef %25)
  %45 = load i8, ptr %44, align 1, !tbaa !5
  %46 = add nsw i64 %indvars.iv54, -1
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1TB5cxx11, i64 noundef %46)
  %48 = load i8, ptr %47, align 1, !tbaa !5
  %49 = icmp eq i8 %45, %48
  br i1 %49, label %50, label %54

50:                                               ; preds = %43
  %51 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %25, i64 %46
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = add nsw i32 %52, 1
  br label %59

54:                                               ; preds = %43
  %55 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %25, i64 %indvars.iv54
  %56 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv57, i64 %46
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %56)
  %58 = load i32, ptr %57, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %50, %54
  %.sink = phi i32 [ %53, %50 ], [ %58, %54 ]
  %60 = getelementptr inbounds [1001 x [1001 x i32]], ptr %1, i64 0, i64 %indvars.iv57, i64 %indvars.iv54
  store i32 %.sink, ptr %60, align 4
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %61 = load i32, ptr @l2, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %.not32.not = icmp slt i64 %indvars.iv54, %62
  br i1 %.not32.not, label %43, label %._crit_edge.loopexit, !llvm.loop !17

._crit_edge49:                                    ; preds = %._crit_edge45, %0
  call void @llvm.lifetime.end.p0(i64 4008004, ptr nonnull %1) #7
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) 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 nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

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 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 = { 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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !13}


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