; LLVM IR from jgaeddert/liquid-dsp :: sandbox (fec_hamming74_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"

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

; Function Attrs: nounwind uwtable
define dso_local i32 @hamming74_dec_symbol(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = and i32 %13, 85
  %15 = call i32 @count_ones(i32 noundef %14)
  %16 = urem i32 %15, 2
  store i32 %16, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = and i32 %17, 51
  %19 = call i32 @count_ones(i32 noundef %18)
  %20 = urem i32 %19, 2
  store i32 %20, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = and i32 %21, 15
  %23 = call i32 @count_ones(i32 noundef %22)
  %24 = urem i32 %23, 2
  store i32 %24, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = shl i32 %25, 0
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = shl i32 %27, 1
  %29 = or i32 %26, %28
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = shl i32 %30, 2
  %32 = or i32 %29, %31
  store i32 %32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %33 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %33, ptr %7, align 4, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %1
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sub i32 7, %37
  %39 = shl i32 1, %38
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = xor i32 %40, %39
  store i32 %41, ptr %7, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %36, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = and i32 %43, 16
  %45 = call i32 @count_ones(i32 noundef %44)
  %46 = urem i32 %45, 2
  store i32 %46, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = and i32 %47, 4
  %49 = call i32 @count_ones(i32 noundef %48)
  %50 = urem i32 %49, 2
  store i32 %50, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = and i32 %51, 2
  %53 = call i32 @count_ones(i32 noundef %52)
  %54 = urem i32 %53, 2
  store i32 %54, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = and i32 %55, 1
  %57 = call i32 @count_ones(i32 noundef %56)
  %58 = urem i32 %57, 2
  store i32 %58, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = shl i32 %59, 3
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = shl i32 %61, 2
  %63 = or i32 %60, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = shl i32 %64, 1
  %66 = or i32 %63, %65
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = shl i32 %67, 0
  %69 = or i32 %66, %68
  store i32 %69, ptr %12, align 4, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !5
  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 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret i32 %70
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @count_ones(i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; 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: nounwind uwtable
define dso_local range(i32 0, 16) i32 @hamming74_dec_symbol(i32 noundef %0) local_unnamed_addr #0 {
  %2 = and i32 %0, 85
  %3 = tail call i32 @count_ones(i32 noundef %2)
  %4 = and i32 %3, 1
  %5 = and i32 %0, 51
  %6 = tail call i32 @count_ones(i32 noundef %5)
  %7 = and i32 %0, 15
  %8 = tail call i32 @count_ones(i32 noundef %7)
  %9 = shl i32 %6, 1
  %10 = and i32 %9, 2
  %11 = or disjoint i32 %10, %4
  %12 = shl i32 %8, 2
  %13 = and i32 %12, 4
  %14 = or disjoint i32 %11, %13
  %.not = icmp eq i32 %14, 0
  %15 = xor i32 %14, 7
  %16 = shl nuw nsw i32 1, %15
  %17 = select i1 %.not, i32 0, i32 %16
  %.0 = xor i32 %17, %0
  %18 = and i32 %.0, 16
  %19 = tail call i32 @count_ones(i32 noundef %18)
  %20 = and i32 %.0, 4
  %21 = tail call i32 @count_ones(i32 noundef %20)
  %22 = and i32 %.0, 2
  %23 = tail call i32 @count_ones(i32 noundef %22)
  %24 = and i32 %.0, 1
  %25 = tail call i32 @count_ones(i32 noundef %24)
  %26 = and i32 %25, 1
  %27 = shl i32 %19, 3
  %28 = and i32 %27, 8
  %29 = shl i32 %21, 2
  %30 = and i32 %29, 4
  %31 = or disjoint i32 %30, %28
  %32 = shl i32 %23, 1
  %33 = and i32 %32, 2
  %34 = or disjoint i32 %31, %33
  %35 = or disjoint i32 %34, %26
  ret i32 %35
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @count_ones(i32 noundef) local_unnamed_addr #0

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" }

!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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass