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

; 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::InstructionIteratorImpl" = type { ptr, %"struct.std::_Rb_tree_const_iterator", %"class.ir_list::InstructionIteratorImpl" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.ir_list::InstructionIteratorImpl" = type { %"class.boost::intrusive::list_iterator", %"class.boost::intrusive::list_iterator" }
%"class.boost::intrusive::list_iterator" = type { %"struct.boost::intrusive::iiterator_members" }
%"struct.boost::intrusive::iiterator_members" = type { ptr }
%"class.cfg::InstructionIteratorImpl.433" = type { ptr, %"struct.std::_Rb_tree_const_iterator", %"class.ir_list::InstructionIteratorImpl.62" }
%"class.ir_list::InstructionIteratorImpl.62" = type { %"class.boost::intrusive::list_iterator.38", %"class.boost::intrusive::list_iterator.38" }
%"class.boost::intrusive::list_iterator.38" = type { %"struct.boost::intrusive::iiterator_members" }
%"class.ir_list::InstructionIterableImpl.578" = type { %"class.boost::intrusive::list_iterator", %"class.boost::intrusive::list_iterator" }
%"class.cfg::InstructionIterableImpl" = type { ptr }
%struct.MethodItemEntry = type { %"class.boost::intrusive::list_member_hook", i32, %union.anon.16 }
%"class.boost::intrusive::list_member_hook" = type { %"class.boost::intrusive::generic_hook" }
%"class.boost::intrusive::generic_hook" = type { %"struct.boost::intrusive::list_node" }
%"struct.boost::intrusive::list_node" = type { ptr, ptr }
%union.anon.16 = type { ptr }

; 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
declare dso_local void @_ZN3cfg5Block27to_cfg_instruction_iteratorERKN7ir_list23InstructionIteratorImplILb0EEEb(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EEC2ERKNS_16ControlFlowGraphE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN3cfg23InstructionIteratorImplILb1EEppEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7ir_list23InstructionIterableImplILb0EEC2IN3cfg5BlockEEEPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7ir_list23InstructionIterableImplILb0EE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.ir_list::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7ir_list23InstructionIterableImplILb0EE3endEv(ptr dead_on_unwind noalias writable sret(%"class.ir_list::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3cfg16ControlFlowGraph9find_insnEP13IRInstructionPNS_5BlockE(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(160) %1, ptr noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.ir_list::InstructionIterableImpl.578", align 8
  %10 = alloca %"class.ir_list::InstructionIteratorImpl", align 8
  %11 = alloca %"class.ir_list::InstructionIteratorImpl", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.cfg::InstructionIteratorImpl", align 8
  %14 = alloca %"class.cfg::InstructionIterableImpl", align 8
  %15 = alloca %"class.cfg::InstructionIteratorImpl.433", align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %41

19:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7ir_list23InstructionIterableImplILb0EEC2IN3cfg5BlockEEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  call void @_ZNK7ir_list23InstructionIterableImplILb0EE5beginEv(ptr dead_on_unwind writable sret(%"class.ir_list::InstructionIteratorImpl") align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %21

21:                                               ; preds = %33, %19
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  call void @_ZNK7ir_list23InstructionIterableImplILb0EE3endEv(ptr dead_on_unwind writable sret(%"class.ir_list::InstructionIteratorImpl") align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %9)
  %22 = call noundef zeroext i1 @_ZNK7ir_list23InstructionIteratorImplILb0EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  store i32 2, ptr %12, align 4
  br label %35

24:                                               ; preds = %21
  %25 = call noundef ptr @_ZNK7ir_list23InstructionIteratorImplILb0EEptEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %26 = getelementptr inbounds %struct.MethodItemEntry, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = icmp eq ptr %27, %28
  br i1 %29, label %30, label %32

30:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #3
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3cfg5Block27to_cfg_instruction_iteratorERKN7ir_list23InstructionIteratorImplILb0EEEb(ptr dead_on_unwind writable sret(%"class.cfg::InstructionIteratorImpl") align 8 %13, ptr noundef nonnull align 8 dereferenceable(104) %31, ptr noundef nonnull align 8 dereferenceable(16) %10, i1 noundef zeroext false)
  call void @_ZN3cfg23InstructionIteratorImplILb1EEC2ERKNS0_ILb0EEE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %13)
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #3
  store i32 1, ptr %12, align 4
  br label %35

32:                                               ; preds = %24
  br label %33

33:                                               ; preds = %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7ir_list23InstructionIteratorImplILb0EEppEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  br label %21, !llvm.loop !10

35:                                               ; preds = %30, %23
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  %36 = load i32, ptr %12, align 4
  switch i32 %36, label %38 [
    i32 2, label %37
  ]

37:                                               ; preds = %35
  store i32 0, ptr %12, align 4
  br label %38

38:                                               ; preds = %37, %35
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  %39 = load i32, ptr %12, align 4
  switch i32 %39, label %57 [
    i32 0, label %40
    i32 1, label %56
  ]

40:                                               ; preds = %38
  br label %41

41:                                               ; preds = %40, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @_ZN3cfg23InstructionIterableImplILb1EEC2ERKNS_16ControlFlowGraphE(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(160) %16)
  call void @_ZN3cfg23InstructionIterableImplILb1EE5beginEv(ptr dead_on_unwind writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %14)
  br label %42

42:                                               ; preds = %52, %41
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #3
  call void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %15, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %43 = call noundef zeroext i1 @_ZNK3cfg23InstructionIteratorImplILb1EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %15)
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #3
  br i1 %43, label %44, label %54

44:                                               ; preds = %42
  %45 = call noundef ptr @_ZNK3cfg23InstructionIteratorImplILb1EEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %46 = getelementptr inbounds %struct.MethodItemEntry, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = icmp eq ptr %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %44
  store i32 1, ptr %12, align 4
  br label %55

51:                                               ; preds = %44
  br label %52

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3cfg23InstructionIteratorImplILb1EEppEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  br label %42, !llvm.loop !12

54:                                               ; preds = %42
  call void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %14)
  store i32 1, ptr %12, align 4
  br label %55

55:                                               ; preds = %54, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %56

56:                                               ; preds = %55, %38
  ret void

57:                                               ; preds = %38
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIteratorImplILb1EEC2ERKNS0_ILb0EEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3cfg23InstructionIteratorImplILb1EEptEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 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 = { 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"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


; 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.cfg::InstructionIteratorImpl" = type { ptr, %"struct.std::_Rb_tree_const_iterator", %"class.ir_list::InstructionIteratorImpl" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.ir_list::InstructionIteratorImpl" = type { %"class.boost::intrusive::list_iterator", %"class.boost::intrusive::list_iterator" }
%"class.boost::intrusive::list_iterator" = type { %"struct.boost::intrusive::iiterator_members" }
%"struct.boost::intrusive::iiterator_members" = type { ptr }
%"class.cfg::InstructionIteratorImpl.433" = type { ptr, %"struct.std::_Rb_tree_const_iterator", %"class.ir_list::InstructionIteratorImpl.62" }
%"class.ir_list::InstructionIteratorImpl.62" = type { %"class.boost::intrusive::list_iterator.38", %"class.boost::intrusive::list_iterator.38" }
%"class.boost::intrusive::list_iterator.38" = type { %"struct.boost::intrusive::iiterator_members" }
%"class.ir_list::InstructionIterableImpl.578" = type { %"class.boost::intrusive::list_iterator", %"class.boost::intrusive::list_iterator" }
%"class.cfg::InstructionIterableImpl" = 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
declare dso_local void @_ZN3cfg5Block27to_cfg_instruction_iteratorERKN7ir_list23InstructionIteratorImplILb0EEEb(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EEC2ERKNS_16ControlFlowGraphE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(160)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7ir_list23InstructionIterableImplILb0EEC2IN3cfg5BlockEEEPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7ir_list23InstructionIterableImplILb0EE5beginEv(ptr dead_on_unwind noalias writable sret(%"class.ir_list::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7ir_list23InstructionIterableImplILb0EE3endEv(ptr dead_on_unwind noalias writable sret(%"class.ir_list::InstructionIteratorImpl") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3cfg16ControlFlowGraph9find_insnEP13IRInstructionPNS_5BlockE(ptr dead_on_unwind noalias writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(160) %1, ptr noundef readnone %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %5 = alloca %"class.ir_list::InstructionIterableImpl.578", align 8
  %6 = alloca %"class.ir_list::InstructionIteratorImpl", align 8
  %7 = alloca %"class.ir_list::InstructionIteratorImpl", align 8
  %8 = alloca %"class.cfg::InstructionIteratorImpl", align 8
  %9 = alloca %"class.cfg::InstructionIterableImpl", align 8
  %10 = alloca %"class.cfg::InstructionIteratorImpl.433", align 8
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %21, label %11

11:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @_ZN7ir_list23InstructionIterableImplILb0EEC2IN3cfg5BlockEEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNK7ir_list23InstructionIterableImplILb0EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.ir_list::InstructionIteratorImpl") align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  call void @_ZNK7ir_list23InstructionIterableImplILb0EE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.ir_list::InstructionIteratorImpl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %12 = call noundef zeroext i1 @_ZNK7ir_list23InstructionIteratorImplILb0EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br i1 %12, label %.lr.ph, label %.thread

.thread:                                          ; preds = %17, %11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %21

.lr.ph:                                           ; preds = %11, %17
  %13 = call noundef ptr @_ZNK7ir_list23InstructionIteratorImplILb0EEptEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %14 = getelementptr inbounds i8, ptr %13, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = icmp eq ptr %15, %2
  br i1 %16, label %20, label %17

17:                                               ; preds = %.lr.ph
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7ir_list23InstructionIteratorImplILb0EEppEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  call void @_ZNK7ir_list23InstructionIterableImplILb0EE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.ir_list::InstructionIteratorImpl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %19 = call noundef zeroext i1 @_ZNK7ir_list23InstructionIteratorImplILb0EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br i1 %19, label %.lr.ph, label %.thread, !llvm.loop !8

20:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #3
  call void @_ZN3cfg5Block27to_cfg_instruction_iteratorERKN7ir_list23InstructionIteratorImplILb0EEEb(ptr dead_on_unwind nonnull writable sret(%"class.cfg::InstructionIteratorImpl") align 8 %8, ptr noundef nonnull align 8 dereferenceable(104) %3, ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext false)
  call void @_ZN3cfg23InstructionIteratorImplILb1EEC2ERKNS0_ILb0EEE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %8)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %30

21:                                               ; preds = %.thread, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @_ZN3cfg23InstructionIterableImplILb1EEC2ERKNS_16ControlFlowGraphE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(160) %1)
  call void @_ZN3cfg23InstructionIterableImplILb1EE5beginEv(ptr dead_on_unwind writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #3
  call void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %22 = call noundef zeroext i1 @_ZNK3cfg23InstructionIteratorImplILb1EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %10)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #3
  br i1 %22, label %.lr.ph9, label %._crit_edge

.lr.ph9:                                          ; preds = %21, %27
  %23 = call noundef ptr @_ZNK3cfg23InstructionIteratorImplILb1EEptEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = icmp eq ptr %25, %2
  br i1 %26, label %.loopexit, label %27

27:                                               ; preds = %.lr.ph9
  %28 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3cfg23InstructionIteratorImplILb1EEppEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #3
  call void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %29 = call noundef zeroext i1 @_ZNK3cfg23InstructionIteratorImplILb1EEneERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %10)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #3
  br i1 %29, label %.lr.ph9, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %27, %21
  call void @_ZN3cfg23InstructionIterableImplILb1EE3endEv(ptr dead_on_unwind nonnull writable sret(%"class.cfg::InstructionIteratorImpl.433") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph9, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br label %30

30:                                               ; preds = %20, %.loopexit
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3cfg23InstructionIteratorImplILb1EEC2ERKNS0_ILb0EEE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3cfg23InstructionIteratorImplILb1EEptEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass