; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/C (7zArcIn)

; 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.CSzArEx = type { %struct.CSzAr, i64, i64, i32, ptr, ptr, %struct.CSzBitUi32s, %struct.CSzBitUi32s, %struct.CSzBitUi64s, %struct.CSzBitUi64s, ptr, ptr, ptr, ptr }
%struct.CSzAr = type { i32, i32, ptr, %struct.CSzBitUi32s, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.CSzBitUi32s = type { ptr, ptr }
%struct.CSzBitUi64s = type { ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @SzArEx_Init(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.CSzArEx, ptr %3, i32 0, i32 0
  call void @SzAr_Init(ptr noundef %4)
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.CSzArEx, ptr %5, i32 0, i32 3
  store i32 0, ptr %6, align 8, !tbaa !9
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.CSzArEx, ptr %7, i32 0, i32 2
  store i64 0, ptr %8, align 8, !tbaa !15
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.CSzArEx, ptr %9, i32 0, i32 4
  store ptr null, ptr %10, align 8, !tbaa !16
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.CSzArEx, ptr %11, i32 0, i32 5
  store ptr null, ptr %12, align 8, !tbaa !17
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.CSzArEx, ptr %13, i32 0, i32 10
  store ptr null, ptr %14, align 8, !tbaa !18
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.CSzArEx, ptr %15, i32 0, i32 11
  store ptr null, ptr %16, align 8, !tbaa !19
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.CSzArEx, ptr %17, i32 0, i32 12
  store ptr null, ptr %18, align 8, !tbaa !20
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.CSzArEx, ptr %19, i32 0, i32 13
  store ptr null, ptr %20, align 8, !tbaa !21
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.CSzArEx, ptr %21, i32 0, i32 6
  %23 = getelementptr inbounds %struct.CSzBitUi32s, ptr %22, i32 0, i32 0
  store ptr null, ptr %23, align 8, !tbaa !22
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.CSzArEx, ptr %24, i32 0, i32 6
  %26 = getelementptr inbounds %struct.CSzBitUi32s, ptr %25, i32 0, i32 1
  store ptr null, ptr %26, align 8, !tbaa !23
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.CSzArEx, ptr %27, i32 0, i32 7
  %29 = getelementptr inbounds %struct.CSzBitUi32s, ptr %28, i32 0, i32 0
  store ptr null, ptr %29, align 8, !tbaa !24
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.CSzArEx, ptr %30, i32 0, i32 7
  %32 = getelementptr inbounds %struct.CSzBitUi32s, ptr %31, i32 0, i32 1
  store ptr null, ptr %32, align 8, !tbaa !25
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.CSzArEx, ptr %33, i32 0, i32 8
  %35 = getelementptr inbounds %struct.CSzBitUi64s, ptr %34, i32 0, i32 0
  store ptr null, ptr %35, align 8, !tbaa !26
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.CSzArEx, ptr %36, i32 0, i32 8
  %38 = getelementptr inbounds %struct.CSzBitUi64s, ptr %37, i32 0, i32 1
  store ptr null, ptr %38, align 8, !tbaa !27
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.CSzArEx, ptr %39, i32 0, i32 9
  %41 = getelementptr inbounds %struct.CSzBitUi64s, ptr %40, i32 0, i32 0
  store ptr null, ptr %41, align 8, !tbaa !28
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.CSzArEx, ptr %42, i32 0, i32 9
  %44 = getelementptr inbounds %struct.CSzBitUi64s, ptr %43, i32 0, i32 1
  store ptr null, ptr %44, align 8, !tbaa !29
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @SzAr_Init(ptr noundef) #0

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, !12, i64 96}
!10 = !{!"", !11, i64 0, !14, i64 80, !14, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !13, i64 120, !13, i64 136, !13, i64 152, !13, i64 168, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208}
!11 = !{!"", !12, i64 0, !12, i64 4, !6, i64 8, !13, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !6, i64 0, !6, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!10, !14, i64 88}
!16 = !{!10, !6, i64 104}
!17 = !{!10, !6, i64 112}
!18 = !{!10, !6, i64 184}
!19 = !{!10, !6, i64 192}
!20 = !{!10, !6, i64 200}
!21 = !{!10, !6, i64 208}
!22 = !{!10, !6, i64 120}
!23 = !{!10, !6, i64 128}
!24 = !{!10, !6, i64 136}
!25 = !{!10, !6, i64 144}
!26 = !{!10, !6, i64 152}
!27 = !{!10, !6, i64 160}
!28 = !{!10, !6, i64 168}
!29 = !{!10, !6, i64 176}


; 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: nounwind uwtable
define dso_local void @SzArEx_Init(ptr noundef %0) local_unnamed_addr #0 {
  tail call void @SzAr_Init(ptr noundef %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 0, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 88
  store i64 0, ptr %3, align 8, !tbaa !14
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %4, i8 0, i64 112, i1 false)
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @SzAr_Init(ptr noundef) local_unnamed_addr #0

; 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 = { 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) }

!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 96}
!6 = !{!"", !7, i64 0, !13, i64 80, !13, i64 88, !8, i64 96, !11, i64 104, !11, i64 112, !12, i64 120, !12, i64 136, !12, i64 152, !12, i64 168, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208}
!7 = !{!"", !8, i64 0, !8, i64 4, !11, i64 8, !12, i64 16, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 8}
!13 = !{!"long long", !9, i64 0}
!14 = !{!6, !13, i64 88}


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