; LLVM IR from facebook/hermes :: API/hermes/cdp (RemoteObjectsTable)

; 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.facebook::hermes::cdp::RemoteObjectsTable" = type { i64, i64, %"class.std::unordered_map", %"class.std::unordered_map.2", %"class.std::unordered_map.16", %"class.std::unordered_map.30" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::unordered_map.2" = type { %"class.std::_Hashtable.3" }
%"class.std::_Hashtable.3" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::unordered_map.16" = type { %"class.std::_Hashtable.17" }
%"class.std::_Hashtable.17" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::unordered_map.30" = type { %"class.std::_Hashtable.31" }
%"class.std::_Hashtable.31" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_19isScopeIdEl(i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_19isValueIdEl(i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8facebook6hermes3cdp18RemoteObjectsTable13releaseObjectEl(ptr noundef nonnull align 8 dereferenceable(240) %0, i64 noundef %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %6 = load ptr, ptr %4, align 8
  %7 = load i64, ptr %5, align 8, !tbaa !9
  %8 = call noundef zeroext i1 @_ZN12_GLOBAL__N_19isScopeIdEl(i64 noundef %7)
  br i1 %8, label %9, label %13

9:                                                ; preds = %2
  %10 = getelementptr inbounds %"class.facebook::hermes::cdp::RemoteObjectsTable", ptr %6, i32 0, i32 2
  %11 = call noundef i64 @_ZNSt13unordered_mapIlSt4pairIjjESt4hashIlESt8equal_toIlESaIS0_IKlS1_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(56) %10, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %12 = icmp ne i64 %11, 0
  store i1 %12, ptr %3, align 1
  br label %21

13:                                               ; preds = %2
  %14 = load i64, ptr %5, align 8, !tbaa !9
  %15 = call noundef zeroext i1 @_ZN12_GLOBAL__N_19isValueIdEl(i64 noundef %14)
  br i1 %15, label %16, label %20

16:                                               ; preds = %13
  %17 = getelementptr inbounds %"class.facebook::hermes::cdp::RemoteObjectsTable", ptr %6, i32 0, i32 3
  %18 = call noundef i64 @_ZNSt13unordered_mapIlN8facebook3jsi5ValueESt4hashIlESt8equal_toIlESaISt4pairIKlS2_EEE5eraseERS8_(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %19 = icmp ne i64 %18, 0
  store i1 %19, ptr %3, align 1
  br label %21

20:                                               ; preds = %13
  store i1 false, ptr %3, align 1
  br label %21

21:                                               ; preds = %20, %16, %9
  %22 = load i1, ptr %3, align 1
  ret i1 %22
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_mapIlSt4pairIjjESt4hashIlESt8equal_toIlESaIS0_IKlS1_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_mapIlN8facebook3jsi5ValueESt4hashIlESt8equal_toIlESaISt4pairIKlS2_EEE5eraseERS8_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

attributes #0 = { 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 #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" }

!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 = !{!"long", !7, i64 0}


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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_19isScopeIdEl(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN12_GLOBAL__N_19isValueIdEl(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8facebook6hermes3cdp18RemoteObjectsTable13releaseObjectEl(ptr noundef nonnull align 8 dereferenceable(240) %0, i64 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca i64, align 8
  store i64 %1, ptr %3, align 8, !tbaa !5
  %4 = tail call noundef zeroext i1 @_ZN12_GLOBAL__N_19isScopeIdEl(i64 noundef %1)
  br i1 %4, label %5, label %9

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = call noundef i64 @_ZNSt13unordered_mapIlSt4pairIjjESt4hashIlESt8equal_toIlESaIS0_IKlS1_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(56) %6, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %8 = icmp ne i64 %7, 0
  br label %15

9:                                                ; preds = %2
  %10 = tail call noundef zeroext i1 @_ZN12_GLOBAL__N_19isValueIdEl(i64 noundef %1)
  br i1 %10, label %11, label %15

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 72
  %13 = call noundef i64 @_ZNSt13unordered_mapIlN8facebook3jsi5ValueESt4hashIlESt8equal_toIlESaISt4pairIKlS2_EEE5eraseERS8_(ptr noundef nonnull align 8 dereferenceable(56) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %14 = icmp ne i64 %13, 0
  br label %15

15:                                               ; preds = %9, %11, %5
  %.0 = phi i1 [ %8, %5 ], [ %14, %11 ], [ false, %9 ]
  ret i1 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_mapIlSt4pairIjjESt4hashIlESt8equal_toIlESaIS0_IKlS1_EEE5eraseERS6_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_mapIlN8facebook3jsi5ValueESt4hashIlESt8equal_toIlESaISt4pairIKlS2_EEE5eraseERS8_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

attributes #0 = { 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 #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" }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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