; LLVM IR from plskz/competitive-programming :: Junior Training Sheet/B (23)

; 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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_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 }

@_Z1sB5cxx11 = external dso_local global [150 x %"class.std::__cxx11::basic_string"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

26:                                               ; preds = %36, %0
  %27 = load i32, ptr %5, align 4, !tbaa !8
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i32, ptr %5, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %33
  %35 = 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) %34)
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %5, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %5, align 4, !tbaa !8
  br label %26, !llvm.loop !11

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 48, ptr %6) #5
  call void @_ZNSt3setIcSt4lessIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %206, %39
  %41 = load i32, ptr %7, align 4, !tbaa !8
  %42 = load i32, ptr %2, align 4, !tbaa !8
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

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

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

46:                                               ; preds = %202, %45
  %47 = load i32, ptr %9, align 4, !tbaa !8
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %205

51:                                               ; preds = %46
  %52 = load i32, ptr %7, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %53
  %55 = load i32, ptr %9, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %54, i64 noundef %56)
          to label %58 unwind label %96

58:                                               ; preds = %51
  %59 = load i8, ptr %57, align 1, !tbaa !13
  %60 = sext i8 %59 to i32
  %61 = load i8, ptr %4, align 1, !tbaa !13
  %62 = sext i8 %61 to i32
  %63 = icmp eq i32 %60, %62
  br i1 %63, label %64, label %201

64:                                               ; preds = %58
  %65 = load i32, ptr %7, align 4, !tbaa !8
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %100

67:                                               ; preds = %64
  %68 = load i32, ptr %7, align 4, !tbaa !8
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %70
  %72 = load i32, ptr %9, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %71, i64 noundef %73)
          to label %75 unwind label %96

75:                                               ; preds = %67
  %76 = load i8, ptr %74, align 1, !tbaa !13
  %77 = sext i8 %76 to i32
  %78 = load i8, ptr %4, align 1, !tbaa !13
  %79 = sext i8 %78 to i32
  %80 = icmp ne i32 %77, %79
  br i1 %80, label %81, label %100

81:                                               ; preds = %75
  %82 = load i32, ptr %7, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %84
  %86 = load i32, ptr %9, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %85, i64 noundef %87)
          to label %89 unwind label %96

89:                                               ; preds = %81
  %90 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 1 dereferenceable(1) %88)
          to label %91 unwind label %96

91:                                               ; preds = %89
  %92 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 0
  %93 = extractvalue { ptr, i8 } %90, 0
  store ptr %93, ptr %92, align 8
  %94 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 1
  %95 = extractvalue { ptr, i8 } %90, 1
  store i8 %95, ptr %94, align 8
  br label %100

96:                                               ; preds = %193, %185, %171, %159, %151, %137, %127, %119, %105, %89, %81, %67, %51
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %10, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %227

100:                                              ; preds = %91, %75, %64
  %101 = load i32, ptr %7, align 4, !tbaa !8
  %102 = load i32, ptr %2, align 4, !tbaa !8
  %103 = sub nsw i32 %102, 1
  %104 = icmp ne i32 %101, %103
  br i1 %104, label %105, label %134

105:                                              ; preds = %100
  %106 = load i32, ptr %7, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %108
  %110 = load i32, ptr %9, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %109, i64 noundef %111)
          to label %113 unwind label %96

113:                                              ; preds = %105
  %114 = load i8, ptr %112, align 1, !tbaa !13
  %115 = sext i8 %114 to i32
  %116 = load i8, ptr %4, align 1, !tbaa !13
  %117 = sext i8 %116 to i32
  %118 = icmp ne i32 %115, %117
  br i1 %118, label %119, label %134

119:                                              ; preds = %113
  %120 = load i32, ptr %7, align 4, !tbaa !8
  %121 = add nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %122
  %124 = load i32, ptr %9, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %123, i64 noundef %125)
          to label %127 unwind label %96

127:                                              ; preds = %119
  %128 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 1 dereferenceable(1) %126)
          to label %129 unwind label %96

129:                                              ; preds = %127
  %130 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %131 = extractvalue { ptr, i8 } %128, 0
  store ptr %131, ptr %130, align 8
  %132 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %133 = extractvalue { ptr, i8 } %128, 1
  store i8 %133, ptr %132, align 8
  br label %134

134:                                              ; preds = %129, %113, %100
  %135 = load i32, ptr %9, align 4, !tbaa !8
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %166

137:                                              ; preds = %134
  %138 = load i32, ptr %7, align 4, !tbaa !8
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %139
  %141 = load i32, ptr %9, align 4, !tbaa !8
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %140, i64 noundef %143)
          to label %145 unwind label %96

145:                                              ; preds = %137
  %146 = load i8, ptr %144, align 1, !tbaa !13
  %147 = sext i8 %146 to i32
  %148 = load i8, ptr %4, align 1, !tbaa !13
  %149 = sext i8 %148 to i32
  %150 = icmp ne i32 %147, %149
  br i1 %150, label %151, label %166

151:                                              ; preds = %145
  %152 = load i32, ptr %7, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %153
  %155 = load i32, ptr %9, align 4, !tbaa !8
  %156 = sub nsw i32 %155, 1
  %157 = sext i32 %156 to i64
  %158 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %154, i64 noundef %157)
          to label %159 unwind label %96

159:                                              ; preds = %151
  %160 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 1 dereferenceable(1) %158)
          to label %161 unwind label %96

161:                                              ; preds = %159
  %162 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %163 = extractvalue { ptr, i8 } %160, 0
  store ptr %163, ptr %162, align 8
  %164 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %165 = extractvalue { ptr, i8 } %160, 1
  store i8 %165, ptr %164, align 8
  br label %166

166:                                              ; preds = %161, %145, %134
  %167 = load i32, ptr %9, align 4, !tbaa !8
  %168 = load i32, ptr %3, align 4, !tbaa !8
  %169 = sub nsw i32 %168, 1
  %170 = icmp ne i32 %167, %169
  br i1 %170, label %171, label %200

171:                                              ; preds = %166
  %172 = load i32, ptr %7, align 4, !tbaa !8
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %173
  %175 = load i32, ptr %9, align 4, !tbaa !8
  %176 = add nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %174, i64 noundef %177)
          to label %179 unwind label %96

179:                                              ; preds = %171
  %180 = load i8, ptr %178, align 1, !tbaa !13
  %181 = sext i8 %180 to i32
  %182 = load i8, ptr %4, align 1, !tbaa !13
  %183 = sext i8 %182 to i32
  %184 = icmp ne i32 %181, %183
  br i1 %184, label %185, label %200

185:                                              ; preds = %179
  %186 = load i32, ptr %7, align 4, !tbaa !8
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %187
  %189 = load i32, ptr %9, align 4, !tbaa !8
  %190 = add nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %188, i64 noundef %191)
          to label %193 unwind label %96

193:                                              ; preds = %185
  %194 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 1 dereferenceable(1) %192)
          to label %195 unwind label %96

195:                                              ; preds = %193
  %196 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %197 = extractvalue { ptr, i8 } %194, 0
  store ptr %197, ptr %196, align 8
  %198 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %199 = extractvalue { ptr, i8 } %194, 1
  store i8 %199, ptr %198, align 8
  br label %200

200:                                              ; preds = %195, %179, %166
  br label %201

201:                                              ; preds = %200, %58
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %9, align 4, !tbaa !8
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %9, align 4, !tbaa !8
  br label %46, !llvm.loop !14

205:                                              ; preds = %50
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %7, align 4, !tbaa !8
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %7, align 4, !tbaa !8
  br label %40, !llvm.loop !15

209:                                              ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  store i8 46, ptr %16, align 1, !tbaa !13
  %210 = invoke noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE5countERKc(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %211 unwind label %223

211:                                              ; preds = %209
  %212 = icmp ne i64 %210, 0
  br i1 %212, label %213, label %216

213:                                              ; preds = %211
  %214 = call noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  %215 = sub i64 %214, 1
  br label %218

216:                                              ; preds = %211
  %217 = call noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  br label %218

218:                                              ; preds = %216, %213
  %219 = phi i64 [ %215, %213 ], [ %217, %216 ]
  %220 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %219)
          to label %221 unwind label %223

221:                                              ; preds = %218
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @_ZNSt3setIcSt4lessIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %222 = load i32, ptr %1, align 4
  ret i32 %222

223:                                              ; preds = %218, %209
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %10, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  br label %227

227:                                              ; preds = %223, %96
  call void @_ZNSt3setIcSt4lessIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %228

228:                                              ; preds = %227
  %229 = load ptr, ptr %10, align 8
  %230 = load i32, ptr %11, align 4
  %231 = insertvalue { ptr, i32 } poison, ptr %229, 0
  %232 = insertvalue { ptr, i32 } %231, i32 %230, 1
  resume { ptr, i32 } %232
}

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 @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #1

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.end.p0(i64 immarg, ptr nocapture) #3

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE5countERKc(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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::__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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, char, std::_Identity<char>, std::less<char>>::_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 }

@_Z1sB5cxx11 = external dso_local global [150 x %"class.std::__cxx11::basic_string"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i8, align 1
  %4 = alloca %"class.std::set", align 8
  %5 = alloca i8, align 1
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  %12 = 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)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %15 = load i32, ptr %1, align 4, !tbaa !8
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @_ZNSt3setIcSt4lessIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %17 = load i32, ptr %1, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  %19 = load i32, ptr %2, align 4
  %20 = icmp sgt i32 %19, 0
  %or.cond = select i1 %18, i1 %20, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge55

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %21 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %indvars.iv
  %22 = 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) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge, %._crit_edge53
  %26 = phi i32 [ %68, %._crit_edge53 ], [ %17, %._crit_edge ]
  %27 = phi i32 [ %69, %._crit_edge53 ], [ %19, %._crit_edge ]
  %indvars.iv62 = phi i64 [ %indvars.iv.next63.pre-phi, %._crit_edge53 ], [ 0, %._crit_edge ]
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph52, label %.preheader.._crit_edge53_crit_edge

.preheader.._crit_edge53_crit_edge:               ; preds = %.preheader
  %.pre70 = add nuw nsw i64 %indvars.iv62, 1
  br label %._crit_edge53

.lr.ph52:                                         ; preds = %.preheader
  %29 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %indvars.iv62
  %.not41 = icmp eq i64 %indvars.iv62, 0
  %30 = add nsw i64 %indvars.iv62, -1
  %31 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %30
  %32 = add nuw nsw i64 %indvars.iv62, 1
  %33 = getelementptr inbounds [150 x %"class.std::__cxx11::basic_string"], ptr @_Z1sB5cxx11, i64 0, i64 %32
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef 0)
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = load i8, ptr %3, align 1, !tbaa !13
  %37 = icmp eq i8 %35, %36
  br i1 %37, label %38, label %64

38:                                               ; preds = %.lr.ph52
  br i1 %.not41, label %46, label %39

39:                                               ; preds = %38
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef 0)
  %41 = load i8, ptr %40, align 1, !tbaa !13
  %42 = load i8, ptr %3, align 1, !tbaa !13
  %.not42.peel = icmp eq i8 %41, %42
  br i1 %.not42.peel, label %46, label %43

43:                                               ; preds = %39
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef 0)
  %45 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %44)
          to label %46 unwind label %.loopexit.split-lp

46:                                               ; preds = %43, %39, %38
  %47 = load i32, ptr %1, align 4, !tbaa !8
  %48 = add nsw i32 %47, -1
  %49 = zext i32 %48 to i64
  %.not43.peel = icmp eq i64 %indvars.iv62, %49
  br i1 %.not43.peel, label %._crit_edge67, label %50

50:                                               ; preds = %46
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %33, i64 noundef 0)
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = load i8, ptr %3, align 1, !tbaa !13
  %.not44.peel = icmp eq i8 %52, %53
  br i1 %.not44.peel, label %._crit_edge67, label %54

54:                                               ; preds = %50
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %33, i64 noundef 0)
  %56 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %55)
          to label %._crit_edge67 unwind label %.loopexit.split-lp

._crit_edge67:                                    ; preds = %54, %50, %46
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  %.not47.peel = icmp eq i32 %.pre, 1
  br i1 %.not47.peel, label %._crit_edge53.loopexit, label %57

57:                                               ; preds = %._crit_edge67
  %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef 1)
  %59 = load i8, ptr %58, align 1, !tbaa !13
  %60 = load i8, ptr %3, align 1, !tbaa !13
  %.not48.peel = icmp eq i8 %59, %60
  br i1 %.not48.peel, label %64, label %61

61:                                               ; preds = %57
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef 1)
  %63 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %62)
          to label %64 unwind label %.loopexit.split-lp

64:                                               ; preds = %61, %57, %.lr.ph52
  %.pr = load i32, ptr %2, align 4, !tbaa !8
  %65 = icmp sgt i32 %.pr, 1
  br i1 %65, label %.peel.next, label %._crit_edge53.loopexit

._crit_edge55:                                    ; preds = %._crit_edge53, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  store i8 46, ptr %5, align 1, !tbaa !13
  %66 = invoke noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE5countERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %119 unwind label %125

._crit_edge53.loopexit:                           ; preds = %115, %._crit_edge67, %64
  %67 = phi i32 [ %.pr, %64 ], [ 1, %._crit_edge67 ], [ %116, %115 ]
  %.pre69 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge53

._crit_edge53:                                    ; preds = %.preheader.._crit_edge53_crit_edge, %._crit_edge53.loopexit
  %indvars.iv.next63.pre-phi = phi i64 [ %.pre70, %.preheader.._crit_edge53_crit_edge ], [ %32, %._crit_edge53.loopexit ]
  %68 = phi i32 [ %26, %.preheader.._crit_edge53_crit_edge ], [ %.pre69, %._crit_edge53.loopexit ]
  %69 = phi i32 [ %27, %.preheader.._crit_edge53_crit_edge ], [ %67, %._crit_edge53.loopexit ]
  %70 = sext i32 %68 to i64
  %71 = icmp slt i64 %indvars.iv.next63.pre-phi, %70
  br i1 %71, label %.preheader, label %._crit_edge55, !llvm.loop !14

.peel.next:                                       ; preds = %64, %115
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %115 ], [ 1, %64 ]
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef %indvars.iv58)
  %73 = load i8, ptr %72, align 1, !tbaa !13
  %74 = load i8, ptr %3, align 1, !tbaa !13
  %75 = icmp eq i8 %73, %74
  br i1 %75, label %76, label %115

76:                                               ; preds = %.peel.next
  br i1 %.not41, label %84, label %77

77:                                               ; preds = %76
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef %indvars.iv58)
  %79 = load i8, ptr %78, align 1, !tbaa !13
  %80 = load i8, ptr %3, align 1, !tbaa !13
  %.not42 = icmp eq i8 %79, %80
  br i1 %.not42, label %84, label %81

81:                                               ; preds = %77
  %82 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %31, i64 noundef %indvars.iv58)
  %83 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %82)
          to label %84 unwind label %.loopexit

.loopexit:                                        ; preds = %81, %92, %100, %112
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %127

.loopexit.split-lp:                               ; preds = %43, %54, %61
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %127

84:                                               ; preds = %81, %77, %76
  %85 = load i32, ptr %1, align 4, !tbaa !8
  %86 = add nsw i32 %85, -1
  %87 = zext i32 %86 to i64
  %.not43 = icmp eq i64 %indvars.iv62, %87
  br i1 %.not43, label %95, label %88

88:                                               ; preds = %84
  %89 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %33, i64 noundef %indvars.iv58)
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = load i8, ptr %3, align 1, !tbaa !13
  %.not44 = icmp eq i8 %90, %91
  br i1 %.not44, label %95, label %92

92:                                               ; preds = %88
  %93 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %33, i64 noundef %indvars.iv58)
  %94 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %93)
          to label %95 unwind label %.loopexit

95:                                               ; preds = %84, %88, %92
  %96 = add nsw i64 %indvars.iv58, -1
  %97 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef %96)
  %98 = load i8, ptr %97, align 1, !tbaa !13
  %99 = load i8, ptr %3, align 1, !tbaa !13
  %.not46 = icmp eq i8 %98, %99
  br i1 %.not46, label %103, label %100

100:                                              ; preds = %95
  %101 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef %96)
  %102 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %101)
          to label %103 unwind label %.loopexit

103:                                              ; preds = %100, %95
  %104 = load i32, ptr %2, align 4, !tbaa !8
  %105 = add nsw i32 %104, -1
  %106 = zext i32 %105 to i64
  %.not47 = icmp eq i64 %indvars.iv58, %106
  br i1 %.not47, label %115, label %107

107:                                              ; preds = %103
  %108 = add nuw nsw i64 %indvars.iv58, 1
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef %108)
  %110 = load i8, ptr %109, align 1, !tbaa !13
  %111 = load i8, ptr %3, align 1, !tbaa !13
  %.not48 = icmp eq i8 %110, %111
  br i1 %.not48, label %115, label %112

112:                                              ; preds = %107
  %113 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %29, i64 noundef %108)
  %114 = invoke { ptr, i8 } @_ZNSt3setIcSt4lessIcESaIcEE6insertERKc(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 1 dereferenceable(1) %113)
          to label %115 unwind label %.loopexit

115:                                              ; preds = %112, %.peel.next, %107, %103
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %116 = load i32, ptr %2, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = icmp slt i64 %indvars.iv.next59, %117
  br i1 %118, label %.peel.next, label %._crit_edge53.loopexit, !llvm.loop !16

119:                                              ; preds = %._crit_edge55
  %.not = icmp ne i64 %66, 0
  %120 = call noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  %121 = sext i1 %.not to i64
  %122 = add i64 %120, %121
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %122)
          to label %124 unwind label %125

124:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSt3setIcSt4lessIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

125:                                              ; preds = %119, %._crit_edge55
  %126 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  br label %127

127:                                              ; preds = %.loopexit, %.loopexit.split-lp, %125
  %.pn = phi { ptr, i32 } [ %126, %125 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt3setIcSt4lessIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

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 @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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.end.p0(i64 immarg, ptr nocapture) #3

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE5countERKc(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIcSt4lessIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.peeled.count", i32 1}


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