; LLVM IR from cruppstahl/upscaledb :: 3rdparty/murmurhash3/MurmurHash3.ll (Z18MurmurHash3_x86_32PKvijPv)

; 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 @_Z18MurmurHash3_x86_32PKvijPv(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %19, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = sdiv i32 %20, 4
  store i32 %21, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %22 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %22, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 -862048943, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 461845907, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = mul nsw i32 %24, 4
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %23, i64 %26
  store ptr %27, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = sub nsw i32 0, %28
  store i32 %29, ptr %15, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %52, %4
  %31 = load i32, ptr %15, align 4, !tbaa !9
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %55

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = load i32, ptr %15, align 4, !tbaa !9
  %37 = call noundef i32 @_Z10getblock32PKji(ptr noundef %35, i32 noundef %36)
  store i32 %37, ptr %16, align 4, !tbaa !9
  %38 = load i32, ptr %16, align 4, !tbaa !9
  %39 = mul i32 %38, -862048943
  store i32 %39, ptr %16, align 4, !tbaa !9
  %40 = load i32, ptr %16, align 4, !tbaa !9
  %41 = call noundef i32 @_Z6rotl32ja(i32 noundef %40, i8 noundef signext 15)
  store i32 %41, ptr %16, align 4, !tbaa !9
  %42 = load i32, ptr %16, align 4, !tbaa !9
  %43 = mul i32 %42, 461845907
  store i32 %43, ptr %16, align 4, !tbaa !9
  %44 = load i32, ptr %16, align 4, !tbaa !9
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = xor i32 %45, %44
  store i32 %46, ptr %11, align 4, !tbaa !9
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = call noundef i32 @_Z6rotl32ja(i32 noundef %47, i8 noundef signext 13)
  store i32 %48, ptr %11, align 4, !tbaa !9
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = mul i32 %49, 5
  %51 = add i32 %50, -430675100
  store i32 %51, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %52

52:                                               ; preds = %34
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %15, align 4, !tbaa !9
  br label %30, !llvm.loop !11

55:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = mul nsw i32 %57, 4
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %56, i64 %59
  store ptr %60, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = and i32 %61, 3
  switch i32 %62, label %95 [
    i32 3, label %63
    i32 2, label %71
    i32 1, label %79
  ]

63:                                               ; preds = %55
  %64 = load ptr, ptr %17, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 2
  %66 = load i8, ptr %65, align 1, !tbaa !13
  %67 = zext i8 %66 to i32
  %68 = shl i32 %67, 16
  %69 = load i32, ptr %18, align 4, !tbaa !9
  %70 = xor i32 %69, %68
  store i32 %70, ptr %18, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %63, %55
  %72 = load ptr, ptr %17, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  %74 = load i8, ptr %73, align 1, !tbaa !13
  %75 = zext i8 %74 to i32
  %76 = shl i32 %75, 8
  %77 = load i32, ptr %18, align 4, !tbaa !9
  %78 = xor i32 %77, %76
  store i32 %78, ptr %18, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %71, %55
  %80 = load ptr, ptr %17, align 8, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %80, i64 0
  %82 = load i8, ptr %81, align 1, !tbaa !13
  %83 = zext i8 %82 to i32
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = xor i32 %84, %83
  store i32 %85, ptr %18, align 4, !tbaa !9
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = mul i32 %86, -862048943
  store i32 %87, ptr %18, align 4, !tbaa !9
  %88 = load i32, ptr %18, align 4, !tbaa !9
  %89 = call noundef i32 @_Z6rotl32ja(i32 noundef %88, i8 noundef signext 15)
  store i32 %89, ptr %18, align 4, !tbaa !9
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = mul i32 %90, 461845907
  store i32 %91, ptr %18, align 4, !tbaa !9
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = xor i32 %93, %92
  store i32 %94, ptr %11, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %79, %55
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = xor i32 %97, %96
  store i32 %98, ptr %11, align 4, !tbaa !9
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = call noundef i32 @_Z6fmix32j(i32 noundef %99)
  store i32 %100, ptr %11, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %101, ptr %102, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10getblock32PKji(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6rotl32ja(i32 noundef, i8 noundef signext) #3

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6fmix32j(i32 noundef) #2

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 = { alwaysinline 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 = { 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 #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, !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 @_Z18MurmurHash3_x86_32PKvijPv(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = sdiv i32 %1, 4
  %6 = shl nsw i32 %5, 2
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds i8, ptr %0, i64 %7
  %.off = add i32 %1, 3
  %.not38 = icmp ult i32 %.off, 7
  br i1 %.not38, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %9 = sub nsw i32 0, %5
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %4
  %.035.lcssa = phi i32 [ %2, %4 ], [ %18, %.lr.ph ]
  %10 = and i32 %1, 3
  switch i32 %10, label %default.unreachable41 [
    i32 3, label %20
    i32 2, label %25
    i32 1, label %31
    i32 0, label %39
  ]

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.03540 = phi i32 [ %18, %.lr.ph ], [ %2, %.lr.ph.preheader ]
  %.03739 = phi i32 [ %19, %.lr.ph ], [ %9, %.lr.ph.preheader ]
  %11 = tail call noundef i32 @_Z10getblock32PKji(ptr noundef %8, i32 noundef %.03739)
  %12 = mul i32 %11, -862048943
  %13 = tail call noundef i32 @_Z6rotl32ja(i32 noundef %12, i8 noundef signext 15)
  %14 = mul i32 %13, 461845907
  %15 = xor i32 %14, %.03540
  %16 = tail call noundef i32 @_Z6rotl32ja(i32 noundef %15, i8 noundef signext 13)
  %17 = mul i32 %16, 5
  %18 = add i32 %17, -430675100
  %19 = add nsw i32 %.03739, 1
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

20:                                               ; preds = %._crit_edge
  %21 = getelementptr inbounds i8, ptr %8, i64 2
  %22 = load i8, ptr %21, align 1, !tbaa !7
  %23 = zext i8 %22 to i32
  %24 = shl nuw nsw i32 %23, 16
  br label %25

25:                                               ; preds = %._crit_edge, %20
  %.0 = phi i32 [ 0, %._crit_edge ], [ %24, %20 ]
  %26 = getelementptr inbounds i8, ptr %8, i64 1
  %27 = load i8, ptr %26, align 1, !tbaa !7
  %28 = zext i8 %27 to i32
  %29 = shl nuw nsw i32 %28, 8
  %30 = or disjoint i32 %29, %.0
  br label %31

31:                                               ; preds = %._crit_edge, %25
  %.1 = phi i32 [ 0, %._crit_edge ], [ %30, %25 ]
  %32 = load i8, ptr %8, align 1, !tbaa !7
  %33 = zext i8 %32 to i32
  %34 = xor i32 %.1, %33
  %35 = mul i32 %34, -862048943
  %36 = tail call noundef i32 @_Z6rotl32ja(i32 noundef %35, i8 noundef signext 15)
  %37 = mul i32 %36, 461845907
  %38 = xor i32 %37, %.035.lcssa
  br label %39

default.unreachable41:                            ; preds = %._crit_edge
  unreachable

39:                                               ; preds = %._crit_edge, %31
  %.136 = phi i32 [ %.035.lcssa, %._crit_edge ], [ %38, %31 ]
  %40 = xor i32 %.136, %1
  %41 = tail call noundef i32 @_Z6fmix32j(i32 noundef %40)
  store i32 %41, ptr %3, align 4, !tbaa !10
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10getblock32PKji(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6rotl32ja(i32 noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6fmix32j(i32 noundef) local_unnamed_addr #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 = { alwaysinline 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 #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" }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}


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