; LLVM IR from thekyria/elabtsaot2 :: ss_analysis (ssutils)

; 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::numeric::ublas::vector" = type { %"class.boost::numeric::ublas::unbounded_array.72" }
%"class.boost::numeric::ublas::unbounded_array.72" = type { [8 x i8], i64, ptr }

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot7ssutils3absERKN5boost7numeric5ublas6vectorISt7complexIdENS3_15unbounded_arrayIS6_SaIS6_EEEEE(ptr dead_on_unwind noalias writable sret(%"class.boost::numeric::ublas::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i1, align 1
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call noundef i64 @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  store i64 %11, ptr %5, align 8, !tbaa !9
  store i1 false, ptr %6, align 1
  %12 = load i64, ptr %5, align 8, !tbaa !9
  call void @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %28, %2
  %14 = load i64, ptr %7, align 8, !tbaa !9
  %15 = load i64, ptr %5, align 8, !tbaa !9
  %16 = icmp ne i64 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %20)
          to label %22 unwind label %31

22:                                               ; preds = %18
  %23 = invoke noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %24 unwind label %31

24:                                               ; preds = %22
  %25 = load i64, ptr %7, align 8, !tbaa !9
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %25)
          to label %27 unwind label %31

27:                                               ; preds = %24
  store double %23, ptr %26, align 8, !tbaa !11
  br label %28

28:                                               ; preds = %27
  %29 = load i64, ptr %7, align 8, !tbaa !9
  %30 = add i64 %29, 1
  store i64 %30, ptr %7, align 8, !tbaa !9
  br label %13, !llvm.loop !13

31:                                               ; preds = %24, %22, %18
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %8, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %39

35:                                               ; preds = %17
  store i1 true, ptr %6, align 1
  %36 = load i1, ptr %6, align 1
  br i1 %36, label %38, label %37

37:                                               ; preds = %35
  call void @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %38

38:                                               ; preds = %37, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void

39:                                               ; preds = %31
  %40 = load ptr, ptr %8, align 8
  %41 = load i32, ptr %9, align 4
  %42 = insertvalue { ptr, i32 } poison, ptr %40, 0
  %43 = insertvalue { ptr, i32 } %42, i32 %41, 1
  resume { ptr, i32 } %43
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

%"class.boost::numeric::ublas::vector" = type { %"class.boost::numeric::ublas::unbounded_array.72" }
%"class.boost::numeric::ublas::unbounded_array.72" = type { [8 x i8], i64, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot7ssutils3absERKN5boost7numeric5ublas6vectorISt7complexIdENS3_15unbounded_arrayIS6_SaIS6_EEEEE(ptr dead_on_unwind noalias writable sret(%"class.boost::numeric::ublas::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = tail call noundef i64 @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  tail call void @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %3)
  %.not10 = icmp eq i64 %3, 0
  br i1 %.not10, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %9
  %.011 = phi i64 [ %10, %9 ], [ 0, %2 ]
  %4 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.011)
          to label %5 unwind label %11

5:                                                ; preds = %.lr.ph
  %6 = invoke noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %7 unwind label %11

7:                                                ; preds = %5
  %8 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.011)
          to label %9 unwind label %11

9:                                                ; preds = %7
  store double %6, ptr %8, align 8, !tbaa !5
  %10 = add nuw i64 %.011, 1
  %.not = icmp eq i64 %10, %3
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

11:                                               ; preds = %7, %5, %.lr.ph
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN5boost7numeric5ublas6vectorIdNS1_15unbounded_arrayIdSaIdEEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  resume { ptr, i32 } %12

._crit_edge:                                      ; preds = %9, %2
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 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 = { 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 #2 = { 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 #3 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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