; LLVM IR from lynx-family/primjs :: src/napi (napi)

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

%struct.napi_property_descriptor = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr }
%"class.Napi::PropertyDescriptor" = type { %struct.napi_property_descriptor }
%"class.Napi::Env" = type { ptr }
%"class.Napi::Object" = type { %"class.Napi::Value" }
%"class.Napi::Value" = type { ptr, ptr }
%"class.Napi::Name" = type { %"class.Napi::Value" }
%class.anon.15 = type { i8 }
%"struct.Napi::details::CallbackData" = type { ptr, 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4Napi5ValuecvP12napi_value__Ev(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef byval(%struct.napi_property_descriptor) align 8) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPv(ptr dead_on_unwind noalias writable sret(%"class.Napi::PropertyDescriptor") align 8 %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr noundef %6, i32 noundef %7, ptr noundef %8) #2 align 2 {
  %10 = alloca %"class.Napi::Env", align 8
  %11 = alloca %"class.Napi::Object", align 8
  %12 = alloca %"class.Napi::Name", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %class.anon.15, align 1
  %18 = alloca %struct.napi_property_descriptor, align 8
  %19 = getelementptr inbounds %"class.Napi::Env", ptr %10, i32 0, i32 0
  store ptr %1, ptr %19, align 8
  %20 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 0
  store ptr %2, ptr %20, align 8
  %21 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 1
  store ptr %3, ptr %21, align 8
  %22 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  store ptr %4, ptr %22, align 8
  %23 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  store ptr %5, ptr %23, align 8
  store ptr %6, ptr %13, align 8, !tbaa !5
  store i32 %7, ptr %14, align 4, !tbaa !9
  store ptr %8, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %24 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #5
  %25 = getelementptr inbounds %"struct.Napi::details::CallbackData", ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %26, ptr %25, align 16, !tbaa !11
  %27 = getelementptr inbounds %"struct.Napi::details::CallbackData", ptr %24, i32 0, i32 1
  %28 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %28, ptr %27, align 8, !tbaa !13
  store ptr %24, ptr %16, align 8, !tbaa !5
  %29 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  %30 = call noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SB_SB_EEv"(ptr noundef nonnull align 1 dereferenceable(1) %17) #4
  call void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef %29, ptr noundef %30, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  %31 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 0
  store ptr null, ptr %31, align 8, !tbaa !14
  %32 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 1
  %33 = call noundef ptr @_ZNK4Napi5ValuecvP12napi_value__Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  store ptr %33, ptr %32, align 8, !tbaa !16
  %34 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 2
  %35 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__, ptr %34, align 8, !tbaa !17
  %36 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 3
  store ptr null, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 4
  store ptr null, ptr %37, align 8, !tbaa !19
  %38 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 5
  store ptr null, ptr %38, align 8, !tbaa !20
  %39 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 6
  %40 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %40, ptr %39, align 8, !tbaa !21
  %41 = getelementptr inbounds %struct.napi_property_descriptor, ptr %18, i32 0, i32 7
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %42, ptr %41, align 8, !tbaa !22
  call void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef byval(%struct.napi_property_descriptor) align 8 %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SB_SB_EEv"(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nobuiltin allocsize(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 }
attributes #5 = { builtin allocsize(0) }

!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 = !{!"_ZTS24napi_property_attributes", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN4Napi7details12CallbackDataE", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS24napi_property_descriptor", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !6, i64 56}
!16 = !{!15, !6, i64 8}
!17 = !{!15, !6, i64 16}
!18 = !{!15, !6, i64 24}
!19 = !{!15, !6, i64 32}
!20 = !{!15, !6, i64 40}
!21 = !{!15, !10, i64 48}
!22 = !{!15, !6, i64 56}


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

%struct.napi_property_descriptor = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr }
%"class.Napi::PropertyDescriptor" = type { %struct.napi_property_descriptor }
%"class.Napi::Object" = type { %"class.Napi::Value" }
%"class.Napi::Value" = type { ptr, ptr }
%"class.Napi::Name" = type { %"class.Napi::Value" }
%class.anon.15 = type { i8 }

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef byval(%struct.napi_property_descriptor) align 8) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPv(ptr dead_on_unwind noalias writable sret(%"class.Napi::PropertyDescriptor") align 8 %0, ptr nocapture readnone %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr noundef %6, i32 noundef %7, ptr noundef %8) local_unnamed_addr #2 align 2 {
  %10 = alloca %"class.Napi::Object", align 8
  %11 = alloca %"class.Napi::Name", align 8
  %12 = alloca %class.anon.15, align 1
  %13 = alloca %struct.napi_property_descriptor, align 8
  store ptr %2, ptr %10, align 8
  %14 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %3, ptr %14, align 8
  store ptr %4, ptr %11, align 8
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %5, ptr %15, align 8
  %16 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #5
  store ptr %6, ptr %16, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %8, ptr %17, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #6
  %18 = call noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SB_SB_EEv"(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull %16, ptr noundef %18, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #6
  store ptr null, ptr %13, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %13, i64 8
  %20 = call noundef ptr @_ZNK4Napi5ValuecvP12napi_value__Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  store ptr %20, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds i8, ptr %13, i64 24
  %23 = getelementptr inbounds i8, ptr %13, i64 48
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, i8 0, i64 24, i1 false)
  store i32 %7, ptr %23, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %13, i64 56
  store ptr %16, ptr %24, align 8, !tbaa !17
  call void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull byval(%struct.napi_property_descriptor) align 8 %13)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SB_SB_EEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nobuiltin allocsize(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: write) }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { 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 = !{!"_ZTSN4Napi7details12CallbackDataE", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTS24napi_property_descriptor", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !13, i64 48, !7, i64 56}
!13 = !{!"_ZTS24napi_property_attributes", !8, i64 0}
!14 = !{!12, !7, i64 8}
!15 = !{!12, !7, i64 16}
!16 = !{!12, !13, i64 48}
!17 = !{!12, !7, i64 56}


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