; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/SHORT/COOK56/STRBIT (A)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@idx = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = 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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %16

16:                                               ; preds = %215, %213, %0
  %17 = load i32, ptr @t, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr @t, align 4, !tbaa !5
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %216

20:                                               ; preds = %16
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr @r, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 1, ptr @idx, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %37, %20
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %24
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %30)
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = sext i8 %32 to i32
  %34 = icmp eq i32 %33, 71
  br label %35

35:                                               ; preds = %28, %24
  %36 = phi i1 [ false, %24 ], [ %34, %28 ]
  br i1 %36, label %37, label %40

37:                                               ; preds = %35
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !10

40:                                               ; preds = %35
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp eq i32 %41, %42
  br i1 %43, label %44, label %57

44:                                               ; preds = %40
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %46)
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 71
  br i1 %50, label %51, label %54

51:                                               ; preds = %44
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %4, align 4
  br label %213, !llvm.loop !12

54:                                               ; preds = %44
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %4, align 4
  br label %213, !llvm.loop !12

57:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = load i32, ptr @k, align 4, !tbaa !5
  %62 = add nsw i32 %60, %61
  %63 = sub nsw i32 %62, 1
  store i32 %63, ptr %6, align 4, !tbaa !5
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %66

66:                                               ; preds = %208, %57
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = icmp ne i32 %67, %69
  br i1 %70, label %71, label %209

71:                                               ; preds = %66
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %72)
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef @.str)
  %75 = load i32, ptr @idx, align 4, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %74, i32 noundef %75)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %78 = load i32, ptr @idx, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %144

80:                                               ; preds = %71
  %81 = load i32, ptr @cnt, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr @cnt, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %96, %80
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %87, label %94

87:                                               ; preds = %83
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %89)
  %91 = load i8, ptr %90, align 1, !tbaa !9
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 82
  br label %94

94:                                               ; preds = %87, %83
  %95 = phi i1 [ false, %83 ], [ %93, %87 ]
  br i1 %95, label %96, label %99

96:                                               ; preds = %94
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %2, align 4, !tbaa !5
  br label %83, !llvm.loop !13

99:                                               ; preds = %94
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %101)
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 82
  br i1 %105, label %106, label %132

106:                                              ; preds = %99
  br label %107

107:                                              ; preds = %120, %106
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %111, label %118

111:                                              ; preds = %107
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %113)
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = sext i8 %115 to i32
  %117 = icmp eq i32 %116, 71
  br label %118

118:                                              ; preds = %111, %107
  %119 = phi i1 [ false, %107 ], [ %117, %111 ]
  br i1 %119, label %120, label %123

120:                                              ; preds = %118
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %2, align 4, !tbaa !5
  br label %107, !llvm.loop !14

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  store i32 %125, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = load i32, ptr @k, align 4, !tbaa !5
  %128 = add nsw i32 %126, %127
  %129 = sub nsw i32 %128, 1
  store i32 %129, ptr %8, align 4, !tbaa !5
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %131 = load i32, ptr %130, align 4, !tbaa !5
  store i32 %131, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %143

132:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %133 = load i32, ptr @n, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  store i32 %134, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %135 = load i32, ptr %2, align 4, !tbaa !5
  %136 = load i32, ptr @k, align 4, !tbaa !5
  %137 = add nsw i32 %135, %136
  %138 = sub nsw i32 %137, 1
  store i32 %138, ptr %10, align 4, !tbaa !5
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %141 = load i32, ptr @idx, align 4, !tbaa !5
  %142 = sub nsw i32 1, %141
  store i32 %142, ptr @idx, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %132, %123
  br label %208

144:                                              ; preds = %71
  %145 = load i32, ptr @cnt, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr @cnt, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %160, %144
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = icmp sle i32 %148, %149
  br i1 %150, label %151, label %158

151:                                              ; preds = %147
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %153)
  %155 = load i8, ptr %154, align 1, !tbaa !9
  %156 = sext i8 %155 to i32
  %157 = icmp eq i32 %156, 71
  br label %158

158:                                              ; preds = %151, %147
  %159 = phi i1 [ false, %147 ], [ %157, %151 ]
  br i1 %159, label %160, label %163

160:                                              ; preds = %158
  %161 = load i32, ptr %2, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %2, align 4, !tbaa !5
  br label %147, !llvm.loop !15

163:                                              ; preds = %158
  %164 = load i32, ptr %2, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %165)
  %167 = load i8, ptr %166, align 1, !tbaa !9
  %168 = sext i8 %167 to i32
  %169 = icmp eq i32 %168, 71
  br i1 %169, label %170, label %196

170:                                              ; preds = %163
  br label %171

171:                                              ; preds = %184, %170
  %172 = load i32, ptr %2, align 4, !tbaa !5
  %173 = load i32, ptr @n, align 4, !tbaa !5
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %175, label %182

175:                                              ; preds = %171
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %177)
  %179 = load i8, ptr %178, align 1, !tbaa !9
  %180 = sext i8 %179 to i32
  %181 = icmp eq i32 %180, 82
  br label %182

182:                                              ; preds = %175, %171
  %183 = phi i1 [ false, %171 ], [ %181, %175 ]
  br i1 %183, label %184, label %187

184:                                              ; preds = %182
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %2, align 4, !tbaa !5
  br label %171, !llvm.loop !16

187:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %188 = load i32, ptr @n, align 4, !tbaa !5
  %189 = sub nsw i32 %188, 1
  store i32 %189, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %190 = load i32, ptr %2, align 4, !tbaa !5
  %191 = load i32, ptr @k, align 4, !tbaa !5
  %192 = add nsw i32 %190, %191
  %193 = sub nsw i32 %192, 1
  store i32 %193, ptr %12, align 4, !tbaa !5
  %194 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %195 = load i32, ptr %194, align 4, !tbaa !5
  store i32 %195, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %207

196:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %197 = load i32, ptr @n, align 4, !tbaa !5
  %198 = sub nsw i32 %197, 1
  store i32 %198, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %199 = load i32, ptr %2, align 4, !tbaa !5
  %200 = load i32, ptr @k, align 4, !tbaa !5
  %201 = add nsw i32 %199, %200
  %202 = sub nsw i32 %201, 1
  store i32 %202, ptr %14, align 4, !tbaa !5
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %204 = load i32, ptr %203, align 4, !tbaa !5
  store i32 %204, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %205 = load i32, ptr @idx, align 4, !tbaa !5
  %206 = sub nsw i32 1, %205
  store i32 %206, ptr @idx, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %196, %187
  br label %208

208:                                              ; preds = %207, %143
  br label %66, !llvm.loop !17

209:                                              ; preds = %66
  %210 = load i32, ptr @cnt, align 4, !tbaa !5
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %210)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %4, align 4
  br label %213

213:                                              ; preds = %209, %54, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %214 = load i32, ptr %4, align 4
  switch i32 %214, label %217 [
    i32 0, label %215
    i32 2, label %16
  ]

215:                                              ; preds = %213
  br label %16, !llvm.loop !12

216:                                              ; preds = %16
  ret i32 0

217:                                              ; preds = %213
  unreachable
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@idx = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = 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 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 = 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) @t)
  %12 = load i32, ptr @t, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @t, align 4, !tbaa !5
  %.not71 = icmp eq i32 %12, 0
  br i1 %.not71, label %._crit_edge74, label %.lr.ph73

.lr.ph73:                                         ; preds = %0, %130
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  store i32 0, ptr @r, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 1, ptr @idx, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.lr.ph73, %22
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %.lr.ph73 ]
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = icmp eq i8 %20, 71
  %.pre.pre = load i32, ptr @n, align 4, !tbaa !5
  br i1 %21, label %22, label %.critedge.loopexit

22:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = sext i32 %.pre.pre to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.critedge.loopexit, !llvm.loop !10

.critedge.loopexit:                               ; preds = %22, %.lr.ph
  %.036.lcssa.ph.in = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next, %22 ]
  %.036.lcssa.ph = trunc i64 %.036.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph73
  %25 = phi i32 [ %17, %.lr.ph73 ], [ %.pre.pre, %.critedge.loopexit ]
  %.036.lcssa = phi i32 [ 0, %.lr.ph73 ], [ %.036.lcssa.ph, %.critedge.loopexit ]
  %26 = icmp eq i32 %.036.lcssa, %25
  br i1 %26, label %27, label %32

27:                                               ; preds = %.critedge
  %28 = zext nneg i32 %25 to i64
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %28)
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = icmp ne i8 %30, 71
  %. = zext i1 %31 to i32
  br label %130, !llvm.loop !12

32:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %33 = add nsw i32 %25, -1
  store i32 %33, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %34 = load i32, ptr @k, align 4, !tbaa !5
  %35 = add i32 %.036.lcssa, -1
  %36 = add i32 %35, %34
  store i32 %36, ptr %2, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  %.not3867 = icmp eq i32 %.036.lcssa, %40
  br i1 %.not3867, label %._crit_edge, label %.lr.ph70

.lr.ph70:                                         ; preds = %32, %126
  %.069 = phi i32 [ %.1, %126 ], [ %38, %32 ]
  %.13768 = phi i32 [ %.6, %126 ], [ %.036.lcssa, %32 ]
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.13768)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @.str)
  %43 = load i32, ptr @idx, align 4, !tbaa !5
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %42, i32 noundef %43)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %46 = load i32, ptr @idx, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 1
  %48 = load i32, ptr @cnt, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @cnt, align 4, !tbaa !5
  %.not4056 = icmp sgt i32 %.13768, %.069
  br i1 %47, label %50, label %88

50:                                               ; preds = %.lr.ph70
  br i1 %.not4056, label %.critedge2, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %50
  %51 = sext i32 %.13768 to i64
  %52 = sext i32 %.069 to i64
  %53 = add i32 %.069, 1
  br label %.lr.ph58

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %57
  %indvars.iv84 = phi i64 [ %51, %.lr.ph58.preheader ], [ %indvars.iv.next85, %57 ]
  %54 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv84)
  %55 = load i8, ptr %54, align 1, !tbaa !9
  %56 = icmp eq i8 %55, 82
  br i1 %56, label %57, label %.critedge2.loopexit.split.loop.exit96

57:                                               ; preds = %.lr.ph58
  %indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
  %.not40.not = icmp slt i64 %indvars.iv84, %52
  br i1 %.not40.not, label %.lr.ph58, label %.critedge2, !llvm.loop !13

.critedge2.loopexit.split.loop.exit96:            ; preds = %.lr.ph58
  %58 = trunc nsw i64 %indvars.iv84 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %57, %.critedge2.loopexit.split.loop.exit96, %50
  %.2.lcssa = phi i32 [ %.13768, %50 ], [ %58, %.critedge2.loopexit.split.loop.exit96 ], [ %53, %57 ]
  %59 = sext i32 %.2.lcssa to i64
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %59)
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = icmp eq i8 %61, 82
  br i1 %62, label %.preheader, label %78

.preheader:                                       ; preds = %.critedge2
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = icmp slt i32 %.2.lcssa, %63
  br i1 %64, label %.lr.ph63, label %.critedge4

.lr.ph63:                                         ; preds = %.preheader, %68
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %68 ], [ %59, %.preheader ]
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv88)
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = icmp eq i8 %66, 71
  %.pre93.pre = load i32, ptr @n, align 4, !tbaa !5
  br i1 %67, label %68, label %.critedge4.loopexit

68:                                               ; preds = %.lr.ph63
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, 1
  %69 = sext i32 %.pre93.pre to i64
  %70 = icmp slt i64 %indvars.iv.next89, %69
  br i1 %70, label %.lr.ph63, label %.critedge4.loopexit, !llvm.loop !14

.critedge4.loopexit:                              ; preds = %68, %.lr.ph63
  %.3.lcssa.ph.in = phi i64 [ %indvars.iv88, %.lr.ph63 ], [ %indvars.iv.next89, %68 ]
  %.3.lcssa.ph = trunc i64 %.3.lcssa.ph.in to i32
  br label %.critedge4

.critedge4:                                       ; preds = %.critedge4.loopexit, %.preheader
  %71 = phi i32 [ %63, %.preheader ], [ %.pre93.pre, %.critedge4.loopexit ]
  %.3.lcssa = phi i32 [ %.2.lcssa, %.preheader ], [ %.3.lcssa.ph, %.critedge4.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %73 = load i32, ptr @k, align 4, !tbaa !5
  %74 = add i32 %.3.lcssa, -1
  %75 = add i32 %74, %73
  store i32 %75, ptr %4, align 4, !tbaa !5
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %77 = load i32, ptr %76, align 4, !tbaa !5
  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 %126

78:                                               ; preds = %.critedge2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %81 = load i32, ptr @k, align 4, !tbaa !5
  %82 = add i32 %.2.lcssa, -1
  %83 = add i32 %82, %81
  store i32 %83, ptr %6, align 4, !tbaa !5
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %85 = load i32, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %86 = load i32, ptr @idx, align 4, !tbaa !5
  %87 = sub nsw i32 1, %86
  store i32 %87, ptr @idx, align 4, !tbaa !5
  br label %126

88:                                               ; preds = %.lr.ph70
  br i1 %.not4056, label %.critedge6, label %.lr.ph47.preheader

.lr.ph47.preheader:                               ; preds = %88
  %89 = sext i32 %.13768 to i64
  %90 = sext i32 %.069 to i64
  %91 = add i32 %.069, 1
  br label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph47.preheader, %95
  %indvars.iv76 = phi i64 [ %89, %.lr.ph47.preheader ], [ %indvars.iv.next77, %95 ]
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv76)
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = icmp eq i8 %93, 71
  br i1 %94, label %95, label %.critedge6.loopexit.split.loop.exit94

95:                                               ; preds = %.lr.ph47
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, 1
  %.not39.not = icmp slt i64 %indvars.iv76, %90
  br i1 %.not39.not, label %.lr.ph47, label %.critedge6, !llvm.loop !15

.critedge6.loopexit.split.loop.exit94:            ; preds = %.lr.ph47
  %96 = trunc nsw i64 %indvars.iv76 to i32
  br label %.critedge6

.critedge6:                                       ; preds = %95, %.critedge6.loopexit.split.loop.exit94, %88
  %.4.lcssa = phi i32 [ %.13768, %88 ], [ %96, %.critedge6.loopexit.split.loop.exit94 ], [ %91, %95 ]
  %97 = sext i32 %.4.lcssa to i64
  %98 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %97)
  %99 = load i8, ptr %98, align 1, !tbaa !9
  %100 = icmp eq i8 %99, 71
  br i1 %100, label %.preheader41, label %116

.preheader41:                                     ; preds = %.critedge6
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %102 = icmp slt i32 %.4.lcssa, %101
  br i1 %102, label %.lr.ph52, label %.critedge8

.lr.ph52:                                         ; preds = %.preheader41, %106
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %106 ], [ %97, %.preheader41 ]
  %103 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv80)
  %104 = load i8, ptr %103, align 1, !tbaa !9
  %105 = icmp eq i8 %104, 82
  %.pre92.pre = load i32, ptr @n, align 4, !tbaa !5
  br i1 %105, label %106, label %.critedge8.loopexit

106:                                              ; preds = %.lr.ph52
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, 1
  %107 = sext i32 %.pre92.pre to i64
  %108 = icmp slt i64 %indvars.iv.next81, %107
  br i1 %108, label %.lr.ph52, label %.critedge8.loopexit, !llvm.loop !16

.critedge8.loopexit:                              ; preds = %106, %.lr.ph52
  %.5.lcssa.ph.in = phi i64 [ %indvars.iv80, %.lr.ph52 ], [ %indvars.iv.next81, %106 ]
  %.5.lcssa.ph = trunc i64 %.5.lcssa.ph.in to i32
  br label %.critedge8

.critedge8:                                       ; preds = %.critedge8.loopexit, %.preheader41
  %109 = phi i32 [ %101, %.preheader41 ], [ %.pre92.pre, %.critedge8.loopexit ]
  %.5.lcssa = phi i32 [ %.4.lcssa, %.preheader41 ], [ %.5.lcssa.ph, %.critedge8.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %110 = add nsw i32 %109, -1
  store i32 %110, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %111 = load i32, ptr @k, align 4, !tbaa !5
  %112 = add i32 %.5.lcssa, -1
  %113 = add i32 %112, %111
  store i32 %113, ptr %8, align 4, !tbaa !5
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %115 = load i32, ptr %114, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %126

116:                                              ; preds = %.critedge6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %119 = load i32, ptr @k, align 4, !tbaa !5
  %120 = add i32 %.4.lcssa, -1
  %121 = add i32 %120, %119
  store i32 %121, ptr %10, align 4, !tbaa !5
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %123 = load i32, ptr %122, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %124 = load i32, ptr @idx, align 4, !tbaa !5
  %125 = sub nsw i32 1, %124
  store i32 %125, ptr @idx, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %.critedge8, %116, %.critedge4, %78
  %.6 = phi i32 [ %.3.lcssa, %.critedge4 ], [ %.2.lcssa, %78 ], [ %.5.lcssa, %.critedge8 ], [ %.4.lcssa, %116 ]
  %.1 = phi i32 [ %77, %.critedge4 ], [ %85, %78 ], [ %115, %.critedge8 ], [ %123, %116 ]
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  %.not38 = icmp eq i32 %.6, %128
  br i1 %.not38, label %._crit_edge, label %.lr.ph70, !llvm.loop !17

._crit_edge:                                      ; preds = %126, %32
  %129 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %27, %._crit_edge
  %.sink98 = phi i32 [ %129, %._crit_edge ], [ %., %27 ]
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink98)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %133 = load i32, ptr @t, align 4, !tbaa !5
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %133, 0
  br i1 %.not, label %._crit_edge74, label %.lr.ph73

._crit_edge74:                                    ; preds = %130, %0
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


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