; LLVM IR from eugenebokhan/awesome-ml :: Awesome ML/Utils/Zip/minizip (unzip)

; 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.unz_file_info64_s = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.tm_unz_s, i64, i64 }
%struct.tm_unz_s = type { i32, i32, i32, i32, i32, i32 }
%struct.unz_file_info_s = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.tm_unz_s, i64 }

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @unzGetCurrentFileInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca %struct.unz_file_info64_s, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i64 %3, ptr %12, align 8, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store i64 %5, ptr %14, align 8, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  store i64 %7, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 152, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %11, align 8, !tbaa !5
  %21 = load i64, ptr %12, align 8, !tbaa !9
  %22 = load ptr, ptr %13, align 8, !tbaa !5
  %23 = load i64, ptr %14, align 8, !tbaa !9
  %24 = load ptr, ptr %15, align 8, !tbaa !5
  %25 = load i64, ptr %16, align 8, !tbaa !9
  %26 = call i32 @unz64local_GetCurrentFileInfoInternal(ptr noundef %19, ptr noundef %17, ptr noundef null, ptr noundef %20, i64 noundef %21, ptr noundef %22, i64 noundef %23, ptr noundef %24, i64 noundef %25)
  store i32 %26, ptr %18, align 4, !tbaa !11
  %27 = load i32, ptr %18, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %95

29:                                               ; preds = %8
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %95

32:                                               ; preds = %29
  %33 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.unz_file_info_s, ptr %35, i32 0, i32 0
  store i64 %34, ptr %36, align 8, !tbaa !17
  %37 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !19
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.unz_file_info_s, ptr %39, i32 0, i32 1
  store i64 %38, ptr %40, align 8, !tbaa !20
  %41 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 2
  %42 = load i64, ptr %41, align 8, !tbaa !21
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.unz_file_info_s, ptr %43, i32 0, i32 2
  store i64 %42, ptr %44, align 8, !tbaa !22
  %45 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !23
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.unz_file_info_s, ptr %47, i32 0, i32 3
  store i64 %46, ptr %48, align 8, !tbaa !24
  %49 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 4
  %50 = load i64, ptr %49, align 8, !tbaa !25
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.unz_file_info_s, ptr %51, i32 0, i32 4
  store i64 %50, ptr %52, align 8, !tbaa !26
  %53 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 5
  %54 = load i64, ptr %53, align 8, !tbaa !27
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.unz_file_info_s, ptr %55, i32 0, i32 5
  store i64 %54, ptr %56, align 8, !tbaa !28
  %57 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 8
  %58 = load i64, ptr %57, align 8, !tbaa !29
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.unz_file_info_s, ptr %59, i32 0, i32 8
  store i64 %58, ptr %60, align 8, !tbaa !30
  %61 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 9
  %62 = load i64, ptr %61, align 8, !tbaa !31
  %63 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 16
  %64 = load i64, ptr %63, align 8, !tbaa !32
  %65 = sub i64 %62, %64
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.unz_file_info_s, ptr %66, i32 0, i32 9
  store i64 %65, ptr %67, align 8, !tbaa !33
  %68 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 10
  %69 = load i64, ptr %68, align 8, !tbaa !34
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.unz_file_info_s, ptr %70, i32 0, i32 10
  store i64 %69, ptr %71, align 8, !tbaa !35
  %72 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 11
  %73 = load i64, ptr %72, align 8, !tbaa !36
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.unz_file_info_s, ptr %74, i32 0, i32 11
  store i64 %73, ptr %75, align 8, !tbaa !37
  %76 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 12
  %77 = load i64, ptr %76, align 8, !tbaa !38
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.unz_file_info_s, ptr %78, i32 0, i32 12
  store i64 %77, ptr %79, align 8, !tbaa !39
  %80 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 13
  %81 = load i64, ptr %80, align 8, !tbaa !40
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.unz_file_info_s, ptr %82, i32 0, i32 13
  store i64 %81, ptr %83, align 8, !tbaa !41
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.unz_file_info_s, ptr %84, i32 0, i32 14
  %86 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %85, ptr align 8 %86, i64 24, i1 false), !tbaa.struct !42
  %87 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 6
  %88 = load i64, ptr %87, align 8, !tbaa !43
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.unz_file_info_s, ptr %89, i32 0, i32 6
  store i64 %88, ptr %90, align 8, !tbaa !44
  %91 = getelementptr inbounds %struct.unz_file_info64_s, ptr %17, i32 0, i32 7
  %92 = load i64, ptr %91, align 8, !tbaa !45
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.unz_file_info_s, ptr %93, i32 0, i32 7
  store i64 %92, ptr %94, align 8, !tbaa !46
  br label %95

95:                                               ; preds = %32, %29, %8
  %96 = load i32, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 152, ptr %17) #3
  ret i32 %96
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"unz_file_info64_s", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !15, i64 48, !15, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !16, i64 112, !15, i64 136, !10, i64 144}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"tm_unz_s", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!17 = !{!18, !10, i64 0}
!18 = !{!"unz_file_info_s", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !16, i64 112, !10, i64 136}
!19 = !{!14, !10, i64 8}
!20 = !{!18, !10, i64 8}
!21 = !{!14, !10, i64 16}
!22 = !{!18, !10, i64 16}
!23 = !{!14, !10, i64 24}
!24 = !{!18, !10, i64 24}
!25 = !{!14, !10, i64 32}
!26 = !{!18, !10, i64 32}
!27 = !{!14, !10, i64 40}
!28 = !{!18, !10, i64 40}
!29 = !{!14, !10, i64 64}
!30 = !{!18, !10, i64 64}
!31 = !{!14, !10, i64 72}
!32 = !{!14, !10, i64 144}
!33 = !{!18, !10, i64 72}
!34 = !{!14, !10, i64 80}
!35 = !{!18, !10, i64 80}
!36 = !{!14, !10, i64 88}
!37 = !{!18, !10, i64 88}
!38 = !{!14, !10, i64 96}
!39 = !{!18, !10, i64 96}
!40 = !{!14, !10, i64 104}
!41 = !{!18, !10, i64 104}
!42 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11, i64 16, i64 4, !11, i64 20, i64 4, !11}
!43 = !{!14, !15, i64 48}
!44 = !{!18, !10, i64 48}
!45 = !{!14, !15, i64 56}
!46 = !{!18, !10, i64 56}


; 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.unz_file_info64_s = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.tm_unz_s, i64, i64 }
%struct.tm_unz_s = type { i32, i32, i32, i32, i32, i32 }

; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @unzGetCurrentFileInfo(ptr noundef %0, ptr noundef writeonly %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7) local_unnamed_addr #2 {
  %9 = alloca %struct.unz_file_info64_s, align 16
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %9) #3
  %10 = call i32 @unz64local_GetCurrentFileInfoInternal(ptr noundef %0, ptr noundef nonnull %9, ptr noundef null, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7)
  %11 = icmp eq i32 %10, 0
  %12 = icmp ne ptr %1, null
  %or.cond = and i1 %12, %11
  br i1 %or.cond, label %13, label %41

13:                                               ; preds = %8
  %14 = load <2 x i64>, ptr %9, align 16, !tbaa !5
  store <2 x i64> %14, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %9, i64 16
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load <2 x i64>, ptr %15, align 16, !tbaa !5
  store <2 x i64> %17, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %9, i64 32
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = load <2 x i64>, ptr %18, align 16, !tbaa !5
  store <2 x i64> %20, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %9, i64 64
  %22 = load i64, ptr %21, align 16, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %1, i64 64
  store i64 %22, ptr %23, align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %9, i64 72
  %25 = load i64, ptr %24, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %9, i64 144
  %27 = load i64, ptr %26, align 16, !tbaa !17
  %28 = sub i64 %25, %27
  %29 = getelementptr inbounds i8, ptr %1, i64 72
  store i64 %28, ptr %29, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %9, i64 80
  %31 = getelementptr inbounds i8, ptr %1, i64 80
  %32 = load <2 x i64>, ptr %30, align 16, !tbaa !5
  store <2 x i64> %32, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %9, i64 96
  %34 = getelementptr inbounds i8, ptr %1, i64 96
  %35 = load <2 x i64>, ptr %33, align 16, !tbaa !5
  store <2 x i64> %35, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %1, i64 112
  %37 = getelementptr inbounds i8, ptr %9, i64 112
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 16 dereferenceable(24) %37, i64 24, i1 false), !tbaa.struct !19
  %38 = getelementptr inbounds i8, ptr %9, i64 48
  %39 = getelementptr inbounds i8, ptr %1, i64 48
  %40 = load <2 x i64>, ptr %38, align 16, !tbaa !21
  store <2 x i64> %40, ptr %39, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %13, %8
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %9) #3
  ret i32 %10
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 64}
!10 = !{!"unz_file_info64_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !11, i64 136, !6, i64 144}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"tm_unz_s", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 64}
!15 = !{!"unz_file_info_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, 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, !12, i64 112, !6, i64 136}
!16 = !{!10, !6, i64 72}
!17 = !{!10, !6, i64 144}
!18 = !{!15, !6, i64 72}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 12, i64 4, !20, i64 16, i64 4, !20, i64 20, i64 4, !20}
!20 = !{!13, !13, i64 0}
!21 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass