; LLVM IR from chriskiefer/libcccrt :: benchmarks/maximilian.ll (ZN10maxiEnvGenC2Ev)

; 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.maxiEnvGen = type { i64, double, i8, i8, i32, i8, i8, %"class.std::vector.10", %class.maxiTrigger, %class.maxiTrigger, %class.maxiTrigger }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<maxiEnvGen::envStage, std::allocator<maxiEnvGen::envStage>>::_Vector_impl" }
%"struct.std::_Vector_base<maxiEnvGen::envStage, std::allocator<maxiEnvGen::envStage>>::_Vector_impl" = type { %"struct.std::_Vector_base<maxiEnvGen::envStage, std::allocator<maxiEnvGen::envStage>>::_Vector_impl_data" }
%"struct.std::_Vector_base<maxiEnvGen::envStage, std::allocator<maxiEnvGen::envStage>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.maxiTrigger = type <{ double, i8, [7 x i8] }>

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10maxiEnvGenC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 0
  store i64 0, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 1
  store double 0.000000e+00, ptr %7, align 8, !tbaa !20
  %8 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 2
  store i8 0, ptr %8, align 8, !tbaa !21
  %9 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 3
  store i8 0, ptr %9, align 1, !tbaa !22
  %10 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 7
  call void @_ZNSt6vectorIN10maxiEnvGen8envStageESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #2
  %11 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 8
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %11)
          to label %12 unwind label %17

12:                                               ; preds = %1
  %13 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 9
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %13)
          to label %14 unwind label %17

14:                                               ; preds = %12
  %15 = getelementptr inbounds %class.maxiEnvGen, ptr %5, i32 0, i32 10
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %15)
          to label %16 unwind label %17

16:                                               ; preds = %14
  ret void

17:                                               ; preds = %14, %12, %1
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %3, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %4, align 4
  call void @_ZNSt6vectorIN10maxiEnvGen8envStageESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #2
  br label %21

21:                                               ; preds = %17
  %22 = load ptr, ptr %3, align 8
  %23 = load i32, ptr %4, align 4
  %24 = insertvalue { ptr, i32 } poison, ptr %22, 0
  %25 = insertvalue { ptr, i32 } %24, i32 %23, 1
  resume { ptr, i32 } %25
}

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

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

declare void @_ZN11maxiTriggerC1Ev(ptr)

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 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 = { 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 = !{!"_ZTS10maxiEnvGen", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 17, !14, i64 20, !13, i64 24, !13, i64 25, !15, i64 32, !19, i64 56, !19, i64 72, !19, i64 88}
!11 = !{!"long", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN10maxiEnvGen10playStatesE", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIN10maxiEnvGen8envStageESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN10maxiEnvGen8envStageESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN10maxiEnvGen8envStageESaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN10maxiEnvGen8envStageESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTS11maxiTrigger", !12, i64 0, !13, i64 8}
!20 = !{!10, !12, i64 8}
!21 = !{!10, !13, i64 16}
!22 = !{!10, !13, i64 17}


; 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10maxiEnvGenC2Ev(ptr noundef nonnull align 8 dereferenceable(104) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(18) %0, i8 0, i64 18, i1 false)
  tail call void @_ZNSt6vectorIN10maxiEnvGen8envStageESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %3 = getelementptr inbounds i8, ptr %0, i64 56
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %3)
          to label %4 unwind label %9

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %5)
          to label %6 unwind label %9

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  invoke void @_ZN11maxiTriggerC1Ev(ptr noundef nonnull align 8 dereferenceable(9) %7)
          to label %8 unwind label %9

8:                                                ; preds = %6
  ret void

9:                                                ; preds = %6, %4, %1
  %10 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt6vectorIN10maxiEnvGen8envStageESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  resume { ptr, i32 } %10
}

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

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

declare void @_ZN11maxiTriggerC1Ev(ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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)"}


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