; LLVM IR from facebook/redex :: service/regalloc (GraphColoring)

; 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<cfg::Block *, unsigned long>::ConstUnorderedIterable" = type { ptr }
%"struct.std::__detail::_Node_const_iterator.339" = type { %"struct.std::__detail::_Node_iterator_base.340" }
%"struct.std::__detail::_Node_iterator_base.340" = type { ptr }
%"struct.std::pair.341" = type { ptr, i64 }

; 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
define dso_local noundef zeroext i1 @_ZN8regalloc14graph_coloring9bad_catchEjRKNS_10SplitCostsE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(56) %1) #1 {
  %3 = alloca i1, align 1
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.UnorderedMap<cfg::Block *, unsigned long>::ConstUnorderedIterable", align 8
  %9 = alloca %"struct.std::__detail::_Node_const_iterator.339", align 8
  %10 = alloca %"struct.std::__detail::_Node_const_iterator.339", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair.341", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = trunc i32 %14 to i16
  %16 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK8regalloc10SplitCosts14death_at_catchEt(ptr noundef nonnull align 8 dereferenceable(56) %13, i16 noundef zeroext %15)
  store ptr %16, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %17 = load ptr, ptr %6, align 8, !tbaa !9
  %18 = call ptr @_Z17UnorderedIterableI12UnorderedMapIPN3cfg5BlockEmSt4hashIS3_ESt8equal_toIS3_EETnNSt9enable_ifIXsr3stdE12is_base_of_vI13UnorderedBaseIT_ESB_EEbE4typeELb1EEDaRKSB_(ptr noundef nonnull align 8 dereferenceable(56) %17)
  %19 = getelementptr inbounds %"class.UnorderedMap<cfg::Block *, unsigned long>::ConstUnorderedIterable", ptr %8, i32 0, i32 0
  store ptr %18, ptr %19, align 8
  store ptr %8, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %20 = load ptr, ptr %7, align 8, !tbaa !9
  %21 = call ptr @_ZNK12UnorderedMapIPN3cfg5BlockEmSt4hashIS2_ESt8equal_toIS2_EE22ConstUnorderedIterable5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %22 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator.339", ptr %9, i32 0, i32 0
  %23 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.340", ptr %22, i32 0, i32 0
  store ptr %21, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = load ptr, ptr %7, align 8, !tbaa !9
  %25 = call ptr @_ZNK12UnorderedMapIPN3cfg5BlockEmSt4hashIS2_ESt8equal_toIS2_EE22ConstUnorderedIterable3endEv(ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = getelementptr inbounds %"struct.std::__detail::_Node_const_iterator.339", ptr %10, i32 0, i32 0
  %27 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.340", ptr %26, i32 0, i32 0
  store ptr %25, ptr %27, align 8
  br label %28

28:                                               ; preds = %45, %2
  %29 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3cfg5BlockEmELb0EEES9_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br i1 %29, label %31, label %30

30:                                               ; preds = %28
  store i32 2, ptr %11, align 4
  br label %47

31:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %32, i64 16, i1 false)
  %33 = getelementptr inbounds %"struct.std::pair.341", ptr %12, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3cfg5Block5predsEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  %36 = call noundef i64 @_ZNKSt6vectorIPN3cfg4EdgeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #4
  %37 = getelementptr inbounds %"struct.std::pair.341", ptr %12, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !14
  %39 = icmp ne i64 %36, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %31
  store i1 true, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %42

41:                                               ; preds = %31
  store i32 0, ptr %11, align 4
  br label %42

42:                                               ; preds = %41, %40
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  %43 = load i32, ptr %11, align 4
  switch i32 %43, label %47 [
    i32 0, label %44
  ]

44:                                               ; preds = %42
  br label %45

45:                                               ; preds = %44
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br label %28

47:                                               ; preds = %42, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %48 = load i32, ptr %11, align 4
  switch i32 %48, label %50 [
    i32 2, label %49
  ]

49:                                               ; preds = %47
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %50

50:                                               ; preds = %49, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %51 = load i1, ptr %3, align 1
  ret i1 %51
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSSt4pairIKPN3cfg5BlockEmE", !10, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}


; 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<cfg::Block *, unsigned long>::ConstUnorderedIterable" = type { ptr }
%"struct.std::__detail::_Node_const_iterator.339" = type { %"struct.std::__detail::_Node_iterator_base.340" }
%"struct.std::__detail::_Node_iterator_base.340" = type { ptr }

; 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
define dso_local noundef zeroext i1 @_ZN8regalloc14graph_coloring9bad_catchEjRKNS_10SplitCostsE(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(56) %1) local_unnamed_addr #1 {
  %3 = alloca %"class.UnorderedMap<cfg::Block *, unsigned long>::ConstUnorderedIterable", align 8
  %4 = alloca %"struct.std::__detail::_Node_const_iterator.339", align 8
  %5 = alloca %"struct.std::__detail::_Node_const_iterator.339", align 8
  %6 = trunc i32 %0 to i16
  %7 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK8regalloc10SplitCosts14death_at_catchEt(ptr noundef nonnull align 8 dereferenceable(56) %1, i16 noundef zeroext %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %8 = tail call ptr @_Z17UnorderedIterableI12UnorderedMapIPN3cfg5BlockEmSt4hashIS3_ESt8equal_toIS3_EETnNSt9enable_ifIXsr3stdE12is_base_of_vI13UnorderedBaseIT_ESB_EEbE4typeELb1EEDaRKSB_(ptr noundef nonnull align 8 dereferenceable(56) %7)
  store ptr %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %9 = call ptr @_ZNK12UnorderedMapIPN3cfg5BlockEmSt4hashIS2_ESt8equal_toIS2_EE22ConstUnorderedIterable5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  store ptr %9, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %10 = call ptr @_ZNK12UnorderedMapIPN3cfg5BlockEmSt4hashIS2_ESt8equal_toIS2_EE22ConstUnorderedIterable3endEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  store ptr %10, ptr %5, align 8
  %11 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3cfg5BlockEmELb0EEES9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %11, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %2, %15
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %.sroa.0.0.copyload = load ptr, ptr %12, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3cfg5Block5predsEv(ptr noundef nonnull align 8 dereferenceable(104) %.sroa.0.0.copyload)
  %14 = call noundef i64 @_ZNKSt6vectorIPN3cfg4EdgeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #3
  %.not = icmp eq i64 %14, %.sroa.4.0.copyload
  br i1 %.not, label %15, label %18

15:                                               ; preds = %.lr.ph
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %17 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKPN3cfg5BlockEmELb0EEES9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  br i1 %17, label %.lr.ph, label %.critedge

18:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %19

.critedge:                                        ; preds = %15, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %19

19:                                               ; preds = %18, %.critedge
  %20 = phi i1 [ true, %18 ], [ false, %.critedge ]
  ret i1 %20
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail20_Node_const_iteratorISt4pairIKPN3cfg5BlockEmELb0ELb0EEppEv(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 = { 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 = { 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 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass