; LLVM IR from alibaba/euler :: euler/common/hash.ll (ZN5euler6hash32EPKviPjj)

; 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: mustprogress uwtable
define dso_local void @_ZN5euler6hash32EPKviPjj(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 -862048943, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 461845907, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 -430675100, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 -2048144789, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 -1028477387, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %20 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %20, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %21, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = ashr i32 %22, 2
  store i32 %23, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %44, %4
  %25 = load i32, ptr %18, align 4, !tbaa !9
  %26 = load i32, ptr %17, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %47

29:                                               ; preds = %24
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i32 1
  store ptr %31, ptr %16, align 8, !tbaa !5
  %32 = load i32, ptr %30, align 4, !tbaa !9
  store i32 %32, ptr %15, align 4, !tbaa !9
  %33 = load i32, ptr %15, align 4, !tbaa !9
  %34 = mul i32 %33, -862048943
  store i32 %34, ptr %15, align 4, !tbaa !9
  call void @_ZN5euler4rotlEPji(ptr noundef %15, i32 noundef 15)
  %35 = load i32, ptr %15, align 4, !tbaa !9
  %36 = mul i32 %35, 461845907
  store i32 %36, ptr %15, align 4, !tbaa !9
  %37 = load i32, ptr %15, align 4, !tbaa !9
  %38 = load i32, ptr %14, align 4, !tbaa !9
  %39 = xor i32 %38, %37
  store i32 %39, ptr %14, align 4, !tbaa !9
  call void @_ZN5euler4rotlEPji(ptr noundef %14, i32 noundef 13)
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = mul i32 %40, 5
  store i32 %41, ptr %14, align 4, !tbaa !9
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = add i32 %42, -430675100
  store i32 %43, ptr %14, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %29
  %45 = load i32, ptr %18, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %18, align 4, !tbaa !9
  br label %24, !llvm.loop !11

47:                                               ; preds = %28
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %48 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %48, ptr %19, align 8, !tbaa !5
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = and i32 %49, 3
  switch i32 %50, label %81 [
    i32 3, label %51
    i32 2, label %59
    i32 1, label %67
  ]

51:                                               ; preds = %47
  %52 = load ptr, ptr %19, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 2
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = zext i8 %54 to i32
  %56 = shl i32 %55, 16
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = xor i32 %57, %56
  store i32 %58, ptr %15, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %51, %47
  %60 = load ptr, ptr %19, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 1
  %62 = load i8, ptr %61, align 1, !tbaa !13
  %63 = zext i8 %62 to i32
  %64 = shl i32 %63, 8
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = xor i32 %65, %64
  store i32 %66, ptr %15, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %59, %47
  %68 = load ptr, ptr %19, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 0
  %70 = load i8, ptr %69, align 1, !tbaa !13
  %71 = zext i8 %70 to i32
  %72 = load i32, ptr %15, align 4, !tbaa !9
  %73 = xor i32 %72, %71
  store i32 %73, ptr %15, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = mul i32 %74, -862048943
  store i32 %75, ptr %15, align 4, !tbaa !9
  call void @_ZN5euler4rotlEPji(ptr noundef %15, i32 noundef 15)
  %76 = load i32, ptr %15, align 4, !tbaa !9
  %77 = mul i32 %76, 461845907
  store i32 %77, ptr %15, align 4, !tbaa !9
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = load i32, ptr %14, align 4, !tbaa !9
  %80 = xor i32 %79, %78
  store i32 %80, ptr %14, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %67, %47
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = xor i32 %83, %82
  store i32 %84, ptr %14, align 4, !tbaa !9
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = lshr i32 %85, 16
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = xor i32 %87, %86
  store i32 %88, ptr %14, align 4, !tbaa !9
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = mul i32 %89, -2048144789
  store i32 %90, ptr %14, align 4, !tbaa !9
  %91 = load i32, ptr %14, align 4, !tbaa !9
  %92 = lshr i32 %91, 13
  %93 = load i32, ptr %14, align 4, !tbaa !9
  %94 = xor i32 %93, %92
  store i32 %94, ptr %14, align 4, !tbaa !9
  %95 = load i32, ptr %14, align 4, !tbaa !9
  %96 = mul i32 %95, -1028477387
  store i32 %96, ptr %14, align 4, !tbaa !9
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = lshr i32 %97, 16
  %99 = load i32, ptr %14, align 4, !tbaa !9
  %100 = xor i32 %99, %98
  store i32 %100, ptr %14, align 4, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %101, ptr %102, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5euler4rotlEPji(ptr noundef, i32 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 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !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"

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5euler6hash32EPKviPjj(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 %3, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %7 = ashr i32 %1, 2
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %4
  %9 = phi i32 [ %3, %4 ], [ %20, %.lr.ph ]
  %.0.lcssa = phi ptr [ %0, %4 ], [ %11, %.lr.ph ]
  store i32 0, ptr %6, align 4, !tbaa !5
  %10 = and i32 %1, 3
  switch i32 %10, label %default.unreachable16 [
    i32 3, label %22
    i32 2, label %27
    i32 1, label %34
    i32 0, label %44
  ]

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.015 = phi ptr [ %11, %.lr.ph ], [ %0, %4 ]
  %.01314 = phi i32 [ %21, %.lr.ph ], [ 0, %4 ]
  %11 = getelementptr inbounds i8, ptr %.015, i64 4
  %12 = load i32, ptr %.015, align 4, !tbaa !5
  %13 = mul i32 %12, -862048943
  store i32 %13, ptr %6, align 4, !tbaa !5
  call void @_ZN5euler4rotlEPji(ptr noundef nonnull %6, i32 noundef 15)
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = mul i32 %14, 461845907
  store i32 %15, ptr %6, align 4, !tbaa !5
  %16 = load i32, ptr %5, align 4, !tbaa !5
  %17 = xor i32 %16, %15
  store i32 %17, ptr %5, align 4, !tbaa !5
  call void @_ZN5euler4rotlEPji(ptr noundef nonnull %5, i32 noundef 13)
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = mul i32 %18, 5
  %20 = add i32 %19, -430675100
  store i32 %20, ptr %5, align 4, !tbaa !5
  %21 = add nuw nsw i32 %.01314, 1
  %exitcond.not = icmp eq i32 %21, %7
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

22:                                               ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %.0.lcssa, i64 2
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = zext i8 %24 to i32
  %26 = shl nuw nsw i32 %25, 16
  store i32 %26, ptr %6, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %._crit_edge, %22
  %28 = phi i32 [ 0, %._crit_edge ], [ %26, %22 ]
  %29 = getelementptr inbounds i8, ptr %.0.lcssa, i64 1
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = zext i8 %30 to i32
  %32 = shl nuw nsw i32 %31, 8
  %33 = or disjoint i32 %32, %28
  br label %34

34:                                               ; preds = %._crit_edge, %27
  %35 = phi i32 [ 0, %._crit_edge ], [ %33, %27 ]
  %36 = load i8, ptr %.0.lcssa, align 1, !tbaa !11
  %37 = zext i8 %36 to i32
  %38 = xor i32 %35, %37
  %39 = mul i32 %38, -862048943
  store i32 %39, ptr %6, align 4, !tbaa !5
  call void @_ZN5euler4rotlEPji(ptr noundef nonnull %6, i32 noundef 15)
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = mul i32 %40, 461845907
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = xor i32 %42, %41
  br label %44

default.unreachable16:                            ; preds = %._crit_edge
  unreachable

44:                                               ; preds = %._crit_edge, %34
  %45 = phi i32 [ %9, %._crit_edge ], [ %43, %34 ]
  %46 = xor i32 %45, %1
  %47 = lshr i32 %46, 16
  %48 = xor i32 %47, %46
  %49 = mul i32 %48, -2048144789
  %50 = lshr i32 %49, 13
  %51 = xor i32 %50, %49
  %52 = mul i32 %51, -1028477387
  %53 = lshr i32 %52, 16
  %54 = xor i32 %53, %52
  store i32 %54, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5euler4rotlEPji(ptr noundef, i32 noundef) local_unnamed_addr #2

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass