; LLVM IR from kmxz/overlayfs-tools :: logic (regular_file_identical)

; 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.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 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: nounwind willreturn memory(none)
declare ptr @__errno_location() #1

; 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 @is_redirect(ptr noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @regular_file_identical(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %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 i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.stat, ptr %23, i32 0, i32 9
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.stat, ptr %26, i32 0, i32 9
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = icmp slt i64 %25, %28
  br i1 %29, label %30, label %34

30:                                               ; preds = %5
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.stat, ptr %31, i32 0, i32 9
  %33 = load i64, ptr %32, align 8, !tbaa !9
  br label %38

34:                                               ; preds = %5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.stat, ptr %35, i32 0, i32 9
  %37 = load i64, ptr %36, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %34, %30
  %39 = phi i64 [ %33, %30 ], [ %37, %34 ]
  store i64 %39, ptr %12, align 8, !tbaa !14
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.stat, ptr %40, i32 0, i32 8
  %42 = load i64, ptr %41, align 8, !tbaa !15
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.stat, ptr %43, i32 0, i32 8
  %45 = load i64, ptr %44, align 8, !tbaa !15
  %46 = icmp ne i64 %42, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %38
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 0, ptr %48, align 1, !tbaa !16
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %160

49:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = call i32 @is_metacopy(ptr noundef %50, ptr noundef %14)
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %159

54:                                               ; preds = %49
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call i32 @is_redirect(ptr noundef %55, ptr noundef %15)
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %159

59:                                               ; preds = %54
  %60 = load i8, ptr %14, align 1, !tbaa !16, !range !18, !noundef !19
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %68

62:                                               ; preds = %59
  %63 = load i8, ptr %15, align 1, !tbaa !16, !range !18, !noundef !19
  %64 = trunc i8 %63 to i1
  %65 = xor i1 %64, true
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = zext i1 %65 to i8
  store i8 %67, ptr %66, align 1, !tbaa !16
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %159

68:                                               ; preds = %59
  %69 = load i64, ptr %12, align 8, !tbaa !14
  %70 = call ptr @llvm.stacksave.p0()
  store ptr %70, ptr %16, align 8
  %71 = alloca i8, i64 %69, align 16
  store i64 %69, ptr %17, align 8
  %72 = load i64, ptr %12, align 8, !tbaa !14
  %73 = alloca i8, i64 %72, align 16
  store i64 %72, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call i32 (ptr, i32, ...) @open(ptr noundef %74, i32 noundef 0)
  store i32 %75, ptr %19, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = call i32 (ptr, i32, ...) @open(ptr noundef %76, i32 noundef 0)
  store i32 %77, ptr %20, align 4, !tbaa !20
  %78 = load i32, ptr %19, align 4, !tbaa !20
  %79 = icmp slt i32 %78, 0
  br i1 %79, label %80, label %87

80:                                               ; preds = %68
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = call ptr @__errno_location() #8
  %84 = load i32, ptr %83, align 4, !tbaa !20
  %85 = call ptr @strerror(i32 noundef %84) #7
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef @.str.13, ptr noundef %82, ptr noundef %85) #7
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %157

87:                                               ; preds = %68
  %88 = load i32, ptr %20, align 4, !tbaa !20
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %90, label %97

90:                                               ; preds = %87
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = call ptr @__errno_location() #8
  %94 = load i32, ptr %93, align 4, !tbaa !20
  %95 = call ptr @strerror(i32 noundef %94) #7
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.13, ptr noundef %92, ptr noundef %95) #7
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %157

97:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  br label %98

98:                                               ; preds = %143, %97
  %99 = load i32, ptr %19, align 4, !tbaa !20
  %100 = load i64, ptr %12, align 8, !tbaa !14
  %101 = trunc i64 %100 to i32
  %102 = call i32 @read_chunk(i32 noundef %99, ptr noundef %71, i32 noundef %101)
  %103 = sext i32 %102 to i64
  store i64 %103, ptr %21, align 8, !tbaa !14
  %104 = load i32, ptr %20, align 4, !tbaa !20
  %105 = load i64, ptr %12, align 8, !tbaa !14
  %106 = trunc i64 %105 to i32
  %107 = call i32 @read_chunk(i32 noundef %104, ptr noundef %73, i32 noundef %106)
  %108 = sext i32 %107 to i64
  store i64 %108, ptr %22, align 8, !tbaa !14
  %109 = load i64, ptr %21, align 8, !tbaa !14
  %110 = icmp slt i64 %109, 0
  br i1 %110, label %111, label %115

111:                                              ; preds = %98
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.14, ptr noundef %113) #7
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

115:                                              ; preds = %98
  %116 = load i64, ptr %22, align 8, !tbaa !14
  %117 = icmp slt i64 %116, 0
  br i1 %117, label %118, label %122

118:                                              ; preds = %115
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.14, ptr noundef %120) #7
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

122:                                              ; preds = %115
  %123 = load i64, ptr %22, align 8, !tbaa !14
  %124 = load i64, ptr %21, align 8, !tbaa !14
  %125 = icmp ne i64 %123, %124
  br i1 %125, label %126, label %130

126:                                              ; preds = %122
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.15, ptr noundef %128) #7
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

130:                                              ; preds = %122
  %131 = load i64, ptr %22, align 8, !tbaa !14
  %132 = call i32 @memcmp(ptr noundef %71, ptr noundef %73, i64 noundef %131) #9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %130
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 0, ptr %135, align 1, !tbaa !16
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

136:                                              ; preds = %130
  br label %137

137:                                              ; preds = %136
  %138 = load i64, ptr %21, align 8, !tbaa !14
  %139 = icmp ne i64 %138, 0
  br i1 %139, label %143, label %140

140:                                              ; preds = %137
  %141 = load i64, ptr %22, align 8, !tbaa !14
  %142 = icmp ne i64 %141, 0
  br label %143

143:                                              ; preds = %140, %137
  %144 = phi i1 [ true, %137 ], [ %142, %140 ]
  br i1 %144, label %98, label %145, !llvm.loop !21

145:                                              ; preds = %143
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  store i8 1, ptr %146, align 1, !tbaa !16
  %147 = load i32, ptr %19, align 4, !tbaa !20
  %148 = call i32 @close(i32 noundef %147)
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %154, label %150

150:                                              ; preds = %145
  %151 = load i32, ptr %20, align 4, !tbaa !20
  %152 = call i32 @close(i32 noundef %151)
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %150, %145
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

155:                                              ; preds = %150
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %156

156:                                              ; preds = %155, %154, %134, %126, %118, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %157

157:                                              ; preds = %156, %90, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %158 = load ptr, ptr %16, align 8
  call void @llvm.stackrestore.p0(ptr %158)
  br label %159

159:                                              ; preds = %157, %62, %58, %53
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  br label %160

160:                                              ; preds = %159, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %161 = load i32, ptr %6, align 4
  ret i32 %161
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

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

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

declare i32 @close(i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 nosync nounwind willreturn }
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 = { 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, !11, i64 56}
!10 = !{!"stat", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !13, i64 88, !13, i64 104, !7, i64 120}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"timespec", !11, i64 0, !11, i64 8}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 48}
!16 = !{!17, !17, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!12, !12, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 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 nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() 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: nounwind uwtable
declare dso_local i32 @is_redirect(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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @regular_file_identical(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #2 {
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = getelementptr inbounds i8, ptr %1, i64 56
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %3, i64 56
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %. = tail call i64 @llvm.smin.i64(i64 %9, i64 %11)
  %12 = getelementptr inbounds i8, ptr %1, i64 48
  %13 = load i64, ptr %12, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %3, i64 48
  %15 = load i64, ptr %14, align 8, !tbaa !12
  %.not = icmp eq i64 %13, %15
  br i1 %.not, label %17, label %16

16:                                               ; preds = %5
  store i8 0, ptr %4, align 1, !tbaa !13
  br label %77

17:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #10
  %18 = call i32 @is_metacopy(ptr noundef %2, ptr noundef nonnull %6)
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %76, label %20

20:                                               ; preds = %17
  %21 = call i32 @is_redirect(ptr noundef %2, ptr noundef nonnull %7)
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %76, label %23

23:                                               ; preds = %20
  %24 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %25 = trunc nuw i8 %24 to i1
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %28 = xor i8 %27, 1
  store i8 %28, ptr %4, align 1, !tbaa !13
  br label %76

29:                                               ; preds = %23
  %30 = call ptr @llvm.stacksave.p0()
  %31 = alloca i8, i64 %., align 16
  %32 = alloca i8, i64 %., align 16
  %33 = call i32 (ptr, i32, ...) @open(ptr noundef %0, i32 noundef 0) #10
  %34 = call i32 (ptr, i32, ...) @open(ptr noundef %2, i32 noundef 0) #10
  %35 = icmp slt i32 %33, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %29
  %37 = load ptr, ptr @stderr, align 8, !tbaa !17
  %38 = tail call ptr @__errno_location() #11
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %40 = call ptr @strerror(i32 noundef %39) #10
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.13, ptr noundef %0, ptr noundef %40) #12
  br label %75

42:                                               ; preds = %29
  %43 = icmp slt i32 %34, 0
  br i1 %43, label %45, label %.preheader

.preheader:                                       ; preds = %42
  %44 = trunc i64 %. to i32
  br label %51

45:                                               ; preds = %42
  %46 = load ptr, ptr @stderr, align 8, !tbaa !17
  %47 = tail call ptr @__errno_location() #11
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = call ptr @strerror(i32 noundef %48) #10
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.13, ptr noundef %2, ptr noundef %49) #12
  br label %75

51:                                               ; preds = %.preheader, %70
  %52 = call i32 @read_chunk(i32 noundef %33, ptr noundef nonnull %31, i32 noundef %44)
  %53 = call i32 @read_chunk(i32 noundef %34, ptr noundef nonnull %32, i32 noundef %44)
  %54 = sext i32 %53 to i64
  %55 = icmp slt i32 %52, 0
  br i1 %55, label %56, label %59

56:                                               ; preds = %51
  %57 = load ptr, ptr @stderr, align 8, !tbaa !17
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.14, ptr noundef %0) #12
  br label %75

59:                                               ; preds = %51
  %60 = icmp slt i32 %53, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %59
  %62 = load ptr, ptr @stderr, align 8, !tbaa !17
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.14, ptr noundef %2) #12
  br label %75

64:                                               ; preds = %59
  %.not43 = icmp eq i32 %53, %52
  br i1 %.not43, label %68, label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr @stderr, align 8, !tbaa !17
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.15, ptr noundef %2) #12
  br label %75

68:                                               ; preds = %64
  %bcmp = call i32 @bcmp(ptr nonnull %31, ptr nonnull %32, i64 %54)
  %.not44 = icmp eq i32 %bcmp, 0
  br i1 %.not44, label %70, label %69

69:                                               ; preds = %68
  store i8 0, ptr %4, align 1, !tbaa !13
  br label %75

70:                                               ; preds = %68
  %.not47 = icmp eq i32 %52, 0
  br i1 %.not47, label %71, label %51, !llvm.loop !20

71:                                               ; preds = %70
  store i8 1, ptr %4, align 1, !tbaa !13
  %72 = call i32 @close(i32 noundef %33) #10
  %.not45 = icmp eq i32 %72, 0
  br i1 %.not45, label %73, label %75

73:                                               ; preds = %71
  %74 = call i32 @close(i32 noundef %34) #10
  %.not46 = icmp ne i32 %74, 0
  %spec.select = sext i1 %.not46 to i32
  br label %75

75:                                               ; preds = %73, %56, %61, %65, %69, %71, %45, %36
  %.1 = phi i32 [ -1, %36 ], [ -1, %45 ], [ -1, %56 ], [ -1, %61 ], [ -1, %65 ], [ 0, %69 ], [ -1, %71 ], [ %spec.select, %73 ]
  call void @llvm.stackrestore.p0(ptr %30)
  br label %76

76:                                               ; preds = %20, %17, %75, %26
  %.2 = phi i32 [ 0, %26 ], [ %.1, %75 ], [ -1, %17 ], [ -1, %20 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #10
  br label %77

77:                                               ; preds = %76, %16
  %.3 = phi i32 [ 0, %16 ], [ %.2, %76 ]
  ret i32 %.3
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #9

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


; Effective O3 passes: ConstraintEliminationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopInstSimplifyPass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass