; LLVM IR from n0bel/ESPrinkler :: espfs/mkespfsimage (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.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 global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [143 x i8], align 1
@stdin = external global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [15 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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @handleFile(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare void @perror(ptr noundef) #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @finishArchive() #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [1024 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca %struct.stat, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 144, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %77, %2
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %80

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds ptr, ptr %22, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call i32 @strcmp(ptr noundef %26, ptr noundef @.str.7) #8
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %44

29:                                               ; preds = %21
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = sub nsw i32 %31, 2
  %33 = icmp sge i32 %30, %32
  br i1 %33, label %34, label %44

34:                                               ; preds = %29
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds ptr, ptr %35, i64 %38
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 @atoi(ptr noundef %40) #8
  store i32 %41, ptr %14, align 4, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %7, align 4, !tbaa !5
  br label %76

44:                                               ; preds = %29, %21
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = call i32 @strcmp(ptr noundef %49, ptr noundef @.str.8) #8
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %74

52:                                               ; preds = %44
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 2
  %56 = icmp sge i32 %53, %55
  br i1 %56, label %57, label %74

57:                                               ; preds = %52
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %58, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call i32 @atoi(ptr noundef %63) #8
  store i32 %64, ptr %15, align 4, !tbaa !5
  %65 = load i32, ptr %15, align 4, !tbaa !5
  %66 = icmp slt i32 %65, 1
  br i1 %66, label %70, label %67

67:                                               ; preds = %57
  %68 = load i32, ptr %15, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 9
  br i1 %69, label %70, label %71

70:                                               ; preds = %67, %57
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %70, %67
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %75

74:                                               ; preds = %52, %44
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %74, %71
  br label %76

76:                                               ; preds = %75, %34
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %17, !llvm.loop !11

80:                                               ; preds = %17
  %81 = load i32, ptr %13, align 4, !tbaa !5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %102

83:                                               ; preds = %80
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = getelementptr inbounds ptr, ptr %85, i64 0
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.9, ptr noundef %87) #7
  %89 = load ptr, ptr @stderr, align 8, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %90, i64 0
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.10, ptr noundef %92) #7
  %94 = load ptr, ptr @stderr, align 8, !tbaa !9
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.11) #7
  %96 = load ptr, ptr @stderr, align 8, !tbaa !9
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.12) #7
  %98 = load ptr, ptr @stderr, align 8, !tbaa !9
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.13) #7
  %100 = load ptr, ptr @stderr, align 8, !tbaa !9
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.14) #7
  call void @exit(i32 noundef 0) #9
  unreachable

102:                                              ; preds = %80
  br label %103

103:                                              ; preds = %167, %102
  %104 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %105 = load ptr, ptr @stdin, align 8, !tbaa !9
  %106 = call ptr @fgets(ptr noundef %104, i32 noundef 1024, ptr noundef %105)
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %168

108:                                              ; preds = %103
  %109 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %110 = call i64 @strlen(ptr noundef %109) #8
  %111 = sub i64 %110, 1
  %112 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 %111
  store i8 0, ptr %112, align 1, !tbaa !13
  %113 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %114 = call i32 @stat(ptr noundef %113, ptr noundef %10) #7
  store i32 %114, ptr %11, align 4, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %161

117:                                              ; preds = %108
  %118 = getelementptr inbounds %struct.stat, ptr %10, i32 0, i32 3
  %119 = load i32, ptr %118, align 8, !tbaa !14
  %120 = and i32 %119, 61440
  %121 = icmp eq i32 %120, 32768
  br i1 %121, label %122, label %161

122:                                              ; preds = %117
  %123 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  store ptr %123, ptr %9, align 8, !tbaa !9
  %124 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %125 = load i8, ptr %124, align 16, !tbaa !13
  %126 = sext i8 %125 to i32
  %127 = icmp eq i32 %126, 46
  br i1 %127, label %128, label %131

128:                                              ; preds = %122
  %129 = load ptr, ptr %9, align 8, !tbaa !9
  %130 = getelementptr inbounds i8, ptr %129, i32 1
  store ptr %130, ptr %9, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %128, %122
  %132 = load ptr, ptr %9, align 8, !tbaa !9
  %133 = getelementptr inbounds i8, ptr %132, i64 0
  %134 = load i8, ptr %133, align 1, !tbaa !13
  %135 = sext i8 %134 to i32
  %136 = icmp eq i32 %135, 47
  br i1 %136, label %137, label %140

137:                                              ; preds = %131
  %138 = load ptr, ptr %9, align 8, !tbaa !9
  %139 = getelementptr inbounds i8, ptr %138, i32 1
  store ptr %139, ptr %9, align 8, !tbaa !9
  br label %140

140:                                              ; preds = %137, %131
  %141 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %142 = call i32 (ptr, i32, ...) @open(ptr noundef %141, i32 noundef 0)
  store i32 %142, ptr %6, align 4, !tbaa !5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = icmp sgt i32 %143, 0
  br i1 %144, label %145, label %158

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr @.str.6, ptr %16, align 8, !tbaa !9
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = load ptr, ptr %9, align 8, !tbaa !9
  %148 = load i32, ptr %14, align 4, !tbaa !5
  %149 = load i32, ptr %15, align 4, !tbaa !5
  %150 = call i32 @handleFile(i32 noundef %146, ptr noundef %147, i32 noundef %148, i32 noundef %149, ptr noundef %16)
  store i32 %150, ptr %12, align 4, !tbaa !5
  %151 = load ptr, ptr @stderr, align 8, !tbaa !9
  %152 = load ptr, ptr %9, align 8, !tbaa !9
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load ptr, ptr %16, align 8, !tbaa !9
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.15, ptr noundef %152, i32 noundef %153, ptr noundef %154) #7
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = call i32 @close(i32 noundef %156)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %160

158:                                              ; preds = %140
  %159 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  call void @perror(ptr noundef %159)
  br label %160

160:                                              ; preds = %158, %145
  br label %167

161:                                              ; preds = %117, %108
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %166

164:                                              ; preds = %161
  %165 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  call void @perror(ptr noundef %165)
  br label %166

166:                                              ; preds = %164, %161
  br label %167

167:                                              ; preds = %166, %160
  br label %103, !llvm.loop !18

168:                                              ; preds = %103
  call void @finishArchive()
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  ret i32 0
}

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #6

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

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

declare i32 @open(ptr noundef, i32 noundef, ...) #2

declare i32 @close(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn 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 #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 = { inlinehint nounwind willreturn memory(read) 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(read) }
attributes #9 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 24}
!15 = !{!"stat", !16, i64 0, !16, i64 8, !16, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !17, i64 72, !17, i64 88, !17, i64 104, !7, i64 120}
!16 = !{!"long", !7, i64 0}
!17 = !{!"timespec", !16, i64 0, !16, i64 8}
!18 = distinct !{!18, !12}


; 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.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [143 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [15 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @handleFile(i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @finishArchive() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = alloca [1024 x i8], align 16
  %4 = alloca %struct.stat, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #8
  %6 = icmp sgt i32 %0, 1
  br i1 %6, label %.lr.ph.outer, label %.preheader

.lr.ph.outer:                                     ; preds = %2, %32
  %.056.ph = phi i32 [ %.1, %32 ], [ -1, %2 ]
  %.03555.ph = phi i32 [ %.136, %32 ], [ 0, %2 ]
  %.03754.ph = phi i32 [ %.2, %32 ], [ 0, %2 ]
  %.03953.ph = phi i32 [ %33, %32 ], [ 1, %2 ]
  %7 = sext i32 %.03953.ph to i64
  %8 = getelementptr inbounds ptr, ptr %1, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.7) #9
  %.not62.peel = icmp eq i32 %10, 0
  br i1 %.not62.peel, label %.loopexit, label %11

11:                                               ; preds = %.lr.ph.outer
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) @.str.8) #9
  %.not63.peel = icmp eq i32 %12, 0
  %13 = add nsw i32 %.03953.ph, 1
  br i1 %.not63.peel, label %.loopexit94, label %.thread.peel

.thread.peel:                                     ; preds = %11
  %14 = icmp slt i32 %13, %0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread76

.lr.ph:                                           ; preds = %.thread.peel, %.thread
  %.03953 = phi i32 [ %26, %.thread ], [ %13, %.thread.peel ]
  %15 = sext i32 %.03953 to i64
  %16 = getelementptr inbounds ptr, ptr %1, i64 %15
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.7) #9
  %.not62 = icmp eq i32 %18, 0
  br i1 %.not62, label %.loopexit, label %24

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph.outer
  %.03754.lcssa = phi i32 [ %.03754.ph, %.lr.ph.outer ], [ 1, %.lr.ph ]
  %.03953.lcssa = phi i32 [ %.03953.ph, %.lr.ph.outer ], [ %.03953, %.lr.ph ]
  %19 = add nsw i32 %.03953.lcssa, 1
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds ptr, ptr %1, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = tail call i32 @atoi(ptr nocapture noundef %22) #9
  br label %32

24:                                               ; preds = %.lr.ph
  %25 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.8) #9
  %.not63 = icmp eq i32 %25, 0
  %26 = add nsw i32 %.03953, 1
  br i1 %.not63, label %.loopexit94, label %.thread

.loopexit94:                                      ; preds = %24, %11
  %.lcssa = phi i32 [ %13, %11 ], [ %26, %24 ]
  %.03754.lcssa90 = phi i32 [ %.03754.ph, %11 ], [ 1, %24 ]
  %27 = sext i32 %.lcssa to i64
  %28 = getelementptr inbounds ptr, ptr %1, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = tail call i32 @atoi(ptr nocapture noundef %29) #9
  %31 = add i32 %30, -10
  %or.cond = icmp ult i32 %31, -9
  %spec.select = select i1 %or.cond, i32 1, i32 %.03754.lcssa90
  br label %32

32:                                               ; preds = %.loopexit, %.loopexit94
  %.140 = phi i32 [ %19, %.loopexit ], [ %.lcssa, %.loopexit94 ]
  %.2 = phi i32 [ %.03754.lcssa, %.loopexit ], [ %spec.select, %.loopexit94 ]
  %.136 = phi i32 [ %23, %.loopexit ], [ %.03555.ph, %.loopexit94 ]
  %.1 = phi i32 [ %.056.ph, %.loopexit ], [ %30, %.loopexit94 ]
  %33 = add nsw i32 %.140, 1
  %34 = icmp slt i32 %33, %0
  br i1 %34, label %.lr.ph.outer, label %._crit_edge, !llvm.loop !9

.thread:                                          ; preds = %24
  %35 = icmp slt i32 %26, %0
  br i1 %35, label %.lr.ph, label %._crit_edge.thread76, !llvm.loop !11

._crit_edge:                                      ; preds = %32
  %36 = icmp eq i32 %.2, 0
  br i1 %36, label %.preheader, label %._crit_edge.thread76

.preheader:                                       ; preds = %2, %._crit_edge
  %.0.lcssa68 = phi i32 [ %.1, %._crit_edge ], [ -1, %2 ]
  %.035.lcssa67 = phi i32 [ %.136, %._crit_edge ], [ 0, %2 ]
  %37 = load ptr, ptr @stdin, align 8, !tbaa !5
  %38 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef %37)
  %.not4559 = icmp eq ptr %38, null
  br i1 %.not4559, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader
  %39 = getelementptr inbounds i8, ptr %4, i64 24
  %40 = getelementptr inbounds i8, ptr %3, i64 1
  %.sroa.gep = getelementptr inbounds i8, ptr %3, i64 2
  br label %55

._crit_edge.thread76:                             ; preds = %.thread, %.thread.peel, %._crit_edge
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.9, ptr noundef %42) #10
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.10, ptr noundef %45) #10
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.11) #10
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.12) #10
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.13) #10
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.14) #10
  tail call void @exit(i32 noundef 0) #11
  unreachable

55:                                               ; preds = %.lr.ph60, %79
  %56 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #9
  %57 = add i64 %56, -1
  %58 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 %57
  store i8 0, ptr %58, align 1, !tbaa !13
  %59 = call i32 @stat(ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  %cond = icmp eq i32 %59, 0
  br i1 %cond, label %60, label %78

60:                                               ; preds = %55
  %61 = load i32, ptr %39, align 8, !tbaa !14
  %62 = and i32 %61, 61440
  %63 = icmp eq i32 %62, 32768
  br i1 %63, label %64, label %79

64:                                               ; preds = %60
  %65 = load i8, ptr %3, align 16, !tbaa !13
  %66 = icmp eq i8 %65, 46
  %spec.select51 = select i1 %66, ptr %40, ptr %3
  %67 = load i8, ptr %spec.select51, align 1, !tbaa !13
  %68 = call i32 (ptr, i32, ...) @open(ptr noundef nonnull %3, i32 noundef 0) #8
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %64
  %71 = icmp eq i8 %67, 47
  %spec.select51.sroa.sel = select i1 %66, ptr %.sroa.gep, ptr %40
  %.142 = select i1 %71, ptr %spec.select51.sroa.sel, ptr %spec.select51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store ptr @.str.6, ptr %5, align 8, !tbaa !5
  %72 = call i32 @handleFile(i32 noundef %68, ptr noundef nonnull %.142, i32 noundef %.035.lcssa67, i32 noundef %.0.lcssa68, ptr noundef nonnull %5)
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.15, ptr noundef nonnull %.142, i32 noundef %72, ptr noundef %74) #10
  %76 = call i32 @close(i32 noundef %68) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %79

77:                                               ; preds = %64
  call void @perror(ptr noundef nonnull %3) #12
  br label %79

78:                                               ; preds = %55
  call void @perror(ptr noundef nonnull %3) #12
  br label %79

79:                                               ; preds = %60, %78, %70, %77
  %80 = load ptr, ptr @stdin, align 8, !tbaa !5
  %81 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 1024, ptr noundef %80)
  %.not45 = icmp eq ptr %81, null
  br i1 %.not45, label %._crit_edge61, label %55, !llvm.loop !19

._crit_edge61:                                    ; preds = %79, %.preheader
  call void @finishArchive()
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #8
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #6

declare i32 @close(i32 noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { noreturn 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 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 #5 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { nofree "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 = { "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 willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { noreturn nounwind }
attributes #12 = { cold }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !17, i64 24}
!15 = !{!"stat", !16, i64 0, !16, i64 8, !16, i64 16, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !18, i64 72, !18, i64 88, !18, i64 104, !7, i64 120}
!16 = !{!"long", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"timespec", !16, i64 0, !16, i64 8}
!19 = distinct !{!19, !10}


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