; LLVM IR from holzschu/ios_system :: libarchive/libarchive/examples (tarfilter)

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

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@stderr = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [8192 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = 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 8192, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %13 = call ptr @archive_read_new()
  store ptr %13, ptr %10, align 8, !tbaa !9
  %14 = load ptr, ptr %10, align 8, !tbaa !9
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  call void (ptr, ...) @die(ptr noundef @.str)
  br label %17

17:                                               ; preds = %16, %2
  %18 = load ptr, ptr %10, align 8, !tbaa !9
  %19 = call i32 @archive_read_support_compression_all(ptr noundef %18)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  call void (ptr, ...) @die(ptr noundef @.str.1)
  br label %22

22:                                               ; preds = %21, %17
  %23 = load ptr, ptr %10, align 8, !tbaa !9
  %24 = call i32 @archive_read_support_format_all(ptr noundef %23)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  call void (ptr, ...) @die(ptr noundef @.str.2)
  br label %27

27:                                               ; preds = %26, %22
  %28 = load ptr, ptr %10, align 8, !tbaa !9
  %29 = call i32 @archive_read_open_fd(ptr noundef %28, i32 noundef 0, i64 noundef 10240)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  call void (ptr, ...) @die(ptr noundef @.str.3)
  br label %32

32:                                               ; preds = %31, %27
  %33 = call ptr @archive_write_new()
  store ptr %33, ptr %11, align 8, !tbaa !9
  %34 = load ptr, ptr %11, align 8, !tbaa !9
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  call void (ptr, ...) @die(ptr noundef @.str.4)
  br label %37

37:                                               ; preds = %36, %32
  %38 = load ptr, ptr %11, align 8, !tbaa !9
  %39 = call i32 @archive_write_set_compression_none(ptr noundef %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  call void (ptr, ...) @die(ptr noundef @.str.5)
  br label %42

42:                                               ; preds = %41, %37
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = call i32 @archive_write_set_format_ustar(ptr noundef %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %47

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

47:                                               ; preds = %46, %42
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = call i32 @archive_write_open_fd(ptr noundef %48, i32 noundef 1)
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

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

52:                                               ; preds = %51, %47
  br label %53

53:                                               ; preds = %113, %66, %52
  %54 = load ptr, ptr %10, align 8, !tbaa !9
  %55 = call i32 @archive_read_next_header(ptr noundef %54, ptr noundef %12)
  store i32 %55, ptr %8, align 4, !tbaa !5
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %116

57:                                               ; preds = %53
  %58 = load ptr, ptr @stderr, align 8, !tbaa !9
  %59 = load ptr, ptr %12, align 8, !tbaa !9
  %60 = call ptr @archive_entry_pathname(ptr noundef %59)
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.8, ptr noundef %60) #4
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = call i32 @archive_entry_mode(ptr noundef %62)
  %64 = and i32 %63, 61440
  %65 = icmp eq i32 %64, 32768
  br i1 %65, label %69, label %66

66:                                               ; preds = %57
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.9) #4
  br label %53, !llvm.loop !11

69:                                               ; preds = %57
  %70 = load ptr, ptr %12, align 8, !tbaa !9
  call void @archive_entry_set_uid(ptr noundef %70, i32 noundef 0)
  %71 = load ptr, ptr %12, align 8, !tbaa !9
  call void @archive_entry_set_uname(ptr noundef %71, ptr noundef @.str.10)
  %72 = load ptr, ptr %12, align 8, !tbaa !9
  call void @archive_entry_set_gid(ptr noundef %72, i32 noundef 0)
  %73 = load ptr, ptr %12, align 8, !tbaa !9
  call void @archive_entry_set_gname(ptr noundef %73, ptr noundef @.str.11)
  %74 = load ptr, ptr %12, align 8, !tbaa !9
  %75 = call i32 @archive_entry_mode(ptr noundef %74)
  store i32 %75, ptr %9, align 4, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !9
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = and i32 %77, -4096
  %79 = or i32 %78, 484
  call void @archive_entry_set_mode(ptr noundef %76, i32 noundef %79)
  %80 = load ptr, ptr %11, align 8, !tbaa !9
  %81 = load ptr, ptr %12, align 8, !tbaa !9
  %82 = call i32 @archive_write_header(ptr noundef %80, ptr noundef %81)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %69
  call void (ptr, ...) @die(ptr noundef @.str.12)
  br label %85

85:                                               ; preds = %84, %69
  %86 = load ptr, ptr %12, align 8, !tbaa !9
  %87 = call i64 @archive_entry_size(ptr noundef %86)
  %88 = icmp sgt i64 %87, 0
  br i1 %88, label %89, label %113

89:                                               ; preds = %85
  %90 = load ptr, ptr %10, align 8, !tbaa !9
  %91 = getelementptr inbounds [8192 x i8], ptr %6, i64 0, i64 0
  %92 = call i64 @archive_read_data(ptr noundef %90, ptr noundef %91, i64 noundef 8192)
  store i64 %92, ptr %7, align 8, !tbaa !13
  br label %93

93:                                               ; preds = %104, %89
  %94 = load i64, ptr %7, align 8, !tbaa !13
  %95 = icmp sgt i64 %94, 0
  br i1 %95, label %96, label %108

96:                                               ; preds = %93
  %97 = load ptr, ptr %11, align 8, !tbaa !9
  %98 = getelementptr inbounds [8192 x i8], ptr %6, i64 0, i64 0
  %99 = load i64, ptr %7, align 8, !tbaa !13
  %100 = call i64 @archive_write_data(ptr noundef %97, ptr noundef %98, i64 noundef %99)
  %101 = load i64, ptr %7, align 8, !tbaa !13
  %102 = icmp ne i64 %100, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %96
  call void (ptr, ...) @die(ptr noundef @.str.12)
  br label %104

104:                                              ; preds = %103, %96
  %105 = load ptr, ptr %10, align 8, !tbaa !9
  %106 = getelementptr inbounds [8192 x i8], ptr %6, i64 0, i64 0
  %107 = call i64 @archive_read_data(ptr noundef %105, ptr noundef %106, i64 noundef 8192)
  store i64 %107, ptr %7, align 8, !tbaa !13
  br label %93, !llvm.loop !15

108:                                              ; preds = %93
  %109 = load i64, ptr %7, align 8, !tbaa !13
  %110 = icmp slt i64 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  call void (ptr, ...) @die(ptr noundef @.str.13)
  br label %112

112:                                              ; preds = %111, %108
  br label %113

113:                                              ; preds = %112, %85
  %114 = load ptr, ptr @stderr, align 8, !tbaa !9
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.14) #4
  br label %53, !llvm.loop !11

116:                                              ; preds = %53
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 1
  br i1 %118, label %119, label %120

119:                                              ; preds = %116
  call void (ptr, ...) @die(ptr noundef @.str.15)
  br label %120

120:                                              ; preds = %119, %116
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  %122 = call i32 @archive_read_finish(ptr noundef %121)
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  call void (ptr, ...) @die(ptr noundef @.str.16)
  br label %125

125:                                              ; preds = %124, %120
  %126 = load ptr, ptr %11, align 8, !tbaa !9
  %127 = call i32 @archive_write_finish(ptr noundef %126)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %130

129:                                              ; preds = %125
  call void (ptr, ...) @die(ptr noundef @.str.17)
  br label %130

130:                                              ; preds = %129, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8192, ptr %6) #4
  ret i32 0
}

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

declare ptr @archive_read_new() #2

; Function Attrs: nounwind uwtable
declare hidden void @die(ptr noundef, ...) #0

declare i32 @archive_read_support_compression_all(ptr noundef) #2

declare i32 @archive_read_support_format_all(ptr noundef) #2

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

declare ptr @archive_write_new() #2

declare i32 @archive_write_set_compression_none(ptr noundef) #2

declare i32 @archive_write_set_format_ustar(ptr noundef) #2

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

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

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

declare ptr @archive_entry_pathname(ptr noundef) #2

declare i32 @archive_entry_mode(ptr noundef) #2

declare void @archive_entry_set_uid(ptr noundef, i32 noundef) #2

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

declare void @archive_entry_set_gid(ptr noundef, i32 noundef) #2

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

declare void @archive_entry_set_mode(ptr noundef, i32 noundef) #2

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

declare i64 @archive_entry_size(ptr noundef) #2

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

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

declare i32 @archive_read_finish(ptr noundef) #2

declare i32 @archive_write_finish(ptr noundef) #2

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

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 }

!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 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !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"

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [8192 x i8], align 16
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %5 = tail call ptr @archive_read_new() #4
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %2
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str)
  br label %8

8:                                                ; preds = %7, %2
  %9 = tail call i32 @archive_read_support_compression_all(ptr noundef %5) #4
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %11, label %10

10:                                               ; preds = %8
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.1)
  br label %11

11:                                               ; preds = %10, %8
  %12 = tail call i32 @archive_read_support_format_all(ptr noundef %5) #4
  %.not21 = icmp eq i32 %12, 0
  br i1 %.not21, label %14, label %13

13:                                               ; preds = %11
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.2)
  br label %14

14:                                               ; preds = %13, %11
  %15 = tail call i32 @archive_read_open_fd(ptr noundef %5, i32 noundef 0, i64 noundef 10240) #4
  %.not22 = icmp eq i32 %15, 0
  br i1 %.not22, label %17, label %16

16:                                               ; preds = %14
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.3)
  br label %17

17:                                               ; preds = %16, %14
  %18 = tail call ptr @archive_write_new() #4
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.4)
  br label %21

21:                                               ; preds = %20, %17
  %22 = tail call i32 @archive_write_set_compression_none(ptr noundef %18) #4
  %.not23 = icmp eq i32 %22, 0
  br i1 %.not23, label %24, label %23

23:                                               ; preds = %21
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.5)
  br label %24

24:                                               ; preds = %23, %21
  %25 = tail call i32 @archive_write_set_format_ustar(ptr noundef %18) #4
  %.not24 = icmp eq i32 %25, 0
  br i1 %.not24, label %27, label %26

26:                                               ; preds = %24
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.6)
  br label %27

27:                                               ; preds = %26, %24
  %28 = tail call i32 @archive_write_open_fd(ptr noundef %18, i32 noundef 1) #4
  %.not25 = icmp eq i32 %28, 0
  br i1 %.not25, label %.preheader, label %29

29:                                               ; preds = %27
  tail call void (ptr, ...) @die(ptr noundef nonnull @.str.7)
  br label %.preheader

.preheader:                                       ; preds = %29, %27
  br label %30

30:                                               ; preds = %.preheader, %.backedge
  %31 = call i32 @archive_read_next_header(ptr noundef %5, ptr noundef nonnull %4) #4
  switch i32 %31, label %70 [
    i32 0, label %32
    i32 1, label %.loopexit
  ]

32:                                               ; preds = %30
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call ptr @archive_entry_pathname(ptr noundef %34) #4
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.8, ptr noundef %35) #5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call i32 @archive_entry_mode(ptr noundef %37) #4
  %39 = and i32 %38, 61440
  %40 = icmp eq i32 %39, 32768
  br i1 %40, label %43, label %.backedge

.backedge:                                        ; preds = %32, %56, %69, %._crit_edge
  %.str.9.sink = phi ptr [ @.str.14, %._crit_edge ], [ @.str.14, %69 ], [ @.str.14, %56 ], [ @.str.9, %32 ]
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull %.str.9.sink) #5
  br label %30, !llvm.loop !9

43:                                               ; preds = %32
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  call void @archive_entry_set_uid(ptr noundef %44, i32 noundef 0) #4
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  call void @archive_entry_set_uname(ptr noundef %45, ptr noundef nonnull @.str.10) #4
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  call void @archive_entry_set_gid(ptr noundef %46, i32 noundef 0) #4
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  call void @archive_entry_set_gname(ptr noundef %47, ptr noundef nonnull @.str.11) #4
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call i32 @archive_entry_mode(ptr noundef %48) #4
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = and i32 %49, -4096
  %52 = or disjoint i32 %51, 484
  call void @archive_entry_set_mode(ptr noundef %50, i32 noundef %52) #4
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = call i32 @archive_write_header(ptr noundef %18, ptr noundef %53) #4
  %.not29 = icmp eq i32 %54, 0
  br i1 %.not29, label %56, label %55

55:                                               ; preds = %43
  call void (ptr, ...) @die(ptr noundef nonnull @.str.12)
  br label %56

56:                                               ; preds = %55, %43
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call i64 @archive_entry_size(ptr noundef %57) #4
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %60, label %.backedge

60:                                               ; preds = %56
  %61 = call i64 @archive_read_data(ptr noundef %5, ptr noundef nonnull %3, i64 noundef 8192) #4
  %62 = icmp sgt i64 %61, 0
  br i1 %62, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %60, %65
  %.031 = phi i64 [ %66, %65 ], [ %61, %60 ]
  %63 = call i64 @archive_write_data(ptr noundef %18, ptr noundef nonnull %3, i64 noundef %.031) #4
  %.not30 = icmp eq i64 %63, %.031
  br i1 %.not30, label %65, label %64

64:                                               ; preds = %.lr.ph
  call void (ptr, ...) @die(ptr noundef nonnull @.str.12)
  br label %65

65:                                               ; preds = %64, %.lr.ph
  %66 = call i64 @archive_read_data(ptr noundef %5, ptr noundef nonnull %3, i64 noundef 8192) #4
  %67 = icmp sgt i64 %66, 0
  br i1 %67, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %65, %60
  %.0.lcssa = phi i64 [ %61, %60 ], [ %66, %65 ]
  %68 = icmp slt i64 %.0.lcssa, 0
  br i1 %68, label %69, label %.backedge

69:                                               ; preds = %._crit_edge
  call void (ptr, ...) @die(ptr noundef nonnull @.str.13)
  br label %.backedge

70:                                               ; preds = %30
  call void (ptr, ...) @die(ptr noundef nonnull @.str.15)
  br label %.loopexit

.loopexit:                                        ; preds = %30, %70
  %71 = call i32 @archive_read_finish(ptr noundef %5) #4
  %.not27 = icmp eq i32 %71, 0
  br i1 %.not27, label %73, label %72

72:                                               ; preds = %.loopexit
  call void (ptr, ...) @die(ptr noundef nonnull @.str.16)
  br label %73

73:                                               ; preds = %72, %.loopexit
  %74 = call i32 @archive_write_finish(ptr noundef %18) #4
  %.not28 = icmp eq i32 %74, 0
  br i1 %.not28, label %76, label %75

75:                                               ; preds = %73
  call void (ptr, ...) @die(ptr noundef nonnull @.str.17)
  br label %76

76:                                               ; preds = %75, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %3) #4
  ret i32 0
}

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

declare ptr @archive_read_new() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @die(ptr noundef, ...) local_unnamed_addr #0

declare i32 @archive_read_support_compression_all(ptr noundef) local_unnamed_addr #2

declare i32 @archive_read_support_format_all(ptr noundef) local_unnamed_addr #2

declare i32 @archive_read_open_fd(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #2

declare ptr @archive_write_new() local_unnamed_addr #2

declare i32 @archive_write_set_compression_none(ptr noundef) local_unnamed_addr #2

declare i32 @archive_write_set_format_ustar(ptr noundef) local_unnamed_addr #2

declare i32 @archive_write_open_fd(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @archive_read_next_header(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

declare ptr @archive_entry_pathname(ptr noundef) local_unnamed_addr #2

declare i32 @archive_entry_mode(ptr noundef) local_unnamed_addr #2

declare void @archive_entry_set_uid(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @archive_entry_set_gid(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @archive_entry_set_mode(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @archive_write_header(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i64 @archive_entry_size(ptr noundef) local_unnamed_addr #2

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

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

declare i32 @archive_read_finish(ptr noundef) local_unnamed_addr #2

declare i32 @archive_write_finish(ptr noundef) local_unnamed_addr #2

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

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 = { nounwind }
attributes #5 = { 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, !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}


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