; LLVM IR from eyangch/competitive-programming :: Codeforces/1328 (d)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@_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
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::set", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %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) %2)
  br label %25

25:                                               ; preds = %255, %0
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %2, align 4, !tbaa !8
  %28 = icmp ne i32 %26, 0
  br i1 %28, label %29, label %258

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %31 = load i32, ptr %3, align 4, !tbaa !8
  %32 = zext i32 %31 to i64
  %33 = call ptr @llvm.stacksave.p0()
  store ptr %33, ptr %4, align 8
  %34 = alloca i32, i64 %32, align 16
  store i64 %32, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %35

35:                                               ; preds = %55, %29
  %36 = load i32, ptr %7, align 4, !tbaa !8
  %37 = load i32, ptr %3, align 4, !tbaa !8
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %7, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %34, i64 %42
  %44 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %45 unwind label %58

45:                                               ; preds = %40
  %46 = load i32, ptr %7, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %34, i64 %47
  %49 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %50 unwind label %58

50:                                               ; preds = %45
  %51 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %52 = extractvalue { ptr, i8 } %49, 0
  store ptr %52, ptr %51, align 8
  %53 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %54 = extractvalue { ptr, i8 } %49, 1
  store i8 %54, ptr %53, align 8
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %7, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !8
  br label %35, !llvm.loop !11

58:                                               ; preds = %45, %40
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %8, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %257

62:                                               ; preds = %39
  %63 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  %64 = trunc i64 %63 to i32
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %95

66:                                               ; preds = %62
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %68 unwind label %76

68:                                               ; preds = %66
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %70 unwind label %76

70:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %85, %70
  %72 = load i32, ptr %11, align 4, !tbaa !8
  %73 = load i32, ptr %3, align 4, !tbaa !8
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %80, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %92

76:                                               ; preds = %133, %110, %108, %92, %68, %66
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %8, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %9, align 4
  br label %257

80:                                               ; preds = %71
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %82 unwind label %88

82:                                               ; preds = %80
  %83 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef @.str)
          to label %84 unwind label %88

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %11, align 4, !tbaa !8
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !8
  br label %71, !llvm.loop !13

88:                                               ; preds = %82, %80
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %8, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %257

92:                                               ; preds = %75
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %94 unwind label %76

94:                                               ; preds = %92
  br label %255

95:                                               ; preds = %62
  %96 = load i32, ptr %3, align 4, !tbaa !8
  %97 = srem i32 %96, 2
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %108, label %99

99:                                               ; preds = %95
  %100 = getelementptr inbounds i32, ptr %34, i64 0
  %101 = load i32, ptr %100, align 16, !tbaa !8
  %102 = load i32, ptr %3, align 4, !tbaa !8
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %34, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = icmp eq i32 %101, %106
  br i1 %107, label %108, label %136

108:                                              ; preds = %99, %95
  %109 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
          to label %110 unwind label %76

110:                                              ; preds = %108
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %112 unwind label %76

112:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %113

113:                                              ; preds = %126, %112
  %114 = load i32, ptr %12, align 4, !tbaa !8
  %115 = load i32, ptr %3, align 4, !tbaa !8
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %133

118:                                              ; preds = %113
  %119 = load i32, ptr %12, align 4, !tbaa !8
  %120 = srem i32 %119, 2
  %121 = add nsw i32 %120, 1
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %121)
          to label %123 unwind label %129

123:                                              ; preds = %118
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @.str)
          to label %125 unwind label %129

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %12, align 4, !tbaa !8
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %12, align 4, !tbaa !8
  br label %113, !llvm.loop !14

129:                                              ; preds = %123, %118
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %8, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %257

133:                                              ; preds = %117
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %135 unwind label %76

135:                                              ; preds = %133
  br label %254

136:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 -1, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !8
  br label %137

137:                                              ; preds = %156, %136
  %138 = load i32, ptr %14, align 4, !tbaa !8
  %139 = load i32, ptr %3, align 4, !tbaa !8
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %159

142:                                              ; preds = %137
  %143 = load i32, ptr %14, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %34, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = load i32, ptr %14, align 4, !tbaa !8
  %148 = sub nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %34, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !8
  %152 = icmp eq i32 %146, %151
  br i1 %152, label %153, label %155

153:                                              ; preds = %142
  %154 = load i32, ptr %14, align 4, !tbaa !8
  store i32 %154, ptr %13, align 4, !tbaa !8
  br label %155

155:                                              ; preds = %153, %142
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %14, align 4, !tbaa !8
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %14, align 4, !tbaa !8
  br label %137, !llvm.loop !15

159:                                              ; preds = %141
  %160 = load i32, ptr %13, align 4, !tbaa !8
  %161 = icmp eq i32 %160, -1
  br i1 %161, label %162, label %192

162:                                              ; preds = %159
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
          to label %164 unwind label %173

164:                                              ; preds = %162
  %165 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %166 unwind label %173

166:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %167

167:                                              ; preds = %180, %166
  %168 = load i32, ptr %15, align 4, !tbaa !8
  %169 = load i32, ptr %3, align 4, !tbaa !8
  %170 = sdiv i32 %169, 2
  %171 = icmp slt i32 %168, %170
  br i1 %171, label %177, label %172

172:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %187

173:                                              ; preds = %249, %223, %217, %194, %192, %189, %187, %164, %162
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %8, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %9, align 4
  br label %253

177:                                              ; preds = %167
  %178 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %179 unwind label %183

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %15, align 4, !tbaa !8
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %15, align 4, !tbaa !8
  br label %167, !llvm.loop !16

183:                                              ; preds = %177
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %8, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %253

187:                                              ; preds = %172
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
          to label %189 unwind label %173

189:                                              ; preds = %187
  %190 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %188, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %191 unwind label %173

191:                                              ; preds = %189
  br label %252

192:                                              ; preds = %159
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
          to label %194 unwind label %173

194:                                              ; preds = %192
  %195 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %196 unwind label %173

196:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %197

197:                                              ; preds = %210, %196
  %198 = load i32, ptr %16, align 4, !tbaa !8
  %199 = load i32, ptr %13, align 4, !tbaa !8
  %200 = icmp slt i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %217

202:                                              ; preds = %197
  %203 = load i32, ptr %16, align 4, !tbaa !8
  %204 = srem i32 %203, 2
  %205 = add nsw i32 %204, 1
  %206 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %205)
          to label %207 unwind label %213

207:                                              ; preds = %202
  %208 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %206, ptr noundef @.str)
          to label %209 unwind label %213

209:                                              ; preds = %207
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %16, align 4, !tbaa !8
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %16, align 4, !tbaa !8
  br label %197, !llvm.loop !17

213:                                              ; preds = %207, %202
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %8, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %253

217:                                              ; preds = %201
  %218 = load i32, ptr %13, align 4, !tbaa !8
  %219 = srem i32 %218, 2
  %220 = sub nsw i32 1, %219
  %221 = add nsw i32 %220, 1
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %221)
          to label %223 unwind label %173

223:                                              ; preds = %217
  %224 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %222, ptr noundef @.str)
          to label %225 unwind label %173

225:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %226 = load i32, ptr %13, align 4, !tbaa !8
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %17, align 4, !tbaa !8
  br label %228

228:                                              ; preds = %242, %225
  %229 = load i32, ptr %17, align 4, !tbaa !8
  %230 = load i32, ptr %3, align 4, !tbaa !8
  %231 = icmp slt i32 %229, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %249

233:                                              ; preds = %228
  %234 = load i32, ptr %17, align 4, !tbaa !8
  %235 = srem i32 %234, 2
  %236 = sub nsw i32 1, %235
  %237 = add nsw i32 %236, 1
  %238 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %237)
          to label %239 unwind label %245

239:                                              ; preds = %233
  %240 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %238, ptr noundef @.str)
          to label %241 unwind label %245

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %17, align 4, !tbaa !8
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %17, align 4, !tbaa !8
  br label %228, !llvm.loop !18

245:                                              ; preds = %239, %233
  %246 = landingpad { ptr, i32 }
          cleanup
  %247 = extractvalue { ptr, i32 } %246, 0
  store ptr %247, ptr %8, align 8
  %248 = extractvalue { ptr, i32 } %246, 1
  store i32 %248, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %253

249:                                              ; preds = %232
  %250 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %251 unwind label %173

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251, %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %254

253:                                              ; preds = %245, %213, %183, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %257

254:                                              ; preds = %252, %135
  br label %255

255:                                              ; preds = %254, %94
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #7
  %256 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %256)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %25, !llvm.loop !19

257:                                              ; preds = %253, %129, %88, %76, %58
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %259

258:                                              ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0

259:                                              ; preds = %257
  %260 = load ptr, ptr %8, align 8
  %261 = load i32, ptr %9, align 4
  %262 = insertvalue { ptr, i32 } poison, ptr %260, 0
  %263 = insertvalue { ptr, i32 } %262, i32 %261, 1
  resume { ptr, i32 } %263
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 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) #5 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)) #6

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@_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
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::set", align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %10 = 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)
  %11 = load i32, ptr %1, align 4, !tbaa !8
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !8
  %.not64 = icmp eq i32 %11, 0
  br i1 %.not64, label %._crit_edge67, label %.lr.ph66

.lr.ph66:                                         ; preds = %0, %155
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = load i32, ptr %2, align 4, !tbaa !8
  %15 = zext i32 %14 to i64
  %16 = call ptr @llvm.stacksave.p0()
  %17 = alloca i32, i64 %15, align 16
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %27, %.lr.ph66
  %20 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  %21 = and i64 %20, 4294967295
  %22 = icmp eq i64 %21, 1
  br i1 %22, label %33, label %50

.lr.ph:                                           ; preds = %.lr.ph66, %27
  %indvars.iv = phi i64 [ %indvars.iv.next, %27 ], [ 0, %.lr.ph66 ]
  %23 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %25 unwind label %31

25:                                               ; preds = %.lr.ph
  %26 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %27 unwind label %31

27:                                               ; preds = %25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %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 !11

31:                                               ; preds = %25, %.lr.ph
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %158

33:                                               ; preds = %._crit_edge
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %35 unwind label %39

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader unwind label %39

.preheader:                                       ; preds = %35
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph62, label %._crit_edge60.invoke

39:                                               ; preds = %._crit_edge60.invoke, %67, %65, %35, %33
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %158

.lr.ph62:                                         ; preds = %.preheader, %44
  %.03361 = phi i32 [ %45, %44 ], [ 0, %.preheader ]
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %42 unwind label %48

42:                                               ; preds = %.lr.ph62
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @.str)
          to label %44 unwind label %48

44:                                               ; preds = %42
  %45 = add nuw nsw i32 %.03361, 1
  %46 = load i32, ptr %2, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph62, label %._crit_edge60.invoke, !llvm.loop !13

48:                                               ; preds = %42, %.lr.ph62
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %158

50:                                               ; preds = %._crit_edge
  %51 = load i32, ptr %2, align 4, !tbaa !8
  %52 = and i32 %51, 1
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %65, label %54

54:                                               ; preds = %50
  %55 = load i32, ptr %17, align 16, !tbaa !8
  %56 = sext i32 %51 to i64
  %57 = getelementptr i32, ptr %17, i64 %56
  %58 = getelementptr i8, ptr %57, i64 -4
  %59 = load i32, ptr %58, align 4, !tbaa !8
  %60 = icmp eq i32 %55, %59
  br i1 %60, label %65, label %.preheader46

.preheader46:                                     ; preds = %54
  %61 = icmp sgt i32 %51, 1
  br i1 %61, label %.lr.ph50.preheader, label %._crit_edge51.thread

.lr.ph50.preheader:                               ; preds = %.preheader46
  %wide.trip.count = zext nneg i32 %51 to i64
  %62 = add nsw i64 %wide.trip.count, -1
  %63 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %62, 2
  %64 = icmp ult i64 %63, 3
  br i1 %64, label %._crit_edge51.unr-lcssa, label %.lr.ph50.preheader.new

.lr.ph50.preheader.new:                           ; preds = %.lr.ph50.preheader
  %unroll_iter = and i64 %62, 2147483644
  br label %.lr.ph50

65:                                               ; preds = %54, %50
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
          to label %67 unwind label %39

67:                                               ; preds = %65
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader42 unwind label %39

.preheader42:                                     ; preds = %67
  %69 = load i32, ptr %2, align 4, !tbaa !8
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph59, label %._crit_edge60.invoke

._crit_edge60.invoke:                             ; preds = %77, %44, %.preheader, %.preheader42
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %155 unwind label %39

.lr.ph59:                                         ; preds = %.preheader42, %77
  %.03258 = phi i32 [ %78, %77 ], [ 0, %.preheader42 ]
  %72 = and i32 %.03258, 1
  %73 = add nuw nsw i32 %72, 1
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %73)
          to label %75 unwind label %81

75:                                               ; preds = %.lr.ph59
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str)
          to label %77 unwind label %81

77:                                               ; preds = %75
  %78 = add nuw nsw i32 %.03258, 1
  %79 = load i32, ptr %2, align 4, !tbaa !8
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %.lr.ph59, label %._crit_edge60.invoke, !llvm.loop !14

81:                                               ; preds = %75, %.lr.ph59
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %158

._crit_edge51.unr-lcssa:                          ; preds = %.lr.ph50, %.lr.ph50.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph50.preheader ], [ %spec.select.3, %.lr.ph50 ]
  %indvars.iv69.unr = phi i64 [ 1, %.lr.ph50.preheader ], [ %indvars.iv.next70.3, %.lr.ph50 ]
  %.03148.unr = phi i32 [ -1, %.lr.ph50.preheader ], [ %spec.select.3, %.lr.ph50 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge51, label %.lr.ph50.epil

.lr.ph50.epil:                                    ; preds = %._crit_edge51.unr-lcssa, %.lr.ph50.epil
  %indvars.iv69.epil = phi i64 [ %indvars.iv.next70.epil, %.lr.ph50.epil ], [ %indvars.iv69.unr, %._crit_edge51.unr-lcssa ]
  %.03148.epil = phi i32 [ %spec.select.epil, %.lr.ph50.epil ], [ %.03148.unr, %._crit_edge51.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph50.epil ], [ 0, %._crit_edge51.unr-lcssa ]
  %83 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv69.epil
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = getelementptr i8, ptr %83, i64 -4
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = icmp eq i32 %84, %86
  %88 = trunc nuw nsw i64 %indvars.iv69.epil to i32
  %spec.select.epil = select i1 %87, i32 %88, i32 %.03148.epil
  %indvars.iv.next70.epil = add nuw nsw i64 %indvars.iv69.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge51, label %.lr.ph50.epil, !llvm.loop !15

._crit_edge51:                                    ; preds = %.lr.ph50.epil, %._crit_edge51.unr-lcssa
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge51.unr-lcssa ], [ %spec.select.epil, %.lr.ph50.epil ]
  %89 = icmp eq i32 %spec.select.lcssa, -1
  br i1 %89, label %._crit_edge51.thread, label %124

.lr.ph50:                                         ; preds = %.lr.ph50, %.lr.ph50.preheader.new
  %indvars.iv69 = phi i64 [ 1, %.lr.ph50.preheader.new ], [ %indvars.iv.next70.3, %.lr.ph50 ]
  %.03148 = phi i32 [ -1, %.lr.ph50.preheader.new ], [ %spec.select.3, %.lr.ph50 ]
  %niter = phi i64 [ 0, %.lr.ph50.preheader.new ], [ %niter.next.3, %.lr.ph50 ]
  %90 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv69
  %91 = load i32, ptr %90, align 4, !tbaa !8
  %92 = getelementptr i8, ptr %90, i64 -4
  %93 = load i32, ptr %92, align 4, !tbaa !8
  %94 = icmp eq i32 %91, %93
  %95 = trunc nuw nsw i64 %indvars.iv69 to i32
  %spec.select = select i1 %94, i32 %95, i32 %.03148
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %96 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next70
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = icmp eq i32 %97, %91
  %99 = trunc nuw nsw i64 %indvars.iv.next70 to i32
  %spec.select.1 = select i1 %98, i32 %99, i32 %spec.select
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %100 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next70.1
  %101 = load i32, ptr %100, align 4, !tbaa !8
  %102 = icmp eq i32 %101, %97
  %103 = trunc nuw nsw i64 %indvars.iv.next70.1 to i32
  %spec.select.2 = select i1 %102, i32 %103, i32 %spec.select.1
  %indvars.iv.next70.2 = add nuw nsw i64 %indvars.iv69, 3
  %104 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv.next70.2
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %106 = icmp eq i32 %105, %101
  %107 = trunc nuw nsw i64 %indvars.iv.next70.2 to i32
  %spec.select.3 = select i1 %106, i32 %107, i32 %spec.select.2
  %indvars.iv.next70.3 = add nuw nsw i64 %indvars.iv69, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge51.unr-lcssa, label %.lr.ph50, !llvm.loop !17

._crit_edge51.thread:                             ; preds = %.preheader46, %._crit_edge51
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
          to label %109 unwind label %114

109:                                              ; preds = %._crit_edge51.thread
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader43 unwind label %114

.preheader43:                                     ; preds = %109
  %111 = load i32, ptr %2, align 4, !tbaa !8
  %112 = icmp sgt i32 %111, 1
  br i1 %112, label %.lr.ph56, label %._crit_edge57

._crit_edge57:                                    ; preds = %117, %.preheader43
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 3)
          to label %.invoke unwind label %114

114:                                              ; preds = %.invoke, %141, %._crit_edge54, %126, %124, %._crit_edge57, %109, %._crit_edge51.thread
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %158

.lr.ph56:                                         ; preds = %.preheader43, %117
  %.02955 = phi i32 [ %118, %117 ], [ 0, %.preheader43 ]
  %116 = invoke 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)
          to label %117 unwind label %122

117:                                              ; preds = %.lr.ph56
  %118 = add nuw nsw i32 %.02955, 1
  %119 = load i32, ptr %2, align 4, !tbaa !8
  %120 = sdiv i32 %119, 2
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %.lr.ph56, label %._crit_edge57, !llvm.loop !18

122:                                              ; preds = %.lr.ph56
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %158

124:                                              ; preds = %._crit_edge51
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
          to label %126 unwind label %114

126:                                              ; preds = %124
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %125, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader45 unwind label %114

.preheader45:                                     ; preds = %126
  %128 = icmp sgt i32 %spec.select.lcssa, 0
  br i1 %128, label %.lr.ph53, label %._crit_edge54

._crit_edge54:                                    ; preds = %137, %.preheader45
  %129 = srem i32 %spec.select.lcssa, 2
  %130 = sub nsw i32 2, %129
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %130)
          to label %141 unwind label %114

.lr.ph53:                                         ; preds = %.preheader45, %137
  %.02852 = phi i32 [ %138, %137 ], [ 0, %.preheader45 ]
  %132 = and i32 %.02852, 1
  %133 = add nuw nsw i32 %132, 1
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %133)
          to label %135 unwind label %139

135:                                              ; preds = %.lr.ph53
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %134, ptr noundef nonnull @.str)
          to label %137 unwind label %139

137:                                              ; preds = %135
  %138 = add nuw nsw i32 %.02852, 1
  %exitcond72.not = icmp eq i32 %138, %spec.select.lcssa
  br i1 %exitcond72.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !19

139:                                              ; preds = %135, %.lr.ph53
  %140 = landingpad { ptr, i32 }
          cleanup
  br label %158

141:                                              ; preds = %._crit_edge54
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull @.str)
          to label %.preheader44 unwind label %114

.preheader44:                                     ; preds = %141, %151
  %.0.in = phi i32 [ %.0, %151 ], [ %spec.select.lcssa, %141 ]
  %.0 = add nsw i32 %.0.in, 1
  %143 = load i32, ptr %2, align 4, !tbaa !8
  %144 = icmp slt i32 %.0, %143
  br i1 %144, label %147, label %.invoke

.invoke:                                          ; preds = %.preheader44, %._crit_edge57
  %145 = phi ptr [ %113, %._crit_edge57 ], [ @_ZSt4cout, %.preheader44 ]
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %155 unwind label %114

147:                                              ; preds = %.preheader44
  %148 = srem i32 %.0, 2
  %149 = sub nsw i32 2, %148
  %150 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %149)
          to label %151 unwind label %153

151:                                              ; preds = %147
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %150, ptr noundef nonnull @.str)
          to label %.preheader44 unwind label %153, !llvm.loop !20

153:                                              ; preds = %151, %147
  %154 = landingpad { ptr, i32 }
          cleanup
  br label %158

155:                                              ; preds = %.invoke, %._crit_edge60.invoke
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  call void @llvm.stackrestore.p0(ptr %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %156 = load i32, ptr %1, align 4, !tbaa !8
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %156, 0
  br i1 %.not, label %._crit_edge67, label %.lr.ph66, !llvm.loop !21

158:                                              ; preds = %114, %122, %139, %153, %81, %48, %39, %31
  %.pn40 = phi { ptr, i32 } [ %32, %31 ], [ %49, %48 ], [ %40, %39 ], [ %82, %81 ], [ %123, %122 ], [ %115, %114 ], [ %140, %139 ], [ %154, %153 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn40

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 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 #5 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)) #6

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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