; LLVM IR from thekyria/elabtsaot2 :: powersystem/generator.ll (ZN9elabtsaot9GeneratorC2Ev)

; 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::allocator" = type { i8 }
%"class.elabtsaot::Generator" = type { i32, i8, %"class.std::__cxx11::basic_string", i32, double, double, %"class.std::complex", i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::complex" = type { { double, double } }

@.str = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot9GeneratorC2Ev(ptr noundef nonnull align 8 dereferenceable(216) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  %7 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 0
  store i32 0, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 1
  store i8 1, ptr %8, align 4, !tbaa !18
  %9 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #3
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %10 unwind label %33

10:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  %11 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 3
  store i32 -1, ptr %11, align 8, !tbaa !19
  %12 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 4
  store double 0.000000e+00, ptr %12, align 8, !tbaa !20
  %13 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 5
  store double 0.000000e+00, ptr %13, align 8, !tbaa !21
  %14 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 6
  invoke void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef 1.000000e+00, double noundef 0.000000e+00)
          to label %15 unwind label %37

15:                                               ; preds = %10
  %16 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 7
  store i32 2, ptr %16, align 8, !tbaa !22
  %17 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 8
  store double 0.000000e+00, ptr %17, align 8, !tbaa !23
  %18 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 9
  store double 0.000000e+00, ptr %18, align 8, !tbaa !24
  %19 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 10
  store double 0.000000e+00, ptr %19, align 8, !tbaa !25
  %20 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 11
  store double 1.000000e+00, ptr %20, align 8, !tbaa !26
  %21 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 12
  store double 0.000000e+00, ptr %21, align 8, !tbaa !27
  %22 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 13
  store double 0.000000e+00, ptr %22, align 8, !tbaa !28
  %23 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 14
  store double 0.000000e+00, ptr %23, align 8, !tbaa !29
  %24 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 15
  store double 0.000000e+00, ptr %24, align 8, !tbaa !30
  %25 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 16
  store double 0.000000e+00, ptr %25, align 8, !tbaa !31
  %26 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 17
  store double 0.000000e+00, ptr %26, align 8, !tbaa !32
  %27 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 18
  store double 0.000000e+00, ptr %27, align 8, !tbaa !33
  %28 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 19
  store double 0.000000e+00, ptr %28, align 8, !tbaa !34
  %29 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 20
  store double 1.000000e+00, ptr %29, align 8, !tbaa !35
  %30 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 21
  store double 0.000000e+00, ptr %30, align 8, !tbaa !36
  %31 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 22
  store double 1.000000e+00, ptr %31, align 8, !tbaa !37
  %32 = getelementptr inbounds %"class.elabtsaot::Generator", ptr %6, i32 0, i32 23
  store double 0.000000e+00, ptr %32, align 8, !tbaa !38
  ret void

33:                                               ; preds = %1
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %4, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #3
  br label %41

37:                                               ; preds = %10
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %4, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  br label %41

41:                                               ; preds = %37, %33
  %42 = load ptr, ptr %4, align 8
  %43 = load i32, ptr %5, align 4
  %44 = insertvalue { ptr, i32 } poison, ptr %42, 0
  %45 = insertvalue { ptr, i32 } %44, i32 %43, 1
  resume { ptr, i32 } %45
}

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

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

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

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 void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 = { 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 = !{!"_ZTSN9elabtsaot9GeneratorE", !11, i64 0, !12, i64 4, !13, i64 8, !11, i64 40, !16, i64 48, !16, i64 56, !17, i64 64, !11, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !16, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !15, i64 8, !7, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSSt7complexIdE", !7, i64 0}
!18 = !{!10, !12, i64 4}
!19 = !{!10, !11, i64 40}
!20 = !{!10, !16, i64 48}
!21 = !{!10, !16, i64 56}
!22 = !{!10, !11, i64 80}
!23 = !{!10, !16, i64 88}
!24 = !{!10, !16, i64 96}
!25 = !{!10, !16, i64 104}
!26 = !{!10, !16, i64 112}
!27 = !{!10, !16, i64 120}
!28 = !{!10, !16, i64 128}
!29 = !{!10, !16, i64 136}
!30 = !{!10, !16, i64 144}
!31 = !{!10, !16, i64 152}
!32 = !{!10, !16, i64 160}
!33 = !{!10, !16, i64 168}
!34 = !{!10, !16, i64 176}
!35 = !{!10, !16, i64 184}
!36 = !{!10, !16, i64 192}
!37 = !{!10, !16, i64 200}
!38 = !{!10, !16, i64 208}


; 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::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9elabtsaot9GeneratorC2Ev(ptr noundef nonnull align 8 dereferenceable(216) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::allocator", align 1
  store i32 0, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  store i8 1, ptr %3, align 4, !tbaa !17
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %5 unwind label %15

5:                                                ; preds = %1
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 -1, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef 1.000000e+00, double noundef 0.000000e+00)
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 2, ptr %9, align 8, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %0, i64 88
  %11 = getelementptr inbounds i8, ptr %0, i64 112
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %10, i8 0, i64 24, i1 false)
  store double 1.000000e+00, ptr %11, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %0, i64 120
  %13 = getelementptr inbounds i8, ptr %0, i64 184
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %12, i8 0, i64 64, i1 false)
  store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %13, align 8, !tbaa !21
  %14 = getelementptr inbounds i8, ptr %0, i64 200
  store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %14, align 8, !tbaa !21
  ret void

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #4
  resume { ptr, i32 } %16
}

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

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

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

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 void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 0}
!6 = !{!"_ZTSN9elabtsaot9GeneratorE", !7, i64 0, !10, i64 4, !11, i64 8, !7, i64 40, !15, i64 48, !15, i64 56, !16, i64 64, !7, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !15, i64 208}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !14, i64 8, !8, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSSt7complexIdE", !8, i64 0}
!17 = !{!6, !10, i64 4}
!18 = !{!6, !7, i64 40}
!19 = !{!6, !7, i64 80}
!20 = !{!6, !15, i64 112}
!21 = !{!15, !15, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass