; LLVM IR from VastoLorde95/Competitive-Programming :: Codejam/2016/Round 1C/Problem C/C.ll (Z5solveiiiiiii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.2" = type { i8 }

@cnt1 = external dso_local global [11 x [11 x i32]], align 16
@cnt2 = external dso_local global [11 x [11 x i32]], align 16
@cnt3 = external dso_local global [11 x [11 x i32]], align 16
@used1 = external dso_local global [11 x [11 x i32]], align 16
@used2 = external dso_local global [11 x [11 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiiiiiii(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i1, align 1
  %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 i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::vector.0", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::allocator.2", align 1
  store ptr %0, ptr %9, align 8
  store i32 %1, ptr %10, align 4, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !5
  store i32 %5, ptr %14, align 4, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !5
  store i32 %7, ptr %16, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @cnt1, i8 0, i64 484, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @cnt2, i8 0, i64 484, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @cnt3, i8 0, i64 484, i1 false)
  store i1 false, ptr %17, align 1
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %186, %8
  %32 = load i32, ptr %18, align 4, !tbaa !5
  %33 = load i32, ptr %10, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %189

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %182, %36
  %38 = load i32, ptr %20, align 4, !tbaa !5
  %39 = load i32, ptr %11, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %185

42:                                               ; preds = %37
  call void @llvm.memset.p0.i64(ptr align 16 @used1, i8 0, i64 484, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @used2, i8 0, i64 484, i1 false)
  br label %43

43:                                               ; preds = %170, %42
  %44 = load i32, ptr %18, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt1, i64 0, i64 %45
  %47 = load i32, ptr %20, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [11 x i32], ptr %46, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = load i32, ptr %13, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %181

53:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 1000000000, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 -1, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %109, %53
  %55 = load i32, ptr %23, align 4, !tbaa !5
  %56 = load i32, ptr %12, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 10, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %112

59:                                               ; preds = %54
  %60 = load i32, ptr %18, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %61
  %63 = load i32, ptr %23, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [11 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %77, label %68

68:                                               ; preds = %59
  %69 = load i32, ptr %20, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [11 x [11 x i32]], ptr @used2, i64 0, i64 %70
  %72 = load i32, ptr %23, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [11 x i32], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %68, %59
  br label %109

78:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %79 = load i32, ptr %18, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt2, i64 0, i64 %80
  %82 = load i32, ptr %23, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [11 x i32], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %20, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt3, i64 0, i64 %86
  %88 = load i32, ptr %23, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [11 x i32], ptr %87, i64 0, i64 %89
  %91 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %84, ptr noundef nonnull align 4 dereferenceable(4) %90)
          to label %92 unwind label %104

92:                                               ; preds = %78
  %93 = load i32, ptr %91, align 4, !tbaa !5
  store i32 %93, ptr %24, align 4, !tbaa !5
  %94 = load i32, ptr %24, align 4, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %108

97:                                               ; preds = %92
  %98 = load i32, ptr %24, align 4, !tbaa !5
  %99 = load i32, ptr %21, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %108

101:                                              ; preds = %97
  %102 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %102, ptr %21, align 4, !tbaa !5
  %103 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %103, ptr %22, align 4, !tbaa !5
  br label %108

104:                                              ; preds = %78
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %25, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %180

108:                                              ; preds = %101, %97, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %109

109:                                              ; preds = %108, %77
  %110 = load i32, ptr %23, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %23, align 4, !tbaa !5
  br label %54, !llvm.loop !9

112:                                              ; preds = %58
  %113 = load i32, ptr %22, align 4, !tbaa !5
  %114 = icmp eq i32 %113, -1
  br i1 %114, label %115, label %116

115:                                              ; preds = %112
  store i32 9, ptr %19, align 4
  br label %168

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %117 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %117, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef 3, ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 1 dereferenceable(1) %30)
          to label %118 unwind label %171

118:                                              ; preds = %116
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  %119 = load i32, ptr %18, align 4, !tbaa !5
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %121) #5
  store i32 %119, ptr %122, align 4, !tbaa !5
  %123 = load i32, ptr %20, align 4, !tbaa !5
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %125) #5
  store i32 %123, ptr %126, align 4, !tbaa !5
  %127 = load i32, ptr %27, align 4, !tbaa !5
  %128 = load i32, ptr %16, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %129) #5
  store i32 %127, ptr %130, align 4, !tbaa !5
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt1, i64 0, i64 %132
  %134 = load i32, ptr %20, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [11 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %136, align 4, !tbaa !5
  %139 = load i32, ptr %18, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt2, i64 0, i64 %140
  %142 = load i32, ptr %27, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [11 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %144, align 4, !tbaa !5
  %147 = load i32, ptr %20, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt3, i64 0, i64 %148
  %150 = load i32, ptr %27, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [11 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = load i32, ptr %18, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %156
  %158 = load i32, ptr %27, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [11 x i32], ptr %157, i64 0, i64 %159
  store i32 1, ptr %160, align 4, !tbaa !5
  %161 = load i32, ptr %20, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %162
  %164 = load i32, ptr %27, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [11 x i32], ptr %163, i64 0, i64 %165
  store i32 1, ptr %166, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %28)
          to label %167 unwind label %175

167:                                              ; preds = %118
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  store i32 0, ptr %19, align 4
  br label %168

168:                                              ; preds = %167, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %169 = load i32, ptr %19, align 4
  switch i32 %169, label %198 [
    i32 0, label %170
    i32 9, label %181
  ]

170:                                              ; preds = %168
  br label %43, !llvm.loop !11

171:                                              ; preds = %116
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %25, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %26, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %30) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %179

175:                                              ; preds = %118
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %25, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %26, align 4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  br label %179

179:                                              ; preds = %175, %171
  call void @llvm.lifetime.end.p0(i64 24, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %180

180:                                              ; preds = %179, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %193

181:                                              ; preds = %168, %43
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %20, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %20, align 4, !tbaa !5
  br label %37, !llvm.loop !12

185:                                              ; preds = %41
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %18, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %18, align 4, !tbaa !5
  br label %31, !llvm.loop !13

189:                                              ; preds = %35
  store i1 true, ptr %17, align 1
  store i32 1, ptr %19, align 4
  %190 = load i1, ptr %17, align 1
  br i1 %190, label %192, label %191

191:                                              ; preds = %189
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %192

192:                                              ; preds = %191, %189
  ret void

193:                                              ; preds = %180
  %194 = load ptr, ptr %25, align 8
  %195 = load i32, ptr %26, align 4
  %196 = insertvalue { ptr, i32 } poison, ptr %194, 0
  %197 = insertvalue { ptr, i32 } %196, i32 %195, 1
  resume { ptr, i32 } %197

198:                                              ; preds = %168
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(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.start.p0(i64 immarg, ptr nocapture) #3

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

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; 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) #2 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.2" = type { i8 }

@cnt1 = external dso_local local_unnamed_addr global [11 x [11 x i32]], align 16
@cnt2 = external dso_local global [11 x [11 x i32]], align 16
@cnt3 = external dso_local global [11 x [11 x i32]], align 16
@used1 = external dso_local local_unnamed_addr global [11 x [11 x i32]], align 16
@used2 = external dso_local local_unnamed_addr global [11 x [11 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiiiiiii(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %9 = alloca %"class.std::vector.0", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::allocator.2", align 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @cnt1, i8 0, i64 484, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @cnt2, i8 0, i64 484, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @cnt3, i8 0, i64 484, i1 false)
  tail call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %.not75 = icmp slt i32 %1, 1
  br i1 %.not75, label %._crit_edge77, label %.preheader65.lr.ph

.preheader65.lr.ph:                               ; preds = %8
  %.not5871 = icmp slt i32 %2, 1
  %.not5966 = icmp slt i32 %3, 1
  %12 = sext i32 %5 to i64
  %13 = sext i32 %6 to i64
  %14 = sext i32 %7 to i64
  br i1 %.not5871, label %._crit_edge77, label %.preheader65.preheader

.preheader65.preheader:                           ; preds = %.preheader65.lr.ph
  %15 = add i32 %3, 1
  %16 = add nuw i32 %2, 1
  %17 = add nuw i32 %1, 1
  %wide.trip.count88 = zext i32 %17 to i64
  %wide.trip.count83 = zext i32 %16 to i64
  %wide.trip.count = zext i32 %15 to i64
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.preheader, %._crit_edge74
  %indvars.iv85 = phi i64 [ 1, %.preheader65.preheader ], [ %indvars.iv.next86, %._crit_edge74 ]
  %18 = trunc nuw nsw i64 %indvars.iv85 to i32
  br label %19

._crit_edge74:                                    ; preds = %.thread
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond89.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count88
  br i1 %exitcond89.not, label %._crit_edge77, label %.preheader65, !llvm.loop !5

19:                                               ; preds = %.preheader65, %.thread
  %indvars.iv80 = phi i64 [ 1, %.preheader65 ], [ %indvars.iv.next81, %.thread ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @used1, i8 0, i64 484, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(484) @used2, i8 0, i64 484, i1 false)
  %20 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt1, i64 0, i64 %indvars.iv85, i64 %indvars.iv80
  %21 = load i32, ptr %20, align 4, !tbaa !7
  %22 = icmp slt i32 %21, %4
  br i1 %22, label %.preheader.preheader, label %.thread

.preheader.preheader:                             ; preds = %19
  %23 = trunc nuw nsw i64 %indvars.iv80 to i32
  br i1 %.not5966, label %.thread, label %.lr.ph

._crit_edge:                                      ; preds = %38
  %24 = icmp eq i32 %.2, -1
  br i1 %24, label %.thread, label %39

.lr.ph:                                           ; preds = %.preheader.preheader, %.lr.ph.backedge
  %indvars.iv = phi i64 [ %indvars.iv.be, %.lr.ph.backedge ], [ 1, %.preheader.preheader ]
  %.05068 = phi i32 [ %.05068.be, %.lr.ph.backedge ], [ -1, %.preheader.preheader ]
  %.05167 = phi i32 [ %.05167.be, %.lr.ph.backedge ], [ 1000000000, %.preheader.preheader ]
  %25 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %indvars.iv85, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %.not61 = icmp eq i32 %26, 0
  br i1 %.not61, label %27, label %38

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds [11 x [11 x i32]], ptr @used2, i64 0, i64 %indvars.iv80, i64 %indvars.iv
  %29 = load i32, ptr %28, align 4, !tbaa !7
  %.not62 = icmp eq i32 %29, 0
  br i1 %.not62, label %30, label %38

30:                                               ; preds = %27
  %31 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt2, i64 0, i64 %indvars.iv85, i64 %indvars.iv
  %32 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt3, i64 0, i64 %indvars.iv80, i64 %indvars.iv
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %34 = load i32, ptr %33, align 4, !tbaa !7
  %35 = icmp slt i32 %34, %4
  %36 = icmp slt i32 %34, %.05167
  %or.cond = select i1 %35, i1 %36, i1 false
  %.152 = select i1 %or.cond, i32 %34, i32 %.05167
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  %.1 = select i1 %or.cond, i32 %37, i32 %.05068
  br label %38

38:                                               ; preds = %.lr.ph, %27, %30
  %.253 = phi i32 [ %.05167, %.lr.ph ], [ %.05167, %27 ], [ %.152, %30 ]
  %.2 = phi i32 [ %.05068, %.lr.ph ], [ %.05068, %27 ], [ %.1, %30 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.backedge

.lr.ph.backedge:                                  ; preds = %38, %55
  %indvars.iv.be = phi i64 [ %indvars.iv.next, %38 ], [ 1, %55 ]
  %.05068.be = phi i32 [ %.2, %38 ], [ -1, %55 ]
  %.05167.be = phi i32 [ %.253, %38 ], [ 1000000000, %55 ]
  br label %.lr.ph, !llvm.loop !11

39:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store i32 0, ptr %10, align 4, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 3, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %40 unwind label %58

40:                                               ; preds = %39
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %12) #5
  store i32 %18, ptr %41, align 4, !tbaa !7
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %13) #5
  store i32 %23, ptr %42, align 4, !tbaa !7
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %14) #5
  store i32 %.2, ptr %43, align 4, !tbaa !7
  %44 = load i32, ptr %20, align 4, !tbaa !7
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %20, align 4, !tbaa !7
  %46 = sext i32 %.2 to i64
  %47 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt2, i64 0, i64 %indvars.iv85, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !7
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !7
  %50 = getelementptr inbounds [11 x [11 x i32]], ptr @cnt3, i64 0, i64 %indvars.iv80, i64 %46
  %51 = load i32, ptr %50, align 4, !tbaa !7
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !7
  %53 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %indvars.iv85, i64 %46
  store i32 1, ptr %53, align 4, !tbaa !7
  %54 = getelementptr inbounds [11 x [11 x i32]], ptr @used1, i64 0, i64 %indvars.iv80, i64 %46
  store i32 1, ptr %54, align 4, !tbaa !7
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %55 unwind label %60

55:                                               ; preds = %40
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  %56 = load i32, ptr %20, align 4, !tbaa !7
  %57 = icmp sge i32 %56, %4
  %brmerge = or i1 %57, %.not5966
  br i1 %brmerge, label %.thread, label %.lr.ph.backedge

58:                                               ; preds = %39
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  br label %62

60:                                               ; preds = %40
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn

.thread:                                          ; preds = %._crit_edge, %55, %.preheader.preheader, %19
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge74, label %19, !llvm.loop !12

._crit_edge77:                                    ; preds = %._crit_edge74, %.preheader65.lr.ph, %8
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(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.start.p0(i64 immarg, ptr nocapture) #3

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

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

; 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 #2 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass