; LLVM IR from wmcnamara/crynn :: lib/thirdparty/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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

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

; 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 %23, label %19

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

23:                                               ; preds = %19, %3
  store i32 -102, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %103

24:                                               ; preds = %19
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = call noalias ptr @malloc(i64 noundef %27) #7
  store ptr %28, ptr %10, align 8, !tbaa !5
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %29, ptr %11, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %74, %24
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %32, i64 %35
  %37 = icmp ult ptr %31, %36
  br i1 %37, label %38, label %75

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

49:                                               ; preds = %38
  %50 = load i16, ptr %13, align 2, !tbaa !9
  %51 = sext i16 %50 to i32
  %52 = add nsw i32 %51, 4
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds i8, ptr %53, i64 %54
  store ptr %55, ptr %8, align 8, !tbaa !5
  br label %74

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

74:                                               ; preds = %56, %49
  br label %30, !llvm.loop !13

75:                                               ; preds = %30
  %76 = load i32, ptr %9, align 4, !tbaa !11
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = load i32, ptr %77, align 4, !tbaa !11
  %79 = icmp slt i32 %76, %78
  br i1 %79, label %80, label %95

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

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

92:                                               ; preds = %87, %80
  %93 = load i32, ptr %9, align 4, !tbaa !11
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %93, ptr %94, align 4, !tbaa !11
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %96

95:                                               ; preds = %75
  store i32 -1, ptr %14, align 4, !tbaa !11
  br label %96

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

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

101:                                              ; preds = %99, %96
  %102 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %102, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %103

103:                                              ; preds = %101, %23
  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
  %104 = load i32, ptr %4, align 4
  ret i32 %104
}

; 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 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #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: 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) #2

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

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

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %23
  %.03542 = phi ptr [ %.1, %23 ], [ %0, %.lr.ph.preheader ]
  %.03641 = phi i32 [ %.137, %23 ], [ 0, %.lr.ph.preheader ]
  %11 = load i16, ptr %.03542, align 2, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %.03542, i64 2
  %13 = load i16, ptr %12, align 2, !tbaa !9
  %14 = icmp eq i16 %11, %2
  br i1 %14, label %15, label %18

15:                                               ; preds = %.lr.ph
  %16 = sext i16 %13 to i64
  %17 = add nsw i64 %16, 4
  br label %23

18:                                               ; preds = %.lr.ph
  %19 = sext i16 %13 to i32
  %20 = add nsw i32 %19, 4
  %21 = sext i32 %20 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %9, ptr nonnull align 1 %.03542, i64 %21, i1 false)
  %22 = add nsw i32 %20, %.03641
  br label %23

23:                                               ; preds = %18, %15
  %.137 = phi i32 [ %.03641, %15 ], [ %22, %18 ]
  %.pn = phi i64 [ %17, %15 ], [ %21, %18 ]
  %.1 = getelementptr inbounds i8, ptr %.03542, i64 %.pn
  %24 = icmp ult ptr %.1, %10
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %23
  %25 = icmp slt i32 %.137, %6
  br i1 %25, label %26, label %31

26:                                               ; preds = %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %0, i8 0, i64 %8, i1 false)
  %27 = icmp sgt i32 %.137, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %26
  %29 = zext nneg i32 %.137 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %0, ptr align 1 %9, i64 %29, i1 false)
  br label %30

30:                                               ; preds = %28, %26
  store i32 %.137, ptr %1, align 4, !tbaa !5
  br label %31

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

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

33:                                               ; preds = %31, %32, %3, %5
  %.034 = phi i32 [ -102, %5 ], [ -102, %3 ], [ %.0, %32 ], [ %.0, %31 ]
  ret i32 %.034
}

; 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 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass