; 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.anon.13 = 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: mustprogress uwtable
declare dso_local void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef, ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #1 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 #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectEPKcPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SC_SC_EEv"(ptr noundef nonnull align 1 dereferenceable(1)) #3 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 = { 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 #3 = { 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 #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.anon.13 = 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: 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 #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__(ptr noundef, ptr noundef) #1 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 #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectEPKcPFNS_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 noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef %7) local_unnamed_addr #1 align 2 {
  %9 = alloca %"class.Napi::Object", align 8
  %10 = alloca %class.anon.13, align 1
  %11 = alloca %struct.napi_property_descriptor, align 8
  store ptr %2, ptr %9, align 8
  %12 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr %3, ptr %12, align 8
  %13 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #5
  store ptr %5, ptr %13, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  store ptr %7, ptr %14, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  %15 = call noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectEPKcPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SC_SC_EEv"(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @_ZN4Napi6Object12AddFinalizerEPvPFvP10napi_env__S1_S1_ES1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %13, ptr noundef %15, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  store ptr %4, ptr %11, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr null, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %11, i64 16
  store ptr @_ZN4Napi7details12CallbackData7WrapperEP10napi_env__P20napi_callback_info__, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %11, i64 24
  %19 = getelementptr inbounds i8, ptr %11, i64 48
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %18, i8 0, i64 24, i1 false)
  store i32 %6, ptr %19, align 8, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %11, i64 56
  store ptr %13, ptr %20, 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 %11)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN4Napi18PropertyDescriptor8FunctionENS_3EnvENS_6ObjectEPKcPFNS_5ValueERKNS_12CallbackInfoEE24napi_property_attributesPvENK3$_0cvPFvP10napi_env__SC_SC_EEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 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 = { 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 = { 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 #3 = { 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 #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