; LLVM IR from Stephane-D/SGDK :: src (maths3D)

; 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.Transformation3D = type { i16, ptr, ptr, %struct.Mat3D_f16, %struct.Mat3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Mat3D_f16 = type { %struct.Vect3D_f16, %struct.Vect3D_f16, %struct.Vect3D_f16 }
%struct.Vect3D_f16 = type { i16, i16, i16 }

; 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: nounwind uwtable
declare dso_local void @M3D_buildMat3D(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @M3D_rotate(ptr noundef %0, ptr noundef %1, ptr noundef %2, i16 noundef zeroext %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  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 i16 %3, ptr %8, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Transformation3D, ptr %15, i32 0, i32 0
  %17 = load i16, ptr %16, align 8, !tbaa !11
  %18 = icmp ne i16 %17, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  call void @M3D_buildMat3D(ptr noundef %20)
  br label %21

21:                                               ; preds = %19, %4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %22, ptr %9, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %23, ptr %10, align 8, !tbaa !5
  %24 = load i16, ptr %8, align 2, !tbaa !9
  store i16 %24, ptr %11, align 2, !tbaa !9
  br label %25

25:                                               ; preds = %29, %21
  %26 = load i16, ptr %11, align 2, !tbaa !9
  %27 = add i16 %26, -1
  store i16 %27, ptr %11, align 2, !tbaa !9
  %28 = icmp ne i16 %26, 0
  br i1 %28, label %29, label %138

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #2
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds i16, ptr %30, i32 1
  store ptr %31, ptr %9, align 8, !tbaa !5
  %32 = load i16, ptr %30, align 2, !tbaa !9
  store i16 %32, ptr %12, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #2
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds i16, ptr %33, i32 1
  store ptr %34, ptr %9, align 8, !tbaa !5
  %35 = load i16, ptr %33, align 2, !tbaa !9
  store i16 %35, ptr %13, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #2
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds i16, ptr %36, i32 1
  store ptr %37, ptr %9, align 8, !tbaa !5
  %38 = load i16, ptr %36, align 2, !tbaa !9
  store i16 %38, ptr %14, align 2, !tbaa !9
  %39 = load i16, ptr %12, align 2, !tbaa !9
  %40 = sext i16 %39 to i32
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.Transformation3D, ptr %41, i32 0, i32 3
  %43 = getelementptr inbounds %struct.Mat3D_f16, ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %struct.Vect3D_f16, ptr %43, i32 0, i32 0
  %45 = load i16, ptr %44, align 8, !tbaa !15
  %46 = sext i16 %45 to i32
  %47 = mul nsw i32 %40, %46
  %48 = load i16, ptr %13, align 2, !tbaa !9
  %49 = sext i16 %48 to i32
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Transformation3D, ptr %50, i32 0, i32 3
  %52 = getelementptr inbounds %struct.Mat3D_f16, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %struct.Vect3D_f16, ptr %52, i32 0, i32 1
  %54 = load i16, ptr %53, align 2, !tbaa !16
  %55 = sext i16 %54 to i32
  %56 = mul nsw i32 %49, %55
  %57 = add nsw i32 %47, %56
  %58 = load i16, ptr %14, align 2, !tbaa !9
  %59 = sext i16 %58 to i32
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Transformation3D, ptr %60, i32 0, i32 3
  %62 = getelementptr inbounds %struct.Mat3D_f16, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.Vect3D_f16, ptr %62, i32 0, i32 2
  %64 = load i16, ptr %63, align 4, !tbaa !17
  %65 = sext i16 %64 to i32
  %66 = mul nsw i32 %59, %65
  %67 = add nsw i32 %57, %66
  %68 = ashr i32 %67, 6
  %69 = trunc i32 %68 to i16
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds i16, ptr %70, i32 1
  store ptr %71, ptr %10, align 8, !tbaa !5
  store i16 %69, ptr %70, align 2, !tbaa !9
  %72 = load i16, ptr %12, align 2, !tbaa !9
  %73 = sext i16 %72 to i32
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Transformation3D, ptr %74, i32 0, i32 3
  %76 = getelementptr inbounds %struct.Mat3D_f16, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %struct.Vect3D_f16, ptr %76, i32 0, i32 0
  %78 = load i16, ptr %77, align 2, !tbaa !18
  %79 = sext i16 %78 to i32
  %80 = mul nsw i32 %73, %79
  %81 = load i16, ptr %13, align 2, !tbaa !9
  %82 = sext i16 %81 to i32
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Transformation3D, ptr %83, i32 0, i32 3
  %85 = getelementptr inbounds %struct.Mat3D_f16, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds %struct.Vect3D_f16, ptr %85, i32 0, i32 1
  %87 = load i16, ptr %86, align 2, !tbaa !19
  %88 = sext i16 %87 to i32
  %89 = mul nsw i32 %82, %88
  %90 = add nsw i32 %80, %89
  %91 = load i16, ptr %14, align 2, !tbaa !9
  %92 = sext i16 %91 to i32
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.Transformation3D, ptr %93, i32 0, i32 3
  %95 = getelementptr inbounds %struct.Mat3D_f16, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds %struct.Vect3D_f16, ptr %95, i32 0, i32 2
  %97 = load i16, ptr %96, align 2, !tbaa !20
  %98 = sext i16 %97 to i32
  %99 = mul nsw i32 %92, %98
  %100 = add nsw i32 %90, %99
  %101 = ashr i32 %100, 6
  %102 = trunc i32 %101 to i16
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds i16, ptr %103, i32 1
  store ptr %104, ptr %10, align 8, !tbaa !5
  store i16 %102, ptr %103, align 2, !tbaa !9
  %105 = load i16, ptr %12, align 2, !tbaa !9
  %106 = sext i16 %105 to i32
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Transformation3D, ptr %107, i32 0, i32 3
  %109 = getelementptr inbounds %struct.Mat3D_f16, ptr %108, i32 0, i32 2
  %110 = getelementptr inbounds %struct.Vect3D_f16, ptr %109, i32 0, i32 0
  %111 = load i16, ptr %110, align 4, !tbaa !21
  %112 = sext i16 %111 to i32
  %113 = mul nsw i32 %106, %112
  %114 = load i16, ptr %13, align 2, !tbaa !9
  %115 = sext i16 %114 to i32
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Transformation3D, ptr %116, i32 0, i32 3
  %118 = getelementptr inbounds %struct.Mat3D_f16, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds %struct.Vect3D_f16, ptr %118, i32 0, i32 1
  %120 = load i16, ptr %119, align 2, !tbaa !22
  %121 = sext i16 %120 to i32
  %122 = mul nsw i32 %115, %121
  %123 = add nsw i32 %113, %122
  %124 = load i16, ptr %14, align 2, !tbaa !9
  %125 = sext i16 %124 to i32
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.Transformation3D, ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds %struct.Mat3D_f16, ptr %127, i32 0, i32 2
  %129 = getelementptr inbounds %struct.Vect3D_f16, ptr %128, i32 0, i32 2
  %130 = load i16, ptr %129, align 4, !tbaa !23
  %131 = sext i16 %130 to i32
  %132 = mul nsw i32 %125, %131
  %133 = add nsw i32 %123, %132
  %134 = ashr i32 %133, 6
  %135 = trunc i32 %134 to i16
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = getelementptr inbounds i16, ptr %136, i32 1
  store ptr %137, ptr %10, align 8, !tbaa !5
  store i16 %135, ptr %136, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #2
  br label %25, !llvm.loop !24

138:                                              ; preds = %25
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 42, !14, i64 60, !14, i64 66}
!13 = !{!"", !14, i64 0, !14, i64 6, !14, i64 12}
!14 = !{!"", !10, i64 0, !10, i64 2, !10, i64 4}
!15 = !{!12, !10, i64 24}
!16 = !{!12, !10, i64 26}
!17 = !{!12, !10, i64 28}
!18 = !{!12, !10, i64 30}
!19 = !{!12, !10, i64 32}
!20 = !{!12, !10, i64 34}
!21 = !{!12, !10, i64 36}
!22 = !{!12, !10, i64 38}
!23 = !{!12, !10, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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
declare dso_local void @M3D_buildMat3D(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @M3D_rotate(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef writeonly %2, i16 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = load i16, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i16 %5, 0
  br i1 %.not, label %7, label %6

6:                                                ; preds = %4
  tail call void @M3D_buildMat3D(ptr noundef nonnull %0)
  br label %7

7:                                                ; preds = %6, %4
  %.not3132 = icmp eq i16 %3, 0
  br i1 %.not3132, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = getelementptr inbounds i8, ptr %0, i64 26
  %10 = getelementptr inbounds i8, ptr %0, i64 28
  %11 = getelementptr inbounds i8, ptr %0, i64 30
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = getelementptr inbounds i8, ptr %0, i64 34
  %14 = getelementptr inbounds i8, ptr %0, i64 36
  %15 = getelementptr inbounds i8, ptr %0, i64 38
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = zext i16 %3 to i64
  %min.iters.check = icmp ult i16 %3, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %18 = add i16 %3, -1
  %19 = zext i16 %18 to i64
  %20 = mul nuw nsw i64 %19, 6
  %21 = add nuw nsw i64 %20, 6
  %scevgep = getelementptr i8, ptr %2, i64 %21
  %scevgep36 = getelementptr i8, ptr %1, i64 %21
  %scevgep37 = getelementptr i8, ptr %0, i64 42
  %bound0 = icmp ugt ptr %scevgep36, %2
  %bound1 = icmp ugt ptr %scevgep, %1
  %found.conflict = and i1 %bound0, %bound1
  %bound038 = icmp ugt ptr %scevgep37, %2
  %bound139 = icmp ult ptr %8, %scevgep
  %found.conflict40 = and i1 %bound038, %bound139
  %conflict.rdx = or i1 %found.conflict, %found.conflict40
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %17, 65528
  %22 = mul nuw nsw i64 %n.vec, 6
  %ind.end = getelementptr i8, ptr %1, i64 %22
  %23 = mul nuw nsw i64 %n.vec, 6
  %ind.end41 = getelementptr i8, ptr %2, i64 %23
  %.cast = trunc nuw i64 %n.vec to i16
  %ind.end43 = sub i16 %3, %.cast
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = mul i64 %index, 6
  %next.gep = getelementptr i8, ptr %1, i64 %offset.idx
  %offset.idx45 = mul i64 %index, 6
  %next.gep46 = getelementptr i8, ptr %2, i64 %offset.idx45
  %wide.vec = load <24 x i16>, ptr %next.gep, align 2, !tbaa !13
  %strided.vec = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 0, i32 3, i32 6, i32 9, i32 12, i32 15, i32 18, i32 21>
  %strided.vec47 = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 1, i32 4, i32 7, i32 10, i32 13, i32 16, i32 19, i32 22>
  %strided.vec48 = shufflevector <24 x i16> %wide.vec, <24 x i16> poison, <8 x i32> <i32 2, i32 5, i32 8, i32 11, i32 14, i32 17, i32 20, i32 23>
  %24 = sext <8 x i16> %strided.vec to <8 x i32>
  %25 = load i16, ptr %8, align 8, !tbaa !14, !alias.scope !15
  %broadcast.splatinsert = insertelement <8 x i16> poison, i16 %25, i64 0
  %broadcast.splat = shufflevector <8 x i16> %broadcast.splatinsert, <8 x i16> poison, <8 x i32> zeroinitializer
  %26 = sext <8 x i16> %broadcast.splat to <8 x i32>
  %27 = mul nsw <8 x i32> %26, %24
  %28 = sext <8 x i16> %strided.vec47 to <8 x i32>
  %29 = load i16, ptr %9, align 2, !tbaa !18, !alias.scope !15
  %broadcast.splatinsert49 = insertelement <8 x i16> poison, i16 %29, i64 0
  %broadcast.splat50 = shufflevector <8 x i16> %broadcast.splatinsert49, <8 x i16> poison, <8 x i32> zeroinitializer
  %30 = sext <8 x i16> %broadcast.splat50 to <8 x i32>
  %31 = mul nsw <8 x i32> %30, %28
  %32 = add nsw <8 x i32> %31, %27
  %33 = sext <8 x i16> %strided.vec48 to <8 x i32>
  %34 = load i16, ptr %10, align 4, !tbaa !19, !alias.scope !15
  %broadcast.splatinsert51 = insertelement <8 x i16> poison, i16 %34, i64 0
  %broadcast.splat52 = shufflevector <8 x i16> %broadcast.splatinsert51, <8 x i16> poison, <8 x i32> zeroinitializer
  %35 = sext <8 x i16> %broadcast.splat52 to <8 x i32>
  %36 = mul nsw <8 x i32> %35, %33
  %37 = add nsw <8 x i32> %32, %36
  %38 = lshr <8 x i32> %37, <i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6>
  %39 = trunc <8 x i32> %38 to <8 x i16>
  %40 = load i16, ptr %11, align 2, !tbaa !20, !alias.scope !15
  %broadcast.splatinsert53 = insertelement <8 x i16> poison, i16 %40, i64 0
  %broadcast.splat54 = shufflevector <8 x i16> %broadcast.splatinsert53, <8 x i16> poison, <8 x i32> zeroinitializer
  %41 = sext <8 x i16> %broadcast.splat54 to <8 x i32>
  %42 = mul nsw <8 x i32> %41, %24
  %43 = load i16, ptr %12, align 2, !tbaa !21, !alias.scope !15
  %broadcast.splatinsert55 = insertelement <8 x i16> poison, i16 %43, i64 0
  %broadcast.splat56 = shufflevector <8 x i16> %broadcast.splatinsert55, <8 x i16> poison, <8 x i32> zeroinitializer
  %44 = sext <8 x i16> %broadcast.splat56 to <8 x i32>
  %45 = mul nsw <8 x i32> %44, %28
  %46 = add nsw <8 x i32> %45, %42
  %47 = load i16, ptr %13, align 2, !tbaa !22, !alias.scope !15
  %broadcast.splatinsert57 = insertelement <8 x i16> poison, i16 %47, i64 0
  %broadcast.splat58 = shufflevector <8 x i16> %broadcast.splatinsert57, <8 x i16> poison, <8 x i32> zeroinitializer
  %48 = sext <8 x i16> %broadcast.splat58 to <8 x i32>
  %49 = mul nsw <8 x i32> %48, %33
  %50 = add nsw <8 x i32> %46, %49
  %51 = lshr <8 x i32> %50, <i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6>
  %52 = trunc <8 x i32> %51 to <8 x i16>
  %53 = load i16, ptr %14, align 4, !tbaa !23, !alias.scope !15
  %broadcast.splatinsert59 = insertelement <8 x i16> poison, i16 %53, i64 0
  %broadcast.splat60 = shufflevector <8 x i16> %broadcast.splatinsert59, <8 x i16> poison, <8 x i32> zeroinitializer
  %54 = sext <8 x i16> %broadcast.splat60 to <8 x i32>
  %55 = mul nsw <8 x i32> %54, %24
  %56 = load i16, ptr %15, align 2, !tbaa !24, !alias.scope !15
  %broadcast.splatinsert61 = insertelement <8 x i16> poison, i16 %56, i64 0
  %broadcast.splat62 = shufflevector <8 x i16> %broadcast.splatinsert61, <8 x i16> poison, <8 x i32> zeroinitializer
  %57 = sext <8 x i16> %broadcast.splat62 to <8 x i32>
  %58 = mul nsw <8 x i32> %57, %28
  %59 = add nsw <8 x i32> %58, %55
  %60 = load i16, ptr %16, align 4, !tbaa !25, !alias.scope !15
  %broadcast.splatinsert63 = insertelement <8 x i16> poison, i16 %60, i64 0
  %broadcast.splat64 = shufflevector <8 x i16> %broadcast.splatinsert63, <8 x i16> poison, <8 x i32> zeroinitializer
  %61 = sext <8 x i16> %broadcast.splat64 to <8 x i32>
  %62 = mul nsw <8 x i32> %61, %33
  %63 = add nsw <8 x i32> %59, %62
  %64 = lshr <8 x i32> %63, <i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6>
  %65 = trunc <8 x i32> %64 to <8 x i16>
  %66 = shufflevector <8 x i16> %39, <8 x i16> %52, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
  %67 = shufflevector <8 x i16> %65, <8 x i16> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
  %interleaved.vec = shufflevector <16 x i16> %66, <16 x i16> %67, <24 x i32> <i32 0, i32 8, i32 16, i32 1, i32 9, i32 17, i32 2, i32 10, i32 18, i32 3, i32 11, i32 19, i32 4, i32 12, i32 20, i32 5, i32 13, i32 21, i32 6, i32 14, i32 22, i32 7, i32 15, i32 23>
  store <24 x i16> %interleaved.vec, ptr %next.gep46, align 2, !tbaa !13
  %index.next = add nuw i64 %index, 8
  %68 = icmp eq i64 %index.next, %n.vec
  br i1 %68, label %middle.block, label %vector.body, !llvm.loop !26

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %17
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %.035.ph = phi ptr [ %1, %vector.memcheck ], [ %1, %.lr.ph ], [ %ind.end, %middle.block ]
  %.02934.ph = phi ptr [ %2, %vector.memcheck ], [ %2, %.lr.ph ], [ %ind.end41, %middle.block ]
  %.03033.ph = phi i16 [ %3, %vector.memcheck ], [ %3, %.lr.ph ], [ %ind.end43, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.035 = phi ptr [ %74, %scalar.ph ], [ %.035.ph, %scalar.ph.preheader ]
  %.02934 = phi ptr [ %120, %scalar.ph ], [ %.02934.ph, %scalar.ph.preheader ]
  %.03033 = phi i16 [ %69, %scalar.ph ], [ %.03033.ph, %scalar.ph.preheader ]
  %69 = add i16 %.03033, -1
  %70 = getelementptr inbounds i8, ptr %.035, i64 2
  %71 = load i16, ptr %.035, align 2, !tbaa !13
  %72 = getelementptr inbounds i8, ptr %.035, i64 4
  %73 = load i16, ptr %70, align 2, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %.035, i64 6
  %75 = load i16, ptr %72, align 2, !tbaa !13
  %76 = sext i16 %71 to i32
  %77 = load i16, ptr %8, align 8, !tbaa !14
  %78 = sext i16 %77 to i32
  %79 = mul nsw i32 %78, %76
  %80 = sext i16 %73 to i32
  %81 = load i16, ptr %9, align 2, !tbaa !18
  %82 = sext i16 %81 to i32
  %83 = mul nsw i32 %82, %80
  %84 = add nsw i32 %83, %79
  %85 = sext i16 %75 to i32
  %86 = load i16, ptr %10, align 4, !tbaa !19
  %87 = sext i16 %86 to i32
  %88 = mul nsw i32 %87, %85
  %89 = add nsw i32 %84, %88
  %90 = lshr i32 %89, 6
  %91 = trunc i32 %90 to i16
  %92 = getelementptr inbounds i8, ptr %.02934, i64 2
  store i16 %91, ptr %.02934, align 2, !tbaa !13
  %93 = load i16, ptr %11, align 2, !tbaa !20
  %94 = sext i16 %93 to i32
  %95 = mul nsw i32 %94, %76
  %96 = load i16, ptr %12, align 2, !tbaa !21
  %97 = sext i16 %96 to i32
  %98 = mul nsw i32 %97, %80
  %99 = add nsw i32 %98, %95
  %100 = load i16, ptr %13, align 2, !tbaa !22
  %101 = sext i16 %100 to i32
  %102 = mul nsw i32 %101, %85
  %103 = add nsw i32 %99, %102
  %104 = lshr i32 %103, 6
  %105 = trunc i32 %104 to i16
  %106 = getelementptr inbounds i8, ptr %.02934, i64 4
  store i16 %105, ptr %92, align 2, !tbaa !13
  %107 = load i16, ptr %14, align 4, !tbaa !23
  %108 = sext i16 %107 to i32
  %109 = mul nsw i32 %108, %76
  %110 = load i16, ptr %15, align 2, !tbaa !24
  %111 = sext i16 %110 to i32
  %112 = mul nsw i32 %111, %80
  %113 = add nsw i32 %112, %109
  %114 = load i16, ptr %16, align 4, !tbaa !25
  %115 = sext i16 %114 to i32
  %116 = mul nsw i32 %115, %85
  %117 = add nsw i32 %113, %116
  %118 = lshr i32 %117, 6
  %119 = trunc i32 %118 to i16
  %120 = getelementptr inbounds i8, ptr %.02934, i64 6
  store i16 %119, ptr %106, align 2, !tbaa !13
  %.not31 = icmp eq i16 %69, 0
  br i1 %.not31, label %._crit_edge, label %scalar.ph, !llvm.loop !30

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %7
  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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 42, !12, i64 60, !12, i64 66}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"", !12, i64 0, !12, i64 6, !12, i64 12}
!12 = !{!"", !7, i64 0, !7, i64 2, !7, i64 4}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 24}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!6, !7, i64 26}
!19 = !{!6, !7, i64 28}
!20 = !{!6, !7, i64 30}
!21 = !{!6, !7, i64 32}
!22 = !{!6, !7, i64 34}
!23 = !{!6, !7, i64 36}
!24 = !{!6, !7, i64 38}
!25 = !{!6, !7, i64 40}
!26 = distinct !{!26, !27, !28, !29}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!"llvm.loop.isvectorized", i32 1}
!29 = !{!"llvm.loop.unroll.runtime.disable"}
!30 = distinct !{!30, !27, !28}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass