; LLVM IR from abeaumont/competitive-programming :: codechef/aug18a (inmat)

; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.3" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"struct.std::_Head_base.6" = type { ptr }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@r = external dso_local global [1000 x i32], align 16
@c = external dso_local global [1000 x i32], align 16
@r0 = external dso_local global [1000 x i32], align 16
@r1 = external dso_local global [1000 x i32], align 16
@c0 = external dso_local global [1000 x i32], align 16
@c1 = external dso_local global [1000 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f1ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f2ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f3ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f4ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2crv(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2ccv(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3allii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %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
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::tuple", align 4
  %17 = alloca %"class.std::tuple.2", align 8
  %18 = alloca %"class.std::tuple", align 4
  %19 = alloca %"class.std::tuple.2", align 8
  %20 = alloca %"class.std::tuple", align 4
  %21 = alloca %"class.std::tuple.2", align 8
  %22 = alloca %"class.std::tuple", align 4
  %23 = alloca %"class.std::tuple.2", align 8
  %24 = alloca %"class.std::tuple", align 4
  %25 = alloca %"class.std::tuple.2", align 8
  %26 = alloca %"class.std::tuple", align 4
  %27 = alloca %"class.std::tuple.2", align 8
  %28 = alloca %"class.std::tuple", align 4
  %29 = alloca %"class.std::tuple.2", align 8
  store i32 0, ptr %1, align 4
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) @v)
  %33 = load i32, ptr @k, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = mul nsw i32 %34, %35
  %37 = icmp sge i32 %33, %36
  br i1 %37, label %38, label %87

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

39:                                               ; preds = %80, %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 2, ptr %3, align 4
  br label %83

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

45:                                               ; preds = %74, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 5, ptr %3, align 4
  br label %77

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %51, i32 noundef %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.1)
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %54, i32 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr @v, align 4, !tbaa !5
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %70

62:                                               ; preds = %50
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %63, i32 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef @.str.1)
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %66, i32 noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %71

70:                                               ; preds = %50
  store i32 0, ptr %3, align 4
  br label %71

71:                                               ; preds = %70, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %72 = load i32, ptr %3, align 4
  switch i32 %72, label %77 [
    i32 0, label %73
  ]

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !9

77:                                               ; preds = %71, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %78 = load i32, ptr %3, align 4
  switch i32 %78, label %83 [
    i32 5, label %79
  ]

79:                                               ; preds = %77
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %2, align 4, !tbaa !5
  br label %39, !llvm.loop !11

83:                                               ; preds = %77, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %84 = load i32, ptr %3, align 4
  switch i32 %84, label %311 [
    i32 2, label %85
    i32 1, label %309
  ]

85:                                               ; preds = %83
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %309

87:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  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 0, ptr %8, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %181, %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %184

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @.str.1)
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %103 = 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)
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000 x i32], ptr @r0, i64 0, i64 %106
  store i32 %104, ptr %107, align 4, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %116, label %114

114:                                              ; preds = %93
  %115 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %115, ptr %7, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %114, %93
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %127

119:                                              ; preds = %116
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = icmp sgt i32 %120, %121
  br i1 %122, label %123, label %127

123:                                              ; preds = %119
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1000 x i32], ptr @c, i64 0, i64 %125
  store i32 1, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %123, %119, %116
  %128 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %128, ptr %6, align 4, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %129, i32 noundef %131)
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %132, ptr noundef @.str.1)
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = srem i32 %135, %136
  %138 = add nsw i32 %137, 1
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %133, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %141 = 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)
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = load i32, ptr @n, align 4, !tbaa !5
  %144 = sub nsw i32 %143, 1
  %145 = icmp ne i32 %142, %144
  br i1 %145, label %146, label %154

146:                                              ; preds = %127
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = icmp sgt i32 %147, %148
  br i1 %149, label %150, label %154

150:                                              ; preds = %146
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %152
  store i32 1, ptr %153, align 4, !tbaa !5
  br label %168

154:                                              ; preds = %146, %127
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = load i32, ptr @n, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = icmp eq i32 %155, %157
  br i1 %158, label %159, label %167

159:                                              ; preds = %154
  %160 = load i32, ptr %6, align 4, !tbaa !5
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %163, label %167

163:                                              ; preds = %159
  %164 = load i32, ptr %8, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %165
  store i32 1, ptr %166, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %163, %159, %154
  br label %168

168:                                              ; preds = %167, %150
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = load i32, ptr %8, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1000 x i32], ptr @r1, i64 0, i64 %171
  store i32 %169, ptr %172, align 4, !tbaa !5
  %173 = load i32, ptr %9, align 4, !tbaa !5
  %174 = load i32, ptr %8, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  %176 = load i32, ptr @n, align 4, !tbaa !5
  %177 = srem i32 %175, %176
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1000 x i32], ptr @c0, i64 0, i64 %178
  store i32 %173, ptr %179, align 4, !tbaa !5
  %180 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %180, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %181

181:                                              ; preds = %168
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %8, align 4, !tbaa !5
  br label %88, !llvm.loop !12

184:                                              ; preds = %92
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = icmp sgt i32 %185, %186
  br i1 %187, label %188, label %189

188:                                              ; preds = %184
  store i32 1, ptr @c, align 16, !tbaa !5
  br label %189

189:                                              ; preds = %188, %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, 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 %190

190:                                              ; preds = %205, %189
  %191 = load i32, ptr %12, align 4, !tbaa !5
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = icmp slt i32 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %208

195:                                              ; preds = %190
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %204

201:                                              ; preds = %195
  %202 = load i32, ptr %11, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %11, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %201, %195
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %12, align 4, !tbaa !5
  br label %190, !llvm.loop !13

208:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %224, %208
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = load i32, ptr @n, align 4, !tbaa !5
  %212 = icmp slt i32 %210, %211
  br i1 %212, label %214, label %213

213:                                              ; preds = %209
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %227

214:                                              ; preds = %209
  %215 = load i32, ptr %13, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [1000 x i32], ptr @c, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %223

220:                                              ; preds = %214
  %221 = load i32, ptr %10, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %10, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %220, %214
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %13, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %13, align 4, !tbaa !5
  br label %209, !llvm.loop !14

227:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  %228 = load i32, ptr %11, align 4, !tbaa !5
  %229 = icmp ne i32 %228, 0
  br i1 %229, label %236, label %230

230:                                              ; preds = %227
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %236, label %233

233:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %234 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z2f1ii(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %16, i32 noundef 0, i32 noundef %234)
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %17, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %235 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %301

236:                                              ; preds = %230, %227
  %237 = load i32, ptr %11, align 4, !tbaa !5
  %238 = icmp ne i32 %237, 0
  br i1 %238, label %246, label %239

239:                                              ; preds = %236
  %240 = load i32, ptr %10, align 4, !tbaa !5
  %241 = load i32, ptr @n, align 4, !tbaa !5
  %242 = icmp eq i32 %240, %241
  br i1 %242, label %243, label %246

243:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %244 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z2f2ii(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %18, i32 noundef 0, i32 noundef %244)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %19, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %245 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %300

246:                                              ; preds = %239, %236
  %247 = load i32, ptr %11, align 4, !tbaa !5
  %248 = load i32, ptr @n, align 4, !tbaa !5
  %249 = icmp eq i32 %247, %248
  br i1 %249, label %250, label %256

250:                                              ; preds = %246
  %251 = load i32, ptr %10, align 4, !tbaa !5
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %256, label %253

253:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %254 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z2f3ii(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %20, i32 noundef 0, i32 noundef %254)
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %21, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %255 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(8) %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %299

256:                                              ; preds = %250, %246
  %257 = load i32, ptr %11, align 4, !tbaa !5
  %258 = load i32, ptr @n, align 4, !tbaa !5
  %259 = icmp eq i32 %257, %258
  br i1 %259, label %260, label %267

260:                                              ; preds = %256
  %261 = load i32, ptr %10, align 4, !tbaa !5
  %262 = load i32, ptr @n, align 4, !tbaa !5
  %263 = icmp eq i32 %261, %262
  br i1 %263, label %264, label %267

264:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %265 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z2f4ii(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %22, i32 noundef 0, i32 noundef %265)
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %23, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %266 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(8) %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %298

267:                                              ; preds = %260, %256
  %268 = load i32, ptr %11, align 4, !tbaa !5
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %270, label %285

270:                                              ; preds = %267
  %271 = load i32, ptr %11, align 4, !tbaa !5
  %272 = load i32, ptr @n, align 4, !tbaa !5
  %273 = icmp ne i32 %271, %272
  br i1 %273, label %274, label %285

274:                                              ; preds = %270
  %275 = load i32, ptr %10, align 4, !tbaa !5
  %276 = icmp ne i32 %275, 0
  br i1 %276, label %277, label %285

277:                                              ; preds = %274
  %278 = load i32, ptr %10, align 4, !tbaa !5
  %279 = load i32, ptr @n, align 4, !tbaa !5
  %280 = icmp ne i32 %278, %279
  br i1 %280, label %281, label %285

281:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %282 = load i32, ptr %11, align 4, !tbaa !5
  %283 = load i32, ptr %10, align 4, !tbaa !5
  call void @_Z3allii(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %24, i32 noundef %282, i32 noundef %283)
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %25, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %284 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(8) %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %297

285:                                              ; preds = %277, %274, %270, %267
  %286 = load i32, ptr %11, align 4, !tbaa !5
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %288, label %294

288:                                              ; preds = %285
  %289 = load i32, ptr %11, align 4, !tbaa !5
  %290 = load i32, ptr @n, align 4, !tbaa !5
  %291 = icmp ne i32 %289, %290
  br i1 %291, label %292, label %294

292:                                              ; preds = %288
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  call void @_Z2crv(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %26)
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %27, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %293 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(8) %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %296

294:                                              ; preds = %288, %285
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  call void @_Z2ccv(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %28)
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 8 %29, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15) #6
  %295 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(8) %28) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %296

296:                                              ; preds = %294, %292
  br label %297

297:                                              ; preds = %296, %281
  br label %298

298:                                              ; preds = %297, %264
  br label %299

299:                                              ; preds = %298, %253
  br label %300

300:                                              ; preds = %299, %243
  br label %301

301:                                              ; preds = %300, %233
  %302 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %303 = load i32, ptr %14, align 4, !tbaa !5
  %304 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %302, i32 noundef %303)
  %305 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %304, ptr noundef @.str.1)
  %306 = load i32, ptr %15, align 4, !tbaa !5
  %307 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %305, i32 noundef %306)
  %308 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %307, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %309

309:                                              ; preds = %301, %85, %83
  %310 = load i32, ptr %1, align 4
  ret i32 %310

311:                                              ; preds = %83
  unreachable
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 = { 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 #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}


; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.1" = type { i32 }
%"class.std::tuple.2" = type { %"struct.std::_Tuple_impl.3" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Tuple_impl.4", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"struct.std::_Head_base.6" = type { ptr }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@r = external dso_local local_unnamed_addr global [1000 x i32], align 16
@c = external dso_local local_unnamed_addr global [1000 x i32], align 16
@r0 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@r1 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@c0 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@c1 = external dso_local local_unnamed_addr global [1000 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f1ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f2ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f3ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2f4ii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2crv(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.2") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2ccv(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3allii(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::tuple", align 4
  %6 = alloca %"class.std::tuple.2", align 8
  %7 = alloca %"class.std::tuple", align 4
  %8 = alloca %"class.std::tuple.2", align 8
  %9 = alloca %"class.std::tuple", align 4
  %10 = alloca %"class.std::tuple.2", align 8
  %11 = alloca %"class.std::tuple", align 4
  %12 = alloca %"class.std::tuple.2", align 8
  %13 = alloca %"class.std::tuple", align 4
  %14 = alloca %"class.std::tuple.2", align 8
  %15 = alloca %"class.std::tuple", align 4
  %16 = alloca %"class.std::tuple.2", align 8
  %17 = alloca %"class.std::tuple", align 4
  %18 = alloca %"class.std::tuple.2", align 8
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @v)
  %22 = load i32, ptr @k, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4
  %24 = mul nsw i32 %23, %23
  %.not = icmp slt i32 %22, %24
  br i1 %.not, label %.preheader113, label %.preheader115

.preheader115:                                    ; preds = %0
  %.not88120 = icmp slt i32 %23, 1
  br i1 %.not88120, label %._crit_edge122, label %.preheader114

.preheader113:                                    ; preds = %0
  %25 = icmp sgt i32 %23, 0
  br i1 %25, label %26, label %._crit_edge138

26:                                               ; preds = %.preheader113
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 1)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.1)
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef 1)
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %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) %2)
  %33 = load i32, ptr %2, align 4
  store i32 %33, ptr @r0, align 16, !tbaa !5
  store i32 %33, ptr @c1, align 16, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %34, i32 noundef 1)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @.str.1)
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = srem i32 1, %37
  %39 = add nuw nsw i32 %38, 1
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef %39)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %42 = 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)
  %43 = load i32, ptr @n, align 4
  %44 = add nsw i32 %43, -1
  %.not87.peel = icmp ne i32 %44, 0
  %45 = load i32, ptr %2, align 4
  %46 = icmp sgt i32 %33, %45
  %or.cond94.peel = select i1 %.not87.peel, i1 %46, i1 false
  br i1 %or.cond94.peel, label %53, label %47

47:                                               ; preds = %26
  %48 = icmp eq i32 %44, 0
  %49 = icmp slt i32 %33, %45
  %or.cond96.peel = select i1 %48, i1 %49, i1 false
  br i1 %or.cond96.peel, label %.thread, label %54

.thread:                                          ; preds = %47
  store i32 1, ptr @r, align 16, !tbaa !5
  store i32 %45, ptr @r1, align 16, !tbaa !5
  %50 = sub nuw i32 1, %43
  %51 = zext nneg i32 %50 to i64
  %52 = getelementptr inbounds [1000 x i32], ptr @c0, i64 0, i64 %51
  store i32 %45, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %._crit_edge127

53:                                               ; preds = %26
  store i32 1, ptr @r, align 16, !tbaa !5
  br label %54

54:                                               ; preds = %53, %47
  store i32 %45, ptr @r1, align 16, !tbaa !5
  %55 = srem i32 1, %43
  %56 = zext nneg i32 %55 to i64
  %57 = getelementptr inbounds [1000 x i32], ptr @c0, i64 0, i64 %56
  store i32 %45, ptr %57, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %58 = icmp sgt i32 %43, 1
  br i1 %58, label %.lr.ph126, label %._crit_edge127

.preheader114:                                    ; preds = %.preheader115, %._crit_edge
  %59 = phi i32 [ %70, %._crit_edge ], [ %23, %.preheader115 ]
  %.075121 = phi i32 [ %71, %._crit_edge ], [ 1, %.preheader115 ]
  %.not89118 = icmp slt i32 %59, 1
  br i1 %.not89118, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader114, %.critedge
  %.072119 = phi i32 [ %68, %.critedge ], [ 1, %.preheader114 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %60, i32 noundef %.075121)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @.str.1)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %62, i32 noundef %.072119)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %65 = 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)
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = load i32, ptr @v, align 4, !tbaa !5
  %.not90 = icmp eq i32 %66, %67
  br i1 %.not90, label %72, label %.critedge

.critedge:                                        ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %68 = add nuw nsw i32 %.072119, 1
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %.not89.not = icmp slt i32 %.072119, %69
  br i1 %.not89.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.critedge, %.preheader114
  %70 = phi i32 [ %59, %.preheader114 ], [ %69, %.critedge ]
  %71 = add nuw nsw i32 %.075121, 1
  %.not88.not = icmp slt i32 %.075121, %70
  br i1 %.not88.not, label %.preheader114, label %._crit_edge122, !llvm.loop !11

72:                                               ; preds = %.lr.ph
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %73, i32 noundef %.075121)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str.1)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 noundef %.072119)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %180

._crit_edge122:                                   ; preds = %._crit_edge, %.preheader115
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br label %180

._crit_edge127:                                   ; preds = %112, %54, %.thread
  %.071.lcssa = phi i32 [ %45, %54 ], [ %45, %.thread ], [ %106, %112 ]
  %.lcssa = phi i32 [ %43, %54 ], [ 1, %.thread ], [ %103, %112 ]
  %79 = icmp sgt i32 %33, %.071.lcssa
  br i1 %79, label %119, label %120

.lr.ph126:                                        ; preds = %54, %112
  %indvars.iv = phi i64 [ %indvars.iv.next, %112 ], [ 1, %54 ]
  %.071123 = phi i32 [ %106, %112 ], [ %45, %54 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %81 = trunc nuw nsw i64 %indvars.iv.next to i32
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %80, i32 noundef %81)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @.str.1)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %83, i32 noundef %81)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %86 = 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)
  %87 = load i32, ptr %2, align 4
  %88 = getelementptr inbounds [1000 x i32], ptr @r0, i64 0, i64 %indvars.iv
  store i32 %87, ptr %88, align 4, !tbaa !5
  %89 = getelementptr inbounds [1000 x i32], ptr @c1, i64 0, i64 %indvars.iv
  store i32 %87, ptr %89, align 4, !tbaa !5
  %.not86 = icmp ne i32 %.071123, 0
  %90 = icmp sgt i32 %.071123, %87
  %or.cond92 = select i1 %.not86, i1 %90, i1 false
  br i1 %or.cond92, label %91, label %93

91:                                               ; preds = %.lr.ph126
  %92 = getelementptr inbounds [1000 x i32], ptr @c, i64 0, i64 %indvars.iv
  store i32 1, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %91, %.lr.ph126
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef %81)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull @.str.1)
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = srem i32 %81, %97
  %99 = add nuw nsw i32 %98, 1
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %96, i32 noundef %99)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %102 = 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)
  %103 = load i32, ptr @n, align 4
  %104 = add nsw i32 %103, -1
  %105 = zext i32 %104 to i64
  %.not87 = icmp ne i64 %indvars.iv, %105
  %106 = load i32, ptr %2, align 4
  %107 = icmp sgt i32 %87, %106
  %or.cond94 = select i1 %.not87, i1 %107, i1 false
  br i1 %or.cond94, label %.sink.split, label %108

108:                                              ; preds = %93
  %109 = icmp eq i64 %indvars.iv, %105
  %110 = icmp slt i32 %87, %106
  %or.cond96 = select i1 %109, i1 %110, i1 false
  br i1 %or.cond96, label %.sink.split, label %112

.sink.split:                                      ; preds = %108, %93
  %111 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %indvars.iv
  store i32 1, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %.sink.split, %108
  %113 = getelementptr inbounds [1000 x i32], ptr @r1, i64 0, i64 %indvars.iv
  store i32 %106, ptr %113, align 4, !tbaa !5
  %114 = srem i32 %81, %103
  %115 = zext nneg i32 %114 to i64
  %116 = getelementptr inbounds [1000 x i32], ptr @c0, i64 0, i64 %115
  store i32 %106, ptr %116, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %117 = sext i32 %103 to i64
  %118 = icmp slt i64 %indvars.iv.next, %117
  br i1 %118, label %.lr.ph126, label %._crit_edge127, !llvm.loop !13

119:                                              ; preds = %._crit_edge127
  store i32 1, ptr @c, align 16, !tbaa !5
  br label %120

120:                                              ; preds = %119, %._crit_edge127
  %121 = icmp sgt i32 %.lcssa, 0
  br i1 %121, label %.lr.ph133.preheader, label %._crit_edge138

.lr.ph133.preheader:                              ; preds = %120
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 8
  br i1 %min.iters.check, label %.lr.ph133.preheader200, label %vector.ph

.lr.ph133.preheader200:                           ; preds = %middle.block, %.lr.ph133.preheader
  %indvars.iv147.ph = phi i64 [ 0, %.lr.ph133.preheader ], [ %n.vec, %middle.block ]
  %.065130.ph = phi i32 [ 0, %.lr.ph133.preheader ], [ %131, %middle.block ]
  br label %.lr.ph133

vector.ph:                                        ; preds = %.lr.ph133.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %128, %vector.body ]
  %vec.phi178 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %129, %vector.body ]
  %122 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %index
  %123 = getelementptr inbounds i8, ptr %122, i64 16
  %wide.load = load <4 x i32>, ptr %122, align 16, !tbaa !5
  %wide.load179 = load <4 x i32>, ptr %123, align 16, !tbaa !5
  %124 = icmp ne <4 x i32> %wide.load, zeroinitializer
  %125 = icmp ne <4 x i32> %wide.load179, zeroinitializer
  %126 = zext <4 x i1> %124 to <4 x i32>
  %127 = zext <4 x i1> %125 to <4 x i32>
  %128 = add <4 x i32> %vec.phi, %126
  %129 = add <4 x i32> %vec.phi178, %127
  %index.next = add nuw i64 %index, 8
  %130 = icmp eq i64 %index.next, %n.vec
  br i1 %130, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %129, %128
  %131 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph133.preheader200

.preheader:                                       ; preds = %.lr.ph133, %middle.block
  %spec.select97.lcssa = phi i32 [ %131, %middle.block ], [ %spec.select97, %.lr.ph133 ]
  br i1 %121, label %.lr.ph137.preheader, label %._crit_edge138

.lr.ph137.preheader:                              ; preds = %.preheader
  %wide.trip.count153 = zext nneg i32 %.lcssa to i64
  %min.iters.check182 = icmp ult i32 %.lcssa, 8
  br i1 %min.iters.check182, label %.lr.ph137.preheader197, label %vector.ph183

.lr.ph137.preheader197:                           ; preds = %middle.block180, %.lr.ph137.preheader
  %indvars.iv150.ph = phi i64 [ 0, %.lr.ph137.preheader ], [ %n.vec185, %middle.block180 ]
  %.066135.ph = phi i32 [ 0, %.lr.ph137.preheader ], [ %141, %middle.block180 ]
  br label %.lr.ph137

vector.ph183:                                     ; preds = %.lr.ph137.preheader
  %n.vec185 = and i64 %wide.trip.count, 2147483640
  br label %vector.body187

vector.body187:                                   ; preds = %vector.body187, %vector.ph183
  %index188 = phi i64 [ 0, %vector.ph183 ], [ %index.next193, %vector.body187 ]
  %vec.phi189 = phi <4 x i32> [ zeroinitializer, %vector.ph183 ], [ %138, %vector.body187 ]
  %vec.phi190 = phi <4 x i32> [ zeroinitializer, %vector.ph183 ], [ %139, %vector.body187 ]
  %132 = getelementptr inbounds [1000 x i32], ptr @c, i64 0, i64 %index188
  %133 = getelementptr inbounds i8, ptr %132, i64 16
  %wide.load191 = load <4 x i32>, ptr %132, align 16, !tbaa !5
  %wide.load192 = load <4 x i32>, ptr %133, align 16, !tbaa !5
  %134 = icmp ne <4 x i32> %wide.load191, zeroinitializer
  %135 = icmp ne <4 x i32> %wide.load192, zeroinitializer
  %136 = zext <4 x i1> %134 to <4 x i32>
  %137 = zext <4 x i1> %135 to <4 x i32>
  %138 = add <4 x i32> %vec.phi189, %136
  %139 = add <4 x i32> %vec.phi190, %137
  %index.next193 = add nuw i64 %index188, 8
  %140 = icmp eq i64 %index.next193, %n.vec185
  br i1 %140, label %middle.block180, label %vector.body187, !llvm.loop !18

middle.block180:                                  ; preds = %vector.body187
  %bin.rdx194 = add <4 x i32> %139, %138
  %141 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx194)
  %cmp.n195 = icmp eq i64 %n.vec185, %wide.trip.count
  br i1 %cmp.n195, label %._crit_edge138, label %.lr.ph137.preheader197

.lr.ph133:                                        ; preds = %.lr.ph133.preheader200, %.lr.ph133
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph133 ], [ %indvars.iv147.ph, %.lr.ph133.preheader200 ]
  %.065130 = phi i32 [ %spec.select97, %.lr.ph133 ], [ %.065130.ph, %.lr.ph133.preheader200 ]
  %142 = getelementptr inbounds [1000 x i32], ptr @r, i64 0, i64 %indvars.iv147
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %.not84 = icmp ne i32 %143, 0
  %144 = zext i1 %.not84 to i32
  %spec.select97 = add nuw nsw i32 %.065130, %144
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph133, !llvm.loop !19

._crit_edge138:                                   ; preds = %.lr.ph137, %middle.block180, %120, %.preheader113, %.preheader
  %.065.lcssa165 = phi i32 [ %spec.select97.lcssa, %.preheader ], [ 0, %.preheader113 ], [ 0, %120 ], [ %spec.select97.lcssa, %middle.block180 ], [ %spec.select97.lcssa, %.lr.ph137 ]
  %.lcssa158161164 = phi i32 [ %.lcssa, %.preheader ], [ %23, %.preheader113 ], [ %.lcssa, %120 ], [ %.lcssa, %middle.block180 ], [ %.lcssa, %.lr.ph137 ]
  %.066.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.preheader113 ], [ 0, %120 ], [ %141, %middle.block180 ], [ %spec.select98, %.lr.ph137 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %145 = icmp ne i32 %.065.lcssa165, 0
  %146 = icmp ne i32 %.066.lcssa, 0
  %or.cond = select i1 %145, i1 true, i1 %146
  br i1 %or.cond, label %152, label %150

.lr.ph137:                                        ; preds = %.lr.ph137.preheader197, %.lr.ph137
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %.lr.ph137 ], [ %indvars.iv150.ph, %.lr.ph137.preheader197 ]
  %.066135 = phi i32 [ %spec.select98, %.lr.ph137 ], [ %.066135.ph, %.lr.ph137.preheader197 ]
  %147 = getelementptr inbounds [1000 x i32], ptr @c, i64 0, i64 %indvars.iv150
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %.not83 = icmp ne i32 %148, 0
  %149 = zext i1 %.not83 to i32
  %spec.select98 = add nuw nsw i32 %.066135, %149
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %._crit_edge138, label %.lr.ph137, !llvm.loop !20

150:                                              ; preds = %._crit_edge138
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @_Z2f1ii(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %5, i32 noundef 0, i32 noundef %.lcssa158161164)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %151 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %172

152:                                              ; preds = %._crit_edge138
  %.not99 = xor i1 %145, true
  %153 = icmp eq i32 %.066.lcssa, %.lcssa158161164
  %or.cond101 = select i1 %.not99, i1 %153, i1 false
  br i1 %or.cond101, label %154, label %156

154:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @_Z2f2ii(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %7, i32 noundef 0, i32 noundef %.lcssa158161164)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %8, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %155 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %172

156:                                              ; preds = %152
  %157 = icmp ne i32 %.065.lcssa165, %.lcssa158161164
  %or.cond4 = select i1 %157, i1 true, i1 %146
  br i1 %or.cond4, label %160, label %158

158:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @_Z2f3ii(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %9, i32 noundef 0, i32 noundef %.lcssa158161164)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %10, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %159 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %172

160:                                              ; preds = %156
  %161 = icmp eq i32 %.065.lcssa165, %.lcssa158161164
  %or.cond102 = select i1 %161, i1 %153, i1 false
  br i1 %or.cond102, label %162, label %164

162:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  call void @_Z2f4ii(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %11, i32 noundef 0, i32 noundef %.lcssa158161164)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %12, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %163 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %172

164:                                              ; preds = %160
  br i1 %145, label %165, label %.critedge105

165:                                              ; preds = %164
  %or.cond6 = select i1 %157, i1 %146, i1 false
  %or.cond6.not = xor i1 %or.cond6, true
  %or.cond103 = select i1 %or.cond6.not, i1 true, i1 %153
  br i1 %or.cond103, label %168, label %166

166:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  call void @_Z3allii(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %13, i32 noundef %.065.lcssa165, i32 noundef %.066.lcssa)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %14, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %167 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br label %172

168:                                              ; preds = %165
  br i1 %161, label %.critedge105, label %169

169:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  call void @_Z2crv(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %15)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %16, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %170 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  br label %172

.critedge105:                                     ; preds = %164, %168
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  call void @_Z2ccv(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %17)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #7
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 8 %18, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %171 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIT_T0_EEERS1_E4typeEOS_IJS4_S5_EE(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  br label %172

172:                                              ; preds = %154, %162, %169, %.critedge105, %166, %158, %150
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %173, i32 noundef %174)
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef nonnull @.str.1)
  %177 = load i32, ptr %4, align 4, !tbaa !5
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %176, i32 noundef %177)
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %178, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %180

180:                                              ; preds = %72, %172, %._crit_edge122
  ret i32 0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 = { 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 #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 = !{!"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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !16, !17}
!19 = distinct !{!19, !10, !17, !16}
!20 = distinct !{!20, !10, !17, !16}


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