; LLVM IR from libxsmm/libxsmm :: src (libxsmm_hash)

; 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"

@internal_crc32_table = external dso_local global ptr, align 64
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@libxsmm_hash_init.crc32_table = external hidden constant [4 x [256 x i32]], align 16
@internal_hash_u512_function = external dso_local global ptr, align 64
@internal_hash_u384_function = external dso_local global ptr, align 64
@internal_hash_u256_function = external dso_local global ptr, align 64
@internal_hash_u128_function = external dso_local global ptr, align 64
@internal_hash_u64_function = external dso_local global ptr, align 64
@internal_hash_u32_function = external dso_local global ptr, align 64
@internal_hash_u16_function = external dso_local global ptr, align 64
@internal_hash_u8_function = external dso_local global ptr, align 64
@internal_hash_function = external dso_local global ptr, align 64
@.str.9 = external hidden unnamed_addr constant [42 x i8], align 1
@__PRETTY_FUNCTION__.libxsmm_hash_init = external hidden unnamed_addr constant [28 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u32(i32 noundef, ptr noundef, ...) #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u8_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u16_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u32_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u64(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u64_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u128(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u128_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u256(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u256_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u384(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u384_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u512(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u512_sse4(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32(i32 noundef, ptr noundef, i64 noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @internal_crc32_u16(i32 noundef, ptr noundef, ...) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @internal_crc32_u8(i32 noundef, ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_sse4(i32 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_hash_init(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  store ptr @libxsmm_hash_init.crc32_table, ptr @internal_crc32_table, align 64, !tbaa !9
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = icmp sle i32 1004, %3
  br i1 %4, label %5, label %6

5:                                                ; preds = %1
  store ptr @internal_crc32_u512_sse4, ptr @internal_hash_u512_function, align 64, !tbaa !9
  store ptr @internal_crc32_u384_sse4, ptr @internal_hash_u384_function, align 64, !tbaa !9
  store ptr @internal_crc32_u256_sse4, ptr @internal_hash_u256_function, align 64, !tbaa !9
  store ptr @internal_crc32_u128_sse4, ptr @internal_hash_u128_function, align 64, !tbaa !9
  store ptr @internal_crc32_u64_sse4, ptr @internal_hash_u64_function, align 64, !tbaa !9
  store ptr @internal_crc32_u32_sse4, ptr @internal_hash_u32_function, align 64, !tbaa !9
  store ptr @internal_crc32_u16_sse4, ptr @internal_hash_u16_function, align 64, !tbaa !9
  store ptr @internal_crc32_u8_sse4, ptr @internal_hash_u8_function, align 64, !tbaa !9
  store ptr @internal_crc32_sse4, ptr @internal_hash_function, align 64, !tbaa !9
  br label %7

6:                                                ; preds = %1
  store ptr @internal_crc32_u512, ptr @internal_hash_u512_function, align 64, !tbaa !9
  store ptr @internal_crc32_u384, ptr @internal_hash_u384_function, align 64, !tbaa !9
  store ptr @internal_crc32_u256, ptr @internal_hash_u256_function, align 64, !tbaa !9
  store ptr @internal_crc32_u128, ptr @internal_hash_u128_function, align 64, !tbaa !9
  store ptr @internal_crc32_u64, ptr @internal_hash_u64_function, align 64, !tbaa !9
  store ptr @internal_crc32_u32, ptr @internal_hash_u32_function, align 64, !tbaa !9
  store ptr @internal_crc32_u16, ptr @internal_hash_u16_function, align 64, !tbaa !9
  store ptr @internal_crc32_u8, ptr @internal_hash_u8_function, align 64, !tbaa !9
  store ptr @internal_crc32, ptr @internal_hash_function, align 64, !tbaa !9
  br label %7

7:                                                ; preds = %6, %5
  %8 = load ptr, ptr @internal_hash_u512_function, align 64, !tbaa !9
  %9 = icmp ne ptr null, %8
  br i1 %9, label %10, label %11

10:                                               ; preds = %7
  br label %12

11:                                               ; preds = %7
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 483, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

12:                                               ; preds = %10
  %13 = load ptr, ptr @internal_hash_u384_function, align 64, !tbaa !9
  %14 = icmp ne ptr null, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %12
  br label %17

16:                                               ; preds = %12
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 484, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

17:                                               ; preds = %15
  %18 = load ptr, ptr @internal_hash_u256_function, align 64, !tbaa !9
  %19 = icmp ne ptr null, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  br label %22

21:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 485, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

22:                                               ; preds = %20
  %23 = load ptr, ptr @internal_hash_u128_function, align 64, !tbaa !9
  %24 = icmp ne ptr null, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  br label %27

26:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 486, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

27:                                               ; preds = %25
  %28 = load ptr, ptr @internal_hash_u64_function, align 64, !tbaa !9
  %29 = icmp ne ptr null, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  br label %32

31:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 487, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

32:                                               ; preds = %30
  %33 = load ptr, ptr @internal_hash_u32_function, align 64, !tbaa !9
  %34 = icmp ne ptr null, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  br label %37

36:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 488, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

37:                                               ; preds = %35
  %38 = load ptr, ptr @internal_hash_u16_function, align 64, !tbaa !9
  %39 = icmp ne ptr null, %38
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  br label %42

41:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 489, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

42:                                               ; preds = %40
  %43 = load ptr, ptr @internal_hash_u8_function, align 64, !tbaa !9
  %44 = icmp ne ptr null, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  br label %47

46:                                               ; preds = %42
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 490, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

47:                                               ; preds = %45
  %48 = load ptr, ptr @internal_hash_function, align 64, !tbaa !9
  %49 = icmp ne ptr null, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  br label %52

51:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 491, ptr noundef @__PRETTY_FUNCTION__.libxsmm_hash_init) #4
  unreachable

52:                                               ; preds = %50
  ret void
}

attributes #0 = { 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 #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+crc32,+cx8,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint 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 #4 = { 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, !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}


; 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"

@internal_crc32_table = external dso_local local_unnamed_addr global ptr, align 64
@libxsmm_hash_init.crc32_table = external hidden constant [4 x [256 x i32]], align 16
@internal_hash_u512_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u384_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u256_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u128_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u64_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u32_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u16_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_u8_function = external dso_local local_unnamed_addr global ptr, align 64
@internal_hash_function = external dso_local local_unnamed_addr global ptr, align 64

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u32(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u8_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u16_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u32_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u64(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u64_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u128(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u128_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u256(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u256_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u384(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u384_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u512(i32 noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_u512_sse4(i32 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32(i32 noundef, ptr noundef, i64 noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @internal_crc32_u16(i32 noundef, ptr noundef, ...) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @internal_crc32_u8(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @internal_crc32_sse4(i32 noundef, ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @libxsmm_hash_init(i32 noundef %0) local_unnamed_addr #3 {
  store ptr @libxsmm_hash_init.crc32_table, ptr @internal_crc32_table, align 64, !tbaa !5
  %2 = icmp sgt i32 %0, 1003
  %internal_crc32_u512_sse4.internal_crc32_u512 = select i1 %2, ptr @internal_crc32_u512_sse4, ptr @internal_crc32_u512
  %internal_crc32_u384_sse4.internal_crc32_u384 = select i1 %2, ptr @internal_crc32_u384_sse4, ptr @internal_crc32_u384
  %internal_crc32_u256_sse4.internal_crc32_u256 = select i1 %2, ptr @internal_crc32_u256_sse4, ptr @internal_crc32_u256
  %internal_crc32_u128_sse4.internal_crc32_u128 = select i1 %2, ptr @internal_crc32_u128_sse4, ptr @internal_crc32_u128
  %internal_crc32_u64_sse4.internal_crc32_u64 = select i1 %2, ptr @internal_crc32_u64_sse4, ptr @internal_crc32_u64
  %internal_crc32_u32_sse4.internal_crc32_u32 = select i1 %2, ptr @internal_crc32_u32_sse4, ptr @internal_crc32_u32
  %internal_crc32_u16_sse4.internal_crc32_u16 = select i1 %2, ptr @internal_crc32_u16_sse4, ptr @internal_crc32_u16
  %internal_crc32_u8_sse4.internal_crc32_u8 = select i1 %2, ptr @internal_crc32_u8_sse4, ptr @internal_crc32_u8
  %internal_crc32_sse4.internal_crc32 = select i1 %2, ptr @internal_crc32_sse4, ptr @internal_crc32
  store ptr %internal_crc32_u512_sse4.internal_crc32_u512, ptr @internal_hash_u512_function, align 64, !tbaa !5
  store ptr %internal_crc32_u384_sse4.internal_crc32_u384, ptr @internal_hash_u384_function, align 64, !tbaa !5
  store ptr %internal_crc32_u256_sse4.internal_crc32_u256, ptr @internal_hash_u256_function, align 64, !tbaa !5
  store ptr %internal_crc32_u128_sse4.internal_crc32_u128, ptr @internal_hash_u128_function, align 64, !tbaa !5
  store ptr %internal_crc32_u64_sse4.internal_crc32_u64, ptr @internal_hash_u64_function, align 64, !tbaa !5
  store ptr %internal_crc32_u32_sse4.internal_crc32_u32, ptr @internal_hash_u32_function, align 64, !tbaa !5
  store ptr %internal_crc32_u16_sse4.internal_crc32_u16, ptr @internal_hash_u16_function, align 64, !tbaa !5
  store ptr %internal_crc32_u8_sse4.internal_crc32_u8, ptr @internal_hash_u8_function, align 64, !tbaa !5
  store ptr %internal_crc32_sse4.internal_crc32, ptr @internal_hash_function, align 64, !tbaa !5
  ret void
}

attributes #0 = { 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 #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+crc32,+cx8,+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) 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" }

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass