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

; 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: nounwind uwtable
define dso_local void @spc2216_encode(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [16 x i8], align 16
  %7 = alloca [22 x i8], align 16
  %8 = alloca [44 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 22, ptr %7) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %22, %2
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = icmp ult i32 %10, 16
  br i1 %11, label %12, label %25

12:                                               ; preds = %9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = mul i32 2, %14
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %13, i64 %16
  %18 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef %17)
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 %20
  store i8 %18, ptr %21, align 1, !tbaa !11
  br label %22

22:                                               ; preds = %12
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = add i32 %23, 1
  store i32 %24, ptr %5, align 4, !tbaa !9
  br label %9, !llvm.loop !12

25:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 44, ptr %8) #3
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %28 = getelementptr inbounds [44 x i8], ptr %8, i64 0, i64 0
  call void @spc2216_transpose_row(ptr noundef %26, ptr noundef %27, ptr noundef %28)
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %41, %25
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = icmp ult i32 %30, 22
  br i1 %31, label %32, label %44

32:                                               ; preds = %29
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = mul i32 2, %33
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds [44 x i8], ptr %8, i64 0, i64 %35
  %37 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef %36)
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [22 x i8], ptr %7, i64 0, i64 %39
  store i8 %37, ptr %40, align 1, !tbaa !11
  br label %41

41:                                               ; preds = %32
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = add i32 %42, 1
  store i32 %43, ptr %5, align 4, !tbaa !9
  br label %29, !llvm.loop !14

44:                                               ; preds = %29
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %47 = getelementptr inbounds [22 x i8], ptr %7, i64 0, i64 0
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  call void @spc2216_pack(ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %48)
  call void @llvm.lifetime.end.p0(i64 44, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 22, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret void
}

declare zeroext i8 @fec_secded2216_compute_parity(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @spc2216_transpose_row(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @spc2216_pack(ptr noundef, ptr noundef, ptr noundef, ptr 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 = { "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/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"}
!14 = distinct !{!14, !13}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @spc2216_encode(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca [16 x i8], align 16
  %4 = alloca [22 x i8], align 16
  %5 = alloca [44 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 22, ptr nonnull %4) #3
  %6 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef %0) #3
  store i8 %6, ptr %3, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 2
  %8 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %7) #3
  %9 = getelementptr inbounds i8, ptr %3, i64 1
  store i8 %8, ptr %9, align 1, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %10) #3
  %12 = getelementptr inbounds i8, ptr %3, i64 2
  store i8 %11, ptr %12, align 2, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 6
  %14 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %13) #3
  %15 = getelementptr inbounds i8, ptr %3, i64 3
  store i8 %14, ptr %15, align 1, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %16) #3
  %18 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 %17, ptr %18, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 10
  %20 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %19) #3
  %21 = getelementptr inbounds i8, ptr %3, i64 5
  store i8 %20, ptr %21, align 1, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 12
  %23 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %22) #3
  %24 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 %23, ptr %24, align 2, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 14
  %26 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %25) #3
  %27 = getelementptr inbounds i8, ptr %3, i64 7
  store i8 %26, ptr %27, align 1, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %28) #3
  %30 = getelementptr inbounds i8, ptr %3, i64 8
  store i8 %29, ptr %30, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 18
  %32 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %31) #3
  %33 = getelementptr inbounds i8, ptr %3, i64 9
  store i8 %32, ptr %33, align 1, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %0, i64 20
  %35 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %34) #3
  %36 = getelementptr inbounds i8, ptr %3, i64 10
  store i8 %35, ptr %36, align 2, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 22
  %38 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %37) #3
  %39 = getelementptr inbounds i8, ptr %3, i64 11
  store i8 %38, ptr %39, align 1, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %0, i64 24
  %41 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %40) #3
  %42 = getelementptr inbounds i8, ptr %3, i64 12
  store i8 %41, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 26
  %44 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %43) #3
  %45 = getelementptr inbounds i8, ptr %3, i64 13
  store i8 %44, ptr %45, align 1, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %0, i64 28
  %47 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %46) #3
  %48 = getelementptr inbounds i8, ptr %3, i64 14
  store i8 %47, ptr %48, align 2, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %0, i64 30
  %50 = tail call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %49) #3
  %51 = getelementptr inbounds i8, ptr %3, i64 15
  store i8 %50, ptr %51, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %5) #3
  call void @spc2216_transpose_row(ptr noundef %0, ptr noundef nonnull %3, ptr noundef nonnull %5)
  %52 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %5) #3
  store i8 %52, ptr %4, align 16, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %5, i64 2
  %54 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %53) #3
  %55 = getelementptr inbounds i8, ptr %4, i64 1
  store i8 %54, ptr %55, align 1, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %5, i64 4
  %57 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %56) #3
  %58 = getelementptr inbounds i8, ptr %4, i64 2
  store i8 %57, ptr %58, align 2, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %5, i64 6
  %60 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %59) #3
  %61 = getelementptr inbounds i8, ptr %4, i64 3
  store i8 %60, ptr %61, align 1, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %5, i64 8
  %63 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %62) #3
  %64 = getelementptr inbounds i8, ptr %4, i64 4
  store i8 %63, ptr %64, align 4, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %5, i64 10
  %66 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %65) #3
  %67 = getelementptr inbounds i8, ptr %4, i64 5
  store i8 %66, ptr %67, align 1, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %5, i64 12
  %69 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %68) #3
  %70 = getelementptr inbounds i8, ptr %4, i64 6
  store i8 %69, ptr %70, align 2, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %5, i64 14
  %72 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %71) #3
  %73 = getelementptr inbounds i8, ptr %4, i64 7
  store i8 %72, ptr %73, align 1, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %5, i64 16
  %75 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %74) #3
  %76 = getelementptr inbounds i8, ptr %4, i64 8
  store i8 %75, ptr %76, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %5, i64 18
  %78 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %77) #3
  %79 = getelementptr inbounds i8, ptr %4, i64 9
  store i8 %78, ptr %79, align 1, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %5, i64 20
  %81 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %80) #3
  %82 = getelementptr inbounds i8, ptr %4, i64 10
  store i8 %81, ptr %82, align 2, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %5, i64 22
  %84 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %83) #3
  %85 = getelementptr inbounds i8, ptr %4, i64 11
  store i8 %84, ptr %85, align 1, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %5, i64 24
  %87 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %86) #3
  %88 = getelementptr inbounds i8, ptr %4, i64 12
  store i8 %87, ptr %88, align 4, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %5, i64 26
  %90 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %89) #3
  %91 = getelementptr inbounds i8, ptr %4, i64 13
  store i8 %90, ptr %91, align 1, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %5, i64 28
  %93 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %92) #3
  %94 = getelementptr inbounds i8, ptr %4, i64 14
  store i8 %93, ptr %94, align 2, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %5, i64 30
  %96 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %95) #3
  %97 = getelementptr inbounds i8, ptr %4, i64 15
  store i8 %96, ptr %97, align 1, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %5, i64 32
  %99 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %98) #3
  %100 = getelementptr inbounds i8, ptr %4, i64 16
  store i8 %99, ptr %100, align 16, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %5, i64 34
  %102 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %101) #3
  %103 = getelementptr inbounds i8, ptr %4, i64 17
  store i8 %102, ptr %103, align 1, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %5, i64 36
  %105 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %104) #3
  %106 = getelementptr inbounds i8, ptr %4, i64 18
  store i8 %105, ptr %106, align 2, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %5, i64 38
  %108 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %107) #3
  %109 = getelementptr inbounds i8, ptr %4, i64 19
  store i8 %108, ptr %109, align 1, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %5, i64 40
  %111 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %110) #3
  %112 = getelementptr inbounds i8, ptr %4, i64 20
  store i8 %111, ptr %112, align 4, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %5, i64 42
  %114 = call zeroext i8 @fec_secded2216_compute_parity(ptr noundef nonnull %113) #3
  %115 = getelementptr inbounds i8, ptr %4, i64 21
  store i8 %114, ptr %115, align 1, !tbaa !5
  call void @spc2216_pack(ptr noundef %0, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 22, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret void
}

declare zeroext i8 @fec_secded2216_compute_parity(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @spc2216_transpose_row(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @spc2216_pack(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass