; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/util (slow_construction)

; 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.boost::_bi::bind_t" = type { %"class.boost::_mfi::mf0", %"class.boost::_bi::list1" }
%"class.boost::_mfi::mf0" = type { { i64, i64 } }
%"class.boost::_bi::list1" = type { %"struct.boost::_bi::storage1" }
%"struct.boost::_bi::storage1" = type { %"class.boost::_bi::value" }
%"class.boost::_bi::value" = type { ptr }
%class.sequentialConstructions = type { i8, %"class.std::vector", %"class.std::vector", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<boost::function<void ()>, std::allocator<boost::function<void ()>>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::function<void ()>, std::allocator<boost::function<void ()>>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::function<void ()>, std::allocator<boost::function<void ()>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::function<void ()>, std::allocator<boost::function<void ()>>>::_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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23sequentialConstructions5startEv(ptr noundef nonnull align 8 dereferenceable(64) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.boost::_bi::bind_t", align 8
  %4 = alloca { i64, i64 }, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  %9 = getelementptr inbounds %class.sequentialConstructions, ptr %8, i32 0, i32 0
  store i8 1, ptr %9, align 8, !tbaa !9
  %10 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #4
  store i1 true, ptr %7, align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  store { i64, i64 } { i64 ptrtoint (ptr @_ZN23sequentialConstructions11reallyStartEv to i64), i64 0 }, ptr %4, align 8, !tbaa !16
  %11 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  %14 = load i64, ptr %13, align 8
  invoke void @_ZN5boost4bindIv23sequentialConstructionsPS1_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS5_T0_EENS3_9list_av_1IT1_E4typeEEEMS8_FS5_vESB_(ptr dead_on_unwind writable sret(%"class.boost::_bi::bind_t") align 8 %3, i64 %12, i64 %14, ptr noundef %8)
          to label %15 unwind label %18

15:                                               ; preds = %1
  invoke void @_ZN5boost6threadC2INS_3_bi6bind_tIvNS_4_mfi3mf0Iv23sequentialConstructionsEENS2_5list1INS2_5valueIPS6_EEEEEEEEOT_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %16 unwind label %18

16:                                               ; preds = %15
  store i1 false, ptr %7, align 1
  %17 = getelementptr inbounds %class.sequentialConstructions, ptr %8, i32 0, i32 3
  store ptr %10, ptr %17, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

18:                                               ; preds = %15, %1
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %5, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  %22 = load i1, ptr %7, align 1
  br i1 %22, label %23, label %24

23:                                               ; preds = %18
  call void @_ZdlPvm(ptr noundef %10, i64 noundef 16) #6
  br label %24

24:                                               ; preds = %23, %18
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %5, align 8
  %27 = load i32, ptr %6, align 4
  %28 = insertvalue { ptr, i32 } poison, ptr %26, 0
  %29 = insertvalue { ptr, i32 } %28, i32 %27, 1
  resume { ptr, i32 } %29
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost4bindIv23sequentialConstructionsPS1_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS5_T0_EENS3_9list_av_1IT1_E4typeEEEMS8_FS5_vESB_(ptr dead_on_unwind noalias writable sret(%"class.boost::_bi::bind_t") align 8, i64, i64, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23sequentialConstructions11reallyStartEv(ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nobuiltin allocsize(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 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin 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, !11, i64 0}
!10 = !{!"_ZTS23sequentialConstructions", !11, i64 0, !12, i64 8, !12, i64 32, !6, i64 56}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIN5boost8functionIFvvEEESaIS3_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!7, !7, i64 0}
!17 = !{!10, !6, i64 56}


; 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.boost::_bi::bind_t" = type { %"class.boost::_mfi::mf0", %"class.boost::_bi::list1" }
%"class.boost::_mfi::mf0" = type { { i64, i64 } }
%"class.boost::_bi::list1" = type { %"struct.boost::_bi::storage1" }
%"struct.boost::_bi::storage1" = type { %"class.boost::_bi::value" }
%"class.boost::_bi::value" = type { ptr }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23sequentialConstructions5startEv(ptr noundef nonnull align 8 dereferenceable(64) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.boost::_bi::bind_t", align 8
  store i8 1, ptr %0, align 8, !tbaa !5
  %3 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  invoke void @_ZN5boost4bindIv23sequentialConstructionsPS1_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS5_T0_EENS3_9list_av_1IT1_E4typeEEEMS8_FS5_vESB_(ptr dead_on_unwind nonnull writable sret(%"class.boost::_bi::bind_t") align 8 %2, i64 ptrtoint (ptr @_ZN23sequentialConstructions11reallyStartEv to i64), i64 0, ptr noundef nonnull %0)
          to label %4 unwind label %7

4:                                                ; preds = %1
  invoke void @_ZN5boost6threadC2INS_3_bi6bind_tIvNS_4_mfi3mf0Iv23sequentialConstructionsEENS2_5list1INS2_5valueIPS6_EEEEEEEEOT_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %5 unwind label %7

5:                                                ; preds = %4
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %3, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret void

7:                                                ; preds = %4, %1
  %8 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @_ZdlPvm(ptr noundef nonnull %3, i64 noundef 16) #6
  resume { ptr, i32 } %8
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5boost4bindIv23sequentialConstructionsPS1_EENS_3_bi6bind_tIT_NS_4_mfi3mf0IS5_T0_EENS3_9list_av_1IT1_E4typeEEEMS8_FS5_vESB_(ptr dead_on_unwind noalias writable sret(%"class.boost::_bi::bind_t") align 8, i64, i64, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN23sequentialConstructions11reallyStartEv(ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nobuiltin allocsize(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 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin 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, !7, i64 0}
!6 = !{!"_ZTS23sequentialConstructions", !7, i64 0, !10, i64 8, !10, i64 32, !14, i64 56}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN5boost8functionIFvvEEESaIS3_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN5boost8functionIFvvEEESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!6, !14, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass