; LLVM IR from Rintarooo/VRPTW_ACO_Routing :: src/graph.ll (ZN5Graph19run_GreedyAlgorithmEv)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.Node = type { i32, i32, i32, i32, i8, i32, i32, i32 }
%class.Graph = type { ptr, i32, i32, ptr, ptr, ptr }
%class.Car = type { i32, i32, i32, i32, i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5Graph14is_all_visitedEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Graph19run_GreedyAlgorithmEv(ptr noundef nonnull align 8 dereferenceable(40) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca %class.Node, align 8
  %9 = alloca %class.Node, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %159, %1
  %14 = call noundef zeroext i1 @_ZNK5Graph14is_all_visitedEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
  %15 = xor i1 %14, true
  br i1 %15, label %16, label %160

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store double 1.000000e+05, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 1, ptr %6, align 1, !tbaa !13
  %17 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %18 = load ptr, ptr %17, align 8, !tbaa !15
  %19 = load i32, ptr %3, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds %class.Car, ptr %18, i64 %20
  %22 = getelementptr inbounds %class.Car, ptr %21, i32 0, i32 5
  %23 = call noundef zeroext i1 @_ZNKSt6vectorI4NodeSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #6
  br i1 %23, label %24, label %35

24:                                               ; preds = %16
  %25 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %class.Car, ptr %26, i64 %28
  %30 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = getelementptr inbounds %class.Node, ptr %31, i64 0
  %33 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef %32, ptr noundef %34)
  br label %35

35:                                               ; preds = %24, %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %104, %35
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %40 = icmp slt i32 %37, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %107

42:                                               ; preds = %36
  %43 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %class.Node, ptr %44, i64 %46
  %48 = getelementptr inbounds %class.Node, ptr %47, i32 0, i32 4
  %49 = load i8, ptr %48, align 4, !tbaa !20, !range !22, !noundef !23
  %50 = trunc i8 %49 to i1
  br i1 %50, label %103, label %51

51:                                               ; preds = %42
  %52 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %class.Car, ptr %53, i64 %55
  %57 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %class.Node, ptr %58, i64 %60
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %61, i64 32, i1 false), !tbaa.struct !24
  %62 = call noundef zeroext i1 @_ZNK3Car11ok_capacityE4Node(ptr noundef nonnull align 8 dereferenceable(48) %56, ptr noundef byval(%class.Node) align 8 %8)
  br i1 %62, label %63, label %102

63:                                               ; preds = %51
  %64 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  %66 = load i32, ptr %3, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %class.Car, ptr %65, i64 %67
  %69 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %class.Node, ptr %70, i64 %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %73, i64 32, i1 false), !tbaa.struct !24
  %74 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = call noundef zeroext i1 @_ZNK3Car7ok_timeE4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %68, ptr noundef byval(%class.Node) align 8 %9, ptr noundef %75)
  br i1 %76, label %77, label %101

77:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %78 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = load i32, ptr %3, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %class.Car, ptr %81, i64 %83
  %85 = getelementptr inbounds %class.Car, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 8, !tbaa !25
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds ptr, ptr %79, i64 %87
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %89, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  store double %93, ptr %10, align 8, !tbaa !11
  %94 = load double, ptr %10, align 8, !tbaa !11
  %95 = load double, ptr %5, align 8, !tbaa !11
  %96 = fcmp olt double %94, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %77
  %98 = load double, ptr %10, align 8, !tbaa !11
  store double %98, ptr %5, align 8, !tbaa !11
  store i8 0, ptr %6, align 1, !tbaa !13
  %99 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %99, ptr %4, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %97, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %101

101:                                              ; preds = %100, %63
  br label %102

102:                                              ; preds = %101, %51
  br label %103

103:                                              ; preds = %102, %42
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !9
  br label %36, !llvm.loop !31

107:                                              ; preds = %41
  %108 = load i8, ptr %6, align 1, !tbaa !13, !range !22, !noundef !23
  %109 = trunc i8 %108 to i1
  br i1 %109, label %123, label %110

110:                                              ; preds = %107
  %111 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = load i32, ptr %3, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %class.Car, ptr %112, i64 %114
  %116 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %117 = load ptr, ptr %116, align 8, !tbaa !17
  %118 = load i32, ptr %4, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds %class.Node, ptr %117, i64 %119
  %121 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %122 = load ptr, ptr %121, align 8, !tbaa !18
  call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %115, ptr noundef %120, ptr noundef %122)
  br label %156

123:                                              ; preds = %107
  %124 = load i32, ptr %3, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  %126 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 1
  %127 = load i32, ptr %126, align 8, !tbaa !33
  %128 = icmp slt i32 %125, %127
  br i1 %128, label %129, label %152

129:                                              ; preds = %123
  %130 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = load i32, ptr %3, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds %class.Car, ptr %131, i64 %133
  %135 = getelementptr inbounds %class.Car, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 8, !tbaa !25
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %149

138:                                              ; preds = %129
  %139 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %140 = load ptr, ptr %139, align 8, !tbaa !15
  %141 = load i32, ptr %3, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds %class.Car, ptr %140, i64 %142
  %144 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %145 = load ptr, ptr %144, align 8, !tbaa !17
  %146 = getelementptr inbounds %class.Node, ptr %145, i64 0
  %147 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %148 = load ptr, ptr %147, align 8, !tbaa !18
  call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %143, ptr noundef %146, ptr noundef %148)
  br label %149

149:                                              ; preds = %138, %129
  %150 = load i32, ptr %3, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %3, align 4, !tbaa !9
  br label %155

152:                                              ; preds = %123
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.8)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 3, ptr %11, align 4
  br label %157

155:                                              ; preds = %149
  br label %156

156:                                              ; preds = %155, %110
  store i32 0, ptr %11, align 4
  br label %157

157:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %158 = load i32, ptr %11, align 4
  switch i32 %158, label %183 [
    i32 0, label %159
    i32 3, label %160
  ]

159:                                              ; preds = %157
  br label %13, !llvm.loop !34

160:                                              ; preds = %157, %13
  %161 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %162 = load ptr, ptr %161, align 8, !tbaa !15
  %163 = load i32, ptr %3, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %class.Car, ptr %162, i64 %164
  %166 = getelementptr inbounds %class.Car, ptr %165, i32 0, i32 2
  %167 = load i32, ptr %166, align 8, !tbaa !25
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %180

169:                                              ; preds = %160
  %170 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 3
  %171 = load ptr, ptr %170, align 8, !tbaa !15
  %172 = load i32, ptr %3, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds %class.Car, ptr %171, i64 %173
  %175 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !17
  %177 = getelementptr inbounds %class.Node, ptr %176, i64 0
  %178 = getelementptr inbounds %class.Graph, ptr %12, i32 0, i32 5
  %179 = load ptr, ptr %178, align 8, !tbaa !18
  call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %174, ptr noundef %177, ptr noundef %179)
  br label %180

180:                                              ; preds = %169, %160
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.9)
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %181, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void

183:                                              ; preds = %157
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorI4NodeSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef) #4

declare noundef zeroext i1 @_ZNK3Car11ok_capacityE4Node(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef byval(%class.Node) align 8) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

declare noundef zeroext i1 @_ZNK3Car7ok_timeE4NodePPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef byval(%class.Node) align 8, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS5Graph", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32}
!17 = !{!16, !6, i64 24}
!18 = !{!16, !6, i64 32}
!19 = !{!16, !10, i64 12}
!20 = !{!21, !14, i64 16}
!21 = !{!"_ZTS4Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !14, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 1, !13, i64 20, i64 4, !9, i64 24, i64 4, !9, i64 28, i64 4, !9}
!25 = !{!26, !10, i64 8}
!26 = !{!"_ZTS3Car", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !27, i64 24}
!27 = !{!"_ZTSSt6vectorI4NodeSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseI4NodeSaIS0_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!16, !10, i64 8}
!34 = distinct !{!34, !32}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.Node = type { i32, i32, i32, i32, i8, i32, i32, i32 }
%class.Car = type { i32, i32, i32, i32, i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5Graph14is_all_visitedEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Graph19run_GreedyAlgorithmEv(ptr noundef nonnull align 8 dereferenceable(40) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %class.Node, align 8
  %3 = alloca %class.Node, align 8
  %4 = tail call noundef zeroext i1 @_ZNK5Graph14is_all_visitedEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br i1 %4, label %.loopexit, label %.lr.ph53

.lr.ph53:                                         ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = getelementptr inbounds i8, ptr %0, i64 12
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  br label %10

10:                                               ; preds = %.lr.ph53, %75
  %.02551 = phi i32 [ 0, %.lr.ph53 ], [ %.2, %75 ]
  %.03350 = phi i32 [ undef, %.lr.ph53 ], [ %.134.lcssa58, %75 ]
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = sext i32 %.02551 to i64
  %13 = getelementptr inbounds %class.Car, ptr %11, i64 %12, i32 5
  %14 = tail call noundef zeroext i1 @_ZNKSt6vectorI4NodeSaIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br i1 %14, label %15, label %20

15:                                               ; preds = %10
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %class.Car, ptr %16, i64 %12
  %18 = load ptr, ptr %6, align 8, !tbaa !11
  %19 = load ptr, ptr %7, align 8, !tbaa !12
  tail call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %17, ptr noundef %18, ptr noundef %19)
  br label %20

20:                                               ; preds = %15, %10
  %21 = load i32, ptr %8, align 4, !tbaa !13
  %22 = icmp sgt i32 %21, 1
  br i1 %22, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %51
  br i1 %.229, label %._crit_edge.thread, label %55

.lr.ph:                                           ; preds = %20, %51
  %indvars.iv = phi i64 [ %indvars.iv.next, %51 ], [ 1, %20 ]
  %.02747 = phi i1 [ %.229, %51 ], [ true, %20 ]
  %.03046 = phi double [ %.232, %51 ], [ 1.000000e+05, %20 ]
  %.13445 = phi i32 [ %.336, %51 ], [ %.03350, %20 ]
  %23 = load ptr, ptr %6, align 8, !tbaa !11
  %24 = getelementptr inbounds %class.Node, ptr %23, i64 %indvars.iv
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %26 = load i8, ptr %25, align 4, !tbaa !14, !range !17, !noundef !18
  %27 = trunc nuw i8 %26 to i1
  br i1 %27, label %51, label %28

28:                                               ; preds = %.lr.ph
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.Car, ptr %29, i64 %12
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 4 dereferenceable(32) %24, i64 32, i1 false), !tbaa.struct !19
  %31 = tail call noundef zeroext i1 @_ZNK3Car11ok_capacityE4Node(ptr noundef nonnull align 8 dereferenceable(48) %30, ptr noundef nonnull byval(%class.Node) align 8 %2)
  br i1 %31, label %32, label %51

32:                                               ; preds = %28
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.Car, ptr %33, i64 %12
  %35 = load ptr, ptr %6, align 8, !tbaa !11
  %36 = getelementptr inbounds %class.Node, ptr %35, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 4 dereferenceable(32) %36, i64 32, i1 false), !tbaa.struct !19
  %37 = load ptr, ptr %7, align 8, !tbaa !12
  %38 = tail call noundef zeroext i1 @_ZNK3Car7ok_timeE4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %34, ptr noundef nonnull byval(%class.Node) align 8 %3, ptr noundef %37)
  br i1 %38, label %39, label %51

39:                                               ; preds = %32
  %40 = load ptr, ptr %7, align 8, !tbaa !12
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %class.Car, ptr %41, i64 %12, i32 2
  %43 = load i32, ptr %42, align 8, !tbaa !22
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %40, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !28
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv
  %48 = load double, ptr %47, align 8, !tbaa !29
  %49 = fcmp uge double %48, %.03046
  %50 = trunc nuw nsw i64 %indvars.iv to i32
  %.235 = select i1 %49, i32 %.13445, i32 %50
  %.131 = select i1 %49, double %.03046, double %48
  %.128 = select i1 %49, i1 %.02747, i1 false
  br label %51

51:                                               ; preds = %.lr.ph, %32, %39, %28
  %.336 = phi i32 [ %.13445, %.lr.ph ], [ %.235, %39 ], [ %.13445, %32 ], [ %.13445, %28 ]
  %.232 = phi double [ %.03046, %.lr.ph ], [ %.131, %39 ], [ %.03046, %32 ], [ %.03046, %28 ]
  %.229 = phi i1 [ %.02747, %.lr.ph ], [ %.128, %39 ], [ %.02747, %32 ], [ %.02747, %28 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %52 = load i32, ptr %8, align 4, !tbaa !13
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !31

55:                                               ; preds = %._crit_edge
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.Car, ptr %56, i64 %12
  %58 = load ptr, ptr %6, align 8, !tbaa !11
  %59 = sext i32 %.336 to i64
  %60 = getelementptr inbounds %class.Node, ptr %58, i64 %59
  %61 = load ptr, ptr %7, align 8, !tbaa !12
  tail call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %57, ptr noundef %60, ptr noundef %61)
  br label %75

._crit_edge.thread:                               ; preds = %20, %._crit_edge
  %.134.lcssa59 = phi i32 [ %.336, %._crit_edge ], [ %.03350, %20 ]
  %62 = add nsw i32 %.02551, 1
  %63 = load i32, ptr %9, align 8, !tbaa !33
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %.thread

65:                                               ; preds = %._crit_edge.thread
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.Car, ptr %66, i64 %12
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = load i32, ptr %68, align 8, !tbaa !22
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %75, label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr %6, align 8, !tbaa !11
  %72 = load ptr, ptr %7, align 8, !tbaa !12
  tail call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %67, ptr noundef %71, ptr noundef %72)
  br label %75

.thread:                                          ; preds = %._crit_edge.thread
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.8)
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit

75:                                               ; preds = %55, %70, %65
  %.134.lcssa58 = phi i32 [ %.336, %55 ], [ %.134.lcssa59, %70 ], [ %.134.lcssa59, %65 ]
  %.2 = phi i32 [ %.02551, %55 ], [ %62, %70 ], [ %62, %65 ]
  %76 = tail call noundef zeroext i1 @_ZNK5Graph14is_all_visitedEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br i1 %76, label %.loopexit, label %10

.loopexit:                                        ; preds = %75, %1, %.thread
  %.02544 = phi i32 [ %.02551, %.thread ], [ 0, %1 ], [ %.2, %75 ]
  %77 = getelementptr inbounds i8, ptr %0, i64 16
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = sext i32 %.02544 to i64
  %80 = getelementptr inbounds %class.Car, ptr %78, i64 %79
  %81 = getelementptr inbounds i8, ptr %80, i64 8
  %82 = load i32, ptr %81, align 8, !tbaa !22
  %.not39 = icmp eq i32 %82, 0
  br i1 %.not39, label %88, label %83

83:                                               ; preds = %.loopexit
  %84 = getelementptr inbounds i8, ptr %0, i64 24
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = getelementptr inbounds i8, ptr %0, i64 32
  %87 = load ptr, ptr %86, align 8, !tbaa !12
  tail call void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48) %80, ptr noundef %85, ptr noundef %87)
  br label %88

88:                                               ; preds = %83, %.loopexit
  %89 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.9)
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret void
}

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

declare void @_ZN3Car8add_nodeEP4NodePPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZNK3Car11ok_capacityE4Node(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef byval(%class.Node) align 8) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare noundef zeroext i1 @_ZNK3Car7ok_timeE4NodePPd(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef byval(%class.Node) align 8, ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 16}
!6 = !{!"_ZTS5Graph", !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 24}
!12 = !{!6, !10, i64 32}
!13 = !{!6, !7, i64 12}
!14 = !{!15, !16, i64 16}
!15 = !{!"_ZTS4Node", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !16, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!16 = !{!"bool", !8, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 12, i64 4, !20, i64 16, i64 1, !21, i64 20, i64 4, !20, i64 24, i64 4, !20, i64 28, i64 4, !20}
!20 = !{!7, !7, i64 0}
!21 = !{!16, !16, i64 0}
!22 = !{!23, !7, i64 8}
!23 = !{!"_ZTS3Car", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !24, i64 24}
!24 = !{!"_ZTSSt6vectorI4NodeSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseI4NodeSaIS0_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseI4NodeSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!28 = !{!10, !10, i64 0}
!29 = !{!30, !30, i64 0}
!30 = !{!"double", !8, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !7, i64 8}


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