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

; 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: mustprogress uwtable
declare dso_local noundef i64 @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; 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

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

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

; 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) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot7ssutils14normComplexVecERKN5boost7numeric5ublas6vectorISt7complexIdENS3_15unbounded_arrayIS6_SaIS6_EEEEE(ptr dead_on_unwind noalias writable sret(%"class.boost::numeric::ublas::vector.96") 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 %"class.std::complex", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  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) #5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef i64 @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  store i64 %13, ptr %5, align 8, !tbaa !9
  store i1 false, ptr %6, align 1
  %14 = load i64, ptr %5, align 8, !tbaa !9
  call void @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %53

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %22)
          to label %24 unwind label %44

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %26)
          to label %28 unwind label %48

28:                                               ; preds = %24
  %29 = invoke noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %27)
          to label %30 unwind label %48

30:                                               ; preds = %28
  store double %29, ptr %11, align 8, !tbaa !11
  %31 = invoke { double, double } @_ZStdvIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %32 unwind label %48

32:                                               ; preds = %30
  %33 = getelementptr inbounds %"class.std::complex", ptr %8, i32 0, i32 0
  %34 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %35 = extractvalue { double, double } %31, 0
  store double %35, ptr %34, align 8
  %36 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %37 = extractvalue { double, double } %31, 1
  store double %37, ptr %36, align 8
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %38)
          to label %40 unwind label %48

40:                                               ; preds = %32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  br label %41

41:                                               ; preds = %40
  %42 = load i64, ptr %7, align 8, !tbaa !9
  %43 = add i64 %42, 1
  store i64 %43, ptr %7, align 8, !tbaa !9
  br label %15, !llvm.loop !15

44:                                               ; preds = %20
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  br label %52

48:                                               ; preds = %32, %30, %28, %24
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %52

52:                                               ; preds = %48, %44
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %57

53:                                               ; preds = %19
  store i1 true, ptr %6, align 1
  %54 = load i1, ptr %6, align 1
  br i1 %54, label %56, label %55

55:                                               ; preds = %53
  call void @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %56

56:                                               ; preds = %55, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

57:                                               ; preds = %52
  %58 = load ptr, ptr %9, align 8
  %59 = load i32, ptr %10, align 4
  %60 = insertvalue { ptr, i32 } poison, ptr %58, 0
  %61 = insertvalue { ptr, i32 } %60, i32 %59, 1
  resume { ptr, i32 } %61
}

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

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 = { 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, !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 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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.96" = type { %"class.boost::numeric::ublas::unbounded_array" }
%"class.boost::numeric::ublas::unbounded_array" = type { [8 x i8], i64, 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: mustprogress uwtable
declare dso_local noundef i64 @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #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) local_unnamed_addr #1 align 2

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

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

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

.lr.ph:                                           ; preds = %2, %14
  %.01316 = phi i64 [ %17, %14 ], [ 0, %2 ]
  %5 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.01316)
          to label %6 unwind label %18

6:                                                ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %7 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.01316)
          to label %8 unwind label %20

8:                                                ; preds = %6
  %9 = invoke noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %10 unwind label %20

10:                                               ; preds = %8
  store double %9, ptr %3, align 8, !tbaa !5
  %11 = invoke { double, double } @_ZStdvIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %12 unwind label %20

12:                                               ; preds = %10
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEEclEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.01316)
          to label %14 unwind label %20

14:                                               ; preds = %12
  %15 = extractvalue { double, double } %11, 1
  %16 = extractvalue { double, double } %11, 0
  store double %16, ptr %13, align 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 8
  store double %15, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %17 = add nuw i64 %.01316, 1
  %.not = icmp eq i64 %17, %4
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

18:                                               ; preds = %.lr.ph
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %12, %10, %8, %6
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @_ZN5boost7numeric5ublas6vectorISt7complexIdENS1_15unbounded_arrayIS4_SaIS4_EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStdvIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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