; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2012-13/Open 2013/13 Open G2.ll (Z5comb1ii)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@ad = external dso_local global [100001 x i32], align 16
@loc = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"class.std::map"], align 16
@neg = external dso_local global [100001 x %"class.std::map"], align 16
@a2 = external dso_local global i64, align 8

; 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 ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5comb1ii(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca %"struct.std::pair", align 4
  %32 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100001 x i32], ptr @loc, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100001 x i32], ptr @loc, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %42
  store ptr %43, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %44 = load ptr, ptr %7, align 8, !tbaa !9
  %45 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %44) #3
  %46 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %47 = load ptr, ptr %7, align 8, !tbaa !9
  %48 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %47) #3
  %49 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  br label %50

50:                                               ; preds = %106, %2
  %51 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  br i1 %51, label %53, label %52

52:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %108

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %54 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %58 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = sub nsw i32 0, %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sub nsw i32 %60, %64
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sub nsw i32 %65, %69
  store i32 %70, ptr %12, align 4, !tbaa !5
  %71 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %57, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %72 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %74
  %76 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %75) #3
  %77 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %13, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br i1 %78, label %79, label %105

79:                                               ; preds = %53
  %80 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !13
  %82 = sext i32 %81 to i64
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %86 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = sub nsw i32 0, %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub nsw i32 %88, %92
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sub nsw i32 %93, %97
  store i32 %98, ptr %14, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %85, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = mul nsw i64 %82, %101
  %103 = load i64, ptr @a2, align 8, !tbaa !14
  %104 = add nsw i64 %103, %102
  store i64 %104, ptr @a2, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %105

105:                                              ; preds = %79, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %106

106:                                              ; preds = %105
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  br label %50

108:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %110
  store ptr %111, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %112 = load ptr, ptr %15, align 8, !tbaa !9
  %113 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %112) #3
  %114 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %115 = load ptr, ptr %15, align 8, !tbaa !9
  %116 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %115) #3
  %117 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  br label %118

118:                                              ; preds = %174, %108
  %119 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  br i1 %119, label %121, label %120

120:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %176

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %122 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %122)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %126 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 0
  %127 = load i32, ptr %126, align 4, !tbaa !11
  %128 = sub nsw i32 0, %127
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sub nsw i32 %128, %132
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sub nsw i32 %133, %137
  store i32 %138, ptr %20, align 4, !tbaa !5
  %139 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %125, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %140 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %139, ptr %140, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %142
  %144 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %143) #3
  %145 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %144, ptr %145, align 8
  %146 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br i1 %146, label %147, label %173

147:                                              ; preds = %121
  %148 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !13
  %150 = sext i32 %149 to i64
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %154 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 0
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = sub nsw i32 0, %155
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sub nsw i32 %156, %160
  %162 = load i32, ptr %6, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sub nsw i32 %161, %165
  store i32 %166, ptr %22, align 4, !tbaa !5
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %153, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = mul nsw i64 %150, %169
  %171 = load i64, ptr @a2, align 8, !tbaa !14
  %172 = add nsw i64 %171, %170
  store i64 %172, ptr @a2, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %173

173:                                              ; preds = %147, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %174

174:                                              ; preds = %173
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #3
  br label %118

176:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %178
  store ptr %179, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %180 = load ptr, ptr %23, align 8, !tbaa !9
  %181 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %180) #3
  %182 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %183 = load ptr, ptr %23, align 8, !tbaa !9
  %184 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %183) #3
  %185 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %184, ptr %185, align 8
  br label %186

186:                                              ; preds = %211, %176
  %187 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #3
  br i1 %187, label %189, label %188

188:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %213

189:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %190 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(8) %190)
  %191 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !13
  %193 = load i32, ptr %6, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %196 = getelementptr inbounds %"struct.std::pair", ptr %26, i32 0, i32 0
  %197 = load i32, ptr %196, align 4, !tbaa !11
  %198 = load i32, ptr %5, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = add nsw i32 %197, %201
  %203 = load i32, ptr %6, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sub nsw i32 %202, %206
  store i32 %207, ptr %27, align 4, !tbaa !5
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %195, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = add nsw i32 %209, %192
  store i32 %210, ptr %208, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  br label %211

211:                                              ; preds = %189
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #3
  br label %186

213:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %214 = load i32, ptr %5, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %215
  store ptr %216, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %217 = load ptr, ptr %28, align 8, !tbaa !9
  %218 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %217) #3
  %219 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %29, i32 0, i32 0
  store ptr %218, ptr %219, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %220 = load ptr, ptr %28, align 8, !tbaa !9
  %221 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %220) #3
  %222 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %221, ptr %222, align 8
  br label %223

223:                                              ; preds = %248, %213
  %224 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #3
  br i1 %224, label %226, label %225

225:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  br label %250

226:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  %227 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %31, ptr noundef nonnull align 4 dereferenceable(8) %227)
  %228 = getelementptr inbounds %"struct.std::pair", ptr %31, i32 0, i32 1
  %229 = load i32, ptr %228, align 4, !tbaa !13
  %230 = load i32, ptr %6, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  %233 = getelementptr inbounds %"struct.std::pair", ptr %31, i32 0, i32 0
  %234 = load i32, ptr %233, align 4, !tbaa !11
  %235 = load i32, ptr %5, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = add nsw i32 %234, %238
  %240 = load i32, ptr %6, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sub nsw i32 %239, %243
  store i32 %244, ptr %32, align 4, !tbaa !5
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %232, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = add nsw i32 %246, %229
  store i32 %247, ptr %245, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  br label %248

248:                                              ; preds = %226
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #3
  br label %223

250:                                              ; preds = %225
  %251 = load i32, ptr %5, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %252
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %253) #3
  %254 = load i32, ptr %5, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %255
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %256) #3
  %257 = load i32, ptr %6, align 4, !tbaa !5
  %258 = load i32, ptr %3, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [100001 x i32], ptr @loc, i64 0, i64 %259
  store i32 %257, ptr %260, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@ad = external dso_local local_unnamed_addr global [100001 x i32], align 16
@loc = external dso_local local_unnamed_addr global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"class.std::map"], align 16
@neg = external dso_local global [100001 x %"class.std::map"], align 16
@a2 = external dso_local local_unnamed_addr global i64, align 8

; 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 ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5comb1ii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca i32, align 4
  %25 = sext i32 %0 to i64
  %26 = getelementptr inbounds [100001 x i32], ptr @loc, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %1 to i64
  %29 = getelementptr inbounds [100001 x i32], ptr @loc, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %27 to i64
  %32 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %33 = tail call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  store ptr %33, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %34 = tail call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  store ptr %34, ptr %4, align 8
  %35 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %36 = sext i32 %30 to i64
  %37 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %36
  %38 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %31
  %39 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %36
  %40 = getelementptr inbounds i8, ptr %5, i64 4
  br label %50

._crit_edge:                                      ; preds = %76, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  %41 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %42 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %41) #3
  store ptr %42, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  %43 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %41) #3
  store ptr %43, ptr %11, align 8
  %44 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  br i1 %44, label %.lr.ph39, label %._crit_edge40

.lr.ph39:                                         ; preds = %._crit_edge
  %45 = sext i32 %30 to i64
  %46 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %45
  %47 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %31
  %48 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %45
  %49 = getelementptr inbounds i8, ptr %12, i64 4
  br label %87

50:                                               ; preds = %.lr.ph, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %51)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = load i32, ptr %38, align 4, !tbaa !5
  %54 = add i32 %52, %53
  %55 = load i32, ptr %39, align 4, !tbaa !5
  %56 = add i32 %54, %55
  %57 = sub i32 0, %56
  store i32 %57, ptr %7, align 4, !tbaa !5
  %58 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store ptr %58, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %59 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %37) #3
  store ptr %59, ptr %8, align 8
  %60 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br i1 %60, label %61, label %76

61:                                               ; preds = %50
  %62 = load i32, ptr %40, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = load i32, ptr %38, align 4, !tbaa !5
  %66 = add i32 %64, %65
  %67 = load i32, ptr %39, align 4, !tbaa !5
  %68 = add i32 %66, %67
  %69 = sub i32 0, %68
  store i32 %69, ptr %9, align 4, !tbaa !5
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %72, %63
  %74 = load i64, ptr @a2, align 8, !tbaa !12
  %75 = add nsw i64 %73, %74
  store i64 %75, ptr @a2, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  br label %76

76:                                               ; preds = %61, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  %78 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %78, label %50, label %._crit_edge

._crit_edge40:                                    ; preds = %113, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #3
  %79 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  store ptr %79, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #3
  %80 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  store ptr %80, ptr %18, align 8
  %81 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #3
  br i1 %81, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %._crit_edge40
  %82 = getelementptr inbounds i8, ptr %19, i64 4
  %83 = sext i32 %30 to i64
  %84 = getelementptr inbounds [100001 x %"class.std::map"], ptr @pos, i64 0, i64 %83
  %85 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %31
  %86 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %83
  br label %124

87:                                               ; preds = %.lr.ph39, %113
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %88)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #3
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = load i32, ptr %47, align 4, !tbaa !5
  %91 = add i32 %89, %90
  %92 = load i32, ptr %48, align 4, !tbaa !5
  %93 = add i32 %91, %92
  %94 = sub i32 0, %93
  store i32 %94, ptr %14, align 4, !tbaa !5
  %95 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %46, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store ptr %95, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #3
  %96 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %46) #3
  store ptr %96, ptr %15, align 8
  %97 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br i1 %97, label %98, label %113

98:                                               ; preds = %87
  %99 = load i32, ptr %49, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #3
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = load i32, ptr %47, align 4, !tbaa !5
  %103 = add i32 %101, %102
  %104 = load i32, ptr %48, align 4, !tbaa !5
  %105 = add i32 %103, %104
  %106 = sub i32 0, %105
  store i32 %106, ptr %16, align 4, !tbaa !5
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %46, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %109, %100
  %111 = load i64, ptr @a2, align 8, !tbaa !12
  %112 = add nsw i64 %110, %111
  store i64 %112, ptr @a2, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #3
  br label %113

113:                                              ; preds = %98, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  %115 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  br i1 %115, label %87, label %._crit_edge40

._crit_edge43:                                    ; preds = %124, %._crit_edge40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #3
  %116 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %41) #3
  store ptr %116, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #3
  %117 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %41) #3
  store ptr %117, ptr %22, align 8
  %118 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #3
  br i1 %118, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %._crit_edge43
  %119 = getelementptr inbounds i8, ptr %23, i64 4
  %120 = sext i32 %30 to i64
  %121 = getelementptr inbounds [100001 x %"class.std::map"], ptr @neg, i64 0, i64 %120
  %122 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %31
  %123 = getelementptr inbounds [100001 x i32], ptr @ad, i64 0, i64 %120
  br label %137

124:                                              ; preds = %.lr.ph42, %124
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #3
  %125 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(8) %125)
  %126 = load i32, ptr %82, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #3
  %127 = load i32, ptr %19, align 4, !tbaa !9
  %128 = load i32, ptr %85, align 4, !tbaa !5
  %129 = add nsw i32 %128, %127
  %130 = load i32, ptr %86, align 4, !tbaa !5
  %131 = sub i32 %129, %130
  store i32 %131, ptr %20, align 4, !tbaa !5
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %84, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %133, %126
  store i32 %134, ptr %132, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #3
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #3
  %136 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #3
  br i1 %136, label %124, label %._crit_edge43

._crit_edge46:                                    ; preds = %137, %._crit_edge43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #3
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #3
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %41) #3
  store i32 %30, ptr %26, align 4, !tbaa !5
  ret void

137:                                              ; preds = %.lr.ph45, %137
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #3
  %138 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #3
  call void @_ZNSt4pairIiiEC2IKiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE18_ConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS_IS4_S5_E(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %138)
  %139 = load i32, ptr %119, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #3
  %140 = load i32, ptr %23, align 4, !tbaa !9
  %141 = load i32, ptr %122, align 4, !tbaa !5
  %142 = add nsw i32 %141, %140
  %143 = load i32, ptr %123, align 4, !tbaa !5
  %144 = sub i32 %142, %143
  store i32 %144, ptr %24, align 4, !tbaa !5
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) %121, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = add nsw i32 %146, %139
  store i32 %147, ptr %145, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #3
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #3
  %149 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #3
  br i1 %149, label %137, label %._crit_edge46
}

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}


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