; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseDetection.ll (ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_)

; 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.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>

@.str.35 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_ = external hidden unnamed_addr constant [58 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_(ptr noundef nonnull align 8 dereferenceable(41) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(41) %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %18 = zext i1 %1 to i8
  store i8 %18, ptr %5, align 1, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZN4Simd9EqualSizeINS_9AllocatorES1_EEbRKNS_4ViewIT_EERKNS2_IT0_EE(ptr noundef nonnull align 8 dereferenceable(41) %19, ptr noundef nonnull align 8 dereferenceable(41) %20)
  br i1 %21, label %22, label %32

22:                                               ; preds = %3
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.Simd::View", ptr %23, i32 0, i32 3
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = icmp eq i32 %25, 6
  br i1 %26, label %27, label %32

27:                                               ; preds = %22
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.Simd::View", ptr %28, i32 0, i32 3
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = icmp eq i32 %30, 5
  br label %32

32:                                               ; preds = %27, %22, %3
  %33 = phi i1 [ false, %22 ], [ false, %3 ], [ %31, %27 ]
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  br label %37

35:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.42, ptr noundef @.str.35, i32 noundef 673, ptr noundef @__PRETTY_FUNCTION__._ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_) #4
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  %38 = load i8, ptr %5, align 1, !tbaa !9, !range !15, !noundef !16
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %109

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !17
  br label %41

41:                                               ; preds = %105, %40
  %42 = load i64, ptr %7, align 8, !tbaa !17
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.Simd::View", ptr %43, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !18
  %46 = icmp ult i64 %42, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %41
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %108

48:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i64, ptr %7, align 8, !tbaa !17
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41) %49, i64 noundef 0, i64 noundef %50)
  store ptr %51, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i64, ptr %7, align 8, !tbaa !17
  %54 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %52, i64 noundef 0, i64 noundef %53)
  store ptr %54, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !17
  br label %55

55:                                               ; preds = %72, %48
  %56 = load i64, ptr %11, align 8, !tbaa !17
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.Simd::View", ptr %57, i32 0, i32 0
  %59 = load i64, ptr %58, align 8, !tbaa !19
  %60 = icmp ult i64 %56, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %55
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %75

62:                                               ; preds = %55
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i64, ptr %11, align 8, !tbaa !17
  %65 = getelementptr inbounds i32, ptr %63, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = trunc i32 %66 to i16
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i64, ptr %11, align 8, !tbaa !17
  %70 = lshr i64 %69, 1
  %71 = getelementptr inbounds i16, ptr %68, i64 %70
  store i16 %67, ptr %71, align 2, !tbaa !22
  br label %72

72:                                               ; preds = %62
  %73 = load i64, ptr %11, align 8, !tbaa !17
  %74 = add i64 %73, 2
  store i64 %74, ptr %11, align 8, !tbaa !17
  br label %55, !llvm.loop !24

75:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.Simd::View", ptr %77, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !19
  %80 = add i64 %79, 1
  %81 = lshr i64 %80, 1
  %82 = load i64, ptr %7, align 8, !tbaa !17
  %83 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %76, i64 noundef %81, i64 noundef %82)
  store ptr %83, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !17
  br label %84

84:                                               ; preds = %101, %75
  %85 = load i64, ptr %13, align 8, !tbaa !17
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.Simd::View", ptr %86, i32 0, i32 0
  %88 = load i64, ptr %87, align 8, !tbaa !19
  %89 = icmp ult i64 %85, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %84
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %104

91:                                               ; preds = %84
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load i64, ptr %13, align 8, !tbaa !17
  %94 = getelementptr inbounds i32, ptr %92, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !20
  %96 = trunc i32 %95 to i16
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load i64, ptr %13, align 8, !tbaa !17
  %99 = lshr i64 %98, 1
  %100 = getelementptr inbounds i16, ptr %97, i64 %99
  store i16 %96, ptr %100, align 2, !tbaa !22
  br label %101

101:                                              ; preds = %91
  %102 = load i64, ptr %13, align 8, !tbaa !17
  %103 = add i64 %102, 2
  store i64 %103, ptr %13, align 8, !tbaa !17
  br label %84, !llvm.loop !26

104:                                              ; preds = %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i64, ptr %7, align 8, !tbaa !17
  %107 = add i64 %106, 1
  store i64 %107, ptr %7, align 8, !tbaa !17
  br label %41, !llvm.loop !27

108:                                              ; preds = %47
  br label %148

109:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !17
  br label %110

110:                                              ; preds = %144, %109
  %111 = load i64, ptr %14, align 8, !tbaa !17
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.Simd::View", ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !18
  %115 = icmp ult i64 %111, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %110
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %147

117:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i64, ptr %14, align 8, !tbaa !17
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41) %118, i64 noundef 0, i64 noundef %119)
  store ptr %120, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load i64, ptr %14, align 8, !tbaa !17
  %123 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %121, i64 noundef 0, i64 noundef %122)
  store ptr %123, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !17
  br label %124

124:                                              ; preds = %140, %117
  %125 = load i64, ptr %17, align 8, !tbaa !17
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.Simd::View", ptr %126, i32 0, i32 0
  %128 = load i64, ptr %127, align 8, !tbaa !19
  %129 = icmp ult i64 %125, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %124
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %143

131:                                              ; preds = %124
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load i64, ptr %17, align 8, !tbaa !17
  %134 = getelementptr inbounds i32, ptr %132, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !20
  %136 = trunc i32 %135 to i16
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  %138 = load i64, ptr %17, align 8, !tbaa !17
  %139 = getelementptr inbounds i16, ptr %137, i64 %138
  store i16 %136, ptr %139, align 2, !tbaa !22
  br label %140

140:                                              ; preds = %131
  %141 = load i64, ptr %17, align 8, !tbaa !17
  %142 = add i64 %141, 1
  store i64 %142, ptr %17, align 8, !tbaa !17
  br label %124, !llvm.loop !28

143:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %144

144:                                              ; preds = %143
  %145 = load i64, ptr %14, align 8, !tbaa !17
  %146 = add i64 %145, 1
  store i64 %146, ptr %14, align 8, !tbaa !17
  br label %110, !llvm.loop !29

147:                                              ; preds = %116
  br label %148

148:                                              ; preds = %147, %108
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd9EqualSizeINS_9AllocatorES1_EEbRKNS_4ViewIT_EERKNS2_IT0_EE(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef nonnull align 8 dereferenceable(41)) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #2 = { alwaysinline 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 #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 = { noreturn nounwind }
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 = !{!"bool", !7, i64 0}
!11 = !{!12, !14, i64 24}
!12 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !6, i64 32, !10, i64 40}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !13, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"short", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}
!29 = distinct !{!29, !25}


; 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.35 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__._ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_ = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_(ptr noundef nonnull align 8 dereferenceable(41) %0, i1 noundef zeroext %1, ptr noundef nonnull align 8 dereferenceable(41) %2) local_unnamed_addr #2 {
  %4 = tail call noundef zeroext i1 @_ZN4Simd9EqualSizeINS_9AllocatorES1_EEbRKNS_4ViewIT_EERKNS2_IT0_EE(ptr noundef nonnull align 8 dereferenceable(41) %0, ptr noundef nonnull align 8 dereferenceable(41) %2)
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load i32, ptr %5, align 8
  %7 = icmp eq i32 %6, 6
  %or.cond = select i1 %4, i1 %7, i1 false
  %8 = getelementptr inbounds i8, ptr %2, i64 24
  %9 = load i32, ptr %8, align 8
  %10 = icmp eq i32 %9, 5
  %or.cond50 = select i1 %or.cond, i1 %10, i1 false
  br i1 %or.cond50, label %11, label %.critedge

.critedge:                                        ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.42, ptr noundef nonnull @.str.35, i32 noundef 673, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4Simd4Base10Prepare16iERKNS_4ViewINS_9AllocatorEEEbRS3_) #3
  unreachable

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %.not67 = icmp eq i64 %13, 0
  br i1 %1, label %.preheader, label %.preheader51

.preheader51:                                     ; preds = %11
  br i1 %.not67, label %.loopexit, label %.lr.ph55

.preheader:                                       ; preds = %11
  br i1 %.not67, label %.loopexit, label %.lr.ph65

.lr.ph65:                                         ; preds = %.preheader, %._crit_edge63
  %.04264 = phi i64 [ %94, %._crit_edge63 ], [ 0, %.preheader ]
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41) %0, i64 noundef 0, i64 noundef %.04264)
  %15 = tail call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %2, i64 noundef 0, i64 noundef %.04264)
  %16 = load i64, ptr %0, align 8, !tbaa !13
  %.not68 = icmp eq i64 %16, 0
  br i1 %.not68, label %._crit_edge59, label %.lr.ph58.preheader

.lr.ph58.preheader:                               ; preds = %.lr.ph65
  %17 = add i64 %16, -1
  %18 = lshr i64 %17, 1
  %19 = add nuw i64 %18, 1
  %xtraiter = and i64 %19, 3
  %20 = icmp ult i64 %16, 7
  br i1 %20, label %._crit_edge59.loopexit.unr-lcssa, label %.lr.ph58.preheader.new

.lr.ph58.preheader.new:                           ; preds = %.lr.ph58.preheader
  %unroll_iter = and i64 %19, -4
  br label %.lr.ph58

._crit_edge59.loopexit.unr-lcssa:                 ; preds = %.lr.ph58, %.lr.ph58.preheader
  %.04556.unr = phi i64 [ 0, %.lr.ph58.preheader ], [ %93, %.lr.ph58 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge59, label %.lr.ph58.epil

.lr.ph58.epil:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa, %.lr.ph58.epil
  %.04556.epil = phi i64 [ %25, %.lr.ph58.epil ], [ %.04556.unr, %._crit_edge59.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph58.epil ], [ 0, %._crit_edge59.loopexit.unr-lcssa ]
  %21 = getelementptr inbounds i32, ptr %14, i64 %.04556.epil
  %22 = load i32, ptr %21, align 4, !tbaa !14
  %23 = trunc i32 %22 to i16
  %24 = getelementptr inbounds i8, ptr %15, i64 %.04556.epil
  store i16 %23, ptr %24, align 2, !tbaa !16
  %25 = add nuw i64 %.04556.epil, 2
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge59, label %.lr.ph58.epil, !llvm.loop !18

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit.unr-lcssa, %.lr.ph58.epil, %.lr.ph65
  %26 = load i64, ptr %2, align 8, !tbaa !13
  %27 = add i64 %26, 1
  %28 = lshr i64 %27, 1
  %29 = tail call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %2, i64 noundef %28, i64 noundef %.04264)
  %30 = load i64, ptr %0, align 8, !tbaa !13
  %31 = icmp ugt i64 %30, 1
  br i1 %31, label %.lr.ph62.preheader, label %._crit_edge63

.lr.ph62.preheader:                               ; preds = %._crit_edge59
  %32 = add i64 %30, -2
  %33 = lshr i64 %32, 1
  %34 = add nuw i64 %33, 1
  %min.iters.check75 = icmp ult i64 %32, 14
  br i1 %min.iters.check75, label %.lr.ph62.preheader84, label %vector.ph76

.lr.ph62.preheader84:                             ; preds = %middle.block73, %.lr.ph62.preheader
  %.04460.ph = phi i64 [ 1, %.lr.ph62.preheader ], [ %ind.end, %middle.block73 ]
  br label %.lr.ph62

vector.ph76:                                      ; preds = %.lr.ph62.preheader
  %n.vec78 = and i64 %34, -8
  %35 = shl i64 %n.vec78, 1
  %ind.end = or disjoint i64 %35, 1
  br label %vector.body80

vector.body80:                                    ; preds = %vector.body80, %vector.ph76
  %index81 = phi i64 [ 0, %vector.ph76 ], [ %index.next82, %vector.body80 ]
  %36 = shl i64 %index81, 1
  %offset.idx = or disjoint i64 %36, 1
  %37 = or disjoint i64 %36, 3
  %38 = or disjoint i64 %36, 5
  %39 = or disjoint i64 %36, 7
  %40 = or disjoint i64 %36, 9
  %41 = or disjoint i64 %36, 11
  %42 = or disjoint i64 %36, 13
  %43 = or disjoint i64 %36, 15
  %44 = getelementptr inbounds i32, ptr %14, i64 %offset.idx
  %45 = getelementptr inbounds i32, ptr %14, i64 %37
  %46 = getelementptr inbounds i32, ptr %14, i64 %38
  %47 = getelementptr inbounds i32, ptr %14, i64 %39
  %48 = getelementptr inbounds i32, ptr %14, i64 %40
  %49 = getelementptr inbounds i32, ptr %14, i64 %41
  %50 = getelementptr inbounds i32, ptr %14, i64 %42
  %51 = getelementptr inbounds i32, ptr %14, i64 %43
  %52 = load i32, ptr %44, align 4, !tbaa !14
  %53 = load i32, ptr %45, align 4, !tbaa !14
  %54 = load i32, ptr %46, align 4, !tbaa !14
  %55 = load i32, ptr %47, align 4, !tbaa !14
  %56 = insertelement <4 x i32> poison, i32 %52, i64 0
  %57 = insertelement <4 x i32> %56, i32 %53, i64 1
  %58 = insertelement <4 x i32> %57, i32 %54, i64 2
  %59 = insertelement <4 x i32> %58, i32 %55, i64 3
  %60 = load i32, ptr %48, align 4, !tbaa !14
  %61 = load i32, ptr %49, align 4, !tbaa !14
  %62 = load i32, ptr %50, align 4, !tbaa !14
  %63 = load i32, ptr %51, align 4, !tbaa !14
  %64 = insertelement <4 x i32> poison, i32 %60, i64 0
  %65 = insertelement <4 x i32> %64, i32 %61, i64 1
  %66 = insertelement <4 x i32> %65, i32 %62, i64 2
  %67 = insertelement <4 x i32> %66, i32 %63, i64 3
  %68 = trunc <4 x i32> %59 to <4 x i16>
  %69 = trunc <4 x i32> %67 to <4 x i16>
  %70 = and i64 %index81, 9223372036854775800
  %71 = getelementptr inbounds i16, ptr %29, i64 %70
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  store <4 x i16> %68, ptr %71, align 2, !tbaa !16
  store <4 x i16> %69, ptr %72, align 2, !tbaa !16
  %index.next82 = add nuw i64 %index81, 8
  %73 = icmp eq i64 %index.next82, %n.vec78
  br i1 %73, label %middle.block73, label %vector.body80, !llvm.loop !20

middle.block73:                                   ; preds = %vector.body80
  %cmp.n83 = icmp eq i64 %34, %n.vec78
  br i1 %cmp.n83, label %._crit_edge63, label %.lr.ph62.preheader84

.lr.ph58:                                         ; preds = %.lr.ph58, %.lr.ph58.preheader.new
  %.04556 = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %93, %.lr.ph58 ]
  %niter = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %niter.next.3, %.lr.ph58 ]
  %74 = getelementptr inbounds i32, ptr %14, i64 %.04556
  %75 = load i32, ptr %74, align 4, !tbaa !14
  %76 = trunc i32 %75 to i16
  %77 = getelementptr inbounds i8, ptr %15, i64 %.04556
  store i16 %76, ptr %77, align 2, !tbaa !16
  %78 = or disjoint i64 %.04556, 2
  %79 = getelementptr inbounds i32, ptr %14, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !14
  %81 = trunc i32 %80 to i16
  %82 = getelementptr inbounds i8, ptr %15, i64 %78
  store i16 %81, ptr %82, align 2, !tbaa !16
  %83 = or disjoint i64 %.04556, 4
  %84 = getelementptr inbounds i32, ptr %14, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !14
  %86 = trunc i32 %85 to i16
  %87 = getelementptr inbounds i8, ptr %15, i64 %83
  store i16 %86, ptr %87, align 2, !tbaa !16
  %88 = or disjoint i64 %.04556, 6
  %89 = getelementptr inbounds i32, ptr %14, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !14
  %91 = trunc i32 %90 to i16
  %92 = getelementptr inbounds i8, ptr %15, i64 %88
  store i16 %91, ptr %92, align 2, !tbaa !16
  %93 = add nuw i64 %.04556, 8
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3.not = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3.not, label %._crit_edge59.loopexit.unr-lcssa, label %.lr.ph58, !llvm.loop !24

._crit_edge63:                                    ; preds = %.lr.ph62, %middle.block73, %._crit_edge59
  %94 = add nuw i64 %.04264, 1
  %95 = load i64, ptr %12, align 8, !tbaa !5
  %96 = icmp ult i64 %94, %95
  br i1 %96, label %.lr.ph65, label %.loopexit, !llvm.loop !25

.lr.ph62:                                         ; preds = %.lr.ph62.preheader84, %.lr.ph62
  %.04460 = phi i64 [ %102, %.lr.ph62 ], [ %.04460.ph, %.lr.ph62.preheader84 ]
  %97 = getelementptr inbounds i32, ptr %14, i64 %.04460
  %98 = load i32, ptr %97, align 4, !tbaa !14
  %99 = trunc i32 %98 to i16
  %100 = lshr i64 %.04460, 1
  %101 = getelementptr inbounds i16, ptr %29, i64 %100
  store i16 %99, ptr %101, align 2, !tbaa !16
  %102 = add nuw i64 %.04460, 2
  %103 = icmp ult i64 %102, %30
  br i1 %103, label %.lr.ph62, label %._crit_edge63, !llvm.loop !26

.lr.ph55:                                         ; preds = %.preheader51, %._crit_edge
  %.04354 = phi i64 [ %114, %._crit_edge ], [ 0, %.preheader51 ]
  %104 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4Simd4ViewINS_9AllocatorEE2AtIjEERKT_mm(ptr noundef nonnull align 8 dereferenceable(41) %0, i64 noundef 0, i64 noundef %.04354)
  %105 = tail call noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41) %2, i64 noundef 0, i64 noundef %.04354)
  %106 = load i64, ptr %0, align 8, !tbaa !13
  %.not66 = icmp eq i64 %106, 0
  br i1 %.not66, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph55
  %min.iters.check = icmp ult i64 %106, 8
  br i1 %min.iters.check, label %.lr.ph.preheader85, label %vector.ph

.lr.ph.preheader85:                               ; preds = %middle.block, %.lr.ph.preheader
  %.053.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %106, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %107 = getelementptr inbounds i32, ptr %104, i64 %index
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  %wide.load = load <4 x i32>, ptr %107, align 4, !tbaa !14
  %wide.load72 = load <4 x i32>, ptr %108, align 4, !tbaa !14
  %109 = trunc <4 x i32> %wide.load to <4 x i16>
  %110 = trunc <4 x i32> %wide.load72 to <4 x i16>
  %111 = getelementptr inbounds i16, ptr %105, i64 %index
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  store <4 x i16> %109, ptr %111, align 2, !tbaa !16
  store <4 x i16> %110, ptr %112, align 2, !tbaa !16
  %index.next = add nuw i64 %index, 8
  %113 = icmp eq i64 %index.next, %n.vec
  br i1 %113, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %106, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader85

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.lr.ph55
  %114 = add nuw i64 %.04354, 1
  %115 = load i64, ptr %12, align 8, !tbaa !5
  %116 = icmp ult i64 %114, %115
  br i1 %116, label %.lr.ph55, label %.loopexit, !llvm.loop !28

.lr.ph:                                           ; preds = %.lr.ph.preheader85, %.lr.ph
  %.053 = phi i64 [ %121, %.lr.ph ], [ %.053.ph, %.lr.ph.preheader85 ]
  %117 = getelementptr inbounds i32, ptr %104, i64 %.053
  %118 = load i32, ptr %117, align 4, !tbaa !14
  %119 = trunc i32 %118 to i16
  %120 = getelementptr inbounds i16, ptr %105, i64 %.053
  store i16 %119, ptr %120, align 2, !tbaa !16
  %121 = add nuw i64 %.053, 1
  %exitcond.not = icmp eq i64 %121, %106
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !29

.loopexit:                                        ; preds = %._crit_edge, %._crit_edge63, %.preheader51, %.preheader
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd9EqualSizeINS_9AllocatorES1_EEbRKNS_4ViewIT_EERKNS2_IT0_EE(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef nonnull align 8 dereferenceable(41)) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN4Simd4ViewINS_9AllocatorEE2AtItEERT_mm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

attributes #0 = { noreturn 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 #1 = { alwaysinline 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 = { 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 #3 = { noreturn 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 8}
!6 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !11, i64 32, !12, i64 40}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21, !23, !22}
!27 = distinct !{!27, !21, !22, !23}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !21, !23, !22}


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