; LLVM IR from kuba--/zip :: src (zip)

; 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.mz_zip_archive_file_stat = type { i32, i64, i16, i16, i16, i16, i32, i64, i64, i16, i32, i64, i32, i32, i32, i32, [512 x i8], [512 x i8], i64 }
%struct.zip_t = type { %struct.mz_zip_archive, i32, %struct.zip_entry_t }
%struct.mz_zip_archive = type { i64, i64, i32, i32, i32, i32, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.zip_entry_t = type { i64, ptr, i64, i64, i32, i64, [30 x i8], i64, i16, %struct.mz_zip_writer_add_state, %struct.tdefl_compressor, i32, i64 }
%struct.mz_zip_writer_add_state = type { ptr, i64, i64 }
%struct.tdefl_compressor = type { ptr, ptr, i32, [2 x i32], i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, ptr, i64, i64, [33025 x i8], [3 x [288 x i16]], [3 x [288 x i16]], [3 x [288 x i8]], [65536 x i8], [32768 x i16], [32768 x i16], [85196 x i8] }
%struct.mz_zip_internal_state_tag = type { %struct.mz_zip_array, %struct.mz_zip_array, %struct.mz_zip_array, i32, i32, i32, ptr, i64, ptr, i64, i64 }
%struct.mz_zip_array = type { ptr, i64, i64, i32 }

; 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
declare void @free(ptr noundef) #1

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

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

14:                                               ; preds = %2
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

15:                                               ; preds = %2
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.zip_t, ptr %16, i32 0, i32 0
  store ptr %17, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.mz_zip_archive, ptr %18, i32 0, i32 3
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = icmp ne i32 %20, 1
  br i1 %21, label %22, label %23

22:                                               ; preds = %15
  store i32 -4, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

23:                                               ; preds = %15
  %24 = load i64, ptr %5, align 8, !tbaa !9
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.mz_zip_archive, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !14
  %28 = zext i32 %27 to i64
  %29 = icmp uge i64 %24, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %23
  store i32 -10, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

31:                                               ; preds = %23
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mz_zip_archive, ptr %32, i32 0, i32 15
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = getelementptr inbounds %struct.mz_zip_internal_state_tag, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds %struct.mz_zip_array, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.mz_zip_archive, ptr %38, i32 0, i32 15
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = getelementptr inbounds %struct.mz_zip_internal_state_tag, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds %struct.mz_zip_array, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = load i64, ptr %5, align 8, !tbaa !9
  %45 = getelementptr inbounds i32, ptr %43, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !20
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %37, i64 %47
  store ptr %48, ptr %9, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %31
  store i32 -11, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

51:                                               ; preds = %31
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 28
  %54 = getelementptr inbounds i8, ptr %53, i64 0
  %55 = load i8, ptr %54, align 1, !tbaa !21
  %56 = zext i8 %55 to i32
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 28
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  %60 = load i8, ptr %59, align 1, !tbaa !21
  %61 = zext i8 %60 to i32
  %62 = shl i32 %61, 8
  %63 = or i32 %56, %62
  store i32 %63, ptr %8, align 4, !tbaa !20
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 46
  store ptr %65, ptr %10, align 8, !tbaa !5
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.zip_t, ptr %66, i32 0, i32 2
  %68 = getelementptr inbounds %struct.zip_entry_t, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !22
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %89

71:                                               ; preds = %51
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.zip_t, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds %struct.zip_entry_t, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !22
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %86

78:                                               ; preds = %72
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.zip_t, ptr %79, i32 0, i32 2
  %81 = getelementptr inbounds %struct.zip_entry_t, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !22
  call void @free(ptr noundef %82) #3
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.zip_t, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds %struct.zip_entry_t, ptr %84, i32 0, i32 1
  store ptr null, ptr %85, align 8, !tbaa !22
  br label %86

86:                                               ; preds = %78, %72
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88, %51
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !20
  %92 = zext i32 %91 to i64
  %93 = call ptr @zip_strclone(ptr noundef %90, i64 noundef %92)
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.zip_t, ptr %94, i32 0, i32 2
  %96 = getelementptr inbounds %struct.zip_entry_t, ptr %95, i32 0, i32 1
  store ptr %93, ptr %96, align 8, !tbaa !22
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.zip_t, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds %struct.zip_entry_t, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !22
  %101 = icmp ne ptr %100, null
  br i1 %101, label %103, label %102

102:                                              ; preds = %89
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

103:                                              ; preds = %89
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load i64, ptr %5, align 8, !tbaa !9
  %106 = trunc i64 %105 to i32
  %107 = call i32 @mz_zip_reader_file_stat(ptr noundef %104, i32 noundef %106, ptr noundef %7)
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %110, label %109

109:                                              ; preds = %103
  store i32 -3, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

110:                                              ; preds = %103
  %111 = load i64, ptr %5, align 8, !tbaa !9
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.zip_t, ptr %112, i32 0, i32 2
  %114 = getelementptr inbounds %struct.zip_entry_t, ptr %113, i32 0, i32 0
  store i64 %111, ptr %114, align 8, !tbaa !28
  %115 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 7
  %116 = load i64, ptr %115, align 8, !tbaa !29
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.zip_t, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds %struct.zip_entry_t, ptr %118, i32 0, i32 3
  store i64 %116, ptr %119, align 8, !tbaa !31
  %120 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 8
  %121 = load i64, ptr %120, align 8, !tbaa !32
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.zip_t, ptr %122, i32 0, i32 2
  %124 = getelementptr inbounds %struct.zip_entry_t, ptr %123, i32 0, i32 2
  store i64 %121, ptr %124, align 8, !tbaa !33
  %125 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 6
  %126 = load i32, ptr %125, align 8, !tbaa !34
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.zip_t, ptr %127, i32 0, i32 2
  %129 = getelementptr inbounds %struct.zip_entry_t, ptr %128, i32 0, i32 4
  store i32 %126, ptr %129, align 8, !tbaa !35
  %130 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !36
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.zip_t, ptr %132, i32 0, i32 2
  %134 = getelementptr inbounds %struct.zip_entry_t, ptr %133, i32 0, i32 5
  store i64 %131, ptr %134, align 8, !tbaa !37
  %135 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 11
  %136 = load i64, ptr %135, align 8, !tbaa !38
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.zip_t, ptr %137, i32 0, i32 2
  %139 = getelementptr inbounds %struct.zip_entry_t, ptr %138, i32 0, i32 7
  store i64 %136, ptr %139, align 8, !tbaa !39
  %140 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 5
  %141 = load i16, ptr %140, align 2, !tbaa !40
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.zip_t, ptr %142, i32 0, i32 2
  %144 = getelementptr inbounds %struct.zip_entry_t, ptr %143, i32 0, i32 8
  store i16 %141, ptr %144, align 8, !tbaa !41
  %145 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 10
  %146 = load i32, ptr %145, align 4, !tbaa !42
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.zip_t, ptr %147, i32 0, i32 2
  %149 = getelementptr inbounds %struct.zip_entry_t, ptr %148, i32 0, i32 11
  store i32 %146, ptr %149, align 8, !tbaa !43
  %150 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %7, i32 0, i32 18
  %151 = load i64, ptr %150, align 8, !tbaa !44
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.zip_t, ptr %152, i32 0, i32 2
  %154 = getelementptr inbounds %struct.zip_entry_t, ptr %153, i32 0, i32 12
  store i64 %151, ptr %154, align 8, !tbaa !45
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %155

155:                                              ; preds = %110, %109, %102, %50, %30, %22, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1112, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %156 = load i32, ptr %3, align 4
  ret i32 %156
}

; Function Attrs: nounwind uwtable
declare hidden ptr @zip_strclone(ptr noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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, !13, i64 20}
!12 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 16}
!15 = !{!12, !6, i64 104}
!16 = !{!17, !6, i64 0}
!17 = !{!"mz_zip_internal_state_tag", !18, i64 0, !18, i64 32, !18, i64 64, !13, i64 96, !13, i64 100, !13, i64 104, !6, i64 112, !10, i64 120, !6, i64 128, !10, i64 136, !10, i64 144}
!18 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !13, i64 24}
!19 = !{!17, !6, i64 32}
!20 = !{!13, !13, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !6, i64 128}
!23 = !{!"zip_t", !12, i64 0, !13, i64 112, !24, i64 120}
!24 = !{!"zip_entry_t", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !10, i64 40, !7, i64 48, !10, i64 80, !25, i64 88, !26, i64 96, !27, i64 120, !13, i64 319472, !10, i64 319480}
!25 = !{!"short", !7, i64 0}
!26 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16}
!27 = !{!"", !6, i64 0, !6, i64 8, !13, i64 16, !7, i64 20, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !13, i64 168, !6, i64 176, !10, i64 184, !10, i64 192, !7, i64 200, !7, i64 33226, !7, i64 34954, !7, i64 36682, !7, i64 37546, !7, i64 103082, !7, i64 168618, !7, i64 234154}
!28 = !{!23, !10, i64 120}
!29 = !{!30, !10, i64 32}
!30 = !{!"", !13, i64 0, !10, i64 8, !25, i64 16, !25, i64 18, !25, i64 20, !25, i64 22, !13, i64 24, !10, i64 32, !10, i64 40, !25, i64 48, !13, i64 52, !10, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !7, i64 80, !7, i64 592, !10, i64 1104}
!31 = !{!23, !10, i64 144}
!32 = !{!30, !10, i64 40}
!33 = !{!23, !10, i64 136}
!34 = !{!30, !13, i64 24}
!35 = !{!23, !13, i64 152}
!36 = !{!30, !10, i64 8}
!37 = !{!23, !10, i64 160}
!38 = !{!30, !10, i64 56}
!39 = !{!23, !10, i64 200}
!40 = !{!30, !25, i64 22}
!41 = !{!23, !25, i64 208}
!42 = !{!30, !13, i64 52}
!43 = !{!23, !13, i64 319592}
!44 = !{!30, !10, i64 1104}
!45 = !{!23, !10, i64 319600}


; 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.mz_zip_archive_file_stat = type { i32, i64, i16, i16, i16, i16, i32, i64, i64, i16, i32, i64, i32, i32, i32, i32, [512 x i8], [512 x i8], i64 }

; 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -11, 1) i32 @zip_entry_openbyindex(ptr noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.mz_zip_archive_file_stat, align 8
  call void @llvm.lifetime.start.p0(i64 1112, ptr nonnull %3) #3
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %58, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 20
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %.not35 = icmp eq i32 %6, 1
  br i1 %.not35, label %7, label %58

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !12
  %10 = zext i32 %9 to i64
  %.not36 = icmp ugt i64 %10, %1
  br i1 %.not36, label %11, label %58

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %.not37 = icmp eq ptr %14, null
  br i1 %.not37, label %58, label %15

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %13, i64 32
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i32, ptr %17, i64 %1
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds i8, ptr %14, i64 %20
  %22 = getelementptr inbounds i8, ptr %21, i64 28
  %23 = load i16, ptr %22, align 1
  %24 = zext i16 %23 to i64
  %25 = getelementptr inbounds i8, ptr %21, i64 46
  %26 = getelementptr inbounds i8, ptr %0, i64 120
  %27 = getelementptr inbounds i8, ptr %0, i64 128
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %.not38 = icmp eq ptr %28, null
  br i1 %.not38, label %30, label %29

29:                                               ; preds = %15
  tail call void @free(ptr noundef nonnull %28) #3
  store ptr null, ptr %27, align 8, !tbaa !19
  br label %30

30:                                               ; preds = %29, %15
  %31 = tail call ptr @zip_strclone(ptr noundef nonnull %25, i64 noundef %24)
  store ptr %31, ptr %27, align 8, !tbaa !19
  %.not39 = icmp eq ptr %31, null
  br i1 %.not39, label %58, label %32

32:                                               ; preds = %30
  %33 = trunc nuw i64 %1 to i32
  %34 = call i32 @mz_zip_reader_file_stat(ptr noundef nonnull %0, i32 noundef %33, ptr noundef nonnull %3)
  %.not40 = icmp eq i32 %34, 0
  br i1 %.not40, label %58, label %35

35:                                               ; preds = %32
  store i64 %1, ptr %26, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %3, i64 32
  %37 = getelementptr inbounds i8, ptr %0, i64 136
  %38 = load <2 x i64>, ptr %36, align 8, !tbaa !26
  %39 = shufflevector <2 x i64> %38, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i64> %39, ptr %37, align 8, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %3, i64 24
  %41 = load i32, ptr %40, align 8, !tbaa !27
  %42 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %41, ptr %42, align 8, !tbaa !29
  %43 = getelementptr inbounds i8, ptr %3, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !30
  %45 = getelementptr inbounds i8, ptr %0, i64 160
  store i64 %44, ptr %45, align 8, !tbaa !31
  %46 = getelementptr inbounds i8, ptr %3, i64 56
  %47 = load i64, ptr %46, align 8, !tbaa !32
  %48 = getelementptr inbounds i8, ptr %0, i64 200
  store i64 %47, ptr %48, align 8, !tbaa !33
  %49 = getelementptr inbounds i8, ptr %3, i64 22
  %50 = load i16, ptr %49, align 2, !tbaa !34
  %51 = getelementptr inbounds i8, ptr %0, i64 208
  store i16 %50, ptr %51, align 8, !tbaa !35
  %52 = getelementptr inbounds i8, ptr %3, i64 52
  %53 = load i32, ptr %52, align 4, !tbaa !36
  %54 = getelementptr inbounds i8, ptr %0, i64 319592
  store i32 %53, ptr %54, align 8, !tbaa !37
  %55 = getelementptr inbounds i8, ptr %3, i64 1104
  %56 = load i64, ptr %55, align 8, !tbaa !38
  %57 = getelementptr inbounds i8, ptr %0, i64 319600
  store i64 %56, ptr %57, align 8, !tbaa !39
  br label %58

58:                                               ; preds = %32, %30, %11, %7, %4, %2, %35
  %.0 = phi i32 [ 0, %35 ], [ -1, %2 ], [ -4, %4 ], [ -10, %7 ], [ -11, %11 ], [ -2, %30 ], [ -3, %32 ]
  call void @llvm.lifetime.end.p0(i64 1112, ptr nonnull %3) #3
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden ptr @zip_strclone(ptr noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 }

!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, !10, i64 20}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !11, i64 104}
!14 = !{!15, !11, i64 0}
!15 = !{!"mz_zip_internal_state_tag", !16, i64 0, !16, i64 32, !16, i64 64, !10, i64 96, !10, i64 100, !10, i64 104, !11, i64 112, !7, i64 120, !11, i64 128, !7, i64 136, !7, i64 144}
!16 = !{!"", !11, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!17 = !{!15, !11, i64 32}
!18 = !{!10, !10, i64 0}
!19 = !{!20, !11, i64 128}
!20 = !{!"zip_t", !6, i64 0, !10, i64 112, !21, i64 120}
!21 = !{!"zip_entry_t", !7, i64 0, !11, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !8, i64 48, !7, i64 80, !22, i64 88, !23, i64 96, !24, i64 120, !10, i64 319472, !7, i64 319480}
!22 = !{!"short", !8, i64 0}
!23 = !{!"", !11, i64 0, !7, i64 8, !7, i64 16}
!24 = !{!"", !11, i64 0, !11, i64 8, !10, i64 16, !8, i64 20, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !10, i64 168, !11, i64 176, !7, i64 184, !7, i64 192, !8, i64 200, !8, i64 33226, !8, i64 34954, !8, i64 36682, !8, i64 37546, !8, i64 103082, !8, i64 168618, !8, i64 234154}
!25 = !{!20, !7, i64 120}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !10, i64 24}
!28 = !{!"", !10, i64 0, !7, i64 8, !22, i64 16, !22, i64 18, !22, i64 20, !22, i64 22, !10, i64 24, !7, i64 32, !7, i64 40, !22, i64 48, !10, i64 52, !7, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !8, i64 80, !8, i64 592, !7, i64 1104}
!29 = !{!20, !10, i64 152}
!30 = !{!28, !7, i64 8}
!31 = !{!20, !7, i64 160}
!32 = !{!28, !7, i64 56}
!33 = !{!20, !7, i64 200}
!34 = !{!28, !22, i64 22}
!35 = !{!20, !22, i64 208}
!36 = !{!28, !10, i64 52}
!37 = !{!20, !10, i64 319592}
!38 = !{!28, !7, i64 1104}
!39 = !{!20, !7, i64 319600}


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