; LLVM IR from optframe/optframe :: Examples/PN/src (NSSeqShift)

; 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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }
%"struct.std::pair" = type { %"class.optframe::CopySolution", %"class.optframe::Evaluation" }
%"class.optframe::CopySolution" = type <{ %"class.optframe::Component.base", [7 x i8], %"class.std::vector", i32, [4 x i8] }>
%"class.optframe::Component.base" = type <{ ptr, ptr, ptr, i32, i8, i8, i8, i8, i8 }>
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.optframe::Evaluation" = type <{ %"class.optframe::Component.base", [7 x i8], double, double, double, i8, i8, [6 x i8] }>
%"class.PN::NSSeqShift" = type { %"class.optframe::NSSeq", ptr, ptr }
%"class.optframe::NSSeq" = type { %"class.optframe::NSFind.base", %"class.std::unique_ptr.11" }
%"class.optframe::NSFind.base" = type { %"class.optframe::NS.base" }
%"class.optframe::NS.base" = type { %"class.optframe::Component.base" }
%"class.std::unique_ptr.11" = type { %"struct.std::__uniq_ptr_data.12" }
%"struct.std::__uniq_ptr_data.12" = type { %"class.std::__uniq_ptr_impl.13" }
%"class.std::__uniq_ptr_impl.13" = type { %"class.std::tuple.14" }
%"class.std::tuple.14" = type { %"struct.std::_Tuple_impl.15" }
%"struct.std::_Tuple_impl.15" = type { %"struct.std::_Head_base.18" }
%"struct.std::_Head_base.18" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2PN10NSSeqShift10randomMoveERKSt4pairIN8optframe12CopySolutionISt6vectorIbSaIbEEiEENS2_10EvaluationIdEEE(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(160) %2) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.std::pair", ptr %12, i32 0, i32 0
  %14 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK8optframe12CopySolutionISt6vectorIbSaIbEEiE4getREv(ptr noundef nonnull align 8 dereferenceable(84) %13)
  store ptr %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %15 = getelementptr inbounds %"class.PN::NSSeqShift", ptr %11, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %17) #5
  %19 = trunc i64 %18 to i32
  %20 = load ptr, ptr %16, align 8, !tbaa !23
  %21 = getelementptr inbounds ptr, ptr %20, i64 17
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(5040) %16, i32 noundef %19)
  store i32 %23, ptr %8, align 4, !tbaa !25
  %24 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #6
  %25 = load i32, ptr %8, align 4, !tbaa !25
  %26 = getelementptr inbounds %"class.PN::NSSeqShift", ptr %11, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !27
  invoke void @_ZN2PN9MoveShiftC2EiRNS_15ProblemInstanceE(ptr noundef nonnull align 8 dereferenceable(48) %24, i32 noundef %25, ptr noundef nonnull align 8 dereferenceable(64) %27)
          to label %28 unwind label %29

28:                                               ; preds = %3
  call void @_ZNSt10unique_ptrIN8optframe4MoveISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEC2ISD_vEEPSB_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

29:                                               ; preds = %3
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %9, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %10, align 4
  call void @_ZdlPvm(ptr noundef %24, i64 noundef 48) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr %9, align 8
  %35 = load i32, ptr %10, align 4
  %36 = insertvalue { ptr, i32 } poison, ptr %34, 0
  %37 = insertvalue { ptr, i32 } %36, i32 %35, 1
  resume { ptr, i32 } %37
}

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 = { 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 #3 = { 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 = { 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { 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, !6, i64 56}
!10 = !{!"_ZTSN2PN10NSSeqShiftE", !11, i64 0, !6, i64 48, !6, i64 56}
!11 = !{!"_ZTSN8optframe5NSSeqISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !12, i64 0, !17, i64 40}
!12 = !{!"_ZTSN8optframe6NSFindISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !13, i64 0}
!13 = !{!"_ZTSN8optframe2NSISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !14, i64 0}
!14 = !{!"_ZTSN8optframe9ComponentE", !6, i64 8, !6, i64 16, !15, i64 24, !16, i64 28, !16, i64 29, !16, i64 30, !16, i64 31, !16, i64 32}
!15 = !{!"_ZTSN6modlog8LogLevelE", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EELb0EE", !6, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!26, !26, i64 0}
!26 = !{!"int", !7, i64 0}
!27 = !{!10, !6, i64 48}


; 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::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.4" }
%"struct.std::_Head_base.4" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNK8optframe12CopySolutionISt6vectorIbSaIbEEiE4getREv(ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2PN9MoveShiftC2EiRNS_15ProblemInstanceE(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2PN10NSSeqShift10randomMoveERKSt4pairIN8optframe12CopySolutionISt6vectorIbSaIbEEiEENS2_10EvaluationIdEEE(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8 %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(160) %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK8optframe12CopySolutionISt6vectorIbSaIbEEiE4getREv(ptr noundef nonnull align 8 dereferenceable(84) %2)
  %5 = getelementptr inbounds i8, ptr %1, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef i64 @_ZNKSt6vectorIbSaIbEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %4) #4
  %8 = trunc i64 %7 to i32
  %9 = load ptr, ptr %6, align 8, !tbaa !22
  %10 = getelementptr inbounds i8, ptr %9, i64 136
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef i32 %11(ptr noundef nonnull align 8 dereferenceable(5040) %6, i32 noundef %8)
  %13 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #5
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  %15 = load ptr, ptr %14, align 8, !tbaa !24
  invoke void @_ZN2PN9MoveShiftC2EiRNS_15ProblemInstanceE(ptr noundef nonnull align 8 dereferenceable(48) %13, i32 noundef %12, ptr noundef nonnull align 8 dereferenceable(64) %15)
          to label %16 unwind label %17

16:                                               ; preds = %3
  tail call void @_ZNSt10unique_ptrIN8optframe4MoveISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEC2ISD_vEEPSB_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %13) #4
  ret void

17:                                               ; preds = %3
  %18 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 48) #6
  resume { ptr, i32 } %18
}

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 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 #4 = { nounwind }
attributes #5 = { builtin allocsize(0) }
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, !11, i64 56}
!6 = !{!"_ZTSN2PN10NSSeqShiftE", !7, i64 0, !11, i64 48, !11, i64 56}
!7 = !{!"_ZTSN8optframe5NSSeqISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !8, i64 0, !16, i64 40}
!8 = !{!"_ZTSN8optframe6NSFindISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !9, i64 0}
!9 = !{!"_ZTSN8optframe2NSISt4pairINS_12CopySolutionISt6vectorIbSaIbEEiEENS_10EvaluationIdEEES9_EE", !10, i64 0}
!10 = !{!"_ZTSN8optframe9ComponentE", !11, i64 8, !11, i64 16, !14, i64 24, !15, i64 28, !15, i64 29, !15, i64 30, !15, i64 31, !15, i64 32}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN6modlog8LogLevelE", !12, i64 0}
!15 = !{!"bool", !12, i64 0}
!16 = !{!"_ZTSSt10unique_ptrIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_dataIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_ELb1ELb1EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_implIN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EE", !19, i64 0}
!19 = !{!"_ZTSSt5tupleIJPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEE", !20, i64 0}
!20 = !{!"_ZTSSt11_Tuple_implILm0EJPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EESt14default_deleteISB_EEE", !21, i64 0}
!21 = !{!"_ZTSSt10_Head_baseILm0EPN8optframe10NSIteratorISt4pairINS0_12CopySolutionISt6vectorIbSaIbEEiEENS0_10EvaluationIdEEESA_EELb0EE", !11, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !13, i64 0}
!24 = !{!6, !11, i64 48}


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