; LLVM IR from cruppstahl/upscaledb :: 3rdparty/simdcomp (simdfor)

; 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: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi32(i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_loadu_si128(ptr noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_or_si128(<2 x i64> noundef, <2 x i64> noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_slli_epi32(<2 x i64> noundef, i32 noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_storeu_si128(ptr noundef, <2 x i64> noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_srli_epi32(<2 x i64> noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @simdunpackFOR_length(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca <2 x i64>, align 16
  %14 = alloca i32, align 4
  %15 = alloca <2 x i64>, align 16
  %16 = alloca <2 x i64>, align 16
  %17 = alloca i32, align 4
  %18 = alloca <2 x i64>, align 16
  %19 = alloca i32, align 4
  %20 = alloca [4 x i32], align 16
  %21 = alloca <2 x i64>, align 16
  %22 = alloca i32, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #4
  %23 = load i32, ptr %9, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %5
  %26 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %26, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %175

27:                                               ; preds = %5
  %28 = load i32, ptr %11, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %46

30:                                               ; preds = %27
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %30
  %32 = load i32, ptr %12, align 4, !tbaa !5
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %35, label %44

35:                                               ; preds = %31
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = load ptr, ptr %10, align 8, !tbaa !9
  %38 = load i32, ptr %12, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %37, i64 %39
  store i32 %36, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %12, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %12, align 4, !tbaa !5
  br label %31, !llvm.loop !11

44:                                               ; preds = %31
  %45 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %45, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %175

46:                                               ; preds = %27
  %47 = load i32, ptr %11, align 4, !tbaa !5
  %48 = icmp eq i32 %47, 32
  br i1 %48, label %49, label %59

49:                                               ; preds = %46
  %50 = load ptr, ptr %10, align 8, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !9
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul i64 %53, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 16 %51, i64 %54, i1 false)
  %55 = load ptr, ptr %8, align 8, !tbaa !9
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %55, i64 %57
  store ptr %58, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %175

59:                                               ; preds = %46
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = call <2 x i64> @_mm_set1_epi32(i32 noundef %60)
  store <2 x i64> %61, ptr %16, align 16, !tbaa !13
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = shl i32 1, %62
  %64 = sub nsw i32 %63, 1
  %65 = call <2 x i64> @_mm_set1_epi32(i32 noundef %64)
  store <2 x i64> %65, ptr %13, align 16, !tbaa !13
  store i32 0, ptr %14, align 4, !tbaa !5
  %66 = load ptr, ptr %8, align 8, !tbaa !9
  %67 = call <2 x i64> @_mm_loadu_si128(ptr noundef %66)
  store <2 x i64> %67, ptr %15, align 16, !tbaa !13
  %68 = load ptr, ptr %8, align 8, !tbaa !9
  %69 = getelementptr inbounds <2 x i64>, ptr %68, i32 1
  store ptr %69, ptr %8, align 8, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %113, %59
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sdiv i32 %72, 4
  %74 = icmp slt i32 %71, %73
  br i1 %74, label %75, label %116

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #4
  %76 = load <2 x i64>, ptr %15, align 16, !tbaa !13
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = call <2 x i64> @_mm_srli_epi32(<2 x i64> noundef %76, i32 noundef %77)
  store <2 x i64> %78, ptr %18, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %79 = load i32, ptr %14, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = sub i64 32, %80
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %19, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = load i32, ptr %19, align 4, !tbaa !5
  %85 = icmp ult i32 %83, %84
  br i1 %85, label %86, label %90

86:                                               ; preds = %75
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = add i32 %88, %87
  store i32 %89, ptr %14, align 4, !tbaa !5
  br label %103

90:                                               ; preds = %75
  %91 = load ptr, ptr %8, align 8, !tbaa !9
  %92 = call <2 x i64> @_mm_loadu_si128(ptr noundef %91)
  store <2 x i64> %92, ptr %15, align 16, !tbaa !13
  %93 = load ptr, ptr %8, align 8, !tbaa !9
  %94 = getelementptr inbounds <2 x i64>, ptr %93, i32 1
  store ptr %94, ptr %8, align 8, !tbaa !9
  %95 = load <2 x i64>, ptr %15, align 16, !tbaa !13
  %96 = load i32, ptr %19, align 4, !tbaa !5
  %97 = call <2 x i64> @_mm_slli_epi32(<2 x i64> noundef %95, i32 noundef %96)
  %98 = load <2 x i64>, ptr %18, align 16, !tbaa !13
  %99 = call <2 x i64> @_mm_or_si128(<2 x i64> noundef %97, <2 x i64> noundef %98)
  store <2 x i64> %99, ptr %18, align 16, !tbaa !13
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = load i32, ptr %19, align 4, !tbaa !5
  %102 = sub i32 %100, %101
  store i32 %102, ptr %14, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %90, %86
  %104 = load <2 x i64>, ptr %13, align 16, !tbaa !13
  %105 = load <2 x i64>, ptr %18, align 16, !tbaa !13
  %106 = call <2 x i64> @_mm_and_si128(<2 x i64> noundef %104, <2 x i64> noundef %105)
  store <2 x i64> %106, ptr %18, align 16, !tbaa !13
  %107 = load ptr, ptr %10, align 8, !tbaa !9
  %108 = load <2 x i64>, ptr %18, align 16, !tbaa !13
  %109 = load <2 x i64>, ptr %16, align 16, !tbaa !13
  %110 = call <2 x i64> @_mm_add_epi32(<2 x i64> noundef %108, <2 x i64> noundef %109)
  call void @_mm_storeu_si128(ptr noundef %107, <2 x i64> noundef %110)
  %111 = load ptr, ptr %10, align 8, !tbaa !9
  %112 = getelementptr inbounds i32, ptr %111, i64 4
  store ptr %112, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #4
  br label %113

113:                                              ; preds = %103
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %12, align 4, !tbaa !5
  br label %70, !llvm.loop !14

116:                                              ; preds = %70
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = srem i32 %117, 4
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %173

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  %121 = load <2 x i64>, ptr %15, align 16, !tbaa !13
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = call <2 x i64> @_mm_srli_epi32(<2 x i64> noundef %121, i32 noundef %122)
  store <2 x i64> %123, ptr %21, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = sub i64 32, %125
  %127 = trunc i64 %126 to i32
  store i32 %127, ptr %22, align 4, !tbaa !5
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = load i32, ptr %22, align 4, !tbaa !5
  %130 = icmp ult i32 %128, %129
  br i1 %130, label %131, label %135

131:                                              ; preds = %120
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = add i32 %133, %132
  store i32 %134, ptr %14, align 4, !tbaa !5
  br label %148

135:                                              ; preds = %120
  %136 = load ptr, ptr %8, align 8, !tbaa !9
  %137 = call <2 x i64> @_mm_loadu_si128(ptr noundef %136)
  store <2 x i64> %137, ptr %15, align 16, !tbaa !13
  %138 = load ptr, ptr %8, align 8, !tbaa !9
  %139 = getelementptr inbounds <2 x i64>, ptr %138, i32 1
  store ptr %139, ptr %8, align 8, !tbaa !9
  %140 = load <2 x i64>, ptr %15, align 16, !tbaa !13
  %141 = load i32, ptr %22, align 4, !tbaa !5
  %142 = call <2 x i64> @_mm_slli_epi32(<2 x i64> noundef %140, i32 noundef %141)
  %143 = load <2 x i64>, ptr %21, align 16, !tbaa !13
  %144 = call <2 x i64> @_mm_or_si128(<2 x i64> noundef %142, <2 x i64> noundef %143)
  store <2 x i64> %144, ptr %21, align 16, !tbaa !13
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = load i32, ptr %22, align 4, !tbaa !5
  %147 = sub i32 %145, %146
  store i32 %147, ptr %14, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %135, %131
  %149 = load <2 x i64>, ptr %13, align 16, !tbaa !13
  %150 = load <2 x i64>, ptr %21, align 16, !tbaa !13
  %151 = call <2 x i64> @_mm_and_si128(<2 x i64> noundef %149, <2 x i64> noundef %150)
  store <2 x i64> %151, ptr %21, align 16, !tbaa !13
  %152 = getelementptr inbounds [4 x i32], ptr %20, i64 0, i64 0
  %153 = load <2 x i64>, ptr %21, align 16, !tbaa !13
  %154 = load <2 x i64>, ptr %16, align 16, !tbaa !13
  %155 = call <2 x i64> @_mm_add_epi32(<2 x i64> noundef %153, <2 x i64> noundef %154)
  call void @_mm_storeu_si128(ptr noundef %152, <2 x i64> noundef %155)
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %169, %148
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = srem i32 %158, 4
  %160 = icmp slt i32 %157, %159
  br i1 %160, label %161, label %172

161:                                              ; preds = %156
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [4 x i32], ptr %20, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 %165, ptr %166, align 4, !tbaa !5
  %167 = load ptr, ptr %10, align 8, !tbaa !9
  %168 = getelementptr inbounds i32, ptr %167, i32 1
  store ptr %168, ptr %10, align 8, !tbaa !9
  br label %169

169:                                              ; preds = %161
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %12, align 4, !tbaa !5
  br label %156, !llvm.loop !15

172:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #4
  br label %173

173:                                              ; preds = %172, %116
  %174 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %174, ptr %6, align 8
  store i32 1, ptr %17, align 4
  br label %175

175:                                              ; preds = %173, %49, %44, %25
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %176 = load ptr, ptr %6, align 8
  ret ptr %176
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_and_si128(<2 x i64> noundef, <2 x i64> noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_add_epi32(<2 x i64> noundef, <2 x i64> noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline nounwind uwtable "min-legal-vector-width"="128" "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="128" "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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi32(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_loadu_si128(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_or_si128(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_slli_epi32(<2 x i64> noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_storeu_si128(ptr noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_srli_epi32(<2 x i64> noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @simdunpackFOR_length(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %6 = alloca [4 x i32], align 16
  %7 = icmp eq i32 %2, 0
  br i1 %7, label %.loopexit, label %8

8:                                                ; preds = %5
  switch i32 %4, label %18 [
    i32 0, label %.preheader
    i32 32, label %14
  ]

.preheader:                                       ; preds = %8
  %9 = icmp sgt i32 %2, 0
  br i1 %9, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 8
  br i1 %min.iters.check, label %.lr.ph.preheader108, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %10 = getelementptr inbounds i32, ptr %3, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  store <4 x i32> %broadcast.splat, ptr %10, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %11, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %12 = icmp eq i64 %index.next, %n.vec
  br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader108

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

.lr.ph:                                           ; preds = %.lr.ph.preheader108, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader108 ]
  %13 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  store i32 %0, ptr %13, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !13

14:                                               ; preds = %8
  %15 = sext i32 %2 to i64
  %16 = shl nsw i64 %15, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 16 %1, i64 %16, i1 false)
  %17 = getelementptr inbounds i32, ptr %1, i64 %15
  br label %.loopexit

18:                                               ; preds = %8
  %19 = tail call <2 x i64> @_mm_set1_epi32(i32 noundef %0)
  %notmask = shl nsw i32 -1, %4
  %20 = xor i32 %notmask, -1
  %21 = tail call <2 x i64> @_mm_set1_epi32(i32 noundef %20)
  %22 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef %1)
  %23 = getelementptr inbounds i8, ptr %1, i64 16
  %24 = sdiv i32 %2, 4
  %25 = srem i32 %2, 4
  %26 = icmp sgt i32 %2, 3
  br i1 %26, label %.lr.ph92, label %._crit_edge

.lr.ph92:                                         ; preds = %18, %38
  %.07091 = phi ptr [ %.1, %38 ], [ %23, %18 ]
  %.07290 = phi ptr [ %41, %38 ], [ %3, %18 ]
  %.07489 = phi <2 x i64> [ %.175, %38 ], [ %22, %18 ]
  %.07688 = phi i32 [ %.177, %38 ], [ 0, %18 ]
  %.17987 = phi i32 [ %42, %38 ], [ 0, %18 ]
  %27 = tail call <2 x i64> @_mm_srli_epi32(<2 x i64> noundef %.07489, i32 noundef %.07688)
  %28 = sub i32 32, %.07688
  %29 = icmp ugt i32 %28, %4
  br i1 %29, label %30, label %32

30:                                               ; preds = %.lr.ph92
  %31 = add i32 %.07688, %4
  br label %38

32:                                               ; preds = %.lr.ph92
  %33 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef %.07091)
  %34 = getelementptr inbounds i8, ptr %.07091, i64 16
  %35 = tail call <2 x i64> @_mm_slli_epi32(<2 x i64> noundef %33, i32 noundef %28)
  %36 = tail call <2 x i64> @_mm_or_si128(<2 x i64> noundef %35, <2 x i64> noundef %27)
  %37 = sub i32 %4, %28
  br label %38

38:                                               ; preds = %32, %30
  %.177 = phi i32 [ %31, %30 ], [ %37, %32 ]
  %.175 = phi <2 x i64> [ %.07489, %30 ], [ %33, %32 ]
  %.071 = phi <2 x i64> [ %27, %30 ], [ %36, %32 ]
  %.1 = phi ptr [ %.07091, %30 ], [ %34, %32 ]
  %39 = tail call <2 x i64> @_mm_and_si128(<2 x i64> noundef %21, <2 x i64> noundef %.071)
  %40 = tail call <2 x i64> @_mm_add_epi32(<2 x i64> noundef %39, <2 x i64> noundef %19)
  tail call void @_mm_storeu_si128(ptr noundef %.07290, <2 x i64> noundef %40)
  %41 = getelementptr inbounds i8, ptr %.07290, i64 16
  %42 = add nuw nsw i32 %.17987, 1
  %exitcond102.not = icmp eq i32 %42, %24
  br i1 %exitcond102.not, label %._crit_edge, label %.lr.ph92, !llvm.loop !14

._crit_edge:                                      ; preds = %38, %18
  %.076.lcssa = phi i32 [ 0, %18 ], [ %.177, %38 ]
  %.074.lcssa = phi <2 x i64> [ %22, %18 ], [ %.175, %38 ]
  %.072.lcssa = phi ptr [ %3, %18 ], [ %41, %38 ]
  %.070.lcssa = phi ptr [ %23, %18 ], [ %.1, %38 ]
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %.loopexit, label %43

43:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %44 = tail call <2 x i64> @_mm_srli_epi32(<2 x i64> noundef %.074.lcssa, i32 noundef %.076.lcssa)
  %45 = sub i32 32, %.076.lcssa
  %46 = icmp ugt i32 %45, %4
  br i1 %46, label %52, label %47

47:                                               ; preds = %43
  %48 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef %.070.lcssa)
  %49 = getelementptr inbounds i8, ptr %.070.lcssa, i64 16
  %50 = tail call <2 x i64> @_mm_slli_epi32(<2 x i64> noundef %48, i32 noundef %45)
  %51 = tail call <2 x i64> @_mm_or_si128(<2 x i64> noundef %50, <2 x i64> noundef %44)
  br label %52

52:                                               ; preds = %43, %47
  %.2 = phi ptr [ %49, %47 ], [ %.070.lcssa, %43 ]
  %.069 = phi <2 x i64> [ %51, %47 ], [ %44, %43 ]
  %53 = tail call <2 x i64> @_mm_and_si128(<2 x i64> noundef %21, <2 x i64> noundef %.069)
  %54 = tail call <2 x i64> @_mm_add_epi32(<2 x i64> noundef %53, <2 x i64> noundef %19)
  call void @_mm_storeu_si128(ptr noundef nonnull %6, <2 x i64> noundef %54)
  %55 = icmp sgt i32 %25, 0
  br i1 %55, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %52
  %56 = load i32, ptr %6, align 16, !tbaa !5
  store i32 %56, ptr %.072.lcssa, align 4, !tbaa !5
  %exitcond107.not = icmp eq i32 %25, 1
  br i1 %exitcond107.not, label %._crit_edge100, label %.lr.ph99.1, !llvm.loop !15

.lr.ph99.1:                                       ; preds = %.lr.ph99
  %57 = getelementptr inbounds i8, ptr %.072.lcssa, i64 4
  %58 = getelementptr inbounds i8, ptr %6, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !5
  store i32 %59, ptr %57, align 4, !tbaa !5
  %exitcond107.not.1 = icmp eq i32 %25, 2
  br i1 %exitcond107.not.1, label %._crit_edge100, label %.lr.ph99.2, !llvm.loop !15

.lr.ph99.2:                                       ; preds = %.lr.ph99.1
  %60 = getelementptr inbounds i8, ptr %.072.lcssa, i64 8
  %61 = getelementptr inbounds i8, ptr %6, i64 8
  %62 = load i32, ptr %61, align 8, !tbaa !5
  store i32 %62, ptr %60, align 4, !tbaa !5
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %.lr.ph99, %.lr.ph99.1, %.lr.ph99.2, %52
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %middle.block, %.preheader, %._crit_edge, %._crit_edge100, %5, %14
  %.0 = phi ptr [ %17, %14 ], [ %1, %5 ], [ %.2, %._crit_edge100 ], [ %.070.lcssa, %._crit_edge ], [ %1, %.preheader ], [ %1, %middle.block ], [ %1, %.lr.ph ]
  ret ptr %.0
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_and_si128(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_add_epi32(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline nounwind uwtable "min-legal-vector-width"="128" "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="128" "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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Effective O3 passes: DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass