; LLVM IR from artagnon/phoenixfs :: pack (unpack_entry)

; 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.packed_git = type { [4096 x i8], [4096 x i8], ptr, ptr, i64, i64, i32 }

@packroot = external hidden global %struct.packed_git, align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [59 x i8], align 1
@__PRETTY_FUNCTION__.unpack_entry = external hidden unnamed_addr constant [48 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

declare void @print_sha1(ptr noundef, ptr noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @unpack_entry(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [20 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca [40 x i8], align 16
  %10 = alloca [4096 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, 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 40, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4096, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  %19 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  call void @print_sha1(ptr noundef %19, ptr noundef %20)
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call i64 @find_pack_entry(ptr noundef %21)
  store i64 %22, ptr %7, align 8, !tbaa !9
  %23 = icmp ne i64 %22, 0
  br i1 %23, label %35, label %24

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %25 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %25, ptr %13, align 8, !tbaa !5
  %26 = load ptr, ptr %13, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %34

28:                                               ; preds = %24
  %29 = load ptr, ptr %13, align 8, !tbaa !5
  %30 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.4, i32 noundef 183, ptr noundef %30) #7
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = call i32 @fclose(ptr noundef %32)
  br label %34

34:                                               ; preds = %28, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %129

35:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %36 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %36, ptr %15, align 8, !tbaa !5
  %37 = load ptr, ptr %15, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %46

39:                                               ; preds = %35
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %42 = load i64, ptr %7, align 8, !tbaa !9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.5, i32 noundef 187, ptr noundef %41, i64 noundef %42) #7
  %44 = load ptr, ptr %15, align 8, !tbaa !5
  %45 = call i32 @fclose(ptr noundef %44)
  br label %46

46:                                               ; preds = %39, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %47 = load ptr, ptr getelementptr inbounds (%struct.packed_git, ptr @packroot, i32 0, i32 2), align 8, !tbaa !11
  %48 = load i64, ptr %7, align 8, !tbaa !9
  %49 = call i32 @fseek(ptr noundef %47, i64 noundef %48, i32 noundef 0)
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  call void (ptr, ...) @die(ptr noundef @.str.6)
  br label %52

52:                                               ; preds = %51, %46
  %53 = load ptr, ptr getelementptr inbounds (%struct.packed_git, ptr @packroot, i32 0, i32 2), align 8, !tbaa !11
  %54 = call i64 @fread(ptr noundef %6, i64 noundef 20, i64 noundef 1, ptr noundef %53)
  %55 = icmp ult i64 %54, 1
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  call void (ptr, ...) @die(ptr noundef @.str.7)
  br label %57

57:                                               ; preds = %56, %52
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds [20 x i8], ptr %6, i64 0, i64 0
  %60 = call i32 @memcmp(ptr noundef %58, ptr noundef %59, i64 noundef 20) #8
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  br label %64

63:                                               ; preds = %57
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 192, ptr noundef @__PRETTY_FUNCTION__.unpack_entry) #9
  unreachable

64:                                               ; preds = %62
  %65 = load ptr, ptr getelementptr inbounds (%struct.packed_git, ptr @packroot, i32 0, i32 2), align 8, !tbaa !11
  %66 = call i64 @fread(ptr noundef %12, i64 noundef 1, i64 noundef 1, ptr noundef %65)
  %67 = icmp ult i64 %66, 1
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  call void (ptr, ...) @die(ptr noundef @.str.10)
  br label %69

69:                                               ; preds = %68, %64
  %70 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %73 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %70, ptr noundef @.str.11, ptr noundef %71, ptr noundef %72) #7
  %74 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %75 = call noalias ptr @fopen(ptr noundef %74, ptr noundef @.str.12)
  store ptr %75, ptr %11, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %91, label %77

77:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %78 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %78, ptr %16, align 8, !tbaa !5
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = icmp ne ptr %79, null
  br i1 %80, label %81, label %87

81:                                               ; preds = %77
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  %83 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.13, i32 noundef 198, ptr noundef %83) #7
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = call i32 @fclose(ptr noundef %85)
  br label %87

87:                                               ; preds = %81, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %88 = call ptr @__errno_location() #10
  %89 = load i32, ptr %88, align 4, !tbaa !14
  %90 = sub nsw i32 0, %89
  store i32 %90, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %129

91:                                               ; preds = %69
  %92 = load i8, ptr %12, align 1, !tbaa !15, !range !17, !noundef !18
  %93 = trunc i8 %92 to i1
  br i1 %93, label %115, label %94

94:                                               ; preds = %91
  %95 = load ptr, ptr getelementptr inbounds (%struct.packed_git, ptr @packroot, i32 0, i32 2), align 8, !tbaa !11
  %96 = call i64 @fread(ptr noundef %8, i64 noundef 8, i64 noundef 1, ptr noundef %95)
  %97 = icmp ult i64 %96, 1
  br i1 %97, label %98, label %100

98:                                               ; preds = %94
  %99 = load i64, ptr %8, align 8, !tbaa !9
  call void (ptr, ...) @die(ptr noundef @.str.14, i64 noundef %99)
  br label %100

100:                                              ; preds = %98, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %101 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %101, ptr %17, align 8, !tbaa !5
  %102 = load ptr, ptr %17, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %110

104:                                              ; preds = %100
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.15, i32 noundef 204, ptr noundef %106) #7
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = call i32 @fclose(ptr noundef %108)
  br label %110

110:                                              ; preds = %104, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %111 = load ptr, ptr getelementptr inbounds (%struct.packed_git, ptr @packroot, i32 0, i32 2), align 8, !tbaa !11
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = load i64, ptr %8, align 8, !tbaa !9
  %114 = call i64 @buffer_copy_bytes(ptr noundef %111, ptr noundef %112, i64 noundef %113)
  br label %126

115:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %116 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %116, ptr %18, align 8, !tbaa !5
  %117 = load ptr, ptr %18, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %125

119:                                              ; preds = %115
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = getelementptr inbounds [40 x i8], ptr %9, i64 0, i64 0
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.16, i32 noundef 208, ptr noundef %121) #7
  %123 = load ptr, ptr %18, align 8, !tbaa !5
  %124 = call i32 @fclose(ptr noundef %123)
  br label %125

125:                                              ; preds = %119, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %126

126:                                              ; preds = %125, %110
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = call i32 @fclose(ptr noundef %127)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %129

129:                                              ; preds = %126, %87, %34
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 40, 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 20, ptr %6) #7
  %130 = load i32, ptr %3, align 4
  ret i32 %130
}

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

declare void @die(ptr noundef, ...) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

declare i64 @buffer_copy_bytes(ptr noundef, ptr noundef, i64 noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn nounwind }
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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8192}
!12 = !{!"packed_git", !7, i64 0, !7, i64 4096, !6, i64 8192, !6, i64 8200, !10, i64 8208, !10, i64 8216, !13, i64 8224}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}


; 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.packed_git = type { [4096 x i8], [4096 x i8], ptr, ptr, i64, i64, i32 }

@packroot = external hidden local_unnamed_addr global %struct.packed_git, align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [59 x i8], align 1
@__PRETTY_FUNCTION__.unpack_entry = external hidden unnamed_addr constant [48 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @find_pack_entry(ptr noundef) 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

declare void @print_sha1(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2147483647, -2147483648) i32 @unpack_entry(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [20 x i8], align 16
  %4 = alloca i64, align 8
  %5 = alloca [40 x i8], align 16
  %6 = alloca [4096 x i8], align 16
  %7 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #7
  call void @print_sha1(ptr noundef nonnull %5, ptr noundef %0) #7
  %8 = call i64 @find_pack_entry(ptr noundef %0)
  %.not = icmp eq i64 %8, 0
  %9 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not30 = icmp eq ptr %9, null
  br i1 %.not, label %10, label %14

10:                                               ; preds = %2
  br i1 %.not30, label %73, label %11

11:                                               ; preds = %10
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.4, i32 noundef 183, ptr noundef nonnull %5) #7
  %13 = call i32 @fclose(ptr noundef nonnull %9)
  br label %73

14:                                               ; preds = %2
  br i1 %.not30, label %18, label %15

15:                                               ; preds = %14
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.5, i32 noundef 187, ptr noundef nonnull %5, i64 noundef %8) #7
  %17 = call i32 @fclose(ptr noundef nonnull %9)
  br label %18

18:                                               ; preds = %15, %14
  %19 = load ptr, ptr getelementptr inbounds (i8, ptr @packroot, i64 8192), align 8, !tbaa !5
  %20 = call i32 @fseek(ptr noundef %19, i64 noundef %8, i32 noundef 0)
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  call void (ptr, ...) @die(ptr noundef nonnull @.str.6) #7
  br label %23

23:                                               ; preds = %22, %18
  %24 = load ptr, ptr getelementptr inbounds (i8, ptr @packroot, i64 8192), align 8, !tbaa !5
  %25 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 20, i64 noundef 1, ptr noundef %24)
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  call void (ptr, ...) @die(ptr noundef nonnull @.str.7) #7
  br label %28

28:                                               ; preds = %27, %23
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(20) %0, ptr noundef nonnull dereferenceable(20) %3, i64 20)
  %29 = icmp eq i32 %bcmp, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %28
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 192, ptr noundef nonnull @__PRETTY_FUNCTION__.unpack_entry) #8
  unreachable

31:                                               ; preds = %28
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @packroot, i64 8192), align 8, !tbaa !5
  %33 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 1, i64 noundef 1, ptr noundef %32)
  %34 = icmp eq i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  call void (ptr, ...) @die(ptr noundef nonnull @.str.10) #7
  br label %36

36:                                               ; preds = %35, %31
  %37 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %1, ptr noundef nonnull %5) #7
  %38 = call noalias ptr @fopen(ptr noundef nonnull %6, ptr noundef nonnull @.str.12)
  %.not32 = icmp eq ptr %38, null
  br i1 %.not32, label %39, label %48

39:                                               ; preds = %36
  %40 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not33 = icmp eq ptr %40, null
  br i1 %.not33, label %44, label %41

41:                                               ; preds = %39
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %40, ptr noundef nonnull @.str.13, i32 noundef 198, ptr noundef nonnull %6) #7
  %43 = call i32 @fclose(ptr noundef nonnull %40)
  br label %44

44:                                               ; preds = %41, %39
  %45 = tail call ptr @__errno_location() #9
  %46 = load i32, ptr %45, align 4, !tbaa !12
  %47 = sub nsw i32 0, %46
  br label %73

48:                                               ; preds = %36
  %49 = load i8, ptr %7, align 1, !tbaa !13, !range !15, !noundef !16
  %50 = trunc nuw i8 %49 to i1
  br i1 %50, label %66, label %51

51:                                               ; preds = %48
  %52 = load ptr, ptr getelementptr inbounds (i8, ptr @packroot, i64 8192), align 8, !tbaa !5
  %53 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 8, i64 noundef 1, ptr noundef %52)
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  %56 = load i64, ptr %4, align 8, !tbaa !17
  call void (ptr, ...) @die(ptr noundef nonnull @.str.14, i64 noundef %56) #7
  br label %57

57:                                               ; preds = %55, %51
  %58 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not34 = icmp eq ptr %58, null
  br i1 %.not34, label %62, label %59

59:                                               ; preds = %57
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %58, ptr noundef nonnull @.str.15, i32 noundef 204, ptr noundef nonnull %5) #7
  %61 = call i32 @fclose(ptr noundef nonnull %58)
  br label %62

62:                                               ; preds = %59, %57
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @packroot, i64 8192), align 8, !tbaa !5
  %64 = load i64, ptr %4, align 8, !tbaa !17
  %65 = call i64 @buffer_copy_bytes(ptr noundef %63, ptr noundef nonnull %38, i64 noundef %64) #7
  br label %71

66:                                               ; preds = %48
  %67 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %.not35 = icmp eq ptr %67, null
  br i1 %.not35, label %71, label %68

68:                                               ; preds = %66
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %67, ptr noundef nonnull @.str.16, i32 noundef 208, ptr noundef nonnull %5) #7
  %70 = call i32 @fclose(ptr noundef nonnull %67)
  br label %71

71:                                               ; preds = %66, %68, %62
  %72 = call i32 @fclose(ptr noundef nonnull %38)
  br label %73

73:                                               ; preds = %10, %11, %71, %44
  %.0 = phi i32 [ 0, %71 ], [ %47, %44 ], [ -1, %11 ], [ -1, %10 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

declare void @die(ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

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

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

declare i64 @buffer_copy_bytes(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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, !9, i64 8192}
!6 = !{!"packed_git", !7, i64 0, !7, i64 4096, !9, i64 8192, !9, i64 8200, !10, i64 8208, !10, i64 8216, !11, i64 8224}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass