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

; 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 <2 x i64> @iunpack0(<2 x i64> noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca <2 x i64>, align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca <2 x i64>, align 16
  %9 = alloca i32, align 4
  store <2 x i64> %0, ptr %4, align 16, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !8
  store ptr %2, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %10 = load ptr, ptr %6, align 8, !tbaa !8
  store ptr %10, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %11 = load <2 x i64>, ptr %4, align 16, !tbaa !5
  %12 = bitcast <2 x i64> %11 to <4 x i32>
  %13 = shufflevector <4 x i32> %12, <4 x i32> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
  %14 = bitcast <4 x i32> %13 to <2 x i64>
  store <2 x i64> %14, ptr %8, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %15 = load ptr, ptr %5, align 8, !tbaa !8
  store i32 0, ptr %9, align 4, !tbaa !10
  br label %16

16:                                               ; preds = %32, %3
  %17 = load i32, ptr %9, align 4, !tbaa !10
  %18 = icmp ult i32 %17, 8
  br i1 %18, label %19, label %35

19:                                               ; preds = %16
  %20 = load ptr, ptr %7, align 8, !tbaa !8
  %21 = getelementptr inbounds <2 x i64>, ptr %20, i32 1
  store ptr %21, ptr %7, align 8, !tbaa !8
  %22 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @_mm_storeu_si128(ptr noundef %20, <2 x i64> noundef %22)
  %23 = load ptr, ptr %7, align 8, !tbaa !8
  %24 = getelementptr inbounds <2 x i64>, ptr %23, i32 1
  store ptr %24, ptr %7, align 8, !tbaa !8
  %25 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @_mm_storeu_si128(ptr noundef %23, <2 x i64> noundef %25)
  %26 = load ptr, ptr %7, align 8, !tbaa !8
  %27 = getelementptr inbounds <2 x i64>, ptr %26, i32 1
  store ptr %27, ptr %7, align 8, !tbaa !8
  %28 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @_mm_storeu_si128(ptr noundef %26, <2 x i64> noundef %28)
  %29 = load ptr, ptr %7, align 8, !tbaa !8
  %30 = getelementptr inbounds <2 x i64>, ptr %29, i32 1
  store ptr %30, ptr %7, align 8, !tbaa !8
  %31 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @_mm_storeu_si128(ptr noundef %29, <2 x i64> noundef %31)
  br label %32

32:                                               ; preds = %19
  %33 = load i32, ptr %9, align 4, !tbaa !10
  %34 = add i32 %33, 1
  store i32 %34, ptr %9, align 4, !tbaa !10
  br label %16, !llvm.loop !12

35:                                               ; preds = %16
  %36 = load <2 x i64>, ptr %4, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret <2 x i64> %36
}

; 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: 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"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 noundef <2 x i64> @iunpack0(<2 x i64> noundef returned %0, ptr nocapture noundef readnone %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = bitcast <2 x i64> %0 to <4 x i32>
  %5 = shufflevector <4 x i32> %4, <4 x i32> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
  %6 = bitcast <4 x i32> %5 to <2 x i64>
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  tail call void @_mm_storeu_si128(ptr noundef %2, <2 x i64> noundef %6)
  %8 = getelementptr inbounds i8, ptr %2, i64 32
  tail call void @_mm_storeu_si128(ptr noundef nonnull %7, <2 x i64> noundef %6)
  %9 = getelementptr inbounds i8, ptr %2, i64 48
  tail call void @_mm_storeu_si128(ptr noundef nonnull %8, <2 x i64> noundef %6)
  %10 = getelementptr inbounds i8, ptr %2, i64 64
  tail call void @_mm_storeu_si128(ptr noundef nonnull %9, <2 x i64> noundef %6)
  %11 = getelementptr inbounds i8, ptr %2, i64 80
  tail call void @_mm_storeu_si128(ptr noundef nonnull %10, <2 x i64> noundef %6)
  %12 = getelementptr inbounds i8, ptr %2, i64 96
  tail call void @_mm_storeu_si128(ptr noundef nonnull %11, <2 x i64> noundef %6)
  %13 = getelementptr inbounds i8, ptr %2, i64 112
  tail call void @_mm_storeu_si128(ptr noundef nonnull %12, <2 x i64> noundef %6)
  %14 = getelementptr inbounds i8, ptr %2, i64 128
  tail call void @_mm_storeu_si128(ptr noundef nonnull %13, <2 x i64> noundef %6)
  %15 = getelementptr inbounds i8, ptr %2, i64 144
  tail call void @_mm_storeu_si128(ptr noundef nonnull %14, <2 x i64> noundef %6)
  %16 = getelementptr inbounds i8, ptr %2, i64 160
  tail call void @_mm_storeu_si128(ptr noundef nonnull %15, <2 x i64> noundef %6)
  %17 = getelementptr inbounds i8, ptr %2, i64 176
  tail call void @_mm_storeu_si128(ptr noundef nonnull %16, <2 x i64> noundef %6)
  %18 = getelementptr inbounds i8, ptr %2, i64 192
  tail call void @_mm_storeu_si128(ptr noundef nonnull %17, <2 x i64> noundef %6)
  %19 = getelementptr inbounds i8, ptr %2, i64 208
  tail call void @_mm_storeu_si128(ptr noundef nonnull %18, <2 x i64> noundef %6)
  %20 = getelementptr inbounds i8, ptr %2, i64 224
  tail call void @_mm_storeu_si128(ptr noundef nonnull %19, <2 x i64> noundef %6)
  %21 = getelementptr inbounds i8, ptr %2, i64 240
  tail call void @_mm_storeu_si128(ptr noundef nonnull %20, <2 x i64> noundef %6)
  %22 = getelementptr inbounds i8, ptr %2, i64 256
  tail call void @_mm_storeu_si128(ptr noundef nonnull %21, <2 x i64> noundef %6)
  %23 = getelementptr inbounds i8, ptr %2, i64 272
  tail call void @_mm_storeu_si128(ptr noundef nonnull %22, <2 x i64> noundef %6)
  %24 = getelementptr inbounds i8, ptr %2, i64 288
  tail call void @_mm_storeu_si128(ptr noundef nonnull %23, <2 x i64> noundef %6)
  %25 = getelementptr inbounds i8, ptr %2, i64 304
  tail call void @_mm_storeu_si128(ptr noundef nonnull %24, <2 x i64> noundef %6)
  %26 = getelementptr inbounds i8, ptr %2, i64 320
  tail call void @_mm_storeu_si128(ptr noundef nonnull %25, <2 x i64> noundef %6)
  %27 = getelementptr inbounds i8, ptr %2, i64 336
  tail call void @_mm_storeu_si128(ptr noundef nonnull %26, <2 x i64> noundef %6)
  %28 = getelementptr inbounds i8, ptr %2, i64 352
  tail call void @_mm_storeu_si128(ptr noundef nonnull %27, <2 x i64> noundef %6)
  %29 = getelementptr inbounds i8, ptr %2, i64 368
  tail call void @_mm_storeu_si128(ptr noundef nonnull %28, <2 x i64> noundef %6)
  %30 = getelementptr inbounds i8, ptr %2, i64 384
  tail call void @_mm_storeu_si128(ptr noundef nonnull %29, <2 x i64> noundef %6)
  %31 = getelementptr inbounds i8, ptr %2, i64 400
  tail call void @_mm_storeu_si128(ptr noundef nonnull %30, <2 x i64> noundef %6)
  %32 = getelementptr inbounds i8, ptr %2, i64 416
  tail call void @_mm_storeu_si128(ptr noundef nonnull %31, <2 x i64> noundef %6)
  %33 = getelementptr inbounds i8, ptr %2, i64 432
  tail call void @_mm_storeu_si128(ptr noundef nonnull %32, <2 x i64> noundef %6)
  %34 = getelementptr inbounds i8, ptr %2, i64 448
  tail call void @_mm_storeu_si128(ptr noundef nonnull %33, <2 x i64> noundef %6)
  %35 = getelementptr inbounds i8, ptr %2, i64 464
  tail call void @_mm_storeu_si128(ptr noundef nonnull %34, <2 x i64> noundef %6)
  %36 = getelementptr inbounds i8, ptr %2, i64 480
  tail call void @_mm_storeu_si128(ptr noundef nonnull %35, <2 x i64> noundef %6)
  %37 = getelementptr inbounds i8, ptr %2, i64 496
  tail call void @_mm_storeu_si128(ptr noundef nonnull %36, <2 x i64> noundef %6)
  tail call void @_mm_storeu_si128(ptr noundef nonnull %37, <2 x i64> noundef %6)
  ret <2 x i64> %0
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_storeu_si128(ptr noundef, <2 x i64> 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,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass