; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 11/2015. Zhenya moves from the dormitory (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [1000 x %"class.std::tuple"], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::tuple", align 4
  %14 = alloca i32, align 4
  %15 = alloca [1000 x %"class.std::tuple.2"], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::tuple.2", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 -1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 -1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %26 = 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)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.start.p0(i64 8000, ptr %9) #5
  %30 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %9, i32 0, i32 0
  %31 = getelementptr inbounds %"class.std::tuple", ptr %30, i64 1000
  br label %32

32:                                               ; preds = %32, %0
  %33 = phi ptr [ %30, %0 ], [ %34, %32 ]
  call void @_ZNSt5tupleIJiiEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_EiiEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %33) #5
  %34 = getelementptr inbounds %"class.std::tuple", ptr %33, i64 1
  %35 = icmp eq ptr %34, %31
  br i1 %35, label %36, label %32

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

37:                                               ; preds = %49, %36
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %52

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @_ZSt10make_tupleIJRiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %13, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %9, i64 0, i64 %46
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5tupleIJiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %10, align 4, !tbaa !5
  br label %37, !llvm.loop !9

52:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.start.p0(i64 12000, ptr %15) #5
  %54 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i32 0, i32 0
  %55 = getelementptr inbounds %"class.std::tuple.2", ptr %54, i64 1000
  br label %56

56:                                               ; preds = %56, %52
  %57 = phi ptr [ %54, %52 ], [ %58, %56 ]
  call void @_ZNSt5tupleIJiiiEEC2IvTnNSt9enable_ifIXclsr4_TCCIXsr7is_voidIT_EE5valueEEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %57) #5
  %58 = getelementptr inbounds %"class.std::tuple.2", ptr %57, i64 1
  %59 = icmp eq ptr %58, %55
  br i1 %59, label %60, label %56

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %74, %60
  %62 = load i32, ptr %16, align 4, !tbaa !5
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %77

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 4 dereferenceable(4) %19)
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #5
  call void @_ZSt10make_tupleIJRiS0_S0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind writable sret(%"class.std::tuple.2") align 4 %20, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %70 = load i32, ptr %16, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %71
  %73 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12) %72, ptr noundef nonnull align 4 dereferenceable(12) %20) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %74

74:                                               ; preds = %66
  %75 = load i32, ptr %16, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %16, align 4, !tbaa !5
  br label %61, !llvm.loop !11

77:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %120, %77
  %79 = load i32, ptr %21, align 4, !tbaa !5
  %80 = load i32, ptr %14, align 4, !tbaa !5
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %78
  %84 = load i32, ptr %21, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %85
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %86) #5
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = icmp sgt i32 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %120

92:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %93 = load i32, ptr %21, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %94
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %95) #5
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %22, align 4, !tbaa !5
  %98 = load i32, ptr %21, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %99
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %100) #5
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = icmp eq i32 %102, 1
  br i1 %103, label %104, label %108

104:                                              ; preds = %92
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = load i32, ptr %22, align 4, !tbaa !5
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %22, align 4, !tbaa !5
  br label %112

108:                                              ; preds = %92
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = load i32, ptr %22, align 4, !tbaa !5
  %111 = add nsw i32 %110, %109
  store i32 %111, ptr %22, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %108, %104
  %113 = load i32, ptr %22, align 4, !tbaa !5
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = icmp sgt i32 %113, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %112
  %117 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %117, ptr %2, align 4, !tbaa !5
  %118 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %118, ptr %3, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %120

120:                                              ; preds = %119, %91
  %121 = load i32, ptr %21, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %21, align 4, !tbaa !5
  br label %78, !llvm.loop !12

123:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %202, %123
  %125 = load i32, ptr %23, align 4, !tbaa !5
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 11, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %205

129:                                              ; preds = %124
  %130 = load i32, ptr %23, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %131
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %132) #5
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 1
  br i1 %135, label %136, label %137

136:                                              ; preds = %129
  br label %202

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

138:                                              ; preds = %198, %137
  %139 = load i32, ptr %25, align 4, !tbaa !5
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 14, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %201

143:                                              ; preds = %138
  %144 = load i32, ptr %23, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %145
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %146) #5
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  %150 = sdiv i32 %149, 2
  %151 = load i32, ptr %25, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %9, i64 0, i64 %152
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %153) #5
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = icmp sgt i32 %150, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %143
  br label %198

158:                                              ; preds = %143
  %159 = load i32, ptr %23, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %160
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %161) #5
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = sdiv i32 %164, 2
  %166 = load i32, ptr %5, align 4, !tbaa !5
  %167 = icmp sgt i32 %165, %166
  br i1 %167, label %168, label %169

168:                                              ; preds = %158
  br label %198

169:                                              ; preds = %158
  %170 = load i32, ptr %23, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %171
  %173 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %172) #5
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = load i32, ptr %25, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %9, i64 0, i64 %176
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %177) #5
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = add nsw i32 %174, %179
  %181 = load i32, ptr %2, align 4, !tbaa !5
  %182 = icmp sgt i32 %180, %181
  br i1 %182, label %183, label %197

183:                                              ; preds = %169
  %184 = load i32, ptr %23, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %15, i64 0, i64 %185
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %186) #5
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = load i32, ptr %25, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %9, i64 0, i64 %190
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %191) #5
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = add nsw i32 %188, %193
  store i32 %194, ptr %2, align 4, !tbaa !5
  %195 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %195, ptr %3, align 4, !tbaa !5
  %196 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %196, ptr %4, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %183, %169
  br label %198

198:                                              ; preds = %197, %168, %157
  %199 = load i32, ptr %25, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %25, align 4, !tbaa !5
  br label %138, !llvm.loop !13

201:                                              ; preds = %142
  br label %202

202:                                              ; preds = %201, %136
  %203 = load i32, ptr %23, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %23, align 4, !tbaa !5
  br label %124, !llvm.loop !14

205:                                              ; preds = %128
  %206 = load i32, ptr %2, align 4, !tbaa !5
  %207 = icmp eq i32 %206, -1
  br i1 %207, label %208, label %210

208:                                              ; preds = %205
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %230

210:                                              ; preds = %205
  %211 = load i32, ptr %4, align 4, !tbaa !5
  %212 = icmp eq i32 %211, -1
  br i1 %212, label %213, label %219

213:                                              ; preds = %210
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %215 = load i32, ptr %3, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %214, i32 noundef %216)
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %217, ptr noundef @.str.2)
  br label %229

219:                                              ; preds = %210
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %221 = load i32, ptr %3, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %220, i32 noundef %222)
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %223, ptr noundef @.str.3)
  %225 = load i32, ptr %4, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %224, i32 noundef %226)
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %227, ptr noundef @.str.4)
  br label %229

229:                                              ; preds = %219, %213
  br label %230

230:                                              ; preds = %229, %208
  call void @llvm.lifetime.end.p0(i64 12000, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8000, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %231 = load i32, ptr %1, align 4
  ret i32 %231
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_EiiEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiiEEC2IvTnNSt9enable_ifIXclsr4_TCCIXsr7is_voidIT_EE5valueEEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8)) #3

; 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) #4

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 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 = !{!"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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.1" }
%"struct.std::_Tuple_impl.4" = type { %"struct.std::_Tuple_impl.5", %"struct.std::_Head_base" }
%"struct.std::_Tuple_impl.5" = type { %"struct.std::_Head_base.6" }
%"struct.std::_Head_base.6" = type { i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [1000 x %"class.std::tuple"], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::tuple", align 4
  %9 = alloca i32, align 4
  %10 = alloca [1000 x %"class.std::tuple.2"], align 16
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::tuple.2", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %15 = 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)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %5) #6
  br label %19

19:                                               ; preds = %19, %0
  %.idx = phi i64 [ 0, %0 ], [ %.add, %19 ]
  %.ptr = getelementptr inbounds i8, ptr %5, i64 %.idx
  call void @_ZNSt5tupleIJiiEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_EiiEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %.ptr) #6
  %.add = add nuw nsw i64 %.idx, 8
  %20 = icmp eq i64 %.add, 8000
  br i1 %20, label %.preheader64, label %19

.preheader64:                                     ; preds = %19
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %23 = 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)
  call void @llvm.lifetime.start.p0(i64 12000, ptr nonnull %10) #6
  br label %31

.lr.ph:                                           ; preds = %.preheader64, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader64 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @_ZSt10make_tupleIJRiS0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %8, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %26 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %5, i64 0, i64 %indvars.iv
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5tupleIJiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !9

31:                                               ; preds = %31, %._crit_edge
  %.idx56 = phi i64 [ 0, %._crit_edge ], [ %.add57, %31 ]
  %.ptr58 = getelementptr inbounds i8, ptr %10, i64 %.idx56
  call void @_ZNSt5tupleIJiiiEEC2IvTnNSt9enable_ifIXclsr4_TCCIXsr7is_voidIT_EE5valueEEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12) %.ptr58) #6
  %.add57 = add nuw nsw i64 %.idx56, 12
  %32 = icmp eq i64 %.add57, 12000
  br i1 %32, label %.preheader63, label %31

.preheader63:                                     ; preds = %31
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph67, label %._crit_edge86.thread

.preheader62:                                     ; preds = %.lr.ph67
  %35 = icmp sgt i32 %41, 0
  br i1 %35, label %.lr.ph71, label %._crit_edge86.thread

.lr.ph67:                                         ; preds = %.preheader63, %.lr.ph67
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph67 ], [ 0, %.preheader63 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #6
  call void @_ZSt10make_tupleIJRiS0_S0_EESt5tupleIJDpNSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeEEEDpOS4_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.2") align 4 %14, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %39 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %10, i64 0, i64 %indvars.iv92
  %40 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12) %39, ptr noundef nonnull align 4 dereferenceable(12) %14) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = icmp slt i64 %indvars.iv.next93, %42
  br i1 %43, label %.lr.ph67, label %.preheader62, !llvm.loop !11

.preheader61:                                     ; preds = %58
  %44 = icmp sgt i32 %59, 0
  br i1 %44, label %.lr.ph85, label %._crit_edge86.thread109

.lr.ph71:                                         ; preds = %.preheader62, %58
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %58 ], [ 0, %.preheader62 ]
  %.04469 = phi i32 [ %.246, %58 ], [ -1, %.preheader62 ]
  %.04868 = phi i32 [ %.250, %58 ], [ -1, %.preheader62 ]
  %45 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %10, i64 0, i64 %indvars.iv95
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %45) #6
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %58, label %50

50:                                               ; preds = %.lr.ph71
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %45) #6
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %45) #6
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i32 %54, 1
  %.val = load i32, ptr %2, align 4
  %.val60 = load i32, ptr %3, align 4
  %.pn = select i1 %55, i32 %.val, i32 %.val60
  %.039 = add nsw i32 %.pn, %52
  %56 = icmp sgt i32 %.039, %.04868
  %.149 = call i32 @llvm.smax.i32(i32 %.039, i32 %.04868)
  %57 = trunc nuw nsw i64 %indvars.iv95 to i32
  %.145 = select i1 %56, i32 %57, i32 %.04469
  br label %58

58:                                               ; preds = %.lr.ph71, %50
  %.250 = phi i32 [ %.04868, %.lr.ph71 ], [ %.149, %50 ]
  %.246 = phi i32 [ %.04469, %.lr.ph71 ], [ %.145, %50 ]
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = icmp slt i64 %indvars.iv.next96, %60
  br i1 %61, label %.lr.ph71, label %.preheader61, !llvm.loop !12

._crit_edge86:                                    ; preds = %.loopexit
  %62 = icmp eq i32 %.654, -1
  br i1 %62, label %._crit_edge86.thread, label %108

._crit_edge86.thread109:                          ; preds = %.preheader61
  %63 = icmp eq i32 %.250, -1
  br i1 %63, label %._crit_edge86.thread, label %.thread

.lr.ph85:                                         ; preds = %.preheader61, %.loopexit
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %.loopexit ], [ 0, %.preheader61 ]
  %.04383 = phi i32 [ %.3, %.loopexit ], [ -1, %.preheader61 ]
  %.34782 = phi i32 [ %.6, %.loopexit ], [ %.246, %.preheader61 ]
  %.35181 = phi i32 [ %.654, %.loopexit ], [ %.250, %.preheader61 ]
  %64 = getelementptr inbounds [1000 x %"class.std::tuple.2"], ptr %10, i64 0, i64 %indvars.iv101
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %64) #6
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 1
  %68 = load i32, ptr %4, align 4
  %69 = icmp sgt i32 %68, 0
  %or.cond = select i1 %67, i1 %69, i1 false
  br i1 %or.cond, label %.lr.ph77.preheader, label %.loopexit

.lr.ph77.preheader:                               ; preds = %.lr.ph85
  %70 = trunc nuw nsw i64 %indvars.iv101 to i32
  br label %.lr.ph77

.lr.ph77:                                         ; preds = %.lr.ph77.preheader, %100
  %indvars.iv98 = phi i64 [ 0, %.lr.ph77.preheader ], [ %indvars.iv.next99, %100 ]
  %.175 = phi i32 [ %.04383, %.lr.ph77.preheader ], [ %.2, %100 ]
  %.474 = phi i32 [ %.34782, %.lr.ph77.preheader ], [ %.5, %100 ]
  %.45273 = phi i32 [ %.35181, %.lr.ph77.preheader ], [ %.553, %100 ]
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %64) #6
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  %74 = sdiv i32 %73, 2
  %75 = getelementptr inbounds [1000 x %"class.std::tuple"], ptr %5, i64 0, i64 %indvars.iv98
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %75) #6
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp sgt i32 %74, %77
  br i1 %78, label %100, label %79

79:                                               ; preds = %.lr.ph77
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %64) #6
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = sdiv i32 %82, 2
  %84 = load i32, ptr %1, align 4, !tbaa !5
  %85 = icmp sgt i32 %83, %84
  br i1 %85, label %100, label %86

86:                                               ; preds = %79
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %64) #6
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %75) #6
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = add nsw i32 %90, %88
  %92 = icmp sgt i32 %91, %.45273
  br i1 %92, label %93, label %100

93:                                               ; preds = %86
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12) %64) #6
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %75) #6
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, %95
  %99 = trunc nuw nsw i64 %indvars.iv98 to i32
  br label %100

100:                                              ; preds = %86, %93, %79, %.lr.ph77
  %.553 = phi i32 [ %.45273, %.lr.ph77 ], [ %.45273, %79 ], [ %98, %93 ], [ %.45273, %86 ]
  %.5 = phi i32 [ %.474, %.lr.ph77 ], [ %.474, %79 ], [ %70, %93 ], [ %.474, %86 ]
  %.2 = phi i32 [ %.175, %.lr.ph77 ], [ %.175, %79 ], [ %99, %93 ], [ %.175, %86 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next99, %102
  br i1 %103, label %.lr.ph77, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %100, %.lr.ph85
  %.654 = phi i32 [ %.35181, %.lr.ph85 ], [ %.553, %100 ]
  %.6 = phi i32 [ %.34782, %.lr.ph85 ], [ %.5, %100 ]
  %.3 = phi i32 [ %.04383, %.lr.ph85 ], [ %.2, %100 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next102, %105
  br i1 %106, label %.lr.ph85, label %._crit_edge86, !llvm.loop !14

._crit_edge86.thread:                             ; preds = %.preheader62, %.preheader63, %._crit_edge86.thread109, %._crit_edge86
  %107 = 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)
  br label %122

108:                                              ; preds = %._crit_edge86
  %109 = icmp eq i32 %.3, -1
  br i1 %109, label %.thread, label %114

.thread:                                          ; preds = %._crit_edge86.thread109, %108
  %.347.lcssa113117 = phi i32 [ %.6, %108 ], [ %.246, %._crit_edge86.thread109 ]
  %110 = 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.1)
  %111 = add nsw i32 %.347.lcssa113117, 1
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %110, i32 noundef %111)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull @.str.2)
  br label %122

114:                                              ; preds = %108
  %115 = 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.1)
  %116 = add nsw i32 %.6, 1
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %116)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef nonnull @.str.3)
  %119 = add nuw nsw i32 %.3, 1
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %118, i32 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull @.str.4)
  br label %122

122:                                              ; preds = %.thread, %114, %._crit_edge86.thread
  call void @llvm.lifetime.end.p0(i64 12000, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiEEC2ILb1ETnNSt9enable_ifIXclsr17_TupleConstraintsIXT_EiiEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5tupleIJiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) 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) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiiEEC2IvTnNSt9enable_ifIXclsr4_TCCIXsr7is_voidIT_EE5valueEEE37__is_implicitly_default_constructibleEEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

; 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 #4

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass