; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/AIM Tech Division 1/Problem B (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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@arr = external dso_local global [1001000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 %"class.std::set", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  %23 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %47, %0
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = load i32, ptr @n, align 4, !tbaa !8
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [1001000 x i32], ptr @arr, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %45)
  br label %47

47:                                               ; preds = %42
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !8
  br label %37, !llvm.loop !11

50:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !8
  br label %51

51:                                               ; preds = %111, %50
  %52 = load i32, ptr %4, align 4, !tbaa !8
  %53 = icmp sle i32 %52, 1
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %115

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %56 = load i32, ptr getelementptr inbounds ([1001000 x i32], ptr @arr, i64 0, i64 1), align 4, !tbaa !8
  %57 = load i32, ptr %4, align 4, !tbaa !8
  %58 = add nsw i32 %56, %57
  store i32 %58, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 2, ptr %7, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %93, %55
  %60 = load i32, ptr %7, align 4, !tbaa !8
  %61 = load i32, ptr %7, align 4, !tbaa !8
  %62 = mul nsw i32 %60, %61
  %63 = load i32, ptr %6, align 4, !tbaa !8
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %59
  %67 = load i32, ptr %6, align 4, !tbaa !8
  %68 = load i32, ptr %7, align 4, !tbaa !8
  %69 = srem i32 %67, %68
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %92

71:                                               ; preds = %66
  %72 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %73 unwind label %87

73:                                               ; preds = %71
  %74 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %75 = extractvalue { ptr, i8 } %72, 0
  store ptr %75, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %77 = extractvalue { ptr, i8 } %72, 1
  store i8 %77, ptr %76, align 8
  br label %78

78:                                               ; preds = %83, %73
  %79 = load i32, ptr %6, align 4, !tbaa !8
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = srem i32 %79, %80
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %91

83:                                               ; preds = %78
  %84 = load i32, ptr %7, align 4, !tbaa !8
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = sdiv i32 %85, %84
  store i32 %86, ptr %6, align 4, !tbaa !8
  br label %78, !llvm.loop !13

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

91:                                               ; preds = %78
  br label %92

92:                                               ; preds = %91, %66
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %7, align 4, !tbaa !8
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !8
  br label %59, !llvm.loop !14

96:                                               ; preds = %65
  %97 = load i32, ptr %6, align 4, !tbaa !8
  %98 = icmp sgt i32 %97, 1
  br i1 %98, label %99, label %110

99:                                               ; preds = %96
  %100 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %101 unwind label %106

101:                                              ; preds = %99
  %102 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %103 = extractvalue { ptr, i8 } %100, 0
  store ptr %103, ptr %102, align 8
  %104 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %105 = extractvalue { ptr, i8 } %100, 1
  store i8 %105, ptr %104, align 8
  br label %110

106:                                              ; preds = %99
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %8, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %9, align 4
  br label %114

110:                                              ; preds = %101, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %4, align 4, !tbaa !8
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %4, align 4, !tbaa !8
  br label %51, !llvm.loop !15

114:                                              ; preds = %106, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %233

115:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %116 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  br label %118

118:                                              ; preds = %127, %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %119 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %13, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %134

123:                                              ; preds = %118
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %125 = load i32, ptr %124, align 4, !tbaa !8
  invoke void @_Z5solvei(i32 noundef %125)
          to label %126 unwind label %130

126:                                              ; preds = %123
  br label %127

127:                                              ; preds = %126
  %128 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #6
  %129 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %128, ptr %129, align 8
  br label %118, !llvm.loop !16

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

134:                                              ; preds = %122
  %135 = load i32, ptr @n, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr getelementptr inbounds (i32, ptr @arr, i64 1), i64 %136
  invoke void @_ZSt7reverseIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @arr, i64 1), ptr noundef %137)
          to label %138 unwind label %143

138:                                              ; preds = %134
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 -1, ptr %15, align 4, !tbaa !8
  br label %139

139:                                              ; preds = %203, %138
  %140 = load i32, ptr %15, align 4, !tbaa !8
  %141 = icmp sle i32 %140, 1
  br i1 %141, label %147, label %142

142:                                              ; preds = %139
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %207

143:                                              ; preds = %229, %226, %134
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %8, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %9, align 4
  br label %233

147:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %148 = load i32, ptr getelementptr inbounds ([1001000 x i32], ptr @arr, i64 0, i64 1), align 4, !tbaa !8
  %149 = load i32, ptr %15, align 4, !tbaa !8
  %150 = add nsw i32 %148, %149
  store i32 %150, ptr %16, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 2, ptr %17, align 4, !tbaa !8
  br label %151

151:                                              ; preds = %185, %147
  %152 = load i32, ptr %17, align 4, !tbaa !8
  %153 = load i32, ptr %17, align 4, !tbaa !8
  %154 = mul nsw i32 %152, %153
  %155 = load i32, ptr %16, align 4, !tbaa !8
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %151
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %188

158:                                              ; preds = %151
  %159 = load i32, ptr %16, align 4, !tbaa !8
  %160 = load i32, ptr %17, align 4, !tbaa !8
  %161 = srem i32 %159, %160
  %162 = icmp eq i32 %161, 0
  br i1 %162, label %163, label %184

163:                                              ; preds = %158
  %164 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %165 unwind label %179

165:                                              ; preds = %163
  %166 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %167 = extractvalue { ptr, i8 } %164, 0
  store ptr %167, ptr %166, align 8
  %168 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %169 = extractvalue { ptr, i8 } %164, 1
  store i8 %169, ptr %168, align 8
  br label %170

170:                                              ; preds = %175, %165
  %171 = load i32, ptr %16, align 4, !tbaa !8
  %172 = load i32, ptr %17, align 4, !tbaa !8
  %173 = srem i32 %171, %172
  %174 = icmp eq i32 %173, 0
  br i1 %174, label %175, label %183

175:                                              ; preds = %170
  %176 = load i32, ptr %17, align 4, !tbaa !8
  %177 = load i32, ptr %16, align 4, !tbaa !8
  %178 = sdiv i32 %177, %176
  store i32 %178, ptr %16, align 4, !tbaa !8
  br label %170, !llvm.loop !17

179:                                              ; preds = %163
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %8, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %206

183:                                              ; preds = %170
  br label %184

184:                                              ; preds = %183, %158
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %17, align 4, !tbaa !8
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %17, align 4, !tbaa !8
  br label %151, !llvm.loop !18

188:                                              ; preds = %157
  %189 = load i32, ptr %16, align 4, !tbaa !8
  %190 = icmp sgt i32 %189, 1
  br i1 %190, label %191, label %202

191:                                              ; preds = %188
  %192 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %193 unwind label %198

193:                                              ; preds = %191
  %194 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %195 = extractvalue { ptr, i8 } %192, 0
  store ptr %195, ptr %194, align 8
  %196 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %197 = extractvalue { ptr, i8 } %192, 1
  store i8 %197, ptr %196, align 8
  br label %202

198:                                              ; preds = %191
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %8, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %9, align 4
  br label %206

202:                                              ; preds = %193, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %15, align 4, !tbaa !8
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %15, align 4, !tbaa !8
  br label %139, !llvm.loop !19

206:                                              ; preds = %198, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %233

207:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %208 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %209 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  br label %210

210:                                              ; preds = %219, %207
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %211 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  %212 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %211, ptr %212, align 8
  %213 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br i1 %213, label %215, label %214

214:                                              ; preds = %210
  store i32 24, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %226

215:                                              ; preds = %210
  %216 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  %217 = load i32, ptr %216, align 4, !tbaa !8
  invoke void @_Z5solvei(i32 noundef %217)
          to label %218 unwind label %222

218:                                              ; preds = %215
  br label %219

219:                                              ; preds = %218
  %220 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #6
  %221 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %220, ptr %221, align 8
  br label %210, !llvm.loop !20

222:                                              ; preds = %215
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %8, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %233

226:                                              ; preds = %214
  %227 = load i64, ptr @ans, align 8, !tbaa !21
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %227)
          to label %229 unwind label %143

229:                                              ; preds = %226
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %228, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %231 unwind label %143

231:                                              ; preds = %229
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  %232 = load i32, ptr %1, align 4
  ret i32 %232

233:                                              ; preds = %222, %206, %143, %130, %114
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %8, align 8
  %236 = load i32, ptr %9, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238
}

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

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

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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #1

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"long long", !10, i64 0}


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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@arr = external dso_local global [1001000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) 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) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %18
  %20 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %24 = load i32, ptr @n, align 4, !tbaa !8
  %.not40 = icmp slt i32 %24, 1
  br i1 %.not40, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 2, ptr %3, align 4, !tbaa !8
  %.not3044 = icmp slt i32 %25, 5
  br i1 %.not3044, label %._crit_edge48, label %.lr.ph47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %27 = getelementptr inbounds [1001000 x i32], ptr @arr, i64 0, i64 %indvars.iv
  %28 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @n, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %.not.not = icmp slt i64 %indvars.iv, %30
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge48:                                    ; preds = %.loopexit36, %._crit_edge
  %.lcssa38 = phi i32 [ %26, %._crit_edge ], [ %.pr, %.loopexit36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %31 = icmp sgt i32 %.lcssa38, 1
  br i1 %31, label %46, label %50

.lr.ph47:                                         ; preds = %._crit_edge, %.loopexit36
  %.pr80 = phi i32 [ %.pr, %.loopexit36 ], [ %26, %._crit_edge ]
  %storemerge2945 = phi i32 [ %44, %.loopexit36 ], [ 2, %._crit_edge ]
  %32 = srem i32 %.pr80, %storemerge2945
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %.loopexit36

34:                                               ; preds = %.lr.ph47
  %35 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %.preheader35 unwind label %.loopexit69

.preheader35:                                     ; preds = %34
  %36 = load i32, ptr %3, align 4, !tbaa !8
  %.promoted = load i32, ptr %2, align 4, !tbaa !8
  %37 = srem i32 %.promoted, %36
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %.lr.ph42, label %.loopexit36

.lr.ph42:                                         ; preds = %.preheader35, %.lr.ph42
  %39 = phi i32 [ %40, %.lr.ph42 ], [ %.promoted, %.preheader35 ]
  %40 = sdiv i32 %39, %36
  %41 = srem i32 %40, %36
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %.lr.ph42, label %..loopexit36_crit_edge, !llvm.loop !13

.loopexit69:                                      ; preds = %34
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

.loopexit.split-lp.loopexit.split-lp:             ; preds = %74
  %lpad.loopexit.split-lp71 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit69
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit69 ], [ %lpad.loopexit70, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp71, %.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %93

..loopexit36_crit_edge:                           ; preds = %.lr.ph42
  store i32 %40, ptr %2, align 4, !tbaa !8
  br label %.loopexit36

.loopexit36:                                      ; preds = %.preheader35, %..loopexit36_crit_edge, %.lr.ph47
  %.pr = phi i32 [ %.promoted, %.preheader35 ], [ %40, %..loopexit36_crit_edge ], [ %.pr80, %.lr.ph47 ]
  %43 = phi i32 [ %36, %.preheader35 ], [ %36, %..loopexit36_crit_edge ], [ %storemerge2945, %.lr.ph47 ]
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !8
  %45 = mul nsw i32 %44, %44
  %.not30 = icmp sgt i32 %45, %.pr
  br i1 %.not30, label %._crit_edge48, label %.lr.ph47, !llvm.loop !14

46:                                               ; preds = %._crit_edge48
  %47 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %50 unwind label %48

48:                                               ; preds = %87, %67, %46
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %93

50:                                               ; preds = %46, %._crit_edge48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  store i32 %51, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 2, ptr %3, align 4, !tbaa !8
  %.not3044.1 = icmp slt i32 %51, 4
  br i1 %.not3044.1, label %._crit_edge48.1, label %.lr.ph47.1

.lr.ph47.1:                                       ; preds = %50, %.loopexit36.1
  %.pr.182 = phi i32 [ %.pr.1, %.loopexit36.1 ], [ %51, %50 ]
  %storemerge2945.1 = phi i32 [ %64, %.loopexit36.1 ], [ 2, %50 ]
  %52 = srem i32 %.pr.182, %storemerge2945.1
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %.loopexit36.1

54:                                               ; preds = %.lr.ph47.1
  %55 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %.preheader35.1 unwind label %.loopexit.split-lp.loopexit

.preheader35.1:                                   ; preds = %54
  %56 = load i32, ptr %3, align 4, !tbaa !8
  %.promoted.1 = load i32, ptr %2, align 4, !tbaa !8
  %57 = srem i32 %.promoted.1, %56
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %.lr.ph42.1, label %.loopexit36.1

.lr.ph42.1:                                       ; preds = %.preheader35.1, %.lr.ph42.1
  %59 = phi i32 [ %60, %.lr.ph42.1 ], [ %.promoted.1, %.preheader35.1 ]
  %60 = sdiv i32 %59, %56
  %61 = srem i32 %60, %56
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %.lr.ph42.1, label %..loopexit36_crit_edge.1, !llvm.loop !13

..loopexit36_crit_edge.1:                         ; preds = %.lr.ph42.1
  store i32 %60, ptr %2, align 4, !tbaa !8
  br label %.loopexit36.1

.loopexit36.1:                                    ; preds = %..loopexit36_crit_edge.1, %.preheader35.1, %.lr.ph47.1
  %.pr.1 = phi i32 [ %60, %..loopexit36_crit_edge.1 ], [ %.promoted.1, %.preheader35.1 ], [ %.pr.182, %.lr.ph47.1 ]
  %63 = phi i32 [ %56, %..loopexit36_crit_edge.1 ], [ %56, %.preheader35.1 ], [ %storemerge2945.1, %.lr.ph47.1 ]
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !8
  %65 = mul nsw i32 %64, %64
  %.not30.1 = icmp sgt i32 %65, %.pr.1
  br i1 %.not30.1, label %._crit_edge48.1, label %.lr.ph47.1, !llvm.loop !14

._crit_edge48.1:                                  ; preds = %.loopexit36.1, %50
  %.lcssa38.1 = phi i32 [ %51, %50 ], [ %.pr.1, %.loopexit36.1 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %66 = icmp sgt i32 %.lcssa38.1, 1
  br i1 %66, label %67, label %69

67:                                               ; preds = %._crit_edge48.1
  %68 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %69 unwind label %48

69:                                               ; preds = %67, %._crit_edge48.1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %2, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 2, ptr %3, align 4, !tbaa !8
  %.not3044.2 = icmp slt i32 %70, 3
  br i1 %.not3044.2, label %._crit_edge48.2, label %.lr.ph47.2

.lr.ph47.2:                                       ; preds = %69, %.loopexit36.2
  %.pr.284 = phi i32 [ %.pr.2, %.loopexit36.2 ], [ %71, %69 ]
  %storemerge2945.2 = phi i32 [ %84, %.loopexit36.2 ], [ 2, %69 ]
  %72 = srem i32 %.pr.284, %storemerge2945.2
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %.loopexit36.2

74:                                               ; preds = %.lr.ph47.2
  %75 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %.preheader35.2 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader35.2:                                   ; preds = %74
  %76 = load i32, ptr %3, align 4, !tbaa !8
  %.promoted.2 = load i32, ptr %2, align 4, !tbaa !8
  %77 = srem i32 %.promoted.2, %76
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %.lr.ph42.2, label %.loopexit36.2

.lr.ph42.2:                                       ; preds = %.preheader35.2, %.lr.ph42.2
  %79 = phi i32 [ %80, %.lr.ph42.2 ], [ %.promoted.2, %.preheader35.2 ]
  %80 = sdiv i32 %79, %76
  %81 = srem i32 %80, %76
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %.lr.ph42.2, label %..loopexit36_crit_edge.2, !llvm.loop !13

..loopexit36_crit_edge.2:                         ; preds = %.lr.ph42.2
  store i32 %80, ptr %2, align 4, !tbaa !8
  br label %.loopexit36.2

.loopexit36.2:                                    ; preds = %..loopexit36_crit_edge.2, %.preheader35.2, %.lr.ph47.2
  %.pr.2 = phi i32 [ %80, %..loopexit36_crit_edge.2 ], [ %.promoted.2, %.preheader35.2 ], [ %.pr.284, %.lr.ph47.2 ]
  %83 = phi i32 [ %76, %..loopexit36_crit_edge.2 ], [ %76, %.preheader35.2 ], [ %storemerge2945.2, %.lr.ph47.2 ]
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !8
  %85 = mul nsw i32 %84, %84
  %.not30.2 = icmp sgt i32 %85, %.pr.2
  br i1 %.not30.2, label %._crit_edge48.2, label %.lr.ph47.2, !llvm.loop !14

._crit_edge48.2:                                  ; preds = %.loopexit36.2, %69
  %.lcssa38.2 = phi i32 [ %71, %69 ], [ %.pr.2, %.loopexit36.2 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %86 = icmp sgt i32 %.lcssa38.2, 1
  br i1 %86, label %87, label %89

87:                                               ; preds = %._crit_edge48.2
  %88 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %89 unwind label %48

89:                                               ; preds = %87, %._crit_edge48.2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %90 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %90, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %91 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %91, ptr %5, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %92, label %.lr.ph51, label %._crit_edge52

93:                                               ; preds = %48, %.loopexit.split-lp
  %.pn31 = phi { ptr, i32 } [ %lpad.phi, %.loopexit.split-lp ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %186

._crit_edge52:                                    ; preds = %99, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %94 = load i32, ptr @n, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), i64 %95
  invoke void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @arr, i64 4), ptr noundef nonnull %96)
          to label %105 unwind label %108

.lr.ph51:                                         ; preds = %89, %99
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %98 = load i32, ptr %97, align 4, !tbaa !8
  invoke void @_Z5solvei(i32 noundef %98)
          to label %99 unwind label %103

99:                                               ; preds = %.lr.ph51
  %100 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %101 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %101, ptr %5, align 8
  %102 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %102, label %.lr.ph51, label %._crit_edge52, !llvm.loop !15

103:                                              ; preds = %.lr.ph51
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %186

105:                                              ; preds = %._crit_edge52
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %106 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 2, ptr %7, align 4, !tbaa !8
  %.not2756 = icmp slt i32 %106, 5
  br i1 %.not2756, label %._crit_edge60, label %.lr.ph59

108:                                              ; preds = %183, %._crit_edge65, %._crit_edge52
  %109 = landingpad { ptr, i32 }
          cleanup
  br label %186

._crit_edge60:                                    ; preds = %.loopexit, %105
  %.lcssa = phi i32 [ %107, %105 ], [ %.pr34, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %110 = icmp sgt i32 %.lcssa, 1
  br i1 %110, label %125, label %129

.lr.ph59:                                         ; preds = %105, %.loopexit
  %.pr3486 = phi i32 [ %.pr34, %.loopexit ], [ %107, %105 ]
  %storemerge57 = phi i32 [ %123, %.loopexit ], [ 2, %105 ]
  %111 = srem i32 %.pr3486, %storemerge57
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %.loopexit

113:                                              ; preds = %.lr.ph59
  %114 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %.preheader unwind label %.loopexit73

.preheader:                                       ; preds = %113
  %115 = load i32, ptr %7, align 4, !tbaa !8
  %.promoted53 = load i32, ptr %6, align 4, !tbaa !8
  %116 = srem i32 %.promoted53, %115
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %.lr.ph54, label %.loopexit

.lr.ph54:                                         ; preds = %.preheader, %.lr.ph54
  %118 = phi i32 [ %119, %.lr.ph54 ], [ %.promoted53, %.preheader ]
  %119 = sdiv i32 %118, %115
  %120 = srem i32 %119, %115
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %.lr.ph54, label %..loopexit_crit_edge, !llvm.loop !16

.loopexit73:                                      ; preds = %113
  %lpad.loopexit75 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp74

.loopexit.split-lp74.loopexit:                    ; preds = %133
  %lpad.loopexit77 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp74

.loopexit.split-lp74.loopexit.split-lp:           ; preds = %153
  %lpad.loopexit.split-lp78 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp74

.loopexit.split-lp74:                             ; preds = %.loopexit.split-lp74.loopexit, %.loopexit.split-lp74.loopexit.split-lp, %.loopexit73
  %lpad.phi76 = phi { ptr, i32 } [ %lpad.loopexit75, %.loopexit73 ], [ %lpad.loopexit77, %.loopexit.split-lp74.loopexit ], [ %lpad.loopexit.split-lp78, %.loopexit.split-lp74.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %172

..loopexit_crit_edge:                             ; preds = %.lr.ph54
  store i32 %119, ptr %6, align 4, !tbaa !8
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %..loopexit_crit_edge, %.lr.ph59
  %.pr34 = phi i32 [ %.promoted53, %.preheader ], [ %119, %..loopexit_crit_edge ], [ %.pr3486, %.lr.ph59 ]
  %122 = phi i32 [ %115, %.preheader ], [ %115, %..loopexit_crit_edge ], [ %storemerge57, %.lr.ph59 ]
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !8
  %124 = mul nsw i32 %123, %123
  %.not27 = icmp sgt i32 %124, %.pr34
  br i1 %.not27, label %._crit_edge60, label %.lr.ph59, !llvm.loop !17

125:                                              ; preds = %._crit_edge60
  %126 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %129 unwind label %127

127:                                              ; preds = %166, %146, %125
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %172

129:                                              ; preds = %125, %._crit_edge60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %130 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  store i32 %130, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 2, ptr %7, align 4, !tbaa !8
  %.not2756.1 = icmp slt i32 %130, 4
  br i1 %.not2756.1, label %._crit_edge60.1, label %.lr.ph59.1

.lr.ph59.1:                                       ; preds = %129, %.loopexit.1
  %.pr34.188 = phi i32 [ %.pr34.1, %.loopexit.1 ], [ %130, %129 ]
  %storemerge57.1 = phi i32 [ %143, %.loopexit.1 ], [ 2, %129 ]
  %131 = srem i32 %.pr34.188, %storemerge57.1
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %.loopexit.1

133:                                              ; preds = %.lr.ph59.1
  %134 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %.preheader.1 unwind label %.loopexit.split-lp74.loopexit

.preheader.1:                                     ; preds = %133
  %135 = load i32, ptr %7, align 4, !tbaa !8
  %.promoted53.1 = load i32, ptr %6, align 4, !tbaa !8
  %136 = srem i32 %.promoted53.1, %135
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %.lr.ph54.1, label %.loopexit.1

.lr.ph54.1:                                       ; preds = %.preheader.1, %.lr.ph54.1
  %138 = phi i32 [ %139, %.lr.ph54.1 ], [ %.promoted53.1, %.preheader.1 ]
  %139 = sdiv i32 %138, %135
  %140 = srem i32 %139, %135
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %.lr.ph54.1, label %..loopexit_crit_edge.1, !llvm.loop !16

..loopexit_crit_edge.1:                           ; preds = %.lr.ph54.1
  store i32 %139, ptr %6, align 4, !tbaa !8
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %..loopexit_crit_edge.1, %.preheader.1, %.lr.ph59.1
  %.pr34.1 = phi i32 [ %139, %..loopexit_crit_edge.1 ], [ %.promoted53.1, %.preheader.1 ], [ %.pr34.188, %.lr.ph59.1 ]
  %142 = phi i32 [ %135, %..loopexit_crit_edge.1 ], [ %135, %.preheader.1 ], [ %storemerge57.1, %.lr.ph59.1 ]
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %7, align 4, !tbaa !8
  %144 = mul nsw i32 %143, %143
  %.not27.1 = icmp sgt i32 %144, %.pr34.1
  br i1 %.not27.1, label %._crit_edge60.1, label %.lr.ph59.1, !llvm.loop !17

._crit_edge60.1:                                  ; preds = %.loopexit.1, %129
  %.lcssa.1 = phi i32 [ %130, %129 ], [ %.pr34.1, %.loopexit.1 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %145 = icmp sgt i32 %.lcssa.1, 1
  br i1 %145, label %146, label %148

146:                                              ; preds = %._crit_edge60.1
  %147 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %148 unwind label %127

148:                                              ; preds = %146, %._crit_edge60.1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %149 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !8
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 2, ptr %7, align 4, !tbaa !8
  %.not2756.2 = icmp slt i32 %149, 3
  br i1 %.not2756.2, label %._crit_edge60.2, label %.lr.ph59.2

.lr.ph59.2:                                       ; preds = %148, %.loopexit.2
  %.pr34.290 = phi i32 [ %.pr34.2, %.loopexit.2 ], [ %150, %148 ]
  %storemerge57.2 = phi i32 [ %163, %.loopexit.2 ], [ 2, %148 ]
  %151 = srem i32 %.pr34.290, %storemerge57.2
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %153, label %.loopexit.2

153:                                              ; preds = %.lr.ph59.2
  %154 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %.preheader.2 unwind label %.loopexit.split-lp74.loopexit.split-lp

.preheader.2:                                     ; preds = %153
  %155 = load i32, ptr %7, align 4, !tbaa !8
  %.promoted53.2 = load i32, ptr %6, align 4, !tbaa !8
  %156 = srem i32 %.promoted53.2, %155
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %.lr.ph54.2, label %.loopexit.2

.lr.ph54.2:                                       ; preds = %.preheader.2, %.lr.ph54.2
  %158 = phi i32 [ %159, %.lr.ph54.2 ], [ %.promoted53.2, %.preheader.2 ]
  %159 = sdiv i32 %158, %155
  %160 = srem i32 %159, %155
  %161 = icmp eq i32 %160, 0
  br i1 %161, label %.lr.ph54.2, label %..loopexit_crit_edge.2, !llvm.loop !16

..loopexit_crit_edge.2:                           ; preds = %.lr.ph54.2
  store i32 %159, ptr %6, align 4, !tbaa !8
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %..loopexit_crit_edge.2, %.preheader.2, %.lr.ph59.2
  %.pr34.2 = phi i32 [ %159, %..loopexit_crit_edge.2 ], [ %.promoted53.2, %.preheader.2 ], [ %.pr34.290, %.lr.ph59.2 ]
  %162 = phi i32 [ %155, %..loopexit_crit_edge.2 ], [ %155, %.preheader.2 ], [ %storemerge57.2, %.lr.ph59.2 ]
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !8
  %164 = mul nsw i32 %163, %163
  %.not27.2 = icmp sgt i32 %164, %.pr34.2
  br i1 %.not27.2, label %._crit_edge60.2, label %.lr.ph59.2, !llvm.loop !17

._crit_edge60.2:                                  ; preds = %.loopexit.2, %148
  %.lcssa.2 = phi i32 [ %150, %148 ], [ %.pr34.2, %.loopexit.2 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %165 = icmp sgt i32 %.lcssa.2, 1
  br i1 %165, label %166, label %168

166:                                              ; preds = %._crit_edge60.2
  %167 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %168 unwind label %127

168:                                              ; preds = %166, %._crit_edge60.2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %169 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %169, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %170 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %170, ptr %9, align 8
  %171 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br i1 %171, label %.lr.ph64, label %._crit_edge65

172:                                              ; preds = %127, %.loopexit.split-lp74
  %.pn = phi { ptr, i32 } [ %lpad.phi76, %.loopexit.split-lp74 ], [ %128, %127 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %186

._crit_edge65:                                    ; preds = %177, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %173 = load i64, ptr @ans, align 8, !tbaa !18
  %174 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %173)
          to label %183 unwind label %108

.lr.ph64:                                         ; preds = %168, %177
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %176 = load i32, ptr %175, align 4, !tbaa !8
  invoke void @_Z5solvei(i32 noundef %176)
          to label %177 unwind label %181

177:                                              ; preds = %.lr.ph64
  %178 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %179 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %179, ptr %9, align 8
  %180 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br i1 %180, label %.lr.ph64, label %._crit_edge65, !llvm.loop !20

181:                                              ; preds = %.lr.ph64
  %182 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %186

183:                                              ; preds = %._crit_edge65
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %174, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %185 unwind label %108

185:                                              ; preds = %183
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  ret i32 0

186:                                              ; preds = %181, %172, %108, %103, %93
  %.pn31.pn = phi { ptr, i32 } [ %.pn31, %93 ], [ %104, %103 ], [ %.pn, %172 ], [ %182, %181 ], [ %109, %108 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn31.pn
}

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

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

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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) 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 #5 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"long long", !10, i64 0}
!20 = distinct !{!20, !12}


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