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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9NWildcard11CCensorNode11FindSubNodeERK7UString(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

; 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) #2 align 2

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

22:                                               ; preds = %4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 0, ptr %23, align 1, !tbaa !9
  store i1 true, ptr %5, align 1
  br label %69

24:                                               ; preds = %4
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  store i8 1, ptr %25, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %28 = trunc i8 %27 to i1
  %29 = call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %17, i1 noundef zeroext true, ptr noundef nonnull align 8 dereferenceable(16) %26, i1 noundef zeroext %28)
  %30 = zext i1 %29 to i8
  store i8 %30, ptr %10, align 1, !tbaa !9
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noundef i32 @_ZNK13CObjectVectorI7UStringE4SizeEv(ptr noundef nonnull align 8 dereferenceable(16) %31)
  %33 = icmp ule i32 %32, 1
  br i1 %33, label %34, label %37

34:                                               ; preds = %24
  %35 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %36 = trunc i8 %35 to i1
  store i1 %36, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %68

37:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK13CObjectVectorI7UStringE5FrontEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  %40 = call noundef i32 @_ZNK9NWildcard11CCensorNode11FindSubNodeERK7UString(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr noundef nonnull align 8 dereferenceable(16) %39)
  store i32 %40, ptr %12, align 4, !tbaa !13
  %41 = load i32, ptr %12, align 4, !tbaa !13
  %42 = icmp sge i32 %41, 0
  br i1 %42, label %43, label %64

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #3
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN13CObjectVectorI7UStringEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %44)
  invoke void @_ZN13CObjectVectorI7UStringE6DeleteEj(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %45 unwind label %56

45:                                               ; preds = %43
  %46 = getelementptr inbounds %"class.NWildcard::CCensorNode", ptr %17, i32 0, i32 2
  %47 = load i32, ptr %12, align 4, !tbaa !13
  %48 = invoke noundef nonnull align 8 dereferenceable(72) ptr @_ZNK13CObjectVectorIN9NWildcard11CCensorNodeEEixEj(ptr noundef nonnull align 8 dereferenceable(16) %46, i32 noundef %47)
          to label %49 unwind label %56

49:                                               ; preds = %45
  %50 = load i8, ptr %8, align 1, !tbaa !9, !range !11, !noundef !12
  %51 = trunc i8 %50 to i1
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = invoke noundef zeroext i1 @_ZNK9NWildcard11CCensorNode13CheckPathVectERK13CObjectVectorI7UStringEbRb(ptr noundef nonnull align 8 dereferenceable(72) %48, ptr noundef nonnull align 8 dereferenceable(16) %13, i1 noundef zeroext %51, ptr noundef nonnull align 1 dereferenceable(1) %52)
          to label %54 unwind label %56

54:                                               ; preds = %49
  br i1 %53, label %55, label %60

55:                                               ; preds = %54
  store i1 true, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %61

56:                                               ; preds = %49, %45, %43
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %14, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %15, align 4
  call void @_ZN13CObjectVectorI7UStringED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  br label %71

60:                                               ; preds = %54
  store i32 0, ptr %11, align 4
  br label %61

61:                                               ; preds = %60, %55
  call void @_ZN13CObjectVectorI7UStringED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  %62 = load i32, ptr %11, align 4
  switch i32 %62, label %67 [
    i32 0, label %63
  ]

63:                                               ; preds = %61
  br label %64

64:                                               ; preds = %63, %37
  %65 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %66 = trunc i8 %65 to i1
  store i1 %66, ptr %5, align 1
  store i32 1, ptr %11, align 4
  br label %67

67:                                               ; preds = %64, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %68

68:                                               ; preds = %67, %34
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  br label %69

69:                                               ; preds = %68, %22
  %70 = load i1, ptr %5, align 1
  ret i1 %70

71:                                               ; preds = %56
  %72 = load ptr, ptr %14, align 8
  %73 = load i32, ptr %15, align 4
  %74 = insertvalue { ptr, i32 } poison, ptr %72, 0
  %75 = insertvalue { ptr, i32 } %74, i32 %73, 1
  resume { ptr, i32 } %75
}

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

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

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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, 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"

%class.CObjectVector = type { %class.CRecordVector }
%class.CRecordVector = type { ptr, i32, i32 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9NWildcard11CCensorNode11FindSubNodeERK7UString(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(72) ptr @_ZNK13CObjectVectorIN9NWildcard11CCensorNodeEEixEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13CObjectVectorI7UStringE6DeleteEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #2 align 2

; 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 #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK9NWildcard11CCensorNode13CheckPathVectERK13CObjectVectorI7UStringEbRb(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.CObjectVector, align 8
  %6 = tail call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext false, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2)
  br i1 %6, label %7, label %8

7:                                                ; preds = %4
  store i8 0, ptr %3, align 1, !tbaa !5
  br label %25

8:                                                ; preds = %4
  store i8 1, ptr %3, align 1, !tbaa !5
  %9 = tail call noundef zeroext i1 @_ZNK9NWildcard11CCensorNode16CheckPathCurrentEbRK13CObjectVectorI7UStringEb(ptr noundef nonnull align 8 dereferenceable(72) %0, i1 noundef zeroext true, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2)
  %10 = tail call noundef i32 @_ZNK13CObjectVectorI7UStringE4SizeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %11 = icmp ult i32 %10, 2
  br i1 %11, label %25, label %12

12:                                               ; preds = %8
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK13CObjectVectorI7UStringE5FrontEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %14 = tail call noundef i32 @_ZNK9NWildcard11CCensorNode11FindSubNodeERK7UString(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %15 = icmp sgt i32 %14, -1
  br i1 %15, label %16, label %24

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  call void @_ZN13CObjectVectorI7UStringEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %1)
  invoke void @_ZN13CObjectVectorI7UStringE6DeleteEj(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
          to label %17 unwind label %21

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZNK13CObjectVectorIN9NWildcard11CCensorNodeEEixEj(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %14)
  %20 = invoke noundef zeroext i1 @_ZNK9NWildcard11CCensorNode13CheckPathVectERK13CObjectVectorI7UStringEbRb(ptr noundef nonnull align 8 dereferenceable(72) %19, ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext %2, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %23 unwind label %21

21:                                               ; preds = %17, %16
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN13CObjectVectorI7UStringED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  resume { ptr, i32 } %22

23:                                               ; preds = %17
  call void @_ZN13CObjectVectorI7UStringED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br i1 %20, label %25, label %24

24:                                               ; preds = %23, %12
  br label %25

25:                                               ; preds = %8, %23, %24, %7
  %.3 = phi i1 [ true, %7 ], [ %9, %8 ], [ %9, %24 ], [ true, %23 ]
  ret i1 %.3
}

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

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

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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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