; LLVM IR from zjhellofss/KuiperInfer :: source/runtime/pnnx (store_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.pnnx::local_file_header" = type <{ i16, i16, i16, i16, i16, i32, i32, i32, i16, i16 }>
%"struct.pnnx::zip64_extended_extra_field" = type <{ i64, i64, i64, i32 }>
%"struct.pnnx::StoreZipWriter::StoreZipMeta" = type { %"class.std::__cxx11::basic_string", i64, i32, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.pnnx::StoreZipWriter" = type { ptr, %"class.std::vector.6" }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<pnnx::StoreZipWriter::StoreZipMeta, std::allocator<pnnx::StoreZipWriter::StoreZipMeta>>::_Vector_impl" }
%"struct.std::_Vector_base<pnnx::StoreZipWriter::StoreZipMeta, std::allocator<pnnx::StoreZipWriter::StoreZipMeta>>::_Vector_impl" = type { %"struct.std::_Vector_base<pnnx::StoreZipWriter::StoreZipMeta, std::allocator<pnnx::StoreZipWriter::StoreZipMeta>>::_Vector_impl_data" }
%"struct.std::_Vector_base<pnnx::StoreZipWriter::StoreZipMeta, std::allocator<pnnx::StoreZipWriter::StoreZipMeta>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

declare i64 @ftell(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4pnnx14StoreZipWriter10write_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, i64 noundef %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.pnnx::local_file_header", align 1
  %13 = alloca %"struct.pnnx::zip64_extended_extra_field", align 1
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca %"struct.pnnx::StoreZipWriter::StoreZipMeta", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %20 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = call i64 @ftell(ptr noundef %21)
  store i64 %22, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 67324752, ptr %10, align 4, !tbaa !17
  %23 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = call i64 @fwrite(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = call noundef i32 @_ZN4pnnxL12CRC32_bufferEPKhm(ptr noundef %26, i64 noundef %27)
  store i32 %28, ptr %11, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 26, ptr %12) #5
  %29 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 0
  store i16 0, ptr %29, align 1, !tbaa !19
  %30 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 1
  store i16 0, ptr %30, align 1, !tbaa !22
  %31 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 2
  store i16 0, ptr %31, align 1, !tbaa !23
  %32 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 3
  store i16 0, ptr %32, align 1, !tbaa !24
  %33 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 4
  store i16 0, ptr %33, align 1, !tbaa !25
  %34 = load i32, ptr %11, align 4, !tbaa !17
  %35 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 5
  store i32 %34, ptr %35, align 1, !tbaa !26
  %36 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 6
  store i32 -1, ptr %36, align 1, !tbaa !27
  %37 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 7
  store i32 -1, ptr %37, align 1, !tbaa !28
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %38) #5
  %40 = trunc i64 %39 to i16
  %41 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 8
  store i16 %40, ptr %41, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 28, ptr %13) #5
  %42 = load i64, ptr %8, align 8, !tbaa !9
  %43 = getelementptr inbounds %"struct.pnnx::zip64_extended_extra_field", ptr %13, i32 0, i32 0
  store i64 %42, ptr %43, align 1, !tbaa !30
  %44 = load i64, ptr %8, align 8, !tbaa !9
  %45 = getelementptr inbounds %"struct.pnnx::zip64_extended_extra_field", ptr %13, i32 0, i32 1
  store i64 %44, ptr %45, align 1, !tbaa !32
  %46 = getelementptr inbounds %"struct.pnnx::zip64_extended_extra_field", ptr %13, i32 0, i32 2
  store i64 0, ptr %46, align 1, !tbaa !33
  %47 = getelementptr inbounds %"struct.pnnx::zip64_extended_extra_field", ptr %13, i32 0, i32 3
  store i32 0, ptr %47, align 1, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #5
  store i16 1, ptr %14, align 2, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #5
  store i16 28, ptr %15, align 2, !tbaa !35
  %48 = getelementptr inbounds %"struct.pnnx::local_file_header", ptr %12, i32 0, i32 9
  store i16 32, ptr %48, align 1, !tbaa !36
  %49 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %51 = call i64 @fwrite(ptr noundef %12, i64 noundef 26, i64 noundef 1, ptr noundef %50)
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %52) #5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %54) #5
  %56 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = call i64 @fwrite(ptr noundef %53, i64 noundef %55, i64 noundef 1, ptr noundef %57)
  %59 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = call i64 @fwrite(ptr noundef %14, i64 noundef 2, i64 noundef 1, ptr noundef %60)
  %62 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = call i64 @fwrite(ptr noundef %15, i64 noundef 2, i64 noundef 1, ptr noundef %63)
  %65 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !11
  %67 = call i64 @fwrite(ptr noundef %13, i64 noundef 28, i64 noundef 1, ptr noundef %66)
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load i64, ptr %8, align 8, !tbaa !9
  %70 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = call i64 @fwrite(ptr noundef %68, i64 noundef %69, i64 noundef 1, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #5
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %16) #5
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.pnnx::StoreZipWriter::StoreZipMeta", ptr %16, i32 0, i32 0
  %75 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %74, ptr noundef nonnull align 8 dereferenceable(32) %73)
          to label %76 unwind label %85

76:                                               ; preds = %4
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = getelementptr inbounds %"struct.pnnx::StoreZipWriter::StoreZipMeta", ptr %16, i32 0, i32 1
  store i64 %77, ptr %78, align 8, !tbaa !37
  %79 = load i32, ptr %11, align 4, !tbaa !17
  %80 = getelementptr inbounds %"struct.pnnx::StoreZipWriter::StoreZipMeta", ptr %16, i32 0, i32 2
  store i32 %79, ptr %80, align 8, !tbaa !41
  %81 = load i64, ptr %8, align 8, !tbaa !9
  %82 = getelementptr inbounds %"struct.pnnx::StoreZipWriter::StoreZipMeta", ptr %16, i32 0, i32 3
  store i64 %81, ptr %82, align 8, !tbaa !42
  %83 = getelementptr inbounds %"class.pnnx::StoreZipWriter", ptr %19, i32 0, i32 1
  invoke void @_ZNSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 8 dereferenceable(56) %16)
          to label %84 unwind label %85

84:                                               ; preds = %76
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %16) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 26, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret i32 0

85:                                               ; preds = %76, %4
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %17, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %18, align 4
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %16) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 26, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %89

89:                                               ; preds = %85
  %90 = load ptr, ptr %17, align 8
  %91 = load i32, ptr %18, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN4pnnxL12CRC32_bufferEPKhm(ptr noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4pnnx14StoreZipWriter12StoreZipMetaC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

attributes #0 = { mustprogress 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN4pnnx14StoreZipWriterE", !6, i64 0, !13, i64 8}
!13 = !{!"_ZTSSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTSN4pnnx17local_file_headerE", !21, i64 0, !21, i64 2, !21, i64 4, !21, i64 6, !21, i64 8, !18, i64 10, !18, i64 14, !18, i64 18, !21, i64 22, !21, i64 24}
!21 = !{!"short", !7, i64 0}
!22 = !{!20, !21, i64 2}
!23 = !{!20, !21, i64 4}
!24 = !{!20, !21, i64 6}
!25 = !{!20, !21, i64 8}
!26 = !{!20, !18, i64 10}
!27 = !{!20, !18, i64 14}
!28 = !{!20, !18, i64 18}
!29 = !{!20, !21, i64 22}
!30 = !{!31, !10, i64 0}
!31 = !{!"_ZTSN4pnnx26zip64_extended_extra_fieldE", !10, i64 0, !10, i64 8, !10, i64 16, !18, i64 24}
!32 = !{!31, !10, i64 8}
!33 = !{!31, !10, i64 16}
!34 = !{!31, !18, i64 24}
!35 = !{!21, !21, i64 0}
!36 = !{!20, !21, i64 24}
!37 = !{!38, !10, i64 32}
!38 = !{!"_ZTSN4pnnx14StoreZipWriter12StoreZipMetaE", !39, i64 0, !10, i64 32, !18, i64 40, !10, i64 48}
!39 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !40, i64 0, !10, i64 8, !7, i64 16}
!40 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!41 = !{!38, !18, i64 40}
!42 = !{!38, !10, i64 48}


; 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.pnnx::local_file_header" = type <{ i16, i16, i16, i16, i16, i32, i32, i32, i16, i16 }>
%"struct.pnnx::zip64_extended_extra_field" = type <{ i64, i64, i64, i32 }>
%"struct.pnnx::StoreZipWriter::StoreZipMeta" = type { %"class.std::__cxx11::basic_string", i64, i32, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

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

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4pnnx14StoreZipWriter10write_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %"struct.pnnx::local_file_header", align 1
  %7 = alloca %"struct.pnnx::zip64_extended_extra_field", align 8
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = alloca %"struct.pnnx::StoreZipWriter::StoreZipMeta", align 8
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = tail call i64 @ftell(ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 67324752, ptr %5, align 4, !tbaa !14
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef %13)
  %15 = tail call noundef i32 @_ZN4pnnxL12CRC32_bufferEPKhm(ptr noundef %2, i64 noundef %3)
  call void @llvm.lifetime.start.p0(i64 26, ptr nonnull %6) #6
  %16 = getelementptr inbounds i8, ptr %6, i64 10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %6, i8 0, i64 10, i1 false)
  store i32 %15, ptr %16, align 1, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %6, i64 14
  store i32 -1, ptr %17, align 1, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %6, i64 18
  store i32 -1, ptr %18, align 1, !tbaa !20
  %19 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %20 = trunc i64 %19 to i16
  %21 = getelementptr inbounds i8, ptr %6, i64 22
  store i16 %20, ptr %21, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %7) #6
  store i64 %3, ptr %7, align 8, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  store i64 %3, ptr %22, align 8, !tbaa !25
  %23 = getelementptr inbounds i8, ptr %7, i64 16
  store i64 0, ptr %23, align 8, !tbaa !26
  %24 = getelementptr inbounds i8, ptr %7, i64 24
  store i32 0, ptr %24, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #6
  store i16 1, ptr %8, align 2, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #6
  store i16 28, ptr %9, align 2, !tbaa !28
  %25 = getelementptr inbounds i8, ptr %6, i64 24
  store i16 32, ptr %25, align 1, !tbaa !29
  %26 = load ptr, ptr %0, align 8, !tbaa !5
  %27 = call i64 @fwrite(ptr noundef nonnull %6, i64 noundef 26, i64 noundef 1, ptr noundef %26)
  %28 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %29 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = tail call i64 @fwrite(ptr noundef %28, i64 noundef %29, i64 noundef 1, ptr noundef %30)
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = call i64 @fwrite(ptr noundef nonnull %8, i64 noundef 2, i64 noundef 1, ptr noundef %32)
  %34 = load ptr, ptr %0, align 8, !tbaa !5
  %35 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 2, i64 noundef 1, ptr noundef %34)
  %36 = load ptr, ptr %0, align 8, !tbaa !5
  %37 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 28, i64 noundef 1, ptr noundef %36)
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = tail call i64 @fwrite(ptr noundef %2, i64 noundef %3, i64 noundef 1, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #6
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #6
  %40 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %41 unwind label %47

41:                                               ; preds = %4
  %42 = getelementptr inbounds i8, ptr %10, i64 32
  store i64 %12, ptr %42, align 8, !tbaa !30
  %43 = getelementptr inbounds i8, ptr %10, i64 40
  store i32 %15, ptr %43, align 8, !tbaa !34
  %44 = getelementptr inbounds i8, ptr %10, i64 48
  store i64 %3, ptr %44, align 8, !tbaa !35
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  invoke void @_ZNSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(56) %10)
          to label %46 unwind label %47

46:                                               ; preds = %41
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  ret i32 0

47:                                               ; preds = %41, %4
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %10) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 26, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  resume { ptr, i32 } %48
}

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN4pnnxL12CRC32_bufferEPKhm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4pnnx14StoreZipWriter12StoreZipMetaC2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4pnnx14StoreZipWriter12StoreZipMetaD2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #4 align 2

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

!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, !7, i64 0}
!6 = !{!"_ZTSN4pnnx14StoreZipWriterE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN4pnnx14StoreZipWriter12StoreZipMetaESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!17, !15, i64 10}
!17 = !{!"_ZTSN4pnnx17local_file_headerE", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8, !15, i64 10, !15, i64 14, !15, i64 18, !18, i64 22, !18, i64 24}
!18 = !{!"short", !8, i64 0}
!19 = !{!17, !15, i64 14}
!20 = !{!17, !15, i64 18}
!21 = !{!17, !18, i64 22}
!22 = !{!23, !24, i64 0}
!23 = !{!"_ZTSN4pnnx26zip64_extended_extra_fieldE", !24, i64 0, !24, i64 8, !24, i64 16, !15, i64 24}
!24 = !{!"long", !8, i64 0}
!25 = !{!23, !24, i64 8}
!26 = !{!23, !24, i64 16}
!27 = !{!23, !15, i64 24}
!28 = !{!18, !18, i64 0}
!29 = !{!17, !18, i64 24}
!30 = !{!31, !24, i64 32}
!31 = !{!"_ZTSN4pnnx14StoreZipWriter12StoreZipMetaE", !32, i64 0, !24, i64 32, !15, i64 40, !24, i64 48}
!32 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !33, i64 0, !24, i64 8, !8, i64 16}
!33 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!34 = !{!31, !15, i64 40}
!35 = !{!31, !24, i64 48}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass