; LLVM IR from Tian-Xie/NLS :: NestedLogitSolverReport.ll (ZN17NestedLogitSolver20GetOptimalAssortmentEv)

; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { ptr, ptr }
%struct.NestedLogitSolver = type { ptr, %"class.std::vector.0", double }
%struct.NestedLogitModel = type { i32, %"class.std::vector.5", double }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<TNest, std::allocator<TNest>>::_Vector_impl" }
%"struct.std::_Vector_base<TNest, std::allocator<TNest>>::_Vector_impl" = type { %"struct.std::_Vector_base<TNest, std::allocator<TNest>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TNest, std::allocator<TNest>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.TNest = type <{ i32, [4 x i8], double, %"class.std::vector.10", ptr, ptr, i32, [4 x i8], ptr, ptr, i32, [4 x i8] }>
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<TProduct, std::allocator<TProduct>>::_Vector_impl" }
%"struct.std::_Vector_base<TProduct, std::allocator<TProduct>>::_Vector_impl" = type { %"struct.std::_Vector_base<TProduct, std::allocator<TProduct>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TProduct, std::allocator<TProduct>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.TCandidate = type { double, double, double, double }
%struct.TProduct = type { double, double }

@.str = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17NestedLogitSolver20GetOptimalAssortmentEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::vector.0", align 8
  %23 = alloca %"class.std::allocator.2", align 1
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %class.anon, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca ptr, align 8
  %34 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %35 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %36 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %4, align 8
  store i1 false, ptr %5, align 1
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %38 = getelementptr inbounds %struct.NestedLogitSolver, ptr %37, i32 0, i32 2
  %39 = load double, ptr %38, align 8, !tbaa !9
  store double %39, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %40 = getelementptr inbounds %struct.NestedLogitSolver, ptr %37, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = getelementptr inbounds %struct.NestedLogitModel, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !18
  store i32 %43, ptr %7, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !25
  br label %44

44:                                               ; preds = %319, %2
  %45 = load i32, ptr %8, align 4, !tbaa !25
  %46 = load i32, ptr %7, align 4, !tbaa !25
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %324

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %50 = getelementptr inbounds %struct.NestedLogitSolver, ptr %37, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = getelementptr inbounds %struct.NestedLogitModel, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %8, align 4, !tbaa !25
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %54) #7
  store ptr %55, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %56 = getelementptr inbounds %struct.NestedLogitSolver, ptr %37, i32 0, i32 1
  %57 = load i32, ptr %8, align 4, !tbaa !25
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #7
  %60 = load i32, ptr %59, align 4, !tbaa !25
  store i32 %60, ptr %11, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TNest, ptr %61, i32 0, i32 5
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = load i32, ptr %11, align 4, !tbaa !25
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !25
  store i32 %67, ptr %12, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.TNest, ptr %68, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !32
  %71 = load i32, ptr %11, align 4, !tbaa !25
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  store ptr %74, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store double -1.000000e+100, ptr %14, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !25
  br label %75

75:                                               ; preds = %116, %49
  %76 = load i32, ptr %16, align 4, !tbaa !25
  %77 = load i32, ptr %12, align 4, !tbaa !25
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %119

80:                                               ; preds = %75
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i32, ptr %16, align 4, !tbaa !25
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %struct.TCandidate, ptr %81, i64 %83
  %85 = getelementptr inbounds %struct.TCandidate, ptr %84, i32 0, i32 2
  %86 = load double, ptr %85, align 8, !tbaa !33
  %87 = load ptr, ptr %13, align 8, !tbaa !5
  %88 = load i32, ptr %16, align 4, !tbaa !25
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.TCandidate, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.TCandidate, ptr %90, i32 0, i32 3
  %92 = load double, ptr %91, align 8, !tbaa !35
  %93 = load double, ptr %6, align 8, !tbaa !16
  %94 = fneg double %92
  %95 = call double @llvm.fmuladd.f64(double %94, double %93, double %86)
  %96 = load double, ptr %14, align 8, !tbaa !16
  %97 = fcmp ogt double %95, %96
  br i1 %97, label %98, label %115

98:                                               ; preds = %80
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load i32, ptr %16, align 4, !tbaa !25
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.TCandidate, ptr %99, i64 %101
  %103 = getelementptr inbounds %struct.TCandidate, ptr %102, i32 0, i32 2
  %104 = load double, ptr %103, align 8, !tbaa !33
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !25
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.TCandidate, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.TCandidate, ptr %108, i32 0, i32 3
  %110 = load double, ptr %109, align 8, !tbaa !35
  %111 = load double, ptr %6, align 8, !tbaa !16
  %112 = fneg double %110
  %113 = call double @llvm.fmuladd.f64(double %112, double %111, double %104)
  store double %113, ptr %14, align 8, !tbaa !16
  %114 = load i32, ptr %16, align 4, !tbaa !25
  store i32 %114, ptr %15, align 4, !tbaa !25
  br label %115

115:                                              ; preds = %98, %80
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %16, align 4, !tbaa !25
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %16, align 4, !tbaa !25
  br label %75, !llvm.loop !36

119:                                              ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store double 0.000000e+00, ptr %17, align 8, !tbaa !16
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load i32, ptr %15, align 4, !tbaa !25
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds %struct.TCandidate, ptr %120, i64 %122
  %124 = getelementptr inbounds %struct.TCandidate, ptr %123, i32 0, i32 0
  %125 = load double, ptr %124, align 8, !tbaa !38
  %126 = fcmp ogt double %125, 1.000000e-08
  br i1 %126, label %127, label %141

127:                                              ; preds = %119
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = load i32, ptr %15, align 4, !tbaa !25
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.TCandidate, ptr %128, i64 %130
  %132 = getelementptr inbounds %struct.TCandidate, ptr %131, i32 0, i32 1
  %133 = load double, ptr %132, align 8, !tbaa !39
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = load i32, ptr %15, align 4, !tbaa !25
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.TCandidate, ptr %134, i64 %136
  %138 = getelementptr inbounds %struct.TCandidate, ptr %137, i32 0, i32 0
  %139 = load double, ptr %138, align 8, !tbaa !38
  %140 = fdiv double %133, %139
  store double %140, ptr %17, align 8, !tbaa !16
  br label %141

141:                                              ; preds = %127, %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.TNest, ptr %142, i32 0, i32 2
  %144 = load double, ptr %143, align 8, !tbaa !40
  %145 = load double, ptr %6, align 8, !tbaa !16
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.TNest, ptr %146, i32 0, i32 2
  %148 = load double, ptr %147, align 8, !tbaa !40
  %149 = fsub double 1.000000e+00, %148
  %150 = load double, ptr %17, align 8, !tbaa !16
  %151 = fmul double %149, %150
  %152 = call double @llvm.fmuladd.f64(double %144, double %145, double %151)
  store double %152, ptr %19, align 8, !tbaa !16
  %153 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %154 unwind label %168

154:                                              ; preds = %141
  %155 = load double, ptr %153, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  store double %155, ptr %18, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.TNest, ptr %156, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !41
  %159 = sext i32 %158 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %159, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %160 unwind label %172

160:                                              ; preds = %154
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !25
  br label %161

161:                                              ; preds = %181, %160
  %162 = load i32, ptr %24, align 4, !tbaa !25
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TNest, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 8, !tbaa !41
  %166 = icmp slt i32 %162, %165
  br i1 %166, label %176, label %167

167:                                              ; preds = %161
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %184

168:                                              ; preds = %141
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %20, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %323

172:                                              ; preds = %154
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %20, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %21, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #7
  br label %322

176:                                              ; preds = %161
  %177 = load i32, ptr %24, align 4, !tbaa !25
  %178 = load i32, ptr %24, align 4, !tbaa !25
  %179 = sext i32 %178 to i64
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %179) #7
  store i32 %177, ptr %180, align 4, !tbaa !25
  br label %181

181:                                              ; preds = %176
  %182 = load i32, ptr %24, align 4, !tbaa !25
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %24, align 4, !tbaa !25
  br label %161, !llvm.loop !42

184:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.TNest, ptr %185, i32 0, i32 3
  store ptr %186, ptr %25, align 8, !tbaa !5
  %187 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %188 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %187, ptr %188, align 8
  %189 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %190 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %189, ptr %190, align 8
  %191 = getelementptr inbounds %class.anon, ptr %28, i32 0, i32 0
  %192 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %192, ptr %191, align 8, !tbaa !5
  %193 = getelementptr inbounds %class.anon, ptr %28, i32 0, i32 1
  store ptr %18, ptr %193, align 8, !tbaa !5
  %194 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8
  %196 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  %197 = load ptr, ptr %196, align 8
  %198 = getelementptr inbounds { ptr, ptr }, ptr %28, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8
  %200 = getelementptr inbounds { ptr, ptr }, ptr %28, i32 0, i32 1
  %201 = load ptr, ptr %200, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZN17NestedLogitSolver20GetOptimalAssortmentEvE3$_0EvT_S9_T0_"(ptr %195, ptr %197, ptr %199, ptr %201)
          to label %202 unwind label %236

202:                                              ; preds = %184
  br label %203

203:                                              ; preds = %233, %202
  %204 = load i32, ptr %11, align 4, !tbaa !25
  %205 = icmp sgt i32 %204, 0
  br i1 %205, label %206, label %231

206:                                              ; preds = %203
  %207 = load ptr, ptr %25, align 8, !tbaa !5
  %208 = load i32, ptr %11, align 4, !tbaa !25
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %210) #7
  %212 = load i32, ptr %211, align 4, !tbaa !25
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %207, i64 noundef %213) #7
  %215 = getelementptr inbounds %struct.TProduct, ptr %214, i32 0, i32 0
  %216 = load double, ptr %215, align 8, !tbaa !43
  %217 = load ptr, ptr %25, align 8, !tbaa !5
  %218 = load i32, ptr %11, align 4, !tbaa !25
  %219 = sub nsw i32 %218, 1
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %220) #7
  %222 = load i32, ptr %221, align 4, !tbaa !25
  %223 = sext i32 %222 to i64
  %224 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %217, i64 noundef %223) #7
  %225 = getelementptr inbounds %struct.TProduct, ptr %224, i32 0, i32 1
  %226 = load double, ptr %225, align 8, !tbaa !45
  %227 = load double, ptr %18, align 8, !tbaa !16
  %228 = fsub double %226, %227
  %229 = fmul double %216, %228
  %230 = fcmp ole double %229, 1.000000e-08
  br label %231

231:                                              ; preds = %206, %203
  %232 = phi i1 [ false, %203 ], [ %230, %206 ]
  br i1 %232, label %233, label %240

233:                                              ; preds = %231
  %234 = load i32, ptr %11, align 4, !tbaa !25
  %235 = add nsw i32 %234, -1
  store i32 %235, ptr %11, align 4, !tbaa !25
  br label %203, !llvm.loop !46

236:                                              ; preds = %252, %243, %240, %184
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %20, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  br label %322

240:                                              ; preds = %231
  %241 = load i32, ptr %11, align 4, !tbaa !25
  %242 = sext i32 %241 to i64
  invoke void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %242)
          to label %243 unwind label %236

243:                                              ; preds = %240
  %244 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %245 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %244, ptr %245, align 8
  %246 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  %247 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %246, ptr %247, align 8
  %248 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8
  %250 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %249, ptr %251)
          to label %252 unwind label %236

252:                                              ; preds = %243
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %253 unwind label %236

253:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  store double 0.000000e+00, ptr %31, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  store double 0.000000e+00, ptr %32, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  store ptr %22, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %254 = load ptr, ptr %33, align 8, !tbaa !5
  %255 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %254) #7
  %256 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %34, i32 0, i32 0
  store ptr %255, ptr %256, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %257 = load ptr, ptr %33, align 8, !tbaa !5
  %258 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %257) #7
  %259 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %35, i32 0, i32 0
  store ptr %258, ptr %259, align 8
  br label %260

260:                                              ; preds = %288, %253
  %261 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35) #7
  br i1 %261, label %263, label %262

262:                                              ; preds = %260
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %290

263:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %264 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  %265 = load i32, ptr %264, align 4, !tbaa !25
  store i32 %265, ptr %36, align 4, !tbaa !25
  %266 = load ptr, ptr %25, align 8, !tbaa !5
  %267 = load i32, ptr %36, align 4, !tbaa !25
  %268 = sext i32 %267 to i64
  %269 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %266, i64 noundef %268) #7
  %270 = getelementptr inbounds %struct.TProduct, ptr %269, i32 0, i32 1
  %271 = load double, ptr %270, align 8, !tbaa !45
  %272 = load ptr, ptr %25, align 8, !tbaa !5
  %273 = load i32, ptr %36, align 4, !tbaa !25
  %274 = sext i32 %273 to i64
  %275 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %272, i64 noundef %274) #7
  %276 = getelementptr inbounds %struct.TProduct, ptr %275, i32 0, i32 0
  %277 = load double, ptr %276, align 8, !tbaa !43
  %278 = load double, ptr %31, align 8, !tbaa !16
  %279 = call double @llvm.fmuladd.f64(double %271, double %277, double %278)
  store double %279, ptr %31, align 8, !tbaa !16
  %280 = load ptr, ptr %25, align 8, !tbaa !5
  %281 = load i32, ptr %36, align 4, !tbaa !25
  %282 = sext i32 %281 to i64
  %283 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %280, i64 noundef %282) #7
  %284 = getelementptr inbounds %struct.TProduct, ptr %283, i32 0, i32 0
  %285 = load double, ptr %284, align 8, !tbaa !43
  %286 = load double, ptr %32, align 8, !tbaa !16
  %287 = fadd double %286, %285
  store double %287, ptr %32, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %288

288:                                              ; preds = %263
  %289 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #7
  br label %260

290:                                              ; preds = %262
  %291 = load double, ptr %31, align 8, !tbaa !16
  %292 = load ptr, ptr %13, align 8, !tbaa !5
  %293 = load i32, ptr %15, align 4, !tbaa !25
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds %struct.TCandidate, ptr %292, i64 %294
  %296 = getelementptr inbounds %struct.TCandidate, ptr %295, i32 0, i32 1
  %297 = load double, ptr %296, align 8, !tbaa !39
  %298 = fsub double %291, %297
  %299 = call double @llvm.fabs.f64(double %298)
  %300 = fcmp olt double %299, 1.000000e-08
  br i1 %300, label %301, label %302

301:                                              ; preds = %290
  br label %304

302:                                              ; preds = %290
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 61, ptr noundef @__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv) #8
  unreachable

303:                                              ; No predecessors!
  br label %304

304:                                              ; preds = %303, %301
  %305 = load double, ptr %32, align 8, !tbaa !16
  %306 = load ptr, ptr %13, align 8, !tbaa !5
  %307 = load i32, ptr %15, align 4, !tbaa !25
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds %struct.TCandidate, ptr %306, i64 %308
  %310 = getelementptr inbounds %struct.TCandidate, ptr %309, i32 0, i32 0
  %311 = load double, ptr %310, align 8, !tbaa !38
  %312 = fsub double %305, %311
  %313 = call double @llvm.fabs.f64(double %312)
  %314 = fcmp olt double %313, 1.000000e-08
  br i1 %314, label %315, label %316

315:                                              ; preds = %304
  br label %318

316:                                              ; preds = %304
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 62, ptr noundef @__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv) #8
  unreachable

317:                                              ; No predecessors!
  br label %318

318:                                              ; preds = %317, %315
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %319

319:                                              ; preds = %318
  %320 = load i32, ptr %8, align 4, !tbaa !25
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %8, align 4, !tbaa !25
  br label %44, !llvm.loop !47

322:                                              ; preds = %236, %172
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br label %323

323:                                              ; preds = %322, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %328

324:                                              ; preds = %48
  store i1 true, ptr %5, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %325 = load i1, ptr %5, align 1
  br i1 %325, label %327, label %326

326:                                              ; preds = %324
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %327

327:                                              ; preds = %326, %324
  ret void

328:                                              ; preds = %323
  %329 = load ptr, ptr %20, align 8
  %330 = load i32, ptr %21, align 4
  %331 = insertvalue { ptr, i32 } poison, ptr %329, 0
  %332 = insertvalue { ptr, i32 } %331, i32 %330, 1
  resume { ptr, i32 } %332
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZN17NestedLogitSolver20GetOptimalAssortmentEvE3$_0EvT_S9_T0_"(ptr, ptr, ptr, ptr) #5

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #5

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 32}
!10 = !{!"_ZTS17NestedLogitSolver", !6, i64 0, !11, i64 8, !15, i64 32}
!11 = !{!"_ZTSSt6vectorIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"double", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!10, !6, i64 0}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTS16NestedLogitModel", !20, i64 0, !21, i64 8, !15, i64 32}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSSt6vectorI5TNestSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI5TNestSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!20, !20, i64 0}
!26 = !{!27, !6, i64 48}
!27 = !{!"_ZTS5TNest", !20, i64 0, !15, i64 8, !28, i64 16, !6, i64 40, !6, i64 48, !20, i64 56, !6, i64 64, !6, i64 72, !20, i64 80}
!28 = !{!"_ZTSSt6vectorI8TProductSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseI8TProductSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!27, !6, i64 40}
!33 = !{!34, !15, i64 16}
!34 = !{!"_ZTS10TCandidate", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!35 = !{!34, !15, i64 24}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!34, !15, i64 0}
!39 = !{!34, !15, i64 8}
!40 = !{!27, !15, i64 8}
!41 = !{!27, !20, i64 0}
!42 = distinct !{!42, !37}
!43 = !{!44, !15, i64 0}
!44 = !{!"_ZTS8TProduct", !15, i64 0, !15, i64 8}
!45 = !{!44, !15, i64 8}
!46 = distinct !{!46, !37}
!47 = distinct !{!47, !37}


; 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.TCandidate = type { double, double, double, double }

@.str = external hidden unnamed_addr constant [51 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17NestedLogitSolver20GetOptimalAssortmentEv(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(40) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca %"class.std::allocator.2", align 1
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  tail call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %10 = getelementptr inbounds i8, ptr %1, i64 32
  %11 = load double, ptr %10, align 8, !tbaa !5
  store double %11, ptr %3, align 8, !tbaa !15
  %12 = load ptr, ptr %1, align 8, !tbaa !16
  %13 = load i32, ptr %12, align 8, !tbaa !17
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %2
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %wide.trip.count112 = zext nneg i32 %13 to i64
  br label %16

._crit_edge100:                                   ; preds = %151, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret void

16:                                               ; preds = %.lr.ph99, %151
  %indvars.iv109 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next110, %151 ]
  %17 = load ptr, ptr %1, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv109) #8
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %indvars.iv109) #8
  %21 = load i32, ptr %20, align 4, !tbaa !24
  %22 = getelementptr inbounds i8, ptr %19, i64 48
  %23 = load ptr, ptr %22, align 8, !tbaa !25
  %24 = sext i32 %21 to i64
  %25 = getelementptr inbounds i32, ptr %23, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %19, i64 40
  %28 = load ptr, ptr %27, align 8, !tbaa !31
  %29 = getelementptr inbounds ptr, ptr %28, i64 %24
  %30 = load ptr, ptr %29, align 8, !tbaa !32
  %31 = icmp sgt i32 %26, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %32 = load double, ptr %3, align 8, !tbaa !15
  %wide.trip.count = zext nneg i32 %26 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %33 = icmp eq i32 %26, 1
  br i1 %33, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %47

._crit_edge.loopexit.unr-lcssa:                   ; preds = %47, %.lr.ph
  %.174.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %.174.1, %47 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %47 ]
  %.07285.unr = phi double [ -1.000000e+100, %.lr.ph ], [ %.1.1, %47 ]
  %.07384.unr = phi i32 [ -1, %.lr.ph ], [ %.174.1, %47 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %34 = getelementptr inbounds %struct.TCandidate, ptr %30, i64 %indvars.iv.unr
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %36 = load double, ptr %35, align 8, !tbaa !33
  %37 = getelementptr inbounds i8, ptr %34, i64 24
  %38 = load double, ptr %37, align 8, !tbaa !35
  %39 = fneg double %38
  %40 = call double @llvm.fmuladd.f64(double %39, double %32, double %36)
  %41 = fcmp ogt double %40, %.07285.unr
  %42 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %.174.epil = select i1 %41, i32 %42, i32 %.07384.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %16
  %.073.lcssa = phi i32 [ -1, %16 ], [ %.174.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.174.epil, %._crit_edge.loopexit.epilog-lcssa ]
  %43 = sext i32 %.073.lcssa to i64
  %44 = getelementptr inbounds %struct.TCandidate, ptr %30, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !36
  %46 = fcmp ogt double %45, 1.000000e-08
  br i1 %46, label %66, label %70

47:                                               ; preds = %47, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %47 ]
  %.07285 = phi double [ -1.000000e+100, %.lr.ph.new ], [ %.1.1, %47 ]
  %.07384 = phi i32 [ -1, %.lr.ph.new ], [ %.174.1, %47 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %47 ]
  %48 = getelementptr inbounds %struct.TCandidate, ptr %30, i64 %indvars.iv
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load double, ptr %49, align 8, !tbaa !33
  %51 = getelementptr inbounds i8, ptr %48, i64 24
  %52 = load double, ptr %51, align 8, !tbaa !35
  %53 = fneg double %52
  %54 = call double @llvm.fmuladd.f64(double %53, double %32, double %50)
  %55 = fcmp ogt double %54, %.07285
  %56 = trunc nuw nsw i64 %indvars.iv to i32
  %.174 = select i1 %55, i32 %56, i32 %.07384
  %.1 = select i1 %55, double %54, double %.07285
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %57 = getelementptr inbounds %struct.TCandidate, ptr %30, i64 %indvars.iv.next
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %59 = load double, ptr %58, align 8, !tbaa !33
  %60 = getelementptr inbounds i8, ptr %57, i64 24
  %61 = load double, ptr %60, align 8, !tbaa !35
  %62 = fneg double %61
  %63 = call double @llvm.fmuladd.f64(double %62, double %32, double %59)
  %64 = fcmp ogt double %63, %.1
  %65 = trunc nuw nsw i64 %indvars.iv.next to i32
  %.174.1 = select i1 %64, i32 %65, i32 %.174
  %.1.1 = select i1 %64, double %63, double %.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %47, !llvm.loop !37

66:                                               ; preds = %._crit_edge
  %67 = getelementptr inbounds i8, ptr %44, i64 8
  %68 = load double, ptr %67, align 8, !tbaa !39
  %69 = fdiv double %68, %45
  br label %70

70:                                               ; preds = %66, %._crit_edge
  %.076 = phi double [ %69, %66 ], [ 0.000000e+00, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %71 = getelementptr inbounds i8, ptr %19, i64 8
  %72 = load double, ptr %71, align 8, !tbaa !40
  %73 = load double, ptr %3, align 8, !tbaa !15
  %74 = fsub double 1.000000e+00, %72
  %75 = fmul double %.076, %74
  %76 = call double @llvm.fmuladd.f64(double %72, double %73, double %75)
  store double %76, ptr %5, align 8, !tbaa !15
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %78 = load double, ptr %77, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  store double %78, ptr %4, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  %79 = load i32, ptr %19, align 8, !tbaa !41
  %80 = sext i32 %79 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %80, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %81 unwind label %88

81:                                               ; preds = %70
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  %82 = load i32, ptr %19, align 8, !tbaa !41
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph88, label %._crit_edge89

._crit_edge89:                                    ; preds = %.lr.ph88, %81
  %84 = getelementptr inbounds i8, ptr %19, i64 16
  %85 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %86 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZN17NestedLogitSolver20GetOptimalAssortmentEvE3$_0EvT_S9_T0_"(ptr %85, ptr %86, ptr nonnull %84, ptr nonnull %4)
          to label %.preheader.preheader unwind label %114

.preheader.preheader:                             ; preds = %._crit_edge89
  %87 = zext i32 %21 to i64
  %smin = call i32 @llvm.smin.i32(i32 %21, i32 0)
  br label %.preheader

88:                                               ; preds = %70
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  br label %152

.lr.ph88:                                         ; preds = %81, %.lr.ph88
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph88 ], [ 0, %81 ]
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv103) #8
  %91 = trunc nuw nsw i64 %indvars.iv103 to i32
  store i32 %91, ptr %90, align 4, !tbaa !24
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %92 = load i32, ptr %19, align 8, !tbaa !41
  %93 = sext i32 %92 to i64
  %94 = icmp slt i64 %indvars.iv.next104, %93
  br i1 %94, label %.lr.ph88, label %._crit_edge89, !llvm.loop !42

.preheader:                                       ; preds = %.preheader.preheader, %97
  %indvars.iv106 = phi i64 [ %87, %.preheader.preheader ], [ %98, %97 ]
  %95 = trunc nuw i64 %indvars.iv106 to i32
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %97, label %.critedge

97:                                               ; preds = %.preheader
  %98 = add nsw i64 %indvars.iv106, -1
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %98) #8
  %100 = load i32, ptr %99, align 4, !tbaa !24
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %101) #8
  %103 = load double, ptr %102, align 8, !tbaa !43
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %98) #8
  %105 = load i32, ptr %104, align 4, !tbaa !24
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %106) #8
  %108 = getelementptr inbounds i8, ptr %107, i64 8
  %109 = load double, ptr %108, align 8, !tbaa !45
  %110 = load double, ptr %4, align 8, !tbaa !15
  %111 = fsub double %109, %110
  %112 = fmul double %103, %111
  %113 = fcmp ugt double %112, 1.000000e-08
  br i1 %113, label %.critedge, label %.preheader, !llvm.loop !46

114:                                              ; preds = %120, %117, %.critedge, %._crit_edge89
  %115 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %152

.critedge:                                        ; preds = %.preheader, %97
  %.071.lcssa = phi i32 [ %smin, %.preheader ], [ %95, %97 ]
  %116 = sext i32 %.071.lcssa to i64
  invoke void @_ZNSt6vectorIiSaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %116)
          to label %117 unwind label %114

117:                                              ; preds = %.critedge
  %118 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  %119 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %118, ptr %119)
          to label %120 unwind label %114

120:                                              ; preds = %117
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %121 unwind label %114

121:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %122 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  store ptr %122, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  %123 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  store ptr %123, ptr %9, align 8
  %124 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %124, label %.lr.ph93, label %._crit_edge94

._crit_edge94:                                    ; preds = %.lr.ph93, %121
  %.070.lcssa = phi double [ 0.000000e+00, %121 ], [ %138, %.lr.ph93 ]
  %.069.lcssa = phi double [ 0.000000e+00, %121 ], [ %141, %.lr.ph93 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %125 = getelementptr inbounds i8, ptr %44, i64 8
  %126 = load double, ptr %125, align 8, !tbaa !39
  %127 = fsub double %.070.lcssa, %126
  %128 = call double @llvm.fabs.f64(double %127)
  %129 = fcmp olt double %128, 1.000000e-08
  br i1 %129, label %145, label %144

.lr.ph93:                                         ; preds = %121, %.lr.ph93
  %.06991 = phi double [ %141, %.lr.ph93 ], [ 0.000000e+00, %121 ]
  %.07090 = phi double [ %138, %.lr.ph93 ], [ 0.000000e+00, %121 ]
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %131 = load i32, ptr %130, align 4, !tbaa !24
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %132) #8
  %134 = getelementptr inbounds i8, ptr %133, i64 8
  %135 = load double, ptr %134, align 8, !tbaa !45
  %136 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %132) #8
  %137 = load double, ptr %136, align 8, !tbaa !43
  %138 = call double @llvm.fmuladd.f64(double %135, double %137, double %.07090)
  %139 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI8TProductSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %132) #8
  %140 = load double, ptr %139, align 8, !tbaa !43
  %141 = fadd double %.06991, %140
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  %143 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br i1 %143, label %.lr.ph93, label %._crit_edge94

144:                                              ; preds = %._crit_edge94
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 61, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv) #9
  unreachable

145:                                              ; preds = %._crit_edge94
  %146 = load double, ptr %44, align 8, !tbaa !36
  %147 = fsub double %.069.lcssa, %146
  %148 = call double @llvm.fabs.f64(double %147)
  %149 = fcmp olt double %148, 1.000000e-08
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 62, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN17NestedLogitSolver20GetOptimalAssortmentEv) #9
  unreachable

151:                                              ; preds = %145
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count112
  br i1 %exitcond113.not, label %._crit_edge100, label %16, !llvm.loop !47

152:                                              ; preds = %114, %88
  %.pn = phi { ptr, i32 } [ %115, %114 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #8
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 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 #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEZN17NestedLogitSolver20GetOptimalAssortmentEvE3$_0EvT_S9_T0_"(ptr, ptr, ptr, ptr) local_unnamed_addr #5

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #5

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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, !14, i64 32}
!6 = !{!"_ZTS17NestedLogitSolver", !7, i64 0, !10, i64 8, !14, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIiSaIiEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!"double", !8, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!6, !7, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS16NestedLogitModel", !19, i64 0, !20, i64 8, !14, i64 32}
!19 = !{!"int", !8, i64 0}
!20 = !{!"_ZTSSt6vectorI5TNestSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseI5TNestSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!24 = !{!19, !19, i64 0}
!25 = !{!26, !7, i64 48}
!26 = !{!"_ZTS5TNest", !19, i64 0, !14, i64 8, !27, i64 16, !7, i64 40, !7, i64 48, !19, i64 56, !7, i64 64, !7, i64 72, !19, i64 80}
!27 = !{!"_ZTSSt6vectorI8TProductSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseI8TProductSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!31 = !{!26, !7, i64 40}
!32 = !{!7, !7, i64 0}
!33 = !{!34, !14, i64 16}
!34 = !{!"_ZTS10TCandidate", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!35 = !{!34, !14, i64 24}
!36 = !{!34, !14, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!34, !14, i64 8}
!40 = !{!26, !14, i64 8}
!41 = !{!26, !19, i64 0}
!42 = distinct !{!42, !38}
!43 = !{!44, !14, i64 0}
!44 = !{!"_ZTS8TProduct", !14, i64 0, !14, i64 8}
!45 = !{!44, !14, i64 8}
!46 = distinct !{!46, !38}
!47 = distinct !{!47, !38}


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