; LLVM IR from facebook/redex :: service/dataflow (ConstantUses)

; 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.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator" = type { %"struct.std::__detail::_Node_const_iterator" }
%"struct.std::__detail::_Node_const_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"class.constant_uses::ConstantUses" = type { %"class.std::unique_ptr", %class.UnorderedMap, %"class.std::vector", ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<IRInstruction *, unsigned long>, std::allocator<std::pair<IRInstruction *, unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<IRInstruction *, unsigned long>, std::allocator<std::pair<IRInstruction *, unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<IRInstruction *, unsigned long>, std::allocator<std::pair<IRInstruction *, unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<IRInstruction *, unsigned long>, std::allocator<std::pair<IRInstruction *, unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.289" = type { ptr, %"class.std::vector" }

@.str.10 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__._ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction = external hidden unnamed_addr constant [125 x i8], align 1

; 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: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", align 8
  %6 = alloca %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %10 = zext i16 %9 to i32
  %11 = icmp eq i32 %10, 12
  br i1 %11, label %17, label %12

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  %15 = zext i16 %14 to i32
  %16 = icmp eq i32 %15, 13
  br i1 %16, label %17, label %18

17:                                               ; preds = %12, %2
  br label %20

18:                                               ; preds = %12
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.14, ptr noundef @.str.10, i32 noundef 156, ptr noundef @__PRETTY_FUNCTION__._ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction, i32 noundef 2, ptr noundef @.str.11) #4
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %21 = getelementptr inbounds %"class.constant_uses::ConstantUses", ptr %7, i32 0, i32 1
  %22 = call ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(56) %21, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %23 = getelementptr inbounds %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", ptr %5, i32 0, i32 0
  %24 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %24, i32 0, i32 0
  store ptr %22, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %26 = getelementptr inbounds %"class.constant_uses::ConstantUses", ptr %7, i32 0, i32 1
  %27 = call ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %26)
  %28 = getelementptr inbounds %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", ptr %6, i32 0, i32 0
  %29 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator", ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %29, i32 0, i32 0
  store ptr %27, ptr %30, align 8
  %31 = call noundef zeroext i1 @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorneERKSC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br i1 %31, label %32, label %35

32:                                               ; preds = %20
  %33 = call noundef ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %34 = getelementptr inbounds %"struct.std::pair.289", ptr %33, i32 0, i32 1
  br label %37

35:                                               ; preds = %20
  %36 = getelementptr inbounds %"class.constant_uses::ConstantUses", ptr %7, i32 0, i32 2
  br label %37

37:                                               ; preds = %35, %32
  %38 = phi ptr [ %34, %32 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret ptr %38
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorneERKSC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorptEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { noreturn }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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

%"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator" = type { %"struct.std::__detail::_Node_const_iterator" }
%"struct.std::__detail::_Node_const_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@.str.10 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__._ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction = external hidden unnamed_addr constant [125 x i8], align 1

; 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: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull %1) local_unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", align 8
  %5 = alloca %"class.UnorderedMap<IRInstruction *, std::vector<std::pair<IRInstruction *, unsigned long>>>::ConstFixedIterator", align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  %6 = tail call noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %7 = icmp eq i16 %6, 12
  br i1 %7, label %12, label %8

8:                                                ; preds = %2
  %9 = tail call noundef zeroext i16 @_ZNK13IRInstruction6opcodeEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %10 = icmp eq i16 %9, 13
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.10, i32 noundef 156, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK13constant_uses12ConstantUses17get_constant_usesEP13IRInstruction, i32 noundef 2, ptr noundef nonnull @.str.11) #4
  unreachable

12:                                               ; preds = %2, %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = call ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE4findERKS1_(ptr noundef nonnull align 8 dereferenceable(56) %13, ptr noundef nonnull align 8 dereferenceable(8) %3)
  store ptr %14, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %15 = call ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %13)
  store ptr %15, ptr %5, align 8
  %16 = call noundef zeroext i1 @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorneERKSC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %16, label %17, label %20

17:                                               ; preds = %12
  %18 = call noundef ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  br label %22

20:                                               ; preds = %12
  %21 = getelementptr inbounds i8, ptr %0, i64 64
  br label %22

22:                                               ; preds = %20, %17
  %23 = phi ptr [ %19, %17 ], [ %21, %20 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret ptr %23
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorneERKSC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12UnorderedMapIP13IRInstructionSt6vectorISt4pairIS1_mESaIS4_EESt4hashIS1_ESt8equal_toIS1_EE18ConstFixedIteratorptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { noreturn }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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