; LLVM IR from cruppstahl/upscaledb :: 3rdparty/simdcomp/src/simdbitpacking.ll_ (SIMD_fastunpack32_32)

; 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: nounwind uwtable
define dso_local void @__SIMD_fastunpack32_32(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  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) #3
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %7, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %17, %2
  %9 = load i32, ptr %6, align 4, !tbaa !9
  %10 = icmp ult i32 %9, 32
  br i1 %10, label %11, label %20

11:                                               ; preds = %8
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds <2 x i64>, ptr %12, i32 1
  store ptr %13, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds <2 x i64>, ptr %14, i32 1
  store ptr %15, ptr %3, align 8, !tbaa !5
  %16 = call <2 x i64> @_mm_loadu_si128(ptr noundef %14)
  call void @_mm_storeu_si128(ptr noundef %12, <2 x i64> noundef %16)
  br label %17

17:                                               ; preds = %11
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = add i32 %18, 1
  store i32 %19, ptr %6, align 4, !tbaa !9
  br label %8, !llvm.loop !11

20:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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
define dso_local void @__SIMD_fastunpack32_32(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 16
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef %0)
  tail call void @_mm_storeu_si128(ptr noundef %1, <2 x i64> noundef %5)
  %6 = getelementptr inbounds i8, ptr %1, i64 32
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %4)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %3, <2 x i64> noundef %8)
  %9 = getelementptr inbounds i8, ptr %1, i64 48
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %7)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %6, <2 x i64> noundef %11)
  %12 = getelementptr inbounds i8, ptr %1, i64 64
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  %14 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %10)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %9, <2 x i64> noundef %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 80
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %13)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %12, <2 x i64> noundef %17)
  %18 = getelementptr inbounds i8, ptr %1, i64 96
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  %20 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %16)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %15, <2 x i64> noundef %20)
  %21 = getelementptr inbounds i8, ptr %1, i64 112
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %19)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %18, <2 x i64> noundef %23)
  %24 = getelementptr inbounds i8, ptr %1, i64 128
  %25 = getelementptr inbounds i8, ptr %0, i64 128
  %26 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %22)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %21, <2 x i64> noundef %26)
  %27 = getelementptr inbounds i8, ptr %1, i64 144
  %28 = getelementptr inbounds i8, ptr %0, i64 144
  %29 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %25)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %24, <2 x i64> noundef %29)
  %30 = getelementptr inbounds i8, ptr %1, i64 160
  %31 = getelementptr inbounds i8, ptr %0, i64 160
  %32 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %28)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %27, <2 x i64> noundef %32)
  %33 = getelementptr inbounds i8, ptr %1, i64 176
  %34 = getelementptr inbounds i8, ptr %0, i64 176
  %35 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %31)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %30, <2 x i64> noundef %35)
  %36 = getelementptr inbounds i8, ptr %1, i64 192
  %37 = getelementptr inbounds i8, ptr %0, i64 192
  %38 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %34)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %33, <2 x i64> noundef %38)
  %39 = getelementptr inbounds i8, ptr %1, i64 208
  %40 = getelementptr inbounds i8, ptr %0, i64 208
  %41 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %37)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %36, <2 x i64> noundef %41)
  %42 = getelementptr inbounds i8, ptr %1, i64 224
  %43 = getelementptr inbounds i8, ptr %0, i64 224
  %44 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %40)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %39, <2 x i64> noundef %44)
  %45 = getelementptr inbounds i8, ptr %1, i64 240
  %46 = getelementptr inbounds i8, ptr %0, i64 240
  %47 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %43)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %42, <2 x i64> noundef %47)
  %48 = getelementptr inbounds i8, ptr %1, i64 256
  %49 = getelementptr inbounds i8, ptr %0, i64 256
  %50 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %46)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %45, <2 x i64> noundef %50)
  %51 = getelementptr inbounds i8, ptr %1, i64 272
  %52 = getelementptr inbounds i8, ptr %0, i64 272
  %53 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %49)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %48, <2 x i64> noundef %53)
  %54 = getelementptr inbounds i8, ptr %1, i64 288
  %55 = getelementptr inbounds i8, ptr %0, i64 288
  %56 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %52)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %51, <2 x i64> noundef %56)
  %57 = getelementptr inbounds i8, ptr %1, i64 304
  %58 = getelementptr inbounds i8, ptr %0, i64 304
  %59 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %55)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %54, <2 x i64> noundef %59)
  %60 = getelementptr inbounds i8, ptr %1, i64 320
  %61 = getelementptr inbounds i8, ptr %0, i64 320
  %62 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %58)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %57, <2 x i64> noundef %62)
  %63 = getelementptr inbounds i8, ptr %1, i64 336
  %64 = getelementptr inbounds i8, ptr %0, i64 336
  %65 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %61)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %60, <2 x i64> noundef %65)
  %66 = getelementptr inbounds i8, ptr %1, i64 352
  %67 = getelementptr inbounds i8, ptr %0, i64 352
  %68 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %64)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %63, <2 x i64> noundef %68)
  %69 = getelementptr inbounds i8, ptr %1, i64 368
  %70 = getelementptr inbounds i8, ptr %0, i64 368
  %71 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %67)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %66, <2 x i64> noundef %71)
  %72 = getelementptr inbounds i8, ptr %1, i64 384
  %73 = getelementptr inbounds i8, ptr %0, i64 384
  %74 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %70)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %69, <2 x i64> noundef %74)
  %75 = getelementptr inbounds i8, ptr %1, i64 400
  %76 = getelementptr inbounds i8, ptr %0, i64 400
  %77 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %73)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %72, <2 x i64> noundef %77)
  %78 = getelementptr inbounds i8, ptr %1, i64 416
  %79 = getelementptr inbounds i8, ptr %0, i64 416
  %80 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %76)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %75, <2 x i64> noundef %80)
  %81 = getelementptr inbounds i8, ptr %1, i64 432
  %82 = getelementptr inbounds i8, ptr %0, i64 432
  %83 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %79)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %78, <2 x i64> noundef %83)
  %84 = getelementptr inbounds i8, ptr %1, i64 448
  %85 = getelementptr inbounds i8, ptr %0, i64 448
  %86 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %82)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %81, <2 x i64> noundef %86)
  %87 = getelementptr inbounds i8, ptr %1, i64 464
  %88 = getelementptr inbounds i8, ptr %0, i64 464
  %89 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %85)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %84, <2 x i64> noundef %89)
  %90 = getelementptr inbounds i8, ptr %1, i64 480
  %91 = getelementptr inbounds i8, ptr %0, i64 480
  %92 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %88)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %87, <2 x i64> noundef %92)
  %93 = getelementptr inbounds i8, ptr %1, i64 496
  %94 = getelementptr inbounds i8, ptr %0, i64 496
  %95 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %91)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %90, <2 x i64> noundef %95)
  %96 = tail call <2 x i64> @_mm_loadu_si128(ptr noundef nonnull %94)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %93, <2 x i64> noundef %96)
  ret void
}

; 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_loadu_si128(ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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" }

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


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass