; LLVM IR from schostac/Advanced-Algorithms-and-Complexity :: week1/stock_charts.ll (Z15construct_graphmm)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.FlowGraph = type { %"class.std::vector.5", %"class.std::vector.10" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9read_datamm(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i64 noundef, i64 noundef) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15construct_graphmm(ptr dead_on_unwind noalias writable sret(%class.FlowGraph) align 8 %0, i64 noundef %1, i64 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store i64 %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %19 = load i64, ptr %5, align 8, !tbaa !5
  %20 = load i64, ptr %6, align 8, !tbaa !5
  call void @_Z9read_datamm(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %7, i64 noundef %19, i64 noundef %20)
  store i1 false, ptr %8, align 1
  %21 = load i64, ptr %5, align 8, !tbaa !5
  %22 = mul i64 %21, 2
  %23 = add i64 %22, 2
  invoke void @_ZN9FlowGraphC2Em(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %23)
          to label %24 unwind label %31

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %39, %24
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = icmp ult i64 %27, %28
  br i1 %29, label %35, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %46

31:                                               ; preds = %3
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  br label %150

35:                                               ; preds = %25
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef 0, i32 noundef %37, i32 noundef 1)
          to label %38 unwind label %42

38:                                               ; preds = %35
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %11, align 4, !tbaa !9
  br label %25, !llvm.loop !11

42:                                               ; preds = %35
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %9, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %149

46:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %117, %46
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = load i64, ptr %5, align 8, !tbaa !5
  %51 = icmp ult i64 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %120

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %54 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %54, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %113, %53
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %116

61:                                               ; preds = %55
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = icmp eq i32 %62, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  br label %113

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  store i8 1, ptr %16, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %91, %66
  %68 = load i32, ptr %17, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = load i64, ptr %6, align 8, !tbaa !5
  %71 = icmp ult i64 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %67
  store i32 11, ptr %13, align 4
  br label %94

73:                                               ; preds = %67
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %75) #5
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %78) #5
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %82) #5
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %85) #5
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = icmp sge i32 %80, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %73
  store i8 0, ptr %16, align 1, !tbaa !13
  store i32 11, ptr %13, align 4
  br label %94

90:                                               ; preds = %73
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %17, align 4, !tbaa !9
  br label %67, !llvm.loop !15

94:                                               ; preds = %89, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %95

95:                                               ; preds = %94
  %96 = load i8, ptr %16, align 1, !tbaa !13, !range !16, !noundef !17
  %97 = trunc i8 %96 to i1
  br i1 %97, label %98, label %112

98:                                               ; preds = %95
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  %101 = load i64, ptr %5, align 8, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = add i64 %101, %103
  %105 = add i64 %104, 1
  %106 = trunc i64 %105 to i32
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %100, i32 noundef %106, i32 noundef 1)
          to label %107 unwind label %108

107:                                              ; preds = %98
  br label %112

108:                                              ; preds = %98
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %9, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %149

112:                                              ; preds = %107, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  br label %113

113:                                              ; preds = %112, %65
  %114 = load i32, ptr %15, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %15, align 4, !tbaa !9
  br label %55, !llvm.loop !18

116:                                              ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %12, align 4, !tbaa !9
  br label %47, !llvm.loop !19

120:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %121 = load i64, ptr %5, align 8, !tbaa !5
  %122 = add i64 %121, 1
  %123 = trunc i64 %122 to i32
  store i32 %123, ptr %18, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %138, %120
  %125 = load i32, ptr %18, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = load i64, ptr %5, align 8, !tbaa !5
  %128 = mul i64 %127, 2
  %129 = icmp ule i64 %126, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %124
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %145

131:                                              ; preds = %124
  %132 = load i32, ptr %18, align 4, !tbaa !9
  %133 = load i64, ptr %5, align 8, !tbaa !5
  %134 = mul i64 %133, 2
  %135 = add i64 %134, 1
  %136 = trunc i64 %135 to i32
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %132, i32 noundef %136, i32 noundef 1)
          to label %137 unwind label %141

137:                                              ; preds = %131
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %18, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %18, align 4, !tbaa !9
  br label %124, !llvm.loop !20

141:                                              ; preds = %131
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %9, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %149

145:                                              ; preds = %130
  store i1 true, ptr %8, align 1
  store i32 1, ptr %13, align 4
  %146 = load i1, ptr %8, align 1
  br i1 %146, label %148, label %147

147:                                              ; preds = %145
  call void @_ZN9FlowGraphD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %148

148:                                              ; preds = %147, %145
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

149:                                              ; preds = %141, %108, %42
  call void @_ZN9FlowGraphD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %150

150:                                              ; preds = %149, %31
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %9, align 8
  %153 = load i32, ptr %10, align 4
  %154 = insertvalue { ptr, i32 } poison, ptr %152, 0
  %155 = insertvalue { ptr, i32 } %154, i32 %153, 1
  resume { ptr, i32 } %155
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9FlowGraphD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.FlowGraph = type { %"class.std::vector.5", %"class.std::vector.10" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl" }
%"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<FlowGraph::Edge, std::allocator<FlowGraph::Edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned long>, std::allocator<std::vector<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9read_datamm(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, i64 noundef, i64 noundef) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15construct_graphmm(ptr dead_on_unwind noalias writable sret(%class.FlowGraph) align 8 %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_Z9read_datamm(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %4, i64 noundef %1, i64 noundef %2)
  %5 = shl i64 %1, 1
  %6 = add i64 %5, 2
  invoke void @_ZN9FlowGraphC2Em(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %6)
          to label %.preheader54 unwind label %22

.preheader54:                                     ; preds = %3, %24
  %indvars.iv = phi i64 [ %indvars.iv.next, %24 ], [ 0, %3 ]
  %exitcond.not = icmp eq i64 %indvars.iv, %1
  br i1 %exitcond.not, label %.preheader53, label %24

.preheader53:                                     ; preds = %.preheader54
  %.not62 = icmp eq i64 %1, 0
  br i1 %.not62, label %._crit_edge, label %.preheader52.lr.ph

.preheader52.lr.ph:                               ; preds = %.preheader53
  %.not4955.not = icmp eq i64 %2, 0
  %7 = trunc i64 %1 to i32
  %8 = add i32 %7, 1
  br i1 %.not4955.not, label %.preheader52, label %.preheader52.us

.preheader52.us:                                  ; preds = %.preheader52.lr.ph, %.split59.us.us
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.split59.us.us ], [ 0, %.preheader52.lr.ph ]
  %indvars.iv.next74 = add nuw i64 %indvars.iv73, 1
  %9 = trunc nuw i64 %indvars.iv.next74 to i32
  br label %10

10:                                               ; preds = %.loopexit.us.us, %.preheader52.us
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.loopexit.us.us ], [ 0, %.preheader52.us ]
  %11 = icmp eq i64 %indvars.iv69, %indvars.iv73
  br i1 %11, label %.loopexit.us.us, label %.preheader.us.us

12:                                               ; preds = %.preheader.us.us
  %indvars.iv.next66 = add nuw i64 %indvars.iv65, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next66, %2
  br i1 %exitcond68.not, label %..critedge_crit_edge.us.us, label %.preheader.us.us, !llvm.loop !5

.preheader.us.us:                                 ; preds = %10, %12
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %12 ], [ 0, %10 ]
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv73) #5
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv65) #5
  %15 = load i32, ptr %14, align 4, !tbaa !7
  %16 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv69) #5
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %indvars.iv65) #5
  %18 = load i32, ptr %17, align 4, !tbaa !7
  %.not48.us.us = icmp slt i32 %15, %18
  br i1 %.not48.us.us, label %12, label %.loopexit.us.us

.loopexit.us.us:                                  ; preds = %.preheader.us.us, %..critedge_crit_edge.us.us, %10
  %indvars.iv.next70 = add nuw i64 %indvars.iv69, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next70, %1
  br i1 %exitcond72.not, label %.split59.us.us, label %10, !llvm.loop !11

..critedge_crit_edge.us.us:                       ; preds = %12
  %19 = trunc nuw nsw i64 %indvars.iv69 to i32
  %20 = add i32 %8, %19
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %9, i32 noundef %20, i32 noundef 1)
          to label %.loopexit.us.us unwind label %.split.us.split.us

.split59.us.us:                                   ; preds = %.loopexit.us.us
  %exitcond76.not = icmp eq i64 %indvars.iv.next74, %1
  br i1 %exitcond76.not, label %._crit_edge, label %.preheader52.us, !llvm.loop !12

.split.us.split.us:                               ; preds = %..critedge_crit_edge.us.us
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %43

22:                                               ; preds = %3
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %44

24:                                               ; preds = %.preheader54
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %25 = trunc nuw i64 %indvars.iv.next to i32
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef 0, i32 noundef %25, i32 noundef 1)
          to label %.preheader54 unwind label %26, !llvm.loop !13

26:                                               ; preds = %24
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %43

.preheader52:                                     ; preds = %.preheader52.lr.ph, %.split59
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.split59 ], [ 0, %.preheader52.lr.ph ]
  %indvars.iv.next82 = add nuw i64 %indvars.iv81, 1
  %28 = trunc nuw i64 %indvars.iv.next82 to i32
  br label %31

._crit_edge:                                      ; preds = %.split59.us.us, %.split59, %.preheader53
  %.pre-phi = phi i32 [ 0, %.preheader53 ], [ %7, %.split59 ], [ %7, %.split59.us.us ]
  %29 = trunc i64 %5 to i32
  %30 = or disjoint i32 %29, 1
  br label %37

.split59:                                         ; preds = %36
  %exitcond84.not = icmp eq i64 %indvars.iv.next82, %1
  br i1 %exitcond84.not, label %._crit_edge, label %.preheader52, !llvm.loop !12

31:                                               ; preds = %.preheader52, %36
  %indvars.iv77 = phi i64 [ 0, %.preheader52 ], [ %indvars.iv.next78, %36 ]
  %32 = icmp eq i64 %indvars.iv77, %indvars.iv81
  br i1 %32, label %36, label %.preheader

.preheader:                                       ; preds = %31
  %33 = trunc nuw nsw i64 %indvars.iv77 to i32
  %34 = add i32 %8, %33
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %28, i32 noundef %34, i32 noundef 1)
          to label %36 unwind label %.split

.split:                                           ; preds = %.preheader
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %43

36:                                               ; preds = %.preheader, %31
  %indvars.iv.next78 = add nuw i64 %indvars.iv77, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next78, %1
  br i1 %exitcond80.not, label %.split59, label %31, !llvm.loop !11

37:                                               ; preds = %39, %._crit_edge
  %.0.in = phi i32 [ %.pre-phi, %._crit_edge ], [ %.0, %39 ]
  %.0 = add i32 %.0.in, 1
  %38 = sext i32 %.0 to i64
  %.not = icmp ult i64 %5, %38
  br i1 %.not, label %42, label %39

39:                                               ; preds = %37
  invoke void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.0, i32 noundef %30, i32 noundef 1)
          to label %37 unwind label %40, !llvm.loop !14

40:                                               ; preds = %39
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %43

42:                                               ; preds = %37
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

43:                                               ; preds = %.split, %.split.us.split.us, %40, %26
  %.pn = phi { ptr, i32 } [ %27, %26 ], [ %41, %40 ], [ %35, %.split ], [ %21, %.split.us.split.us ]
  call void @_ZN9FlowGraphD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %44

44:                                               ; preds = %43, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %43 ], [ %23, %22 ]
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN9FlowGraph8add_edgeEiii(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN9FlowGraphD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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