; LLVM IR from tangjz/acm-icpc :: lydsy/2891.ll (Z4initv)

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

@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@all = external dso_local global i32, align 4
@w = external dso_local global [3763 x i32], align 16
@go = external dso_local global [65 x [3763 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca [3763 x i64], align 16
  %3 = alloca [7 x i64], align 16
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca { i64, i32 }, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"struct.std::pair.0", align 8
  %23 = alloca i32, align 4
  %24 = alloca { i64, i32 }, align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca %"struct.std::pair.0", align 8
  %27 = alloca i32, align 4
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr %1) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.start.p0(i64 30104, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr %3) #5
  %30 = load i32, ptr @tot, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %30 to i64
  %33 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %32
  store i64 1, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %38 = load i32, ptr @tot, align 4, !tbaa !5
  %39 = sub nsw i32 %38, 1
  store i32 %39, ptr %5, align 4, !tbaa !5
  %40 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %41 unwind label %53

41:                                               ; preds = %0
  store { i64, i32 } %40, ptr %8, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %8, i64 12, i1 false)
  %42 = invoke { ptr, i8 } @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %4)
          to label %43 unwind label %53

43:                                               ; preds = %41
  %44 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 0
  %45 = extractvalue { ptr, i8 } %42, 0
  store ptr %45, ptr %44, align 8
  %46 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 1
  %47 = extractvalue { ptr, i8 } %42, 1
  store i8 %47, ptr %46, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %237, %43
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = load i32, ptr @tot, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %57, label %52

52:                                               ; preds = %48
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %240

53:                                               ; preds = %41, %0
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %6, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  br label %241

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !9
  store i64 %61, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %101, %57
  %63 = load i32, ptr %13, align 4, !tbaa !5
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %104

67:                                               ; preds = %62
  %68 = load i64, ptr %12, align 8, !tbaa !9
  %69 = load i32, ptr %13, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %70
  store i64 %68, ptr %71, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %97, %67
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = load i32, ptr @all, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %100

77:                                               ; preds = %72
  %78 = load i64, ptr %12, align 8, !tbaa !9
  %79 = load i32, ptr %14, align 4, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = lshr i64 %78, %80
  %82 = and i64 %81, 1
  %83 = icmp ne i64 %82, 0
  br i1 %83, label %84, label %96

84:                                               ; preds = %77
  %85 = load i32, ptr %14, align 4, !tbaa !5
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = shl i32 1, %86
  %88 = or i32 %85, %87
  %89 = zext i32 %88 to i64
  %90 = shl i64 1, %89
  %91 = load i32, ptr %13, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = or i64 %94, %90
  store i64 %95, ptr %93, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %84, %77
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %14, align 4, !tbaa !5
  br label %72, !llvm.loop !11

100:                                              ; preds = %76
  br label %101

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

104:                                              ; preds = %66
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [3763 x i32], ptr @w, i64 0, i64 %106
  store i32 0, ptr %107, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %231, %104
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = load i32, ptr @all, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %236

113:                                              ; preds = %108
  %114 = load i64, ptr %12, align 8, !tbaa !9
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = zext i32 %115 to i64
  %117 = lshr i64 %114, %116
  %118 = and i64 %117, 1
  %119 = icmp ne i64 %118, 0
  br i1 %119, label %120, label %150

120:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %133, %120
  %122 = load i32, ptr %17, align 4, !tbaa !5
  %123 = load i32, ptr @n, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %136

126:                                              ; preds = %121
  %127 = load i32, ptr %15, align 4, !tbaa !5
  %128 = load i32, ptr %17, align 4, !tbaa !5
  %129 = ashr i32 %127, %128
  %130 = and i32 %129, 1
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = add nsw i32 %131, %130
  store i32 %132, ptr %16, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %126
  %134 = load i32, ptr %17, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %17, align 4, !tbaa !5
  br label %121, !llvm.loop !14

136:                                              ; preds = %125
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [3763 x i32], ptr @w, i64 0, i64 %138
  %140 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %139, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %141 unwind label %146

141:                                              ; preds = %136
  %142 = load i32, ptr %140, align 4, !tbaa !5
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3763 x i32], ptr @w, i64 0, i64 %144
  store i32 %142, ptr %145, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %150

146:                                              ; preds = %136
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %6, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %235

150:                                              ; preds = %141, %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %151 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %151, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %171, %150
  %153 = load i32, ptr %19, align 4, !tbaa !5
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %174

157:                                              ; preds = %152
  %158 = load i32, ptr %15, align 4, !tbaa !5
  %159 = load i32, ptr %19, align 4, !tbaa !5
  %160 = ashr i32 %158, %159
  %161 = and i32 %160, 1
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %170

163:                                              ; preds = %157
  %164 = load i32, ptr %19, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = load i64, ptr %18, align 8, !tbaa !9
  %169 = or i64 %168, %167
  store i64 %169, ptr %18, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %163, %157
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %19, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %19, align 4, !tbaa !5
  br label %152, !llvm.loop !15

174:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  %175 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %176 unwind label %211

176:                                              ; preds = %174
  store { i64, i32 } %175, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %24, i64 12, i1 false)
  %177 = invoke ptr @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %22)
          to label %178 unwind label %211

178:                                              ; preds = %176
  %179 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %177, ptr %179, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %180 = call ptr @_ZNKSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  %181 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %25, i32 0, i32 0
  store ptr %180, ptr %181, align 8
  %182 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIyiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br i1 %182, label %189, label %183

183:                                              ; preds = %178
  %184 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIyiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %185 = getelementptr inbounds %"struct.std::pair.0", ptr %184, i32 0, i32 0
  %186 = load i64, ptr %185, align 8, !tbaa !16
  %187 = load i64, ptr %18, align 8, !tbaa !9
  %188 = icmp ne i64 %186, %187
  br label %189

189:                                              ; preds = %183, %178
  %190 = phi i1 [ true, %178 ], [ %188, %183 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br i1 %190, label %191, label %219

191:                                              ; preds = %189
  %192 = load i64, ptr %18, align 8, !tbaa !9
  %193 = load i32, ptr @tot, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr @tot, align 4, !tbaa !5
  store i32 %193, ptr %20, align 4, !tbaa !5
  %195 = sext i32 %193 to i64
  %196 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %195
  store i64 %192, ptr %196, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  %197 = load i32, ptr @tot, align 4, !tbaa !5
  %198 = sub nsw i32 %197, 1
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %199
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %201 = load i32, ptr @tot, align 4, !tbaa !5
  %202 = sub nsw i32 %201, 1
  store i32 %202, ptr %27, align 4, !tbaa !5
  %203 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %200, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %204 unwind label %215

204:                                              ; preds = %191
  store { i64, i32 } %203, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %28, i64 12, i1 false)
  %205 = invoke { ptr, i8 } @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %26)
          to label %206 unwind label %215

206:                                              ; preds = %204
  %207 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 0
  %208 = extractvalue { ptr, i8 } %205, 0
  store ptr %208, ptr %207, align 8
  %209 = getelementptr inbounds { ptr, i8 }, ptr %29, i32 0, i32 1
  %210 = extractvalue { ptr, i8 } %205, 1
  store i8 %210, ptr %209, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  br label %223

211:                                              ; preds = %176, %174
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %6, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  br label %234

215:                                              ; preds = %204, %191
  %216 = landingpad { ptr, i32 }
          cleanup
  %217 = extractvalue { ptr, i32 } %216, 0
  store ptr %217, ptr %6, align 8
  %218 = extractvalue { ptr, i32 } %216, 1
  store i32 %218, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  br label %234

219:                                              ; preds = %189
  %220 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIyiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %221 = getelementptr inbounds %"struct.std::pair.0", ptr %220, i32 0, i32 1
  %222 = load i32, ptr %221, align 8, !tbaa !18
  store i32 %222, ptr %20, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %219, %206
  %224 = load i32, ptr %20, align 4, !tbaa !5
  %225 = load i32, ptr %15, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [65 x [3763 x i32]], ptr @go, i64 0, i64 %226
  %228 = load i32, ptr %10, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [3763 x i32], ptr %227, i64 0, i64 %229
  store i32 %224, ptr %230, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %231

231:                                              ; preds = %223
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %15, align 4, !tbaa !5
  br label %108, !llvm.loop !19

234:                                              ; preds = %215, %211
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %235

235:                                              ; preds = %234, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %241

236:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %237

237:                                              ; preds = %236
  %238 = load i32, ptr %10, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %10, align 4, !tbaa !5
  br label %48, !llvm.loop !20

240:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 30104, ptr %2) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %1) #5
  ret void

241:                                              ; preds = %235, %53
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 30104, ptr %2) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %1) #5
  br label %242

242:                                              ; preds = %241
  %243 = load ptr, ptr %6, align 8
  %244 = load i32, ptr %7, align 4
  %245 = insertvalue { ptr, i32 } poison, ptr %243, 0
  %246 = insertvalue { ptr, i32 } %245, i32 %244, 1
  resume { ptr, i32 } %246
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!17, !10, i64 0}
!17 = !{!"_ZTSSt4pairIyiE", !10, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<unsigned long long, int>, std::pair<unsigned long long, int>, std::_Identity<std::pair<unsigned long long, int>>, std::less<std::pair<unsigned long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<unsigned long long, int>, std::pair<unsigned long long, int>, std::_Identity<std::pair<unsigned long long, int>>, std::less<std::pair<unsigned long long, 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.0" = type <{ i64, i32, [4 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@all = external dso_local local_unnamed_addr global i32, align 4
@w = external dso_local global [3763 x i32], align 16
@go = external dso_local local_unnamed_addr global [65 x [3763 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca [3763 x i64], align 16
  %3 = alloca [7 x i64], align 16
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::pair.0", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::pair.0", align 8
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.start.p0(i64 30104, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #5
  %14 = load i32, ptr @tot, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @tot, align 4, !tbaa !5
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %16
  store i64 1, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 %14, ptr %5, align 4, !tbaa !5
  %18 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %19 unwind label %24

19:                                               ; preds = %0
  %.fca.0.extract41 = extractvalue { i64, i32 } %18, 0
  %.fca.1.extract42 = extractvalue { i64, i32 } %18, 1
  store i64 %.fca.0.extract41, ptr %4, align 8
  %.sroa.244.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %.fca.1.extract42, ptr %.sroa.244.0..sroa_idx, align 8
  %20 = invoke { ptr, i8 } @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %4)
          to label %21 unwind label %24

21:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %22 = load i32, ptr @tot, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph78, label %._crit_edge79

.lr.ph78:                                         ; preds = %21
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  %.pre.pre = load i32, ptr @all, align 4, !tbaa !5
  br label %26

._crit_edge79:                                    ; preds = %._crit_edge75, %21
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 30104, ptr nonnull %2) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #5
  ret void

24:                                               ; preds = %19, %0
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %161

26:                                               ; preds = %.lr.ph78, %._crit_edge75
  %.pre = phi i32 [ %.pre.pre, %.lr.ph78 ], [ %.pre108, %._crit_edge75 ]
  %27 = phi i32 [ %22, %.lr.ph78 ], [ %73, %._crit_edge75 ]
  %indvars.iv101 = phi i64 [ 0, %.lr.ph78 ], [ %indvars.iv.next102, %._crit_edge75 ]
  %28 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %indvars.iv101
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph63, label %._crit_edge64

.lr.ph63:                                         ; preds = %26
  %32 = icmp sgt i32 %.pre, 0
  %wide.trip.count90 = zext nneg i32 %30 to i64
  br i1 %32, label %.lr.ph.us.preheader, label %.lr.ph63.split.preheader

.lr.ph63.split.preheader:                         ; preds = %.lr.ph63
  %min.iters.check118 = icmp ult i32 %30, 4
  br i1 %min.iters.check118, label %.lr.ph63.split.preheader130, label %vector.ph119

.lr.ph63.split.preheader130:                      ; preds = %middle.block116, %.lr.ph63.split.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph63.split.preheader ], [ %n.vec121, %middle.block116 ]
  br label %.lr.ph63.split

vector.ph119:                                     ; preds = %.lr.ph63.split.preheader
  %n.vec121 = and i64 %wide.trip.count90, 2147483644
  %broadcast.splatinsert125 = insertelement <2 x i64> poison, i64 %29, i64 0
  %broadcast.splat126 = shufflevector <2 x i64> %broadcast.splatinsert125, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body123

vector.body123:                                   ; preds = %vector.body123, %vector.ph119
  %index124 = phi i64 [ 0, %vector.ph119 ], [ %index.next127, %vector.body123 ]
  %33 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %index124
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  store <2 x i64> %broadcast.splat126, ptr %33, align 16, !tbaa !9
  store <2 x i64> %broadcast.splat126, ptr %34, align 16, !tbaa !9
  %index.next127 = add nuw i64 %index124, 4
  %35 = icmp eq i64 %index.next127, %n.vec121
  br i1 %35, label %middle.block116, label %vector.body123, !llvm.loop !11

middle.block116:                                  ; preds = %vector.body123
  %cmp.n128 = icmp eq i64 %n.vec121, %wide.trip.count90
  br i1 %cmp.n128, label %._crit_edge64, label %.lr.ph63.split.preheader130

.lr.ph.us.preheader:                              ; preds = %.lr.ph63
  %wide.trip.count85 = zext nneg i32 %.pre to i64
  %xtraiter = and i64 %wide.trip.count85, 1
  %36 = icmp eq i32 %.pre, 1
  %unroll_iter = and i64 %wide.trip.count85, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv87 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next88, %._crit_edge.us ]
  %37 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %indvars.iv87
  store i64 %29, ptr %37, align 8, !tbaa !9
  %38 = trunc nuw nsw i64 %indvars.iv87 to i32
  %39 = shl nuw i32 1, %38
  br i1 %36, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new

.lr.ph.us.new:                                    ; preds = %.lr.ph.us, %60
  %40 = phi i64 [ %61, %60 ], [ %29, %.lr.ph.us ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83.1, %60 ], [ 0, %.lr.ph.us ]
  %niter = phi i64 [ %niter.next.1, %60 ], [ 0, %.lr.ph.us ]
  %41 = shl nuw i64 1, %indvars.iv82
  %42 = and i64 %41, %29
  %.not59.us = icmp eq i64 %42, 0
  br i1 %.not59.us, label %49, label %43

43:                                               ; preds = %.lr.ph.us.new
  %44 = trunc nuw nsw i64 %indvars.iv82 to i32
  %45 = or i32 %39, %44
  %46 = zext nneg i32 %45 to i64
  %47 = shl nuw i64 1, %46
  %48 = or i64 %40, %47
  store i64 %48, ptr %37, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %43, %.lr.ph.us.new
  %50 = phi i64 [ %48, %43 ], [ %40, %.lr.ph.us.new ]
  %51 = shl nuw i64 2, %indvars.iv82
  %52 = and i64 %51, %29
  %.not59.us.1 = icmp eq i64 %52, 0
  br i1 %.not59.us.1, label %60, label %53

53:                                               ; preds = %49
  %54 = trunc i64 %indvars.iv82 to i32
  %55 = or disjoint i32 %54, 1
  %56 = or i32 %39, %55
  %57 = zext nneg i32 %56 to i64
  %58 = shl nuw i64 1, %57
  %59 = or i64 %50, %58
  store i64 %59, ptr %37, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %53, %49
  %61 = phi i64 [ %59, %53 ], [ %50, %49 ]
  %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.unr-lcssa, label %.lr.ph.us.new, !llvm.loop !15

._crit_edge.us.unr-lcssa:                         ; preds = %60, %.lr.ph.us
  %.unr = phi i64 [ %29, %.lr.ph.us ], [ %61, %60 ]
  %indvars.iv82.unr = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next83.1, %60 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa
  %62 = shl nuw i64 1, %indvars.iv82.unr
  %63 = and i64 %62, %29
  %.not59.us.epil = icmp eq i64 %63, 0
  br i1 %.not59.us.epil, label %._crit_edge.us, label %64

64:                                               ; preds = %.epil.preheader
  %65 = trunc nuw nsw i64 %indvars.iv82.unr to i32
  %66 = or i32 %39, %65
  %67 = zext nneg i32 %66 to i64
  %68 = shl nuw i64 1, %67
  %69 = or i64 %.unr, %68
  store i64 %69, ptr %37, align 8, !tbaa !9
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.epil.preheader, %64, %._crit_edge.us.unr-lcssa
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
  br i1 %exitcond91.not, label %._crit_edge64, label %.lr.ph.us, !llvm.loop !16

._crit_edge64:                                    ; preds = %.lr.ph63.split, %._crit_edge.us, %middle.block116, %26
  %70 = getelementptr inbounds [3763 x i32], ptr @w, i64 0, i64 %indvars.iv101
  store i32 0, ptr %70, align 4, !tbaa !5
  %71 = icmp sgt i32 %.pre, 0
  br i1 %71, label %.lr.ph74, label %._crit_edge75

.lr.ph63.split:                                   ; preds = %.lr.ph63.split.preheader130, %.lr.ph63.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph63.split ], [ %indvars.iv.ph, %.lr.ph63.split.preheader130 ]
  %72 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %indvars.iv
  store i64 %29, ptr %72, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count90
  br i1 %exitcond.not, label %._crit_edge64, label %.lr.ph63.split, !llvm.loop !17

._crit_edge75.loopexit:                           ; preds = %155
  %.pre107 = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %._crit_edge75.loopexit, %._crit_edge64
  %.pre108 = phi i32 [ %157, %._crit_edge75.loopexit ], [ %.pre, %._crit_edge64 ]
  %73 = phi i32 [ %.pre107, %._crit_edge75.loopexit ], [ %27, %._crit_edge64 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next102, %74
  br i1 %75, label %26, label %._crit_edge79, !llvm.loop !18

.lr.ph74:                                         ; preds = %._crit_edge64, %155
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %155 ], [ 0, %._crit_edge64 ]
  %76 = shl nuw i64 1, %indvars.iv98
  %77 = and i64 %76, %29
  %.not = icmp eq i64 %77, 0
  %.pre105 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %.not, label %97, label %78

78:                                               ; preds = %.lr.ph74
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  %79 = icmp sgt i32 %.pre105, 0
  br i1 %79, label %.lr.ph.preheader, label %89

.lr.ph.preheader:                                 ; preds = %78
  %80 = trunc nuw nsw i64 %indvars.iv98 to i32
  %min.iters.check = icmp ult i32 %.pre105, 8
  br i1 %min.iters.check, label %.lr.ph.preheader129, label %vector.ph

.lr.ph.preheader129:                              ; preds = %middle.block, %.lr.ph.preheader
  %.05365.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %88, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i32 %.pre105, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %80, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %85, %vector.body ]
  %vec.phi115 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %86, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %81 = lshr <4 x i32> %broadcast.splat, %vec.ind
  %82 = lshr <4 x i32> %broadcast.splat, %step.add
  %83 = and <4 x i32> %81, <i32 1, i32 1, i32 1, i32 1>
  %84 = and <4 x i32> %82, <i32 1, i32 1, i32 1, i32 1>
  %85 = add <4 x i32> %vec.phi, %83
  %86 = add <4 x i32> %vec.phi115, %84
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %87 = icmp eq i32 %index.next, %n.vec
  br i1 %87, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %86, %85
  %88 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i32 %.pre105, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader129

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %.lcssa = phi i32 [ %88, %middle.block ], [ %95, %.lr.ph ]
  store i32 %.lcssa, ptr %6, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %._crit_edge, %78
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %70, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  store i32 %91, ptr %70, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %.pre104 = load i32, ptr @n, align 4, !tbaa !5
  br label %97

.lr.ph:                                           ; preds = %.lr.ph.preheader129, %.lr.ph
  %.05365 = phi i32 [ %96, %.lr.ph ], [ %.05365.ph, %.lr.ph.preheader129 ]
  %92 = phi i32 [ %95, %.lr.ph ], [ %.ph, %.lr.ph.preheader129 ]
  %93 = lshr i32 %80, %.05365
  %94 = and i32 %93, 1
  %95 = add nuw nsw i32 %92, %94
  %96 = add nuw nsw i32 %.05365, 1
  %exitcond92.not = icmp eq i32 %96, %.pre105
  br i1 %exitcond92.not, label %._crit_edge, label %.lr.ph, !llvm.loop !20

97:                                               ; preds = %89, %.lr.ph74
  %98 = phi i32 [ %.pre104, %89 ], [ %.pre105, %.lr.ph74 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store i64 %29, ptr %7, align 8, !tbaa !9
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph69.preheader, label %._crit_edge70

.lr.ph69.preheader:                               ; preds = %97
  %wide.trip.count96 = zext nneg i32 %98 to i64
  %100 = trunc nuw nsw i64 %indvars.iv98 to i32
  %xtraiter136 = and i64 %wide.trip.count96, 1
  %101 = icmp eq i32 %98, 1
  br i1 %101, label %._crit_edge70.loopexit.unr-lcssa, label %.lr.ph69.preheader.new

.lr.ph69.preheader.new:                           ; preds = %.lr.ph69.preheader
  %unroll_iter139 = and i64 %wide.trip.count96, 2147483646
  br label %.lr.ph69

._crit_edge70.loopexit.unr-lcssa:                 ; preds = %126, %.lr.ph69.preheader
  %indvars.iv93.unr = phi i64 [ 0, %.lr.ph69.preheader ], [ %indvars.iv.next94.1, %126 ]
  %.unr137 = phi i64 [ %29, %.lr.ph69.preheader ], [ %127, %126 ]
  %lcmp.mod138.not = icmp eq i64 %xtraiter136, 0
  br i1 %lcmp.mod138.not, label %._crit_edge70, label %.lr.ph69.epil

.lr.ph69.epil:                                    ; preds = %._crit_edge70.loopexit.unr-lcssa
  %102 = trunc nuw nsw i64 %indvars.iv93.unr to i32
  %103 = shl nuw i32 1, %102
  %104 = and i32 %103, %100
  %.not58.epil = icmp eq i32 %104, 0
  br i1 %.not58.epil, label %._crit_edge70, label %105

105:                                              ; preds = %.lr.ph69.epil
  %106 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %indvars.iv93.unr
  %107 = load i64, ptr %106, align 8, !tbaa !9
  %108 = or i64 %.unr137, %107
  store i64 %108, ptr %7, align 8, !tbaa !9
  br label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge70.loopexit.unr-lcssa, %105, %.lr.ph69.epil, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  %109 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %128 unwind label %147

.lr.ph69:                                         ; preds = %126, %.lr.ph69.preheader.new
  %indvars.iv93 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %indvars.iv.next94.1, %126 ]
  %110 = phi i64 [ %29, %.lr.ph69.preheader.new ], [ %127, %126 ]
  %niter140 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %niter140.next.1, %126 ]
  %111 = trunc nuw nsw i64 %indvars.iv93 to i32
  %112 = shl nuw i32 1, %111
  %113 = and i32 %112, %100
  %.not58 = icmp eq i32 %113, 0
  br i1 %.not58, label %.lr.ph69.1, label %114

114:                                              ; preds = %.lr.ph69
  %115 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %indvars.iv93
  %116 = load i64, ptr %115, align 16, !tbaa !9
  %117 = or i64 %110, %116
  store i64 %117, ptr %7, align 8, !tbaa !9
  br label %.lr.ph69.1

.lr.ph69.1:                                       ; preds = %.lr.ph69, %114
  %118 = phi i64 [ %110, %.lr.ph69 ], [ %117, %114 ]
  %indvars.iv.next94 = or disjoint i64 %indvars.iv93, 1
  %119 = trunc nuw nsw i64 %indvars.iv.next94 to i32
  %120 = shl nuw i32 1, %119
  %121 = and i32 %120, %100
  %.not58.1 = icmp eq i32 %121, 0
  br i1 %.not58.1, label %126, label %122

122:                                              ; preds = %.lr.ph69.1
  %123 = getelementptr inbounds [7 x i64], ptr %3, i64 0, i64 %indvars.iv.next94
  %124 = load i64, ptr %123, align 8, !tbaa !9
  %125 = or i64 %118, %124
  store i64 %125, ptr %7, align 8, !tbaa !9
  br label %126

126:                                              ; preds = %122, %.lr.ph69.1
  %127 = phi i64 [ %118, %.lr.ph69.1 ], [ %125, %122 ]
  %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 2
  %niter140.next.1 = add i64 %niter140, 2
  %niter140.ncmp.1 = icmp eq i64 %niter140.next.1, %unroll_iter139
  br i1 %niter140.ncmp.1, label %._crit_edge70.loopexit.unr-lcssa, label %.lr.ph69, !llvm.loop !21

128:                                              ; preds = %._crit_edge70
  %.fca.0.extract2 = extractvalue { i64, i32 } %109, 0
  %.fca.1.extract3 = extractvalue { i64, i32 } %109, 1
  store i64 %.fca.0.extract2, ptr %9, align 8
  store i32 %.fca.1.extract3, ptr %.sroa.25.0..sroa_idx, align 8
  %129 = invoke ptr @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE11lower_boundERKS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %130 unwind label %147

130:                                              ; preds = %128
  store ptr %129, ptr %8, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %131 = call ptr @_ZNKSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  store ptr %131, ptr %11, align 8
  %132 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIyiEES4_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %132, label %.critedge, label %133

133:                                              ; preds = %130
  %134 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIyiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %135 = load i64, ptr %134, align 8, !tbaa !22
  %136 = load i64, ptr %7, align 8, !tbaa !9
  %.not55 = icmp eq i64 %135, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %.not55, label %151, label %137

.critedge:                                        ; preds = %130
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  %.pre106 = load i64, ptr %7, align 8, !tbaa !9
  br label %137

137:                                              ; preds = %.critedge, %133
  %138 = phi i64 [ %.pre106, %.critedge ], [ %136, %133 ]
  %139 = load i32, ptr @tot, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr @tot, align 4, !tbaa !5
  %141 = sext i32 %139 to i64
  %142 = getelementptr inbounds [3763 x i64], ptr %2, i64 0, i64 %141
  store i64 %138, ptr %142, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  store i32 %139, ptr %13, align 4, !tbaa !5
  %143 = invoke { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %144 unwind label %149

144:                                              ; preds = %137
  %.fca.0.extract = extractvalue { i64, i32 } %143, 0
  %.fca.1.extract = extractvalue { i64, i32 } %143, 1
  store i64 %.fca.0.extract, ptr %12, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %145 = invoke { ptr, i8 } @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %146 unwind label %149

146:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %155

147:                                              ; preds = %128, %._crit_edge70
  %148 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  br label %160

149:                                              ; preds = %144, %137
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %160

151:                                              ; preds = %133
  %152 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIyiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %153 = getelementptr inbounds i8, ptr %152, i64 8
  %154 = load i32, ptr %153, align 8, !tbaa !24
  br label %155

155:                                              ; preds = %151, %146
  %.051 = phi i32 [ %139, %146 ], [ %154, %151 ]
  %156 = getelementptr inbounds [65 x [3763 x i32]], ptr @go, i64 0, i64 %indvars.iv98, i64 %indvars.iv101
  store i32 %.051, ptr %156, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %157 = load i32, ptr @all, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = icmp slt i64 %indvars.iv.next99, %158
  br i1 %159, label %.lr.ph74, label %._crit_edge75.loopexit, !llvm.loop !25

160:                                              ; preds = %149, %147
  %.pn = phi { ptr, i32 } [ %150, %149 ], [ %148, %147 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %161

161:                                              ; preds = %160, %24
  %.pn.pn = phi { ptr, i32 } [ %.pn, %160 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 30104, ptr nonnull %2) #5
  call void @_ZNSt3setISt4pairIyiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRyiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !14, !13}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !13, !14}
!20 = distinct !{!20, !12, !14, !13}
!21 = distinct !{!21, !12}
!22 = !{!23, !10, i64 0}
!23 = !{!"_ZTSSt4pairIyiE", !10, i64 0, !6, i64 8}
!24 = !{!23, !6, i64 8}
!25 = distinct !{!25, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass