; LLVM IR from troldal/KZip :: KZip/KZip.ll/ZN4KZip8ZipEntryC2ERKNSt7 (cxx1112basic_stringIcSt11char_traitsIcESaIcEEE)

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

%"class.KZip::ZipEntry" = type { %struct.mz_zip_archive_file_stat, %"class.std::vector" }
%struct.mz_zip_archive_file_stat = type { i32, i64, i16, i16, i16, i16, i64, i32, i64, i64, i16, i32, i64, i32, i32, i32, i32, [512 x i8], [512 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4KZip8ZipEntryC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1136) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #0 align 2 {
  %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
  %6 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 1112, i1 false)
  %7 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  %8 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %9 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %8, i32 0, i32 0
  store i32 0, ptr %9, align 8, !tbaa !9
  %10 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %11 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %10, i32 0, i32 1
  store i64 0, ptr %11, align 8, !tbaa !19
  %12 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %13 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %12, i32 0, i32 2
  store i16 0, ptr %13, align 8, !tbaa !20
  %14 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %15 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %14, i32 0, i32 3
  store i16 0, ptr %15, align 2, !tbaa !21
  %16 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %17 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %16, i32 0, i32 4
  store i16 0, ptr %17, align 4, !tbaa !22
  %18 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %19 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %18, i32 0, i32 5
  store i16 0, ptr %19, align 2, !tbaa !23
  %20 = call i64 @time(ptr noundef null) #3
  %21 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %22 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %21, i32 0, i32 6
  store i64 %20, ptr %22, align 8, !tbaa !24
  %23 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %24 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %23, i32 0, i32 7
  store i32 0, ptr %24, align 8, !tbaa !25
  %25 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %26 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %25, i32 0, i32 8
  store i64 0, ptr %26, align 8, !tbaa !26
  %27 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %28 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %27, i32 0, i32 9
  store i64 0, ptr %28, align 8, !tbaa !27
  %29 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %30 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %29, i32 0, i32 10
  store i16 0, ptr %30, align 8, !tbaa !28
  %31 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %32 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %31, i32 0, i32 11
  store i32 0, ptr %32, align 4, !tbaa !29
  %33 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %34 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %33, i32 0, i32 12
  store i64 0, ptr %34, align 8, !tbaa !30
  %35 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %36 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %35, i32 0, i32 13
  store i32 0, ptr %36, align 8, !tbaa !31
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %37) #3
  %39 = load i8, ptr %38, align 1, !tbaa !32
  %40 = sext i8 %39 to i32
  %41 = icmp eq i32 %40, 47
  %42 = zext i1 %41 to i32
  %43 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %44 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %43, i32 0, i32 14
  store i32 %42, ptr %44, align 4, !tbaa !33
  %45 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %46 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %45, i32 0, i32 15
  store i32 0, ptr %46, align 8, !tbaa !34
  %47 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %48 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %47, i32 0, i32 16
  store i32 1, ptr %48, align 4, !tbaa !35
  %49 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %50 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %49, i32 0, i32 17
  %51 = getelementptr inbounds [512 x i8], ptr %50, i64 0, i64 0
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %52) #3
  %54 = call ptr @strncpy(ptr noundef %51, ptr noundef %53, i64 noundef 512) #3
  %55 = getelementptr inbounds %"class.KZip::ZipEntry", ptr %5, i32 0, i32 0
  %56 = getelementptr inbounds %struct.mz_zip_archive_file_stat, ptr %55, i32 0, i32 18
  %57 = getelementptr inbounds [512 x i8], ptr %56, i64 0, i64 0
  %58 = call ptr @strncpy(ptr noundef %57, ptr noundef @.str, i64 noundef 512) #3
  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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

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

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #0 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 nounwind willreturn memory(argmem: write) }
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 = { 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, !12, i64 0}
!10 = !{!"_ZTSN4KZip8ZipEntryE", !11, i64 0, !15, i64 1112}
!11 = !{!"_ZTS24mz_zip_archive_file_stat", !12, i64 0, !13, i64 8, !14, i64 16, !14, i64 18, !14, i64 20, !14, i64 22, !13, i64 24, !12, i64 32, !13, i64 40, !13, i64 48, !14, i64 56, !12, i64 60, !13, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !7, i64 88, !7, i64 600}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIhSaIhEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!10, !13, i64 8}
!20 = !{!10, !14, i64 16}
!21 = !{!10, !14, i64 18}
!22 = !{!10, !14, i64 20}
!23 = !{!10, !14, i64 22}
!24 = !{!10, !13, i64 24}
!25 = !{!10, !12, i64 32}
!26 = !{!10, !13, i64 40}
!27 = !{!10, !13, i64 48}
!28 = !{!10, !14, i64 56}
!29 = !{!10, !12, i64 60}
!30 = !{!10, !13, i64 64}
!31 = !{!10, !12, i64 72}
!32 = !{!7, !7, i64 0}
!33 = !{!10, !12, i64 76}
!34 = !{!10, !12, i64 80}
!35 = !{!10, !12, i64 84}


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

@.str = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4KZip8ZipEntryC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1136) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 1112
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1136) %0, i8 0, i64 1136, i1 false)
  tail call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  store i32 0, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %5 = tail call i64 @time(ptr noundef null) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %5, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 0, ptr %7, align 8, !tbaa !19
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(18) %8, i8 0, i64 18, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  %10 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %11 = load i8, ptr %10, align 1, !tbaa !20
  %12 = icmp eq i8 %11, 47
  %13 = zext i1 %12 to i32
  %14 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %13, ptr %14, align 4, !tbaa !21
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 0, ptr %15, align 8, !tbaa !22
  %16 = getelementptr inbounds i8, ptr %0, i64 84
  store i32 1, ptr %16, align 4, !tbaa !23
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  %19 = tail call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) %18, i64 noundef 512) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 600
  %21 = tail call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef 512) #4
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #3

; 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

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 nounwind willreturn memory(argmem: write) }
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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 }

!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, !8, i64 0}
!6 = !{!"_ZTSN4KZip8ZipEntryE", !7, i64 0, !13, i64 1112}
!7 = !{!"_ZTS24mz_zip_archive_file_stat", !8, i64 0, !11, i64 8, !12, i64 16, !12, i64 18, !12, i64 20, !12, i64 22, !11, i64 24, !8, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !8, i64 60, !11, i64 64, !8, i64 72, !8, i64 76, !8, i64 80, !8, i64 84, !9, i64 88, !9, i64 600}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"short", !9, i64 0}
!13 = !{!"_ZTSSt6vectorIhSaIhEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !9, i64 0}
!18 = !{!6, !11, i64 24}
!19 = !{!6, !8, i64 32}
!20 = !{!9, !9, i64 0}
!21 = !{!6, !8, i64 76}
!22 = !{!6, !8, i64 80}
!23 = !{!6, !8, i64 84}


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