; LLVM IR from facebook/redex :: service/copy-propagation (AliasedRegisters)

; 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.aliased_registers::AliasGraph" = type { %"class.std::shared_ptr.4", %class.UnorderedMap, %class.UnorderedMap.12, i64 }
%"class.std::shared_ptr.4" = type { %"class.std::__shared_ptr.5" }
%"class.std::__shared_ptr.5" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%class.UnorderedMap = type { %"class.std::unordered_map" }
%"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.UnorderedMap.12 = type { %"class.std::unordered_map.14" }
%"class.std::unordered_map.14" = type { %"class.std::_Hashtable.15" }
%"class.std::_Hashtable.15" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

@.str.10 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj = external hidden unnamed_addr constant [65 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17aliased_registers10AliasGraph8add_edgeEjj(ptr noundef nonnull align 8 dereferenceable(136) %0, i32 noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %7 = load ptr, ptr %4, align 8
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = load i32, ptr %6, align 4, !tbaa !9
  %10 = icmp ne i32 %8, %9
  br i1 %10, label %11, label %12

11:                                               ; preds = %3
  br label %14

12:                                               ; preds = %3
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.39, ptr noundef @.str.10, i32 noundef 689, ptr noundef @__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj, i32 noundef 2, ptr noundef @.str.13) #2
  unreachable

13:                                               ; No predecessors!
  br label %14

14:                                               ; preds = %13, %11
  %15 = getelementptr inbounds %"class.aliased_registers::AliasGraph", ptr %7, i32 0, i32 2
  %16 = call noundef i64 @_ZNK12UnorderedMapIjjSt4hashIjESt8equal_toIjEE5countERKj(ptr noundef nonnull align 8 dereferenceable(56) %15, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  br label %21

19:                                               ; preds = %14
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.40, ptr noundef @.str.10, i32 noundef 690, ptr noundef @__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj, i32 noundef 2, ptr noundef @.str.13) #2
  unreachable

20:                                               ; No predecessors!
  br label %21

21:                                               ; preds = %20, %18
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = getelementptr inbounds %"class.aliased_registers::AliasGraph", ptr %7, i32 0, i32 2
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN12UnorderedMapIjjSt4hashIjESt8equal_toIjEEixERKj(ptr noundef nonnull align 8 dereferenceable(56) %23, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i32 %22, ptr %24, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.aliased_registers::AliasGraph", ptr %7, i32 0, i32 1
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN12UnorderedMapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjEEixERKj(ptr noundef nonnull align 8 dereferenceable(56) %25, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %27 = getelementptr inbounds %"class.aliased_registers::AliasGraph", ptr %7, i32 0, i32 3
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = add i64 %28, 1
  store i64 %29, ptr %27, align 8, !tbaa !11
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

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

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !19, i64 128}
!12 = !{!"_ZTSN17aliased_registers10AliasGraphE", !13, i64 0, !16, i64 16, !23, i64 72, !19, i64 128}
!13 = !{!"_ZTSSt10shared_ptrIN17aliased_registers12VertexValuesEE", !14, i64 0}
!14 = !{!"_ZTSSt12__shared_ptrIN17aliased_registers12VertexValuesELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!16 = !{!"_ZTS12UnorderedMapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjEE", !17, i64 0}
!17 = !{!"_ZTSSt13unordered_mapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjESaISt4pairIKjS2_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_HashtableIjSt4pairIKjSt6vectorIjSaIjEEESaIS5_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !19, i64 8, !20, i64 16, !19, i64 24, !21, i64 32, !6, i64 48}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!21 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !22, i64 0, !19, i64 8}
!22 = !{!"float", !7, i64 0}
!23 = !{!"_ZTS12UnorderedMapIjjSt4hashIjESt8equal_toIjEE", !24, i64 0}
!24 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !25, i64 0}
!25 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !6, i64 0, !19, i64 8, !20, i64 16, !19, i64 24, !21, i64 32, !6, i64 48}


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

@.str.10 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj = external hidden unnamed_addr constant [65 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17aliased_registers10AliasGraph8add_edgeEjj(ptr noundef nonnull align 8 dereferenceable(136) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 %1, ptr %4, align 4, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !5
  %.not = icmp eq i32 %1, %2
  br i1 %.not, label %6, label %7

6:                                                ; preds = %3
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.39, ptr noundef nonnull @.str.10, i32 noundef 689, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj, i32 noundef 2, ptr noundef nonnull @.str.13) #2
  unreachable

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = call noundef i64 @_ZNK12UnorderedMapIjjSt4hashIjESt8equal_toIjEE5countERKj(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %.not1 = icmp eq i64 %9, 0
  br i1 %.not1, label %11, label %10

10:                                               ; preds = %7
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.10, i32 noundef 690, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN17aliased_registers10AliasGraph8add_edgeEjj, i32 noundef 2, ptr noundef nonnull @.str.13) #2
  unreachable

11:                                               ; preds = %7
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN12UnorderedMapIjjSt4hashIjESt8equal_toIjEEixERKj(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i32 %2, ptr %12, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN12UnorderedMapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjEEixERKj(ptr noundef nonnull align 8 dereferenceable(56) %13, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %15 = getelementptr inbounds i8, ptr %0, i64 128
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = add i64 %16, 1
  store i64 %17, ptr %15, align 8, !tbaa !9
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEE9push_backERKj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

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

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

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !18, i64 128}
!10 = !{!"_ZTSN17aliased_registers10AliasGraphE", !11, i64 0, !15, i64 16, !22, i64 72, !18, i64 128}
!11 = !{!"_ZTSSt10shared_ptrIN17aliased_registers12VertexValuesEE", !12, i64 0}
!12 = !{!"_ZTSSt12__shared_ptrIN17aliased_registers12VertexValuesELN9__gnu_cxx12_Lock_policyE2EE", !13, i64 0, !14, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !13, i64 0}
!15 = !{!"_ZTS12UnorderedMapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjEE", !16, i64 0}
!16 = !{!"_ZTSSt13unordered_mapIjSt6vectorIjSaIjEESt4hashIjESt8equal_toIjESaISt4pairIKjS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt10_HashtableIjSt4pairIKjSt6vectorIjSaIjEEESaIS5_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS7_18_Mod_range_hashingENS7_20_Default_ranged_hashENS7_20_Prime_rehash_policyENS7_17_Hashtable_traitsILb0ELb0ELb1EEEE", !13, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !13, i64 48}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !13, i64 0}
!20 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !21, i64 0, !18, i64 8}
!21 = !{!"float", !7, i64 0}
!22 = !{!"_ZTS12UnorderedMapIjjSt4hashIjESt8equal_toIjEE", !23, i64 0}
!23 = !{!"_ZTSSt13unordered_mapIjjSt4hashIjESt8equal_toIjESaISt4pairIKjjEEE", !24, i64 0}
!24 = !{!"_ZTSSt10_HashtableIjSt4pairIKjjESaIS2_ENSt8__detail10_Select1stESt8equal_toIjESt4hashIjENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !13, i64 0, !18, i64 8, !19, i64 16, !18, i64 24, !20, i64 32, !13, i64 48}


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