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

; 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.zlib_filefunc64_32_def_s = type { %struct.zlib_filefunc64_def_s, ptr, ptr, ptr, ptr }
%struct.zlib_filefunc64_def_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.zlib_filefunc_def_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @fill_zlib_filefunc64_32_def_from_filefunc32(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %5, i32 0, i32 0
  %7 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %6, i32 0, i32 0
  store ptr null, ptr %7, align 8, !tbaa !9
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %8, i32 0, i32 0
  %10 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %9, i32 0, i32 1
  store ptr null, ptr %10, align 8, !tbaa !12
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %14, i32 0, i32 1
  store ptr %13, ptr %15, align 8, !tbaa !15
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %19, i32 0, i32 2
  store ptr %18, ptr %20, align 8, !tbaa !17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %21, i32 0, i32 7
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %25, i32 0, i32 7
  store ptr %23, ptr %26, align 8, !tbaa !19
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %31, i32 0, i32 2
  store ptr %29, ptr %32, align 8, !tbaa !21
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %37, i32 0, i32 3
  store ptr %35, ptr %38, align 8, !tbaa !23
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %40, i32 0, i32 4
  store ptr null, ptr %41, align 8, !tbaa !24
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %43, i32 0, i32 5
  store ptr null, ptr %44, align 8, !tbaa !25
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %45, i32 0, i32 6
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %49, i32 0, i32 6
  store ptr %47, ptr %50, align 8, !tbaa !27
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %51, i32 0, i32 7
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %55, i32 0, i32 7
  store ptr %53, ptr %56, align 8, !tbaa !19
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %57, i32 0, i32 8
  %59 = load ptr, ptr %58, align 8, !tbaa !28
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.zlib_filefunc64_def_s, ptr %61, i32 0, i32 8
  store ptr %59, ptr %62, align 8, !tbaa !29
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %63, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !30
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %66, i32 0, i32 4
  store ptr %65, ptr %67, align 8, !tbaa !31
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.zlib_filefunc_def_s, ptr %68, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !32
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.zlib_filefunc64_32_def_s, ptr %71, i32 0, i32 3
  store ptr %70, ptr %72, align 8, !tbaa !33
  ret void
}

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

!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, !6, i64 0}
!10 = !{!"zlib_filefunc64_32_def_s", !11, i64 0, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!11 = !{!"zlib_filefunc64_def_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}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !6, i64 0}
!14 = !{!"zlib_filefunc_def_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}
!15 = !{!10, !6, i64 72}
!16 = !{!14, !6, i64 8}
!17 = !{!10, !6, i64 80}
!18 = !{!14, !6, i64 56}
!19 = !{!10, !6, i64 56}
!20 = !{!14, !6, i64 16}
!21 = !{!10, !6, i64 16}
!22 = !{!14, !6, i64 24}
!23 = !{!10, !6, i64 24}
!24 = !{!10, !6, i64 32}
!25 = !{!10, !6, i64 40}
!26 = !{!14, !6, i64 48}
!27 = !{!10, !6, i64 48}
!28 = !{!14, !6, i64 64}
!29 = !{!10, !6, i64 64}
!30 = !{!14, !6, i64 40}
!31 = !{!10, !6, i64 96}
!32 = !{!14, !6, i64 32}
!33 = !{!10, !6, i64 88}


; 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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @fill_zlib_filefunc64_32_def_from_filefunc32(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  %3 = getelementptr inbounds i8, ptr %0, i64 72
  %4 = load <2 x ptr>, ptr %1, align 8, !tbaa !5
  store <2 x ptr> %4, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load <2 x ptr>, ptr %8, align 8, !tbaa !5
  store <2 x ptr> %10, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = getelementptr inbounds i8, ptr %1, i64 48
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %13, ptr %14, align 8, !tbaa !12
  store ptr %6, ptr %7, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %1, i64 64
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %16, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %1, i64 32
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  %20 = load <2 x ptr>, ptr %18, align 8, !tbaa !5
  store <2 x ptr> %20, ptr %19, align 8, !tbaa !5
  ret void
}

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

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

!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, !6, i64 56}
!10 = !{!"zlib_filefunc_def_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}
!11 = !{!10, !6, i64 48}
!12 = !{!13, !6, i64 48}
!13 = !{!"zlib_filefunc64_32_def_s", !14, i64 0, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!14 = !{!"zlib_filefunc64_def_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}
!15 = !{!13, !6, i64 56}
!16 = !{!10, !6, i64 64}
!17 = !{!13, !6, i64 64}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass