; LLVM IR from duc0/ContestNeko :: CPPProjects (RangeQuery)

; 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"

%struct.Node = type { i64, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%class.anon = type { i8 }
%class.anon.0 = type { ptr }
%class.RangeQuery = type { i64, i64, %"class.std::vector", %"class.std::function" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@h = external dso_local global [200100 x i64], align 16
@d = external dso_local global [200100 x i64], align 16
@dst = external dso_local global [200100 x i64], align 16
@hplusd = external dso_local global [200100 x %struct.Node], align 16
@hminusd = external dso_local global [200100 x %struct.Node], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Node, align 8
  %8 = alloca %struct.Node, align 8
  %9 = alloca %class.anon, align 1
  %10 = alloca %class.anon.0, align 8
  %11 = alloca %class.RangeQuery, align 8
  %12 = alloca %"class.std::function", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.RangeQuery, align 8
  %16 = alloca %"class.std::function", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.Node, align 8
  %24 = alloca %struct.Node, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = alloca %struct.Node, align 8
  %29 = alloca i32, align 4
  %30 = alloca %struct.Node, align 8
  %31 = alloca %struct.Node, align 8
  %32 = alloca i64, align 8
  %33 = alloca %struct.Node, align 8
  %34 = alloca i32, align 4
  %35 = alloca %struct.Node, align 8
  %36 = alloca %struct.Node, align 8
  %37 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %50, %0
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %48)
  br label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %40, !llvm.loop !9

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %64, %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %67

59:                                               ; preds = %54
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %61
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %62)
  br label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %54, !llvm.loop !11

67:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %4, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %95, %67
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = mul nsw i32 2, %72
  %74 = icmp sle i32 %71, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %98

76:                                               ; preds = %70
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = sub nsw i32 %77, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !12
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %84
  store i64 %82, ptr %85, align 8, !tbaa !12
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !12
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %93
  store i64 %91, ptr %94, align 8, !tbaa !12
  br label %95

95:                                               ; preds = %76
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %70, !llvm.loop !14

98:                                               ; preds = %75
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = mul nsw i32 %99, 2
  store i32 %100, ptr @n, align 4, !tbaa !5
  store i64 0, ptr getelementptr inbounds ([200100 x i64], ptr @d, i64 0, i64 1), align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %121, %98
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = icmp sle i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %124

106:                                              ; preds = %101
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !12
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = sub nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !12
  %117 = add nsw i64 %111, %116
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %119
  store i64 %117, ptr %120, align 8, !tbaa !12
  br label %121

121:                                              ; preds = %106
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %5, align 4, !tbaa !5
  br label %101, !llvm.loop !15

124:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %169, %124
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %172

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  %131 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 0
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !12
  %136 = mul nsw i64 2, %135
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !12
  %141 = add nsw i64 %136, %140
  store i64 %141, ptr %131, align 8, !tbaa !16
  %142 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 1
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = sub nsw i32 %143, 1
  store i32 %144, ptr %142, align 8, !tbaa !18
  %145 = getelementptr inbounds %struct.Node, ptr %7, i32 0, i32 2
  store i32 -1, ptr %145, align 4, !tbaa !19
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200100 x %struct.Node], ptr @hplusd, i64 0, i64 %148
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %149, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #8
  %150 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 0
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !12
  %155 = mul nsw i64 2, %154
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !12
  %160 = sub nsw i64 %155, %159
  store i64 %160, ptr %150, align 8, !tbaa !16
  %161 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 1
  %162 = load i32, ptr %6, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  store i32 %163, ptr %161, align 8, !tbaa !18
  %164 = getelementptr inbounds %struct.Node, ptr %8, i32 0, i32 2
  store i32 -1, ptr %164, align 4, !tbaa !19
  %165 = load i32, ptr %6, align 4, !tbaa !5
  %166 = sub nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200100 x %struct.Node], ptr @hminusd, i64 0, i64 %167
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %168, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #8
  br label %169

169:                                              ; preds = %130
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %6, align 4, !tbaa !5
  br label %125, !llvm.loop !21

172:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %173 = getelementptr inbounds %class.anon.0, ptr %10, i32 0, i32 0
  store ptr %9, ptr %173, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #8
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.Node, ptr @hplusd, i64 %175
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #8
  call void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  invoke void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72) %11, ptr noundef @hplusd, ptr noundef %176, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %177 unwind label %187

177:                                              ; preds = %172
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 72, ptr %15) #8
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds %struct.Node, ptr @hminusd, i64 %179
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #8
  call void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  invoke void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72) %15, ptr noundef @hminusd, ptr noundef %180, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %181 unwind label %191

181:                                              ; preds = %177
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %414, %181
  %183 = load i32, ptr %21, align 4, !tbaa !5
  %184 = load i32, ptr @q, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %195, label %186

186:                                              ; preds = %182
  store i32 17, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %423

187:                                              ; preds = %172
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %13, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #8
  br label %426

191:                                              ; preds = %177
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %13, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %14, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #8
  br label %425

195:                                              ; preds = %182
  %196 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %197 unwind label %211

197:                                              ; preds = %195
  %198 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %196, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %199 unwind label %211

199:                                              ; preds = %197
  %200 = load i32, ptr %17, align 4, !tbaa !5
  %201 = load i32, ptr %18, align 4, !tbaa !5
  %202 = icmp sle i32 %200, %201
  br i1 %202, label %203, label %215

203:                                              ; preds = %199
  %204 = load i32, ptr %18, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %19, align 4, !tbaa !5
  %206 = load i32, ptr %17, align 4, !tbaa !5
  %207 = sub nsw i32 %206, 1
  %208 = load i32, ptr @n, align 4, !tbaa !5
  %209 = sdiv i32 %208, 2
  %210 = add nsw i32 %207, %209
  store i32 %210, ptr %20, align 4, !tbaa !5
  br label %220

211:                                              ; preds = %197, %195
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %13, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %14, align 4
  br label %422

215:                                              ; preds = %199
  %216 = load i32, ptr %18, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %19, align 4, !tbaa !5
  %218 = load i32, ptr %17, align 4, !tbaa !5
  %219 = sub nsw i32 %218, 1
  store i32 %219, ptr %20, align 4, !tbaa !5
  br label %220

220:                                              ; preds = %215, %203
  %221 = load i32, ptr %19, align 4, !tbaa !5
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr %19, align 4, !tbaa !5
  %223 = load i32, ptr %20, align 4, !tbaa !5
  %224 = add nsw i32 %223, -1
  store i32 %224, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  store i64 -1000000000000000000, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #8
  %225 = load i32, ptr %19, align 4, !tbaa !5
  %226 = load i32, ptr %20, align 4, !tbaa !5
  %227 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %11, i32 noundef %225, i32 noundef %226)
          to label %228 unwind label %237

228:                                              ; preds = %220
  %229 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 0
  %230 = extractvalue { i64, i64 } %227, 0
  store i64 %230, ptr %229, align 8
  %231 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 1
  %232 = extractvalue { i64, i64 } %227, 1
  store i64 %232, ptr %231, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %28, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %308, %228
  %234 = load i32, ptr %29, align 4, !tbaa !5
  %235 = icmp slt i32 %234, 2
  br i1 %235, label %241, label %236

236:                                              ; preds = %233
  store i32 20, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %316

237:                                              ; preds = %220
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %13, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  br label %421

241:                                              ; preds = %233
  %242 = load i32, ptr %29, align 4, !tbaa !5
  %243 = icmp eq i32 %242, 0
  br i1 %243, label %244, label %247

244:                                              ; preds = %241
  %245 = getelementptr inbounds %struct.Node, ptr %23, i32 0, i32 1
  %246 = load i32, ptr %245, align 8, !tbaa !18
  store i32 %246, ptr %27, align 4, !tbaa !5
  br label %250

247:                                              ; preds = %241
  %248 = getelementptr inbounds %struct.Node, ptr %23, i32 0, i32 2
  %249 = load i32, ptr %248, align 4, !tbaa !19
  store i32 %249, ptr %27, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %247, %244
  %251 = load i32, ptr %27, align 4, !tbaa !5
  %252 = icmp eq i32 %251, -1
  br i1 %252, label %253, label %254

253:                                              ; preds = %250
  br label %308

254:                                              ; preds = %250
  store i64 -1000000000000000000, ptr %26, align 8, !tbaa !12
  %255 = load i32, ptr %19, align 4, !tbaa !5
  %256 = load i32, ptr %27, align 4, !tbaa !5
  %257 = sub nsw i32 %256, 1
  %258 = icmp sle i32 %255, %257
  br i1 %258, label %259, label %277

259:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #8
  %260 = load i32, ptr %19, align 4, !tbaa !5
  %261 = load i32, ptr %27, align 4, !tbaa !5
  %262 = sub nsw i32 %261, 1
  %263 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %15, i32 noundef %260, i32 noundef %262)
          to label %264 unwind label %273

264:                                              ; preds = %259
  %265 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 0
  %266 = extractvalue { i64, i64 } %263, 0
  store i64 %266, ptr %265, align 8
  %267 = getelementptr inbounds { i64, i64 }, ptr %30, i32 0, i32 1
  %268 = extractvalue { i64, i64 } %263, 1
  store i64 %268, ptr %267, align 8
  %269 = getelementptr inbounds %struct.Node, ptr %30, i32 0, i32 0
  %270 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %269)
          to label %271 unwind label %273

271:                                              ; preds = %264
  %272 = load i64, ptr %270, align 8, !tbaa !12
  store i64 %272, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #8
  br label %277

273:                                              ; preds = %264, %259
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %13, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #8
  br label %315

277:                                              ; preds = %271, %254
  %278 = load i32, ptr %27, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  %280 = load i32, ptr %20, align 4, !tbaa !5
  %281 = icmp sle i32 %279, %280
  br i1 %281, label %282, label %300

282:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #8
  %283 = load i32, ptr %27, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  %285 = load i32, ptr %20, align 4, !tbaa !5
  %286 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %15, i32 noundef %284, i32 noundef %285)
          to label %287 unwind label %296

287:                                              ; preds = %282
  %288 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 0
  %289 = extractvalue { i64, i64 } %286, 0
  store i64 %289, ptr %288, align 8
  %290 = getelementptr inbounds { i64, i64 }, ptr %31, i32 0, i32 1
  %291 = extractvalue { i64, i64 } %286, 1
  store i64 %291, ptr %290, align 8
  %292 = getelementptr inbounds %struct.Node, ptr %31, i32 0, i32 0
  %293 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %292)
          to label %294 unwind label %296

294:                                              ; preds = %287
  %295 = load i64, ptr %293, align 8, !tbaa !12
  store i64 %295, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  br label %300

296:                                              ; preds = %287, %282
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %13, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #8
  br label %315

300:                                              ; preds = %294, %277
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %301 = getelementptr inbounds %struct.Node, ptr %23, i32 0, i32 0
  %302 = load i64, ptr %301, align 8, !tbaa !16
  %303 = load i64, ptr %26, align 8, !tbaa !12
  %304 = add nsw i64 %302, %303
  store i64 %304, ptr %32, align 8, !tbaa !12
  %305 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %306 unwind label %311

306:                                              ; preds = %300
  %307 = load i64, ptr %305, align 8, !tbaa !12
  store i64 %307, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %308

308:                                              ; preds = %306, %253
  %309 = load i32, ptr %29, align 4, !tbaa !5
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %29, align 4, !tbaa !5
  br label %233, !llvm.loop !24

311:                                              ; preds = %300
  %312 = landingpad { ptr, i32 }
          cleanup
  %313 = extractvalue { ptr, i32 } %312, 0
  store ptr %313, ptr %13, align 8
  %314 = extractvalue { ptr, i32 } %312, 1
  store i32 %314, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %315

315:                                              ; preds = %311, %296, %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %421

316:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #8
  %317 = load i32, ptr %19, align 4, !tbaa !5
  %318 = load i32, ptr %20, align 4, !tbaa !5
  %319 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %15, i32 noundef %317, i32 noundef %318)
          to label %320 unwind label %329

320:                                              ; preds = %316
  %321 = getelementptr inbounds { i64, i64 }, ptr %33, i32 0, i32 0
  %322 = extractvalue { i64, i64 } %319, 0
  store i64 %322, ptr %321, align 8
  %323 = getelementptr inbounds { i64, i64 }, ptr %33, i32 0, i32 1
  %324 = extractvalue { i64, i64 } %319, 1
  store i64 %324, ptr %323, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %33, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %325

325:                                              ; preds = %400, %320
  %326 = load i32, ptr %34, align 4, !tbaa !5
  %327 = icmp slt i32 %326, 2
  br i1 %327, label %333, label %328

328:                                              ; preds = %325
  store i32 23, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %408

329:                                              ; preds = %316
  %330 = landingpad { ptr, i32 }
          cleanup
  %331 = extractvalue { ptr, i32 } %330, 0
  store ptr %331, ptr %13, align 8
  %332 = extractvalue { ptr, i32 } %330, 1
  store i32 %332, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #8
  br label %421

333:                                              ; preds = %325
  %334 = load i32, ptr %34, align 4, !tbaa !5
  %335 = icmp eq i32 %334, 0
  br i1 %335, label %336, label %339

336:                                              ; preds = %333
  %337 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 1
  %338 = load i32, ptr %337, align 8, !tbaa !18
  store i32 %338, ptr %27, align 4, !tbaa !5
  br label %342

339:                                              ; preds = %333
  %340 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 2
  %341 = load i32, ptr %340, align 4, !tbaa !19
  store i32 %341, ptr %27, align 4, !tbaa !5
  br label %342

342:                                              ; preds = %339, %336
  %343 = load i32, ptr %27, align 4, !tbaa !5
  %344 = icmp eq i32 %343, -1
  br i1 %344, label %345, label %346

345:                                              ; preds = %342
  br label %400

346:                                              ; preds = %342
  store i64 -1000000000000000000, ptr %26, align 8, !tbaa !12
  %347 = load i32, ptr %19, align 4, !tbaa !5
  %348 = load i32, ptr %27, align 4, !tbaa !5
  %349 = sub nsw i32 %348, 1
  %350 = icmp sle i32 %347, %349
  br i1 %350, label %351, label %369

351:                                              ; preds = %346
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #8
  %352 = load i32, ptr %19, align 4, !tbaa !5
  %353 = load i32, ptr %27, align 4, !tbaa !5
  %354 = sub nsw i32 %353, 1
  %355 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %11, i32 noundef %352, i32 noundef %354)
          to label %356 unwind label %365

356:                                              ; preds = %351
  %357 = getelementptr inbounds { i64, i64 }, ptr %35, i32 0, i32 0
  %358 = extractvalue { i64, i64 } %355, 0
  store i64 %358, ptr %357, align 8
  %359 = getelementptr inbounds { i64, i64 }, ptr %35, i32 0, i32 1
  %360 = extractvalue { i64, i64 } %355, 1
  store i64 %360, ptr %359, align 8
  %361 = getelementptr inbounds %struct.Node, ptr %35, i32 0, i32 0
  %362 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %361)
          to label %363 unwind label %365

363:                                              ; preds = %356
  %364 = load i64, ptr %362, align 8, !tbaa !12
  store i64 %364, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  br label %369

365:                                              ; preds = %356, %351
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %13, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #8
  br label %407

369:                                              ; preds = %363, %346
  %370 = load i32, ptr %27, align 4, !tbaa !5
  %371 = add nsw i32 %370, 1
  %372 = load i32, ptr %20, align 4, !tbaa !5
  %373 = icmp sle i32 %371, %372
  br i1 %373, label %374, label %392

374:                                              ; preds = %369
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #8
  %375 = load i32, ptr %27, align 4, !tbaa !5
  %376 = add nsw i32 %375, 1
  %377 = load i32, ptr %20, align 4, !tbaa !5
  %378 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %11, i32 noundef %376, i32 noundef %377)
          to label %379 unwind label %388

379:                                              ; preds = %374
  %380 = getelementptr inbounds { i64, i64 }, ptr %36, i32 0, i32 0
  %381 = extractvalue { i64, i64 } %378, 0
  store i64 %381, ptr %380, align 8
  %382 = getelementptr inbounds { i64, i64 }, ptr %36, i32 0, i32 1
  %383 = extractvalue { i64, i64 } %378, 1
  store i64 %383, ptr %382, align 8
  %384 = getelementptr inbounds %struct.Node, ptr %36, i32 0, i32 0
  %385 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %384)
          to label %386 unwind label %388

386:                                              ; preds = %379
  %387 = load i64, ptr %385, align 8, !tbaa !12
  store i64 %387, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #8
  br label %392

388:                                              ; preds = %379, %374
  %389 = landingpad { ptr, i32 }
          cleanup
  %390 = extractvalue { ptr, i32 } %389, 0
  store ptr %390, ptr %13, align 8
  %391 = extractvalue { ptr, i32 } %389, 1
  store i32 %391, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #8
  br label %407

392:                                              ; preds = %386, %369
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %393 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 0
  %394 = load i64, ptr %393, align 8, !tbaa !16
  %395 = load i64, ptr %26, align 8, !tbaa !12
  %396 = add nsw i64 %394, %395
  store i64 %396, ptr %37, align 8, !tbaa !12
  %397 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %398 unwind label %403

398:                                              ; preds = %392
  %399 = load i64, ptr %397, align 8, !tbaa !12
  store i64 %399, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %400

400:                                              ; preds = %398, %345
  %401 = load i32, ptr %34, align 4, !tbaa !5
  %402 = add nsw i32 %401, 1
  store i32 %402, ptr %34, align 4, !tbaa !5
  br label %325, !llvm.loop !25

403:                                              ; preds = %392
  %404 = landingpad { ptr, i32 }
          cleanup
  %405 = extractvalue { ptr, i32 } %404, 0
  store ptr %405, ptr %13, align 8
  %406 = extractvalue { ptr, i32 } %404, 1
  store i32 %406, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  br label %407

407:                                              ; preds = %403, %388, %365
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %421

408:                                              ; preds = %328
  %409 = load i64, ptr %25, align 8, !tbaa !12
  %410 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %409)
          to label %411 unwind label %417

411:                                              ; preds = %408
  %412 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %410, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %413 unwind label %417

413:                                              ; preds = %411
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  br label %414

414:                                              ; preds = %413
  %415 = load i32, ptr %21, align 4, !tbaa !5
  %416 = add nsw i32 %415, 1
  store i32 %416, ptr %21, align 4, !tbaa !5
  br label %182, !llvm.loop !26

417:                                              ; preds = %411, %408
  %418 = landingpad { ptr, i32 }
          cleanup
  %419 = extractvalue { ptr, i32 } %418, 0
  store ptr %419, ptr %13, align 8
  %420 = extractvalue { ptr, i32 } %418, 1
  store i32 %420, ptr %14, align 4
  br label %421

421:                                              ; preds = %417, %407, %329, %315, %237
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #8
  br label %422

422:                                              ; preds = %421, %211
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %15) #8
  br label %425

423:                                              ; preds = %186
  store i32 0, ptr %1, align 4
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %15) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %11) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  %424 = load i32, ptr %1, align 4
  ret i32 %424

425:                                              ; preds = %422, %191
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %11) #8
  br label %426

426:                                              ; preds = %425, %187
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #8
  br label %427

427:                                              ; preds = %426
  %428 = load ptr, ptr %13, align 8
  %429 = load i32, ptr %14, align 4
  %430 = insertvalue { ptr, i32 } poison, ptr %428, 0
  %431 = insertvalue { ptr, i32 } %430, i32 %429, 1
  resume { ptr, i32 } %431
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #6 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !13, i64 0}
!17 = !{!"_ZTS4Node", !13, i64 0, !6, i64 8, !6, i64 12}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 12}
!20 = !{i64 0, i64 8, !12, i64 8, i64 4, !5, i64 12, i64 4, !5}
!21 = distinct !{!21, !10}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}


; 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"

%struct.Node = type { i64, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%class.anon = type { i8 }
%class.anon.0 = type { ptr }
%class.RangeQuery = type { i64, i64, %"class.std::vector", %"class.std::function" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Node>, std::allocator<std::vector<Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@h = external dso_local global [200100 x i64], align 16
@d = external dso_local local_unnamed_addr global [200100 x i64], align 16
@dst = external dso_local global [200100 x i64], align 16
@hplusd = external dso_local global [200100 x %struct.Node], align 16
@hminusd = external dso_local global [200100 x %struct.Node], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.anon, align 1
  %2 = alloca %class.anon.0, align 8
  %3 = alloca %class.RangeQuery, align 8
  %4 = alloca %"class.std::function", align 8
  %5 = alloca %class.RangeQuery, align 8
  %6 = alloca %"class.std::function", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.Node, align 8
  %12 = alloca %struct.Node, align 8
  %13 = alloca i64, align 8
  %14 = alloca %struct.Node, align 8
  %15 = alloca %struct.Node, align 8
  %16 = alloca i64, align 8
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @q)
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %.not123 = icmp slt i32 %19, 1
  br i1 %.not123, label %.preheader120, label %.lr.ph

.preheader121:                                    ; preds = %.lr.ph
  %.not104125 = icmp slt i32 %22, 1
  br i1 %.not104125, label %.preheader120, label %.lr.ph127

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %20 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %indvars.iv
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %.not.not = icmp slt i64 %indvars.iv, %23
  br i1 %.not.not, label %.lr.ph, label %.preheader121, !llvm.loop !9

.preheader120:                                    ; preds = %.lr.ph127, %0, %.preheader121
  %.lcssa122 = phi i32 [ %22, %.preheader121 ], [ %19, %0 ], [ %50, %.lr.ph127 ]
  %24 = shl nsw i32 %.lcssa122, 1
  %.not105.not128 = icmp slt i32 %.lcssa122, %24
  br i1 %.not105.not128, label %.lr.ph130.preheader, label %._crit_edge

.lr.ph130.preheader:                              ; preds = %.preheader120
  %25 = sext i32 %.lcssa122 to i64
  %wide.trip.count = sext i32 %24 to i64
  %26 = sub nsw i64 %wide.trip.count, %25
  %min.iters.check = icmp ult i64 %26, 4
  %27 = and i64 %25, 2305843009213693948
  %diff.check = icmp eq i64 %27, 0
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph130.preheader171, label %vector.ph

.lr.ph130.preheader171:                           ; preds = %middle.block, %.lr.ph130.preheader
  %indvars.iv150.ph = phi i64 [ %25, %.lr.ph130.preheader ], [ %ind.end, %middle.block ]
  %xtraiter = and i64 %indvars.iv150.ph, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph130.prol.loopexit, label %.lr.ph130.prol

.lr.ph130.prol:                                   ; preds = %.lr.ph130.preheader171
  %indvars.iv.next151.prol = add nsw i64 %indvars.iv150.ph, 1
  %28 = sub nsw i64 %indvars.iv.next151.prol, %25
  %29 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %indvars.iv.next151.prol
  store i64 %30, ptr %31, align 8, !tbaa !11
  %32 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %28
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %indvars.iv.next151.prol
  store i64 %33, ptr %34, align 8, !tbaa !11
  br label %.lr.ph130.prol.loopexit

.lr.ph130.prol.loopexit:                          ; preds = %.lr.ph130.prol, %.lr.ph130.preheader171
  %indvars.iv150.unr = phi i64 [ %indvars.iv150.ph, %.lr.ph130.preheader171 ], [ %indvars.iv.next151.prol, %.lr.ph130.prol ]
  %35 = add nsw i64 %wide.trip.count, -1
  %36 = icmp eq i64 %indvars.iv150.ph, %35
  br i1 %36, label %._crit_edge, label %.lr.ph130

vector.ph:                                        ; preds = %.lr.ph130.preheader
  %n.vec = and i64 %26, -4
  %ind.end = add nsw i64 %n.vec, %25
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %25
  %37 = add nsw i64 %offset.idx, 1
  %38 = sub nsw i64 %37, %25
  %39 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %wide.load = load <2 x i64>, ptr %39, align 8, !tbaa !11
  %wide.load168 = load <2 x i64>, ptr %40, align 8, !tbaa !11
  %41 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %37
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  store <2 x i64> %wide.load, ptr %41, align 8, !tbaa !11
  store <2 x i64> %wide.load168, ptr %42, align 8, !tbaa !11
  %43 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %38
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load169 = load <2 x i64>, ptr %43, align 8, !tbaa !11
  %wide.load170 = load <2 x i64>, ptr %44, align 8, !tbaa !11
  %45 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %37
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  store <2 x i64> %wide.load169, ptr %45, align 8, !tbaa !11
  store <2 x i64> %wide.load170, ptr %46, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %47 = icmp eq i64 %index.next, %n.vec
  br i1 %47, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph130.preheader171

.lr.ph127:                                        ; preds = %.preheader121, %.lr.ph127
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph127 ], [ 1, %.preheader121 ]
  %48 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %indvars.iv147
  %49 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %48)
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %.not104.not = icmp slt i64 %indvars.iv147, %51
  br i1 %.not104.not, label %.lr.ph127, label %.preheader120, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph130.prol.loopexit, %.lr.ph130, %middle.block, %.preheader120
  store i32 %24, ptr @n, align 4, !tbaa !5
  store i64 0, ptr getelementptr inbounds (i8, ptr @d, i64 8), align 8, !tbaa !11
  %.not106132 = icmp slt i32 %.lcssa122, 1
  br i1 %.not106132, label %._crit_edge139, label %.lr.ph135.preheader

.lr.ph135.preheader:                              ; preds = %._crit_edge
  %smax = tail call i32 @llvm.smax.i32(i32 %24, i32 2)
  %52 = zext nneg i32 %smax to i64
  %53 = add nsw i64 %52, -1
  %54 = add nsw i64 %52, -2
  %xtraiter173 = and i64 %53, 3
  %55 = icmp ult i64 %54, 3
  br i1 %55, label %.lr.ph135.epil.preheader, label %.lr.ph135.preheader.new

.lr.ph135.preheader.new:                          ; preds = %.lr.ph135.preheader
  %unroll_iter = and i64 %53, -4
  br label %.lr.ph135

.lr.ph130:                                        ; preds = %.lr.ph130.prol.loopexit, %.lr.ph130
  %indvars.iv150 = phi i64 [ %indvars.iv.next151.1, %.lr.ph130 ], [ %indvars.iv150.unr, %.lr.ph130.prol.loopexit ]
  %indvars.iv.next151 = add nsw i64 %indvars.iv150, 1
  %56 = sub nsw i64 %indvars.iv.next151, %25
  %57 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %indvars.iv.next151
  store i64 %58, ptr %59, align 8, !tbaa !11
  %60 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %56
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %indvars.iv.next151
  store i64 %61, ptr %62, align 8, !tbaa !11
  %indvars.iv.next151.1 = add nsw i64 %indvars.iv150, 2
  %63 = sub nsw i64 %indvars.iv.next151.1, %25
  %64 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %indvars.iv.next151.1
  store i64 %65, ptr %66, align 8, !tbaa !11
  %67 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %63
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %indvars.iv.next151.1
  store i64 %68, ptr %69, align 8, !tbaa !11
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next151.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph130, !llvm.loop !17

.lr.ph135.epil.preheader:                         ; preds = %.lr.ph135.preheader, %.lr.ph135
  %.unr = phi i64 [ 0, %.lr.ph135.preheader ], [ %95, %.lr.ph135 ]
  %indvars.iv153.unr = phi i64 [ 2, %.lr.ph135.preheader ], [ %indvars.iv.next154.3, %.lr.ph135 ]
  br label %.lr.ph135.epil

.lr.ph135.epil:                                   ; preds = %.lr.ph135.epil, %.lr.ph135.epil.preheader
  %70 = phi i64 [ %.unr, %.lr.ph135.epil.preheader ], [ %74, %.lr.ph135.epil ]
  %indvars.iv153.epil = phi i64 [ %indvars.iv153.unr, %.lr.ph135.epil.preheader ], [ %indvars.iv.next154.epil, %.lr.ph135.epil ]
  %epil.iter = phi i64 [ 0, %.lr.ph135.epil.preheader ], [ %epil.iter.next, %.lr.ph135.epil ]
  %71 = add nsw i64 %indvars.iv153.epil, -1
  %72 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = add nsw i64 %73, %70
  %75 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv153.epil
  store i64 %74, ptr %75, align 8, !tbaa !11
  %indvars.iv.next154.epil = add nuw nsw i64 %indvars.iv153.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter173
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph135.epil, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph135.epil
  br i1 %.not106132, label %._crit_edge139, label %.lr.ph138.preheader

.lr.ph138.preheader:                              ; preds = %.preheader
  %smax161 = tail call i32 @llvm.smax.i32(i32 %24, i32 1)
  %76 = add nuw nsw i32 %smax161, 1
  %wide.trip.count162 = zext nneg i32 %76 to i64
  br label %.lr.ph138

.lr.ph135:                                        ; preds = %.lr.ph135, %.lr.ph135.preheader.new
  %77 = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %95, %.lr.ph135 ]
  %indvars.iv153 = phi i64 [ 2, %.lr.ph135.preheader.new ], [ %indvars.iv.next154.3, %.lr.ph135 ]
  %niter = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %niter.next.3, %.lr.ph135 ]
  %78 = add nsw i64 %indvars.iv153, -1
  %79 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !11
  %81 = add nsw i64 %80, %77
  %82 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv153
  store i64 %81, ptr %82, align 16, !tbaa !11
  %indvars.iv.next154 = or disjoint i64 %indvars.iv153, 1
  %83 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %indvars.iv153
  %84 = load i64, ptr %83, align 16, !tbaa !11
  %85 = add nsw i64 %84, %81
  %86 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv.next154
  store i64 %85, ptr %86, align 8, !tbaa !11
  %indvars.iv.next154.1 = add nuw nsw i64 %indvars.iv153, 2
  %87 = or disjoint i64 %indvars.iv153, 1
  %88 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = add nsw i64 %89, %85
  %91 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv.next154.1
  store i64 %90, ptr %91, align 16, !tbaa !11
  %indvars.iv.next154.2 = add nuw nsw i64 %indvars.iv153, 3
  %92 = add nuw nsw i64 %indvars.iv153, 2
  %93 = getelementptr inbounds [200100 x i64], ptr @dst, i64 0, i64 %92
  %94 = load i64, ptr %93, align 16, !tbaa !11
  %95 = add nsw i64 %94, %90
  %96 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv.next154.2
  store i64 %95, ptr %96, align 8, !tbaa !11
  %indvars.iv.next154.3 = add nuw nsw i64 %indvars.iv153, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.lr.ph135.epil.preheader, label %.lr.ph135, !llvm.loop !20

._crit_edge139:                                   ; preds = %.lr.ph138, %._crit_edge, %.preheader
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store ptr %1, ptr %2, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #8
  %97 = sext i32 %24 to i64
  %98 = getelementptr inbounds %struct.Node, ptr @hplusd, i64 %97
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  invoke void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72) %3, ptr noundef nonnull @hplusd, ptr noundef nonnull %98, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %110 unwind label %121

.lr.ph138:                                        ; preds = %.lr.ph138.preheader, %.lr.ph138
  %indvars.iv158 = phi i64 [ 1, %.lr.ph138.preheader ], [ %indvars.iv.next159, %.lr.ph138 ]
  %99 = getelementptr inbounds [200100 x i64], ptr @h, i64 0, i64 %indvars.iv158
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = shl nsw i64 %100, 1
  %102 = getelementptr inbounds [200100 x i64], ptr @d, i64 0, i64 %indvars.iv158
  %103 = load i64, ptr %102, align 8, !tbaa !11
  %104 = add nsw i64 %101, %103
  %105 = add nsw i64 %indvars.iv158, -1
  %106 = getelementptr inbounds [200100 x %struct.Node], ptr @hplusd, i64 0, i64 %105
  store i64 %104, ptr %106, align 16, !tbaa !11
  %.sroa.442.0..sroa_idx = getelementptr inbounds i8, ptr %106, i64 8
  %107 = trunc nuw nsw i64 %105 to i32
  store i32 %107, ptr %.sroa.442.0..sroa_idx, align 8, !tbaa !5
  %.sroa.543.0..sroa_idx = getelementptr inbounds i8, ptr %106, i64 12
  store i32 -1, ptr %.sroa.543.0..sroa_idx, align 4, !tbaa !5
  %108 = sub nsw i64 %101, %103
  %109 = getelementptr inbounds [200100 x %struct.Node], ptr @hminusd, i64 0, i64 %105
  store i64 %108, ptr %109, align 16, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %109, i64 8
  store i32 %107, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  %.sroa.540.0..sroa_idx = getelementptr inbounds i8, ptr %109, i64 12
  store i32 -1, ptr %.sroa.540.0..sroa_idx, align 4, !tbaa !5
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %exitcond163.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count162
  br i1 %exitcond163.not, label %._crit_edge139, label %.lr.ph138, !llvm.loop !23

110:                                              ; preds = %._crit_edge139
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #8
  %111 = load i32, ptr @n, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.Node, ptr @hminusd, i64 %112
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #8
  call void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  invoke void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72) %5, ptr noundef nonnull @hminusd, ptr noundef nonnull %113, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %114 unwind label %123

114:                                              ; preds = %110
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %115 = load i32, ptr @q, align 4, !tbaa !5
  %116 = icmp sgt i32 %115, 0
  br i1 %116, label %.lr.ph144, label %._crit_edge145

.lr.ph144:                                        ; preds = %114
  %117 = getelementptr inbounds i8, ptr %11, i64 8
  %118 = getelementptr inbounds i8, ptr %12, i64 8
  %119 = getelementptr inbounds i8, ptr %14, i64 8
  %120 = getelementptr inbounds i8, ptr %15, i64 8
  br label %125

._crit_edge145:                                   ; preds = %269, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %5) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %3) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #8
  ret i32 0

121:                                              ; preds = %._crit_edge139
  %122 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %278

123:                                              ; preds = %110
  %124 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #8
  br label %277

125:                                              ; preds = %.lr.ph144, %269
  %.087142 = phi i32 [ 0, %.lr.ph144 ], [ %270, %269 ]
  %126 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %127 unwind label %137

127:                                              ; preds = %125
  %128 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %126, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %129 unwind label %137

129:                                              ; preds = %127
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %.not108 = icmp sgt i32 %130, %131
  %132 = add nsw i32 %130, -1
  br i1 %.not108, label %139, label %133

133:                                              ; preds = %129
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = sdiv i32 %134, 2
  %136 = add nsw i32 %132, %135
  br label %139

137:                                              ; preds = %127, %125
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %276

139:                                              ; preds = %129, %133
  %.088 = phi i32 [ %136, %133 ], [ %132, %129 ]
  %140 = add nsw i32 %.088, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  store i64 -1000000000000000000, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %141 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %3, i32 noundef %131, i32 noundef %140)
          to label %142 unwind label %146

142:                                              ; preds = %139
  %143 = extractvalue { i64, i64 } %141, 0
  %144 = extractvalue { i64, i64 } %141, 1
  %.sroa.521.12.extract.shift = lshr i64 %144, 32
  %.076 = trunc i64 %144 to i32
  %145 = icmp eq i32 %.076, -1
  br i1 %145, label %176, label %148

146:                                              ; preds = %139
  %147 = landingpad { ptr, i32 }
          cleanup
  br label %275

148:                                              ; preds = %142
  store i64 -1000000000000000000, ptr %10, align 8, !tbaa !11
  %.not112.not = icmp slt i32 %131, %.076
  br i1 %.not112.not, label %149, label %159

149:                                              ; preds = %148
  %150 = add nsw i32 %.076, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  %151 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %5, i32 noundef %131, i32 noundef %150)
          to label %152 unwind label %157

152:                                              ; preds = %149
  %153 = extractvalue { i64, i64 } %151, 0
  store i64 %153, ptr %11, align 8
  %154 = extractvalue { i64, i64 } %151, 1
  store i64 %154, ptr %117, align 8
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %156 = load i64, ptr %155, align 8, !tbaa !11
  store i64 %156, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %159

157:                                              ; preds = %179, %149
  %158 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %275

159:                                              ; preds = %152, %148
  %160 = phi i64 [ %156, %152 ], [ -1000000000000000000, %148 ]
  %.not113.not = icmp sgt i32 %140, %.076
  br i1 %.not113.not, label %161, label %171

161:                                              ; preds = %159
  %162 = add nuw nsw i32 %.076, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #8
  %163 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %5, i32 noundef %162, i32 noundef %140)
          to label %164 unwind label %169

164:                                              ; preds = %161
  %165 = extractvalue { i64, i64 } %163, 0
  store i64 %165, ptr %12, align 8
  %166 = extractvalue { i64, i64 } %163, 1
  store i64 %166, ptr %118, align 8
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %168 = load i64, ptr %167, align 8, !tbaa !11
  store i64 %168, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #8
  br label %171

169:                                              ; preds = %189, %161
  %170 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #8
  br label %275

171:                                              ; preds = %164, %159
  %172 = phi i64 [ %168, %164 ], [ %160, %159 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %173 = add nsw i64 %172, %143
  store i64 %173, ptr %13, align 8, !tbaa !11
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %175 = load i64, ptr %174, align 8, !tbaa !11
  store i64 %175, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  br label %176

176:                                              ; preds = %142, %171
  %.076.1 = trunc nuw i64 %.sroa.521.12.extract.shift to i32
  %177 = icmp eq i64 %.sroa.521.12.extract.shift, 4294967295
  br i1 %177, label %202, label %178

178:                                              ; preds = %176
  store i64 -1000000000000000000, ptr %10, align 8, !tbaa !11
  %.not112.not.1 = icmp slt i32 %131, %.076.1
  br i1 %.not112.not.1, label %179, label %187

179:                                              ; preds = %178
  %180 = add nsw i32 %.076.1, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #8
  %181 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %5, i32 noundef %131, i32 noundef %180)
          to label %182 unwind label %157

182:                                              ; preds = %179
  %183 = extractvalue { i64, i64 } %181, 0
  store i64 %183, ptr %11, align 8
  %184 = extractvalue { i64, i64 } %181, 1
  store i64 %184, ptr %117, align 8
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %186 = load i64, ptr %185, align 8, !tbaa !11
  store i64 %186, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #8
  br label %187

187:                                              ; preds = %182, %178
  %188 = phi i64 [ %186, %182 ], [ -1000000000000000000, %178 ]
  %.not113.not.1 = icmp sgt i32 %140, %.076.1
  br i1 %.not113.not.1, label %189, label %197

189:                                              ; preds = %187
  %190 = add nuw nsw i32 %.076.1, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #8
  %191 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %5, i32 noundef %190, i32 noundef %140)
          to label %192 unwind label %169

192:                                              ; preds = %189
  %193 = extractvalue { i64, i64 } %191, 0
  store i64 %193, ptr %12, align 8
  %194 = extractvalue { i64, i64 } %191, 1
  store i64 %194, ptr %118, align 8
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %196 = load i64, ptr %195, align 8, !tbaa !11
  store i64 %196, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #8
  br label %197

197:                                              ; preds = %192, %187
  %198 = phi i64 [ %196, %192 ], [ %188, %187 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #8
  %199 = add nsw i64 %198, %143
  store i64 %199, ptr %13, align 8, !tbaa !11
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %201 = load i64, ptr %200, align 8, !tbaa !11
  store i64 %201, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #8
  br label %202

202:                                              ; preds = %197, %176
  %203 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %5, i32 noundef %131, i32 noundef %140)
          to label %204 unwind label %208

204:                                              ; preds = %202
  %205 = extractvalue { i64, i64 } %203, 0
  %206 = extractvalue { i64, i64 } %203, 1
  %.sroa.519.12.extract.shift = lshr i64 %206, 32
  %.1 = trunc i64 %206 to i32
  %207 = icmp eq i32 %.1, -1
  br i1 %207, label %238, label %210

208:                                              ; preds = %202
  %209 = landingpad { ptr, i32 }
          cleanup
  br label %275

210:                                              ; preds = %204
  store i64 -1000000000000000000, ptr %10, align 8, !tbaa !11
  %.not109.not = icmp slt i32 %131, %.1
  br i1 %.not109.not, label %211, label %221

211:                                              ; preds = %210
  %212 = add nsw i32 %.1, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  %213 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %3, i32 noundef %131, i32 noundef %212)
          to label %214 unwind label %219

214:                                              ; preds = %211
  %215 = extractvalue { i64, i64 } %213, 0
  store i64 %215, ptr %14, align 8
  %216 = extractvalue { i64, i64 } %213, 1
  store i64 %216, ptr %119, align 8
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %218 = load i64, ptr %217, align 8, !tbaa !11
  store i64 %218, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  br label %221

219:                                              ; preds = %241, %211
  %220 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  br label %275

221:                                              ; preds = %214, %210
  %222 = phi i64 [ %218, %214 ], [ -1000000000000000000, %210 ]
  %.not110.not = icmp sgt i32 %140, %.1
  br i1 %.not110.not, label %223, label %233

223:                                              ; preds = %221
  %224 = add nuw nsw i32 %.1, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #8
  %225 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %3, i32 noundef %224, i32 noundef %140)
          to label %226 unwind label %231

226:                                              ; preds = %223
  %227 = extractvalue { i64, i64 } %225, 0
  store i64 %227, ptr %15, align 8
  %228 = extractvalue { i64, i64 } %225, 1
  store i64 %228, ptr %120, align 8
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %230 = load i64, ptr %229, align 8, !tbaa !11
  store i64 %230, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  br label %233

231:                                              ; preds = %251, %223
  %232 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  br label %275

233:                                              ; preds = %226, %221
  %234 = phi i64 [ %230, %226 ], [ %222, %221 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  %235 = add nsw i64 %234, %205
  store i64 %235, ptr %16, align 8, !tbaa !11
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %237 = load i64, ptr %236, align 8, !tbaa !11
  store i64 %237, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %238

238:                                              ; preds = %204, %233
  %.1.1 = trunc nuw i64 %.sroa.519.12.extract.shift to i32
  %239 = icmp eq i64 %.sroa.519.12.extract.shift, 4294967295
  br i1 %239, label %._crit_edge164, label %240

._crit_edge164:                                   ; preds = %238
  %.pre = load i64, ptr %9, align 8, !tbaa !11
  br label %264

240:                                              ; preds = %238
  store i64 -1000000000000000000, ptr %10, align 8, !tbaa !11
  %.not109.not.1 = icmp slt i32 %131, %.1.1
  br i1 %.not109.not.1, label %241, label %249

241:                                              ; preds = %240
  %242 = add nsw i32 %.1.1, -1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #8
  %243 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %3, i32 noundef %131, i32 noundef %242)
          to label %244 unwind label %219

244:                                              ; preds = %241
  %245 = extractvalue { i64, i64 } %243, 0
  store i64 %245, ptr %14, align 8
  %246 = extractvalue { i64, i64 } %243, 1
  store i64 %246, ptr %119, align 8
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %248 = load i64, ptr %247, align 8, !tbaa !11
  store i64 %248, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #8
  br label %249

249:                                              ; preds = %244, %240
  %250 = phi i64 [ %248, %244 ], [ -1000000000000000000, %240 ]
  %.not110.not.1 = icmp sgt i32 %140, %.1.1
  br i1 %.not110.not.1, label %251, label %259

251:                                              ; preds = %249
  %252 = add nuw nsw i32 %.1.1, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #8
  %253 = invoke { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72) %3, i32 noundef %252, i32 noundef %140)
          to label %254 unwind label %231

254:                                              ; preds = %251
  %255 = extractvalue { i64, i64 } %253, 0
  store i64 %255, ptr %15, align 8
  %256 = extractvalue { i64, i64 } %253, 1
  store i64 %256, ptr %120, align 8
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %258 = load i64, ptr %257, align 8, !tbaa !11
  store i64 %258, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #8
  br label %259

259:                                              ; preds = %254, %249
  %260 = phi i64 [ %258, %254 ], [ %250, %249 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  %261 = add nsw i64 %260, %205
  store i64 %261, ptr %16, align 8, !tbaa !11
  %262 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %263 = load i64, ptr %262, align 8, !tbaa !11
  store i64 %263, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %264

264:                                              ; preds = %._crit_edge164, %259
  %265 = phi i64 [ %.pre, %._crit_edge164 ], [ %263, %259 ]
  %266 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %265)
          to label %267 unwind label %273

267:                                              ; preds = %264
  %268 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %266, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %269 unwind label %273

269:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  %270 = add nuw nsw i32 %.087142, 1
  %271 = load i32, ptr @q, align 4, !tbaa !5
  %272 = icmp slt i32 %270, %271
  br i1 %272, label %125, label %._crit_edge145, !llvm.loop !24

273:                                              ; preds = %267, %264
  %274 = landingpad { ptr, i32 }
          cleanup
  br label %275

275:                                              ; preds = %219, %231, %157, %169, %273, %208, %146
  %.pn114.pn = phi { ptr, i32 } [ %274, %273 ], [ %209, %208 ], [ %147, %146 ], [ %170, %169 ], [ %158, %157 ], [ %232, %231 ], [ %220, %219 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  br label %276

276:                                              ; preds = %275, %137
  %.pn114.pn.pn = phi { ptr, i32 } [ %.pn114.pn, %275 ], [ %138, %137 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %5) #8
  br label %277

277:                                              ; preds = %276, %123
  %.pn114.pn.pn.pn = phi { ptr, i32 } [ %.pn114.pn.pn, %276 ], [ %124, %123 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #8
  call void @_ZN10RangeQueryI4NodeED2Ev(ptr noundef nonnull align 8 dereferenceable(72) %3) #8
  br label %278

278:                                              ; preds = %277, %121
  %.pn114.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn114.pn.pn.pn, %277 ], [ %122, %121 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn114.pn.pn.pn.pn
}

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

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 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 nounwind uwtable
declare hidden void @"_ZNSt8functionIF4NodeS0_S0_EEC2IRZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10RangeQueryI4NodeEC2IPS0_EET_S4_RKSt8functionIFS0_S0_S0_EE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZN10RangeQueryI4NodeE5queryEii(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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