; LLVM IR from vss2sn/cvrp :: src/utils.ll (ZN8Solution21CreateInitialSolutionEv)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl.base", [3 x i8] }
%"struct.std::_Tuple_impl.base" = type { %"struct.std::_Tuple_impl.20", %"struct.std::_Head_base.21" }
%"struct.std::_Tuple_impl.20" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %struct.Node }
%struct.Node = type <{ i32, i32, i32, i32, i8, [3 x i8] }>
%"struct.std::_Head_base.21" = type { i8 }
%class.Solution = type { ptr, %"class.std::vector.10", %"class.std::vector.15", %"class.std::vector.0", %struct.Node, i32 }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<Vehicle, std::allocator<Vehicle>>::_Vector_impl" }
%"struct.std::_Vector_base<Vehicle, std::allocator<Vehicle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vehicle, std::allocator<Vehicle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vehicle, std::allocator<Vehicle>>::_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<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Vehicle = type { i32, i32, i32, double, %"class.std::vector" }
%"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 }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Solution21CreateInitialSolutionEv(ptr noundef nonnull align 8 dereferenceable(104) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::tuple", align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %12 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 2
  store ptr %12, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call ptr @_ZNSt6vectorI7VehicleSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  %15 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %14, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call ptr @_ZNSt6vectorI7VehicleSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  br label %19

19:                                               ; preds = %104, %1
  %20 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP7VehicleSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  br i1 %20, label %22, label %21

21:                                               ; preds = %19
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %106

22:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %23 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP7VehicleSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  store ptr %23, ptr %7, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %102, %22
  br label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNK8Solution12find_closestERK7Vehicle(ptr dead_on_unwind writable sret(%"class.std::tuple") align 4 %8, ptr noundef nonnull align 8 dereferenceable(104) %11, ptr noundef nonnull align 8 dereferenceable(48) %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZSt3getILm0EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %8) #4
  store ptr %27, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %28 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZSt3getILm1EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %8) #4
  store ptr %28, ptr %10, align 8, !tbaa !5
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = load i8, ptr %29, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %77

32:                                               ; preds = %25
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Vehicle, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !13
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Node, ptr %36, i32 0, i32 3
  %38 = load i32, ptr %37, align 4, !tbaa !21
  %39 = sub nsw i32 %35, %38
  %40 = icmp sge i32 %39, 0
  br i1 %40, label %41, label %77

41:                                               ; preds = %32
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.Node, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !21
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.Vehicle, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = sub nsw i32 %47, %44
  store i32 %48, ptr %46, align 4, !tbaa !13
  %49 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 3
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Vehicle, ptr %50, i32 0, i32 4
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #4
  %53 = load i32, ptr %52, align 4, !tbaa !23
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %54) #4
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.Node, ptr %56, i32 0, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !24
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %59) #4
  %61 = load double, ptr %60, align 8, !tbaa !25
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Vehicle, ptr %62, i32 0, i32 3
  %64 = load double, ptr %63, align 8, !tbaa !26
  %65 = fadd double %64, %61
  store double %65, ptr %63, align 8, !tbaa !26
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Vehicle, ptr %66, i32 0, i32 4
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Node, ptr %68, i32 0, i32 2
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %70 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 1
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Node, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !24
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZNSt6vectorI4NodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %74) #4
  %76 = getelementptr inbounds %struct.Node, ptr %75, i32 0, i32 4
  store i8 1, ptr %76, align 4, !tbaa !27
  br label %99

77:                                               ; preds = %32, %25
  %78 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 3
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Vehicle, ptr %79, i32 0, i32 4
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #4
  %82 = load i32, ptr %81, align 4, !tbaa !23
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %83) #4
  %85 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 4
  %86 = getelementptr inbounds %struct.Node, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !28
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %88) #4
  %90 = load double, ptr %89, align 8, !tbaa !25
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Vehicle, ptr %91, i32 0, i32 3
  %93 = load double, ptr %92, align 8, !tbaa !26
  %94 = fadd double %93, %90
  store double %94, ptr %92, align 8, !tbaa !26
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Vehicle, ptr %95, i32 0, i32 4
  %97 = getelementptr inbounds %class.Solution, ptr %11, i32 0, i32 4
  %98 = getelementptr inbounds %struct.Node, ptr %97, i32 0, i32 2
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 4 dereferenceable(4) %98)
  store i32 5, ptr %6, align 4
  br label %100

99:                                               ; preds = %41
  store i32 0, ptr %6, align 4
  br label %100

100:                                              ; preds = %99, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  %101 = load i32, ptr %6, align 4
  switch i32 %101, label %107 [
    i32 0, label %102
    i32 5, label %103
  ]

102:                                              ; preds = %100
  br label %24, !llvm.loop !42

103:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %104

104:                                              ; preds = %103
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP7VehicleSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br label %19

106:                                              ; preds = %21
  ret void

107:                                              ; preds = %100
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Solution12find_closestERK7Vehicle(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(17) ptr @_ZSt3getILm1EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21)) #1

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !15, i64 4}
!14 = !{!"_ZTS7Vehicle", !15, i64 0, !15, i64 4, !15, i64 8, !16, i64 16, !17, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSSt6vectorIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!22, !15, i64 12}
!22 = !{!"_ZTS4Node", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !10, i64 16}
!23 = !{!15, !15, i64 0}
!24 = !{!22, !15, i64 8}
!25 = !{!16, !16, i64 0}
!26 = !{!14, !16, i64 16}
!27 = !{!22, !10, i64 16}
!28 = !{!29, !15, i64 88}
!29 = !{!"_ZTS8Solution", !30, i64 8, !34, i64 32, !38, i64 56, !22, i64 80, !15, i64 100}
!30 = !{!"_ZTSSt6vectorI4NodeSaIS0_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseI4NodeSaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSSt6vectorI7VehicleSaIS0_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseI7VehicleSaIS0_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI7VehicleSaIS0_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseI7VehicleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl.base", [3 x i8] }
%"struct.std::_Tuple_impl.base" = type { %"struct.std::_Tuple_impl.20", %"struct.std::_Head_base.21" }
%"struct.std::_Tuple_impl.20" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %struct.Node }
%struct.Node = type <{ i32, i32, i32, i32, i8, [3 x i8] }>
%"struct.std::_Head_base.21" = type { i8 }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Solution21CreateInitialSolutionEv(ptr noundef nonnull align 8 dereferenceable(104) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.std::tuple", align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %6 = tail call ptr @_ZNSt6vectorI7VehicleSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  store ptr %6, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %7 = tail call ptr @_ZNSt6vectorI7VehicleSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  store ptr %7, ptr %3, align 8
  %8 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP7VehicleSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br i1 %8, label %.lr.ph23, label %._crit_edge24

.lr.ph23:                                         ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  br label %12

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

12:                                               ; preds = %.lr.ph23, %._crit_edge
  %13 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP7VehicleSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNK8Solution12find_closestERK7Vehicle(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %4, ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(48) %13)
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZSt3getILm0EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %4) #4
  %16 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZSt3getILm1EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %4) #4
  %17 = load i8, ptr %15, align 1, !tbaa !5, !range !9, !noundef !10
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12
  %19 = getelementptr inbounds i8, ptr %13, i64 24
  %20 = getelementptr inbounds i8, ptr %13, i64 16
  br label %21

21:                                               ; preds = %.lr.ph, %28
  %22 = phi ptr [ %16, %.lr.ph ], [ %45, %28 ]
  %23 = load i32, ptr %14, align 4, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %22, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !20
  %26 = sub nsw i32 %23, %25
  %27 = icmp sgt i32 %26, -1
  br i1 %27, label %28, label %._crit_edge

28:                                               ; preds = %21
  store i32 %26, ptr %14, align 4, !tbaa !11
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #4
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %31) #4
  %33 = getelementptr inbounds i8, ptr %22, i64 8
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %35) #4
  %37 = load double, ptr %36, align 8, !tbaa !24
  %38 = load double, ptr %20, align 8, !tbaa !25
  %39 = fadd double %37, %38
  store double %39, ptr %20, align 8, !tbaa !25
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %40 = load i32, ptr %33, align 4, !tbaa !23
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZNSt6vectorI4NodeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %41) #4
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store i8 1, ptr %43, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNK8Solution12find_closestERK7Vehicle(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 4 %4, ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(48) %13)
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZSt3getILm0EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %4) #4
  %45 = call noundef nonnull align 4 dereferenceable(17) ptr @_ZSt3getILm1EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21) %4) #4
  %46 = load i8, ptr %44, align 1, !tbaa !5, !range !9, !noundef !10
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %21, label %._crit_edge

._crit_edge:                                      ; preds = %21, %28, %12
  %48 = getelementptr inbounds i8, ptr %13, i64 24
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %48) #4
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %51) #4
  %53 = load i32, ptr %11, align 8, !tbaa !27
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %54) #4
  %56 = load double, ptr %55, align 8, !tbaa !24
  %57 = getelementptr inbounds i8, ptr %13, i64 16
  %58 = load double, ptr %57, align 8, !tbaa !25
  %59 = fadd double %56, %58
  store double %59, ptr %57, align 8, !tbaa !25
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP7VehicleSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %61 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP7VehicleSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br i1 %61, label %12, label %._crit_edge24
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK8Solution12find_closestERK7Vehicle(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 4, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(17) ptr @_ZSt3getILm1EJb4NodeEEOKNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeEOKS5_(ptr noundef nonnull align 4 dereferenceable(21)) local_unnamed_addr #1

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !13, i64 4}
!12 = !{!"_ZTS7Vehicle", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !15, i64 24}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!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", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !7, i64 0}
!20 = !{!21, !13, i64 12}
!21 = !{!"_ZTS4Node", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !6, i64 16}
!22 = !{!13, !13, i64 0}
!23 = !{!21, !13, i64 8}
!24 = !{!14, !14, i64 0}
!25 = !{!12, !14, i64 16}
!26 = !{!21, !6, i64 16}
!27 = !{!28, !13, i64 88}
!28 = !{!"_ZTS8Solution", !29, i64 8, !33, i64 32, !37, i64 56, !21, i64 80, !13, i64 100}
!29 = !{!"_ZTSSt6vectorI4NodeSaIS0_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseI4NodeSaIS0_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!33 = !{!"_ZTSSt6vectorI7VehicleSaIS0_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseI7VehicleSaIS0_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseI7VehicleSaIS0_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI7VehicleSaIS0_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!37 = !{!"_ZTSSt6vectorIS_IdSaIdEESaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseISt6vectorIdSaIdEESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}


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