; LLVM IR from jgaeddert/liquid-dsp :: sandbox (crc_gentab)

; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [256 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 -306674912, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %34, %0
  %9 = load i32, ptr %6, align 4, !tbaa !5
  %10 = icmp ult i32 %9, 256
  br i1 %10, label %11, label %37

11:                                               ; preds = %8
  %12 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %12, ptr %2, align 4, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %26, %11
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = icmp ult i32 %14, 8
  br i1 %15, label %16, label %29

16:                                               ; preds = %13
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = and i32 %17, 1
  %19 = sub i32 0, %18
  store i32 %19, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = lshr i32 %20, 1
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = and i32 %22, %23
  %25 = xor i32 %21, %24
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %16
  %27 = load i32, ptr %7, align 4, !tbaa !5
  %28 = add i32 %27, 1
  store i32 %28, ptr %7, align 4, !tbaa !5
  br label %13, !llvm.loop !9

29:                                               ; preds = %13
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %29
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = add i32 %35, 1
  store i32 %36, ptr %6, align 4, !tbaa !5
  br label %8, !llvm.loop !11

37:                                               ; preds = %8
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef 256)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %64, %37
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp ult i32 %41, 256
  br i1 %42, label %43, label %67

43:                                               ; preds = %40
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds [256 x i32], ptr %5, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %47)
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 255
  br i1 %50, label %51, label %53

51:                                               ; preds = %43
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %63

53:                                               ; preds = %43
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = add i32 %54, 1
  %56 = urem i32 %55, 8
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %53
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %62

60:                                               ; preds = %53
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %62

62:                                               ; preds = %60, %58
  br label %63

63:                                               ; preds = %62, %51
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !12

67:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 1024, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  ret i32 0
}

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

declare i32 @printf(ptr 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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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 [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
vector.ph:
  %0 = alloca [256 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %0) #3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
  %2 = lshr <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
  %3 = icmp eq <4 x i32> %1, zeroinitializer
  %4 = select <4 x i1> %3, <4 x i32> zeroinitializer, <4 x i32> <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
  %5 = xor <4 x i32> %4, %2
  %6 = lshr <4 x i32> %5, <i32 1, i32 1, i32 1, i32 1>
  %7 = and <4 x i32> %vec.ind, <i32 2, i32 2, i32 2, i32 2>
  %8 = icmp eq <4 x i32> %7, zeroinitializer
  %9 = select <4 x i1> %8, <4 x i32> zeroinitializer, <4 x i32> <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
  %10 = xor <4 x i32> %9, %6
  %11 = lshr <4 x i32> %10, <i32 6, i32 6, i32 6, i32 6>
  %12 = and <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %13 = icmp eq <4 x i32> %12, zeroinitializer
  %14 = select <4 x i1> %13, <4 x i32> zeroinitializer, <4 x i32> <i32 124634137, i32 124634137, i32 124634137, i32 124634137>
  %15 = xor <4 x i32> %14, %11
  %16 = and <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %17 = icmp eq <4 x i32> %16, zeroinitializer
  %18 = select <4 x i1> %17, <4 x i32> zeroinitializer, <4 x i32> <i32 249268274, i32 249268274, i32 249268274, i32 249268274>
  %19 = xor <4 x i32> %18, %15
  %20 = and <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
  %21 = icmp eq <4 x i32> %20, zeroinitializer
  %22 = select <4 x i1> %21, <4 x i32> zeroinitializer, <4 x i32> <i32 498536548, i32 498536548, i32 498536548, i32 498536548>
  %23 = xor <4 x i32> %22, %19
  %24 = and <4 x i32> %vec.ind, <i32 32, i32 32, i32 32, i32 32>
  %25 = icmp eq <4 x i32> %24, zeroinitializer
  %26 = select <4 x i1> %25, <4 x i32> zeroinitializer, <4 x i32> <i32 997073096, i32 997073096, i32 997073096, i32 997073096>
  %27 = xor <4 x i32> %26, %23
  %28 = and <4 x i32> %5, <i32 32, i32 32, i32 32, i32 32>
  %29 = icmp eq <4 x i32> %28, zeroinitializer
  %30 = select <4 x i1> %29, <4 x i32> zeroinitializer, <4 x i32> <i32 1994146192, i32 1994146192, i32 1994146192, i32 1994146192>
  %31 = xor <4 x i32> %30, %27
  %32 = and <4 x i32> %10, <i32 32, i32 32, i32 32, i32 32>
  %33 = icmp eq <4 x i32> %32, zeroinitializer
  %34 = select <4 x i1> %33, <4 x i32> zeroinitializer, <4 x i32> <i32 -306674912, i32 -306674912, i32 -306674912, i32 -306674912>
  %35 = xor <4 x i32> %34, %31
  %36 = getelementptr inbounds [256 x i32], ptr %0, i64 0, i64 %index
  store <4 x i32> %35, ptr %36, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %37 = icmp eq i64 %index.next, 256
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 256)
  br label %40

40:                                               ; preds = %middle.block, %46
  %indvars.iv23 = phi i64 [ 0, %middle.block ], [ %47, %46 ]
  %41 = getelementptr inbounds [256 x i32], ptr %0, i64 0, i64 %indvars.iv23
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %42)
  %44 = icmp eq i64 %indvars.iv23, 255
  br i1 %44, label %.thread, label %46

.thread:                                          ; preds = %40
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.loopexit

46:                                               ; preds = %40
  %47 = add nuw nsw i64 %indvars.iv23, 1
  %48 = and i64 %47, 7
  %49 = icmp eq i64 %48, 0
  %.str.4..str.5 = select i1 %49, ptr @.str.4, ptr @.str.5
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4..str.5)
  %exitcond26.not = icmp eq i64 %47, 256
  br i1 %exitcond26.not, label %.loopexit, label %40, !llvm.loop !13

.loopexit:                                        ; preds = %46, %.thread
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %0) #3
  ret i32 0
}

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

attributes #0 = { nofree 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 = { 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 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass