; LLVM IR from facebook/redex :: libredex/ControlFlow.ll (ZNK3cfg5Block8same_tryEPKS0_)

; 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.cfg::Block" = type { i64, %class.IRList, %"class.boost::intrusive::list_iterator", %"class.boost::intrusive::list_iterator", %"class.std::vector.11", %"class.std::vector.11", ptr }
%class.IRList = type { %"class.boost::intrusive::list" }
%"class.boost::intrusive::list" = type { %"class.boost::intrusive::list_impl" }
%"class.boost::intrusive::list_impl" = type { %"struct.boost::intrusive::list_impl<boost::intrusive::mhtraits<MethodItemEntry, boost::intrusive::list_member_hook<>, &MethodItemEntry::list_hook_>, unsigned long, true, void>::data_t" }
%"struct.boost::intrusive::list_impl<boost::intrusive::mhtraits<MethodItemEntry, boost::intrusive::list_member_hook<>, &MethodItemEntry::list_hook_>, unsigned long, true, void>::data_t" = type { %"struct.boost::intrusive::list_impl<boost::intrusive::mhtraits<MethodItemEntry, boost::intrusive::list_member_hook<>, &MethodItemEntry::list_hook_>, unsigned long, true, void>::root_plus_size" }
%"struct.boost::intrusive::list_impl<boost::intrusive::mhtraits<MethodItemEntry, boost::intrusive::list_member_hook<>, &MethodItemEntry::list_hook_>, unsigned long, true, void>::root_plus_size" = type { %"struct.boost::intrusive::detail::size_holder", %"struct.boost::intrusive::detail::default_header_holder" }
%"struct.boost::intrusive::detail::size_holder" = type { i64 }
%"struct.boost::intrusive::detail::default_header_holder" = type { %"struct.boost::intrusive::list_node" }
%"struct.boost::intrusive::list_node" = type { ptr, ptr }
%"class.boost::intrusive::list_iterator" = type { %"struct.boost::intrusive::iiterator_members" }
%"struct.boost::intrusive::iiterator_members" = type { ptr }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<cfg::Edge *, std::allocator<cfg::Edge *>>::_Vector_impl" }
%"struct.std::_Vector_base<cfg::Edge *, std::allocator<cfg::Edge *>>::_Vector_impl" = type { %"struct.std::_Vector_base<cfg::Edge *, std::allocator<cfg::Edge *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cfg::Edge *, std::allocator<cfg::Edge *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3cfg5Block8same_tryEPKS0_ = external hidden unnamed_addr constant [47 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3cfg5Block8same_tryEPKS0_(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %"class.cfg::Block", ptr %6, i32 0, i32 6
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"class.cfg::Block", ptr %5, i32 0, i32 6
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = icmp eq ptr %8, %10
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %15

13:                                               ; preds = %2
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 277, ptr noundef @__PRETTY_FUNCTION__._ZNK3cfg5Block8same_tryEPKS0_, i32 noundef 2, ptr noundef @.str.9) #2
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = getelementptr inbounds %"class.cfg::Block", ptr %5, i32 0, i32 6
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef zeroext i1 @_ZNK3cfg16ControlFlowGraph22blocks_are_in_same_tryEPKNS_5BlockES3_(ptr noundef nonnull align 8 dereferenceable(160) %17, ptr noundef %5, ptr noundef %18)
  ret i1 %19
}

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK3cfg16ControlFlowGraph22blocks_are_in_same_tryEPKNS_5BlockES3_(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef, ptr noundef) #0 align 2

attributes #0 = { 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 #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 = { 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, !6, i64 96}
!10 = !{!"_ZTSN3cfg5BlockE", !11, i64 0, !12, i64 8, !20, i64 32, !20, i64 40, !22, i64 48, !22, i64 72, !6, i64 96}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTS6IRList", !13, i64 0}
!13 = !{!"_ZTSN5boost9intrusive4listI15MethodItemEntryJNS0_11member_hookIS2_NS0_16list_member_hookIJEEEXadL_ZNS2_10list_hook_EEEEEEEE", !14, i64 0}
!14 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvEE", !15, i64 0}
!15 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvE6data_tE", !16, i64 0}
!16 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvE14root_plus_sizeE", !17, i64 0, !18, i64 8}
!17 = !{!"_ZTSN5boost9intrusive6detail11size_holderILb1EmvEE", !11, i64 0}
!18 = !{!"_ZTSN5boost9intrusive6detail21default_header_holderINS0_16list_node_traitsIPvEEEE", !19, i64 0}
!19 = !{!"_ZTSN5boost9intrusive9list_nodeIPvEE", !6, i64 0, !6, i64 8}
!20 = !{!"_ZTSN5boost9intrusive13list_iteratorINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEELb0EEE", !21, i64 0}
!21 = !{!"_ZTSN5boost9intrusive17iiterator_membersIPNS0_9list_nodeIPvEEPKNS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS7_10list_hook_EEEEELb0EEE", !6, i64 0}
!22 = !{!"_ZTSSt6vectorIPN3cfg4EdgeESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}


; 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.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZNK3cfg5Block8same_tryEPKS0_ = external hidden unnamed_addr constant [47 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK3cfg5Block8same_tryEPKS0_(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 96
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 96
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %4, %6
  br i1 %7, label %9, label %8

8:                                                ; preds = %2
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 277, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK3cfg5Block8same_tryEPKS0_, i32 noundef 2, ptr noundef nonnull @.str.9) #2
  unreachable

9:                                                ; preds = %2
  %10 = tail call noundef zeroext i1 @_ZNK3cfg16ControlFlowGraph22blocks_are_in_same_tryEPKNS_5BlockES3_(ptr noundef nonnull align 8 dereferenceable(160) %6, ptr noundef nonnull %0, ptr noundef nonnull %1)
  ret i1 %10
}

; 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 uwtable
declare dso_local noundef zeroext i1 @_ZNK3cfg16ControlFlowGraph22blocks_are_in_same_tryEPKNS_5BlockES3_(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #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 = { 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, !18, i64 96}
!6 = !{!"_ZTSN3cfg5BlockE", !7, i64 0, !10, i64 8, !19, i64 32, !19, i64 40, !21, i64 48, !21, i64 72, !18, i64 96}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS6IRList", !11, i64 0}
!11 = !{!"_ZTSN5boost9intrusive4listI15MethodItemEntryJNS0_11member_hookIS2_NS0_16list_member_hookIJEEEXadL_ZNS2_10list_hook_EEEEEEEE", !12, i64 0}
!12 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvEE", !13, i64 0}
!13 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvE6data_tE", !14, i64 0}
!14 = !{!"_ZTSN5boost9intrusive9list_implINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEEmLb1EvE14root_plus_sizeE", !15, i64 0, !16, i64 8}
!15 = !{!"_ZTSN5boost9intrusive6detail11size_holderILb1EmvEE", !7, i64 0}
!16 = !{!"_ZTSN5boost9intrusive6detail21default_header_holderINS0_16list_node_traitsIPvEEEE", !17, i64 0}
!17 = !{!"_ZTSN5boost9intrusive9list_nodeIPvEE", !18, i64 0, !18, i64 8}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!"_ZTSN5boost9intrusive13list_iteratorINS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS3_10list_hook_EEEEELb0EEE", !20, i64 0}
!20 = !{!"_ZTSN5boost9intrusive17iiterator_membersIPNS0_9list_nodeIPvEEPKNS0_8mhtraitsI15MethodItemEntryNS0_16list_member_hookIJEEEXadL_ZNS7_10list_hook_EEEEELb0EEE", !18, i64 0}
!21 = !{!"_ZTSSt6vectorIPN3cfg4EdgeESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIPN3cfg4EdgeESaIS2_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}


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