; LLVM IR from Tian-Xie/NLS :: NestedLogitSolverJoint.ll (ZN17NestedLogitSolver13JointDPOracleEdiPd)

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

%struct.NestedLogitSolver = type { ptr, %"class.std::vector", double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.NestedLogitModel = type { i32, %"class.std::vector.0", double }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5", ptr, ptr, i32, [4 x i8], ptr, ptr, i32, [4 x i8] }>
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN17NestedLogitSolver13JointDPOracleEdiPd(ptr noundef nonnull align 8 dereferenceable(40) %0, double noundef %1, i32 noundef %2, ptr noundef %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %27, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !11
  %30 = add nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds double, ptr %28, i64 %31
  store ptr %32, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load i32, ptr %7, align 4, !tbaa !11
  %35 = add nsw i32 %34, 1
  %36 = mul nsw i32 2, %35
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds double, ptr %33, i64 %37
  store ptr %38, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %39 = getelementptr inbounds %struct.NestedLogitSolver, ptr %26, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.NestedLogitModel, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !19
  store i32 %42, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %60, %4
  %44 = load i32, ptr %13, align 4, !tbaa !11
  %45 = load i32, ptr %7, align 4, !tbaa !11
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %63

48:                                               ; preds = %43
  %49 = getelementptr inbounds %struct.NestedLogitSolver, ptr %26, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = getelementptr inbounds %struct.NestedLogitModel, ptr %50, i32 0, i32 2
  %52 = load double, ptr %51, align 8, !tbaa !25
  %53 = fneg double %52
  %54 = load double, ptr %6, align 8, !tbaa !9
  %55 = fmul double %53, %54
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i32, ptr %13, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds double, ptr %56, i64 %58
  store double %55, ptr %59, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %48
  %61 = load i32, ptr %13, align 4, !tbaa !11
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %13, align 4, !tbaa !11
  br label %43, !llvm.loop !26

63:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %213, %63
  %65 = load i32, ptr %14, align 4, !tbaa !11
  %66 = load i32, ptr %12, align 4, !tbaa !11
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %216

69:                                               ; preds = %64
  call void @_ZSt4swapIPdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %70 = getelementptr inbounds %struct.NestedLogitSolver, ptr %26, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = getelementptr inbounds %struct.NestedLogitModel, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %14, align 4, !tbaa !11
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %74) #4
  store ptr %75, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TNest, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !28
  store i32 %78, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %79

79:                                               ; preds = %148, %69
  %80 = load i32, ptr %18, align 4, !tbaa !11
  %81 = load i32, ptr %17, align 4, !tbaa !11
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %151

84:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store double -1.000000e+100, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.TNest, ptr %85, i32 0, i32 5
  %87 = load ptr, ptr %86, align 8, !tbaa !34
  %88 = load i32, ptr %18, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !11
  store i32 %91, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.TNest, ptr %92, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !35
  %95 = load i32, ptr %18, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds ptr, ptr %94, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  store ptr %98, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %99

99:                                               ; preds = %139, %84
  %100 = load i32, ptr %22, align 4, !tbaa !11
  %101 = load i32, ptr %20, align 4, !tbaa !11
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %142

104:                                              ; preds = %99
  %105 = load ptr, ptr %21, align 8, !tbaa !5
  %106 = load i32, ptr %22, align 4, !tbaa !11
  %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 2
  %110 = load double, ptr %109, align 8, !tbaa !36
  %111 = load ptr, ptr %21, align 8, !tbaa !5
  %112 = load i32, ptr %22, align 4, !tbaa !11
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds %struct.TCandidate, ptr %111, i64 %113
  %115 = getelementptr inbounds %struct.TCandidate, ptr %114, i32 0, i32 3
  %116 = load double, ptr %115, align 8, !tbaa !38
  %117 = load double, ptr %6, align 8, !tbaa !9
  %118 = fneg double %116
  %119 = call double @llvm.fmuladd.f64(double %118, double %117, double %110)
  %120 = load double, ptr %19, align 8, !tbaa !9
  %121 = fcmp ogt double %119, %120
  br i1 %121, label %122, label %138

122:                                              ; preds = %104
  %123 = load ptr, ptr %21, align 8, !tbaa !5
  %124 = load i32, ptr %22, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.TCandidate, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.TCandidate, ptr %126, i32 0, i32 2
  %128 = load double, ptr %127, align 8, !tbaa !36
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = load i32, ptr %22, align 4, !tbaa !11
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.TCandidate, ptr %129, i64 %131
  %133 = getelementptr inbounds %struct.TCandidate, ptr %132, i32 0, i32 3
  %134 = load double, ptr %133, align 8, !tbaa !38
  %135 = load double, ptr %6, align 8, !tbaa !9
  %136 = fneg double %134
  %137 = call double @llvm.fmuladd.f64(double %136, double %135, double %128)
  store double %137, ptr %19, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %122, %104
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %22, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %22, align 4, !tbaa !11
  br label %99, !llvm.loop !39

142:                                              ; preds = %103
  %143 = load double, ptr %19, align 8, !tbaa !9
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %18, align 4, !tbaa !11
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds double, ptr %144, i64 %146
  store double %143, ptr %147, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %148

148:                                              ; preds = %142
  %149 = load i32, ptr %18, align 4, !tbaa !11
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %18, align 4, !tbaa !11
  br label %79, !llvm.loop !40

151:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %152

152:                                              ; preds = %209, %151
  %153 = load i32, ptr %23, align 4, !tbaa !11
  %154 = load i32, ptr %7, align 4, !tbaa !11
  %155 = icmp sle i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %212

157:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  store double -1.000000e+100, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %158

158:                                              ; preds = %200, %157
  %159 = load i32, ptr %25, align 4, !tbaa !11
  %160 = load i32, ptr %17, align 4, !tbaa !11
  %161 = icmp sle i32 %159, %160
  br i1 %161, label %162, label %166

162:                                              ; preds = %158
  %163 = load i32, ptr %25, align 4, !tbaa !11
  %164 = load i32, ptr %23, align 4, !tbaa !11
  %165 = icmp sle i32 %163, %164
  br label %166

166:                                              ; preds = %162, %158
  %167 = phi i1 [ false, %158 ], [ %165, %162 ]
  br i1 %167, label %169, label %168

168:                                              ; preds = %166
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %203

169:                                              ; preds = %166
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load i32, ptr %23, align 4, !tbaa !11
  %172 = load i32, ptr %25, align 4, !tbaa !11
  %173 = sub nsw i32 %171, %172
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds double, ptr %170, i64 %174
  %176 = load double, ptr %175, align 8, !tbaa !9
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = load i32, ptr %25, align 4, !tbaa !11
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds double, ptr %177, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !9
  %182 = fadd double %176, %181
  %183 = load double, ptr %24, align 8, !tbaa !9
  %184 = fcmp ogt double %182, %183
  br i1 %184, label %185, label %199

185:                                              ; preds = %169
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = load i32, ptr %23, align 4, !tbaa !11
  %188 = load i32, ptr %25, align 4, !tbaa !11
  %189 = sub nsw i32 %187, %188
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %186, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !9
  %193 = load ptr, ptr %11, align 8, !tbaa !5
  %194 = load i32, ptr %25, align 4, !tbaa !11
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %193, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !9
  %198 = fadd double %192, %197
  store double %198, ptr %24, align 8, !tbaa !9
  br label %199

199:                                              ; preds = %185, %169
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %25, align 4, !tbaa !11
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %25, align 4, !tbaa !11
  br label %158, !llvm.loop !41

203:                                              ; preds = %168
  %204 = load double, ptr %24, align 8, !tbaa !9
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = load i32, ptr %23, align 4, !tbaa !11
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds double, ptr %205, i64 %207
  store double %204, ptr %208, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %209

209:                                              ; preds = %203
  %210 = load i32, ptr %23, align 4, !tbaa !11
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %23, align 4, !tbaa !11
  br label %152, !llvm.loop !42

212:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %14, align 4, !tbaa !11
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %14, align 4, !tbaa !11
  br label %64, !llvm.loop !43

216:                                              ; preds = %68
  %217 = load ptr, ptr %10, align 8, !tbaa !5
  %218 = load i32, ptr %7, align 4, !tbaa !11
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds double, ptr %217, i64 %219
  %221 = load double, ptr %220, align 8, !tbaa !9
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret double %221
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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) #0 align 2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

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


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

%struct.TCandidate = type { double, double, double, double }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN17NestedLogitSolver13JointDPOracleEdiPd(ptr nocapture noundef nonnull readonly align 8 dereferenceable(40) %0, double noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr %3, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %7 = add i32 %2, 1
  %8 = sext i32 %7 to i64
  %9 = getelementptr double, ptr %3, i64 %8
  store ptr %9, ptr %6, align 8, !tbaa !5
  %10 = shl nsw i32 %7, 1
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds double, ptr %3, i64 %11
  %13 = load ptr, ptr %0, align 8, !tbaa !9
  %14 = load i32, ptr %13, align 8, !tbaa !16
  %.not75 = icmp slt i32 %2, 0
  br i1 %.not75, label %.preheader74.thread, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %15 = getelementptr inbounds i8, ptr %13, i64 32
  %wide.trip.count = zext i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 10
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %16 = load double, ptr %15, align 8, !tbaa !23
  %17 = fneg double %16
  %18 = fmul double %17, %1
  %19 = getelementptr inbounds double, ptr %9, i64 %indvars.iv.prol
  store double %18, ptr %19, align 8, !tbaa !24
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !25

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %20 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %21 = icmp ugt i64 %20, -4
  br i1 %21, label %.preheader74, label %scalar.ph.preheader.new

scalar.ph.preheader.new:                          ; preds = %scalar.ph.prol.loopexit
  %invariant.gep = getelementptr i8, ptr %9, i64 8
  %invariant.gep179 = getelementptr i8, ptr %9, i64 16
  %invariant.gep181 = getelementptr i8, ptr %9, i64 24
  br label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph
  %22 = add nsw i64 %8, %wide.trip.count
  %23 = shl nsw i64 %22, 3
  %scevgep = getelementptr i8, ptr %3, i64 %23
  %scevgep147 = getelementptr i8, ptr %13, i64 40
  %bound0 = icmp ult ptr %9, %scevgep147
  %bound1 = icmp ult ptr %15, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 4294967292
  %broadcast.splatinsert150 = insertelement <2 x double> poison, double %1, i64 0
  %broadcast.splat151 = shufflevector <2 x double> %broadcast.splatinsert150, <2 x double> poison, <2 x i32> zeroinitializer
  %24 = load double, ptr %15, align 8, !tbaa !23, !alias.scope !27
  %broadcast.splatinsert148 = insertelement <2 x double> poison, double %24, i64 0
  %broadcast.splat149 = shufflevector <2 x double> %broadcast.splatinsert148, <2 x double> poison, <2 x i32> zeroinitializer
  %25 = fneg <2 x double> %broadcast.splat149
  %26 = fneg <2 x double> %broadcast.splat149
  %27 = fmul <2 x double> %broadcast.splat151, %25
  %28 = fmul <2 x double> %broadcast.splat151, %26
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %29 = getelementptr inbounds double, ptr %9, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <2 x double> %27, ptr %29, align 8, !tbaa !24, !alias.scope !30, !noalias !27
  store <2 x double> %28, ptr %30, align 8, !tbaa !24, !alias.scope !30, !noalias !27
  %index.next = add nuw i64 %index, 4
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !32

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader74, label %scalar.ph.preheader

.preheader74:                                     ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %32 = icmp sgt i32 %14, 0
  br i1 %32, label %.lr.ph93, label %._crit_edge94

.preheader74.thread:                              ; preds = %4
  %33 = icmp sgt i32 %14, 0
  br i1 %33, label %.lr.ph93.split.us.preheader, label %._crit_edge94

.lr.ph93:                                         ; preds = %.preheader74
  br i1 %.not75, label %.lr.ph93.split.us.preheader, label %.lr.ph93.split.preheader

.lr.ph93.split.preheader:                         ; preds = %.lr.ph93
  %wide.trip.count126 = zext nneg i32 %14 to i64
  %wide.trip.count121 = zext i32 %7 to i64
  %wide.trip.count111 = zext i32 %7 to i64
  %min.iters.check154 = icmp ult i32 %7, 4
  %n.vec157 = and i64 %wide.trip.count, 4294967292
  %cmp.n162 = icmp eq i64 %n.vec157, %wide.trip.count
  br label %.lr.ph93.split

.lr.ph93.split.us.preheader:                      ; preds = %.preheader74.thread, %.lr.ph93
  %wide.trip.count141 = zext nneg i32 %14 to i64
  br label %.lr.ph93.split.us

.lr.ph93.split.us:                                ; preds = %.lr.ph93.split.us.preheader, %.preheader73.us
  %indvars.iv138 = phi i64 [ 0, %.lr.ph93.split.us.preheader ], [ %indvars.iv.next139, %.preheader73.us ]
  call void @_ZSt4swapIPdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %34 = load ptr, ptr %0, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %indvars.iv138) #5
  %37 = load i32, ptr %36, align 8, !tbaa !36
  %.not7180.us = icmp slt i32 %37, 0
  br i1 %.not7180.us, label %.preheader73.us, label %.lr.ph83.us

38:                                               ; preds = %.lr.ph83.us, %._crit_edge.us
  %indvars.iv133 = phi i64 [ 0, %.lr.ph83.us ], [ %indvars.iv.next134, %._crit_edge.us ]
  %39 = getelementptr inbounds i32, ptr %71, i64 %indvars.iv133
  %40 = load i32, ptr %39, align 4, !tbaa !42
  %41 = getelementptr inbounds ptr, ptr %73, i64 %indvars.iv133
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = icmp sgt i32 %40, 0
  br i1 %43, label %.lr.ph79.us.preheader, label %._crit_edge.us

.lr.ph79.us.preheader:                            ; preds = %38
  %wide.trip.count131 = zext nneg i32 %40 to i64
  %xtraiter174 = and i64 %wide.trip.count131, 1
  %44 = icmp eq i32 %40, 1
  br i1 %44, label %._crit_edge.us.loopexit.unr-lcssa, label %.lr.ph79.us.preheader.new

.lr.ph79.us.preheader.new:                        ; preds = %.lr.ph79.us.preheader
  %unroll_iter177 = and i64 %wide.trip.count131, 2147483646
  br label %.lr.ph79.us

._crit_edge.us.loopexit.unr-lcssa:                ; preds = %.lr.ph79.us, %.lr.ph79.us.preheader
  %.165.us.lcssa.ph = phi double [ poison, %.lr.ph79.us.preheader ], [ %.165.us.1, %.lr.ph79.us ]
  %indvars.iv128.unr = phi i64 [ 0, %.lr.ph79.us.preheader ], [ %indvars.iv.next129.1, %.lr.ph79.us ]
  %.06477.us.unr = phi double [ -1.000000e+100, %.lr.ph79.us.preheader ], [ %.165.us.1, %.lr.ph79.us ]
  %lcmp.mod175.not = icmp eq i64 %xtraiter174, 0
  br i1 %lcmp.mod175.not, label %._crit_edge.us, label %.lr.ph79.us.epil

.lr.ph79.us.epil:                                 ; preds = %._crit_edge.us.loopexit.unr-lcssa
  %45 = getelementptr inbounds %struct.TCandidate, ptr %42, i64 %indvars.iv128.unr
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %47 = load double, ptr %46, align 8, !tbaa !43
  %48 = getelementptr inbounds i8, ptr %45, i64 24
  %49 = load double, ptr %48, align 8, !tbaa !45
  %50 = fneg double %49
  %51 = call double @llvm.fmuladd.f64(double %50, double %1, double %47)
  %52 = fcmp ogt double %51, %.06477.us.unr
  %.165.us.epil = select i1 %52, double %51, double %.06477.us.unr
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph79.us.epil, %._crit_edge.us.loopexit.unr-lcssa, %38
  %.064.lcssa.us = phi double [ -1.000000e+100, %38 ], [ %.165.us.lcssa.ph, %._crit_edge.us.loopexit.unr-lcssa ], [ %.165.us.epil, %.lr.ph79.us.epil ]
  %53 = getelementptr inbounds double, ptr %12, i64 %indvars.iv133
  store double %.064.lcssa.us, ptr %53, align 8, !tbaa !24
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
  br i1 %exitcond137.not, label %.preheader73.us, label %38, !llvm.loop !46

.lr.ph79.us:                                      ; preds = %.lr.ph79.us, %.lr.ph79.us.preheader.new
  %indvars.iv128 = phi i64 [ 0, %.lr.ph79.us.preheader.new ], [ %indvars.iv.next129.1, %.lr.ph79.us ]
  %.06477.us = phi double [ -1.000000e+100, %.lr.ph79.us.preheader.new ], [ %.165.us.1, %.lr.ph79.us ]
  %niter178 = phi i64 [ 0, %.lr.ph79.us.preheader.new ], [ %niter178.next.1, %.lr.ph79.us ]
  %54 = getelementptr inbounds %struct.TCandidate, ptr %42, i64 %indvars.iv128
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %56 = load double, ptr %55, align 8, !tbaa !43
  %57 = getelementptr inbounds i8, ptr %54, i64 24
  %58 = load double, ptr %57, align 8, !tbaa !45
  %59 = fneg double %58
  %60 = call double @llvm.fmuladd.f64(double %59, double %1, double %56)
  %61 = fcmp ogt double %60, %.06477.us
  %.165.us = select i1 %61, double %60, double %.06477.us
  %indvars.iv.next129 = or disjoint i64 %indvars.iv128, 1
  %62 = getelementptr inbounds %struct.TCandidate, ptr %42, i64 %indvars.iv.next129
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load double, ptr %63, align 8, !tbaa !43
  %65 = getelementptr inbounds i8, ptr %62, i64 24
  %66 = load double, ptr %65, align 8, !tbaa !45
  %67 = fneg double %66
  %68 = call double @llvm.fmuladd.f64(double %67, double %1, double %64)
  %69 = fcmp ogt double %68, %.165.us
  %.165.us.1 = select i1 %69, double %68, double %.165.us
  %indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
  %niter178.next.1 = add i64 %niter178, 2
  %niter178.ncmp.1 = icmp eq i64 %niter178.next.1, %unroll_iter177
  br i1 %niter178.ncmp.1, label %._crit_edge.us.loopexit.unr-lcssa, label %.lr.ph79.us, !llvm.loop !47

.preheader73.us:                                  ; preds = %._crit_edge.us, %.lr.ph93.split.us
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %exitcond142.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count141
  br i1 %exitcond142.not, label %._crit_edge94.loopexit, label %.lr.ph93.split.us, !llvm.loop !48

.lr.ph83.us:                                      ; preds = %.lr.ph93.split.us
  %70 = getelementptr inbounds i8, ptr %36, i64 48
  %71 = load ptr, ptr %70, align 8, !tbaa !49
  %72 = getelementptr inbounds i8, ptr %36, i64 40
  %73 = load ptr, ptr %72, align 8, !tbaa !50
  %74 = add nuw i32 %37, 1
  %wide.trip.count136 = zext i32 %74 to i64
  br label %38

scalar.ph:                                        ; preds = %scalar.ph, %scalar.ph.preheader.new
  %indvars.iv = phi i64 [ %indvars.iv.unr, %scalar.ph.preheader.new ], [ %indvars.iv.next.3, %scalar.ph ]
  %75 = load double, ptr %15, align 8, !tbaa !23
  %76 = fneg double %75
  %77 = fmul double %76, %1
  %78 = getelementptr inbounds double, ptr %9, i64 %indvars.iv
  store double %77, ptr %78, align 8, !tbaa !24
  %79 = load double, ptr %15, align 8, !tbaa !23
  %80 = fneg double %79
  %81 = fmul double %80, %1
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv
  store double %81, ptr %gep, align 8, !tbaa !24
  %82 = load double, ptr %15, align 8, !tbaa !23
  %83 = fneg double %82
  %84 = fmul double %83, %1
  %gep180 = getelementptr double, ptr %invariant.gep179, i64 %indvars.iv
  store double %84, ptr %gep180, align 8, !tbaa !24
  %85 = load double, ptr %15, align 8, !tbaa !23
  %86 = fneg double %85
  %87 = fmul double %86, %1
  %gep182 = getelementptr double, ptr %invariant.gep181, i64 %indvars.iv
  store double %87, ptr %gep182, align 8, !tbaa !24
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.preheader74, label %scalar.ph, !llvm.loop !51

._crit_edge94.loopexit:                           ; preds = %.preheader73.us
  %.pre = load ptr, ptr %6, align 8, !tbaa !5
  br label %._crit_edge94

._crit_edge94:                                    ; preds = %._crit_edge91, %.preheader74.thread, %._crit_edge94.loopexit, %.preheader74
  %88 = phi ptr [ %.pre, %._crit_edge94.loopexit ], [ %9, %.preheader74 ], [ %9, %.preheader74.thread ], [ %167, %._crit_edge91 ]
  %89 = sext i32 %2 to i64
  %90 = getelementptr inbounds double, ptr %88, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret double %91

.lr.ph93.split:                                   ; preds = %.lr.ph93.split.preheader, %._crit_edge91
  %indvars.iv123 = phi i64 [ 0, %.lr.ph93.split.preheader ], [ %indvars.iv.next124, %._crit_edge91 ]
  call void @_ZSt4swapIPdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %92 = load ptr, ptr %0, align 8, !tbaa !9
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  %94 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNSt6vectorI5TNestSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %indvars.iv123) #5
  %95 = load i32, ptr %94, align 8, !tbaa !36
  %.not7180 = icmp slt i32 %95, 0
  br i1 %.not7180, label %.preheader73.thread, label %.lr.ph83

.preheader73.thread:                              ; preds = %.lr.ph93.split
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  br i1 %min.iters.check154, label %.preheader.preheader, label %vector.body159

.preheader.preheader:                             ; preds = %middle.block152, %.preheader73.thread
  %indvars.iv108.ph = phi i64 [ 0, %.preheader73.thread ], [ %n.vec157, %middle.block152 ]
  br label %.preheader

.lr.ph83:                                         ; preds = %.lr.ph93.split
  %97 = getelementptr inbounds i8, ptr %94, i64 48
  %98 = load ptr, ptr %97, align 8, !tbaa !49
  %99 = getelementptr inbounds i8, ptr %94, i64 40
  %100 = load ptr, ptr %99, align 8, !tbaa !50
  %101 = add nuw i32 %95, 1
  %wide.trip.count106 = zext i32 %101 to i64
  br label %134

.preheader73:                                     ; preds = %._crit_edge
  %102 = load ptr, ptr %5, align 8
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = zext nneg i32 %95 to i64
  br label %.preheader.us

vector.body159:                                   ; preds = %.preheader73.thread, %vector.body159
  %index160 = phi i64 [ %index.next161, %vector.body159 ], [ 0, %.preheader73.thread ]
  %105 = getelementptr inbounds double, ptr %96, i64 %index160
  %106 = getelementptr inbounds i8, ptr %105, i64 16
  store <2 x double> <double -1.000000e+100, double -1.000000e+100>, ptr %105, align 8, !tbaa !24
  store <2 x double> <double -1.000000e+100, double -1.000000e+100>, ptr %106, align 8, !tbaa !24
  %index.next161 = add nuw i64 %index160, 4
  %107 = icmp eq i64 %index.next161, %n.vec157
  br i1 %107, label %middle.block152, label %vector.body159, !llvm.loop !52

middle.block152:                                  ; preds = %vector.body159
  br i1 %cmp.n162, label %._crit_edge91, label %.preheader.preheader

.preheader.us:                                    ; preds = %.preheader73, %._crit_edge87.us
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %._crit_edge87.us ], [ 0, %.preheader73 ]
  %umin168 = call i64 @llvm.umin.i64(i64 %indvars.iv118, i64 %104)
  %108 = icmp eq i64 %umin168, 0
  br i1 %108, label %._crit_edge87.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us
  %109 = add nuw nsw i64 %umin168, 1
  %unroll_iter172 = and i64 %109, 4294967294
  br label %110

110:                                              ; preds = %110, %.preheader.us.new
  %indvars.iv113 = phi i64 [ 0, %.preheader.us.new ], [ %indvars.iv.next114.1, %110 ]
  %.05984.us = phi double [ -1.000000e+100, %.preheader.us.new ], [ %.1.us.1, %110 ]
  %niter173 = phi i64 [ 0, %.preheader.us.new ], [ %niter173.next.1, %110 ]
  %111 = sub nsw i64 %indvars.iv118, %indvars.iv113
  %112 = getelementptr inbounds double, ptr %102, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !24
  %114 = getelementptr inbounds double, ptr %12, i64 %indvars.iv113
  %115 = load double, ptr %114, align 8, !tbaa !24
  %116 = fadd double %113, %115
  %117 = fcmp ogt double %116, %.05984.us
  %.1.us = select i1 %117, double %116, double %.05984.us
  %indvars.iv.next114 = or disjoint i64 %indvars.iv113, 1
  %118 = sub nsw i64 %indvars.iv118, %indvars.iv.next114
  %119 = getelementptr inbounds double, ptr %102, i64 %118
  %120 = load double, ptr %119, align 8, !tbaa !24
  %121 = getelementptr inbounds double, ptr %12, i64 %indvars.iv.next114
  %122 = load double, ptr %121, align 8, !tbaa !24
  %123 = fadd double %120, %122
  %124 = fcmp ogt double %123, %.1.us
  %.1.us.1 = select i1 %124, double %123, double %.1.us
  %indvars.iv.next114.1 = add nuw nsw i64 %indvars.iv113, 2
  %niter173.next.1 = add i64 %niter173, 2
  %niter173.ncmp.1 = icmp eq i64 %niter173.next.1, %unroll_iter172
  br i1 %niter173.ncmp.1, label %._crit_edge87.us.unr-lcssa, label %110, !llvm.loop !53

._crit_edge87.us.unr-lcssa:                       ; preds = %110, %.preheader.us
  %.1.us.lcssa.ph = phi double [ poison, %.preheader.us ], [ %.1.us.1, %110 ]
  %indvars.iv113.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next114.1, %110 ]
  %.05984.us.unr = phi double [ -1.000000e+100, %.preheader.us ], [ %.1.us.1, %110 ]
  %125 = and i64 %umin168, 1
  %lcmp.mod170.not.not = icmp eq i64 %125, 0
  br i1 %lcmp.mod170.not.not, label %._crit_edge87.us.epilog-lcssa, label %._crit_edge87.us

._crit_edge87.us.epilog-lcssa:                    ; preds = %._crit_edge87.us.unr-lcssa
  %126 = sub nsw i64 %indvars.iv118, %indvars.iv113.unr
  %127 = getelementptr inbounds double, ptr %102, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !24
  %129 = getelementptr inbounds double, ptr %12, i64 %indvars.iv113.unr
  %130 = load double, ptr %129, align 8, !tbaa !24
  %131 = fadd double %128, %130
  %132 = fcmp ogt double %131, %.05984.us.unr
  %.1.us.epil = select i1 %132, double %131, double %.05984.us.unr
  br label %._crit_edge87.us

._crit_edge87.us:                                 ; preds = %._crit_edge87.us.unr-lcssa, %._crit_edge87.us.epilog-lcssa
  %.1.us.lcssa = phi double [ %.1.us.lcssa.ph, %._crit_edge87.us.unr-lcssa ], [ %.1.us.epil, %._crit_edge87.us.epilog-lcssa ]
  %133 = getelementptr inbounds double, ptr %103, i64 %indvars.iv118
  store double %.1.us.lcssa, ptr %133, align 8, !tbaa !24
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %._crit_edge91, label %.preheader.us, !llvm.loop !54

134:                                              ; preds = %.lr.ph83, %._crit_edge
  %indvars.iv103 = phi i64 [ 0, %.lr.ph83 ], [ %indvars.iv.next104, %._crit_edge ]
  %135 = getelementptr inbounds i32, ptr %98, i64 %indvars.iv103
  %136 = load i32, ptr %135, align 4, !tbaa !42
  %137 = getelementptr inbounds ptr, ptr %100, i64 %indvars.iv103
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = icmp sgt i32 %136, 0
  br i1 %139, label %.lr.ph79.preheader, label %._crit_edge

.lr.ph79.preheader:                               ; preds = %134
  %wide.trip.count101 = zext nneg i32 %136 to i64
  %xtraiter165 = and i64 %wide.trip.count101, 1
  %140 = icmp eq i32 %136, 1
  br i1 %140, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph79.preheader.new

.lr.ph79.preheader.new:                           ; preds = %.lr.ph79.preheader
  %unroll_iter = and i64 %wide.trip.count101, 2147483646
  br label %.lr.ph79

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph79, %.lr.ph79.preheader
  %.165.lcssa.ph = phi double [ poison, %.lr.ph79.preheader ], [ %.165.1, %.lr.ph79 ]
  %indvars.iv98.unr = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next99.1, %.lr.ph79 ]
  %.06477.unr = phi double [ -1.000000e+100, %.lr.ph79.preheader ], [ %.165.1, %.lr.ph79 ]
  %lcmp.mod166.not = icmp eq i64 %xtraiter165, 0
  br i1 %lcmp.mod166.not, label %._crit_edge, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %141 = getelementptr inbounds %struct.TCandidate, ptr %138, i64 %indvars.iv98.unr
  %142 = getelementptr inbounds i8, ptr %141, i64 16
  %143 = load double, ptr %142, align 8, !tbaa !43
  %144 = getelementptr inbounds i8, ptr %141, i64 24
  %145 = load double, ptr %144, align 8, !tbaa !45
  %146 = fneg double %145
  %147 = call double @llvm.fmuladd.f64(double %146, double %1, double %143)
  %148 = fcmp ogt double %147, %.06477.unr
  %.165.epil = select i1 %148, double %147, double %.06477.unr
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph79.epil, %._crit_edge.loopexit.unr-lcssa, %134
  %.064.lcssa = phi double [ -1.000000e+100, %134 ], [ %.165.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.165.epil, %.lr.ph79.epil ]
  %149 = getelementptr inbounds double, ptr %12, i64 %indvars.iv103
  store double %.064.lcssa, ptr %149, align 8, !tbaa !24
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count106
  br i1 %exitcond107.not, label %.preheader73, label %134, !llvm.loop !46

.lr.ph79:                                         ; preds = %.lr.ph79, %.lr.ph79.preheader.new
  %indvars.iv98 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %indvars.iv.next99.1, %.lr.ph79 ]
  %.06477 = phi double [ -1.000000e+100, %.lr.ph79.preheader.new ], [ %.165.1, %.lr.ph79 ]
  %niter = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %niter.next.1, %.lr.ph79 ]
  %150 = getelementptr inbounds %struct.TCandidate, ptr %138, i64 %indvars.iv98
  %151 = getelementptr inbounds i8, ptr %150, i64 16
  %152 = load double, ptr %151, align 8, !tbaa !43
  %153 = getelementptr inbounds i8, ptr %150, i64 24
  %154 = load double, ptr %153, align 8, !tbaa !45
  %155 = fneg double %154
  %156 = call double @llvm.fmuladd.f64(double %155, double %1, double %152)
  %157 = fcmp ogt double %156, %.06477
  %.165 = select i1 %157, double %156, double %.06477
  %indvars.iv.next99 = or disjoint i64 %indvars.iv98, 1
  %158 = getelementptr inbounds %struct.TCandidate, ptr %138, i64 %indvars.iv.next99
  %159 = getelementptr inbounds i8, ptr %158, i64 16
  %160 = load double, ptr %159, align 8, !tbaa !43
  %161 = getelementptr inbounds i8, ptr %158, i64 24
  %162 = load double, ptr %161, align 8, !tbaa !45
  %163 = fneg double %162
  %164 = call double @llvm.fmuladd.f64(double %163, double %1, double %160)
  %165 = fcmp ogt double %164, %.165
  %.165.1 = select i1 %165, double %164, double %.165
  %indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 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 %.lr.ph79, !llvm.loop !47

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.preheader ], [ %indvars.iv108.ph, %.preheader.preheader ]
  %166 = getelementptr inbounds double, ptr %96, i64 %indvars.iv108
  store double -1.000000e+100, ptr %166, align 8, !tbaa !24
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond112.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count111
  br i1 %exitcond112.not, label %._crit_edge91, label %.preheader, !llvm.loop !55

._crit_edge91:                                    ; preds = %._crit_edge87.us, %.preheader, %middle.block152
  %167 = phi ptr [ %96, %middle.block152 ], [ %96, %.preheader ], [ %103, %._crit_edge87.us ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %._crit_edge94, label %.lr.ph93.split, !llvm.loop !48
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #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 #0 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!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 = !{!17, !18, i64 0}
!17 = !{!"_ZTS16NestedLogitModel", !18, i64 0, !19, i64 8, !15, i64 32}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSSt6vectorI5TNestSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseI5TNestSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI5TNestSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!17, !15, i64 32}
!24 = !{!15, !15, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.unroll.disable"}
!27 = !{!28}
!28 = distinct !{!28, !29}
!29 = distinct !{!29, !"LVerDomain"}
!30 = !{!31}
!31 = distinct !{!31, !29}
!32 = distinct !{!32, !33, !34, !35}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!"llvm.loop.isvectorized", i32 1}
!35 = !{!"llvm.loop.unroll.runtime.disable"}
!36 = !{!37, !18, i64 0}
!37 = !{!"_ZTS5TNest", !18, i64 0, !15, i64 8, !38, i64 16, !6, i64 40, !6, i64 48, !18, i64 56, !6, i64 64, !6, i64 72, !18, i64 80}
!38 = !{!"_ZTSSt6vectorI8TProductSaIS0_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseI8TProductSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI8TProductSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!18, !18, i64 0}
!43 = !{!44, !15, i64 16}
!44 = !{!"_ZTS10TCandidate", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!45 = !{!44, !15, i64 24}
!46 = distinct !{!46, !33}
!47 = distinct !{!47, !33}
!48 = distinct !{!48, !33}
!49 = !{!37, !6, i64 48}
!50 = !{!37, !6, i64 40}
!51 = distinct !{!51, !33, !34}
!52 = distinct !{!52, !33, !34, !35}
!53 = distinct !{!53, !33}
!54 = distinct !{!54, !33}
!55 = distinct !{!55, !33, !35, !34}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass