; 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_pack(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 = %28, %4
  %14 = load i32, ptr %9, align 4, !tbaa !9
  %15 = icmp ult i32 %14, 16
  br i1 %15, label %16, label %31

16:                                               ; preds = %13
  %17 = load ptr, ptr %8, 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 = load i8, ptr %23, align 1, !tbaa !11
  %25 = call i32 @liquid_pack_array(ptr noundef %18, i32 noundef 29, i32 noundef %19, i32 noundef 6, i8 noundef zeroext %24)
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = add i32 %26, 6
  store i32 %27, ptr %10, align 4, !tbaa !9
  br label %28

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

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

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

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

47:                                               ; preds = %35
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = add i32 %48, 1
  store i32 %49, ptr %9, align 4, !tbaa !9
  br label %32, !llvm.loop !14

50:                                               ; preds = %32
  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_pack_array(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) #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 = !{!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: nounwind uwtable
define dso_local void @spc2216_pack(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr noundef %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 %3, i64 32
  %5 = load i8, ptr %1, align 1, !tbaa !5
  %6 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 0, i32 noundef 6, i8 noundef zeroext %5) #3
  %7 = getelementptr inbounds i8, ptr %1, i64 1
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 6, i32 noundef 6, i8 noundef zeroext %8) #3
  %10 = getelementptr inbounds i8, ptr %1, i64 2
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 12, i32 noundef 6, i8 noundef zeroext %11) #3
  %13 = getelementptr inbounds i8, ptr %1, i64 3
  %14 = load i8, ptr %13, align 1, !tbaa !5
  %15 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 18, i32 noundef 6, i8 noundef zeroext %14) #3
  %16 = getelementptr inbounds i8, ptr %1, i64 4
  %17 = load i8, ptr %16, align 1, !tbaa !5
  %18 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 24, i32 noundef 6, i8 noundef zeroext %17) #3
  %19 = getelementptr inbounds i8, ptr %1, i64 5
  %20 = load i8, ptr %19, align 1, !tbaa !5
  %21 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 30, i32 noundef 6, i8 noundef zeroext %20) #3
  %22 = getelementptr inbounds i8, ptr %1, i64 6
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 36, i32 noundef 6, i8 noundef zeroext %23) #3
  %25 = getelementptr inbounds i8, ptr %1, i64 7
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 42, i32 noundef 6, i8 noundef zeroext %26) #3
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 48, i32 noundef 6, i8 noundef zeroext %29) #3
  %31 = getelementptr inbounds i8, ptr %1, i64 9
  %32 = load i8, ptr %31, align 1, !tbaa !5
  %33 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 54, i32 noundef 6, i8 noundef zeroext %32) #3
  %34 = getelementptr inbounds i8, ptr %1, i64 10
  %35 = load i8, ptr %34, align 1, !tbaa !5
  %36 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 60, i32 noundef 6, i8 noundef zeroext %35) #3
  %37 = getelementptr inbounds i8, ptr %1, i64 11
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 66, i32 noundef 6, i8 noundef zeroext %38) #3
  %40 = getelementptr inbounds i8, ptr %1, i64 12
  %41 = load i8, ptr %40, align 1, !tbaa !5
  %42 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 72, i32 noundef 6, i8 noundef zeroext %41) #3
  %43 = getelementptr inbounds i8, ptr %1, i64 13
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 78, i32 noundef 6, i8 noundef zeroext %44) #3
  %46 = getelementptr inbounds i8, ptr %1, i64 14
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 84, i32 noundef 6, i8 noundef zeroext %47) #3
  %49 = getelementptr inbounds i8, ptr %1, i64 15
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 90, i32 noundef 6, i8 noundef zeroext %50) #3
  %52 = load i8, ptr %2, align 1, !tbaa !5
  %53 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 96, i32 noundef 6, i8 noundef zeroext %52) #3
  %54 = getelementptr inbounds i8, ptr %2, i64 1
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %56 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 102, i32 noundef 6, i8 noundef zeroext %55) #3
  %57 = getelementptr inbounds i8, ptr %2, i64 2
  %58 = load i8, ptr %57, align 1, !tbaa !5
  %59 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 108, i32 noundef 6, i8 noundef zeroext %58) #3
  %60 = getelementptr inbounds i8, ptr %2, i64 3
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 114, i32 noundef 6, i8 noundef zeroext %61) #3
  %63 = getelementptr inbounds i8, ptr %2, i64 4
  %64 = load i8, ptr %63, align 1, !tbaa !5
  %65 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 120, i32 noundef 6, i8 noundef zeroext %64) #3
  %66 = getelementptr inbounds i8, ptr %2, i64 5
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 126, i32 noundef 6, i8 noundef zeroext %67) #3
  %69 = getelementptr inbounds i8, ptr %2, i64 6
  %70 = load i8, ptr %69, align 1, !tbaa !5
  %71 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 132, i32 noundef 6, i8 noundef zeroext %70) #3
  %72 = getelementptr inbounds i8, ptr %2, i64 7
  %73 = load i8, ptr %72, align 1, !tbaa !5
  %74 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 138, i32 noundef 6, i8 noundef zeroext %73) #3
  %75 = getelementptr inbounds i8, ptr %2, i64 8
  %76 = load i8, ptr %75, align 1, !tbaa !5
  %77 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 144, i32 noundef 6, i8 noundef zeroext %76) #3
  %78 = getelementptr inbounds i8, ptr %2, i64 9
  %79 = load i8, ptr %78, align 1, !tbaa !5
  %80 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 150, i32 noundef 6, i8 noundef zeroext %79) #3
  %81 = getelementptr inbounds i8, ptr %2, i64 10
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 156, i32 noundef 6, i8 noundef zeroext %82) #3
  %84 = getelementptr inbounds i8, ptr %2, i64 11
  %85 = load i8, ptr %84, align 1, !tbaa !5
  %86 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 162, i32 noundef 6, i8 noundef zeroext %85) #3
  %87 = getelementptr inbounds i8, ptr %2, i64 12
  %88 = load i8, ptr %87, align 1, !tbaa !5
  %89 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 168, i32 noundef 6, i8 noundef zeroext %88) #3
  %90 = getelementptr inbounds i8, ptr %2, i64 13
  %91 = load i8, ptr %90, align 1, !tbaa !5
  %92 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 174, i32 noundef 6, i8 noundef zeroext %91) #3
  %93 = getelementptr inbounds i8, ptr %2, i64 14
  %94 = load i8, ptr %93, align 1, !tbaa !5
  %95 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 180, i32 noundef 6, i8 noundef zeroext %94) #3
  %96 = getelementptr inbounds i8, ptr %2, i64 15
  %97 = load i8, ptr %96, align 1, !tbaa !5
  %98 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 186, i32 noundef 6, i8 noundef zeroext %97) #3
  %99 = getelementptr inbounds i8, ptr %2, i64 16
  %100 = load i8, ptr %99, align 1, !tbaa !5
  %101 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 192, i32 noundef 6, i8 noundef zeroext %100) #3
  %102 = getelementptr inbounds i8, ptr %2, i64 17
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 198, i32 noundef 6, i8 noundef zeroext %103) #3
  %105 = getelementptr inbounds i8, ptr %2, i64 18
  %106 = load i8, ptr %105, align 1, !tbaa !5
  %107 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 204, i32 noundef 6, i8 noundef zeroext %106) #3
  %108 = getelementptr inbounds i8, ptr %2, i64 19
  %109 = load i8, ptr %108, align 1, !tbaa !5
  %110 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 210, i32 noundef 6, i8 noundef zeroext %109) #3
  %111 = getelementptr inbounds i8, ptr %2, i64 20
  %112 = load i8, ptr %111, align 1, !tbaa !5
  %113 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 216, i32 noundef 6, i8 noundef zeroext %112) #3
  %114 = getelementptr inbounds i8, ptr %2, i64 21
  %115 = load i8, ptr %114, align 1, !tbaa !5
  %116 = tail call i32 @liquid_pack_array(ptr noundef nonnull %4, i32 noundef 29, i32 noundef 222, i32 noundef 6, i8 noundef zeroext %115) #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_pack_array(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i8 noundef zeroext) 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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


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