; LLVM IR from fast-pack/FastPFOR :: src/bitpackingunaligned.ll/Z24 (fastunalignedunpack6_8PKhPj)

; 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: mustprogress nounwind uwtable
define dso_local noundef ptr @_Z24__fastunalignedunpack6_8PKhPj(ptr noalias noundef %0, ptr noalias noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %6, ptr %5, align 8, !tbaa !5
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = lshr i32 %8, 0
  %10 = urem i32 %9, 64
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %10, ptr %11, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds i32, ptr %12, i32 1
  store ptr %13, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = lshr i32 %15, 6
  %17 = urem i32 %16, 64
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %17, ptr %18, align 4, !tbaa !9
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds i32, ptr %19, i32 1
  store ptr %20, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = lshr i32 %22, 12
  %24 = urem i32 %23, 64
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %24, ptr %25, align 4, !tbaa !9
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds i32, ptr %26, i32 1
  store ptr %27, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = lshr i32 %29, 18
  %31 = urem i32 %30, 64
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %31, ptr %32, align 4, !tbaa !9
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds i32, ptr %33, i32 1
  store ptr %34, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = lshr i32 %36, 24
  %38 = urem i32 %37, 64
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %38, ptr %39, align 4, !tbaa !9
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %40, i32 1
  store ptr %41, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = lshr i32 %43, 30
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %44, ptr %45, align 4, !tbaa !9
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds i32, ptr %46, i32 1
  store ptr %47, ptr %5, align 8, !tbaa !5
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = urem i32 %49, 16
  %51 = shl i32 %50, 2
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = or i32 %53, %51
  store i32 %54, ptr %52, align 4, !tbaa !9
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds i32, ptr %55, i32 1
  store ptr %56, ptr %4, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = lshr i32 %58, 4
  %60 = urem i32 %59, 64
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %60, ptr %61, align 4, !tbaa !9
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds i32, ptr %62, i32 1
  store ptr %63, ptr %4, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = lshr i32 %65, 10
  %67 = urem i32 %66, 64
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 %67, ptr %68, align 4, !tbaa !9
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds i32, ptr %69, i32 1
  store ptr %70, ptr %4, align 8, !tbaa !5
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret ptr %72
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"int", !7, i64 0}


; 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 noundef nonnull ptr @_Z24__fastunalignedunpack6_8PKhPj(ptr noalias noundef readonly %0, ptr noalias nocapture noundef writeonly %1) local_unnamed_addr #0 {
  %3 = load i32, ptr %0, align 4, !tbaa !5
  %4 = and i32 %3, 63
  store i32 %4, ptr %1, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 4
  %6 = lshr i32 %3, 6
  %7 = and i32 %6, 63
  store i32 %7, ptr %5, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = lshr i32 %3, 12
  %10 = and i32 %9, 63
  store i32 %10, ptr %8, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 12
  %12 = lshr i32 %3, 18
  %13 = and i32 %12, 63
  store i32 %13, ptr %11, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  %15 = lshr i32 %3, 24
  %16 = and i32 %15, 63
  store i32 %16, ptr %14, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %1, i64 20
  %18 = lshr i32 %3, 30
  %19 = getelementptr inbounds i8, ptr %0, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = shl i32 %20, 2
  %22 = and i32 %21, 60
  %23 = or disjoint i32 %22, %18
  store i32 %23, ptr %17, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %1, i64 24
  %25 = lshr i32 %20, 4
  %26 = and i32 %25, 63
  store i32 %26, ptr %24, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %1, i64 28
  %28 = lshr i32 %20, 10
  %29 = and i32 %28, 63
  store i32 %29, ptr %27, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 6
  ret ptr %30
}

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

!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++ TBAA"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass