; 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_unpack(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %11 = load ptr, ptr %8, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %11, ptr align 1 %12, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %27, %4
  %14 = load i32, ptr %9, align 4, !tbaa !9
  %15 = icmp ult i32 %14, 16
  br i1 %15, label %16, label %30

16:                                               ; preds = %13
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load i32, ptr %10, align 4, !tbaa !9
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = getelementptr inbounds i8, ptr %20, i64 %22
  %24 = call i32 @liquid_unpack_array(ptr noundef %18, i32 noundef 29, i32 noundef %19, i32 noundef 6, ptr noundef %23)
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = add i32 %25, 6
  store i32 %26, ptr %10, align 4, !tbaa !9
  br label %27

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

30:                                               ; preds = %13
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %45, %30
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp ult i32 %32, 22
  br i1 %33, label %34, label %48

34:                                               ; preds = %31
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 32
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %38, i64 %40
  %42 = call i32 @liquid_unpack_array(ptr noundef %36, i32 noundef 29, i32 noundef %37, i32 noundef 6, ptr noundef %41)
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add i32 %43, 6
  store i32 %44, ptr %10, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %34
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = add i32 %46, 1
  store i32 %47, ptr %9, align 4, !tbaa !9
  br label %31, !llvm.loop !13

48:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #2

declare i32 @liquid_unpack_array(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

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


; 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 void @spc2216_unpack(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
.preheader:
  tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %3, ptr noundef nonnull align 1 dereferenceable(32) %0, i64 32, i1 false)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 0, i32 noundef 6, ptr noundef %1) #3
  %6 = getelementptr inbounds i8, ptr %1, i64 1
  %7 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 6, i32 noundef 6, ptr noundef nonnull %6) #3
  %8 = getelementptr inbounds i8, ptr %1, i64 2
  %9 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 12, i32 noundef 6, ptr noundef nonnull %8) #3
  %10 = getelementptr inbounds i8, ptr %1, i64 3
  %11 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 18, i32 noundef 6, ptr noundef nonnull %10) #3
  %12 = getelementptr inbounds i8, ptr %1, i64 4
  %13 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 24, i32 noundef 6, ptr noundef nonnull %12) #3
  %14 = getelementptr inbounds i8, ptr %1, i64 5
  %15 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 30, i32 noundef 6, ptr noundef nonnull %14) #3
  %16 = getelementptr inbounds i8, ptr %1, i64 6
  %17 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 36, i32 noundef 6, ptr noundef nonnull %16) #3
  %18 = getelementptr inbounds i8, ptr %1, i64 7
  %19 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 42, i32 noundef 6, ptr noundef nonnull %18) #3
  %20 = getelementptr inbounds i8, ptr %1, i64 8
  %21 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 48, i32 noundef 6, ptr noundef nonnull %20) #3
  %22 = getelementptr inbounds i8, ptr %1, i64 9
  %23 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 54, i32 noundef 6, ptr noundef nonnull %22) #3
  %24 = getelementptr inbounds i8, ptr %1, i64 10
  %25 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 60, i32 noundef 6, ptr noundef nonnull %24) #3
  %26 = getelementptr inbounds i8, ptr %1, i64 11
  %27 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 66, i32 noundef 6, ptr noundef nonnull %26) #3
  %28 = getelementptr inbounds i8, ptr %1, i64 12
  %29 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 72, i32 noundef 6, ptr noundef nonnull %28) #3
  %30 = getelementptr inbounds i8, ptr %1, i64 13
  %31 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 78, i32 noundef 6, ptr noundef nonnull %30) #3
  %32 = getelementptr inbounds i8, ptr %1, i64 14
  %33 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 84, i32 noundef 6, ptr noundef nonnull %32) #3
  %34 = getelementptr inbounds i8, ptr %1, i64 15
  %35 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 90, i32 noundef 6, ptr noundef nonnull %34) #3
  %36 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 96, i32 noundef 6, ptr noundef %2) #3
  %37 = getelementptr inbounds i8, ptr %2, i64 1
  %38 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 102, i32 noundef 6, ptr noundef nonnull %37) #3
  %39 = getelementptr inbounds i8, ptr %2, i64 2
  %40 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 108, i32 noundef 6, ptr noundef nonnull %39) #3
  %41 = getelementptr inbounds i8, ptr %2, i64 3
  %42 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 114, i32 noundef 6, ptr noundef nonnull %41) #3
  %43 = getelementptr inbounds i8, ptr %2, i64 4
  %44 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 120, i32 noundef 6, ptr noundef nonnull %43) #3
  %45 = getelementptr inbounds i8, ptr %2, i64 5
  %46 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 126, i32 noundef 6, ptr noundef nonnull %45) #3
  %47 = getelementptr inbounds i8, ptr %2, i64 6
  %48 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 132, i32 noundef 6, ptr noundef nonnull %47) #3
  %49 = getelementptr inbounds i8, ptr %2, i64 7
  %50 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 138, i32 noundef 6, ptr noundef nonnull %49) #3
  %51 = getelementptr inbounds i8, ptr %2, i64 8
  %52 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 144, i32 noundef 6, ptr noundef nonnull %51) #3
  %53 = getelementptr inbounds i8, ptr %2, i64 9
  %54 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 150, i32 noundef 6, ptr noundef nonnull %53) #3
  %55 = getelementptr inbounds i8, ptr %2, i64 10
  %56 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 156, i32 noundef 6, ptr noundef nonnull %55) #3
  %57 = getelementptr inbounds i8, ptr %2, i64 11
  %58 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 162, i32 noundef 6, ptr noundef nonnull %57) #3
  %59 = getelementptr inbounds i8, ptr %2, i64 12
  %60 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 168, i32 noundef 6, ptr noundef nonnull %59) #3
  %61 = getelementptr inbounds i8, ptr %2, i64 13
  %62 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 174, i32 noundef 6, ptr noundef nonnull %61) #3
  %63 = getelementptr inbounds i8, ptr %2, i64 14
  %64 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 180, i32 noundef 6, ptr noundef nonnull %63) #3
  %65 = getelementptr inbounds i8, ptr %2, i64 15
  %66 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 186, i32 noundef 6, ptr noundef nonnull %65) #3
  %67 = getelementptr inbounds i8, ptr %2, i64 16
  %68 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 192, i32 noundef 6, ptr noundef nonnull %67) #3
  %69 = getelementptr inbounds i8, ptr %2, i64 17
  %70 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 198, i32 noundef 6, ptr noundef nonnull %69) #3
  %71 = getelementptr inbounds i8, ptr %2, i64 18
  %72 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 204, i32 noundef 6, ptr noundef nonnull %71) #3
  %73 = getelementptr inbounds i8, ptr %2, i64 19
  %74 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 210, i32 noundef 6, ptr noundef nonnull %73) #3
  %75 = getelementptr inbounds i8, ptr %2, i64 20
  %76 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 216, i32 noundef 6, ptr noundef nonnull %75) #3
  %77 = getelementptr inbounds i8, ptr %2, i64 21
  %78 = tail call i32 @liquid_unpack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 222, i32 noundef 6, ptr noundef nonnull %77) #3
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #1

declare i32 @liquid_unpack_array(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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 = { mustprogress nocallback nofree 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)"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass