; 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.11 = type { i8 }
%"struct.Napi::details::AccessorCallbackData" = type { ptr, 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 @_ZN4Napi7details20AccessorCallbackData13GetterWrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details20AccessorCallbackData13SetterWrapperEP10napi_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 @_ZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_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, ptr noundef %7, i32 noundef %8, ptr noundef %9) #2 align 2 {
  %11 = alloca %"class.Napi::Env", align 8
  %12 = alloca %"class.Napi::Object", align 8
  %13 = alloca %"class.Napi::Name", align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %class.anon.11, align 1
  %20 = alloca %struct.napi_property_descriptor, align 8
  %21 = getelementptr inbounds %"class.Napi::Env", ptr %11, i32 0, i32 0
  store ptr %1, ptr %21, align 8
  %22 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  store ptr %2, ptr %22, align 8
  %23 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  store ptr %3, ptr %23, align 8
  %24 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 0
  store ptr %4, ptr %24, align 8
  %25 = getelementptr inbounds { ptr, ptr }, ptr %13, i32 0, i32 1
  store ptr %5, ptr %25, align 8
  store ptr %6, ptr %14, align 8, !tbaa !5
  store ptr %7, ptr %15, align 8, !tbaa !5
  store i32 %8, ptr %16, align 4, !tbaa !9
  store ptr %9, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %26 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #5
  %27 = getelementptr inbounds %"struct.Napi::details::AccessorCallbackData", ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %28, ptr %27, align 16, !tbaa !11
  %29 = getelementptr inbounds %"struct.Napi::details::AccessorCallbackData", ptr %26, i32 0, i32 1
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %30, ptr %29, align 8, !tbaa !13
  %31 = getelementptr inbounds %"struct.Napi::details::AccessorCallbackData", ptr %26, i32 0, i32 2
  %32 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %32, ptr %31, align 16, !tbaa !14
  store ptr %26, ptr %18, align 8, !tbaa !5
  %33 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #4
  %34 = call noundef ptr @"_ZZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SF_SF_EEv"(ptr noundef nonnull align 1 dereferenceable(1) %19) #4
  call void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %33, ptr noundef %34, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  %35 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 0
  store ptr null, ptr %35, align 8, !tbaa !15
  %36 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 1
  %37 = call noundef ptr @_ZNK4Napi5ValuecvP12napi_value__Ev(ptr noundef nonnull align 8 dereferenceable(16) %13)
  store ptr %37, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 2
  store ptr null, ptr %38, align 8, !tbaa !18
  %39 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 3
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %44

42:                                               ; preds = %10
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  br label %45

44:                                               ; preds = %10
  br label %45

45:                                               ; preds = %44, %42
  %46 = phi ptr [ @_ZN4Napi7details20AccessorCallbackData13GetterWrapperEP10napi_env__P20napi_callback_info__, %42 ], [ null, %44 ]
  store ptr %46, ptr %39, align 8, !tbaa !19
  %47 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 4
  %48 = load ptr, ptr %15, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %52

50:                                               ; preds = %45
  %51 = load ptr, ptr %18, align 8, !tbaa !5
  br label %53

52:                                               ; preds = %45
  br label %53

53:                                               ; preds = %52, %50
  %54 = phi ptr [ @_ZN4Napi7details20AccessorCallbackData13SetterWrapperEP10napi_env__P20napi_callback_info__, %50 ], [ null, %52 ]
  store ptr %54, ptr %47, align 8, !tbaa !20
  %55 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 5
  store ptr null, ptr %55, align 8, !tbaa !21
  %56 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 6
  %57 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %57, ptr %56, align 8, !tbaa !22
  %58 = getelementptr inbounds %struct.napi_property_descriptor, ptr %20, i32 0, i32 7
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %59, ptr %58, align 8, !tbaa !23
  call void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef byval(%struct.napi_property_descriptor) align 8 %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SF_SF_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 = !{!"_ZTSN4Napi7details20AccessorCallbackDataE", !6, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 16}
!15 = !{!16, !6, i64 0}
!16 = !{!"_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}
!17 = !{!16, !6, i64 8}
!18 = !{!16, !6, i64 16}
!19 = !{!16, !6, i64 24}
!20 = !{!16, !6, i64 32}
!21 = !{!16, !6, i64 40}
!22 = !{!16, !10, i64 48}
!23 = !{!16, !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.11 = 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 @_ZN4Napi7details20AccessorCallbackData13GetterWrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details20AccessorCallbackData13SetterWrapperEP10napi_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 @_ZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_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, ptr noundef %7, i32 noundef %8, ptr noundef %9) local_unnamed_addr #2 align 2 {
  %11 = alloca %"class.Napi::Object", align 8
  %12 = alloca %"class.Napi::Name", align 8
  %13 = alloca %class.anon.11, align 1
  %14 = alloca %struct.napi_property_descriptor, align 8
  store ptr %2, ptr %11, align 8
  %15 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %3, ptr %15, align 8
  store ptr %4, ptr %12, align 8
  %16 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr %5, ptr %16, align 8
  %17 = tail call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #4
  store ptr %6, ptr %17, align 16, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %7, ptr %18, align 8, !tbaa !10
  %19 = getelementptr inbounds i8, ptr %17, i64 16
  store ptr %9, ptr %19, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #5
  %20 = call noundef ptr @"_ZZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SF_SF_EEv"(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %17, ptr noundef %20, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #5
  store ptr null, ptr %14, align 8, !tbaa !12
  %21 = getelementptr inbounds i8, ptr %14, i64 8
  %22 = call noundef ptr @_ZNK4Napi5ValuecvP12napi_value__Ev(ptr noundef nonnull align 8 dereferenceable(16) %12)
  store ptr %22, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %14, i64 16
  store ptr null, ptr %23, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %14, i64 24
  %25 = insertelement <2 x ptr> poison, ptr %6, i64 0
  %26 = insertelement <2 x ptr> %25, ptr %7, i64 1
  %27 = icmp eq <2 x ptr> %26, zeroinitializer
  %28 = select <2 x i1> %27, <2 x ptr> zeroinitializer, <2 x ptr> <ptr @_ZN4Napi7details20AccessorCallbackData13GetterWrapperEP10napi_env__P20napi_callback_info__, ptr @_ZN4Napi7details20AccessorCallbackData13SetterWrapperEP10napi_env__P20napi_callback_info__>
  store <2 x ptr> %28, ptr %24, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %14, i64 40
  store ptr null, ptr %29, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %14, i64 48
  store i32 %8, ptr %30, align 8, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %14, i64 56
  store ptr %17, ptr %31, align 8, !tbaa !20
  call void @_ZN4Napi18PropertyDescriptorC2E24napi_property_descriptor(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull byval(%struct.napi_property_descriptor) align 8 %14)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8AccessorENS_3EnvENS_6ObjectENS_4NameEPFNS_5ValueERKNS_12CallbackInfoEEPFvS7_RKS4_E24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SF_SF_EEv"(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 = { 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 = { builtin allocsize(0) }
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, !7, i64 0}
!6 = !{!"_ZTSN4Napi7details20AccessorCallbackDataE", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !7, i64 0}
!13 = !{!"_ZTS24napi_property_descriptor", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !14, i64 48, !7, i64 56}
!14 = !{!"_ZTS24napi_property_attributes", !8, i64 0}
!15 = !{!13, !7, i64 8}
!16 = !{!13, !7, i64 16}
!17 = !{!7, !7, i64 0}
!18 = !{!13, !7, i64 40}
!19 = !{!13, !14, i64 48}
!20 = !{!13, !7, i64 56}


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