; 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.22 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.test_aho_corasick_edge_cases.patterns = external hidden unnamed_addr constant [6 x ptr], align 16
@.str.29 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [53 x i8], align 1
@__const.test_aho_corasick_edge_cases.patterns_long = external hidden unnamed_addr constant [2 x ptr], align 16
@__const.test_aho_corasick_edge_cases.pattern_lens_long = external hidden unnamed_addr constant [2 x i64], align 16
@.str.36 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [64 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_edge_cases() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = alloca [6 x ptr], align 16
  %4 = alloca [6 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 %struct.search_params, align 8
  %10 = alloca [2 x ptr], align 16
  %11 = alloca [2 x i64], align 16
  %12 = alloca %struct.search_params, align 8
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  store ptr @.str.23, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = call i64 @strlen(ptr noundef %14) #7
  store i64 %15, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.test_aho_corasick_edge_cases.patterns, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 48, i1 false)
  %16 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 0
  store i64 1, ptr %16, align 16
  %17 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 1
  store i64 1, ptr %17, align 8
  %18 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 2
  store i64 1, ptr %18, align 16
  %19 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 3
  store i64 2, ptr %19, align 8
  %20 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 4
  store i64 2, ptr %20, align 16
  %21 = getelementptr inbounds [6 x i64], ptr %4, i32 0, i32 5
  store i64 3, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 6, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %6) #6
  %22 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 0
  store ptr null, ptr %22, align 8, !tbaa !11
  %23 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 1
  store i64 0, ptr %23, align 8, !tbaa !14
  %24 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 2
  %25 = getelementptr inbounds [6 x ptr], ptr %3, i64 0, i64 0
  store ptr %25, ptr %24, align 8, !tbaa !15
  %26 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 3
  %27 = getelementptr inbounds [6 x i64], ptr %4, i64 0, i64 0
  store ptr %27, ptr %26, align 8, !tbaa !16
  %28 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 4
  %29 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %29, ptr %28, align 8, !tbaa !17
  %30 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 5
  store i8 1, ptr %30, align 8, !tbaa !18
  %31 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 6
  store i8 0, ptr %31, align 1, !tbaa !19
  %32 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 7
  store i8 0, ptr %32, align 2, !tbaa !20
  %33 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 8
  store i8 1, ptr %33, align 1, !tbaa !21
  %34 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 9
  store i8 0, ptr %34, align 4, !tbaa !22
  %35 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 10
  store i8 0, ptr %35, align 1, !tbaa !23
  %36 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 11
  store ptr null, ptr %36, align 8, !tbaa !24
  %37 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  store ptr null, ptr %37, align 8, !tbaa !25
  %38 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 13
  store i64 -1, ptr %38, align 8, !tbaa !26
  %39 = call ptr @ac_trie_build(ptr noundef %6)
  %40 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  store ptr %39, ptr %40, align 8, !tbaa !25
  %41 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  %42 = load ptr, ptr %41, align 8, !tbaa !25
  %43 = icmp ne ptr %42, null
  br i1 %43, label %48, label %44

44:                                               ; preds = %0
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  %46 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @tests_failed, align 4, !tbaa !27
  store i32 1, ptr %7, align 4
  br label %153

48:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %49 = load ptr, ptr %1, align 8, !tbaa !5
  %50 = load i64, ptr %2, align 8, !tbaa !9
  %51 = call i64 @aho_corasick_search(ptr noundef %6, ptr noundef %49, i64 noundef %50, ptr noundef null)
  store i64 %51, ptr %8, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %8, align 8, !tbaa !9
  %54 = icmp eq i64 %53, 6
  br i1 %54, label %55, label %59

55:                                               ; preds = %52
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.30)
  %57 = load i32, ptr @tests_passed, align 4, !tbaa !27
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @tests_passed, align 4, !tbaa !27
  br label %63

59:                                               ; preds = %52
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.30)
  %61 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr @tests_failed, align 4, !tbaa !27
  br label %63

63:                                               ; preds = %59, %55
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = call i64 @aho_corasick_search(ptr noundef %6, ptr noundef @.str.31, i64 noundef 0, ptr noundef null)
  store i64 %66, ptr %8, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %65
  %68 = load i64, ptr %8, align 8, !tbaa !9
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %70, label %74

70:                                               ; preds = %67
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.32)
  %72 = load i32, ptr @tests_passed, align 4, !tbaa !27
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @tests_passed, align 4, !tbaa !27
  br label %78

74:                                               ; preds = %67
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.32)
  %76 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr @tests_failed, align 4, !tbaa !27
  br label %78

78:                                               ; preds = %74, %70
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = getelementptr inbounds %struct.search_params, ptr %6, i32 0, i32 12
  %82 = load ptr, ptr %81, align 8, !tbaa !25
  call void @ac_trie_free(ptr noundef %82)
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 72, i1 false)
  %83 = getelementptr inbounds %struct.search_params, ptr %9, i32 0, i32 5
  store i8 1, ptr %83, align 8
  %84 = getelementptr inbounds %struct.search_params, ptr %9, i32 0, i32 8
  store i8 1, ptr %84, align 1
  %85 = getelementptr inbounds %struct.search_params, ptr %9, i32 0, i32 13
  store i64 -1, ptr %85, align 8
  %86 = call ptr @ac_trie_build(ptr noundef %9)
  %87 = getelementptr inbounds %struct.search_params, ptr %9, i32 0, i32 12
  store ptr %86, ptr %87, align 8, !tbaa !25
  %88 = load ptr, ptr %1, align 8, !tbaa !5
  %89 = load i64, ptr %2, align 8, !tbaa !9
  %90 = call i64 @aho_corasick_search(ptr noundef %9, ptr noundef %88, i64 noundef %89, ptr noundef null)
  store i64 %90, ptr %8, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %80
  %92 = load i64, ptr %8, align 8, !tbaa !9
  %93 = icmp eq i64 %92, 0
  br i1 %93, label %94, label %98

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

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

102:                                              ; preds = %98, %94
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = getelementptr inbounds %struct.search_params, ptr %9, i32 0, i32 12
  %106 = load ptr, ptr %105, align 8, !tbaa !25
  call void @ac_trie_free(ptr noundef %106)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 @__const.test_aho_corasick_edge_cases.patterns_long, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 @__const.test_aho_corasick_edge_cases.pattern_lens_long, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %12) #6
  %107 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 0
  store ptr null, ptr %107, align 8, !tbaa !11
  %108 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 1
  store i64 0, ptr %108, align 8, !tbaa !14
  %109 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 2
  %110 = getelementptr inbounds [2 x ptr], ptr %10, i64 0, i64 0
  store ptr %110, ptr %109, align 8, !tbaa !15
  %111 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 3
  %112 = getelementptr inbounds [2 x i64], ptr %11, i64 0, i64 0
  store ptr %112, ptr %111, align 8, !tbaa !16
  %113 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 4
  store i64 2, ptr %113, align 8, !tbaa !17
  %114 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 5
  store i8 1, ptr %114, align 8, !tbaa !18
  %115 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 6
  store i8 0, ptr %115, align 1, !tbaa !19
  %116 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 7
  store i8 0, ptr %116, align 2, !tbaa !20
  %117 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 8
  store i8 1, ptr %117, align 1, !tbaa !21
  %118 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 9
  store i8 0, ptr %118, align 4, !tbaa !22
  %119 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 10
  store i8 0, ptr %119, align 1, !tbaa !23
  %120 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 11
  store ptr null, ptr %120, align 8, !tbaa !24
  %121 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 12
  store ptr null, ptr %121, align 8, !tbaa !25
  %122 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 13
  store i64 -1, ptr %122, align 8, !tbaa !26
  %123 = call ptr @ac_trie_build(ptr noundef %12)
  %124 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 12
  store ptr %123, ptr %124, align 8, !tbaa !25
  %125 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 12
  %126 = load ptr, ptr %125, align 8, !tbaa !25
  %127 = icmp ne ptr %126, null
  br i1 %127, label %132, label %128

128:                                              ; preds = %104
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.36)
  %130 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr @tests_failed, align 4, !tbaa !27
  store i32 1, ptr %7, align 4
  br label %152

132:                                              ; preds = %104
  %133 = load ptr, ptr %1, align 8, !tbaa !5
  %134 = load i64, ptr %2, align 8, !tbaa !9
  %135 = call i64 @aho_corasick_search(ptr noundef %12, ptr noundef %133, i64 noundef %134, ptr noundef null)
  store i64 %135, ptr %8, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %132
  %137 = load i64, ptr %8, align 8, !tbaa !9
  %138 = icmp eq i64 %137, 0
  br i1 %138, label %139, label %143

139:                                              ; preds = %136
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.37)
  %141 = load i32, ptr @tests_passed, align 4, !tbaa !27
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @tests_passed, align 4, !tbaa !27
  br label %147

143:                                              ; preds = %136
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @.str.37)
  %145 = load i32, ptr @tests_failed, align 4, !tbaa !27
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr @tests_failed, align 4, !tbaa !27
  br label %147

147:                                              ; preds = %143, %139
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = getelementptr inbounds %struct.search_params, ptr %12, i32 0, i32 12
  %151 = load ptr, ptr %150, align 8, !tbaa !25
  call void @ac_trie_free(ptr noundef %151)
  store i32 0, ptr %7, align 4
  br label %152

152:                                              ; preds = %149, %128
  call void @llvm.lifetime.end.p0(i64 72, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %153

153:                                              ; preds = %152, %44
  call void @llvm.lifetime.end.p0(i64 72, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  %154 = load i32, ptr %7, align 4
  switch i32 %154, label %156 [
    i32 0, label %155
    i32 1, label %155
  ]

155:                                              ; preds = %153, %153
  ret void

156:                                              ; preds = %153
  unreachable
}

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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.22 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@__const.test_aho_corasick_edge_cases.patterns = external hidden unnamed_addr constant [6 x ptr], align 16
@.str.29 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [53 x i8], align 1
@__const.test_aho_corasick_edge_cases.patterns_long = external hidden unnamed_addr constant [2 x ptr], align 16
@__const.test_aho_corasick_edge_cases.pattern_lens_long = external hidden unnamed_addr constant [2 x i64], align 16
@.str.36 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [64 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_edge_cases() local_unnamed_addr #5 {
  %1 = alloca [6 x ptr], align 16
  %2 = alloca [6 x i64], align 16
  %3 = alloca %struct.search_params, align 8
  %4 = alloca %struct.search_params, align 8
  %5 = alloca [2 x ptr], align 16
  %6 = alloca [2 x i64], align 16
  %7 = alloca %struct.search_params, align 8
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %9 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.23) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %1, ptr noundef nonnull align 16 dereferenceable(48) @__const.test_aho_corasick_edge_cases.patterns, i64 48, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #8
  store i64 1, ptr %2, align 16
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 1, ptr %10, align 8
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  store i64 1, ptr %11, align 16
  %12 = getelementptr inbounds i8, ptr %2, i64 24
  store i64 2, ptr %12, align 8
  %13 = getelementptr inbounds i8, ptr %2, i64 32
  store i64 2, ptr %13, align 16
  %14 = getelementptr inbounds i8, ptr %2, i64 40
  store i64 3, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #8
  %15 = 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 %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %2, ptr %16, align 8, !tbaa !12
  %17 = getelementptr inbounds i8, ptr %3, i64 32
  store i64 6, ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %3, i64 40
  store <4 x i8> <i8 1, i8 0, i8 0, i8 1>, ptr %18, align 8, !tbaa !14
  %19 = getelementptr inbounds i8, ptr %3, i64 44
  store i8 0, ptr %19, align 4, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %3, i64 45
  store i8 0, ptr %20, align 1, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %3, i64 48
  %22 = getelementptr inbounds i8, ptr %3, i64 56
  %23 = getelementptr inbounds i8, ptr %3, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %21, i8 0, i64 16, i1 false)
  store i64 -1, ptr %23, align 8, !tbaa !17
  %24 = call ptr @ac_trie_build(ptr noundef nonnull %3) #8
  store ptr %24, ptr %22, align 8, !tbaa !18
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %25, label %29

25:                                               ; preds = %0
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  %27 = load i32, ptr @tests_failed, align 4, !tbaa !19
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tests_failed, align 4, !tbaa !19
  br label %74

29:                                               ; preds = %0
  %30 = call i64 @aho_corasick_search(ptr noundef nonnull %3, ptr noundef nonnull @.str.23, i64 noundef %9, ptr noundef null) #8
  %31 = icmp eq i64 %30, 6
  %.str.7..str.9 = select i1 %31, ptr @.str.7, ptr @.str.9
  %tests_passed.tests_failed = select i1 %31, ptr @tests_passed, ptr @tests_failed
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7..str.9, ptr noundef nonnull @.str.30)
  %33 = load i32, ptr %tests_passed.tests_failed, align 4, !tbaa !19
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %tests_passed.tests_failed, align 4, !tbaa !19
  %35 = call i64 @aho_corasick_search(ptr noundef nonnull %3, ptr noundef nonnull @.str.31, i64 noundef 0, ptr noundef null) #8
  %36 = icmp eq i64 %35, 0
  %.str.9.sink17 = select i1 %36, ptr @.str.7, ptr @.str.9
  %tests_failed.sink16 = select i1 %36, ptr @tests_passed, ptr @tests_failed
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.9.sink17, ptr noundef nonnull @.str.32)
  %38 = load i32, ptr %tests_failed.sink16, align 4, !tbaa !19
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %tests_failed.sink16, align 4, !tbaa !19
  %40 = load ptr, ptr %22, align 8, !tbaa !18
  call void @ac_trie_free(ptr noundef %40) #8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %4, i8 0, i64 64, i1 false)
  %41 = getelementptr inbounds i8, ptr %4, i64 40
  store i8 1, ptr %41, align 8
  %42 = getelementptr inbounds i8, ptr %4, i64 43
  store i8 1, ptr %42, align 1
  %43 = getelementptr inbounds i8, ptr %4, i64 64
  store i64 -1, ptr %43, align 8
  %44 = call ptr @ac_trie_build(ptr noundef nonnull %4) #8
  %45 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %44, ptr %45, align 8, !tbaa !18
  %46 = call i64 @aho_corasick_search(ptr noundef nonnull %4, ptr noundef nonnull @.str.23, i64 noundef %9, ptr noundef null) #8
  %47 = icmp eq i64 %46, 0
  %.str.9.sink21 = select i1 %47, ptr @.str.7, ptr @.str.9
  %tests_failed.sink20 = select i1 %47, ptr @tests_passed, ptr @tests_failed
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.9.sink21, ptr noundef nonnull @.str.33)
  %49 = load i32, ptr %tests_failed.sink20, align 4, !tbaa !19
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %tests_failed.sink20, align 4, !tbaa !19
  %51 = load ptr, ptr %45, align 8, !tbaa !18
  call void @ac_trie_free(ptr noundef %51) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) @__const.test_aho_corasick_edge_cases.patterns_long, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) @__const.test_aho_corasick_edge_cases.pattern_lens_long, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #8
  %52 = getelementptr inbounds i8, ptr %7, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  store ptr %5, ptr %52, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %6, ptr %53, align 8, !tbaa !12
  %54 = getelementptr inbounds i8, ptr %7, i64 32
  store i64 2, ptr %54, align 8, !tbaa !13
  %55 = getelementptr inbounds i8, ptr %7, i64 40
  store <4 x i8> <i8 1, i8 0, i8 0, i8 1>, ptr %55, align 8, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %7, i64 44
  store i8 0, ptr %56, align 4, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %7, i64 45
  store i8 0, ptr %57, align 1, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %7, i64 48
  %59 = getelementptr inbounds i8, ptr %7, i64 56
  %60 = getelementptr inbounds i8, ptr %7, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %58, i8 0, i64 16, i1 false)
  store i64 -1, ptr %60, align 8, !tbaa !17
  %61 = call ptr @ac_trie_build(ptr noundef nonnull %7) #8
  store ptr %61, ptr %59, align 8, !tbaa !18
  %.not11 = icmp eq ptr %61, null
  br i1 %.not11, label %62, label %66

62:                                               ; preds = %29
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36)
  %64 = load i32, ptr @tests_failed, align 4, !tbaa !19
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @tests_failed, align 4, !tbaa !19
  br label %73

66:                                               ; preds = %29
  %67 = call i64 @aho_corasick_search(ptr noundef nonnull %7, ptr noundef nonnull @.str.23, i64 noundef %9, ptr noundef null) #8
  %68 = icmp eq i64 %67, 0
  %.str.7..str.926 = select i1 %68, ptr @.str.7, ptr @.str.9
  %tests_passed.tests_failed27 = select i1 %68, ptr @tests_passed, ptr @tests_failed
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.7..str.926, ptr noundef nonnull @.str.37)
  %70 = load i32, ptr %tests_passed.tests_failed27, align 4, !tbaa !19
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %tests_passed.tests_failed27, align 4, !tbaa !19
  %72 = load ptr, ptr %59, align 8, !tbaa !18
  call void @ac_trie_free(ptr noundef %72) #8
  br label %73

73:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #8
  br label %74

74:                                               ; preds = %73, %25
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret void
}

; Function Attrs: mustprogress 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 = { mustprogress 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: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass