; LLVM IR from rweather/lightweight-crypto :: src/combined (internal-sliscp-light-m)

; 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.mask_x4_uint32_t = type { i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @sliscp_light192_reduce_masked(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %3

3:                                                ; preds = %1
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %4, i64 0
  %6 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %5, i32 0, i32 0
  %7 = load i32, ptr %6, align 4, !tbaa !9
  %8 = and i32 %7, 16777215
  store i32 %8, ptr %6, align 4, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %9, i64 0
  %11 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 4, !tbaa !12
  %13 = and i32 %12, 16777215
  store i32 %13, ptr %11, align 4, !tbaa !12
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %14, i64 0
  %16 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = and i32 %17, 16777215
  store i32 %18, ptr %16, align 4, !tbaa !13
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %19, i64 0
  %21 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %20, i32 0, i32 3
  %22 = load i32, ptr %21, align 4, !tbaa !14
  %23 = and i32 %22, 16777215
  store i32 %23, ptr %21, align 4, !tbaa !14
  br label %24

24:                                               ; preds = %3
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %26, i64 1
  %28 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = and i32 %29, 16777215
  store i32 %30, ptr %28, align 4, !tbaa !9
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %31, i64 1
  %33 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !12
  %35 = and i32 %34, 16777215
  store i32 %35, ptr %33, align 4, !tbaa !12
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %36, i64 1
  %38 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %37, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !13
  %40 = and i32 %39, 16777215
  store i32 %40, ptr %38, align 4, !tbaa !13
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %41, i64 1
  %43 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !14
  %45 = and i32 %44, 16777215
  store i32 %45, ptr %43, align 4, !tbaa !14
  br label %46

46:                                               ; preds = %25
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %48, i64 2
  %50 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = and i32 %51, 16777215
  store i32 %52, ptr %50, align 4, !tbaa !9
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %53, i64 2
  %55 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = and i32 %56, 16777215
  store i32 %57, ptr %55, align 4, !tbaa !12
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %58, i64 2
  %60 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %60, align 4, !tbaa !13
  %62 = and i32 %61, 16777215
  store i32 %62, ptr %60, align 4, !tbaa !13
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %63, i64 2
  %65 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %64, i32 0, i32 3
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = and i32 %66, 16777215
  store i32 %67, ptr %65, align 4, !tbaa !14
  br label %68

68:                                               ; preds = %47
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %70, i64 3
  %72 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = and i32 %73, 16777215
  store i32 %74, ptr %72, align 4, !tbaa !9
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %75, i64 3
  %77 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !12
  %79 = and i32 %78, 16777215
  store i32 %79, ptr %77, align 4, !tbaa !12
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %80, i64 3
  %82 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 4, !tbaa !13
  %84 = and i32 %83, 16777215
  store i32 %84, ptr %82, align 4, !tbaa !13
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %85, i64 3
  %87 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %86, i32 0, i32 3
  %88 = load i32, ptr %87, align 4, !tbaa !14
  %89 = and i32 %88, 16777215
  store i32 %89, ptr %87, align 4, !tbaa !14
  br label %90

90:                                               ; preds = %69
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %92, i64 4
  %94 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = and i32 %95, 16777215
  store i32 %96, ptr %94, align 4, !tbaa !9
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %97, i64 4
  %99 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !12
  %101 = and i32 %100, 16777215
  store i32 %101, ptr %99, align 4, !tbaa !12
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %102, i64 4
  %104 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %103, i32 0, i32 2
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = and i32 %105, 16777215
  store i32 %106, ptr %104, align 4, !tbaa !13
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %107, i64 4
  %109 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 4, !tbaa !14
  %111 = and i32 %110, 16777215
  store i32 %111, ptr %109, align 4, !tbaa !14
  br label %112

112:                                              ; preds = %91
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %114, i64 5
  %116 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = and i32 %117, 16777215
  store i32 %118, ptr %116, align 4, !tbaa !9
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %119, i64 5
  %121 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !12
  %123 = and i32 %122, 16777215
  store i32 %123, ptr %121, align 4, !tbaa !12
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %124, i64 5
  %126 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !13
  %128 = and i32 %127, 16777215
  store i32 %128, ptr %126, align 4, !tbaa !13
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %129, i64 5
  %131 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %130, i32 0, i32 3
  %132 = load i32, ptr %131, align 4, !tbaa !14
  %133 = and i32 %132, 16777215
  store i32 %133, ptr %131, align 4, !tbaa !14
  br label %134

134:                                              ; preds = %113
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %136, i64 6
  %138 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = and i32 %139, 16777215
  store i32 %140, ptr %138, align 4, !tbaa !9
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %141, i64 6
  %143 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %142, i32 0, i32 1
  %144 = load i32, ptr %143, align 4, !tbaa !12
  %145 = and i32 %144, 16777215
  store i32 %145, ptr %143, align 4, !tbaa !12
  %146 = load ptr, ptr %2, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %146, i64 6
  %148 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %147, i32 0, i32 2
  %149 = load i32, ptr %148, align 4, !tbaa !13
  %150 = and i32 %149, 16777215
  store i32 %150, ptr %148, align 4, !tbaa !13
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %151, i64 6
  %153 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %152, i32 0, i32 3
  %154 = load i32, ptr %153, align 4, !tbaa !14
  %155 = and i32 %154, 16777215
  store i32 %155, ptr %153, align 4, !tbaa !14
  br label %156

156:                                              ; preds = %135
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %2, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %158, i64 7
  %160 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !9
  %162 = and i32 %161, 16777215
  store i32 %162, ptr %160, align 4, !tbaa !9
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %163, i64 7
  %165 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %164, i32 0, i32 1
  %166 = load i32, ptr %165, align 4, !tbaa !12
  %167 = and i32 %166, 16777215
  store i32 %167, ptr %165, align 4, !tbaa !12
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %168, i64 7
  %170 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %170, align 4, !tbaa !13
  %172 = and i32 %171, 16777215
  store i32 %172, ptr %170, align 4, !tbaa !13
  %173 = load ptr, ptr %2, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %173, i64 7
  %175 = getelementptr inbounds %struct.mask_x4_uint32_t, ptr %174, i32 0, i32 3
  %176 = load i32, ptr %175, align 4, !tbaa !14
  %177 = and i32 %176, 16777215
  store i32 %177, ptr %175, align 4, !tbaa !14
  br label %178

178:                                              ; preds = %157
  ret void
}

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

!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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !11, i64 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @sliscp_light192_reduce_masked(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = load <4 x i32>, ptr %0, align 4, !tbaa !5
  %3 = and <4 x i32> %2, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %3, ptr %0, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load <4 x i32>, ptr %4, align 4, !tbaa !5
  %6 = and <4 x i32> %5, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %6, ptr %4, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load <4 x i32>, ptr %7, align 4, !tbaa !5
  %9 = and <4 x i32> %8, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %9, ptr %7, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = load <4 x i32>, ptr %10, align 4, !tbaa !5
  %12 = and <4 x i32> %11, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %12, ptr %10, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 64
  %14 = load <4 x i32>, ptr %13, align 4, !tbaa !5
  %15 = and <4 x i32> %14, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %15, ptr %13, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load <4 x i32>, ptr %16, align 4, !tbaa !5
  %18 = and <4 x i32> %17, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %18, ptr %16, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  %20 = load <4 x i32>, ptr %19, align 4, !tbaa !5
  %21 = and <4 x i32> %20, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %21, ptr %19, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = load <4 x i32>, ptr %22, align 4, !tbaa !5
  %24 = and <4 x i32> %23, <i32 16777215, i32 16777215, i32 16777215, i32 16777215>
  store <4 x i32> %24, ptr %22, align 4, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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" }

!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/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass