; LLVM IR from jgaeddert/liquid-dsp :: src/fec/src (fec)

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

%struct.fec_s = type { i32, float, i32, i32, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr }

; 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
declare dso_local i32 @fec_get_enc_msg_length(i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @fec_decode_soft(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.fec_s, ptr %14, i32 0, i32 36
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %27

18:                                               ; preds = %4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.fec_s, ptr %19, i32 0, i32 36
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = call i32 %21(ptr noundef %22, i32 noundef %23, ptr noundef %24, ptr noundef %25)
  store i32 %26, ptr %5, align 4
  br label %190

27:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.fec_s, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !14
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = call i32 @fec_get_enc_msg_length(i32 noundef %30, i32 noundef %31)
  store i32 %32, ptr %10, align 4, !tbaa !9
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = call ptr @llvm.stacksave.p0()
  store ptr %35, ptr %11, align 8
  %36 = alloca i8, i64 %34, align 16
  store i64 %34, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %181, %27
  %38 = load i32, ptr %13, align 4, !tbaa !9
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = icmp ult i32 %38, %39
  br i1 %40, label %41, label %184

41:                                               ; preds = %37
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %36, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !15
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = mul i32 8, %46
  %48 = add i32 %47, 0
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds i8, ptr %45, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !15
  %52 = zext i8 %51 to i32
  %53 = ashr i32 %52, 0
  %54 = and i32 %53, 128
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %36, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !15
  %59 = zext i8 %58 to i32
  %60 = or i32 %59, %54
  %61 = trunc i32 %60 to i8
  store i8 %61, ptr %57, align 1, !tbaa !15
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = mul i32 8, %63
  %65 = add i32 %64, 1
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %62, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !15
  %69 = zext i8 %68 to i32
  %70 = ashr i32 %69, 1
  %71 = and i32 %70, 64
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds i8, ptr %36, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !15
  %76 = zext i8 %75 to i32
  %77 = or i32 %76, %71
  %78 = trunc i32 %77 to i8
  store i8 %78, ptr %74, align 1, !tbaa !15
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = mul i32 8, %80
  %82 = add i32 %81, 2
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %79, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !15
  %86 = zext i8 %85 to i32
  %87 = ashr i32 %86, 2
  %88 = and i32 %87, 32
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %36, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !15
  %93 = zext i8 %92 to i32
  %94 = or i32 %93, %88
  %95 = trunc i32 %94 to i8
  store i8 %95, ptr %91, align 1, !tbaa !15
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = mul i32 8, %97
  %99 = add i32 %98, 3
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %96, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !15
  %103 = zext i8 %102 to i32
  %104 = ashr i32 %103, 3
  %105 = and i32 %104, 16
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %36, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !15
  %110 = zext i8 %109 to i32
  %111 = or i32 %110, %105
  %112 = trunc i32 %111 to i8
  store i8 %112, ptr %108, align 1, !tbaa !15
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = mul i32 8, %114
  %116 = add i32 %115, 4
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds i8, ptr %113, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !15
  %120 = zext i8 %119 to i32
  %121 = ashr i32 %120, 4
  %122 = and i32 %121, 8
  %123 = load i32, ptr %13, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %36, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !15
  %127 = zext i8 %126 to i32
  %128 = or i32 %127, %122
  %129 = trunc i32 %128 to i8
  store i8 %129, ptr %125, align 1, !tbaa !15
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = mul i32 8, %131
  %133 = add i32 %132, 5
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds i8, ptr %130, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !15
  %137 = zext i8 %136 to i32
  %138 = ashr i32 %137, 5
  %139 = and i32 %138, 4
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %36, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !15
  %144 = zext i8 %143 to i32
  %145 = or i32 %144, %139
  %146 = trunc i32 %145 to i8
  store i8 %146, ptr %142, align 1, !tbaa !15
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = mul i32 8, %148
  %150 = add i32 %149, 6
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %147, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !15
  %154 = zext i8 %153 to i32
  %155 = ashr i32 %154, 6
  %156 = and i32 %155, 2
  %157 = load i32, ptr %13, align 4, !tbaa !9
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds i8, ptr %36, i64 %158
  %160 = load i8, ptr %159, align 1, !tbaa !15
  %161 = zext i8 %160 to i32
  %162 = or i32 %161, %156
  %163 = trunc i32 %162 to i8
  store i8 %163, ptr %159, align 1, !tbaa !15
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = load i32, ptr %13, align 4, !tbaa !9
  %166 = mul i32 8, %165
  %167 = add i32 %166, 7
  %168 = zext i32 %167 to i64
  %169 = getelementptr inbounds i8, ptr %164, i64 %168
  %170 = load i8, ptr %169, align 1, !tbaa !15
  %171 = zext i8 %170 to i32
  %172 = ashr i32 %171, 7
  %173 = and i32 %172, 1
  %174 = load i32, ptr %13, align 4, !tbaa !9
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds i8, ptr %36, i64 %175
  %177 = load i8, ptr %176, align 1, !tbaa !15
  %178 = zext i8 %177 to i32
  %179 = or i32 %178, %173
  %180 = trunc i32 %179 to i8
  store i8 %180, ptr %176, align 1, !tbaa !15
  br label %181

181:                                              ; preds = %41
  %182 = load i32, ptr %13, align 4, !tbaa !9
  %183 = add i32 %182, 1
  store i32 %183, ptr %13, align 4, !tbaa !9
  br label %37, !llvm.loop !16

184:                                              ; preds = %37
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = load i32, ptr %7, align 4, !tbaa !9
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = call i32 @fec_decode(ptr noundef %185, i32 noundef %186, ptr noundef %36, ptr noundef %187)
  store i32 %188, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %189 = load ptr, ptr %11, align 8
  call void @llvm.stackrestore.p0(ptr %189)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %190

190:                                              ; preds = %184, %18
  %191 = load i32, ptr %5, align 4
  ret i32 %191
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

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 nosync nounwind willreturn }
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 = !{!12, !6, i64 216}
!12 = !{!"fec_s", !10, i64 0, !13, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !6, i64 136, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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
declare dso_local i32 @fec_get_enc_msg_length(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @fec_decode_soft(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 216
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %9, label %7

7:                                                ; preds = %4
  %8 = tail call i32 %6(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #2
  br label %123

9:                                                ; preds = %4
  %10 = load i32, ptr %0, align 8, !tbaa !12
  %11 = tail call i32 @fec_get_enc_msg_length(i32 noundef %10, i32 noundef %1)
  %12 = zext i32 %11 to i64
  %13 = tail call ptr @llvm.stacksave.p0()
  %14 = alloca i8, i64 %12, align 16
  %.not44 = icmp eq i32 %11, 0
  br i1 %.not44, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %9
  %min.iters.check = icmp ult i32 %11, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check46 = icmp ult i32 %11, 16
  br i1 %min.iters.check46, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %12, 4294967280
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %15 = getelementptr inbounds i8, ptr %14, i64 %index
  %16 = shl i64 %index, 3
  %17 = and i64 %16, 4294967168
  %18 = getelementptr inbounds i8, ptr %2, i64 %17
  %wide.vec = load <128 x i8>, ptr %18, align 1, !tbaa !13
  %strided.vec = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 0, i32 8, i32 16, i32 24, i32 32, i32 40, i32 48, i32 56, i32 64, i32 72, i32 80, i32 88, i32 96, i32 104, i32 112, i32 120>
  %strided.vec47 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 1, i32 9, i32 17, i32 25, i32 33, i32 41, i32 49, i32 57, i32 65, i32 73, i32 81, i32 89, i32 97, i32 105, i32 113, i32 121>
  %strided.vec48 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 2, i32 10, i32 18, i32 26, i32 34, i32 42, i32 50, i32 58, i32 66, i32 74, i32 82, i32 90, i32 98, i32 106, i32 114, i32 122>
  %strided.vec49 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 3, i32 11, i32 19, i32 27, i32 35, i32 43, i32 51, i32 59, i32 67, i32 75, i32 83, i32 91, i32 99, i32 107, i32 115, i32 123>
  %strided.vec50 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60, i32 68, i32 76, i32 84, i32 92, i32 100, i32 108, i32 116, i32 124>
  %strided.vec51 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 5, i32 13, i32 21, i32 29, i32 37, i32 45, i32 53, i32 61, i32 69, i32 77, i32 85, i32 93, i32 101, i32 109, i32 117, i32 125>
  %strided.vec52 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 6, i32 14, i32 22, i32 30, i32 38, i32 46, i32 54, i32 62, i32 70, i32 78, i32 86, i32 94, i32 102, i32 110, i32 118, i32 126>
  %strided.vec53 = shufflevector <128 x i8> %wide.vec, <128 x i8> poison, <16 x i32> <i32 7, i32 15, i32 23, i32 31, i32 39, i32 47, i32 55, i32 63, i32 71, i32 79, i32 87, i32 95, i32 103, i32 111, i32 119, i32 127>
  %19 = and <16 x i8> %strided.vec, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
  %20 = lshr <16 x i8> %strided.vec47, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  %21 = and <16 x i8> %20, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
  %22 = or disjoint <16 x i8> %21, %19
  %23 = lshr <16 x i8> %strided.vec48, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
  %24 = and <16 x i8> %23, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
  %25 = or disjoint <16 x i8> %24, %22
  %26 = lshr <16 x i8> %strided.vec49, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
  %27 = and <16 x i8> %26, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16>
  %28 = or disjoint <16 x i8> %27, %25
  %29 = lshr <16 x i8> %strided.vec50, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %30 = and <16 x i8> %29, <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
  %31 = or disjoint <16 x i8> %30, %28
  %32 = lshr <16 x i8> %strided.vec51, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
  %33 = and <16 x i8> %32, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %34 = or disjoint <16 x i8> %33, %31
  %35 = lshr <16 x i8> %strided.vec52, <i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6>
  %36 = and <16 x i8> %35, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
  %37 = or <16 x i8> %36, %34
  %38 = lshr <16 x i8> %strided.vec53, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %39 = or <16 x i8> %37, %38
  store <16 x i8> %39, ptr %15, align 16, !tbaa !13
  %index.next = add nuw i64 %index, 16
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %12
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %12, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %.lr.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec55 = and i64 %12, 4294967288
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index56 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next66, %vec.epilog.vector.body ]
  %41 = getelementptr inbounds i8, ptr %14, i64 %index56
  %42 = shl i64 %index56, 3
  %43 = and i64 %42, 4294967232
  %44 = getelementptr inbounds i8, ptr %2, i64 %43
  %wide.vec57 = load <64 x i8>, ptr %44, align 1, !tbaa !13
  %strided.vec58 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 0, i32 8, i32 16, i32 24, i32 32, i32 40, i32 48, i32 56>
  %strided.vec59 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 1, i32 9, i32 17, i32 25, i32 33, i32 41, i32 49, i32 57>
  %strided.vec60 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 2, i32 10, i32 18, i32 26, i32 34, i32 42, i32 50, i32 58>
  %strided.vec61 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 3, i32 11, i32 19, i32 27, i32 35, i32 43, i32 51, i32 59>
  %strided.vec62 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60>
  %strided.vec63 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 5, i32 13, i32 21, i32 29, i32 37, i32 45, i32 53, i32 61>
  %strided.vec64 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 6, i32 14, i32 22, i32 30, i32 38, i32 46, i32 54, i32 62>
  %strided.vec65 = shufflevector <64 x i8> %wide.vec57, <64 x i8> poison, <8 x i32> <i32 7, i32 15, i32 23, i32 31, i32 39, i32 47, i32 55, i32 63>
  %45 = and <8 x i8> %strided.vec58, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
  %46 = lshr <8 x i8> %strided.vec59, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
  %47 = and <8 x i8> %46, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
  %48 = or disjoint <8 x i8> %47, %45
  %49 = lshr <8 x i8> %strided.vec60, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
  %50 = and <8 x i8> %49, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
  %51 = or disjoint <8 x i8> %50, %48
  %52 = lshr <8 x i8> %strided.vec61, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
  %53 = and <8 x i8> %52, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16>
  %54 = or disjoint <8 x i8> %53, %51
  %55 = lshr <8 x i8> %strided.vec62, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %56 = and <8 x i8> %55, <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
  %57 = or disjoint <8 x i8> %56, %54
  %58 = lshr <8 x i8> %strided.vec63, <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5>
  %59 = and <8 x i8> %58, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %60 = or disjoint <8 x i8> %59, %57
  %61 = lshr <8 x i8> %strided.vec64, <i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6, i8 6>
  %62 = and <8 x i8> %61, <i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2, i8 2>
  %63 = or <8 x i8> %62, %60
  %64 = lshr <8 x i8> %strided.vec65, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %65 = or <8 x i8> %63, %64
  store <8 x i8> %65, ptr %41, align 8, !tbaa !13
  %index.next66 = add nuw i64 %index56, 8
  %66 = icmp eq i64 %index.next66, %n.vec55
  br i1 %66, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !18

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n67 = icmp eq i64 %n.vec55, %12
  br i1 %cmp.n67, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec55, %vec.epilog.middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader ]
  %67 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv
  %68 = trunc nuw i64 %indvars.iv to i32
  %69 = shl i32 %68, 3
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds i8, ptr %2, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !13
  %73 = and i8 %72, -128
  %74 = or disjoint i32 %69, 1
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %2, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !13
  %78 = lshr i8 %77, 1
  %79 = and i8 %78, 64
  %80 = or disjoint i8 %79, %73
  %81 = or disjoint i32 %69, 2
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %2, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = lshr i8 %84, 2
  %86 = and i8 %85, 32
  %87 = or disjoint i8 %86, %80
  %88 = or disjoint i32 %69, 3
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %2, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !13
  %92 = lshr i8 %91, 3
  %93 = and i8 %92, 16
  %94 = or disjoint i8 %93, %87
  %95 = or disjoint i32 %69, 4
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %2, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !13
  %99 = lshr i8 %98, 4
  %100 = and i8 %99, 8
  %101 = or disjoint i8 %100, %94
  %102 = or disjoint i32 %69, 5
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds i8, ptr %2, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !13
  %106 = lshr i8 %105, 5
  %107 = and i8 %106, 4
  %108 = or disjoint i8 %107, %101
  %109 = or disjoint i32 %69, 6
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds i8, ptr %2, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !13
  %113 = lshr i8 %112, 6
  %114 = and i8 %113, 2
  %115 = or i8 %114, %108
  %116 = or disjoint i32 %69, 7
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds i8, ptr %2, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !13
  %120 = lshr i8 %119, 7
  %121 = or i8 %115, %120
  store i8 %121, ptr %67, align 1, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %12
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %vec.epilog.middle.block, %9
  %122 = call i32 @fec_decode(ptr noundef nonnull %0, i32 noundef %1, ptr noundef nonnull %14, ptr noundef %3)
  call void @llvm.stackrestore.p0(ptr %13)
  br label %123

123:                                              ; preds = %._crit_edge, %7
  %.041 = phi i32 [ %8, %7 ], [ %122, %._crit_edge ]
  ret i32 %.041
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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, !11, i64 216}
!6 = !{!"fec_s", !7, i64 0, !10, i64 4, !7, i64 8, !7, i64 12, !11, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !11, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !7, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !7, i64 192, !11, i64 200, !11, i64 208, !11, i64 216}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!8, !8, i64 0}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !15, !16, !17}
!19 = distinct !{!19, !15, !16}


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