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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z9MicroOAATPKvijPv(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #1 {
  %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 ptr, align 8
  %11 = alloca i32, align 4
  %12 = 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) #2
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %13, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %14, i64 %16
  store ptr %17, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = xor i32 %18, 15104
  store i32 %19, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = shl i32 %20, 15
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = lshr i32 %22, 17
  %24 = or i32 %21, %23
  store i32 %24, ptr %12, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %48, %4
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp ne ptr %26, %27
  br i1 %28, label %29, label %51

29:                                               ; preds = %25
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 0
  %32 = load i8, ptr %31, align 1, !tbaa !11
  %33 = zext i8 %32 to i32
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = add i32 %34, %33
  store i32 %35, ptr %11, align 4, !tbaa !9
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = shl i32 %36, 3
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = add i32 %38, %37
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = sub i32 %41, %40
  store i32 %42, ptr %12, align 4, !tbaa !9
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = shl i32 %43, 7
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = lshr i32 %45, 25
  %47 = or i32 %44, %46
  store i32 %47, ptr %11, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %29
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i32 1
  store ptr %50, ptr %9, align 8, !tbaa !5
  br label %25, !llvm.loop !12

51:                                               ; preds = %25
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = xor i32 %52, %53
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %54, ptr %55, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; 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 nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @_Z9MicroOAATPKvijPv(ptr noundef readonly %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = sext i32 %1 to i64
  %6 = getelementptr inbounds i8, ptr %0, i64 %5
  %7 = xor i32 %2, 15104
  %8 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 15)
  %.not21 = icmp eq i32 %1, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %xtraiter = and i64 %5, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader
  %9 = load i8, ptr %0, align 1, !tbaa !5
  %10 = zext i8 %9 to i32
  %11 = add i32 %7, %10
  %12 = mul i32 %11, 9
  %13 = sub i32 %8, %12
  %14 = mul i32 %11, 1152
  %15 = lshr i32 %12, 25
  %16 = or disjoint i32 %15, %14
  %17 = getelementptr inbounds i8, ptr %0, i64 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.lcssa29.unr = phi i32 [ poison, %.lr.ph.preheader ], [ %13, %.lr.ph.prol ]
  %.lcssa.unr = phi i32 [ poison, %.lr.ph.preheader ], [ %16, %.lr.ph.prol ]
  %.024.unr = phi i32 [ %8, %.lr.ph.preheader ], [ %13, %.lr.ph.prol ]
  %.01923.unr = phi i32 [ %7, %.lr.ph.preheader ], [ %16, %.lr.ph.prol ]
  %.02022.unr = phi ptr [ %0, %.lr.ph.preheader ], [ %17, %.lr.ph.prol ]
  %18 = icmp eq i32 %1, 1
  br i1 %18, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.024 = phi i32 [ %32, %.lr.ph ], [ %.024.unr, %.lr.ph.prol.loopexit ]
  %.01923 = phi i32 [ %35, %.lr.ph ], [ %.01923.unr, %.lr.ph.prol.loopexit ]
  %.02022 = phi ptr [ %36, %.lr.ph ], [ %.02022.unr, %.lr.ph.prol.loopexit ]
  %19 = load i8, ptr %.02022, align 1, !tbaa !5
  %20 = zext i8 %19 to i32
  %21 = add i32 %.01923, %20
  %22 = mul i32 %21, 9
  %23 = mul i32 %21, 1152
  %24 = lshr i32 %22, 25
  %25 = or disjoint i32 %24, %23
  %26 = getelementptr inbounds i8, ptr %.02022, i64 1
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = zext i8 %27 to i32
  %29 = add i32 %25, %28
  %30 = mul i32 %29, 9
  %31 = add i32 %22, %30
  %32 = sub i32 %.024, %31
  %33 = mul i32 %29, 1152
  %34 = lshr i32 %30, 25
  %35 = or disjoint i32 %34, %33
  %36 = getelementptr inbounds i8, ptr %.02022, i64 2
  %.not.1 = icmp eq ptr %36, %6
  br i1 %.not.1, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %4
  %.019.lcssa = phi i32 [ %7, %4 ], [ %.lcssa.unr, %.lr.ph.prol.loopexit ], [ %35, %.lr.ph ]
  %.0.lcssa = phi i32 [ %8, %4 ], [ %.lcssa29.unr, %.lr.ph.prol.loopexit ], [ %32, %.lr.ph ]
  %37 = xor i32 %.0.lcssa, %.019.lcssa
  store i32 %37, ptr %3, align 4, !tbaa !10
  ret void
}

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

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


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