; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Medium Hard/MGCHGYM/A.ll (ZN5Treap11range_queryERPNS_4nodeEiii)

; 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.std::pair" = type { ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [1565 x i64] }
%"class.std::bitset<100100>::reference" = type { ptr, i64 }
%"struct.Treap::node" = type <{ i32, i32, i32, [4 x i8], ptr, ptr, %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN5Treap4poswE = external dso_local global [10 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef, i32 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5Treap11range_queryERPNS_4nodeEiii(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.std::bitset", align 8
  %17 = alloca %"class.std::bitset<100100>::reference", align 8
  %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 %"class.std::bitset", align 8
  %24 = alloca %"class.std::bitset<100100>::reference", align 8
  %25 = alloca %"class.std::bitset", align 8
  %26 = alloca %"class.std::bitset<100100>::reference", align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::bitset<100100>::reference", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  call void @_ZNSt4pairIPN5Treap4nodeES2_EC2IS2_S2_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES6_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = call { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %30, i32 noundef %31)
  %33 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 0
  %34 = extractvalue { ptr, ptr } %32, 0
  store ptr %34, ptr %33, align 8
  %35 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 1
  %36 = extractvalue { ptr, ptr } %32, 1
  store ptr %36, ptr %35, align 8
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %13) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  %38 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  store ptr %39, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  store ptr %41, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = sub nsw i32 %43, 1
  %45 = call { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %42, i32 noundef %44)
  %46 = getelementptr inbounds { ptr, ptr }, ptr %14, i32 0, i32 0
  %47 = extractvalue { ptr, ptr } %45, 0
  store ptr %47, ptr %46, align 8
  %48 = getelementptr inbounds { ptr, ptr }, ptr %14, i32 0, i32 1
  %49 = extractvalue { ptr, ptr } %45, 1
  store ptr %49, ptr %48, align 8
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  %51 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  store ptr %52, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  store ptr %54, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.Treap::node", ptr %55, i32 0, i32 6
  store ptr %56, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12520, ptr %16) #4
  call void @_ZNSt6bitsetILm100100EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12520) %16) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #4
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<100100>::reference") align 8 %17, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef 0)
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm100100EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %17, i1 noundef zeroext true) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %126, %4
  %59 = load i32, ptr %18, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 10
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 2, ptr %19, align 4
  br label %129

62:                                               ; preds = %58
  %63 = load i32, ptr %18, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [10 x i32], ptr @_ZN5Treap4poswE, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  store i32 2, ptr %19, align 4
  br label %129

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10 x i32], ptr @_ZN5Treap4poswE, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = sdiv i32 %70, %74
  store i32 %75, ptr %21, align 4, !tbaa !9
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = load i32, ptr %18, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #4
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %79)
  %81 = load i32, ptr %80, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  store i32 %81, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 1, ptr %22, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %104, %69
  %83 = load i32, ptr %22, align 4, !tbaa !9
  %84 = load i32, ptr %20, align 4, !tbaa !9
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %86, label %105

86:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 12520, ptr %23) #4
  %87 = load i32, ptr %18, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10 x i32], ptr @_ZN5Treap4poswE, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = load i32, ptr %22, align 4, !tbaa !9
  %92 = mul nsw i32 %90, %91
  %93 = sext i32 %92 to i64
  call void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %23, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef %93) #4
  %94 = call noundef nonnull align 8 dereferenceable(12520) ptr @_ZNSt6bitsetILm100100EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(12520) %16, ptr noundef nonnull align 8 dereferenceable(12520) %23) #4
  call void @llvm.lifetime.end.p0(i64 12520, ptr %23) #4
  %95 = load i32, ptr %22, align 4, !tbaa !9
  %96 = load i32, ptr %20, align 4, !tbaa !9
  %97 = sub nsw i32 %96, %95
  store i32 %97, ptr %20, align 4, !tbaa !9
  %98 = load i32, ptr %22, align 4, !tbaa !9
  %99 = shl i32 %98, 1
  store i32 %99, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #4
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<100100>::reference") align 8 %24, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef %101)
  %102 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %24) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #4
  br i1 %102, label %103, label %104

103:                                              ; preds = %86
  br label %105

104:                                              ; preds = %86
  br label %82, !llvm.loop !14

105:                                              ; preds = %103, %82
  %106 = load i32, ptr %20, align 4, !tbaa !9
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %117

108:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 12520, ptr %25) #4
  %109 = load i32, ptr %18, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [10 x i32], ptr @_ZN5Treap4poswE, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = load i32, ptr %20, align 4, !tbaa !9
  %114 = mul nsw i32 %112, %113
  %115 = sext i32 %114 to i64
  call void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %25, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef %115) #4
  %116 = call noundef nonnull align 8 dereferenceable(12520) ptr @_ZNSt6bitsetILm100100EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(12520) %16, ptr noundef nonnull align 8 dereferenceable(12520) %25) #4
  call void @llvm.lifetime.end.p0(i64 12520, ptr %25) #4
  br label %117

117:                                              ; preds = %108, %105
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #4
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<100100>::reference") align 8 %26, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef %119)
  %120 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %26) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %26) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #4
  br i1 %120, label %121, label %122

121:                                              ; preds = %117
  store i32 2, ptr %19, align 4
  br label %123

122:                                              ; preds = %117
  store i32 0, ptr %19, align 4
  br label %123

123:                                              ; preds = %122, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %124 = load i32, ptr %19, align 4
  switch i32 %124, label %129 [
    i32 0, label %125
  ]

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %18, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %18, align 4, !tbaa !9
  br label %58, !llvm.loop !16

129:                                              ; preds = %123, %68, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %130

130:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #4
  %131 = load i32, ptr %8, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<100100>::reference") align 8 %28, ptr noundef nonnull align 8 dereferenceable(12520) %16, i64 noundef %132)
  %133 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  %134 = zext i1 %133 to i32
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #4
  store i32 %134, ptr %27, align 4, !tbaa !9
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = call noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %135, ptr noundef %136)
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %137, ptr %138, align 8, !tbaa !5
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = load ptr, ptr %139, align 8, !tbaa !5
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = call noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %140, ptr noundef %141)
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %142, ptr %143, align 8, !tbaa !5
  %144 = load i32, ptr %27, align 4, !tbaa !9
  %145 = icmp ne i32 %144, 0
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 12520, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret i1 %145
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<100100>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(12520), i64 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(12520), i64 noundef) #1 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIPN5Treap4nodeES2_E", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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.std::pair" = type { ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [1565 x i64] }
%"class.std::bitset<100100>::reference" = type { ptr, i64 }

@_ZN5Treap4poswE = external dso_local local_unnamed_addr global [10 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5Treap11range_queryERPNS_4nodeEiii(ptr nocapture noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"class.std::bitset", align 8
  %9 = alloca %"class.std::bitset<100100>::reference", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::bitset", align 8
  %12 = alloca %"class.std::bitset<100100>::reference", align 8
  %13 = alloca %"class.std::bitset", align 8
  %14 = alloca %"class.std::bitset<100100>::reference", align 8
  %15 = alloca %"class.std::bitset<100100>::reference", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  call void @_ZNSt4pairIPN5Treap4nodeES2_EC2IS2_S2_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES6_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = call { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %16, i32 noundef %2)
  %18 = extractvalue { ptr, ptr } %17, 0
  store ptr %18, ptr %6, align 8
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  %20 = extractvalue { ptr, ptr } %17, 1
  store ptr %20, ptr %19, align 8
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %5, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %25 = add nsw i32 %1, -1
  %26 = call { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %22, i32 noundef %25)
  %27 = extractvalue { ptr, ptr } %26, 0
  store ptr %27, ptr %7, align 8
  %28 = getelementptr inbounds i8, ptr %7, i64 8
  %29 = extractvalue { ptr, ptr } %26, 1
  store ptr %29, ptr %28, align 8
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = load ptr, ptr %23, align 8, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  call void @llvm.lifetime.start.p0(i64 12520, ptr nonnull %8) #4
  call void @_ZNSt6bitsetILm100100EEC2Ev(ptr noundef nonnull align 8 dereferenceable(12520) %8) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<100100>::reference") align 8 %9, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef 0)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm100100EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %9, i1 noundef zeroext true) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  %35 = sext i32 %3 to i64
  br label %36

36:                                               ; preds = %59, %4
  %indvars.iv = phi i64 [ 0, %4 ], [ %indvars.iv.next, %59 ]
  %37 = getelementptr inbounds [10 x i32], ptr @_ZN5Treap4poswE, i64 0, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !12
  %.not = icmp eq i32 %38, 0
  br i1 %.not, label %61, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %40 = sdiv i32 %3, %38
  store i32 %40, ptr %10, align 4, !tbaa !12
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %indvars.iv) #4
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %42, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %44

44:                                               ; preds = %45, %39
  %.032 = phi i32 [ %43, %39 ], [ %50, %45 ]
  %.0 = phi i32 [ 1, %39 ], [ %51, %45 ]
  %.not35 = icmp sgt i32 %.0, %.032
  br i1 %.not35, label %53, label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12520, ptr nonnull %11) #4
  %46 = load i32, ptr %37, align 4, !tbaa !12
  %47 = mul nsw i32 %46, %.0
  %48 = sext i32 %47 to i64
  call void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %11, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef %48) #4
  %49 = call noundef nonnull align 8 dereferenceable(12520) ptr @_ZNSt6bitsetILm100100EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(12520) %8, ptr noundef nonnull align 8 dereferenceable(12520) %11) #4
  call void @llvm.lifetime.end.p0(i64 12520, ptr nonnull %11) #4
  %50 = sub nsw i32 %.032, %.0
  %51 = shl i32 %.0, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #4
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<100100>::reference") align 8 %12, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef %35)
  %52 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #4
  br i1 %52, label %53, label %44, !llvm.loop !14

53:                                               ; preds = %45, %44
  %.1 = phi i32 [ %50, %45 ], [ %.032, %44 ]
  %.not36 = icmp eq i32 %.1, 0
  br i1 %.not36, label %59, label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 12520, ptr nonnull %13) #4
  %55 = load i32, ptr %37, align 4, !tbaa !12
  %56 = mul nsw i32 %55, %.1
  %57 = sext i32 %56 to i64
  call void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %13, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef %57) #4
  %58 = call noundef nonnull align 8 dereferenceable(12520) ptr @_ZNSt6bitsetILm100100EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(12520) %8, ptr noundef nonnull align 8 dereferenceable(12520) %13) #4
  call void @llvm.lifetime.end.p0(i64 12520, ptr nonnull %13) #4
  br label %59

59:                                               ; preds = %54, %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<100100>::reference") align 8 %14, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef %35)
  %60 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10
  %or.cond = select i1 %60, i1 true, i1 %exitcond.not
  br i1 %or.cond, label %61, label %36, !llvm.loop !16

61:                                               ; preds = %36, %59
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #4
  call void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<100100>::reference") align 8 %15, ptr noundef nonnull align 8 dereferenceable(12520) %8, i64 noundef %35)
  %62 = call noundef zeroext i1 @_ZNKSt6bitsetILm100100EE9referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  call void @_ZNSt6bitsetILm100100EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #4
  %63 = call noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %31, ptr noundef %32)
  store ptr %63, ptr %0, align 8, !tbaa !5
  %64 = call noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %63, ptr noundef %24)
  store ptr %64, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12520, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  ret i1 %62
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm100100EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<100100>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(12520), i64 noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm100100EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(12520), i64 noundef) local_unnamed_addr #1 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIPN5Treap4nodeES2_E", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass