; LLVM IR from VastoLorde95/Competitive-Programming :: Timus/1276/A.ll (Z5solveiiiii)

; 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<std::vector<int>, std::pair<const std::vector<int>, long long>, std::_Select1st<std::pair<const std::vector<int>, long long>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, long long>, std::_Select1st<std::pair<const std::vector<int>, long long>>, std::less<std::vector<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 }
%"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 }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator.3" = type { i8 }

@dp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2okiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solveiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca %"class.std::initializer_list", align 8
  %14 = alloca [5 x i32], align 4
  %15 = alloca %"class.std::allocator.3", align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca %"class.std::initializer_list", align 8
  %20 = alloca [5 x i32], align 4
  %21 = alloca %"class.std::allocator.3", align 1
  %22 = alloca ptr, align 8
  %23 = alloca %"class.std::vector", align 8
  %24 = alloca %"class.std::initializer_list", align 8
  %25 = alloca [5 x i32], align 4
  %26 = alloca %"class.std::allocator.3", align 1
  %27 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr %14) #3
  %28 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %28, ptr %14, align 4, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %14, i64 1
  %30 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %30, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %14, i64 2
  %32 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds i32, ptr %14, i64 3
  %34 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %34, ptr %33, align 4, !tbaa !5
  %35 = getelementptr inbounds i32, ptr %14, i64 4
  %36 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %36, ptr %35, align 4, !tbaa !5
  %37 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 0
  store ptr %14, ptr %37, align 8, !tbaa !9
  %38 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 1
  store i64 5, ptr %38, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  %39 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8
  %41 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %42 = load i64, ptr %41, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr %40, i64 %42, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %43 unwind label %67

43:                                               ; preds = %5
  %44 = invoke noundef i64 @_ZNKSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %45 unwind label %71

45:                                               ; preds = %43
  %46 = icmp ne i64 %44, 0
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  br i1 %46, label %47, label %85

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr %20) #3
  %48 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %48, ptr %20, align 4, !tbaa !5
  %49 = getelementptr inbounds i32, ptr %20, i64 1
  %50 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %50, ptr %49, align 4, !tbaa !5
  %51 = getelementptr inbounds i32, ptr %20, i64 2
  %52 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %52, ptr %51, align 4, !tbaa !5
  %53 = getelementptr inbounds i32, ptr %20, i64 3
  %54 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %54, ptr %53, align 4, !tbaa !5
  %55 = getelementptr inbounds i32, ptr %20, i64 4
  %56 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %56, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 0
  store ptr %20, ptr %57, align 8, !tbaa !9
  %58 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 1
  store i64 5, ptr %58, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  %59 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8
  %61 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %62 = load i64, ptr %61, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr %60, i64 %62, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %63 unwind label %76

63:                                               ; preds = %47
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEEixEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %65 unwind label %80

65:                                               ; preds = %63
  %66 = load i64, ptr %64, align 8, !tbaa !14
  store i64 %66, ptr %6, align 8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #3
  br label %210

67:                                               ; preds = %5
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %16, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %17, align 4
  br label %75

71:                                               ; preds = %43
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %16, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %17, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  br label %212

76:                                               ; preds = %47
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %16, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %17, align 4
  br label %84

80:                                               ; preds = %63
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %16, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %17, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  br label %84

84:                                               ; preds = %80, %76
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #3
  br label %212

85:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr %25) #3
  %86 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %86, ptr %25, align 4, !tbaa !5
  %87 = getelementptr inbounds i32, ptr %25, i64 1
  %88 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %88, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds i32, ptr %25, i64 2
  %90 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %90, ptr %89, align 4, !tbaa !5
  %91 = getelementptr inbounds i32, ptr %25, i64 3
  %92 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %92, ptr %91, align 4, !tbaa !5
  %93 = getelementptr inbounds i32, ptr %25, i64 4
  %94 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %94, ptr %93, align 4, !tbaa !5
  %95 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 0
  store ptr %25, ptr %95, align 8, !tbaa !9
  %96 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 1
  store i64 5, ptr %96, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  %97 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %100 = load i64, ptr %99, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr %98, i64 %100, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %101 unwind label %121

101:                                              ; preds = %85
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEEixEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %103 unwind label %125

103:                                              ; preds = %101
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #3
  store ptr %102, ptr %22, align 8, !tbaa !16
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = add nsw i32 %108, %109
  %111 = icmp eq i32 %110, 1
  br i1 %111, label %112, label %130

112:                                              ; preds = %103
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = call noundef i32 @_Z2okiiiii(i32 noundef %113, i32 noundef %114, i32 noundef %115, i32 noundef %116, i32 noundef %117)
  %119 = sext i32 %118 to i64
  %120 = load ptr, ptr %22, align 8, !tbaa !16
  store i64 %119, ptr %120, align 8, !tbaa !14
  store i64 %119, ptr %6, align 8
  store i32 1, ptr %27, align 4
  br label %209

121:                                              ; preds = %85
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %16, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %17, align 4
  br label %129

125:                                              ; preds = %101
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %16, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %17, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #3
  br label %129

129:                                              ; preds = %125, %121
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %212

130:                                              ; preds = %103
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %149

133:                                              ; preds = %130
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %139, label %136

136:                                              ; preds = %133
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = icmp eq i32 %137, 1
  br i1 %138, label %139, label %149

139:                                              ; preds = %136, %133
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = load i32, ptr %10, align 4, !tbaa !5
  %145 = call noundef i64 @_Z5solveiiiii(i32 noundef %141, i32 noundef %142, i32 noundef %143, i32 noundef %144, i32 noundef 0)
  %146 = load ptr, ptr %22, align 8, !tbaa !16
  %147 = load i64, ptr %146, align 8, !tbaa !14
  %148 = add nsw i64 %147, %145
  store i64 %148, ptr %146, align 8, !tbaa !14
  br label %149

149:                                              ; preds = %139, %136, %130
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %168

152:                                              ; preds = %149
  %153 = load i32, ptr %11, align 4, !tbaa !5
  %154 = icmp eq i32 %153, 2
  br i1 %154, label %158, label %155

155:                                              ; preds = %152
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = icmp eq i32 %156, 3
  br i1 %157, label %158, label %168

158:                                              ; preds = %155, %152
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = load i32, ptr %9, align 4, !tbaa !5
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = call noundef i64 @_Z5solveiiiii(i32 noundef %159, i32 noundef %161, i32 noundef %162, i32 noundef %163, i32 noundef 1)
  %165 = load ptr, ptr %22, align 8, !tbaa !16
  %166 = load i64, ptr %165, align 8, !tbaa !14
  %167 = add nsw i64 %166, %164
  store i64 %167, ptr %165, align 8, !tbaa !14
  br label %168

168:                                              ; preds = %158, %155, %149
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %187

171:                                              ; preds = %168
  %172 = load i32, ptr %11, align 4, !tbaa !5
  %173 = icmp eq i32 %172, 0
  br i1 %173, label %177, label %174

174:                                              ; preds = %171
  %175 = load i32, ptr %11, align 4, !tbaa !5
  %176 = icmp eq i32 %175, 1
  br i1 %176, label %177, label %187

177:                                              ; preds = %174, %171
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = load i32, ptr %8, align 4, !tbaa !5
  %180 = load i32, ptr %9, align 4, !tbaa !5
  %181 = sub nsw i32 %180, 1
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = call noundef i64 @_Z5solveiiiii(i32 noundef %178, i32 noundef %179, i32 noundef %181, i32 noundef %182, i32 noundef 2)
  %184 = load ptr, ptr %22, align 8, !tbaa !16
  %185 = load i64, ptr %184, align 8, !tbaa !14
  %186 = add nsw i64 %185, %183
  store i64 %186, ptr %184, align 8, !tbaa !14
  br label %187

187:                                              ; preds = %177, %174, %168
  %188 = load i32, ptr %10, align 4, !tbaa !5
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %206

190:                                              ; preds = %187
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = icmp eq i32 %191, 2
  br i1 %192, label %196, label %193

193:                                              ; preds = %190
  %194 = load i32, ptr %11, align 4, !tbaa !5
  %195 = icmp eq i32 %194, 3
  br i1 %195, label %196, label %206

196:                                              ; preds = %193, %190
  %197 = load i32, ptr %7, align 4, !tbaa !5
  %198 = load i32, ptr %8, align 4, !tbaa !5
  %199 = load i32, ptr %9, align 4, !tbaa !5
  %200 = load i32, ptr %10, align 4, !tbaa !5
  %201 = sub nsw i32 %200, 1
  %202 = call noundef i64 @_Z5solveiiiii(i32 noundef %197, i32 noundef %198, i32 noundef %199, i32 noundef %201, i32 noundef 3)
  %203 = load ptr, ptr %22, align 8, !tbaa !16
  %204 = load i64, ptr %203, align 8, !tbaa !14
  %205 = add nsw i64 %204, %202
  store i64 %205, ptr %203, align 8, !tbaa !14
  br label %206

206:                                              ; preds = %196, %193, %187
  %207 = load ptr, ptr %22, align 8, !tbaa !16
  %208 = load i64, ptr %207, align 8, !tbaa !14
  store i64 %208, ptr %6, align 8
  store i32 1, ptr %27, align 4
  br label %209

209:                                              ; preds = %206, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %210

210:                                              ; preds = %209, %65
  %211 = load i64, ptr %6, align 8
  ret i64 %211

212:                                              ; preds = %129, %84, %75
  %213 = load ptr, ptr %16, align 8
  %214 = load i32, ptr %17, align 4
  %215 = insertvalue { ptr, i32 } poison, ptr %213, 0
  %216 = insertvalue { ptr, i32 } %215, i32 %214, 1
  resume { ptr, i32 } %216
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listIiE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!11, !11, 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<std::vector<int>, std::pair<const std::vector<int>, long long>, std::_Select1st<std::pair<const std::vector<int>, long long>>, std::less<std::vector<int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::vector<int>, std::pair<const std::vector<int>, long long>, std::_Select1st<std::pair<const std::vector<int>, long long>>, std::less<std::vector<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 }
%"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 }
%"class.std::allocator.3" = type { i8 }

@dp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2okiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solveiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca [5 x i32], align 4
  %8 = alloca %"class.std::allocator.3", align 1
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca [5 x i32], align 4
  %11 = alloca %"class.std::allocator.3", align 1
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca [5 x i32], align 4
  %14 = alloca %"class.std::allocator.3", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %7) #3
  store i32 %0, ptr %7, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %1, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %2, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %7, i64 12
  store i32 %3, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %7, i64 16
  store i32 %4, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #3
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr nonnull %7, i64 5, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %19 unwind label %31

19:                                               ; preds = %5
  %20 = invoke noundef i64 @_ZNKSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %21 unwind label %33

21:                                               ; preds = %19
  %.not = icmp eq i64 %20, 0
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br i1 %.not, label %41, label %22

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %10) #3
  store i32 %0, ptr %10, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 %1, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 %2, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %10, i64 12
  store i32 %3, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %10, i64 16
  store i32 %4, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr nonnull %10, i64 5, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %27 unwind label %36

27:                                               ; preds = %22
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEEixEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %29 unwind label %38

29:                                               ; preds = %27
  %30 = load i64, ptr %28, align 8, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #3
  br label %83

31:                                               ; preds = %5
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %35

33:                                               ; preds = %19
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  br label %35

35:                                               ; preds = %33, %31
  %.pn = phi { ptr, i32 } [ %34, %33 ], [ %32, %31 ]
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br label %84

36:                                               ; preds = %22
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %27
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  br label %40

40:                                               ; preds = %38, %36
  %.pn88 = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #3
  br label %84

41:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %13) #3
  store i32 %0, ptr %13, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %13, i64 4
  store i32 %1, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %13, i64 8
  store i32 %2, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %13, i64 12
  store i32 %3, ptr %44, align 4, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %13, i64 16
  store i32 %4, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #3
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #3
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr nonnull %13, i64 5, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %46 unwind label %56

46:                                               ; preds = %41
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapISt6vectorIiSaIiEExSt4lessIS2_ESaISt4pairIKS2_xEEEixEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @dp, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %48 unwind label %58

48:                                               ; preds = %46
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #3
  %49 = add nsw i32 %1, %0
  %50 = add nsw i32 %49, %2
  %51 = add nsw i32 %50, %3
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %61

53:                                               ; preds = %48
  %54 = call noundef i32 @_Z2okiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4)
  %55 = sext i32 %54 to i64
  store i64 %55, ptr %47, align 8, !tbaa !9
  br label %83

56:                                               ; preds = %41
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %60

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  br label %60

60:                                               ; preds = %58, %56
  %.pn82 = phi { ptr, i32 } [ %59, %58 ], [ %57, %56 ]
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #3
  br label %84

61:                                               ; preds = %48
  %.not84 = icmp ne i32 %0, 0
  %or.cond = icmp ult i32 %4, 2
  %or.cond91 = and i1 %.not84, %or.cond
  br i1 %or.cond91, label %62, label %67

62:                                               ; preds = %61
  %63 = add nsw i32 %0, -1
  %64 = call noundef i64 @_Z5solveiiiii(i32 noundef %63, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef 0)
  %65 = load i64, ptr %47, align 8, !tbaa !9
  %66 = add nsw i64 %65, %64
  store i64 %66, ptr %47, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %62, %61
  %.not85 = icmp ne i32 %1, 0
  %68 = and i32 %4, -2
  %or.cond3 = icmp eq i32 %68, 2
  %or.cond92 = and i1 %.not85, %or.cond3
  br i1 %or.cond92, label %.thread, label %71

.thread:                                          ; preds = %67
  %69 = add nsw i32 %1, -1
  %70 = call noundef i64 @_Z5solveiiiii(i32 noundef %0, i32 noundef %69, i32 noundef %2, i32 noundef %3, i32 noundef 1)
  br label %.sink.split

71:                                               ; preds = %67
  %.not86 = icmp ne i32 %2, 0
  %or.cond93 = and i1 %.not86, %or.cond
  br i1 %or.cond93, label %72, label %77

72:                                               ; preds = %71
  %73 = add nsw i32 %2, -1
  %74 = call noundef i64 @_Z5solveiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %73, i32 noundef %3, i32 noundef 2)
  br label %.sink.split

.sink.split:                                      ; preds = %72, %.thread
  %.sink98 = phi i64 [ %70, %.thread ], [ %74, %72 ]
  %75 = load i64, ptr %47, align 8, !tbaa !9
  %76 = add nsw i64 %75, %.sink98
  store i64 %76, ptr %47, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %.sink.split, %71
  %.not87 = icmp ne i32 %3, 0
  %or.cond94 = and i1 %.not87, %or.cond3
  br i1 %or.cond94, label %78, label %._crit_edge

._crit_edge:                                      ; preds = %77
  %.pre = load i64, ptr %47, align 8, !tbaa !9
  br label %83

78:                                               ; preds = %77
  %79 = add nsw i32 %3, -1
  %80 = call noundef i64 @_Z5solveiiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %79, i32 noundef 3)
  %81 = load i64, ptr %47, align 8, !tbaa !9
  %82 = add nsw i64 %81, %80
  store i64 %82, ptr %47, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %78, %._crit_edge, %53, %29
  %.1 = phi i64 [ %30, %29 ], [ %55, %53 ], [ %.pre, %._crit_edge ], [ %82, %78 ]
  ret i64 %.1

84:                                               ; preds = %60, %40, %35
  %.pn88.pn = phi { ptr, i32 } [ %.pn88, %40 ], [ %.pn82, %60 ], [ %.pn, %35 ]
  resume { ptr, i32 } %.pn88.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass