; LLVM IR from davidesantangelo/krep :: test (test_multiple_patterns)

; 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.search_params = type { ptr, i64, ptr, ptr, i64, i8, i8, i8, i8, i8, i8, ptr, ptr, i64 }

@tests_failed = external global i32, align 4
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@tests_passed = external global i32, align 4
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@__const.test_aho_corasick_case_insensitive.patterns = external hidden unnamed_addr constant [4 x ptr], align 16
@__const.test_aho_corasick_case_insensitive.pattern_lens = external hidden unnamed_addr constant [4 x i64], align 16
@.str.14 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [60 x i8], align 1
@__const.test_aho_corasick_case_insensitive.patterns2 = external hidden unnamed_addr constant [4 x ptr], align 16
@.str.20 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [72 x i8], align 1

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare ptr @ac_trie_build(ptr noundef) #0

declare i64 @aho_corasick_search(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

declare void @ac_trie_free(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @test_aho_corasick_case_insensitive() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = alloca [4 x ptr], align 16
  %4 = alloca [4 x i64], align 16
  %5 = alloca i64, align 8
  %6 = alloca %struct.search_params, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca [4 x ptr], align 16
  %10 = alloca %struct.search_params, align 8
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store ptr @.str.13, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = call i64 @strlen(ptr noundef %12) #6
  store i64 %13, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.test_aho_corasick_case_insensitive.patterns, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.test_aho_corasick_case_insensitive.pattern_lens, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 4, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %6) #5
  %14 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 0
  store ptr null, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 1
  store i64 0, ptr %15, align 8, !tbaa !14
  %16 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 2
  %17 = getelementptr inbounds [4 x ptr], ptr %3, i64 0, i64 0
  store ptr %17, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 3
  %19 = getelementptr inbounds [4 x i64], ptr %4, i64 0, i64 0
  store ptr %19, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 4
  %21 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %21, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 5
  store i8 0, ptr %22, align 8, !tbaa !18
  %23 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 6
  store i8 0, ptr %23, align 1, !tbaa !19
  %24 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 7
  store i8 0, ptr %24, align 2, !tbaa !20
  %25 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 8
  store i8 1, ptr %25, align 1, !tbaa !21
  %26 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 9
  store i8 0, ptr %26, align 4, !tbaa !22
  %27 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 10
  store i8 0, ptr %27, align 1, !tbaa !23
  %28 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 11
  store ptr null, ptr %28, align 8, !tbaa !24
  %29 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  store ptr null, ptr %29, align 8, !tbaa !25
  %30 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 13
  store i64 -1, ptr %30, align 8, !tbaa !26
  %31 = call ptr @ac_trie_build(ptr noundef %6)
  %32 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  store ptr %31, ptr %32, align 8, !tbaa !25
  %33 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = icmp ne ptr %34, null
  br i1 %35, label %40, label %36

36:                                               ; preds = %0
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %38 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr @tests_failed, align 4, !tbaa !27
  store i32 1, ptr %7, align 4
  br label %107

40:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %41 = load ptr, ptr %1, align 8, !tbaa !5
  %42 = load i64, ptr %2, align 8, !tbaa !9
  %43 = call i64 @aho_corasick_search(ptr noundef %6, ptr noundef %41, i64 noundef %42, ptr noundef null)
  store i64 %43, ptr %8, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %40
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = icmp eq i64 %45, 3
  br i1 %46, label %47, label %51

47:                                               ; preds = %44
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.15)
  %49 = load i32, ptr @tests_passed, align 4, !tbaa !27
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @tests_passed, align 4, !tbaa !27
  br label %55

51:                                               ; preds = %44
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.15)
  %53 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @tests_failed, align 4, !tbaa !27
  br label %55

55:                                               ; preds = %51, %47
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  %59 = load ptr, ptr %58, align 8, !tbaa !25
  call void @ac_trie_free(ptr noundef %59)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.test_aho_corasick_case_insensitive.patterns2, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #5
  %60 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 0
  store ptr null, ptr %60, align 8, !tbaa !11
  %61 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 1
  store i64 0, ptr %61, align 8, !tbaa !14
  %62 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 2
  %63 = getelementptr inbounds [4 x ptr], ptr %9, i64 0, i64 0
  store ptr %63, ptr %62, align 8, !tbaa !15
  %64 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 3
  %65 = getelementptr inbounds [4 x i64], ptr %4, i64 0, i64 0
  store ptr %65, ptr %64, align 8, !tbaa !16
  %66 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 4
  %67 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %67, ptr %66, align 8, !tbaa !17
  %68 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 5
  store i8 0, ptr %68, align 8, !tbaa !18
  %69 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 6
  store i8 0, ptr %69, align 1, !tbaa !19
  %70 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 7
  store i8 0, ptr %70, align 2, !tbaa !20
  %71 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 8
  store i8 1, ptr %71, align 1, !tbaa !21
  %72 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 9
  store i8 0, ptr %72, align 4, !tbaa !22
  %73 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 10
  store i8 0, ptr %73, align 1, !tbaa !23
  %74 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 11
  store ptr null, ptr %74, align 8, !tbaa !24
  %75 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 12
  store ptr null, ptr %75, align 8, !tbaa !25
  %76 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 13
  store i64 -1, ptr %76, align 8, !tbaa !26
  %77 = call ptr @ac_trie_build(ptr noundef %10)
  %78 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 12
  store ptr %77, ptr %78, align 8, !tbaa !25
  %79 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 12
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = icmp ne ptr %80, null
  br i1 %81, label %86, label %82

82:                                               ; preds = %57
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  %84 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @tests_failed, align 4, !tbaa !27
  store i32 1, ptr %7, align 4
  br label %106

86:                                               ; preds = %57
  %87 = load ptr, ptr %1, align 8, !tbaa !5
  %88 = load i64, ptr %2, align 8, !tbaa !9
  %89 = call i64 @aho_corasick_search(ptr noundef %10, ptr noundef %87, i64 noundef %88, ptr noundef null)
  store i64 %89, ptr %8, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %86
  %91 = load i64, ptr %8, align 8, !tbaa !9
  %92 = icmp eq i64 %91, 3
  br i1 %92, label %93, label %97

93:                                               ; preds = %90
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.21)
  %95 = load i32, ptr @tests_passed, align 4, !tbaa !27
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr @tests_passed, align 4, !tbaa !27
  br label %101

97:                                               ; preds = %90
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.21)
  %99 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @tests_failed, align 4, !tbaa !27
  br label %101

101:                                              ; preds = %97, %93
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  %104 = getelementptr inbounds %struct.search_params, ptr %10, i32 0, i32 12
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  call void @ac_trie_free(ptr noundef %105)
  store i32 0, ptr %7, align 4
  br label %106

106:                                              ; preds = %103, %82
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %107

107:                                              ; preds = %106, %36
  call void @llvm.lifetime.end.p0(i64 72, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  %108 = load i32, ptr %7, align 4
  switch i32 %108, label %110 [
    i32 0, label %109
    i32 1, label %109
  ]

109:                                              ; preds = %107, %107
  ret void

110:                                              ; preds = %107
  unreachable
}

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"search_params", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !13, i64 41, !13, i64 42, !13, i64 43, !13, i64 44, !13, i64 45, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !6, i64 16}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !13, i64 40}
!19 = !{!12, !13, i64 41}
!20 = !{!12, !13, i64 42}
!21 = !{!12, !13, i64 43}
!22 = !{!12, !13, i64 44}
!23 = !{!12, !13, i64 45}
!24 = !{!12, !6, i64 48}
!25 = !{!12, !6, i64 56}
!26 = !{!12, !10, i64 64}
!27 = !{!28, !28, i64 0}
!28 = !{!"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"

%struct.search_params = type { ptr, i64, ptr, ptr, i64, i8, i8, i8, i8, i8, i8, ptr, ptr, i64 }

@tests_failed = external local_unnamed_addr global i32, align 4
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@tests_passed = external local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@__const.test_aho_corasick_case_insensitive.patterns = external hidden unnamed_addr constant [4 x ptr], align 16
@__const.test_aho_corasick_case_insensitive.pattern_lens = external hidden unnamed_addr constant [4 x i64], align 16
@.str.14 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [60 x i8], align 1
@__const.test_aho_corasick_case_insensitive.patterns2 = external hidden unnamed_addr constant [4 x ptr], align 16
@.str.20 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [72 x i8], align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare ptr @ac_trie_build(ptr noundef) local_unnamed_addr #4

declare i64 @aho_corasick_search(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare void @ac_trie_free(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local void @test_aho_corasick_case_insensitive() local_unnamed_addr #5 {
  %1 = alloca [4 x ptr], align 16
  %2 = alloca [4 x i64], align 16
  %3 = alloca %struct.search_params, align 8
  %4 = alloca [4 x ptr], align 16
  %5 = alloca %struct.search_params, align 8
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %7 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.13) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %1, ptr noundef nonnull align 16 dereferenceable(32) @__const.test_aho_corasick_case_insensitive.patterns, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %2, ptr noundef nonnull align 16 dereferenceable(32) @__const.test_aho_corasick_case_insensitive.pattern_lens, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #8
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store ptr %1, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %2, ptr %9, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %3, i64 32
  store i64 4, ptr %10, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %3, i64 40
  store <4 x i8> <i8 0, i8 0, i8 0, i8 1>, ptr %11, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %3, i64 44
  store i8 0, ptr %12, align 4, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %3, i64 45
  store i8 0, ptr %13, align 1, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %3, i64 48
  %15 = getelementptr inbounds i8, ptr %3, i64 56
  %16 = getelementptr inbounds i8, ptr %3, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %14, i8 0, i64 16, i1 false)
  store i64 -1, ptr %16, align 8, !tbaa !17
  %17 = call ptr @ac_trie_build(ptr noundef nonnull %3) #8
  store ptr %17, ptr %15, align 8, !tbaa !18
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %18, label %22

18:                                               ; preds = %0
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %20 = load i32, ptr @tests_failed, align 4, !tbaa !19
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @tests_failed, align 4, !tbaa !19
  br label %51

22:                                               ; preds = %0
  %23 = call i64 @aho_corasick_search(ptr noundef nonnull %3, ptr noundef nonnull @.str.13, i64 noundef %7, ptr noundef null) #8
  %24 = icmp eq i64 %23, 3
  %.str.7..str.9 = select i1 %24, ptr @.str.7, ptr @.str.9
  %tests_passed.tests_failed = select i1 %24, ptr @tests_passed, ptr @tests_failed
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7..str.9, ptr noundef nonnull @.str.15)
  %26 = load i32, ptr %tests_passed.tests_failed, align 4, !tbaa !19
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %tests_passed.tests_failed, align 4, !tbaa !19
  %28 = load ptr, ptr %15, align 8, !tbaa !18
  call void @ac_trie_free(ptr noundef %28) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull align 16 dereferenceable(32) @__const.test_aho_corasick_case_insensitive.patterns2, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #8
  %29 = getelementptr inbounds i8, ptr %5, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store ptr %4, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %2, ptr %30, align 8, !tbaa !12
  %31 = getelementptr inbounds i8, ptr %5, i64 32
  store i64 4, ptr %31, align 8, !tbaa !13
  %32 = getelementptr inbounds i8, ptr %5, i64 40
  store <4 x i8> <i8 0, i8 0, i8 0, i8 1>, ptr %32, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %5, i64 44
  store i8 0, ptr %33, align 4, !tbaa !15
  %34 = getelementptr inbounds i8, ptr %5, i64 45
  store i8 0, ptr %34, align 1, !tbaa !16
  %35 = getelementptr inbounds i8, ptr %5, i64 48
  %36 = getelementptr inbounds i8, ptr %5, i64 56
  %37 = getelementptr inbounds i8, ptr %5, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %35, i8 0, i64 16, i1 false)
  store i64 -1, ptr %37, align 8, !tbaa !17
  %38 = call ptr @ac_trie_build(ptr noundef nonnull %5) #8
  store ptr %38, ptr %36, align 8, !tbaa !18
  %.not8 = icmp eq ptr %38, null
  br i1 %.not8, label %39, label %43

39:                                               ; preds = %22
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %41 = load i32, ptr @tests_failed, align 4, !tbaa !19
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @tests_failed, align 4, !tbaa !19
  br label %50

43:                                               ; preds = %22
  %44 = call i64 @aho_corasick_search(ptr noundef nonnull %5, ptr noundef nonnull @.str.13, i64 noundef %7, ptr noundef null) #8
  %45 = icmp eq i64 %44, 3
  %.str.7..str.915 = select i1 %45, ptr @.str.7, ptr @.str.9
  %tests_passed.tests_failed16 = select i1 %45, ptr @tests_passed, ptr @tests_failed
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7..str.915, ptr noundef nonnull @.str.21)
  %47 = load i32, ptr %tests_passed.tests_failed16, align 4, !tbaa !19
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %tests_passed.tests_failed16, align 4, !tbaa !19
  %49 = load ptr, ptr %36, align 8, !tbaa !18
  call void @ac_trie_free(ptr noundef %49) #8
  br label %50

50:                                               ; preds = %43, %39
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  br label %51

51:                                               ; preds = %50, %18
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #8
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !7, i64 16}
!6 = !{!"search_params", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !11, i64 41, !11, i64 42, !11, i64 43, !11, i64 44, !11, i64 45, !7, i64 48, !7, i64 56, !10, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!6, !7, i64 24}
!13 = !{!6, !10, i64 32}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !11, i64 44}
!16 = !{!6, !11, i64 45}
!17 = !{!6, !10, i64 64}
!18 = !{!6, !7, i64 56}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !8, i64 0}


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