; LLVM IR from pictools/pica :: test/gtest/fused-src/gtest (gtest-all)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef %0, ptr noundef %1) #0 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = load i8, ptr %6, align 1, !tbaa !9
  %8 = sext i8 %7 to i32
  switch i32 %8, label %44 [
    i32 0, label %9
    i32 58, label %9
    i32 63, label %14
    i32 42, label %27
  ]

9:                                                ; preds = %2, %2
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = load i8, ptr %10, align 1, !tbaa !9
  %12 = sext i8 %11 to i32
  %13 = icmp eq i32 %12, 0
  store i1 %13, ptr %3, align 1
  br label %60

14:                                               ; preds = %2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load i8, ptr %15, align 1, !tbaa !9
  %17 = sext i8 %16 to i32
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %25

19:                                               ; preds = %14
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 1
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %24 = call noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef %21, ptr noundef %23)
  br label %25

25:                                               ; preds = %19, %14
  %26 = phi i1 [ false, %14 ], [ %24, %19 ]
  store i1 %26, ptr %3, align 1
  br label %60

27:                                               ; preds = %2
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %27
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  %36 = call noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef %33, ptr noundef %35)
  br i1 %36, label %42, label %37

37:                                               ; preds = %32, %27
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 1
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef %39, ptr noundef %40)
  br label %42

42:                                               ; preds = %37, %32
  %43 = phi i1 [ true, %32 ], [ %41, %37 ]
  store i1 %43, ptr %3, align 1
  br label %60

44:                                               ; preds = %2
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = sext i8 %46 to i32
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %47, %50
  br i1 %51, label %52, label %58

52:                                               ; preds = %44
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 1
  %57 = call noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef %54, ptr noundef %56)
  br label %58

58:                                               ; preds = %52, %44
  %59 = phi i1 [ false, %44 ], [ %57, %52 ]
  store i1 %59, ptr %3, align 1
  br label %60

60:                                               ; preds = %58, %42, %25, %9
  %61 = load i1, ptr %3, align 1
  ret i1 %61
}

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 = !{!7, !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"

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 align 2 {
  br label %tailrecurse.outer

tailrecurse.outer:                                ; preds = %tailrecurse.outer.backedge, %2
  %.tr.ph = phi ptr [ %0, %2 ], [ %.tr.ph.be, %tailrecurse.outer.backedge ]
  %.tr16.ph = phi ptr [ %1, %2 ], [ %3, %tailrecurse.outer.backedge ]
  %3 = getelementptr inbounds i8, ptr %.tr16.ph, i64 1
  br label %tailrecurse

tailrecurse:                                      ; preds = %tailrecurse.outer, %14
  %.tr = phi ptr [ %15, %14 ], [ %.tr.ph, %tailrecurse.outer ]
  %4 = load i8, ptr %.tr, align 1, !tbaa !5
  switch i8 %4, label %16 [
    i8 0, label %5
    i8 58, label %5
    i8 63, label %8
    i8 42, label %10
  ]

5:                                                ; preds = %tailrecurse, %tailrecurse
  %6 = load i8, ptr %.tr16.ph, align 1, !tbaa !5
  %7 = icmp eq i8 %6, 0
  br label %.loopexit

8:                                                ; preds = %tailrecurse
  %9 = load i8, ptr %.tr16.ph, align 1, !tbaa !5
  %.not15 = icmp eq i8 %9, 0
  br i1 %.not15, label %.loopexit, label %tailrecurse.outer.backedge

tailrecurse.outer.backedge:                       ; preds = %16, %8
  %.tr.ph.be = getelementptr inbounds i8, ptr %.tr, i64 1
  br label %tailrecurse.outer

10:                                               ; preds = %tailrecurse
  %11 = load i8, ptr %.tr16.ph, align 1, !tbaa !5
  %.not = icmp eq i8 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call noundef zeroext i1 @_ZN7testing8internal15UnitTestOptions20PatternMatchesStringEPKcS3_(ptr noundef nonnull %.tr, ptr noundef nonnull %3)
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %12, %10
  %15 = getelementptr inbounds i8, ptr %.tr, i64 1
  br label %tailrecurse

16:                                               ; preds = %tailrecurse
  %17 = load i8, ptr %.tr16.ph, align 1, !tbaa !5
  %18 = icmp eq i8 %4, %17
  br i1 %18, label %tailrecurse.outer.backedge, label %.loopexit

.loopexit:                                        ; preds = %16, %8, %12, %5
  %.0 = phi i1 [ %7, %5 ], [ true, %12 ], [ false, %8 ], [ false, %16 ]
  ret i1 %.0
}

attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass