; LLVM IR from alex-s168/tpre :: example (main)

; 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.tpre_re_t = type { i8, i16, i16, i8, ptr }
%struct.tpre_errs_t = type { ptr, i64 }
%struct.tpre_match_t = type { i8, i64, ptr }
%struct.tpre_err_t = type { i64, ptr }

@.str = external hidden unnamed_addr constant [45 x i8], align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %struct.tpre_re_t, align 8
  %4 = alloca %struct.tpre_errs_t, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.tpre_match_t, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.tpre_match_t, align 8
  %10 = alloca %struct.tpre_match_t, align 8
  %11 = alloca %struct.tpre_match_t, align 8
  %12 = alloca %struct.tpre_match_t, align 8
  %13 = alloca %struct.tpre_match_t, align 8
  %14 = alloca %struct.tpre_match_t, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store ptr @.str, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call i32 @tpre_compile(ptr noundef %3, ptr noundef %15, ptr noundef %4)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %43

18:                                               ; preds = %0
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %21

21:                                               ; preds = %35, %18
  %22 = load i64, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.tpre_errs_t, ptr %4, i32 0, i32 1
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = icmp ult i64 %22, %24
  br i1 %25, label %26, label %38

26:                                               ; preds = %21
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.tpre_errs_t, ptr %4, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = load i64, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.tpre_err_t, ptr %29, i64 %30
  %32 = getelementptr inbounds %struct.tpre_err_t, ptr %31, i32 0, i32 1
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.2, ptr noundef %33) #5
  br label %35

35:                                               ; preds = %26
  %36 = load i64, ptr %5, align 8, !tbaa !9
  %37 = add i64 %36, 1
  store i64 %37, ptr %5, align 8, !tbaa !9
  br label %21, !llvm.loop !16

38:                                               ; preds = %21
  %39 = getelementptr inbounds { ptr, i64 }, ptr %4, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8
  %41 = getelementptr inbounds { ptr, i64 }, ptr %4, i32 0, i32 1
  %42 = load i64, ptr %41, align 8
  call void @tpre_errs_free(ptr %40, i64 %42)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %66

43:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr @.str.3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %9, ptr noundef %3, ptr noundef %44)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %9, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %45, ptr noundef %46)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  store ptr @.str.4, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %10, ptr noundef %3, ptr noundef %47)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %10, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %48, ptr noundef %49)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  store ptr @.str.5, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %11, ptr noundef %3, ptr noundef %50)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %51, ptr noundef %52)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  store ptr @.str.6, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %12, ptr noundef %3, ptr noundef %53)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %12, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %54, ptr noundef %55)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  store ptr @.str.7, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %13, ptr noundef %3, ptr noundef %56)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %13, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %57, ptr noundef %58)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  store ptr @.str.8, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  call void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8 %14, ptr noundef %3, ptr noundef %59)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8 %7, ptr noundef %60, ptr noundef %61)
  call void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8 %7)
  %62 = getelementptr inbounds { i64, ptr }, ptr %3, i32 0, i32 0
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds { i64, ptr }, ptr %3, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8
  call void @tpre_free(i64 %63, ptr %65)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  store i32 0, ptr %6, align 4
  br label %66

66:                                               ; preds = %43, %38
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %67 = load i32, ptr %6, align 4
  switch i32 %67, label %70 [
    i32 0, label %68
    i32 1, label %68
  ]

68:                                               ; preds = %66, %66
  %69 = load i32, ptr %1, align 4
  ret i32 %69

70:                                               ; preds = %66
  unreachable
}

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

declare i32 @tpre_compile(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare void @tpre_errs_free(ptr, i64) #2

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

declare void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8, ptr noundef, 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) #4

declare void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8, ptr noundef, ptr noundef) #2

declare void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8) #2

declare void @tpre_free(i64, ptr) #2

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 = { "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 "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 }

!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 8}
!12 = !{!"", !6, i64 0, !10, i64 8}
!13 = !{!12, !6, i64 0}
!14 = !{!15, !6, i64 8}
!15 = !{!"", !10, i64 0, !6, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{i64 0, i64 1, !19, i64 8, i64 8, !9, i64 16, i64 8, !5}
!19 = !{!20, !20, i64 0}
!20 = !{!"_Bool", !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.tpre_re_t = type { i8, i16, i16, i8, ptr }
%struct.tpre_errs_t = type { ptr, i64 }
%struct.tpre_match_t = type { i8, i64, ptr }
%struct.tpre_err_t = type { i64, ptr }

@.str = external hidden unnamed_addr constant [45 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.tpre_re_t, align 8
  %2 = alloca %struct.tpre_errs_t, align 8
  %3 = alloca %struct.tpre_match_t, align 8
  %4 = alloca %struct.tpre_match_t, align 8
  %5 = alloca %struct.tpre_match_t, align 8
  %6 = alloca %struct.tpre_match_t, align 8
  %7 = alloca %struct.tpre_match_t, align 8
  %8 = alloca %struct.tpre_match_t, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %9 = call i32 @tpre_compile(ptr noundef nonnull %1, ptr noundef nonnull @.str, ptr noundef nonnull %2) #5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %24, label %10

10:                                               ; preds = %0
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1) #6
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = load i64, ptr %13, align 8
  %.not19 = icmp eq i64 %14, 0
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.01618 = phi i64 [ %20, %.lr.ph ], [ 0, %10 ]
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.tpre_err_t, ptr %16, i64 %.01618, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.2, ptr noundef %18) #6
  %20 = add nuw i64 %.01618, 1
  %21 = load i64, ptr %13, align 8
  %22 = icmp ult i64 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph, %10
  %.lcssa = phi i64 [ 0, %10 ], [ %21, %.lr.ph ]
  %23 = load ptr, ptr %2, align 8
  call void @tpre_errs_free(ptr %23, i64 %.lcssa) #5
  br label %34

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull %1, ptr noundef nonnull @.str.3) #5
  %25 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.3, ptr noundef %25) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %4, ptr noundef nonnull %1, ptr noundef nonnull @.str.4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %26 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.4, ptr noundef %26) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %5, ptr noundef nonnull %1, ptr noundef nonnull @.str.5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 24, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.5, ptr noundef %27) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %6, ptr noundef nonnull %1, ptr noundef nonnull @.str.6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %6, i64 24, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %28 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.6, ptr noundef %28) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %7, ptr noundef nonnull %1, ptr noundef nonnull @.str.7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %7, i64 24, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %29 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.7, ptr noundef %29) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @tpre_match(ptr dead_on_unwind nonnull writable sret(%struct.tpre_match_t) align 8 %8, ptr noundef nonnull %1, ptr noundef nonnull @.str.8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 24, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  %30 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @tpre_match_dump(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3, ptr noundef nonnull @.str.8, ptr noundef %30) #5
  call void @tpre_match_free(ptr noundef nonnull byval(%struct.tpre_match_t) align 8 %3) #5
  %31 = load i64, ptr %1, align 8
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load ptr, ptr %32, align 8
  call void @tpre_free(i64 %31, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %34

34:                                               ; preds = %24, %._crit_edge
  %.0 = phi i32 [ 1, %._crit_edge ], [ 0, %24 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  ret i32 %.0
}

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

declare i32 @tpre_compile(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @tpre_errs_free(ptr, i64) 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

declare void @tpre_match(ptr dead_on_unwind writable sret(%struct.tpre_match_t) align 8, ptr noundef, ptr 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) #4

declare void @tpre_match_dump(ptr noundef byval(%struct.tpre_match_t) align 8, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @tpre_match_free(ptr noundef byval(%struct.tpre_match_t) align 8) local_unnamed_addr #2

declare void @tpre_free(i64, ptr) local_unnamed_addr #2

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

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

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


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