; LLVM IR from aap/librw :: src/plg.ll (ZN2rw10PluginList10streamReadEPNS_6StreamEPv)

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

%"struct.rw::ChunkHeaderInfo" = type { i32, i32, i32, i32 }
%"struct.rw::PluginList" = type { i32, i32, %"struct.rw::LinkList" }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::Plugin" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"struct.rw::LLLink", %"struct.rw::LLLink" }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; 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 @_ZN2rw10PluginList10streamReadEPNS_6StreamEPv(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.rw::ChunkHeaderInfo", align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call noundef zeroext i1 @_ZN2rw9findChunkEPNS_6StreamEjPjS2_(ptr noundef %18, i32 noundef 3, ptr noundef %8, ptr noundef null)
  br i1 %19, label %21, label %20

20:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %130

21:                                               ; preds = %3
  br label %22

22:                                               ; preds = %89, %21
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %94

25:                                               ; preds = %22
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call noundef zeroext i1 @_ZN2rw19readChunkHeaderInfoEPNS_6StreamEPNS_15ChunkHeaderInfoE(ptr noundef %26, ptr noundef %9)
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %130

29:                                               ; preds = %25
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = sub nsw i32 %30, 12
  store i32 %31, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %32 = getelementptr inbounds %"struct.rw::PluginList", ptr %17, i32 0, i32 2
  %33 = getelementptr inbounds %"struct.rw::LinkList", ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.rw::LLLink", ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  store ptr %35, ptr %12, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %78, %29
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.rw::LLLink", ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  store ptr %39, ptr %11, align 8, !tbaa !5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.rw::PluginList", ptr %17, i32 0, i32 2
  %42 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %41)
  %43 = icmp ne ptr %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  store i32 4, ptr %10, align 4
  br label %80

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 -88
  store ptr %47, ptr %13, align 8, !tbaa !5
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.rw::Plugin", ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 8, !tbaa !16
  %51 = getelementptr inbounds %"struct.rw::ChunkHeaderInfo", ptr %9, i32 0, i32 0
  %52 = load i32, ptr %51, align 4, !tbaa !18
  %53 = icmp eq i32 %50, %52
  br i1 %53, label %54, label %74

54:                                               ; preds = %45
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.rw::Plugin", ptr %55, i32 0, i32 6
  %57 = load ptr, ptr %56, align 8, !tbaa !20
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %74

59:                                               ; preds = %54
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.rw::Plugin", ptr %60, i32 0, i32 6
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.rw::ChunkHeaderInfo", ptr %9, i32 0, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !21
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.rw::Plugin", ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !22
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.rw::Plugin", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !23
  %73 = call noundef ptr %62(ptr noundef %63, i32 noundef %65, ptr noundef %66, i32 noundef %69, i32 noundef %72)
  store i32 7, ptr %10, align 4
  br label %75

74:                                               ; preds = %54, %45
  store i32 0, ptr %10, align 4
  br label %75

75:                                               ; preds = %74, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %76 = load i32, ptr %10, align 4
  switch i32 %76, label %80 [
    i32 0, label %77
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %79, ptr %12, align 8, !tbaa !5
  br label %36, !llvm.loop !24

80:                                               ; preds = %75, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %81 = load i32, ptr %10, align 4
  switch i32 %81, label %130 [
    i32 4, label %82
    i32 7, label %89
  ]

82:                                               ; preds = %80
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.rw::ChunkHeaderInfo", ptr %9, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !21
  %86 = load ptr, ptr %83, align 8, !tbaa !26
  %87 = getelementptr inbounds ptr, ptr %86, i64 5
  %88 = load ptr, ptr %87, align 8
  call void %88(ptr noundef nonnull align 8 dereferenceable(8) %83, i32 noundef %85, i32 noundef 1)
  br label %89

89:                                               ; preds = %82, %80
  %90 = getelementptr inbounds %"struct.rw::ChunkHeaderInfo", ptr %9, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !21
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = sub i32 %92, %91
  store i32 %93, ptr %8, align 4, !tbaa !9
  br label %22, !llvm.loop !28

94:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %95 = getelementptr inbounds %"struct.rw::PluginList", ptr %17, i32 0, i32 2
  %96 = getelementptr inbounds %"struct.rw::LinkList", ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %"struct.rw::LLLink", ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  store ptr %98, ptr %15, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %127, %94
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.rw::LLLink", ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  store ptr %102, ptr %14, align 8, !tbaa !5
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.rw::PluginList", ptr %17, i32 0, i32 2
  %105 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %104)
  %106 = icmp ne ptr %103, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %99
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %129

108:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 -88
  store ptr %110, ptr %16, align 8, !tbaa !5
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.rw::Plugin", ptr %111, i32 0, i32 10
  %113 = load ptr, ptr %112, align 8, !tbaa !29
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %126

115:                                              ; preds = %108
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.rw::Plugin", ptr %116, i32 0, i32 10
  %118 = load ptr, ptr %117, align 8, !tbaa !29
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.rw::Plugin", ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !22
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.rw::Plugin", ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !23
  call void %118(ptr noundef %119, i32 noundef %122, i32 noundef %125)
  br label %126

126:                                              ; preds = %115, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %128, ptr %15, align 8, !tbaa !5
  br label %99, !llvm.loop !30

129:                                              ; preds = %107
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %130

130:                                              ; preds = %129, %80, %28, %20
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %131 = load i1, ptr %4, align 1
  ret i1 %131
}

declare noundef zeroext i1 @_ZN2rw9findChunkEPNS_6StreamEjPjS2_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare noundef zeroext i1 @_ZN2rw19readChunkHeaderInfoEPNS_6StreamEPNS_15ChunkHeaderInfoE(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN2rw10PluginListE", !10, i64 0, !10, i64 4, !13, i64 8}
!13 = !{!"_ZTSN2rw8LinkListE", !14, i64 0}
!14 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 0}
!16 = !{!17, !10, i64 8}
!17 = !{!"_ZTSN2rw6PluginE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !14, i64 104}
!18 = !{!19, !10, i64 0}
!19 = !{!"_ZTSN2rw15ChunkHeaderInfoE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!20 = !{!17, !6, i64 40}
!21 = !{!19, !10, i64 4}
!22 = !{!17, !10, i64 0}
!23 = !{!17, !10, i64 4}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !8, i64 0}
!28 = distinct !{!28, !25}
!29 = !{!17, !6, i64 72}
!30 = distinct !{!30, !25}


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

%"struct.rw::ChunkHeaderInfo" = type { i32, i32, i32, i32 }

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; 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 @_ZN2rw10PluginList10streamReadEPNS_6StreamEPv(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca %"struct.rw::ChunkHeaderInfo", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  %6 = call noundef zeroext i1 @_ZN2rw9findChunkEPNS_6StreamEjPjS2_(ptr noundef %1, i32 noundef 3, ptr noundef nonnull %4, ptr noundef null)
  br i1 %6, label %thread-pre-split, label %.loopexit

thread-pre-split:                                 ; preds = %3
  %.pr = load i32, ptr %4, align 4, !tbaa !5
  %7 = icmp sgt i32 %.pr, 0
  br i1 %7, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %thread-pre-split
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %5, i64 4
  br label %10

10:                                               ; preds = %.lr.ph45, %40
  %11 = call noundef zeroext i1 @_ZN2rw19readChunkHeaderInfoEPNS_6StreamEPNS_15ChunkHeaderInfoE(ptr noundef %1, ptr noundef nonnull %5)
  br i1 %11, label %12, label %.loopexit

12:                                               ; preds = %10
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = add nsw i32 %13, -12
  store i32 %14, ptr %4, align 4, !tbaa !5
  %15 = load ptr, ptr %8, align 8, !tbaa !9
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %.not3243 = icmp eq ptr %15, %17
  br i1 %.not3243, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %12, %26
  %18 = phi ptr [ %27, %26 ], [ %16, %12 ]
  %.02844 = phi ptr [ %18, %26 ], [ %15, %12 ]
  %19 = getelementptr inbounds i8, ptr %.02844, i64 -80
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %21 = load i32, ptr %5, align 4, !tbaa !17
  %22 = icmp eq i32 %20, %21
  br i1 %22, label %23, label %26

23:                                               ; preds = %.lr.ph
  %24 = getelementptr inbounds i8, ptr %.02844, i64 -48
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %.not33 = icmp eq ptr %25, null
  br i1 %.not33, label %26, label %29

26:                                               ; preds = %.lr.ph, %23
  %27 = load ptr, ptr %18, align 8, !tbaa !14
  %28 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %.not32 = icmp eq ptr %18, %28
  br i1 %.not32, label %._crit_edge, label %.lr.ph, !llvm.loop !20

29:                                               ; preds = %23
  %30 = getelementptr inbounds i8, ptr %.02844, i64 -88
  %31 = load i32, ptr %9, align 4, !tbaa !22
  %32 = load i32, ptr %30, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %.02844, i64 -84
  %34 = load i32, ptr %33, align 4, !tbaa !24
  %35 = call noundef ptr %25(ptr noundef %1, i32 noundef %31, ptr noundef %2, i32 noundef %32, i32 noundef %34)
  br label %40

._crit_edge:                                      ; preds = %26, %12
  %36 = load i32, ptr %9, align 4, !tbaa !22
  %37 = load ptr, ptr %1, align 8, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %37, i64 40
  %39 = load ptr, ptr %38, align 8
  call void %39(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %36, i32 noundef 1)
  br label %40

40:                                               ; preds = %29, %._crit_edge
  %41 = load i32, ptr %9, align 4, !tbaa !22
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sub i32 %42, %41
  store i32 %43, ptr %4, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %10, label %._crit_edge46, !llvm.loop !27

._crit_edge46:                                    ; preds = %40, %thread-pre-split
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %.not47 = icmp eq ptr %46, %48
  br i1 %.not47, label %.loopexit, label %.lr.ph50

.lr.ph50:                                         ; preds = %._crit_edge46, %57
  %49 = phi ptr [ %58, %57 ], [ %47, %._crit_edge46 ]
  %.02648 = phi ptr [ %49, %57 ], [ %46, %._crit_edge46 ]
  %50 = getelementptr inbounds i8, ptr %.02648, i64 -16
  %51 = load ptr, ptr %50, align 8, !tbaa !28
  %.not31 = icmp eq ptr %51, null
  br i1 %.not31, label %57, label %52

52:                                               ; preds = %.lr.ph50
  %53 = getelementptr inbounds i8, ptr %.02648, i64 -88
  %54 = load i32, ptr %53, align 8, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %.02648, i64 -84
  %56 = load i32, ptr %55, align 4, !tbaa !24
  call void %51(ptr noundef %2, i32 noundef %54, i32 noundef %56)
  br label %57

57:                                               ; preds = %52, %.lr.ph50
  %58 = load ptr, ptr %49, align 8, !tbaa !14
  %59 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %.not = icmp eq ptr %49, %59
  br i1 %.not, label %.loopexit, label %.lr.ph50, !llvm.loop !29

.loopexit:                                        ; preds = %10, %57, %._crit_edge46, %3
  %.0 = phi i1 [ false, %3 ], [ true, %._crit_edge46 ], [ true, %57 ], [ false, %10 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret i1 %.0
}

declare noundef zeroext i1 @_ZN2rw9findChunkEPNS_6StreamEjPjS2_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZN2rw19readChunkHeaderInfoEPNS_6StreamEPNS_15ChunkHeaderInfoE(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { 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, !13, i64 8}
!10 = !{!"_ZTSN2rw10PluginListE", !6, i64 0, !6, i64 4, !11, i64 8}
!11 = !{!"_ZTSN2rw8LinkListE", !12, i64 0}
!12 = !{!"_ZTSN2rw6LLLinkE", !13, i64 0, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSN2rw6PluginE", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !12, i64 88, !12, i64 104}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSN2rw15ChunkHeaderInfoE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!19 = !{!16, !13, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !6, i64 4}
!23 = !{!16, !6, i64 0}
!24 = !{!16, !6, i64 4}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = distinct !{!27, !21}
!28 = !{!16, !13, i64 72}
!29 = distinct !{!29, !21}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass