; LLVM IR from intuitive-robots/mdt_policy :: pyhash-0.9.3/src/t1ha/tests/highwayhash (verifier)

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

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@kExpected64 = external hidden constant [65 x i64], align 16
@kTestKey1 = external hidden constant [4 x i64], align 16
@kTestKey2 = external hidden constant [4 x i64], align 16
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @HighwayHash64_verify(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca [65 x i8], align 16
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = call zeroext i1 @is_option_set(i32 noundef 2)
  br i1 %8, label %15, label %9

9:                                                ; preds = %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call zeroext i1 @is_option_set(i32 noundef 1)
  %12 = zext i1 %11 to i64
  %13 = select i1 %11, ptr @.str.1, ptr @.str.2
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %10, ptr noundef %13)
  br label %15

15:                                               ; preds = %9, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 65, ptr %6) #5
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 65, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %16

16:                                               ; preds = %41, %15
  %17 = load i32, ptr %7, align 4, !tbaa !11
  %18 = icmp sle i32 %17, 64
  br i1 %18, label %19, label %44

19:                                               ; preds = %16
  %20 = load i32, ptr %7, align 4, !tbaa !11
  %21 = trunc i32 %20 to i8
  %22 = load i32, ptr %7, align 4, !tbaa !11
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [65 x i8], ptr %6, i64 0, i64 %23
  store i8 %21, ptr %24, align 1, !tbaa !13
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [65 x i64], ptr @kExpected64, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds [65 x i8], ptr %6, i64 0, i64 0
  %31 = load i32, ptr %7, align 4, !tbaa !11
  %32 = sext i32 %31 to i64
  %33 = call zeroext i1 @TestHash64(ptr noundef %25, i64 noundef %29, ptr noundef %30, i64 noundef %32, ptr noundef @kTestKey1)
  %34 = zext i1 %33 to i32
  %35 = load i8, ptr %5, align 1, !tbaa !9, !range !16, !noundef !17
  %36 = trunc i8 %35 to i1
  %37 = zext i1 %36 to i32
  %38 = or i32 %37, %34
  %39 = icmp ne i32 %38, 0
  %40 = zext i1 %39 to i8
  store i8 %40, ptr %5, align 1, !tbaa !9
  br label %41

41:                                               ; preds = %19
  %42 = load i32, ptr %7, align 4, !tbaa !11
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %7, align 4, !tbaa !11
  br label %16, !llvm.loop !18

44:                                               ; preds = %16
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %57, %44
  %46 = load i32, ptr %7, align 4, !tbaa !11
  %47 = icmp slt i32 %46, 33
  br i1 %47, label %48, label %60

48:                                               ; preds = %45
  %49 = load i32, ptr %7, align 4, !tbaa !11
  %50 = trunc i32 %49 to i8
  %51 = zext i8 %50 to i32
  %52 = add nsw i32 128, %51
  %53 = trunc i32 %52 to i8
  %54 = load i32, ptr %7, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [65 x i8], ptr %6, i64 0, i64 %55
  store i8 %53, ptr %56, align 1, !tbaa !13
  br label %57

57:                                               ; preds = %48
  %58 = load i32, ptr %7, align 4, !tbaa !11
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %7, align 4, !tbaa !11
  br label %45, !llvm.loop !20

60:                                               ; preds = %45
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds [65 x i8], ptr %6, i64 0, i64 0
  %63 = call zeroext i1 @TestHash64(ptr noundef %61, i64 noundef 6036255944822278871, ptr noundef %62, i64 noundef 33, ptr noundef @kTestKey2)
  %64 = zext i1 %63 to i32
  %65 = load i8, ptr %5, align 1, !tbaa !9, !range !16, !noundef !17
  %66 = trunc i8 %65 to i1
  %67 = zext i1 %66 to i32
  %68 = or i32 %67, %64
  %69 = icmp ne i32 %68, 0
  %70 = zext i1 %69 to i8
  store i8 %70, ptr %5, align 1, !tbaa !9
  %71 = call zeroext i1 @is_option_set(i32 noundef 1)
  br i1 %71, label %72, label %74

72:                                               ; preds = %60
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %74

74:                                               ; preds = %72, %60
  %75 = call zeroext i1 @is_option_set(i32 noundef 2)
  br i1 %75, label %87, label %76

76:                                               ; preds = %74
  %77 = call zeroext i1 @is_option_set(i32 noundef 1)
  br i1 %77, label %82, label %78

78:                                               ; preds = %76
  %79 = load i8, ptr %5, align 1, !tbaa !9, !range !16, !noundef !17
  %80 = trunc i8 %79 to i1
  %81 = xor i1 %80, true
  br label %82

82:                                               ; preds = %78, %76
  %83 = phi i1 [ false, %76 ], [ %81, %78 ]
  %84 = zext i1 %83 to i64
  %85 = select i1 %83, ptr @.str.5, ptr @.str.2
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %85)
  br label %87

87:                                               ; preds = %82, %74
  %88 = load i8, ptr %5, align 1, !tbaa !9, !range !16, !noundef !17
  %89 = trunc i8 %88 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 65, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i1 %89
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @is_option_set(i32 noundef) #1

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @TestHash64(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #0

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

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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@kExpected64 = external hidden local_unnamed_addr constant [65 x i64], align 16
@kTestKey1 = external hidden constant [4 x i64], align 16
@kTestKey2 = external hidden constant [4 x i64], align 16
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @HighwayHash64_verify(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [65 x i8], align 16
  %4 = tail call zeroext i1 @is_option_set(i32 noundef 2)
  br i1 %4, label %9, label %5

5:                                                ; preds = %2
  %6 = tail call zeroext i1 @is_option_set(i32 noundef 1)
  %7 = select i1 %6, ptr @.str.1, ptr @.str.2
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %1, ptr noundef nonnull %7)
  br label %9

9:                                                ; preds = %5, %2
  call void @llvm.lifetime.start.p0(i64 65, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(65) %3, i8 0, i64 65, i1 false)
  br label %15

.preheader:                                       ; preds = %15
  store <16 x i8> <i8 -128, i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113>, ptr %3, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %3, i64 16
  store <16 x i8> <i8 -112, i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97>, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %3, i64 32
  store i8 -96, ptr %11, align 16, !tbaa !5
  %12 = call zeroext i1 @TestHash64(ptr noundef %0, i64 noundef 6036255944822278871, ptr noundef nonnull %3, i64 noundef 33, ptr noundef nonnull @kTestKey2)
  %13 = or i1 %21, %12
  %14 = call zeroext i1 @is_option_set(i32 noundef 1)
  br i1 %14, label %22, label %24

15:                                               ; preds = %9, %15
  %indvars.iv = phi i64 [ 0, %9 ], [ %indvars.iv.next, %15 ]
  %.01617 = phi i1 [ false, %9 ], [ %21, %15 ]
  %16 = trunc i64 %indvars.iv to i8
  %17 = getelementptr inbounds [65 x i8], ptr %3, i64 0, i64 %indvars.iv
  store i8 %16, ptr %17, align 1, !tbaa !5
  %18 = getelementptr inbounds [65 x i64], ptr @kExpected64, i64 0, i64 %indvars.iv
  %19 = load i64, ptr %18, align 8, !tbaa !8
  %20 = call zeroext i1 @TestHash64(ptr noundef %0, i64 noundef %19, ptr noundef nonnull %3, i64 noundef %indvars.iv, ptr noundef nonnull @kTestKey1)
  %21 = or i1 %.01617, %20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 65
  br i1 %exitcond.not, label %.preheader, label %15, !llvm.loop !10

22:                                               ; preds = %.preheader
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %24

24:                                               ; preds = %22, %.preheader
  %25 = call zeroext i1 @is_option_set(i32 noundef 2)
  br i1 %25, label %31, label %26

26:                                               ; preds = %24
  %27 = call zeroext i1 @is_option_set(i32 noundef 1)
  %28 = select i1 %27, i1 true, i1 %13
  %29 = select i1 %28, ptr @.str.2, ptr @.str.5
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %29)
  br label %31

31:                                               ; preds = %26, %24
  call void @llvm.lifetime.end.p0(i64 65, ptr nonnull %3) #5
  ret i1 %13
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @is_option_set(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @TestHash64(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"long", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass