; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/Common (Wildcard)

; 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.NWildcard::CCensorNode" = type { ptr, %class.UString, %class.CObjectVector.0, %class.CObjectVector.1, %class.CObjectVector.1 }
%class.UString = type { ptr, i32, i32 }
%class.CObjectVector.0 = type { %class.CRecordVector }
%class.CRecordVector = type { ptr, i32, i32 }
%class.CObjectVector.1 = type { %class.CRecordVector }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK9NWildcard11CCensorNode15CheckPathToRootEbR13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext %3) #0 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  %10 = zext i1 %1 to i8
  store i8 %10, ptr %7, align 1, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  %11 = zext i1 %3 to i8
  store i8 %11, ptr %9, align 1, !tbaa !9
  %12 = load ptr, ptr %6, align 8
  %13 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %14 = trunc i8 %13 to i1
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %17 = trunc i8 %16 to i1
  %18 = call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %12, i1 noundef zeroext %14, ptr noundef nonnull align 8 dereferenceable(16) %15, i1 noundef zeroext %17)
  br i1 %18, label %19, label %20

19:                                               ; preds = %4
  store i1 true, ptr %5, align 1
  br label %36

20:                                               ; preds = %4
  %21 = getelementptr inbounds %"class.NWildcard::CCensorNode", ptr %12, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  store i1 false, ptr %5, align 1
  br label %36

25:                                               ; preds = %20
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.NWildcard::CCensorNode", ptr %12, i32 0, i32 1
  call void @_ZN13CObjectVectorI7UStringE6InsertEjRKS0_(ptr noundef nonnull align 8 dereferenceable(16) %26, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(16) %27)
  %28 = getelementptr inbounds %"class.NWildcard::CCensorNode", ptr %12, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load i8, ptr %9, align 1, !tbaa !9, !range !11, !noundef !12
  %34 = trunc i8 %33 to i1
  %35 = call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode15CheckPathToRootEbR13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %29, i1 noundef zeroext %31, ptr noundef nonnull align 8 dereferenceable(16) %32, i1 noundef zeroext %34)
  store i1 %35, ptr %5, align 1
  br label %36

36:                                               ; preds = %25, %24, %19
  %37 = load i1, ptr %5, align 1
  ret i1 %37
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13CObjectVectorI7UStringE6InsertEjRKS0_(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) #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" }

!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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN9NWildcard11CCensorNodeE", !6, i64 0, !15, i64 8, !17, i64 24, !19, i64 40, !19, i64 56}
!15 = !{!"_ZTS7UString", !6, i64 0, !16, i64 8, !16, i64 12}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS13CObjectVectorIN9NWildcard11CCensorNodeEE", !18, i64 0}
!18 = !{!"_ZTS13CRecordVectorIPvE", !6, i64 0, !16, i64 8, !16, i64 12}
!19 = !{!"_ZTS13CObjectVectorIN9NWildcard5CItemEE", !18, i64 0}


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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK9NWildcard11CCensorNode15CheckPathToRootEbR13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext %3)
  br i1 %5, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4, %tailrecurse
  %.tr11 = phi ptr [ %8, %tailrecurse ], [ %0, %4 ]
  %6 = load ptr, ptr %.tr11, align 8, !tbaa !5
  %.not = icmp ne ptr %6, null
  br i1 %.not, label %tailrecurse, label %._crit_edge

tailrecurse:                                      ; preds = %.lr.ph
  %7 = getelementptr inbounds i8, ptr %.tr11, i64 8
  tail call void @_ZN13CObjectVectorI7UStringE6InsertEjRKS0_(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %8 = load ptr, ptr %.tr11, align 8, !tbaa !5
  %9 = tail call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %8, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(16) %2, i1 noundef zeroext %3)
  br i1 %9, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %tailrecurse, %.lr.ph, %4
  %.0 = phi i1 [ true, %4 ], [ %.not, %.lr.ph ], [ %.not, %tailrecurse ]
  ret i1 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13CObjectVectorI7UStringE6InsertEjRKS0_(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef nonnull align 8 dereferenceable(16)) 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" }

!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, !7, i64 0}
!6 = !{!"_ZTSN9NWildcard11CCensorNodeE", !7, i64 0, !10, i64 8, !12, i64 24, !14, i64 40, !14, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS7UString", !7, i64 0, !11, i64 8, !11, i64 12}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTS13CObjectVectorIN9NWildcard11CCensorNodeEE", !13, i64 0}
!13 = !{!"_ZTS13CRecordVectorIPvE", !7, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!"_ZTS13CObjectVectorIN9NWildcard5CItemEE", !13, i64 0}


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