; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 11/2014. Zhenya moves from parents (main)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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 }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::set.4" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = 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::pair.10" = type <{ %"struct.std::_Rb_tree_const_iterator.12", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator.12" = type { ptr }

@n = external dso_local global i32, align 4
@sq = external dso_local global i32, align 4
@mp = external dso_local global %"class.std::map", align 8
@indexx = external dso_local global [101766 x i64], align 16
@indexInt = external dso_local global [101766 x i32], align 16
@add = external dso_local global [101766 x i64], align 16
@value = external dso_local global [101766 x i64], align 16
@delta = external dso_local global [101766 x i64], align 16
@minis = external dso_local global [101766 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z7getTimev() #0

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

; 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 %"class.std::set", align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::set.4", align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair.10", align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator.12", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator.12", align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n)
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %30)
  %32 = fptosi double %31 to i32
  %33 = add nsw i32 %32, 2
  store i32 %33, ptr @sq, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #6
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %58, %0
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %70

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %40 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %4)
          to label %41 unwind label %61

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %42 = invoke noundef i64 @_Z7getTimev()
          to label %43 unwind label %65

43:                                               ; preds = %41
  store i64 %42, ptr %7, align 8, !tbaa !9
  %44 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %45 unwind label %65

45:                                               ; preds = %43
  %46 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %47 = extractvalue { ptr, i8 } %44, 0
  store ptr %47, ptr %46, align 8
  %48 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %49 = extractvalue { ptr, i8 } %44, 1
  store i8 %49, ptr %48, align 8
  %50 = load i64, ptr %7, align 8, !tbaa !9
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [101766 x i64], ptr @indexx, i64 0, i64 %52
  store i64 %50, ptr %53, align 8, !tbaa !9
  %54 = load i64, ptr %4, align 8, !tbaa !9
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101766 x i64], ptr @add, i64 0, i64 %56
  store i64 %54, ptr %57, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %58

58:                                               ; preds = %45
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  br label %34, !llvm.loop !11

61:                                               ; preds = %39
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %5, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %6, align 4
  br label %69

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

69:                                               ; preds = %65, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %273

70:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr %2, ptr %10, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %71 = load ptr, ptr %10, align 8, !tbaa !13
  %72 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %71) #6
  %73 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %74 = load ptr, ptr %10, align 8, !tbaa !13
  %75 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %74) #6
  %76 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %12, i32 0, i32 0
  store ptr %75, ptr %76, align 8
  br label %77

77:                                               ; preds = %88, %70
  %78 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br i1 %78, label %80, label %79

79:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %94

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %82 = load i64, ptr %81, align 8, !tbaa !9
  store i64 %82, ptr %13, align 8, !tbaa !9
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %85 unwind label %90

85:                                               ; preds = %80
  store i32 %83, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %88

88:                                               ; preds = %85
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br label %77

90:                                               ; preds = %80
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %5, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %272

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

95:                                               ; preds = %110, %94
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %117

100:                                              ; preds = %95
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [101766 x i64], ptr @indexx, i64 0, i64 %102
  %104 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(8) %103)
          to label %105 unwind label %113

105:                                              ; preds = %100
  %106 = load i32, ptr %104, align 4, !tbaa !5
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101766 x i32], ptr @indexInt, i64 0, i64 %108
  store i32 %106, ptr %109, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %105
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %14, align 4, !tbaa !5
  br label %95, !llvm.loop !15

113:                                              ; preds = %100
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %5, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %272

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

118:                                              ; preds = %261, %117
  %119 = load i32, ptr %15, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 10, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %270

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [101766 x i32], ptr @indexInt, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %18, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %180, %123
  %129 = load i32, ptr %18, align 4, !tbaa !5
  %130 = load i32, ptr @sq, align 4, !tbaa !5
  %131 = load i32, ptr @sq, align 4, !tbaa !5
  %132 = mul nsw i32 %130, %131
  %133 = icmp slt i32 %129, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %128
  store i32 13, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %181

135:                                              ; preds = %128
  %136 = load i32, ptr %18, align 4, !tbaa !5
  %137 = load i32, ptr @sq, align 4, !tbaa !5
  %138 = srem i32 %136, %137
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %155

140:                                              ; preds = %135
  %141 = load i32, ptr %15, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [101766 x i64], ptr @add, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = load i32, ptr %18, align 4, !tbaa !5
  %146 = load i32, ptr @sq, align 4, !tbaa !5
  %147 = sdiv i32 %145, %146
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [101766 x i64], ptr @delta, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !9
  %151 = add nsw i64 %150, %144
  store i64 %151, ptr %149, align 8, !tbaa !9
  %152 = load i32, ptr @sq, align 4, !tbaa !5
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = add nsw i32 %153, %152
  store i32 %154, ptr %18, align 4, !tbaa !5
  br label %180

155:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %156 = load i32, ptr %18, align 4, !tbaa !5
  %157 = load i32, ptr @sq, align 4, !tbaa !5
  %158 = sdiv i32 %156, %157
  store i32 %158, ptr %19, align 4, !tbaa !5
  %159 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %160 unwind label %176

160:                                              ; preds = %155
  %161 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %162 = extractvalue { ptr, i8 } %159, 0
  store ptr %162, ptr %161, align 8
  %163 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %164 = extractvalue { ptr, i8 } %159, 1
  store i8 %164, ptr %163, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %165 = load i32, ptr %15, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [101766 x i64], ptr @add, i64 0, i64 %166
  %168 = load i64, ptr %167, align 8, !tbaa !9
  %169 = load i32, ptr %18, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [101766 x i64], ptr @value, i64 0, i64 %170
  %172 = load i64, ptr %171, align 8, !tbaa !9
  %173 = add nsw i64 %172, %168
  store i64 %173, ptr %171, align 8, !tbaa !9
  %174 = load i32, ptr %18, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %18, align 4, !tbaa !5
  br label %180

176:                                              ; preds = %155
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %5, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %269

180:                                              ; preds = %160, %140
  br label %128, !llvm.loop !16

181:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store ptr %17, ptr %21, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %182 = load ptr, ptr %21, align 8, !tbaa !13
  %183 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %182) #6
  %184 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.12", ptr %22, i32 0, i32 0
  store ptr %183, ptr %184, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %185 = load ptr, ptr %21, align 8, !tbaa !13
  %186 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %185) #6
  %187 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator.12", ptr %23, i32 0, i32 0
  store ptr %186, ptr %187, align 8
  br label %188

188:                                              ; preds = %229, %181
  %189 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  br i1 %189, label %191, label %190

190:                                              ; preds = %188
  store i32 15, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %231

191:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %192 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  %193 = load i32, ptr %192, align 4, !tbaa !5
  store i32 %193, ptr %24, align 4, !tbaa !5
  %194 = load i32, ptr %24, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %195
  store i64 0, ptr %196, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %197 = load i32, ptr %24, align 4, !tbaa !5
  %198 = load i32, ptr @sq, align 4, !tbaa !5
  %199 = mul nsw i32 %197, %198
  store i32 %199, ptr %25, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %221, %191
  %201 = load i32, ptr %25, align 4, !tbaa !5
  %202 = load i32, ptr %24, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  %204 = load i32, ptr @sq, align 4, !tbaa !5
  %205 = mul nsw i32 %203, %204
  %206 = icmp slt i32 %201, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %200
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %228

208:                                              ; preds = %200
  %209 = load i32, ptr %24, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %210
  %212 = load i32, ptr %25, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [101766 x i64], ptr @value, i64 0, i64 %213
  %215 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef nonnull align 8 dereferenceable(8) %214)
          to label %216 unwind label %224

216:                                              ; preds = %208
  %217 = load i64, ptr %215, align 8, !tbaa !9
  %218 = load i32, ptr %24, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %219
  store i64 %217, ptr %220, align 8, !tbaa !9
  br label %221

221:                                              ; preds = %216
  %222 = load i32, ptr %25, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %25, align 4, !tbaa !5
  br label %200, !llvm.loop !17

224:                                              ; preds = %208
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %5, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %269

228:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %229

229:                                              ; preds = %228
  %230 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  br label %188

231:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 0, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %232

232:                                              ; preds = %250, %231
  %233 = load i32, ptr %27, align 4, !tbaa !5
  %234 = load i32, ptr @sq, align 4, !tbaa !5
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %237, label %236

236:                                              ; preds = %232
  store i32 20, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %257

237:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %238 = load i32, ptr %27, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %239
  %241 = load i64, ptr %240, align 8, !tbaa !9
  %242 = load i32, ptr %27, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [101766 x i64], ptr @delta, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !9
  %246 = add nsw i64 %241, %245
  store i64 %246, ptr %28, align 8, !tbaa !9
  %247 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %248 unwind label %253

248:                                              ; preds = %237
  %249 = load i64, ptr %247, align 8, !tbaa !9
  store i64 %249, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %250

250:                                              ; preds = %248
  %251 = load i32, ptr %27, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %27, align 4, !tbaa !5
  br label %232, !llvm.loop !18

253:                                              ; preds = %237
  %254 = landingpad { ptr, i32 }
          cleanup
  %255 = extractvalue { ptr, i32 } %254, 0
  store ptr %255, ptr %5, align 8
  %256 = extractvalue { ptr, i32 } %254, 1
  store i32 %256, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %268

257:                                              ; preds = %236
  %258 = load i64, ptr %26, align 8, !tbaa !9
  %259 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %258)
          to label %260 unwind label %264

260:                                              ; preds = %257
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  br label %261

261:                                              ; preds = %260
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %15, align 4, !tbaa !5
  br label %118, !llvm.loop !19

264:                                              ; preds = %257
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %5, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %6, align 4
  br label %268

268:                                              ; preds = %264, %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %269

269:                                              ; preds = %268, %224, %176
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %17) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %272

270:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #6
  %271 = load i32, ptr %1, align 4
  ret i32 %271

272:                                              ; preds = %269, %113, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %273

273:                                              ; preds = %272, %69
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #6
  br label %274

274:                                              ; preds = %273
  %275 = load ptr, ptr %5, align 8
  %276 = load i32, ptr %6, align 4
  %277 = insertvalue { ptr, i32 } poison, ptr %275, 0
  %278 = insertvalue { ptr, i32 } %277, i32 %276, 1
  resume { ptr, i32 } %278
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 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 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; 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 ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(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 noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

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

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

declare i32 @printf(ptr noundef, ...) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(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 = { "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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 }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::set.4" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = 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_const_iterator.12" = type { ptr }

@n = external dso_local global i32, align 4
@sq = external dso_local local_unnamed_addr global i32, align 4
@mp = external dso_local global %"class.std::map", align 8
@indexx = external dso_local global [101766 x i64], align 16
@indexInt = external dso_local local_unnamed_addr global [101766 x i32], align 16
@add = external dso_local local_unnamed_addr global [101766 x i64], align 16
@value = external dso_local global [101766 x i64], align 16
@delta = external dso_local local_unnamed_addr global [101766 x i64], align 16
@minis = external dso_local global [101766 x i64], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z7getTimev() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::set.4", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::_Rb_tree_const_iterator.12", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator.12", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n)
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %14)
  %16 = fptosi double %15 to i32
  %17 = add nsw i32 %16, 2
  store i32 %17, ptr @sq, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #6
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %27, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %20 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %20, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %21 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  store ptr %21, ptr %5, align 8
  %22 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %22, label %.lr.ph59, label %._crit_edge60

.lr.ph:                                           ; preds = %0, %27
  %indvars.iv = phi i64 [ %indvars.iv.next, %27 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %24 = invoke noundef i64 @_Z7getTimev()
          to label %25 unwind label %35

25:                                               ; preds = %.lr.ph
  store i64 %24, ptr %3, align 8, !tbaa !9
  %26 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %27 unwind label %35

27:                                               ; preds = %25
  %28 = load i64, ptr %3, align 8, !tbaa !9
  %29 = getelementptr inbounds [101766 x i64], ptr @indexx, i64 0, i64 %indvars.iv
  store i64 %28, ptr %29, align 8, !tbaa !9
  %30 = load i64, ptr %2, align 8, !tbaa !9
  %31 = getelementptr inbounds [101766 x i64], ptr @add, i64 0, i64 %indvars.iv
  store i64 %30, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = icmp slt i64 %indvars.iv.next, %33
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !11

35:                                               ; preds = %25, %.lr.ph
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %129

._crit_edge60:                                    ; preds = %42, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph63, label %._crit_edge81

.lr.ph59:                                         ; preds = %._crit_edge, %42
  %.04757 = phi i32 [ %43, %42 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %40 = load i64, ptr %39, align 8, !tbaa !9
  store i64 %40, ptr %6, align 8, !tbaa !9
  %41 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %42 unwind label %46

42:                                               ; preds = %.lr.ph59
  store i32 %.04757, ptr %41, align 4, !tbaa !5
  %43 = add nuw nsw i32 %.04757, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %45 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %45, label %.lr.ph59, label %._crit_edge60

46:                                               ; preds = %.lr.ph59
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %129

.preheader:                                       ; preds = %51
  %48 = icmp sgt i32 %54, 0
  br i1 %48, label %.lr.ph80, label %._crit_edge81

.lr.ph63:                                         ; preds = %._crit_edge60, %51
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %51 ], [ 0, %._crit_edge60 ]
  %49 = getelementptr inbounds [101766 x i64], ptr @indexx, i64 0, i64 %indvars.iv83
  %50 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 8 dereferenceable(8) %49)
          to label %51 unwind label %57

51:                                               ; preds = %.lr.ph63
  %52 = load i32, ptr %50, align 4, !tbaa !5
  %53 = getelementptr inbounds [101766 x i32], ptr @indexInt, i64 0, i64 %indvars.iv83
  store i32 %52, ptr %53, align 4, !tbaa !5
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next84, %55
  br i1 %56, label %.lr.ph63, label %.preheader, !llvm.loop !13

57:                                               ; preds = %.lr.ph63
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %129

._crit_edge81:                                    ; preds = %._crit_edge78, %._crit_edge60, %.preheader
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  ret i32 0

.lr.ph80:                                         ; preds = %.preheader, %._crit_edge78
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge78 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  %59 = getelementptr inbounds [101766 x i32], ptr @indexInt, i64 0, i64 %indvars.iv92
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr @sq, align 4, !tbaa !5
  %62 = mul nsw i32 %61, %61
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %.lr.ph66, label %._crit_edge67

.lr.ph66:                                         ; preds = %.lr.ph80
  %64 = getelementptr inbounds [101766 x i64], ptr @add, i64 0, i64 %indvars.iv92
  br label %68

._crit_edge67:                                    ; preds = %89, %.lr.ph80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %65 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  store ptr %65, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %66 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  store ptr %66, ptr %10, align 8
  %67 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %67, label %.lr.ph73, label %._crit_edge74

68:                                               ; preds = %.lr.ph66, %89
  %69 = phi i32 [ %61, %.lr.ph66 ], [ %90, %89 ]
  %.04864 = phi i32 [ %60, %.lr.ph66 ], [ %.149, %89 ]
  %70 = srem i32 %.04864, %69
  %71 = icmp eq i32 %70, 0
  %72 = sdiv i32 %.04864, %69
  br i1 %71, label %73, label %79

73:                                               ; preds = %68
  %74 = load i64, ptr %64, align 8, !tbaa !9
  %75 = sext i32 %72 to i64
  %76 = getelementptr inbounds [101766 x i64], ptr @delta, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = add nsw i64 %77, %74
  store i64 %78, ptr %76, align 8, !tbaa !9
  br label %89

79:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 %72, ptr %8, align 4, !tbaa !5
  %80 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %81 unwind label %87

81:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %82 = load i64, ptr %64, align 8, !tbaa !9
  %83 = sext i32 %.04864 to i64
  %84 = getelementptr inbounds [101766 x i64], ptr @value, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !9
  %86 = add nsw i64 %85, %82
  store i64 %86, ptr %84, align 8, !tbaa !9
  %.pre = load i32, ptr @sq, align 4, !tbaa !5
  br label %89

87:                                               ; preds = %79
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #6
  br label %129

89:                                               ; preds = %81, %73
  %90 = phi i32 [ %69, %73 ], [ %.pre, %81 ]
  %.pn = phi i32 [ %69, %73 ], [ 1, %81 ]
  %.149 = add nsw i32 %.pn, %.04864
  %91 = mul nsw i32 %90, %90
  %92 = icmp slt i32 %.149, %91
  br i1 %92, label %68, label %._crit_edge67, !llvm.loop !14

._crit_edge74:                                    ; preds = %._crit_edge71, %._crit_edge67
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  store i64 0, ptr %11, align 8, !tbaa !9
  %93 = load i32, ptr @sq, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.lr.ph77, label %._crit_edge78

.lr.ph73:                                         ; preds = %._crit_edge67, %._crit_edge71
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %97
  store i64 0, ptr %98, align 8, !tbaa !9
  %99 = load i32, ptr @sq, align 4, !tbaa !5
  %100 = mul nsw i32 %99, %96
  %101 = add nsw i32 %96, 1
  %102 = mul nsw i32 %99, %101
  %103 = icmp slt i32 %100, %102
  br i1 %103, label %.lr.ph70.preheader, label %._crit_edge71

.lr.ph70.preheader:                               ; preds = %.lr.ph73
  %104 = sext i32 %100 to i64
  br label %.lr.ph70

._crit_edge71:                                    ; preds = %.lr.ph70, %.lr.ph73
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %106 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %106, label %.lr.ph73, label %._crit_edge74

.lr.ph70:                                         ; preds = %.lr.ph70.preheader, %.lr.ph70
  %indvars.iv86 = phi i64 [ %104, %.lr.ph70.preheader ], [ %indvars.iv.next87, %.lr.ph70 ]
  %107 = getelementptr inbounds [101766 x i64], ptr @value, i64 0, i64 %indvars.iv86
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull align 8 dereferenceable(8) %107)
  %109 = load i64, ptr %108, align 8, !tbaa !9
  store i64 %109, ptr %98, align 8, !tbaa !9
  %indvars.iv.next87 = add nsw i64 %indvars.iv86, 1
  %110 = load i32, ptr @sq, align 4, !tbaa !5
  %111 = mul nsw i32 %110, %101
  %112 = sext i32 %111 to i64
  %113 = icmp slt i64 %indvars.iv.next87, %112
  br i1 %113, label %.lr.ph70, label %._crit_edge71, !llvm.loop !15

._crit_edge78:                                    ; preds = %.lr.ph77, %._crit_edge74
  %114 = phi i64 [ 0, %._crit_edge74 ], [ %125, %.lr.ph77 ]
  %115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %114)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #6
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = icmp slt i64 %indvars.iv.next93, %117
  br i1 %118, label %.lr.ph80, label %._crit_edge81, !llvm.loop !16

.lr.ph77:                                         ; preds = %._crit_edge74, %.lr.ph77
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph77 ], [ 0, %._crit_edge74 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %119 = getelementptr inbounds [101766 x i64], ptr @minis, i64 0, i64 %indvars.iv89
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds [101766 x i64], ptr @delta, i64 0, i64 %indvars.iv89
  %122 = load i64, ptr %121, align 8, !tbaa !9
  %123 = add nsw i64 %122, %120
  store i64 %123, ptr %12, align 8, !tbaa !9
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %125 = load i64, ptr %124, align 8, !tbaa !9
  store i64 %125, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %126 = load i32, ptr @sq, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = icmp slt i64 %indvars.iv.next90, %127
  br i1 %128, label %.lr.ph77, label %._crit_edge78, !llvm.loop !17

129:                                              ; preds = %46, %57, %87, %35
  %.pn54 = phi { ptr, i32 } [ %36, %35 ], [ %47, %46 ], [ %58, %57 ], [ %88, %87 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn54
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #4

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; 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 ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(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 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(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 = { nofree nounwind "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !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}


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