; LLVM IR from rweather/lightweight-crypto :: src/combined (spix)

; 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: nounwind uwtable
define dso_local i32 @spix_aead_encrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca [32 x i8], align 16
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store i64 %3, ptr %13, align 8, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store i64 %5, ptr %15, align 8, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  store ptr %8, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %29 = load ptr, ptr %16, align 8, !tbaa !5
  %30 = load i64, ptr %13, align 8, !tbaa !9
  %31 = add i64 %30, 16
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %31, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  %34 = load ptr, ptr %18, align 8, !tbaa !5
  %35 = load ptr, ptr %17, align 8, !tbaa !5
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = load i64, ptr %15, align 8, !tbaa !9
  call void @spix_init(ptr noundef %33, ptr noundef %34, ptr noundef %35, ptr noundef %36, i64 noundef %37)
  br label %38

38:                                               ; preds = %67, %9
  %39 = load i64, ptr %13, align 8, !tbaa !9
  %40 = icmp uge i64 %39, 8
  br i1 %40, label %41, label %80

41:                                               ; preds = %38
  br label %42

42:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %43, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %44 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  store ptr %45, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %46, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 8, ptr %24, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %50, %42
  %48 = load i32, ptr %24, align 4, !tbaa !11
  %49 = icmp ugt i32 %48, 0
  br i1 %49, label %50, label %65

50:                                               ; preds = %47
  %51 = load ptr, ptr %23, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i32 1
  store ptr %52, ptr %23, align 8, !tbaa !5
  %53 = load i8, ptr %51, align 1, !tbaa !13
  %54 = zext i8 %53 to i32
  %55 = load ptr, ptr %22, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i32 1
  store ptr %56, ptr %22, align 8, !tbaa !5
  %57 = load i8, ptr %55, align 1, !tbaa !13
  %58 = zext i8 %57 to i32
  %59 = xor i32 %58, %54
  %60 = trunc i32 %59 to i8
  store i8 %60, ptr %55, align 1, !tbaa !13
  %61 = load ptr, ptr %21, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i32 1
  store ptr %62, ptr %21, align 8, !tbaa !5
  store i8 %60, ptr %61, align 1, !tbaa !13
  %63 = load i32, ptr %24, align 4, !tbaa !11
  %64 = add i32 %63, -1
  store i32 %64, ptr %24, align 4, !tbaa !11
  br label %47, !llvm.loop !14

65:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 31
  %69 = load i8, ptr %68, align 1, !tbaa !13
  %70 = zext i8 %69 to i32
  %71 = xor i32 %70, 2
  %72 = trunc i32 %71 to i8
  store i8 %72, ptr %68, align 1, !tbaa !13
  %73 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  call void @sliscp_light256_permute_spix(ptr noundef %73, i32 noundef 9)
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 8
  store ptr %75, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  store ptr %77, ptr %12, align 8, !tbaa !5
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = sub i64 %78, 8
  store i64 %79, ptr %13, align 8, !tbaa !9
  br label %38, !llvm.loop !16

80:                                               ; preds = %38
  %81 = load i64, ptr %13, align 8, !tbaa !9
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %20, align 4, !tbaa !11
  br label %83

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %84, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %85 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  store ptr %86, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %87, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %88 = load i32, ptr %20, align 4, !tbaa !11
  store i32 %88, ptr %28, align 4, !tbaa !11
  br label %89

89:                                               ; preds = %92, %83
  %90 = load i32, ptr %28, align 4, !tbaa !11
  %91 = icmp ugt i32 %90, 0
  br i1 %91, label %92, label %107

92:                                               ; preds = %89
  %93 = load ptr, ptr %27, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i32 1
  store ptr %94, ptr %27, align 8, !tbaa !5
  %95 = load i8, ptr %93, align 1, !tbaa !13
  %96 = zext i8 %95 to i32
  %97 = load ptr, ptr %26, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i32 1
  store ptr %98, ptr %26, align 8, !tbaa !5
  %99 = load i8, ptr %97, align 1, !tbaa !13
  %100 = zext i8 %99 to i32
  %101 = xor i32 %100, %96
  %102 = trunc i32 %101 to i8
  store i8 %102, ptr %97, align 1, !tbaa !13
  %103 = load ptr, ptr %25, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i32 1
  store ptr %104, ptr %25, align 8, !tbaa !5
  store i8 %102, ptr %103, align 1, !tbaa !13
  %105 = load i32, ptr %28, align 4, !tbaa !11
  %106 = add i32 %105, -1
  store i32 %106, ptr %28, align 4, !tbaa !11
  br label %89, !llvm.loop !17

107:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %20, align 4, !tbaa !11
  %111 = add i32 %110, 8
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = zext i8 %114 to i32
  %116 = xor i32 %115, 128
  %117 = trunc i32 %116 to i8
  store i8 %117, ptr %113, align 1, !tbaa !13
  %118 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 31
  %119 = load i8, ptr %118, align 1, !tbaa !13
  %120 = zext i8 %119 to i32
  %121 = xor i32 %120, 2
  %122 = trunc i32 %121 to i8
  store i8 %122, ptr %118, align 1, !tbaa !13
  %123 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  call void @sliscp_light256_permute_spix(ptr noundef %123, i32 noundef 9)
  %124 = load i64, ptr %13, align 8, !tbaa !9
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 %124
  store ptr %126, ptr %10, align 8, !tbaa !5
  %127 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  call void @spix_finalize(ptr noundef %127, ptr noundef %128, ptr noundef %129)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #3
  ret i32 0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @spix_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

declare void @sliscp_light256_permute_spix(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @spix_finalize(ptr noundef, ptr noundef, ptr noundef) #0

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 = { nocallback nofree nosync 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


; 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 noundef i32 @spix_aead_encrypt(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef readonly %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr nocapture noundef readnone %6, ptr noundef %7, ptr noundef %8) local_unnamed_addr #0 {
  %10 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #3
  %11 = add i64 %3, 16
  store i64 %11, ptr %1, align 8, !tbaa !5
  call void @spix_init(ptr noundef nonnull %10, ptr noundef %8, ptr noundef %7, ptr noundef %4, i64 noundef %5)
  %12 = icmp ugt i64 %3, 7
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %13 = getelementptr inbounds i8, ptr %10, i64 8
  %14 = getelementptr inbounds i8, ptr %10, i64 31
  %15 = getelementptr inbounds i8, ptr %10, i64 9
  %16 = getelementptr inbounds i8, ptr %10, i64 10
  %17 = getelementptr inbounds i8, ptr %10, i64 11
  %18 = getelementptr inbounds i8, ptr %10, i64 12
  %19 = getelementptr inbounds i8, ptr %10, i64 13
  %20 = getelementptr inbounds i8, ptr %10, i64 14
  %21 = getelementptr inbounds i8, ptr %10, i64 15
  br label %22

22:                                               ; preds = %.lr.ph, %22
  %.03848 = phi ptr [ %0, %.lr.ph ], [ %63, %22 ]
  %.03947 = phi ptr [ %2, %.lr.ph ], [ %64, %22 ]
  %.04046 = phi i64 [ %3, %.lr.ph ], [ %65, %22 ]
  %23 = getelementptr inbounds i8, ptr %.03947, i64 1
  %24 = load i8, ptr %.03947, align 1, !tbaa !9
  %25 = load i8, ptr %13, align 8, !tbaa !9
  %26 = xor i8 %25, %24
  store i8 %26, ptr %13, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %.03848, i64 1
  store i8 %26, ptr %.03848, align 1, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %.03947, i64 2
  %29 = load i8, ptr %23, align 1, !tbaa !9
  %30 = load i8, ptr %15, align 1, !tbaa !9
  %31 = xor i8 %30, %29
  store i8 %31, ptr %15, align 1, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %.03848, i64 2
  store i8 %31, ptr %27, align 1, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %.03947, i64 3
  %34 = load i8, ptr %28, align 1, !tbaa !9
  %35 = load i8, ptr %16, align 2, !tbaa !9
  %36 = xor i8 %35, %34
  store i8 %36, ptr %16, align 2, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %.03848, i64 3
  store i8 %36, ptr %32, align 1, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %.03947, i64 4
  %39 = load i8, ptr %33, align 1, !tbaa !9
  %40 = load i8, ptr %17, align 1, !tbaa !9
  %41 = xor i8 %40, %39
  store i8 %41, ptr %17, align 1, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %.03848, i64 4
  store i8 %41, ptr %37, align 1, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %.03947, i64 5
  %44 = load i8, ptr %38, align 1, !tbaa !9
  %45 = load i8, ptr %18, align 4, !tbaa !9
  %46 = xor i8 %45, %44
  store i8 %46, ptr %18, align 4, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %.03848, i64 5
  store i8 %46, ptr %42, align 1, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %.03947, i64 6
  %49 = load i8, ptr %43, align 1, !tbaa !9
  %50 = load i8, ptr %19, align 1, !tbaa !9
  %51 = xor i8 %50, %49
  store i8 %51, ptr %19, align 1, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %.03848, i64 6
  store i8 %51, ptr %47, align 1, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %.03947, i64 7
  %54 = load i8, ptr %48, align 1, !tbaa !9
  %55 = load i8, ptr %20, align 2, !tbaa !9
  %56 = xor i8 %55, %54
  store i8 %56, ptr %20, align 2, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %.03848, i64 7
  store i8 %56, ptr %52, align 1, !tbaa !9
  %58 = load i8, ptr %53, align 1, !tbaa !9
  %59 = load i8, ptr %21, align 1, !tbaa !9
  %60 = xor i8 %59, %58
  store i8 %60, ptr %21, align 1, !tbaa !9
  store i8 %60, ptr %57, align 1, !tbaa !9
  %61 = load i8, ptr %14, align 1, !tbaa !9
  %62 = xor i8 %61, 2
  store i8 %62, ptr %14, align 1, !tbaa !9
  call void @sliscp_light256_permute_spix(ptr noundef nonnull %10, i32 noundef 9) #3
  %63 = getelementptr inbounds i8, ptr %.03848, i64 8
  %64 = getelementptr inbounds i8, ptr %.03947, i64 8
  %65 = add i64 %.04046, -8
  %66 = icmp ugt i64 %65, 7
  br i1 %66, label %22, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %22, %9
  %.040.lcssa = phi i64 [ %3, %9 ], [ %65, %22 ]
  %.039.lcssa = phi ptr [ %2, %9 ], [ %64, %22 ]
  %.038.lcssa = phi ptr [ %0, %9 ], [ %63, %22 ]
  %.not51 = icmp eq i64 %.040.lcssa, 0
  br i1 %.not51, label %._crit_edge58, label %iter.check

iter.check:                                       ; preds = %._crit_edge
  %67 = getelementptr inbounds i8, ptr %10, i64 8
  %68 = trunc nuw i64 %.040.lcssa to i32
  %69 = add nuw nsw i64 %.040.lcssa, 4294967295
  %70 = and i64 %69, 4294967295
  %71 = add nuw nsw i64 %70, 1
  %min.iters.check = icmp ult i64 %70, 7
  br i1 %min.iters.check, label %.lr.ph57.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %72 = add nuw nsw i64 %.040.lcssa, 4294967295
  %73 = and i64 %72, 4294967295
  %74 = getelementptr i8, ptr %10, i64 %73
  %scevgep = getelementptr i8, ptr %74, i64 9
  %75 = add nuw nsw i64 %73, 1
  %scevgep65 = getelementptr i8, ptr %.038.lcssa, i64 %75
  %scevgep66 = getelementptr i8, ptr %.039.lcssa, i64 %75
  %bound0 = icmp ult ptr %67, %scevgep65
  %bound1 = icmp ult ptr %.038.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound067 = icmp ult ptr %67, %scevgep66
  %bound168 = icmp ult ptr %.039.lcssa, %scevgep
  %found.conflict69 = and i1 %bound067, %bound168
  %conflict.rdx = or i1 %found.conflict, %found.conflict69
  %bound070 = icmp ult ptr %.038.lcssa, %scevgep66
  %bound171 = icmp ult ptr %.039.lcssa, %scevgep65
  %found.conflict72 = and i1 %bound070, %bound171
  %conflict.rdx73 = or i1 %conflict.rdx, %found.conflict72
  br i1 %conflict.rdx73, label %.lr.ph57.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  %min.iters.check74 = icmp ult i64 %70, 31
  br i1 %min.iters.check74, label %vec.epilog.ph, label %vector.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %next.gep = getelementptr i8, ptr %.039.lcssa, i64 %index
  %next.gep76 = getelementptr i8, ptr %67, i64 %index
  %next.gep78 = getelementptr i8, ptr %.038.lcssa, i64 %index
  %76 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %wide.load80 = load <16 x i8>, ptr %76, align 1, !tbaa !9, !alias.scope !12
  %77 = getelementptr i8, ptr %next.gep76, i64 16
  %wide.load81 = load <16 x i8>, ptr %next.gep76, align 8, !tbaa !9, !alias.scope !15, !noalias !17
  %wide.load82 = load <16 x i8>, ptr %77, align 8, !tbaa !9, !alias.scope !15, !noalias !17
  %78 = xor <16 x i8> %wide.load81, %wide.load
  %79 = xor <16 x i8> %wide.load82, %wide.load80
  store <16 x i8> %78, ptr %next.gep76, align 8, !tbaa !9, !alias.scope !15, !noalias !17
  store <16 x i8> %79, ptr %77, align 8, !tbaa !9, !alias.scope !15, !noalias !17
  %80 = getelementptr i8, ptr %next.gep78, i64 16
  store <16 x i8> %78, ptr %next.gep78, align 1, !tbaa !9, !alias.scope !19, !noalias !12
  store <16 x i8> %79, ptr %80, align 1, !tbaa !9, !alias.scope !19, !noalias !12
  %index.next = add nuw i64 %index, 32
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !20

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end94 = getelementptr i8, ptr %.038.lcssa, i64 %n.vec
  %ind.end91 = getelementptr i8, ptr %67, i64 %n.vec
  %ind.end88 = getelementptr i8, ptr %.039.lcssa, i64 %n.vec
  %.cast85 = trunc i64 %n.vec to i32
  %ind.end86 = sub i32 %68, %.cast85
  %n.vec.remaining = and i64 %71, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph57.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.vec84 = and i64 %71, 8589934584
  %.cast = trunc i64 %n.vec84 to i32
  %ind.end = sub i32 %68, %.cast
  %ind.end87 = getelementptr i8, ptr %.039.lcssa, i64 %n.vec84
  %ind.end90 = getelementptr i8, ptr %67, i64 %n.vec84
  %ind.end93 = getelementptr i8, ptr %.038.lcssa, i64 %n.vec84
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index96 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next102, %vec.epilog.vector.body ]
  %next.gep97 = getelementptr i8, ptr %.039.lcssa, i64 %index96
  %next.gep98 = getelementptr i8, ptr %67, i64 %index96
  %next.gep99 = getelementptr i8, ptr %.038.lcssa, i64 %index96
  %wide.load100 = load <8 x i8>, ptr %next.gep97, align 1, !tbaa !9, !alias.scope !23
  %wide.load101 = load <8 x i8>, ptr %next.gep98, align 8, !tbaa !9, !alias.scope !26, !noalias !28
  %82 = xor <8 x i8> %wide.load101, %wide.load100
  store <8 x i8> %82, ptr %next.gep98, align 8, !tbaa !9, !alias.scope !26, !noalias !28
  store <8 x i8> %82, ptr %next.gep99, align 1, !tbaa !9, !alias.scope !30, !noalias !23
  %index.next102 = add nuw i64 %index96, 8
  %83 = icmp eq i64 %index.next102, %n.vec84
  br i1 %83, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !31

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n103 = icmp eq i64 %71, %n.vec84
  br i1 %cmp.n103, label %._crit_edge58, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.055.ph = phi i32 [ %68, %iter.check ], [ %68, %vector.memcheck ], [ %ind.end86, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.03154.ph = phi ptr [ %.039.lcssa, %iter.check ], [ %.039.lcssa, %vector.memcheck ], [ %ind.end88, %vec.epilog.iter.check ], [ %ind.end87, %vec.epilog.middle.block ]
  %.03253.ph = phi ptr [ %67, %iter.check ], [ %67, %vector.memcheck ], [ %ind.end91, %vec.epilog.iter.check ], [ %ind.end90, %vec.epilog.middle.block ]
  %.03352.ph = phi ptr [ %.038.lcssa, %iter.check ], [ %.038.lcssa, %vector.memcheck ], [ %ind.end94, %vec.epilog.iter.check ], [ %ind.end93, %vec.epilog.middle.block ]
  %84 = add nsw i32 %.055.ph, -1
  %xtraiter = and i32 %.055.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph57.prol.loopexit, label %.lr.ph57.prol

.lr.ph57.prol:                                    ; preds = %.lr.ph57.preheader, %.lr.ph57.prol
  %.055.prol = phi i32 [ %91, %.lr.ph57.prol ], [ %.055.ph, %.lr.ph57.preheader ]
  %.03154.prol = phi ptr [ %85, %.lr.ph57.prol ], [ %.03154.ph, %.lr.ph57.preheader ]
  %.03253.prol = phi ptr [ %87, %.lr.ph57.prol ], [ %.03253.ph, %.lr.ph57.preheader ]
  %.03352.prol = phi ptr [ %90, %.lr.ph57.prol ], [ %.03352.ph, %.lr.ph57.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph57.prol ], [ 0, %.lr.ph57.preheader ]
  %85 = getelementptr inbounds i8, ptr %.03154.prol, i64 1
  %86 = load i8, ptr %.03154.prol, align 1, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %.03253.prol, i64 1
  %88 = load i8, ptr %.03253.prol, align 1, !tbaa !9
  %89 = xor i8 %88, %86
  store i8 %89, ptr %.03253.prol, align 1, !tbaa !9
  %90 = getelementptr inbounds i8, ptr %.03352.prol, i64 1
  store i8 %89, ptr %.03352.prol, align 1, !tbaa !9
  %91 = add nsw i32 %.055.prol, -1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph57.prol.loopexit, label %.lr.ph57.prol, !llvm.loop !32

.lr.ph57.prol.loopexit:                           ; preds = %.lr.ph57.prol, %.lr.ph57.preheader
  %.055.unr = phi i32 [ %.055.ph, %.lr.ph57.preheader ], [ %91, %.lr.ph57.prol ]
  %.03154.unr = phi ptr [ %.03154.ph, %.lr.ph57.preheader ], [ %85, %.lr.ph57.prol ]
  %.03253.unr = phi ptr [ %.03253.ph, %.lr.ph57.preheader ], [ %87, %.lr.ph57.prol ]
  %.03352.unr = phi ptr [ %.03352.ph, %.lr.ph57.preheader ], [ %90, %.lr.ph57.prol ]
  %92 = icmp ult i32 %84, 3
  br i1 %92, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %.lr.ph57.prol.loopexit, %.lr.ph57
  %.055 = phi i32 [ %117, %.lr.ph57 ], [ %.055.unr, %.lr.ph57.prol.loopexit ]
  %.03154 = phi ptr [ %111, %.lr.ph57 ], [ %.03154.unr, %.lr.ph57.prol.loopexit ]
  %.03253 = phi ptr [ %113, %.lr.ph57 ], [ %.03253.unr, %.lr.ph57.prol.loopexit ]
  %.03352 = phi ptr [ %116, %.lr.ph57 ], [ %.03352.unr, %.lr.ph57.prol.loopexit ]
  %93 = getelementptr inbounds i8, ptr %.03154, i64 1
  %94 = load i8, ptr %.03154, align 1, !tbaa !9
  %95 = getelementptr inbounds i8, ptr %.03253, i64 1
  %96 = load i8, ptr %.03253, align 1, !tbaa !9
  %97 = xor i8 %96, %94
  store i8 %97, ptr %.03253, align 1, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %.03352, i64 1
  store i8 %97, ptr %.03352, align 1, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %.03154, i64 2
  %100 = load i8, ptr %93, align 1, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %.03253, i64 2
  %102 = load i8, ptr %95, align 1, !tbaa !9
  %103 = xor i8 %102, %100
  store i8 %103, ptr %95, align 1, !tbaa !9
  %104 = getelementptr inbounds i8, ptr %.03352, i64 2
  store i8 %103, ptr %98, align 1, !tbaa !9
  %105 = getelementptr inbounds i8, ptr %.03154, i64 3
  %106 = load i8, ptr %99, align 1, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %.03253, i64 3
  %108 = load i8, ptr %101, align 1, !tbaa !9
  %109 = xor i8 %108, %106
  store i8 %109, ptr %101, align 1, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %.03352, i64 3
  store i8 %109, ptr %104, align 1, !tbaa !9
  %111 = getelementptr inbounds i8, ptr %.03154, i64 4
  %112 = load i8, ptr %105, align 1, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %.03253, i64 4
  %114 = load i8, ptr %107, align 1, !tbaa !9
  %115 = xor i8 %114, %112
  store i8 %115, ptr %107, align 1, !tbaa !9
  %116 = getelementptr inbounds i8, ptr %.03352, i64 4
  store i8 %115, ptr %110, align 1, !tbaa !9
  %117 = add nsw i32 %.055, -4
  %.not.3 = icmp eq i32 %117, 0
  br i1 %.not.3, label %._crit_edge58, label %.lr.ph57, !llvm.loop !34

._crit_edge58:                                    ; preds = %.lr.ph57.prol.loopexit, %.lr.ph57, %middle.block, %vec.epilog.middle.block, %._crit_edge
  %118 = or disjoint i64 %.040.lcssa, 8
  %119 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = xor i8 %120, -128
  store i8 %121, ptr %119, align 1, !tbaa !9
  %122 = getelementptr inbounds i8, ptr %10, i64 31
  %123 = load i8, ptr %122, align 1, !tbaa !9
  %124 = xor i8 %123, 2
  store i8 %124, ptr %122, align 1, !tbaa !9
  call void @sliscp_light256_permute_spix(ptr noundef nonnull %10, i32 noundef 9) #3
  %125 = getelementptr inbounds i8, ptr %.038.lcssa, i64 %.040.lcssa
  call void @spix_finalize(ptr noundef nonnull %10, ptr noundef %8, ptr noundef %125)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #3
  ret i32 0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @spix_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @sliscp_light256_permute_spix(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @spix_finalize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13}
!13 = distinct !{!13, !14}
!14 = distinct !{!14, !"LVerDomain"}
!15 = !{!16}
!16 = distinct !{!16, !14}
!17 = !{!18, !13}
!18 = distinct !{!18, !14}
!19 = !{!18}
!20 = distinct !{!20, !11, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = !{!24}
!24 = distinct !{!24, !25}
!25 = distinct !{!25, !"LVerDomain"}
!26 = !{!27}
!27 = distinct !{!27, !25}
!28 = !{!29, !24}
!29 = distinct !{!29, !25}
!30 = !{!29}
!31 = distinct !{!31, !11, !21, !22}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.unroll.disable"}
!34 = distinct !{!34, !11, !21}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass