; LLVM IR from intuitive-robots/mdt_policy :: pyhash-0.9.3/src/smhasher/main.ll (Z8testHashPKc)

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

%class.hashfunc = type { ptr }
%class.hashfunc.0 = type { ptr }
%class.hashfunc.1 = type { ptr }
%class.hashfunc.2 = type { ptr }
%struct.HashInfo = type { ptr, i32, i32, ptr, ptr }

@g_hashUnderTest = external dso_local global ptr, align 8
@.str.135 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z8findHashPKc(ptr noundef) #0

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

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10VerifyHashPKvijPv(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8testHashPKc(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %class.hashfunc, align 8
  %6 = alloca %class.hashfunc.0, align 8
  %7 = alloca %class.hashfunc.1, align 8
  %8 = alloca %class.hashfunc.2, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = call noundef ptr @_Z8findHashPKc(ptr noundef %9)
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %16

13:                                               ; preds = %1
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.135, ptr noundef %14)
  store i32 1, ptr %4, align 4
  br label %75

16:                                               ; preds = %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %17, ptr @g_hashUnderTest, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.HashInfo, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = icmp eq i32 %20, 32
  br i1 %21, label %22, label %26

22:                                               ; preds = %16
  call void @_ZN8hashfuncIjEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @_Z10VerifyHashPKvijPv)
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %class.hashfunc, ptr %5, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8
  call void @_Z4testIjEv8hashfuncIT_EP8HashInfo(ptr %25, ptr noundef %23)
  br label %73

26:                                               ; preds = %16
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.HashInfo, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp eq i32 %29, 64
  br i1 %30, label %31, label %38

31:                                               ; preds = %26
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.HashInfo, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  call void @_ZN8hashfuncImEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %34)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.hashfunc.0, ptr %6, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8
  call void @_Z4testImEv8hashfuncIT_EP8HashInfo(ptr %37, ptr noundef %35)
  br label %72

38:                                               ; preds = %26
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HashInfo, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 8, !tbaa !9
  %42 = icmp eq i32 %41, 128
  br i1 %42, label %43, label %50

43:                                               ; preds = %38
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.HashInfo, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !12
  call void @_ZN8hashfuncI4BlobILi128EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %46)
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.hashfunc.1, ptr %7, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8
  call void @_Z4testI4BlobILi128EEEv8hashfuncIT_EP8HashInfo(ptr %49, ptr noundef %47)
  br label %71

50:                                               ; preds = %38
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.HashInfo, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !9
  %54 = icmp eq i32 %53, 256
  br i1 %54, label %55, label %62

55:                                               ; preds = %50
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.HashInfo, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !12
  call void @_ZN8hashfuncI4BlobILi256EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef %58)
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %class.hashfunc.2, ptr %8, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8
  call void @_Z4testI4BlobILi256EEEv8hashfuncIT_EP8HashInfo(ptr %61, ptr noundef %59)
  br label %70

62:                                               ; preds = %50
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.HashInfo, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !9
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.HashInfo, ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.136, i32 noundef %65, ptr noundef %68)
  br label %70

70:                                               ; preds = %62, %55
  br label %71

71:                                               ; preds = %70, %43
  br label %72

72:                                               ; preds = %71, %31
  br label %73

73:                                               ; preds = %72, %22
  br label %74

74:                                               ; preds = %73
  store i32 0, ptr %4, align 4
  br label %75

75:                                               ; preds = %74, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  %76 = load i32, ptr %4, align 4
  switch i32 %76, label %78 [
    i32 0, label %77
    i32 1, label %77
  ]

77:                                               ; preds = %75, %75
  ret void

78:                                               ; preds = %75
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testIjEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncIjEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testImEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncImEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testI4BlobILi128EEEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncI4BlobILi128EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testI4BlobILi256EEEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncI4BlobILi256EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 = { 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++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTS8HashInfo", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 16}


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

%class.hashfunc = type { ptr }
%class.hashfunc.0 = type { ptr }
%class.hashfunc.1 = type { ptr }
%class.hashfunc.2 = type { ptr }

@g_hashUnderTest = external dso_local local_unnamed_addr global ptr, align 8
@.str.135 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z8findHashPKc(ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10VerifyHashPKvijPv(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8testHashPKc(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca %class.hashfunc, align 8
  %3 = alloca %class.hashfunc.0, align 8
  %4 = alloca %class.hashfunc.1, align 8
  %5 = alloca %class.hashfunc.2, align 8
  %6 = tail call noundef ptr @_Z8findHashPKc(ptr noundef %0)
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %10

8:                                                ; preds = %1
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.135, ptr noundef %0)
  br label %30

10:                                               ; preds = %1
  store ptr %6, ptr @g_hashUnderTest, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %6, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = add i32 %12, -32
  %14 = tail call i32 @llvm.fshl.i32(i32 %13, i32 %13, i32 27)
  switch i32 %14, label %26 [
    i32 0, label %15
    i32 1, label %17
    i32 3, label %20
    i32 7, label %23
  ]

15:                                               ; preds = %10
  call void @_ZN8hashfuncIjEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull @_Z10VerifyHashPKvijPv)
  %16 = load ptr, ptr %2, align 8
  call void @_Z4testIjEv8hashfuncIT_EP8HashInfo(ptr %16, ptr noundef nonnull %6)
  br label %30

17:                                               ; preds = %10
  %18 = load ptr, ptr %6, align 8, !tbaa !12
  call void @_ZN8hashfuncImEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %18)
  %19 = load ptr, ptr %3, align 8
  call void @_Z4testImEv8hashfuncIT_EP8HashInfo(ptr %19, ptr noundef nonnull %6)
  br label %30

20:                                               ; preds = %10
  %21 = load ptr, ptr %6, align 8, !tbaa !12
  call void @_ZN8hashfuncI4BlobILi128EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %21)
  %22 = load ptr, ptr %4, align 8
  call void @_Z4testI4BlobILi128EEEv8hashfuncIT_EP8HashInfo(ptr %22, ptr noundef nonnull %6)
  br label %30

23:                                               ; preds = %10
  %24 = load ptr, ptr %6, align 8, !tbaa !12
  call void @_ZN8hashfuncI4BlobILi256EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %24)
  %25 = load ptr, ptr %5, align 8
  call void @_Z4testI4BlobILi256EEEv8hashfuncIT_EP8HashInfo(ptr %25, ptr noundef nonnull %6)
  br label %30

26:                                               ; preds = %10
  %27 = getelementptr inbounds i8, ptr %6, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.136, i32 noundef %12, ptr noundef %28)
  br label %30

30:                                               ; preds = %17, %23, %26, %20, %15, %8
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testIjEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncIjEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testImEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncImEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testI4BlobILi128EEEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncI4BlobILi128EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4testI4BlobILi256EEEv8hashfuncIT_EP8HashInfo(ptr, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8hashfuncI4BlobILi256EEEC2EPFvPKvijPvE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.fshl.i32(i32, i32, i32) #3

attributes #0 = { mustprogress 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 = { nofree 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 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTS8HashInfo", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass