; LLVM IR from DeadParrot/NHTSA-Tools :: src/lib/Linux/GCC (wildmat)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @wild_match_(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.re_pattern_buffer, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #8
  %18 = load i64, ptr %8, align 8, !tbaa !9
  %19 = add nsw i64 %18, 1
  %20 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %19) #9
  store ptr %20, ptr %10, align 8, !tbaa !5
  %21 = load i64, ptr %9, align 8, !tbaa !9
  %22 = add nsw i64 %21, 1
  %23 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %22) #9
  store ptr %23, ptr %11, align 8, !tbaa !5
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %29, label %26

26:                                               ; preds = %4
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %26, %4
  %30 = call i32 @f77_return(i32 noundef 0)
  store i32 %30, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %233

31:                                               ; preds = %26
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 %33, i64 %34, i1 false)
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %35, ptr align 1 %36, i64 %37, i1 false)
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  store ptr %40, ptr %12, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %58, %31
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 32
  br i1 %45, label %56, label %46

46:                                               ; preds = %41
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 9
  br i1 %50, label %56, label %51

51:                                               ; preds = %46
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = sext i8 %53 to i32
  %55 = icmp eq i32 %54, 0
  br label %56

56:                                               ; preds = %51, %46, %41
  %57 = phi i1 [ true, %46 ], [ true, %41 ], [ %55, %51 ]
  br i1 %57, label %58, label %61

58:                                               ; preds = %56
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i32 -1
  store ptr %60, ptr %12, align 8, !tbaa !5
  br label %41, !llvm.loop !12

61:                                               ; preds = %56
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i32 1
  store ptr %63, ptr %12, align 8, !tbaa !5
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %64, align 1, !tbaa !11
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = getelementptr inbounds i8, ptr %65, i64 %66
  store ptr %67, ptr %12, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %85, %61
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 32
  br i1 %72, label %83, label %73

73:                                               ; preds = %68
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %76, 9
  br i1 %77, label %83, label %78

78:                                               ; preds = %73
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load i8, ptr %79, align 1, !tbaa !11
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 0
  br label %83

83:                                               ; preds = %78, %73, %68
  %84 = phi i1 [ true, %73 ], [ true, %68 ], [ %82, %78 ]
  br i1 %84, label %85, label %88

85:                                               ; preds = %83
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i32 -1
  store ptr %87, ptr %12, align 8, !tbaa !5
  br label %68, !llvm.loop !14

88:                                               ; preds = %83
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i32 1
  store ptr %90, ptr %12, align 8, !tbaa !5
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %91, align 1, !tbaa !11
  store i32 1, ptr %14, align 4, !tbaa !15
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = call i64 @strlen(ptr noundef %92) #10
  %94 = add i64 %93, 1
  %95 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %94) #9
  store ptr %95, ptr %13, align 8, !tbaa !5
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %223

98:                                               ; preds = %88
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %99, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = call i64 @strlen(ptr noundef %101) #10
  %103 = add i64 %102, 2
  %104 = call ptr @realloc(ptr noundef %100, i64 noundef %103) #11
  store ptr %104, ptr %13, align 8, !tbaa !5
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %208

107:                                              ; preds = %98
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 0
  store i8 0, ptr %109, align 1, !tbaa !11
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = call ptr @strcat(ptr noundef %110, ptr noundef @.str) #8
  store i32 0, ptr %14, align 4, !tbaa !15
  br label %112

112:                                              ; preds = %192, %107
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = load i8, ptr %113, align 1, !tbaa !11
  %115 = sext i8 %114 to i32
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %120

117:                                              ; preds = %112
  %118 = load i32, ptr %14, align 4, !tbaa !15
  %119 = icmp eq i32 %118, 0
  br label %120

120:                                              ; preds = %117, %112
  %121 = phi i1 [ false, %112 ], [ %119, %117 ]
  br i1 %121, label %122, label %195

122:                                              ; preds = %120
  %123 = load ptr, ptr %12, align 8, !tbaa !5
  %124 = load i8, ptr %123, align 1, !tbaa !11
  %125 = sext i8 %124 to i32
  switch i32 %125, label %178 [
    i32 46, label %126
    i32 126, label %139
    i32 63, label %152
    i32 42, label %165
  ]

126:                                              ; preds = %122
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = call i64 @strlen(ptr noundef %128) #10
  %130 = add i64 %129, 3
  %131 = call ptr @realloc(ptr noundef %127, i64 noundef %130) #11
  store ptr %131, ptr %13, align 8, !tbaa !5
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %137

134:                                              ; preds = %126
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = call ptr @strcat(ptr noundef %135, ptr noundef @.str.1) #8
  br label %138

137:                                              ; preds = %126
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %138

138:                                              ; preds = %137, %134
  br label %192

139:                                              ; preds = %122
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = call i64 @strlen(ptr noundef %141) #10
  %143 = add i64 %142, 3
  %144 = call ptr @realloc(ptr noundef %140, i64 noundef %143) #11
  store ptr %144, ptr %13, align 8, !tbaa !5
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %150

147:                                              ; preds = %139
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  %149 = call ptr @strcat(ptr noundef %148, ptr noundef @.str.2) #8
  br label %151

150:                                              ; preds = %139
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %151

151:                                              ; preds = %150, %147
  br label %192

152:                                              ; preds = %122
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = call i64 @strlen(ptr noundef %154) #10
  %156 = add i64 %155, 2
  %157 = call ptr @realloc(ptr noundef %153, i64 noundef %156) #11
  store ptr %157, ptr %13, align 8, !tbaa !5
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %163

160:                                              ; preds = %152
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = call ptr @strcat(ptr noundef %161, ptr noundef @.str.3) #8
  br label %164

163:                                              ; preds = %152
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %164

164:                                              ; preds = %163, %160
  br label %192

165:                                              ; preds = %122
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  %168 = call i64 @strlen(ptr noundef %167) #10
  %169 = add i64 %168, 3
  %170 = call ptr @realloc(ptr noundef %166, i64 noundef %169) #11
  store ptr %170, ptr %13, align 8, !tbaa !5
  %171 = load ptr, ptr %13, align 8, !tbaa !5
  %172 = icmp ne ptr %171, null
  br i1 %172, label %173, label %176

173:                                              ; preds = %165
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = call ptr @strcat(ptr noundef %174, ptr noundef @.str.4) #8
  br label %177

176:                                              ; preds = %165
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %177

177:                                              ; preds = %176, %173
  br label %192

178:                                              ; preds = %122
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = call i64 @strlen(ptr noundef %180) #10
  %182 = add i64 %181, 2
  %183 = call ptr @realloc(ptr noundef %179, i64 noundef %182) #11
  store ptr %183, ptr %13, align 8, !tbaa !5
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = icmp ne ptr %184, null
  br i1 %185, label %186, label %190

186:                                              ; preds = %178
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  %189 = call ptr @strncat(ptr noundef %187, ptr noundef %188, i64 noundef 1) #8
  br label %191

190:                                              ; preds = %178
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %191

191:                                              ; preds = %190, %186
  br label %192

192:                                              ; preds = %191, %177, %164, %151, %138
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i32 1
  store ptr %194, ptr %12, align 8, !tbaa !5
  br label %112, !llvm.loop !17

195:                                              ; preds = %120
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = load ptr, ptr %13, align 8, !tbaa !5
  %198 = call i64 @strlen(ptr noundef %197) #10
  %199 = add i64 %198, 2
  %200 = call ptr @realloc(ptr noundef %196, i64 noundef %199) #11
  store ptr %200, ptr %13, align 8, !tbaa !5
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = icmp ne ptr %201, null
  br i1 %202, label %203, label %206

203:                                              ; preds = %195
  %204 = load ptr, ptr %13, align 8, !tbaa !5
  %205 = call ptr @strcat(ptr noundef %204, ptr noundef @.str.5) #8
  br label %207

206:                                              ; preds = %195
  store i32 1, ptr %14, align 4, !tbaa !15
  br label %207

207:                                              ; preds = %206, %203
  br label %208

208:                                              ; preds = %207, %98
  %209 = load i32, ptr %14, align 4, !tbaa !15
  %210 = icmp eq i32 %209, 0
  br i1 %210, label %211, label %222

211:                                              ; preds = %208
  store i32 12, ptr %15, align 4, !tbaa !15
  %212 = load ptr, ptr %13, align 8, !tbaa !5
  %213 = load i32, ptr %15, align 4, !tbaa !15
  %214 = call i32 @regcomp(ptr noundef %16, ptr noundef %212, i32 noundef %213)
  store i32 %214, ptr %14, align 4, !tbaa !15
  %215 = load i32, ptr %14, align 4, !tbaa !15
  %216 = icmp eq i32 %215, 0
  br i1 %216, label %217, label %221

217:                                              ; preds = %211
  store i32 0, ptr %15, align 4, !tbaa !15
  %218 = load ptr, ptr %11, align 8, !tbaa !5
  %219 = load i32, ptr %15, align 4, !tbaa !15
  %220 = call i32 @regexec(ptr noundef %16, ptr noundef %218, i64 noundef 0, ptr noundef null, i32 noundef %219)
  store i32 %220, ptr %14, align 4, !tbaa !15
  br label %221

221:                                              ; preds = %217, %211
  br label %222

222:                                              ; preds = %221, %208
  br label %223

223:                                              ; preds = %222, %88
  %224 = load ptr, ptr %13, align 8, !tbaa !5
  %225 = icmp ne ptr %224, null
  br i1 %225, label %226, label %228

226:                                              ; preds = %223
  %227 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %227) #8
  br label %228

228:                                              ; preds = %226, %223
  call void @regfree(ptr noundef %16)
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %229) #8
  %230 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %230) #8
  %231 = load i32, ptr %14, align 4, !tbaa !15
  %232 = call i32 @f77_return(i32 noundef %231)
  store i32 %232, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %233

233:                                              ; preds = %228, %29
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %234 = load i32, ptr %5, align 4
  ret i32 %234
}

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

declare i32 @f77_return(i32 noundef) #3

; 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) #4

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #6

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind
declare ptr @strncat(ptr noundef, ptr noundef, i64 noundef) #7

declare i32 @regcomp(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @regexec(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #7

declare void @regfree(ptr noundef) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind allocsize(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 #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(1) }

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !13}


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @wild_match_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.re_pattern_buffer, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #9
  %6 = add nsw i64 %2, 1
  %7 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %6) #10
  %8 = add nsw i64 %3, 1
  %9 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %8) #10
  %10 = icmp eq ptr %7, null
  %11 = icmp eq ptr %9, null
  %or.cond = or i1 %10, %11
  br i1 %or.cond, label %12, label %14

12:                                               ; preds = %4
  %13 = tail call i32 @f77_return(i32 noundef 0) #9
  br label %78

14:                                               ; preds = %4
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %7, ptr align 1 %0, i64 %2, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %9, ptr align 1 %1, i64 %3, i1 false)
  %15 = getelementptr inbounds i8, ptr %7, i64 %2
  br label %16

16:                                               ; preds = %.critedge, %14
  %.081 = phi ptr [ %15, %14 ], [ %18, %.critedge ]
  %17 = load i8, ptr %.081, align 1, !tbaa !5
  switch i8 %17, label %19 [
    i8 32, label %.critedge
    i8 9, label %.critedge
    i8 0, label %.critedge
  ]

.critedge:                                        ; preds = %16, %16, %16
  %18 = getelementptr inbounds i8, ptr %.081, i64 -1
  br label %16, !llvm.loop !8

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %.081, i64 1
  store i8 0, ptr %20, align 1, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %9, i64 %3
  br label %22

22:                                               ; preds = %.critedge3, %19
  %.182 = phi ptr [ %21, %19 ], [ %24, %.critedge3 ]
  %23 = load i8, ptr %.182, align 1, !tbaa !5
  switch i8 %23, label %25 [
    i8 32, label %.critedge3
    i8 9, label %.critedge3
    i8 0, label %.critedge3
  ]

.critedge3:                                       ; preds = %22, %22, %22
  %24 = getelementptr inbounds i8, ptr %.182, i64 -1
  br label %22, !llvm.loop !10

25:                                               ; preds = %22
  %26 = getelementptr inbounds i8, ptr %.182, i64 1
  store i8 0, ptr %26, align 1, !tbaa !5
  %27 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #11
  %28 = add i64 %27, 1
  %29 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %28) #10
  %.not = icmp eq ptr %29, null
  br i1 %.not, label %.thread, label %30

30:                                               ; preds = %25
  %31 = add i64 %27, 2
  %32 = tail call ptr @realloc(ptr noundef nonnull %29, i64 noundef %31) #12
  %.not107 = icmp eq ptr %32, null
  br i1 %.not107, label %.thread, label %33

33:                                               ; preds = %30
  store i8 0, ptr %32, align 1, !tbaa !5
  %34 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %32, ptr noundef nonnull dereferenceable(1) @.str) #9
  %35 = load i8, ptr %7, align 1, !tbaa !5
  %.not128 = icmp eq i8 %35, 0
  br i1 %.not128, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %33, %63
  %36 = phi i8 [ %65, %63 ], [ %35, %33 ]
  %.077126 = phi ptr [ %.178, %63 ], [ %32, %33 ]
  %.283125 = phi ptr [ %64, %63 ], [ %7, %33 ]
  %37 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.077126) #11
  switch i8 %36, label %58 [
    i8 46, label %38
    i8 126, label %43
    i8 63, label %48
    i8 42, label %53
  ]

38:                                               ; preds = %.lr.ph
  %39 = add i64 %37, 3
  %40 = tail call ptr @realloc(ptr noundef nonnull %.077126, i64 noundef %39) #12
  %.not113 = icmp eq ptr %40, null
  br i1 %.not113, label %._crit_edge, label %41

41:                                               ; preds = %38
  %42 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %40, ptr noundef nonnull dereferenceable(1) @.str.1) #9
  br label %63

43:                                               ; preds = %.lr.ph
  %44 = add i64 %37, 3
  %45 = tail call ptr @realloc(ptr noundef nonnull %.077126, i64 noundef %44) #12
  %.not112 = icmp eq ptr %45, null
  br i1 %.not112, label %._crit_edge, label %46

46:                                               ; preds = %43
  %47 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %45, ptr noundef nonnull dereferenceable(1) @.str.2) #9
  br label %63

48:                                               ; preds = %.lr.ph
  %49 = add i64 %37, 2
  %50 = tail call ptr @realloc(ptr noundef nonnull %.077126, i64 noundef %49) #12
  %.not111 = icmp eq ptr %50, null
  br i1 %.not111, label %._crit_edge, label %51

51:                                               ; preds = %48
  %52 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %50, ptr noundef nonnull dereferenceable(1) @.str.3) #9
  br label %63

53:                                               ; preds = %.lr.ph
  %54 = add i64 %37, 3
  %55 = tail call ptr @realloc(ptr noundef nonnull %.077126, i64 noundef %54) #12
  %.not110 = icmp eq ptr %55, null
  br i1 %.not110, label %._crit_edge, label %56

56:                                               ; preds = %53
  %57 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %55, ptr noundef nonnull dereferenceable(1) @.str.4) #9
  br label %63

58:                                               ; preds = %.lr.ph
  %59 = add i64 %37, 2
  %60 = tail call ptr @realloc(ptr noundef nonnull %.077126, i64 noundef %59) #12
  %.not114 = icmp eq ptr %60, null
  br i1 %.not114, label %._crit_edge, label %61

61:                                               ; preds = %58
  %62 = tail call ptr @strncat(ptr noundef nonnull dereferenceable(1) %60, ptr noundef nonnull dereferenceable(1) %.283125, i64 noundef 1) #9
  br label %63

63:                                               ; preds = %61, %56, %51, %46, %41
  %.178 = phi ptr [ %60, %61 ], [ %55, %56 ], [ %50, %51 ], [ %45, %46 ], [ %40, %41 ]
  %64 = getelementptr inbounds i8, ptr %.283125, i64 1
  %65 = load i8, ptr %64, align 1, !tbaa !5
  %.not133 = icmp eq i8 %65, 0
  br i1 %.not133, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %58, %53, %48, %43, %38, %63, %33
  %.077.lcssa = phi ptr [ %32, %33 ], [ null, %58 ], [ null, %53 ], [ null, %48 ], [ null, %43 ], [ null, %38 ], [ %.178, %63 ]
  %.lcssa = phi i1 [ true, %33 ], [ false, %58 ], [ false, %53 ], [ false, %48 ], [ false, %43 ], [ false, %38 ], [ true, %63 ]
  %66 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.077.lcssa) #11
  %67 = add i64 %66, 2
  %68 = tail call ptr @realloc(ptr noundef %.077.lcssa, i64 noundef %67) #12
  %.not108 = icmp eq ptr %68, null
  br i1 %.not108, label %.thread, label %69

69:                                               ; preds = %._crit_edge
  %70 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %68, ptr noundef nonnull dereferenceable(1) @.str.5) #9
  br i1 %.lcssa, label %71, label %76

71:                                               ; preds = %69
  %72 = call i32 @regcomp(ptr noundef nonnull %5, ptr noundef nonnull %68, i32 noundef 12) #9
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %71
  %75 = call i32 @regexec(ptr noundef nonnull %5, ptr noundef %9, i64 noundef 0, ptr noundef null, i32 noundef 0) #9
  br label %76

76:                                               ; preds = %74, %71, %69
  %.3.ph = phi i32 [ 1, %69 ], [ %72, %71 ], [ %75, %74 ]
  call void @free(ptr noundef nonnull %68) #9
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %30, %25, %76
  %.3124 = phi i32 [ %.3.ph, %76 ], [ 1, %25 ], [ 1, %30 ], [ 1, %._crit_edge ]
  call void @regfree(ptr noundef nonnull %5) #9
  call void @free(ptr noundef %7) #9
  call void @free(ptr noundef %9) #9
  %77 = call i32 @f77_return(i32 noundef %.3124) #9
  br label %78

78:                                               ; preds = %.thread, %12
  %.084 = phi i32 [ %13, %12 ], [ %77, %.thread ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #9
  ret i32 %.084
}

; 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 allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

declare i32 @f77_return(i32 noundef) local_unnamed_addr #3

; 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) #4

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #7

declare i32 @regcomp(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @regexec(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

declare void @regfree(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0,1) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(1) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass