; LLVM IR from rweather/lightweight-crypto :: src/genavr/algorithm_forkskinny.ll (Z19get_forkskinny_sboxi)

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

%class.Sbox = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZL6sbox64 = external hidden constant [16 x i8], align 16
@_ZL10sbox64_inv = external hidden constant [16 x i8], align 16
@_ZL2RC = external hidden constant [87 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19get_forkskinny_sboxi(ptr dead_on_unwind noalias writable sret(%class.Sbox) align 8 %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [256 x i8], align 16
  %6 = alloca i32, align 4
  %7 = alloca [256 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca [256 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca [256 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca [174 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  switch i32 %16, label %18 [
    i32 0, label %17
    i32 1, label %17
    i32 2, label %17
    i32 3, label %17
    i32 5, label %20
    i32 6, label %50
    i32 7, label %80
    i32 8, label %105
    i32 4, label %129
  ]

17:                                               ; preds = %2, %2, %2, %2
  br label %18

18:                                               ; preds = %17, %2
  %19 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z18get_skinny128_sboxi(ptr dead_on_unwind writable sret(%class.Sbox) align 8 %0, i32 noundef %19)
  br label %161

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %45, %20
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 256
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %48

25:                                               ; preds = %21
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = and i32 %26, 15
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [16 x i8], ptr @_ZL6sbox64, i64 0, i64 %28
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = zext i8 %30 to i32
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = ashr i32 %32, 4
  %34 = and i32 %33, 15
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [16 x i8], ptr @_ZL6sbox64, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = zext i8 %37 to i32
  %39 = shl i32 %38, 4
  %40 = or i32 %31, %39
  %41 = trunc i32 %40 to i8
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %43
  store i8 %41, ptr %44, align 1, !tbaa !9
  br label %45

45:                                               ; preds = %25
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !5
  br label %21, !llvm.loop !10

48:                                               ; preds = %24
  %49 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %49, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr %5) #3
  br label %161

50:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %75, %50
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = icmp slt i32 %52, 256
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %78

55:                                               ; preds = %51
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = and i32 %56, 15
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [16 x i8], ptr @_ZL10sbox64_inv, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = zext i8 %60 to i32
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = ashr i32 %62, 4
  %64 = and i32 %63, 15
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [16 x i8], ptr @_ZL10sbox64_inv, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %68 = zext i8 %67 to i32
  %69 = shl i32 %68, 4
  %70 = or i32 %61, %69
  %71 = trunc i32 %70 to i8
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %73
  store i8 %71, ptr %74, align 1, !tbaa !9
  br label %75

75:                                               ; preds = %55
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !5
  br label %51, !llvm.loop !12

78:                                               ; preds = %54
  %79 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 0
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %79, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #3
  br label %161

80:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %100, %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = icmp slt i32 %82, 256
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %103

85:                                               ; preds = %81
  %86 = load i32, ptr %10, align 4, !tbaa !5
  %87 = shl i32 %86, 1
  %88 = and i32 %87, 238
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = ashr i32 %89, 3
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = ashr i32 %91, 2
  %93 = xor i32 %90, %92
  %94 = and i32 %93, 17
  %95 = xor i32 %88, %94
  %96 = trunc i32 %95 to i8
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 %98
  store i8 %96, ptr %99, align 1, !tbaa !9
  br label %100

100:                                              ; preds = %85
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %81, !llvm.loop !13

103:                                              ; preds = %84
  %104 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %104, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr %9) #3
  br label %161

105:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %124, %105
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = icmp slt i32 %107, 256
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %127

110:                                              ; preds = %106
  %111 = load i32, ptr %12, align 4, !tbaa !5
  %112 = ashr i32 %111, 1
  %113 = and i32 %112, 119
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = shl i32 %115, 3
  %117 = xor i32 %114, %116
  %118 = and i32 %117, 136
  %119 = xor i32 %113, %118
  %120 = trunc i32 %119 to i8
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 %122
  store i8 %120, ptr %123, align 1, !tbaa !9
  br label %124

124:                                              ; preds = %110
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %12, align 4, !tbaa !5
  br label %106, !llvm.loop !14

127:                                              ; preds = %109
  %128 = getelementptr inbounds [256 x i8], ptr %11, i64 0, i64 0
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %128, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #3
  br label %161

129:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 174, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %156, %129
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = icmp slt i32 %131, 87
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %159

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [87 x i8], ptr @_ZL2RC, i64 0, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !9
  %139 = zext i8 %138 to i32
  store i32 %139, ptr %15, align 4, !tbaa !5
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = and i32 %140, 15
  %142 = trunc i32 %141 to i8
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = mul nsw i32 %143, 2
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [174 x i8], ptr %13, i64 0, i64 %145
  store i8 %142, ptr %146, align 1, !tbaa !9
  %147 = load i32, ptr %15, align 4, !tbaa !5
  %148 = and i32 %147, 112
  %149 = ashr i32 %148, 4
  %150 = trunc i32 %149 to i8
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = mul nsw i32 %151, 2
  %153 = add nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [174 x i8], ptr %13, i64 0, i64 %154
  store i8 %150, ptr %155, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %156

156:                                              ; preds = %134
  %157 = load i32, ptr %14, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %14, align 4, !tbaa !5
  br label %130, !llvm.loop !15

159:                                              ; preds = %133
  %160 = getelementptr inbounds [174 x i8], ptr %13, i64 0, i64 0
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %160, i32 noundef 174)
  call void @llvm.lifetime.end.p0(i64 174, ptr %13) #3
  br label %161

161:                                              ; preds = %159, %127, %103, %78, %48, %18
  ret void
}

declare void @_Z18get_skinny128_sboxi(ptr dead_on_unwind writable sret(%class.Sbox) align 8, i32 noundef) #1

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

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

declare void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i32 noundef) unnamed_addr #1

attributes #0 = { mustprogress 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 = { "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 memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


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

%class.Sbox = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZL6sbox64 = external hidden local_unnamed_addr constant [16 x i8], align 16
@_ZL10sbox64_inv = external hidden local_unnamed_addr constant [16 x i8], align 16
@_ZL2RC = external hidden local_unnamed_addr constant [87 x i8], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z19get_forkskinny_sboxi(ptr dead_on_unwind noalias writable sret(%class.Sbox) align 8 %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca [256 x i8], align 16
  %5 = alloca [256 x i8], align 16
  %6 = alloca [256 x i8], align 16
  %7 = alloca [174 x i8], align 16
  switch i32 %1, label %8 [
    i32 4, label %vector.ph94
    i32 8, label %vector.ph85
    i32 7, label %vector.ph76
    i32 6, label %vector.scevcheck60
    i32 5, label %vector.scevcheck
  ]

8:                                                ; preds = %2
  tail call void @_Z18get_skinny128_sboxi(ptr dead_on_unwind writable sret(%class.Sbox) align 8 %0, i32 noundef %1)
  br label %143

vector.scevcheck:                                 ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #3
  br label %9

.loopexit105:                                     ; preds = %9
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %3, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #3
  br label %143

9:                                                ; preds = %9, %vector.scevcheck
  %indvars.iv = phi i64 [ 0, %vector.scevcheck ], [ %indvars.iv.next.1, %9 ]
  %10 = and i64 %indvars.iv, 14
  %11 = getelementptr inbounds [16 x i8], ptr @_ZL6sbox64, i64 0, i64 %10
  %12 = load i8, ptr %11, align 2, !tbaa !5
  %13 = lshr i64 %indvars.iv, 4
  %14 = and i64 %13, 268435455
  %15 = getelementptr inbounds [16 x i8], ptr @_ZL6sbox64, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = shl i8 %16, 4
  %18 = or i8 %17, %12
  %19 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %indvars.iv
  store i8 %18, ptr %19, align 2, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %20 = and i64 %indvars.iv.next, 15
  %21 = getelementptr inbounds [16 x i8], ptr @_ZL6sbox64, i64 0, i64 %20
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = shl i8 %16, 4
  %24 = or i8 %23, %22
  %25 = getelementptr inbounds [256 x i8], ptr %3, i64 0, i64 %indvars.iv.next
  store i8 %24, ptr %25, align 1, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 256
  br i1 %exitcond.not.1, label %.loopexit105, label %9, !llvm.loop !8

vector.scevcheck60:                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #3
  br label %26

.loopexit104:                                     ; preds = %26
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %4, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #3
  br label %143

26:                                               ; preds = %26, %vector.scevcheck60
  %indvars.iv41 = phi i64 [ 0, %vector.scevcheck60 ], [ %indvars.iv.next42.1, %26 ]
  %27 = and i64 %indvars.iv41, 14
  %28 = getelementptr inbounds [16 x i8], ptr @_ZL10sbox64_inv, i64 0, i64 %27
  %29 = load i8, ptr %28, align 2, !tbaa !5
  %30 = lshr i64 %indvars.iv41, 4
  %31 = and i64 %30, 268435455
  %32 = getelementptr inbounds [16 x i8], ptr @_ZL10sbox64_inv, i64 0, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = shl i8 %33, 4
  %35 = or i8 %34, %29
  %36 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %indvars.iv41
  store i8 %35, ptr %36, align 2, !tbaa !5
  %indvars.iv.next42 = or disjoint i64 %indvars.iv41, 1
  %37 = and i64 %indvars.iv.next42, 15
  %38 = getelementptr inbounds [16 x i8], ptr @_ZL10sbox64_inv, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !5
  %40 = shl i8 %33, 4
  %41 = or i8 %40, %39
  %42 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %indvars.iv.next42
  store i8 %41, ptr %42, align 1, !tbaa !5
  %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 2
  %exitcond44.not.1 = icmp eq i64 %indvars.iv.next42.1, 256
  br i1 %exitcond44.not.1, label %.loopexit104, label %26, !llvm.loop !11

vector.ph76:                                      ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #3
  br label %vector.body78

vector.body78:                                    ; preds = %vector.body78, %vector.ph76
  %index79 = phi i64 [ 0, %vector.ph76 ], [ %index.next82, %vector.body78 ]
  %vec.ind = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph76 ], [ %vec.ind.next, %vector.body78 ]
  %vec.ind80 = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph76 ], [ %vec.ind.next81, %vector.body78 ]
  %43 = shl <16 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %44 = and <16 x i32> %43, <i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238, i32 238>
  %45 = lshr <16 x i32> %vec.ind80, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
  %46 = lshr <16 x i32> %vec.ind80, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>
  %47 = xor <16 x i32> %45, %46
  %48 = and <16 x i32> %47, <i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17>
  %49 = or disjoint <16 x i32> %48, %44
  %50 = trunc nuw <16 x i32> %49 to <16 x i8>
  %51 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %index79
  store <16 x i8> %50, ptr %51, align 16, !tbaa !5
  %index.next82 = add nuw i64 %index79, 16
  %vec.ind.next = add <16 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %vec.ind.next81 = add <16 x i32> %vec.ind80, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %52 = icmp eq i64 %index.next82, 256
  br i1 %52, label %middle.block74, label %vector.body78, !llvm.loop !12

middle.block74:                                   ; preds = %vector.body78
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %5, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #3
  br label %143

vector.ph85:                                      ; preds = %2
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #3
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph85
  %index88 = phi i64 [ 0, %vector.ph85 ], [ %index.next91, %vector.body87 ]
  %vec.ind89 = phi <16 x i32> [ <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>, %vector.ph85 ], [ %vec.ind.next90, %vector.body87 ]
  %53 = lshr <16 x i32> %vec.ind89, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %54 = and <16 x i32> %53, <i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119, i32 119>
  %55 = shl nuw nsw <16 x i32> %vec.ind89, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
  %56 = xor <16 x i32> %55, %vec.ind89
  %57 = and <16 x i32> %56, <i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136, i32 136>
  %58 = or disjoint <16 x i32> %57, %54
  %59 = trunc nuw <16 x i32> %58 to <16 x i8>
  %60 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 %index88
  store <16 x i8> %59, ptr %60, align 16, !tbaa !5
  %index.next91 = add nuw i64 %index88, 16
  %vec.ind.next90 = add <16 x i32> %vec.ind89, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
  %61 = icmp eq i64 %index.next91, 256
  br i1 %61, label %middle.block83, label %vector.body87, !llvm.loop !14

middle.block83:                                   ; preds = %vector.body87
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %6, i32 noundef 256)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #3
  br label %143

vector.ph94:                                      ; preds = %2
  call void @llvm.lifetime.start.p0(i64 174, ptr nonnull %7) #3
  %wide.load98 = load <8 x i8>, ptr @_ZL2RC, align 16, !tbaa !5
  %wide.load99 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 8), align 8, !tbaa !5
  %62 = and <8 x i8> %wide.load98, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %63 = and <8 x i8> %wide.load99, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %64 = lshr <8 x i8> %wide.load98, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %65 = lshr <8 x i8> %wide.load99, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %66 = and <8 x i8> %64, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %67 = and <8 x i8> %65, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %68 = getelementptr inbounds i8, ptr %7, i64 16
  %interleaved.vec = shufflevector <8 x i8> %62, <8 x i8> %66, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec, ptr %7, align 16, !tbaa !5
  %interleaved.vec100 = shufflevector <8 x i8> %63, <8 x i8> %67, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec100, ptr %68, align 16, !tbaa !5
  %wide.load98.1 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 16), align 16, !tbaa !5
  %wide.load99.1 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 24), align 8, !tbaa !5
  %69 = and <8 x i8> %wide.load98.1, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %70 = and <8 x i8> %wide.load99.1, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %71 = lshr <8 x i8> %wide.load98.1, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %72 = lshr <8 x i8> %wide.load99.1, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %73 = and <8 x i8> %71, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %74 = and <8 x i8> %72, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %75 = getelementptr inbounds i8, ptr %7, i64 32
  %76 = getelementptr inbounds i8, ptr %7, i64 48
  %interleaved.vec.1 = shufflevector <8 x i8> %69, <8 x i8> %73, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec.1, ptr %75, align 16, !tbaa !5
  %interleaved.vec100.1 = shufflevector <8 x i8> %70, <8 x i8> %74, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec100.1, ptr %76, align 16, !tbaa !5
  %wide.load98.2 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 32), align 16, !tbaa !5
  %wide.load99.2 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 40), align 8, !tbaa !5
  %77 = and <8 x i8> %wide.load98.2, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %78 = and <8 x i8> %wide.load99.2, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %79 = lshr <8 x i8> %wide.load98.2, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %80 = lshr <8 x i8> %wide.load99.2, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %81 = and <8 x i8> %79, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %82 = and <8 x i8> %80, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %83 = getelementptr inbounds i8, ptr %7, i64 64
  %84 = getelementptr inbounds i8, ptr %7, i64 80
  %interleaved.vec.2 = shufflevector <8 x i8> %77, <8 x i8> %81, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec.2, ptr %83, align 16, !tbaa !5
  %interleaved.vec100.2 = shufflevector <8 x i8> %78, <8 x i8> %82, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec100.2, ptr %84, align 16, !tbaa !5
  %wide.load98.3 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 48), align 16, !tbaa !5
  %wide.load99.3 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 56), align 8, !tbaa !5
  %85 = and <8 x i8> %wide.load98.3, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %86 = and <8 x i8> %wide.load99.3, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %87 = lshr <8 x i8> %wide.load98.3, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %88 = lshr <8 x i8> %wide.load99.3, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %89 = and <8 x i8> %87, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %90 = and <8 x i8> %88, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %91 = getelementptr inbounds i8, ptr %7, i64 96
  %92 = getelementptr inbounds i8, ptr %7, i64 112
  %interleaved.vec.3 = shufflevector <8 x i8> %85, <8 x i8> %89, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec.3, ptr %91, align 16, !tbaa !5
  %interleaved.vec100.3 = shufflevector <8 x i8> %86, <8 x i8> %90, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec100.3, ptr %92, align 16, !tbaa !5
  %wide.load98.4 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 64), align 16, !tbaa !5
  %wide.load99.4 = load <8 x i8>, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 72), align 8, !tbaa !5
  %93 = and <8 x i8> %wide.load98.4, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %94 = and <8 x i8> %wide.load99.4, <i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15, i8 15>
  %95 = lshr <8 x i8> %wide.load98.4, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %96 = lshr <8 x i8> %wide.load99.4, <i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4, i8 4>
  %97 = and <8 x i8> %95, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %98 = and <8 x i8> %96, <i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7, i8 7>
  %99 = getelementptr inbounds i8, ptr %7, i64 128
  %100 = getelementptr inbounds i8, ptr %7, i64 144
  %interleaved.vec.4 = shufflevector <8 x i8> %93, <8 x i8> %97, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec.4, ptr %99, align 16, !tbaa !5
  %interleaved.vec100.4 = shufflevector <8 x i8> %94, <8 x i8> %98, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec100.4, ptr %100, align 16, !tbaa !5
  %101 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 80), align 16, !tbaa !5
  %102 = and i8 %101, 15
  %103 = getelementptr inbounds i8, ptr %7, i64 160
  store i8 %102, ptr %103, align 16, !tbaa !5
  %104 = lshr i8 %101, 4
  %105 = and i8 %104, 7
  %106 = getelementptr inbounds i8, ptr %7, i64 161
  store i8 %105, ptr %106, align 1, !tbaa !5
  %107 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 81), align 1, !tbaa !5
  %108 = and i8 %107, 15
  %109 = getelementptr inbounds i8, ptr %7, i64 162
  store i8 %108, ptr %109, align 2, !tbaa !5
  %110 = lshr i8 %107, 4
  %111 = and i8 %110, 7
  %112 = getelementptr inbounds i8, ptr %7, i64 163
  store i8 %111, ptr %112, align 1, !tbaa !5
  %113 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 82), align 2, !tbaa !5
  %114 = and i8 %113, 15
  %115 = getelementptr inbounds i8, ptr %7, i64 164
  store i8 %114, ptr %115, align 4, !tbaa !5
  %116 = lshr i8 %113, 4
  %117 = and i8 %116, 7
  %118 = getelementptr inbounds i8, ptr %7, i64 165
  store i8 %117, ptr %118, align 1, !tbaa !5
  %119 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 83), align 1, !tbaa !5
  %120 = and i8 %119, 15
  %121 = getelementptr inbounds i8, ptr %7, i64 166
  store i8 %120, ptr %121, align 2, !tbaa !5
  %122 = lshr i8 %119, 4
  %123 = and i8 %122, 7
  %124 = getelementptr inbounds i8, ptr %7, i64 167
  store i8 %123, ptr %124, align 1, !tbaa !5
  %125 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 84), align 4, !tbaa !5
  %126 = and i8 %125, 15
  %127 = getelementptr inbounds i8, ptr %7, i64 168
  store i8 %126, ptr %127, align 8, !tbaa !5
  %128 = lshr i8 %125, 4
  %129 = and i8 %128, 7
  %130 = getelementptr inbounds i8, ptr %7, i64 169
  store i8 %129, ptr %130, align 1, !tbaa !5
  %131 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 85), align 1, !tbaa !5
  %132 = and i8 %131, 15
  %133 = getelementptr inbounds i8, ptr %7, i64 170
  store i8 %132, ptr %133, align 2, !tbaa !5
  %134 = lshr i8 %131, 4
  %135 = and i8 %134, 7
  %136 = getelementptr inbounds i8, ptr %7, i64 171
  store i8 %135, ptr %136, align 1, !tbaa !5
  %137 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL2RC, i64 86), align 2, !tbaa !5
  %138 = and i8 %137, 15
  %139 = getelementptr inbounds i8, ptr %7, i64 172
  store i8 %138, ptr %139, align 4, !tbaa !5
  %140 = lshr i8 %137, 4
  %141 = and i8 %140, 7
  %142 = getelementptr inbounds i8, ptr %7, i64 173
  store i8 %141, ptr %142, align 1, !tbaa !5
  call void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %7, i32 noundef 174)
  call void @llvm.lifetime.end.p0(i64 174, ptr nonnull %7) #3
  br label %143

143:                                              ; preds = %vector.ph94, %middle.block83, %middle.block74, %.loopexit104, %.loopexit105, %8
  ret void
}

declare void @_Z18get_skinny128_sboxi(ptr dead_on_unwind writable sret(%class.Sbox) align 8, i32 noundef) local_unnamed_addr #1

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

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

declare void @_ZN4SboxC1EPKhj(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, i32 noundef) unnamed_addr #1

attributes #0 = { mustprogress 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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = distinct !{!11, !9, !10}
!12 = distinct !{!12, !9, !10, !13}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !9, !10, !13}


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