; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/contrib/zlib/contrib/minizip (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"

; 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 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @zipRemoveExtraInfoBlock(ptr noundef %0, ptr noundef %1, i16 noundef signext %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %16, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %26, label %19

19:                                               ; preds = %3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %26, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = icmp slt i32 %24, 4
  br i1 %25, label %26, label %27

26:                                               ; preds = %22, %19, %3
  store i32 -102, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %106

27:                                               ; preds = %22
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = zext i32 %29 to i64
  %31 = call noalias ptr @malloc(i64 noundef %30) #7
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %32, ptr %11, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %77, %27
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %35, i64 %38
  %40 = icmp ult ptr %34, %39
  br i1 %40, label %41, label %78

41:                                               ; preds = %33
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load i16, ptr %42, align 2, !tbaa !9
  store i16 %43, ptr %12, align 2, !tbaa !9
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds i16, ptr %44, i64 1
  %46 = load i16, ptr %45, align 2, !tbaa !9
  store i16 %46, ptr %13, align 2, !tbaa !9
  %47 = load i16, ptr %12, align 2, !tbaa !9
  %48 = sext i16 %47 to i32
  %49 = load i16, ptr %7, align 2, !tbaa !9
  %50 = sext i16 %49 to i32
  %51 = icmp eq i32 %48, %50
  br i1 %51, label %52, label %59

52:                                               ; preds = %41
  %53 = load i16, ptr %13, align 2, !tbaa !9
  %54 = sext i16 %53 to i32
  %55 = add nsw i32 %54, 4
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = sext i32 %55 to i64
  %58 = getelementptr inbounds i8, ptr %56, i64 %57
  store ptr %58, ptr %8, align 8, !tbaa !5
  br label %77

59:                                               ; preds = %41
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = load i16, ptr %13, align 2, !tbaa !9
  %63 = sext i16 %62 to i32
  %64 = add nsw i32 %63, 4
  %65 = sext i32 %64 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %60, ptr align 1 %61, i64 %65, i1 false)
  %66 = load i16, ptr %13, align 2, !tbaa !9
  %67 = sext i16 %66 to i32
  %68 = add nsw i32 %67, 4
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds i8, ptr %69, i64 %70
  store ptr %71, ptr %8, align 8, !tbaa !5
  %72 = load i16, ptr %13, align 2, !tbaa !9
  %73 = sext i16 %72 to i32
  %74 = add nsw i32 %73, 4
  %75 = load i32, ptr %9, align 4, !tbaa !11
  %76 = add nsw i32 %75, %74
  store i32 %76, ptr %9, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %59, %52
  br label %33, !llvm.loop !13

78:                                               ; preds = %33
  %79 = load i32, ptr %9, align 4, !tbaa !11
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr %80, align 4, !tbaa !11
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %98

83:                                               ; preds = %78
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %84, i8 0, i64 %87, i1 false)
  %88 = load i32, ptr %9, align 4, !tbaa !11
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %95

90:                                               ; preds = %83
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load i32, ptr %9, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %91, ptr align 1 %92, i64 %94, i1 false)
  br label %95

95:                                               ; preds = %90, %83
  %96 = load i32, ptr %9, align 4, !tbaa !11
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %96, ptr %97, align 4, !tbaa !11
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %99

98:                                               ; preds = %78
  store i32 -1, ptr %14, align 4, !tbaa !11
  br label %99

99:                                               ; preds = %98, %95
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %104

102:                                              ; preds = %99
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %103) #6
  br label %104

104:                                              ; preds = %102, %99
  %105 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %105, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %106

106:                                              ; preds = %104, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %107 = load i32, ptr %4, align 4
  ret i32 %107
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; 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) #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -102, 1) i32 @zipRemoveExtraInfoBlock(ptr noundef %0, ptr noundef %1, i16 noundef signext %2) local_unnamed_addr #3 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %34, label %6

6:                                                ; preds = %3
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = icmp slt i32 %7, 4
  br i1 %8, label %34, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %6
  %9 = zext nneg i32 %7 to i64
  %10 = tail call noalias ptr @malloc(i64 noundef %9) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 %9
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %.03745 = phi ptr [ %.1, %24 ], [ %0, %.lr.ph.preheader ]
  %.03844 = phi i32 [ %.139, %24 ], [ 0, %.lr.ph.preheader ]
  %12 = load i16, ptr %.03745, align 2, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %.03745, i64 2
  %14 = load i16, ptr %13, align 2, !tbaa !9
  %15 = icmp eq i16 %12, %2
  br i1 %15, label %16, label %19

16:                                               ; preds = %.lr.ph
  %17 = sext i16 %14 to i64
  %18 = add nsw i64 %17, 4
  br label %24

19:                                               ; preds = %.lr.ph
  %20 = sext i16 %14 to i32
  %21 = add nsw i32 %20, 4
  %22 = sext i32 %21 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %10, ptr nonnull align 1 %.03745, i64 %22, i1 false)
  %23 = add nsw i32 %21, %.03844
  br label %24

24:                                               ; preds = %19, %16
  %.139 = phi i32 [ %.03844, %16 ], [ %23, %19 ]
  %.pn = phi i64 [ %18, %16 ], [ %22, %19 ]
  %.1 = getelementptr inbounds i8, ptr %.03745, i64 %.pn
  %25 = icmp ult ptr %.1, %11
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %24
  %26 = icmp slt i32 %.139, %7
  br i1 %26, label %27, label %32

27:                                               ; preds = %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr align 1 %0, i8 0, i64 %9, i1 false)
  %28 = icmp sgt i32 %.139, 0
  br i1 %28, label %29, label %31

29:                                               ; preds = %27
  %30 = zext nneg i32 %.139 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %0, ptr align 1 %10, i64 %30, i1 false)
  br label %31

31:                                               ; preds = %29, %27
  store i32 %.139, ptr %1, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %._crit_edge, %31
  %.0 = phi i32 [ 0, %31 ], [ -1, %._crit_edge ]
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %34, label %33

33:                                               ; preds = %32
  tail call void @free(ptr noundef nonnull %10) #6
  br label %34

34:                                               ; preds = %32, %33, %3, %6
  %.036 = phi i32 [ -102, %6 ], [ -102, %3 ], [ %.0, %33 ], [ %.0, %32 ]
  ret i32 %.036
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { 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 = !{!"short", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass