; LLVM IR from apache/kvrocks :: src/vendor/crc64.ll (Z18crcspeed64big_initPFmmPKvmEPA256_m)

; 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
declare dso_local void @_Z21crcspeed64little_initPFmmPKvmEPA256_m(ptr noundef, 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18crcspeed64big_initPFmmPKvmEPA256_m(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_Z21crcspeed64little_initPFmmPKvmEPA256_m(ptr noundef %8, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %40, %2
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 8
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %43

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %36, %14
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 256
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %39

19:                                               ; preds = %15
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [256 x i64], ptr %20, i64 %22
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [256 x i64], ptr %23, i64 0, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !11
  %28 = call noundef i64 @_ZL4rev8m(i64 noundef %27)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [256 x i64], ptr %29, i64 %31
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [256 x i64], ptr %32, i64 0, i64 %34
  store i64 %28, ptr %35, align 8, !tbaa !11
  br label %36

36:                                               ; preds = %19
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %7, align 4, !tbaa !9
  br label %15, !llvm.loop !13

39:                                               ; preds = %18
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %5, align 4, !tbaa !9
  br label %10, !llvm.loop !15

43:                                               ; preds = %13
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL4rev8m(i64 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 uwtable
declare dso_local void @_Z21crcspeed64little_initPFmmPKvmEPA256_m(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18crcspeed64big_initPFmmPKvmEPA256_m(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
.preheader:
  tail call void @_Z21crcspeed64little_initPFmmPKvmEPA256_m(ptr noundef %0, ptr noundef %1)
  br label %24

.preheader.1:                                     ; preds = %24, %.preheader.1
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %.preheader.1 ], [ 0, %24 ]
  %2 = getelementptr inbounds [256 x i64], ptr %1, i64 1, i64 %indvars.iv.1
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %4 = tail call noundef i64 @_ZL4rev8m(i64 noundef %3)
  store i64 %4, ptr %2, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, 256
  br i1 %exitcond.1.not, label %.preheader.2, label %.preheader.1, !llvm.loop !9

.preheader.2:                                     ; preds = %.preheader.1, %.preheader.2
  %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %.preheader.2 ], [ 0, %.preheader.1 ]
  %5 = getelementptr inbounds [256 x i64], ptr %1, i64 2, i64 %indvars.iv.2
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef i64 @_ZL4rev8m(i64 noundef %6)
  store i64 %7, ptr %5, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %exitcond.2.not = icmp eq i64 %indvars.iv.next.2, 256
  br i1 %exitcond.2.not, label %.preheader.3, label %.preheader.2, !llvm.loop !9

.preheader.3:                                     ; preds = %.preheader.2, %.preheader.3
  %indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %.preheader.3 ], [ 0, %.preheader.2 ]
  %8 = getelementptr inbounds [256 x i64], ptr %1, i64 3, i64 %indvars.iv.3
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i64 @_ZL4rev8m(i64 noundef %9)
  store i64 %10, ptr %8, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %exitcond.3.not = icmp eq i64 %indvars.iv.next.3, 256
  br i1 %exitcond.3.not, label %.preheader.4, label %.preheader.3, !llvm.loop !9

.preheader.4:                                     ; preds = %.preheader.3, %.preheader.4
  %indvars.iv.4 = phi i64 [ %indvars.iv.next.4, %.preheader.4 ], [ 0, %.preheader.3 ]
  %11 = getelementptr inbounds [256 x i64], ptr %1, i64 4, i64 %indvars.iv.4
  %12 = load i64, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef i64 @_ZL4rev8m(i64 noundef %12)
  store i64 %13, ptr %11, align 8, !tbaa !5
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %exitcond.4.not = icmp eq i64 %indvars.iv.next.4, 256
  br i1 %exitcond.4.not, label %.preheader.5, label %.preheader.4, !llvm.loop !9

.preheader.5:                                     ; preds = %.preheader.4, %.preheader.5
  %indvars.iv.5 = phi i64 [ %indvars.iv.next.5, %.preheader.5 ], [ 0, %.preheader.4 ]
  %14 = getelementptr inbounds [256 x i64], ptr %1, i64 5, i64 %indvars.iv.5
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = tail call noundef i64 @_ZL4rev8m(i64 noundef %15)
  store i64 %16, ptr %14, align 8, !tbaa !5
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %exitcond.5.not = icmp eq i64 %indvars.iv.next.5, 256
  br i1 %exitcond.5.not, label %.preheader.6, label %.preheader.5, !llvm.loop !9

.preheader.6:                                     ; preds = %.preheader.5, %.preheader.6
  %indvars.iv.6 = phi i64 [ %indvars.iv.next.6, %.preheader.6 ], [ 0, %.preheader.5 ]
  %17 = getelementptr inbounds [256 x i64], ptr %1, i64 6, i64 %indvars.iv.6
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = tail call noundef i64 @_ZL4rev8m(i64 noundef %18)
  store i64 %19, ptr %17, align 8, !tbaa !5
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %exitcond.6.not = icmp eq i64 %indvars.iv.next.6, 256
  br i1 %exitcond.6.not, label %.preheader.7, label %.preheader.6, !llvm.loop !9

.preheader.7:                                     ; preds = %.preheader.6, %.preheader.7
  %indvars.iv.7 = phi i64 [ %indvars.iv.next.7, %.preheader.7 ], [ 0, %.preheader.6 ]
  %20 = getelementptr inbounds [256 x i64], ptr %1, i64 7, i64 %indvars.iv.7
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = tail call noundef i64 @_ZL4rev8m(i64 noundef %21)
  store i64 %22, ptr %20, align 8, !tbaa !5
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %exitcond.7.not = icmp eq i64 %indvars.iv.next.7, 256
  br i1 %exitcond.7.not, label %23, label %.preheader.7, !llvm.loop !9

23:                                               ; preds = %.preheader.7
  ret void

24:                                               ; preds = %.preheader, %24
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %24 ]
  %25 = getelementptr inbounds [256 x i64], ptr %1, i64 0, i64 %indvars.iv
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = tail call noundef i64 @_ZL4rev8m(i64 noundef %26)
  store i64 %27, ptr %25, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %.preheader.1, label %24, !llvm.loop !9
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL4rev8m(i64 noundef) local_unnamed_addr #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 = { 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 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass