; 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: 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 void @_mm_storeu_si128(ptr noundef, <2 x i64> 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: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_loadu_si128(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local <2 x i64> @iunpack32(<2 x i64> noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %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 i64, align 8
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load <2 x i64>, ptr %4, align 16, !tbaa !5
  store i64 0, ptr %9, align 8, !tbaa !10
  br label %12

12:                                               ; preds = %22, %3
  %13 = load i64, ptr %9, align 8, !tbaa !10
  %14 = icmp ult i64 %13, 32
  br i1 %14, label %15, label %25

15:                                               ; preds = %12
  %16 = load ptr, ptr %5, align 8, !tbaa !8
  %17 = getelementptr inbounds <2 x i64>, ptr %16, i32 1
  store ptr %17, ptr %5, align 8, !tbaa !8
  %18 = call <2 x i64> @_mm_loadu_si128(ptr noundef %16)
  store <2 x i64> %18, ptr %8, align 16, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !8
  %20 = getelementptr inbounds <2 x i64>, ptr %19, i32 1
  store ptr %20, ptr %7, align 8, !tbaa !8
  %21 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @_mm_storeu_si128(ptr noundef %19, <2 x i64> noundef %21)
  br label %22

22:                                               ; preds = %15
  %23 = load i64, ptr %9, align 8, !tbaa !10
  %24 = add i64 %23, 1
  store i64 %24, ptr %9, align 8, !tbaa !10
  br label %12, !llvm.loop !12

25:                                               ; preds = %12
  %26 = load <2 x i64>, ptr %8, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, 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> %26
}

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 = { 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 = !{!"long", !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: alwaysinline nounwind uwtable
declare hidden void @_mm_storeu_si128(ptr noundef, <2 x i64> noundef) local_unnamed_addr #0

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

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

attributes #0 = { 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 #1 = { 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,LCSSAPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass