; LLVM IR from holzschu/ios_system :: text_cmds/csplit (csplit)

; 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 }

@sflag = external dso_local global i32, align 4
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@truncofs = external dso_local global i64, align 8
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@currfile = external dso_local global [4096 x i8], align 16
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @my_tmpfile() #0

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

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

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

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: noreturn
declare void @errx(i32 noundef, ptr noundef, ...) #4

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
define dso_local void @do_rexp(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.re_pattern_buffer, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = call noalias ptr @strdup(ptr noundef %13) #7
  store ptr %14, ptr %7, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %1
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.22) #8
  unreachable

17:                                               ; preds = %1
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 1
  store ptr %19, ptr %11, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = call ptr @strrchr(ptr noundef %20, i32 noundef %23) #9
  store ptr %24, ptr %10, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %32, label %26

26:                                               ; preds = %17
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 -1
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp eq i32 %30, 92
  br i1 %31, label %32, label %37

32:                                               ; preds = %26, %17
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = sext i8 %35 to i32
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.23, ptr noundef %33, i32 noundef %36) #8
  unreachable

37:                                               ; preds = %26
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i32 1
  store ptr %39, ptr %10, align 8, !tbaa !5
  store i8 0, ptr %38, align 1, !tbaa !9
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %59

44:                                               ; preds = %37
  %45 = call ptr @__errno_location() #10
  store i32 0, ptr %45, align 4, !tbaa !10
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call i64 @strtol(ptr noundef %46, ptr noundef %8, i32 noundef 10) #7
  store i64 %47, ptr %5, align 8, !tbaa !12
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = sext i8 %49 to i32
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %56, label %52

52:                                               ; preds = %44
  %53 = call ptr @__errno_location() #10
  %54 = load i32, ptr %53, align 4, !tbaa !10
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %52, %44
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.24, ptr noundef %57) #8
  unreachable

58:                                               ; preds = %52
  br label %60

59:                                               ; preds = %37
  store i64 0, ptr %5, align 8, !tbaa !12
  br label %60

60:                                               ; preds = %59, %58
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = call i32 @regcomp(ptr noundef %3, ptr noundef %61, i32 noundef 8)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %60
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.25, ptr noundef %65) #8
  unreachable

66:                                               ; preds = %60
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = load i8, ptr %67, align 1, !tbaa !9
  %69 = sext i8 %68 to i32
  %70 = icmp eq i32 %69, 47
  br i1 %70, label %71, label %73

71:                                               ; preds = %66
  %72 = call ptr @newfile()
  store ptr %72, ptr %12, align 8, !tbaa !5
  br label %78

73:                                               ; preds = %66
  %74 = call ptr @my_tmpfile()
  store ptr %74, ptr %12, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %77

76:                                               ; preds = %73
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.26) #8
  unreachable

77:                                               ; preds = %73
  br label %78

78:                                               ; preds = %77, %71
  store i32 1, ptr %6, align 4, !tbaa !10
  br label %79

79:                                               ; preds = %96, %78
  %80 = call ptr @csplit_getline()
  store ptr %80, ptr %9, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %97

82:                                               ; preds = %79
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = call i32 @fputs(ptr noundef %83, ptr noundef %84)
  %86 = icmp eq i32 %85, -1
  br i1 %86, label %87, label %88

87:                                               ; preds = %82
  br label %97

88:                                               ; preds = %82
  %89 = load i32, ptr %6, align 4, !tbaa !10
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %96, label %91

91:                                               ; preds = %88
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = call i32 @regexec(ptr noundef %3, ptr noundef %92, i64 noundef 0, ptr noundef null, i32 noundef 0)
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %91
  br label %97

96:                                               ; preds = %91, %88
  store i32 0, ptr %6, align 4, !tbaa !10
  br label %79, !llvm.loop !14

97:                                               ; preds = %95, %87, %79
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = icmp eq ptr %98, null
  br i1 %99, label %100, label %102

100:                                              ; preds = %97
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef @.str.27, ptr noundef %101) #8
  unreachable

102:                                              ; preds = %97
  %103 = load i64, ptr %5, align 8, !tbaa !12
  %104 = icmp sle i64 %103, 0
  br i1 %104, label %105, label %118

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %114

108:                                              ; preds = %105
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load i64, ptr %5, align 8, !tbaa !12
  %111 = sub nsw i64 0, %110
  %112 = add nsw i64 %111, 1
  call void @toomuch(ptr noundef %109, i64 noundef %112)
  %113 = load i64, ptr @truncofs, align 8, !tbaa !12
  store i64 %113, ptr %4, align 8, !tbaa !12
  br label %117

114:                                              ; preds = %105
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = call i64 @ftello(ptr noundef %115)
  store i64 %116, ptr %4, align 8, !tbaa !12
  br label %117

117:                                              ; preds = %114, %108
  br label %140

118:                                              ; preds = %102
  br label %119

119:                                              ; preds = %128, %118
  %120 = load i64, ptr %5, align 8, !tbaa !12
  %121 = add nsw i64 %120, -1
  store i64 %121, ptr %5, align 8, !tbaa !12
  %122 = icmp sgt i64 %121, 0
  br i1 %122, label %123, label %126

123:                                              ; preds = %119
  %124 = call ptr @csplit_getline()
  store ptr %124, ptr %9, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br label %126

126:                                              ; preds = %123, %119
  %127 = phi i1 [ false, %119 ], [ %125, %123 ]
  br i1 %127, label %128, label %132

128:                                              ; preds = %126
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = call i32 @fputs(ptr noundef %129, ptr noundef %130)
  br label %119, !llvm.loop !16

132:                                              ; preds = %126
  call void @toomuch(ptr noundef null, i64 noundef 0)
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = call i64 @ftello(ptr noundef %133)
  store i64 %134, ptr %4, align 8, !tbaa !12
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = call i32 @fclose(ptr noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %132
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.11, ptr noundef @currfile) #8
  unreachable

139:                                              ; preds = %132
  br label %140

140:                                              ; preds = %139, %117
  %141 = load i32, ptr @sflag, align 4, !tbaa !10
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %151, label %143

143:                                              ; preds = %140
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = load i8, ptr %144, align 1, !tbaa !9
  %146 = sext i8 %145 to i32
  %147 = icmp eq i32 %146, 47
  br i1 %147, label %148, label %151

148:                                              ; preds = %143
  %149 = load i64, ptr %4, align 8, !tbaa !12
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i64 noundef %149)
  br label %151

151:                                              ; preds = %148, %143, %140
  call void @regfree(ptr noundef %3)
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %152) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #7
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @newfile() #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @csplit_getline() #0

declare i32 @fputs(ptr noundef, ptr noundef) #5

declare i32 @printf(ptr noundef, ...) #5

declare i64 @ftello(ptr noundef) #5

declare i32 @fclose(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @toomuch(ptr noundef, i64 noundef) #0

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #6

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

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

declare void @regfree(ptr noundef) #5

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

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 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 #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 = { noreturn "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 = { "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 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 #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind willreturn memory(none) }

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


; 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 }

@sflag = external dso_local local_unnamed_addr global i32, align 4
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@truncofs = external dso_local local_unnamed_addr global i64, align 8
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@currfile = external dso_local global [4096 x i8], align 16
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @my_tmpfile() 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: noreturn
declare void @errx(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @do_rexp(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.re_pattern_buffer, align 8
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  %4 = tail call noalias ptr @strdup(ptr noundef %0) #10
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %7

6:                                                ; preds = %1
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.22) #11
  unreachable

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %4, i64 1
  %9 = load i8, ptr %0, align 1, !tbaa !5
  %10 = sext i8 %9 to i32
  %11 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %4, i32 noundef %10) #12
  %12 = icmp eq ptr %11, null
  br i1 %12, label %17, label %13

13:                                               ; preds = %7
  %14 = getelementptr inbounds i8, ptr %11, i64 -1
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = icmp eq i8 %15, 92
  br i1 %16, label %17, label %18

17:                                               ; preds = %13, %7
  tail call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.23, ptr noundef nonnull %0, i32 noundef %10) #11
  unreachable

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %11, i64 1
  store i8 0, ptr %11, align 1, !tbaa !5
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %.not = icmp eq i8 %20, 0
  br i1 %.not, label %29, label %21

21:                                               ; preds = %18
  %22 = tail call ptr @__errno_location() #13
  store i32 0, ptr %22, align 4, !tbaa !8
  %23 = call i64 @strtol(ptr noundef nonnull %19, ptr noundef nonnull %3, i32 noundef 10) #10
  %24 = load ptr, ptr %3, align 8, !tbaa !10
  %25 = load i8, ptr %24, align 1, !tbaa !5
  %.not41 = icmp eq i8 %25, 0
  br i1 %.not41, label %26, label %28

26:                                               ; preds = %21
  %27 = load i32, ptr %22, align 4, !tbaa !8
  %.not42 = icmp eq i32 %27, 0
  br i1 %.not42, label %29, label %28

28:                                               ; preds = %26, %21
  tail call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.24, ptr noundef nonnull %19) #11
  unreachable

29:                                               ; preds = %18, %26
  %.033 = phi i64 [ %23, %26 ], [ 0, %18 ]
  %30 = call i32 @regcomp(ptr noundef nonnull %2, ptr noundef nonnull %8, i32 noundef 8) #10
  %.not43 = icmp eq i32 %30, 0
  br i1 %.not43, label %32, label %31

31:                                               ; preds = %29
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.25, ptr noundef nonnull %8) #11
  unreachable

32:                                               ; preds = %29
  %33 = load i8, ptr %0, align 1, !tbaa !5
  %34 = icmp eq i8 %33, 47
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = call ptr @newfile()
  br label %41

37:                                               ; preds = %32
  %38 = call ptr @my_tmpfile()
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.26) #11
  unreachable

41:                                               ; preds = %37, %35
  %.0 = phi ptr [ %36, %35 ], [ %38, %37 ]
  %42 = call ptr @csplit_getline()
  %cond49 = icmp eq ptr %42, null
  br i1 %cond49, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %41
  %43 = call i32 @fputs(ptr noundef nonnull %42, ptr noundef %.0)
  %44 = icmp eq i32 %43, -1
  br i1 %44, label %.loopexit, label %45

45:                                               ; preds = %.lr.ph.preheader
  %46 = call ptr @csplit_getline()
  %cond.peel = icmp eq ptr %46, null
  br i1 %cond.peel, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %45, %53
  %47 = phi ptr [ %54, %53 ], [ %46, %45 ]
  %48 = call i32 @fputs(ptr noundef nonnull %47, ptr noundef %.0)
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %.loopexit, label %50

50:                                               ; preds = %.lr.ph
  %51 = call i32 @regexec(ptr noundef nonnull %2, ptr noundef nonnull %47, i64 noundef 0, ptr noundef null, i32 noundef 0) #10
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %.loopexit, label %53

53:                                               ; preds = %50
  %54 = call ptr @csplit_getline()
  %cond = icmp eq ptr %54, null
  br i1 %cond, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %53, %45, %41
  call void (i32, ptr, ...) @errx(i32 noundef 1, ptr noundef nonnull @.str.27, ptr noundef nonnull %8) #11
  unreachable

.loopexit:                                        ; preds = %.lr.ph, %50, %.lr.ph.preheader
  %55 = icmp slt i64 %.033, 1
  br i1 %55, label %56, label %.preheader

.preheader:                                       ; preds = %.loopexit
  %.not53 = icmp eq i64 %.033, 1
  br i1 %.not53, label %.critedge, label %.lr.ph51

56:                                               ; preds = %.loopexit
  %57 = sub i64 1, %.033
  call void @toomuch(ptr noundef %.0, i64 noundef %57)
  %58 = load i64, ptr @truncofs, align 8, !tbaa !15
  br label %67

.lr.ph51:                                         ; preds = %.preheader, %60
  %.in = phi i64 [ %61, %60 ], [ %.033, %.preheader ]
  %59 = call ptr @csplit_getline()
  %.not46 = icmp eq ptr %59, null
  br i1 %.not46, label %.critedge, label %60

60:                                               ; preds = %.lr.ph51
  %61 = add nsw i64 %.in, -1
  %62 = call i32 @fputs(ptr noundef nonnull %59, ptr noundef %.0)
  %63 = icmp sgt i64 %.in, 2
  br i1 %63, label %.lr.ph51, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %.lr.ph51, %60, %.preheader
  call void @toomuch(ptr noundef null, i64 noundef 0)
  %64 = call i64 @ftello(ptr noundef %.0)
  %65 = call i32 @fclose(ptr noundef %.0)
  %.not47 = icmp eq i32 %65, 0
  br i1 %.not47, label %67, label %66

66:                                               ; preds = %.critedge
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.11, ptr noundef nonnull @currfile) #11
  unreachable

67:                                               ; preds = %.critedge, %56
  %.032 = phi i64 [ %58, %56 ], [ %64, %.critedge ]
  %68 = load i32, ptr @sflag, align 4, !tbaa !8
  %.not48 = icmp eq i32 %68, 0
  br i1 %.not48, label %69, label %74

69:                                               ; preds = %67
  %70 = load i8, ptr %0, align 1, !tbaa !5
  %71 = icmp eq i8 %70, 47
  br i1 %71, label %72, label %74

72:                                               ; preds = %69
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef %.032)
  br label %74

74:                                               ; preds = %72, %69, %67
  call void @regfree(ptr noundef nonnull %2) #10
  call void @free(ptr noundef %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #10
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @newfile() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @csplit_getline() local_unnamed_addr #0

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @ftello(ptr nocapture noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind uwtable
declare dso_local void @toomuch(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #7

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

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

declare void @regfree(ptr noundef) local_unnamed_addr #8

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

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 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 #3 = { mustprogress nofree nounwind willreturn "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 = { noreturn "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 = { 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 #6 = { mustprogress nofree nounwind willreturn 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: 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 #8 = { "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 = { 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 #10 = { nounwind }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind willreturn memory(none) }

!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 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !6, i64 0}
!17 = distinct !{!17, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass