; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0224 (ARC027_B)

; 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::__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::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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4mojic(i8 noundef signext) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4rooti(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6issameii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [2 x %"class.std::__cxx11::basic_string"], align 16
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::set", align 8
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %19 = 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)
  call void @llvm.lifetime.start.p0(i64 64, ptr %3) #6
  %20 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i32 0, i32 0
  %21 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %20, i64 2
  br label %22

22:                                               ; preds = %22, %0
  %23 = phi ptr [ %20, %0 ], [ %24, %22 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #6
  %24 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %23, i64 1
  %25 = icmp eq ptr %24, %21
  br i1 %25, label %26, label %22

26:                                               ; preds = %22
  %27 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 0
  %28 = invoke 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) %27)
          to label %29 unwind label %38

29:                                               ; preds = %26
  %30 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 1
  %31 = invoke 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) %28, ptr noundef nonnull align 8 dereferenceable(32) %30)
          to label %32 unwind label %38

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

33:                                               ; preds = %60, %32
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %42, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %72

38:                                               ; preds = %29, %26
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  br label %175

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %43 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 0
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %43, i64 noundef %45)
          to label %47 unwind label %63

47:                                               ; preds = %42
  %48 = load i8, ptr %46, align 1, !tbaa !9
  %49 = call noundef i32 @_Z4mojic(i8 noundef signext %48)
  store i32 %49, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %50 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 1
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %50, i64 noundef %52)
          to label %54 unwind label %67

54:                                               ; preds = %47
  %55 = load i8, ptr %53, align 1, !tbaa !9
  %56 = call noundef i32 @_Z4mojic(i8 noundef signext %55)
  store i32 %56, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %8, align 4, !tbaa !5
  invoke void @_Z5uniteii(i32 noundef %57, i32 noundef %58)
          to label %59 unwind label %67

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !5
  br label %33, !llvm.loop !10

63:                                               ; preds = %42
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %4, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %5, align 4
  br label %71

67:                                               ; preds = %54, %47
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %4, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %71

71:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %175

72:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i8 0, ptr %10, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %132, %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %136

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 1, ptr %13, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %79

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

82:                                               ; preds = %79
  store i32 8, ptr %12, align 4
  br label %103

83:                                               ; preds = %79
  %84 = load i32, ptr %14, align 4, !tbaa !5
  %85 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 0
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %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 %95

89:                                               ; preds = %83
  %90 = load i8, ptr %88, align 1, !tbaa !9
  %91 = call noundef i32 @_Z4mojic(i8 noundef signext %90)
  %92 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef %84, i32 noundef %91)
          to label %93 unwind label %95

93:                                               ; preds = %89
  br i1 %92, label %94, label %99

94:                                               ; preds = %93
  store i8 0, ptr %13, align 1, !tbaa !12
  store i32 8, ptr %12, align 4
  br label %103

95:                                               ; preds = %89, %83
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %4, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %135

99:                                               ; preds = %93
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %14, align 4, !tbaa !5
  br label %79, !llvm.loop !14

103:                                              ; preds = %94, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %104

104:                                              ; preds = %103
  %105 = load i8, ptr %13, align 1, !tbaa !12, !range !15, !noundef !16
  %106 = trunc i8 %105 to i1
  br i1 %106, label %107, label %131

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %108 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i64 0, i64 0
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %108, i64 noundef %110)
          to label %112 unwind label %126

112:                                              ; preds = %107
  %113 = load i8, ptr %111, align 1, !tbaa !9
  %114 = call noundef i32 @_Z4mojic(i8 noundef signext %113)
  %115 = invoke noundef i32 @_Z4rooti(i32 noundef %114)
          to label %116 unwind label %126

116:                                              ; preds = %112
  store i32 %115, ptr %15, align 4, !tbaa !5
  %117 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %118 unwind label %126

118:                                              ; preds = %116
  %119 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %120 = extractvalue { ptr, i8 } %117, 0
  store ptr %120, ptr %119, align 8
  %121 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %122 = extractvalue { ptr, i8 } %117, 1
  store i8 %122, ptr %121, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %130

125:                                              ; preds = %118
  store i8 1, ptr %10, align 1, !tbaa !12
  br label %130

126:                                              ; preds = %116, %112, %107
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %4, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %135

130:                                              ; preds = %125, %118
  br label %131

131:                                              ; preds = %130, %104
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %11, align 4, !tbaa !5
  br label %73, !llvm.loop !17

135:                                              ; preds = %126, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %174

136:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 1, ptr %17, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %146, %136
  %138 = load i32, ptr %18, align 4, !tbaa !5
  %139 = zext i32 %138 to i64
  %140 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  %141 = icmp ult i64 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %137
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %149

143:                                              ; preds = %137
  %144 = load i64, ptr %17, align 8, !tbaa !18
  %145 = mul nsw i64 %144, 10
  store i64 %145, ptr %17, align 8, !tbaa !18
  br label %146

146:                                              ; preds = %143
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = add i32 %147, 1
  store i32 %148, ptr %18, align 4, !tbaa !5
  br label %137, !llvm.loop !20

149:                                              ; preds = %142
  %150 = load i8, ptr %10, align 1, !tbaa !12, !range !15, !noundef !16
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %156

152:                                              ; preds = %149
  %153 = load i64, ptr %17, align 8, !tbaa !18
  %154 = sdiv i64 %153, 10
  %155 = mul nsw i64 %154, 9
  store i64 %155, ptr %17, align 8, !tbaa !18
  br label %156

156:                                              ; preds = %152, %149
  %157 = load i64, ptr %17, align 8, !tbaa !18
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %157)
          to label %159 unwind label %170

159:                                              ; preds = %156
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %161 unwind label %170

161:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  %162 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i32 0, i32 0
  %163 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %162, i64 2
  br label %164

164:                                              ; preds = %164, %161
  %165 = phi ptr [ %163, %161 ], [ %166, %164 ]
  %166 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %165, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %166) #6
  %167 = icmp eq ptr %166, %162
  br i1 %167, label %168, label %164

168:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %169 = load i32, ptr %1, align 4
  ret i32 %169

170:                                              ; preds = %159, %156
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %4, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %174

174:                                              ; preds = %170, %135
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #6
  br label %175

175:                                              ; preds = %174, %71, %38
  %176 = getelementptr inbounds [2 x %"class.std::__cxx11::basic_string"], ptr %3, i32 0, i32 0
  %177 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %176, i64 2
  br label %178

178:                                              ; preds = %178, %175
  %179 = phi ptr [ %177, %175 ], [ %180, %178 ]
  %180 = getelementptr inbounds %"class.std::__cxx11::basic_string", ptr %179, i64 -1
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %180) #6
  %181 = icmp eq ptr %180, %176
  br i1 %181, label %182, label %178

182:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %4, align 8
  %185 = load i32, ptr %5, align 4
  %186 = insertvalue { ptr, i32 } poison, ptr %184, 0
  %187 = insertvalue { ptr, i32 } %186, i32 %185, 1
  resume { ptr, i32 } %187
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

; 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) #0 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !11}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !11}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = distinct !{!20, !11}


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

%"class.std::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::__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::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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4mojic(i8 noundef signext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4rooti(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6issameii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca [2 x %"class.std::__cxx11::basic_string"], align 16
  %3 = alloca %"class.std::set", align 8
  %4 = alloca i32, align 4
  tail call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %5 = 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)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %.ptr.1 = getelementptr inbounds i8, ptr %2, i64 32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %.ptr.1) #6
  %6 = invoke 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) %2)
          to label %7 unwind label %81

7:                                                ; preds = %0
  %8 = invoke 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) %6, ptr noundef nonnull align 8 dereferenceable(32) %.ptr.1)
          to label %.preheader44 unwind label %81

.preheader44:                                     ; preds = %7
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %89, %.preheader44
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.preheader43.preheader, label %.preheader

.preheader43.preheader:                           ; preds = %._crit_edge
  %13 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %14 = load i8, ptr %13, align 1, !tbaa !9
  %15 = call noundef i32 @_Z4mojic(i8 noundef signext %14)
  %16 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 0, i32 noundef %15)
          to label %17 unwind label %.loopexit.split-lp

17:                                               ; preds = %.preheader43.preheader
  br i1 %16, label %.loopexit.peel, label %18

18:                                               ; preds = %17
  %19 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = call noundef i32 @_Z4mojic(i8 noundef signext %20)
  %22 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 1, i32 noundef %21)
          to label %23 unwind label %.loopexit.split-lp

23:                                               ; preds = %18
  br i1 %22, label %.loopexit.peel, label %24

24:                                               ; preds = %23
  %25 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %27 = call noundef i32 @_Z4mojic(i8 noundef signext %26)
  %28 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 2, i32 noundef %27)
          to label %29 unwind label %.loopexit.split-lp

29:                                               ; preds = %24
  br i1 %28, label %.loopexit.peel, label %30

30:                                               ; preds = %29
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = call noundef i32 @_Z4mojic(i8 noundef signext %32)
  %34 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 3, i32 noundef %33)
          to label %35 unwind label %.loopexit.split-lp

35:                                               ; preds = %30
  br i1 %34, label %.loopexit.peel, label %36

36:                                               ; preds = %35
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = call noundef i32 @_Z4mojic(i8 noundef signext %38)
  %40 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 4, i32 noundef %39)
          to label %41 unwind label %.loopexit.split-lp

41:                                               ; preds = %36
  br i1 %40, label %.loopexit.peel, label %42

42:                                               ; preds = %41
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = call noundef i32 @_Z4mojic(i8 noundef signext %44)
  %46 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 5, i32 noundef %45)
          to label %47 unwind label %.loopexit.split-lp

47:                                               ; preds = %42
  br i1 %46, label %.loopexit.peel, label %48

48:                                               ; preds = %47
  %49 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = call noundef i32 @_Z4mojic(i8 noundef signext %50)
  %52 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 6, i32 noundef %51)
          to label %53 unwind label %.loopexit.split-lp

53:                                               ; preds = %48
  br i1 %52, label %.loopexit.peel, label %54

54:                                               ; preds = %53
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = call noundef i32 @_Z4mojic(i8 noundef signext %56)
  %58 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 7, i32 noundef %57)
          to label %59 unwind label %.loopexit.split-lp

59:                                               ; preds = %54
  br i1 %58, label %.loopexit.peel, label %60

60:                                               ; preds = %59
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = call noundef i32 @_Z4mojic(i8 noundef signext %62)
  %64 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 8, i32 noundef %63)
          to label %65 unwind label %.loopexit.split-lp

65:                                               ; preds = %60
  br i1 %64, label %.loopexit.peel, label %66

66:                                               ; preds = %65
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %68 = load i8, ptr %67, align 1, !tbaa !9
  %69 = call noundef i32 @_Z4mojic(i8 noundef signext %68)
  %70 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 9, i32 noundef %69)
          to label %71 unwind label %.loopexit.split-lp

71:                                               ; preds = %66
  br i1 %70, label %.loopexit.peel, label %.critedge.peel

.critedge.peel:                                   ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef 0)
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = call noundef i32 @_Z4mojic(i8 noundef signext %73)
  %75 = invoke noundef i32 @_Z4rooti(i32 noundef %74)
          to label %76 unwind label %.loopexit.split-lp62

76:                                               ; preds = %.critedge.peel
  store i32 %75, ptr %4, align 4, !tbaa !5
  %77 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %78 unwind label %.loopexit.split-lp62

78:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %.loopexit.peel

.loopexit.peel:                                   ; preds = %17, %23, %29, %35, %41, %47, %53, %59, %65, %71, %78
  %.133.peel = phi i1 [ true, %78 ], [ false, %71 ], [ false, %65 ], [ false, %59 ], [ false, %53 ], [ false, %47 ], [ false, %41 ], [ false, %35 ], [ false, %29 ], [ false, %23 ], [ false, %17 ]
  %79 = load i32, ptr %1, align 4, !tbaa !5
  %80 = icmp sgt i32 %79, 1
  br i1 %80, label %.preheader43, label %.preheader

81:                                               ; preds = %7, %0
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %183

.lr.ph:                                           ; preds = %.preheader44, %89
  %indvars.iv = phi i64 [ %indvars.iv.next, %89 ], [ 0, %.preheader44 ]
  %83 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv)
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = call noundef i32 @_Z4mojic(i8 noundef signext %84)
  %86 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %.ptr.1, i64 noundef %indvars.iv)
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = call noundef i32 @_Z4mojic(i8 noundef signext %87)
  invoke void @_Z5uniteii(i32 noundef %85, i32 noundef %88)
          to label %89 unwind label %93

89:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = icmp slt i64 %indvars.iv.next, %91
  br i1 %92, label %.lr.ph, label %._crit_edge, !llvm.loop !10

93:                                               ; preds = %.lr.ph
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %183

.preheader43:                                     ; preds = %.loopexit.peel, %.loopexit
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.loopexit ], [ 1, %.loopexit.peel ]
  %95 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %96 = load i8, ptr %95, align 1, !tbaa !9
  %97 = call noundef i32 @_Z4mojic(i8 noundef signext %96)
  %98 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 0, i32 noundef %97)
          to label %158 unwind label %.loopexit60

.preheader:                                       ; preds = %.loopexit, %.loopexit.peel, %._crit_edge
  %.032.lcssa = phi i1 [ false, %._crit_edge ], [ %.133.peel, %.loopexit.peel ], [ %.133.peel, %.loopexit ]
  %99 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %.not = icmp eq i64 %99, 0
  br i1 %.not, label %._crit_edge54, label %.lr.ph53

100:                                              ; preds = %158
  %101 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %102 = load i8, ptr %101, align 1, !tbaa !9
  %103 = call noundef i32 @_Z4mojic(i8 noundef signext %102)
  %104 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 1, i32 noundef %103)
          to label %105 unwind label %.loopexit60

105:                                              ; preds = %100
  br i1 %104, label %.loopexit, label %106

106:                                              ; preds = %105
  %107 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %109 = call noundef i32 @_Z4mojic(i8 noundef signext %108)
  %110 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 2, i32 noundef %109)
          to label %111 unwind label %.loopexit60

111:                                              ; preds = %106
  br i1 %110, label %.loopexit, label %112

112:                                              ; preds = %111
  %113 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %114 = load i8, ptr %113, align 1, !tbaa !9
  %115 = call noundef i32 @_Z4mojic(i8 noundef signext %114)
  %116 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 3, i32 noundef %115)
          to label %117 unwind label %.loopexit60

117:                                              ; preds = %112
  br i1 %116, label %.loopexit, label %118

118:                                              ; preds = %117
  %119 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = call noundef i32 @_Z4mojic(i8 noundef signext %120)
  %122 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 4, i32 noundef %121)
          to label %123 unwind label %.loopexit60

123:                                              ; preds = %118
  br i1 %122, label %.loopexit, label %124

124:                                              ; preds = %123
  %125 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %126 = load i8, ptr %125, align 1, !tbaa !9
  %127 = call noundef i32 @_Z4mojic(i8 noundef signext %126)
  %128 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 5, i32 noundef %127)
          to label %129 unwind label %.loopexit60

129:                                              ; preds = %124
  br i1 %128, label %.loopexit, label %130

130:                                              ; preds = %129
  %131 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %132 = load i8, ptr %131, align 1, !tbaa !9
  %133 = call noundef i32 @_Z4mojic(i8 noundef signext %132)
  %134 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 6, i32 noundef %133)
          to label %135 unwind label %.loopexit60

135:                                              ; preds = %130
  br i1 %134, label %.loopexit, label %136

136:                                              ; preds = %135
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %138 = load i8, ptr %137, align 1, !tbaa !9
  %139 = call noundef i32 @_Z4mojic(i8 noundef signext %138)
  %140 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 7, i32 noundef %139)
          to label %141 unwind label %.loopexit60

141:                                              ; preds = %136
  br i1 %140, label %.loopexit, label %142

142:                                              ; preds = %141
  %143 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %144 = load i8, ptr %143, align 1, !tbaa !9
  %145 = call noundef i32 @_Z4mojic(i8 noundef signext %144)
  %146 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 8, i32 noundef %145)
          to label %147 unwind label %.loopexit60

147:                                              ; preds = %142
  br i1 %146, label %.loopexit, label %148

148:                                              ; preds = %147
  %149 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %150 = load i8, ptr %149, align 1, !tbaa !9
  %151 = call noundef i32 @_Z4mojic(i8 noundef signext %150)
  %152 = invoke noundef zeroext i1 @_Z6issameii(i32 noundef 9, i32 noundef %151)
          to label %153 unwind label %.loopexit60

153:                                              ; preds = %148
  br i1 %152, label %.loopexit, label %.critedge

.critedge:                                        ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %154 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %indvars.iv57)
  %155 = load i8, ptr %154, align 1, !tbaa !9
  %156 = call noundef i32 @_Z4mojic(i8 noundef signext %155)
  %157 = invoke noundef i32 @_Z4rooti(i32 noundef %156)
          to label %159 unwind label %.loopexit61

158:                                              ; preds = %.preheader43
  br i1 %98, label %.loopexit, label %100

.loopexit60:                                      ; preds = %.preheader43, %100, %106, %112, %118, %124, %130, %136, %142, %148
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %182

.loopexit.split-lp:                               ; preds = %.preheader43.preheader, %18, %24, %30, %36, %42, %48, %54, %60, %66
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %182

159:                                              ; preds = %.critedge
  store i32 %157, ptr %4, align 4, !tbaa !5
  %160 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %161 unwind label %.loopexit61

161:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %.loopexit

.loopexit61:                                      ; preds = %.critedge, %159
  %lpad.loopexit63 = landingpad { ptr, i32 }
          cleanup
  br label %162

.loopexit.split-lp62:                             ; preds = %.critedge.peel, %76
  %lpad.loopexit.split-lp64 = landingpad { ptr, i32 }
          cleanup
  br label %162

162:                                              ; preds = %.loopexit.split-lp62, %.loopexit61
  %lpad.phi65 = phi { ptr, i32 } [ %lpad.loopexit63, %.loopexit61 ], [ %lpad.loopexit.split-lp64, %.loopexit.split-lp62 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %182

.loopexit:                                        ; preds = %158, %105, %111, %117, %123, %129, %135, %141, %147, %153, %161
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %163 = load i32, ptr %1, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = icmp slt i64 %indvars.iv.next58, %164
  br i1 %165, label %.preheader43, label %.preheader, !llvm.loop !12

._crit_edge54:                                    ; preds = %.lr.ph53, %.preheader
  %.023.lcssa = phi i64 [ 1, %.preheader ], [ %166, %.lr.ph53 ]
  br i1 %.032.lcssa, label %171, label %174

.lr.ph53:                                         ; preds = %.preheader, %.lr.ph53
  %.052 = phi i32 [ %167, %.lr.ph53 ], [ 0, %.preheader ]
  %.02351 = phi i64 [ %166, %.lr.ph53 ], [ 1, %.preheader ]
  %166 = mul nuw nsw i64 %.02351, 10
  %167 = add i32 %.052, 1
  %168 = zext i32 %167 to i64
  %169 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %170 = icmp ugt i64 %169, %168
  br i1 %170, label %.lr.ph53, label %._crit_edge54, !llvm.loop !14

171:                                              ; preds = %._crit_edge54
  %172 = udiv i64 %.023.lcssa, 10
  %173 = mul nuw nsw i64 %172, 9
  br label %174

174:                                              ; preds = %171, %._crit_edge54
  %.1 = phi i64 [ %173, %171 ], [ %.023.lcssa, %._crit_edge54 ]
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.1)
          to label %176 unwind label %180

176:                                              ; preds = %174
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %178 unwind label %180

178:                                              ; preds = %176
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #6
  %179 = getelementptr inbounds i8, ptr %2, i64 32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %179) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

180:                                              ; preds = %176, %174
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %182

182:                                              ; preds = %.loopexit60, %.loopexit.split-lp, %162, %180
  %.pn.pn = phi { ptr, i32 } [ %181, %180 ], [ %lpad.phi65, %162 ], [ %lpad.loopexit, %.loopexit60 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #6
  br label %183

183:                                              ; preds = %182, %93, %81
  %.pn41 = phi { ptr, i32 } [ %94, %93 ], [ %.pn.pn, %182 ], [ %82, %81 ]
  %184 = getelementptr inbounds i8, ptr %2, i64 32
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %184) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn41
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

; 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 #0 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !11}


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