; LLVM IR from jspd-group/pegit :: src (tree)

; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }
%struct.strbuf = type { i64, i64, ptr }
%struct.dirent = type { i64, i64, i16, i8, [256 x i8] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@stdout = external global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare ptr @opendir(ptr noundef) #1

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #3

declare ptr @readdir(ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_addch(ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_addstr(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i32 @stat(ptr noundef, ptr noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @is_file(ptr noundef) #4

declare i32 @closedir(ptr noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_setlen(ptr noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @list_directory_files(ptr noundef %0, i32 noundef %1) #6 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.stat, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 144, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.strbuf, ptr %12, i32 0, i32 2
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = call ptr @opendir(ptr noundef %14)
  store ptr %15, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %38, label %18

18:                                               ; preds = %2
  br label %19

19:                                               ; preds = %18
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str) #7
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.1) #7
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.2) #7
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.3) #7
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.strbuf, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = call ptr @__errno_location() #8
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call ptr @strerror(i32 noundef %33) #7
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.14, ptr noundef %31, ptr noundef %34) #7
  br label %36

36:                                               ; preds = %19
  br label %37

37:                                               ; preds = %36
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %105

38:                                               ; preds = %2
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  call void @strbuf_addch(ptr noundef %39, i32 noundef 47)
  br label %40

40:                                               ; preds = %91, %38
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call ptr @readdir(ptr noundef %41)
  store ptr %42, ptr %6, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %101

44:                                               ; preds = %40
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.dirent, ptr %46, i32 0, i32 4
  %48 = getelementptr inbounds [256 x i8], ptr %47, i64 0, i64 0
  call void @strbuf_addstr(ptr noundef %45, ptr noundef %48)
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.strbuf, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = call i32 @stat(ptr noundef %51, ptr noundef %8) #7
  store i32 %52, ptr %9, align 4, !tbaa !9
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %55, label %76

55:                                               ; preds = %44
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str) #7
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.1) #7
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.2) #7
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.3) #7
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.dirent, ptr %66, i32 0, i32 4
  %68 = getelementptr inbounds [256 x i8], ptr %67, i64 0, i64 0
  %69 = call ptr @__errno_location() #8
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = call ptr @strerror(i32 noundef %70) #7
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.13, ptr noundef %68, ptr noundef %71) #7
  br label %73

73:                                               ; preds = %56
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %75, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %105

76:                                               ; preds = %44
  %77 = call i32 @is_file(ptr noundef %8)
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %91

79:                                               ; preds = %76
  %80 = load i32, ptr %5, align 4, !tbaa !9
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %88, label %82

82:                                               ; preds = %79
  %83 = load ptr, ptr @stdout, align 8, !tbaa !5
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.dirent, ptr %84, i32 0, i32 4
  %86 = getelementptr inbounds [256 x i8], ptr %85, i64 0, i64 0
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.7, ptr noundef %86) #7
  br label %88

88:                                               ; preds = %82, %79
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %88, %76
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.strbuf, ptr %93, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !14
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.dirent, ptr %96, i32 0, i32 4
  %98 = getelementptr inbounds [256 x i8], ptr %97, i64 0, i64 0
  %99 = call i64 @strlen(ptr noundef %98) #9
  %100 = sub i64 %95, %99
  call void @strbuf_setlen(ptr noundef %92, i64 noundef %100)
  br label %40, !llvm.loop !15

101:                                              ; preds = %40
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = call i32 @closedir(ptr noundef %102)
  %104 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %104, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %105

105:                                              ; preds = %101, %74, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %106 = load i32, ptr %3, align 4
  ret i32 %106
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 #3 = { nounwind willreturn memory(none) "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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"strbuf", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @opendir(ptr nocapture noundef readonly) local_unnamed_addr #1

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #3

declare ptr @readdir(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_addch(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_addstr(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @stat(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @is_file(ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @closedir(ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_setlen(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local i32 @list_directory_files(ptr noundef %0, i32 noundef %1) local_unnamed_addr #7 {
  %3 = alloca %struct.stat, align 8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %3) #8
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call ptr @opendir(ptr noundef %5)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %22

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !11
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #9
  %10 = load ptr, ptr @stderr, align 8, !tbaa !11
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.1) #9
  %12 = load ptr, ptr @stderr, align 8, !tbaa !11
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.2) #9
  %14 = load ptr, ptr @stderr, align 8, !tbaa !11
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.3) #9
  %16 = load ptr, ptr @stderr, align 8, !tbaa !11
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = tail call ptr @__errno_location() #10
  %19 = load i32, ptr %18, align 4, !tbaa !12
  %20 = tail call ptr @strerror(i32 noundef %19) #8
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.14, ptr noundef %17, ptr noundef %20) #9
  br label %67

22:                                               ; preds = %2
  tail call void @strbuf_addch(ptr noundef nonnull %0, i32 noundef 47)
  %23 = tail call ptr @readdir(ptr noundef nonnull %6) #8
  %.not2328 = icmp eq ptr %23, null
  br i1 %.not2328, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %22
  %.not25 = icmp eq i32 %1, 0
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %.not25, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %36
  %25 = phi ptr [ %40, %36 ], [ %23, %.lr.ph ]
  %.029.us = phi i32 [ %.1.us, %36 ], [ 0, %.lr.ph ]
  %26 = getelementptr inbounds i8, ptr %25, i64 19
  call void @strbuf_addstr(ptr noundef nonnull %0, ptr noundef nonnull %26)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call i32 @stat(ptr noundef %27, ptr noundef nonnull %3) #8
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %.split.us, label %30

30:                                               ; preds = %.lr.ph.split.us
  %31 = call i32 @is_file(ptr noundef nonnull %3)
  %.not24.us = icmp eq i32 %31, 0
  br i1 %.not24.us, label %36, label %32

32:                                               ; preds = %30
  %33 = load ptr, ptr @stdout, align 8, !tbaa !11
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.7, ptr noundef nonnull %26) #8
  %35 = add nsw i32 %.029.us, 1
  br label %36

36:                                               ; preds = %32, %30
  %.1.us = phi i32 [ %35, %32 ], [ %.029.us, %30 ]
  %37 = load i64, ptr %24, align 8, !tbaa !14
  %38 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %26) #11
  %39 = sub i64 %37, %38
  call void @strbuf_setlen(ptr noundef nonnull %0, i64 noundef %39)
  %40 = call ptr @readdir(ptr noundef nonnull %6) #8
  %.not23.us = icmp eq ptr %40, null
  br i1 %.not23.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !15

.lr.ph.split:                                     ; preds = %.lr.ph, %59
  %41 = phi ptr [ %65, %59 ], [ %23, %.lr.ph ]
  %.029 = phi i32 [ %spec.select, %59 ], [ 0, %.lr.ph ]
  %42 = getelementptr inbounds i8, ptr %41, i64 19
  call void @strbuf_addstr(ptr noundef nonnull %0, ptr noundef nonnull %42)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call i32 @stat(ptr noundef %43, ptr noundef nonnull %3) #8
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %.split.us, label %59

.split.us:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us
  %.us-phi = phi ptr [ %26, %.lr.ph.split.us ], [ %42, %.lr.ph.split ]
  %.us-phi30 = phi i32 [ %28, %.lr.ph.split.us ], [ %44, %.lr.ph.split ]
  %46 = load ptr, ptr @stderr, align 8, !tbaa !11
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str) #9
  %48 = load ptr, ptr @stderr, align 8, !tbaa !11
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.1) #9
  %50 = load ptr, ptr @stderr, align 8, !tbaa !11
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.2) #9
  %52 = load ptr, ptr @stderr, align 8, !tbaa !11
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.3) #9
  %54 = load ptr, ptr @stderr, align 8, !tbaa !11
  %55 = tail call ptr @__errno_location() #10
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = call ptr @strerror(i32 noundef %56) #8
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.13, ptr noundef nonnull %.us-phi, ptr noundef %57) #9
  br label %67

59:                                               ; preds = %.lr.ph.split
  %60 = call i32 @is_file(ptr noundef nonnull %3)
  %.not24 = icmp ne i32 %60, 0
  %61 = zext i1 %.not24 to i32
  %spec.select = add nuw nsw i32 %.029, %61
  %62 = load i64, ptr %24, align 8, !tbaa !14
  %63 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %42) #11
  %64 = sub i64 %62, %63
  call void @strbuf_setlen(ptr noundef nonnull %0, i64 noundef %64)
  %65 = call ptr @readdir(ptr noundef nonnull %6) #8
  %.not23 = icmp eq ptr %65, null
  br i1 %.not23, label %._crit_edge, label %.lr.ph.split, !llvm.loop !15

._crit_edge:                                      ; preds = %59, %36, %22
  %.0.lcssa = phi i32 [ 0, %22 ], [ %.1.us, %36 ], [ %spec.select, %59 ]
  %66 = call i32 @closedir(ptr noundef nonnull %6)
  br label %67

67:                                               ; preds = %._crit_edge, %.split.us, %7
  %.019 = phi i32 [ %.us-phi30, %.split.us ], [ %.0.lcssa, %._crit_edge ], [ -1, %7 ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %3) #8
  ret i32 %.019
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { inlinehint 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 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { cold nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { 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, !10, i64 16}
!6 = !{!"strbuf", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !7, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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