; LLVM IR from PepcyCh/bisemutum-engine :: bisemutum/thirdparty/AnyAny/examples (examples_main)

; 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::initializer_list" = type { ptr, i64 }
%"struct.aa::const_poly_ref.13" = type { %"struct.aa::noexport::vtable_view.15", ptr }
%"struct.aa::noexport::vtable_view.15" = type { %"struct.aa::vtable.16" }
%"struct.aa::vtable.16" = type { %"struct.aa::noexport::tuple.17" }
%"struct.aa::noexport::tuple.17" = type { %"struct.aa::noexport::tuple_base.18" }
%"struct.aa::noexport::tuple_base.18" = type { %"struct.aa::noexport::value_in_tuple.19" }
%"struct.aa::noexport::value_in_tuple.19" = type { 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
define dso_local void @_ZN7example9print_allESt16initializer_listIN2aa14const_poly_refIJNS_5printEEEEE(ptr %0, i64 %1) #1 {
  %3 = alloca %"class.std::initializer_list", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.aa::const_poly_ref.13", align 8
  %8 = getelementptr inbounds { ptr, i64 }, ptr %3, i32 0, i32 0
  store ptr %0, ptr %8, align 8
  %9 = getelementptr inbounds { ptr, i64 }, ptr %3, i32 0, i32 1
  store i64 %1, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr %3, 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 ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  store ptr %11, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  store ptr %13, ptr %6, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %21, %2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %24

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %20, i64 16, i1 false)
  call void @_ZNK7example5print11make_pluginIN2aa14const_poly_refIJS0_EEEFvRKiES0_E5printEv(ptr noundef nonnull align 1 dereferenceable(1) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  br label %21

21:                                               ; preds = %19
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.aa::const_poly_ref.13", ptr %22, i32 1
  store ptr %23, ptr %5, align 8, !tbaa !5
  br label %14

24:                                               ; preds = %18
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 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) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7example5print11make_pluginIN2aa14const_poly_refIJS0_EEEFvRKiES0_E5printEv(ptr noundef nonnull align 1 dereferenceable(1)) #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 = { 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: readwrite) }
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"}


; 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::initializer_list" = type { ptr, i64 }
%"struct.aa::const_poly_ref.13" = type { %"struct.aa::noexport::vtable_view.15", ptr }
%"struct.aa::noexport::vtable_view.15" = type { %"struct.aa::vtable.16" }
%"struct.aa::vtable.16" = type { %"struct.aa::noexport::tuple.17" }
%"struct.aa::noexport::tuple.17" = type { %"struct.aa::noexport::tuple_base.18" }
%"struct.aa::noexport::tuple_base.18" = type { %"struct.aa::noexport::value_in_tuple.19" }
%"struct.aa::noexport::value_in_tuple.19" = type { 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7example9print_allESt16initializer_listIN2aa14const_poly_refIJNS_5printEEEEE(ptr %0, i64 %1) local_unnamed_addr #1 {
  %3 = alloca %"class.std::initializer_list", align 8
  %4 = alloca %"struct.aa::const_poly_ref.13", align 8
  store ptr %0, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 %1, ptr %5, align 8
  %6 = call noundef ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  %7 = call noundef ptr @_ZNKSt16initializer_listIN2aa14const_poly_refIJN7example5printEEEEE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  %.not6 = icmp eq ptr %6, %7
  br i1 %.not6, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  ret void

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.07 = phi ptr [ %8, %.lr.ph ], [ %6, %2 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %.07, i64 16, i1 false)
  call void @_ZNK7example5print11make_pluginIN2aa14const_poly_refIJS0_EEEFvRKiES0_E5printEv(ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %8 = getelementptr inbounds i8, ptr %.07, i64 16
  %.not = icmp eq ptr %8, %7
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

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

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

; Function Attrs: mustprogress 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) #3

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

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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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)"}


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