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

; 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 }
%struct.match_result_t = type { ptr, i64, i64 }

@tests_passed = external global i32, align 4
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@tests_failed = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [47 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 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_regex_report_limit() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.search_params, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.54)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  store ptr @.str.55, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = call i64 @strlen(ptr noundef %12) #5
  store i64 %13, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %4) #4
  call void @create_regex_params(ptr dead_on_unwind writable sret(%struct.search_params) align 8 %4, ptr noundef @.str.23, i1 noundef zeroext true, i1 noundef zeroext false, i1 noundef zeroext false)
  %14 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 -1, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  %16 = load i64, ptr %2, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = call i64 @regex_search(ptr noundef %4, ptr noundef %15, i64 noundef %16, ptr noundef %17)
  store i64 %18, ptr %5, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %0
  %20 = load i64, ptr %5, align 8, !tbaa !9
  %21 = icmp eq i64 %20, 4
  br i1 %21, label %22, label %26

22:                                               ; preds = %19
  %23 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr @tests_passed, align 4, !tbaa !14
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.56)
  br label %31

26:                                               ; preds = %19
  %27 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tests_failed, align 4, !tbaa !14
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.56)
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 290)
  br label %31

31:                                               ; preds = %26, %22
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  %34 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 3, ptr %34, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %35 = load ptr, ptr %1, align 8, !tbaa !5
  %36 = load i64, ptr %2, align 8, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = call i64 @regex_search(ptr noundef %4, ptr noundef %35, i64 noundef %36, ptr noundef %37)
  store i64 %38, ptr %6, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %33
  %40 = load i64, ptr %6, align 8, !tbaa !9
  %41 = icmp eq i64 %40, 3
  br i1 %41, label %42, label %46

42:                                               ; preds = %39
  %43 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @tests_passed, align 4, !tbaa !14
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.57)
  br label %51

46:                                               ; preds = %39
  %47 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr @tests_failed, align 4, !tbaa !14
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.57)
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 294)
  br label %51

51:                                               ; preds = %46, %42
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 2, ptr %54, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %55 = load ptr, ptr %1, align 8, !tbaa !5
  %56 = load i64, ptr %2, align 8, !tbaa !9
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = call i64 @regex_search(ptr noundef %4, ptr noundef %55, i64 noundef %56, ptr noundef %57)
  store i64 %58, ptr %7, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %53
  %60 = load i64, ptr %7, align 8, !tbaa !9
  %61 = icmp eq i64 %60, 2
  br i1 %61, label %62, label %66

62:                                               ; preds = %59
  %63 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @tests_passed, align 4, !tbaa !14
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.58)
  br label %71

66:                                               ; preds = %59
  %67 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr @tests_failed, align 4, !tbaa !14
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.58)
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 298)
  br label %71

71:                                               ; preds = %66, %62
  br label %72

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 1, ptr %74, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %75 = load ptr, ptr %1, align 8, !tbaa !5
  %76 = load i64, ptr %2, align 8, !tbaa !9
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = call i64 @regex_search(ptr noundef %4, ptr noundef %75, i64 noundef %76, ptr noundef %77)
  store i64 %78, ptr %8, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %73
  %80 = load i64, ptr %8, align 8, !tbaa !9
  %81 = icmp eq i64 %80, 1
  br i1 %81, label %82, label %86

82:                                               ; preds = %79
  %83 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr @tests_passed, align 4, !tbaa !14
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.59)
  br label %91

86:                                               ; preds = %79
  %87 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @tests_failed, align 4, !tbaa !14
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.59)
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 302)
  br label %91

91:                                               ; preds = %86, %82
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  %94 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 0, ptr %94, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %95 = load ptr, ptr %1, align 8, !tbaa !5
  %96 = load i64, ptr %2, align 8, !tbaa !9
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = call i64 @regex_search(ptr noundef %4, ptr noundef %95, i64 noundef %96, ptr noundef %97)
  store i64 %98, ptr %9, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %93
  %100 = load i64, ptr %9, align 8, !tbaa !9
  %101 = icmp eq i64 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %99
  %103 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr @tests_passed, align 4, !tbaa !14
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.60)
  br label %111

106:                                              ; preds = %99
  %107 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr @tests_failed, align 4, !tbaa !14
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.60)
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 306)
  br label %111

111:                                              ; preds = %106, %102
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  %114 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 9
  store i8 1, ptr %114, align 4, !tbaa !16
  %115 = getelementptr inbounds %struct.search_params, ptr %4, i32 0, i32 13
  store i64 2, ptr %115, align 8, !tbaa !11
  %116 = call ptr @match_result_init(i64 noundef 5)
  store ptr %116, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %117 = load ptr, ptr %1, align 8, !tbaa !5
  %118 = load i64, ptr %2, align 8, !tbaa !9
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = call i64 @regex_search(ptr noundef %4, ptr noundef %117, i64 noundef %118, ptr noundef %119)
  store i64 %120, ptr %10, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %113
  %122 = load i64, ptr %10, align 8, !tbaa !9
  %123 = icmp eq i64 %122, 2
  br i1 %123, label %124, label %128

124:                                              ; preds = %121
  %125 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr @tests_passed, align 4, !tbaa !14
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.61)
  br label %133

128:                                              ; preds = %121
  %129 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr @tests_failed, align 4, !tbaa !14
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.61)
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 313)
  br label %133

133:                                              ; preds = %128, %124
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.match_result_t, ptr %137, i32 0, i32 1
  %139 = load i64, ptr %138, align 8, !tbaa !17
  %140 = icmp eq i64 %139, 2
  br i1 %140, label %141, label %145

141:                                              ; preds = %136
  %142 = load i32, ptr @tests_passed, align 4, !tbaa !14
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr @tests_passed, align 4, !tbaa !14
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.62)
  br label %150

145:                                              ; preds = %136
  %146 = load i32, ptr @tests_failed, align 4, !tbaa !14
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr @tests_failed, align 4, !tbaa !14
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef @.str.62)
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 314)
  br label %150

150:                                              ; preds = %145, %141
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  call void @match_result_free(ptr noundef %153)
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @cleanup_params(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

declare void @create_regex_params(ptr dead_on_unwind writable sret(%struct.search_params) align 8, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #0

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

declare ptr @match_result_init(i64 noundef) #0

declare void @match_result_free(ptr noundef) #0

declare void @cleanup_params(ptr noundef) #0

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 = { 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 #4 = { nounwind }
attributes #5 = { 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, !10, i64 64}
!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 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !13, i64 44}
!17 = !{!18, !10, i64 8}
!18 = !{!"match_result_t", !6, i64 0, !10, i64 8, !10, i64 16}


; 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_passed = external local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@tests_failed = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [47 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 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_regex_report_limit() local_unnamed_addr #3 {
  %1 = alloca %struct.search_params, align 8
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.54)
  %3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.55) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %1) #6
  call void @create_regex_params(ptr dead_on_unwind nonnull writable sret(%struct.search_params) align 8 %1, ptr noundef nonnull @.str.23, i1 noundef zeroext true, i1 noundef zeroext false, i1 noundef zeroext false) #6
  %4 = getelementptr inbounds i8, ptr %1, i64 64
  store i64 -1, ptr %4, align 8, !tbaa !5
  %5 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef null) #6
  %6 = icmp eq i64 %5, 4
  br i1 %6, label %7, label %11

7:                                                ; preds = %0
  %8 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %9 = add nsw i32 %8, 1
  store i32 %9, ptr @tests_passed, align 4, !tbaa !12
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.56)
  br label %16

11:                                               ; preds = %0
  %12 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @tests_failed, align 4, !tbaa !12
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.56)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 290)
  br label %16

16:                                               ; preds = %11, %7
  store i64 3, ptr %4, align 8, !tbaa !5
  %17 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef null) #6
  %18 = icmp eq i64 %17, 3
  br i1 %18, label %19, label %23

19:                                               ; preds = %16
  %20 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @tests_passed, align 4, !tbaa !12
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.57)
  br label %28

23:                                               ; preds = %16
  %24 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @tests_failed, align 4, !tbaa !12
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.57)
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 294)
  br label %28

28:                                               ; preds = %23, %19
  store i64 2, ptr %4, align 8, !tbaa !5
  %29 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef null) #6
  %30 = icmp eq i64 %29, 2
  br i1 %30, label %31, label %35

31:                                               ; preds = %28
  %32 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @tests_passed, align 4, !tbaa !12
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.58)
  br label %40

35:                                               ; preds = %28
  %36 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @tests_failed, align 4, !tbaa !12
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.58)
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 298)
  br label %40

40:                                               ; preds = %35, %31
  store i64 1, ptr %4, align 8, !tbaa !5
  %41 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef null) #6
  %42 = icmp eq i64 %41, 1
  br i1 %42, label %43, label %47

43:                                               ; preds = %40
  %44 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @tests_passed, align 4, !tbaa !12
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.59)
  br label %52

47:                                               ; preds = %40
  %48 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @tests_failed, align 4, !tbaa !12
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.59)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 302)
  br label %52

52:                                               ; preds = %47, %43
  store i64 0, ptr %4, align 8, !tbaa !5
  %53 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef null) #6
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %55, label %59

55:                                               ; preds = %52
  %56 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr @tests_passed, align 4, !tbaa !12
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.60)
  br label %64

59:                                               ; preds = %52
  %60 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr @tests_failed, align 4, !tbaa !12
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.60)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 306)
  br label %64

64:                                               ; preds = %59, %55
  %65 = getelementptr inbounds i8, ptr %1, i64 44
  store i8 1, ptr %65, align 4, !tbaa !14
  store i64 2, ptr %4, align 8, !tbaa !5
  %66 = call ptr @match_result_init(i64 noundef 5) #6
  %67 = call i64 @regex_search(ptr noundef nonnull %1, ptr noundef nonnull @.str.55, i64 noundef %3, ptr noundef %66) #6
  %68 = icmp eq i64 %67, 2
  br i1 %68, label %69, label %73

69:                                               ; preds = %64
  %70 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @tests_passed, align 4, !tbaa !12
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.61)
  br label %78

73:                                               ; preds = %64
  %74 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr @tests_failed, align 4, !tbaa !12
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.61)
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 313)
  br label %78

78:                                               ; preds = %69, %73
  %79 = getelementptr inbounds i8, ptr %66, i64 8
  %80 = load i64, ptr %79, align 8, !tbaa !15
  %81 = icmp eq i64 %80, 2
  br i1 %81, label %82, label %86

82:                                               ; preds = %78
  %83 = load i32, ptr @tests_passed, align 4, !tbaa !12
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr @tests_passed, align 4, !tbaa !12
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.62)
  br label %91

86:                                               ; preds = %78
  %87 = load i32, ptr @tests_failed, align 4, !tbaa !12
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @tests_failed, align 4, !tbaa !12
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull @.str.62)
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @.str.8, i32 noundef 314)
  br label %91

91:                                               ; preds = %86, %82
  call void @match_result_free(ptr noundef nonnull %66) #6
  call void @cleanup_params(ptr noundef nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %1) #6
  ret void
}

declare void @create_regex_params(ptr dead_on_unwind writable sret(%struct.search_params) align 8, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #4

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

declare ptr @match_result_init(i64 noundef) local_unnamed_addr #4

declare void @match_result_free(ptr noundef) local_unnamed_addr #4

declare void @cleanup_params(ptr noundef) local_unnamed_addr #4

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 = { 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 #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 willreturn memory(read) }
attributes #6 = { 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, !10, i64 64}
!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 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !11, i64 44}
!15 = !{!16, !10, i64 8}
!16 = !{!"match_result_t", !7, i64 0, !10, i64 8, !10, i64 16}


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