; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/tests/test_c.ll (Z11testfiltersbPN11alglib_impl8ae_stateE)

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

@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.542 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.543 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.544 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.545 = external hidden unnamed_addr constant [42 x i8], align 1

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

declare i32 @printf(ptr noundef, ...) #1

; 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 @_Z11testfiltersbPN11alglib_impl8ae_stateE(i1 noundef zeroext %0, ptr noundef %1) #2 {
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = zext i1 %0 to i8
  store i8 %10, ptr %3, align 1, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  %11 = load ptr, ptr %4, align 8, !tbaa !9
  %12 = call noundef zeroext i1 @_Z7testsmabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %11)
  %13 = zext i1 %12 to i8
  store i8 %13, ptr %6, align 1, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !9
  %15 = call noundef zeroext i1 @_Z7testemabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %14)
  %16 = zext i1 %15 to i8
  store i8 %16, ptr %7, align 1, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !9
  %18 = call noundef zeroext i1 @_Z8testlrmabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %17)
  %19 = zext i1 %18 to i8
  store i8 %19, ptr %8, align 1, !tbaa !5
  %20 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %21 = trunc i8 %20 to i1
  br i1 %21, label %28, label %22

22:                                               ; preds = %2
  %23 = load i8, ptr %7, align 1, !tbaa !5, !range !11, !noundef !12
  %24 = trunc i8 %23 to i1
  br i1 %24, label %28, label %25

25:                                               ; preds = %22
  %26 = load i8, ptr %8, align 1, !tbaa !5, !range !11, !noundef !12
  %27 = trunc i8 %26 to i1
  br label %28

28:                                               ; preds = %25, %22, %2
  %29 = phi i1 [ true, %22 ], [ true, %2 ], [ %27, %25 ]
  %30 = zext i1 %29 to i8
  store i8 %30, ptr %5, align 1, !tbaa !5
  %31 = load i8, ptr %3, align 1, !tbaa !5, !range !11, !noundef !12
  %32 = trunc i8 %31 to i1
  br i1 %32, label %67, label %33

33:                                               ; preds = %28
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.542)
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str.543)
  %36 = load i8, ptr %6, align 1, !tbaa !5, !range !11, !noundef !12
  %37 = trunc i8 %36 to i1
  br i1 %37, label %40, label %38

38:                                               ; preds = %33
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %42

40:                                               ; preds = %33
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %42

42:                                               ; preds = %40, %38
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str.544)
  %44 = load i8, ptr %7, align 1, !tbaa !5, !range !11, !noundef !12
  %45 = trunc i8 %44 to i1
  br i1 %45, label %48, label %46

46:                                               ; preds = %42
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %50

48:                                               ; preds = %42
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %50

50:                                               ; preds = %48, %46
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.545)
  %52 = load i8, ptr %8, align 1, !tbaa !5, !range !11, !noundef !12
  %53 = trunc i8 %52 to i1
  br i1 %53, label %56, label %54

54:                                               ; preds = %50
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %58

56:                                               ; preds = %50
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %58

58:                                               ; preds = %56, %54
  %59 = load i8, ptr %5, align 1, !tbaa !5, !range !11, !noundef !12
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  br label %65

63:                                               ; preds = %58
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  br label %65

65:                                               ; preds = %63, %61
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %67

67:                                               ; preds = %65, %28
  %68 = load i8, ptr %5, align 1, !tbaa !5, !range !11, !noundef !12
  %69 = trunc i8 %68 to i1
  %70 = xor i1 %69, true
  %71 = zext i1 %70 to i8
  store i8 %71, ptr %9, align 1, !tbaa !5
  %72 = load i8, ptr %9, align 1, !tbaa !5, !range !11, !noundef !12
  %73 = trunc i8 %72 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  ret i1 %73
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z7testsmabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z7testemabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z8testlrmabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


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

@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.542 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.543 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.544 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.545 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z11testfiltersbPN11alglib_impl8ae_stateE(i1 noundef zeroext %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = tail call noundef zeroext i1 @_Z7testsmabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %1)
  %4 = tail call noundef zeroext i1 @_Z7testemabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %1)
  %5 = tail call noundef zeroext i1 @_Z8testlrmabPN11alglib_impl8ae_stateE(i1 noundef zeroext true, ptr noundef %1)
  %spec.select = or i1 %4, %5
  %spec.select12 = or i1 %3, %spec.select
  br i1 %0, label %16, label %6

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.542)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.543)
  %.str.7..str.6 = select i1 %3, ptr @.str.7, ptr @.str.6
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7..str.6)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.544)
  %.str.7.sink13 = select i1 %4, ptr @.str.7, ptr @.str.6
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7.sink13)
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.545)
  %.str.7.sink14 = select i1 %5, ptr @.str.7, ptr @.str.6
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7.sink14)
  %.str.21.sink = select i1 %spec.select12, ptr @.str.20, ptr @.str.21
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.21.sink)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %16

16:                                               ; preds = %6, %2
  %17 = xor i1 %spec.select12, true
  ret i1 %17
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z7testsmabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z7testemabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z8testlrmabPN11alglib_impl8ae_stateE(i1 noundef zeroext, ptr noundef) local_unnamed_addr #1

attributes #0 = { nofree nounwind "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 #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" }

!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)"}


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