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

38:                                               ; preds = %9
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %23, align 4
  br label %154

39:                                               ; preds = %9
  %40 = load i64, ptr %15, align 8, !tbaa !9
  %41 = sub i64 %40, 16
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %41, ptr %42, align 8, !tbaa !9
  %43 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %44 = load ptr, ptr %19, align 8, !tbaa !5
  %45 = load ptr, ptr %18, align 8, !tbaa !5
  %46 = load ptr, ptr %16, align 8, !tbaa !5
  %47 = load i64, ptr %17, align 8, !tbaa !9
  call void @spix_init(ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46, i64 noundef %47)
  %48 = load i64, ptr %15, align 8, !tbaa !9
  %49 = sub i64 %48, 16
  store i64 %49, ptr %15, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %82, %39
  %51 = load i64, ptr %15, align 8, !tbaa !9
  %52 = icmp uge i64 %51, 8
  br i1 %52, label %53, label %95

53:                                               ; preds = %50
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %55, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %56 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 8
  store ptr %57, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %58, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  store i32 8, ptr %27, align 4, !tbaa !11
  br label %59

59:                                               ; preds = %62, %54
  %60 = load i32, ptr %27, align 4, !tbaa !11
  %61 = icmp ugt i32 %60, 0
  br i1 %61, label %62, label %80

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #3
  %63 = load ptr, ptr %26, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i32 1
  store ptr %64, ptr %26, align 8, !tbaa !5
  %65 = load i8, ptr %63, align 1, !tbaa !13
  store i8 %65, ptr %28, align 1, !tbaa !13
  %66 = load ptr, ptr %25, align 8, !tbaa !5
  %67 = load i8, ptr %66, align 1, !tbaa !13
  %68 = zext i8 %67 to i32
  %69 = load i8, ptr %28, align 1, !tbaa !13
  %70 = zext i8 %69 to i32
  %71 = xor i32 %68, %70
  %72 = trunc i32 %71 to i8
  %73 = load ptr, ptr %24, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i32 1
  store ptr %74, ptr %24, align 8, !tbaa !5
  store i8 %72, ptr %73, align 1, !tbaa !13
  %75 = load i8, ptr %28, align 1, !tbaa !13
  %76 = load ptr, ptr %25, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i32 1
  store ptr %77, ptr %25, align 8, !tbaa !5
  store i8 %75, ptr %76, align 1, !tbaa !13
  %78 = load i32, ptr %27, align 4, !tbaa !11
  %79 = add i32 %78, -1
  store i32 %79, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #3
  br label %59, !llvm.loop !14

80:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 31
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = zext i8 %84 to i32
  %86 = xor i32 %85, 2
  %87 = trunc i32 %86 to i8
  store i8 %87, ptr %83, align 1, !tbaa !13
  %88 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  call void @sliscp_light256_permute_spix(ptr noundef %88, i32 noundef 9)
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  store ptr %90, ptr %14, align 8, !tbaa !5
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  store ptr %92, ptr %11, align 8, !tbaa !5
  %93 = load i64, ptr %15, align 8, !tbaa !9
  %94 = sub i64 %93, 8
  store i64 %94, ptr %15, align 8, !tbaa !9
  br label %50, !llvm.loop !16

95:                                               ; preds = %50
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = trunc i64 %96 to i32
  store i32 %97, ptr %22, align 4, !tbaa !11
  br label %98

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %99, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %100 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %101 = getelementptr inbounds i8, ptr %100, i64 8
  store ptr %101, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #3
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %102, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  %103 = load i32, ptr %22, align 4, !tbaa !11
  store i32 %103, ptr %32, align 4, !tbaa !11
  br label %104

104:                                              ; preds = %107, %98
  %105 = load i32, ptr %32, align 4, !tbaa !11
  %106 = icmp ugt i32 %105, 0
  br i1 %106, label %107, label %125

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #3
  %108 = load ptr, ptr %31, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i32 1
  store ptr %109, ptr %31, align 8, !tbaa !5
  %110 = load i8, ptr %108, align 1, !tbaa !13
  store i8 %110, ptr %33, align 1, !tbaa !13
  %111 = load ptr, ptr %30, align 8, !tbaa !5
  %112 = load i8, ptr %111, align 1, !tbaa !13
  %113 = zext i8 %112 to i32
  %114 = load i8, ptr %33, align 1, !tbaa !13
  %115 = zext i8 %114 to i32
  %116 = xor i32 %113, %115
  %117 = trunc i32 %116 to i8
  %118 = load ptr, ptr %29, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i32 1
  store ptr %119, ptr %29, align 8, !tbaa !5
  store i8 %117, ptr %118, align 1, !tbaa !13
  %120 = load i8, ptr %33, align 1, !tbaa !13
  %121 = load ptr, ptr %30, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i32 1
  store ptr %122, ptr %30, align 8, !tbaa !5
  store i8 %120, ptr %121, align 1, !tbaa !13
  %123 = load i32, ptr %32, align 4, !tbaa !11
  %124 = add i32 %123, -1
  store i32 %124, ptr %32, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #3
  br label %104, !llvm.loop !17

125:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %22, align 4, !tbaa !11
  %129 = add i32 %128, 8
  %130 = zext i32 %129 to i64
  %131 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !13
  %133 = zext i8 %132 to i32
  %134 = xor i32 %133, 128
  %135 = trunc i32 %134 to i8
  store i8 %135, ptr %131, align 1, !tbaa !13
  %136 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 31
  %137 = load i8, ptr %136, align 1, !tbaa !13
  %138 = zext i8 %137 to i32
  %139 = xor i32 %138, 2
  %140 = trunc i32 %139 to i8
  store i8 %140, ptr %136, align 1, !tbaa !13
  %141 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  call void @sliscp_light256_permute_spix(ptr noundef %141, i32 noundef 9)
  %142 = load i64, ptr %15, align 8, !tbaa !9
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = getelementptr inbounds i8, ptr %143, i64 %142
  store ptr %144, ptr %14, align 8, !tbaa !5
  %145 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  call void @spix_finalize(ptr noundef %145, ptr noundef %146, ptr noundef %147)
  %148 = load ptr, ptr %21, align 8, !tbaa !5
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = load i64, ptr %149, align 8, !tbaa !9
  %151 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = call i32 @aead_check_tag(ptr noundef %148, i64 noundef %150, ptr noundef %151, ptr noundef %152, i32 noundef 16)
  store i32 %153, ptr %10, align 4
  store i32 1, ptr %23, align 4
  br label %154

154:                                              ; preds = %127, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #3
  %155 = load i32, ptr %10, align 4
  ret i32 %155
}

; 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

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 i32 @spix_aead_decrypt(ptr noundef %0, ptr nocapture noundef %1, ptr nocapture noundef readnone %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %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 = icmp ult i64 %4, 16
  br i1 %11, label %130, label %12

12:                                               ; preds = %9
  %13 = add i64 %4, -16
  store i64 %13, ptr %1, align 8, !tbaa !5
  call void @spix_init(ptr noundef nonnull %10, ptr noundef %8, ptr noundef %7, ptr noundef %5, i64 noundef %6)
  %14 = icmp ugt i64 %13, 7
  br i1 %14, label %.lr.ph, label %._crit_edge

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

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

._crit_edge:                                      ; preds = %24, %12
  %.053.lcssa = phi i64 [ %13, %12 ], [ %67, %24 ]
  %.052.lcssa = phi ptr [ %3, %12 ], [ %65, %24 ]
  %.047.lcssa = phi ptr [ %0, %12 ], [ %66, %24 ]
  %.not65 = icmp eq i64 %.053.lcssa, 0
  br i1 %.not65, label %._crit_edge72, label %iter.check

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

vector.memcheck:                                  ; preds = %iter.check
  %74 = add nuw nsw i64 %.053.lcssa, 4294967295
  %75 = and i64 %74, 4294967295
  %76 = add nuw nsw i64 %75, 1
  %scevgep = getelementptr i8, ptr %.047.lcssa, i64 %76
  %77 = getelementptr i8, ptr %10, i64 %75
  %scevgep79 = getelementptr i8, ptr %77, i64 9
  %scevgep80 = getelementptr i8, ptr %.052.lcssa, i64 %76
  %bound0 = icmp ult ptr %.047.lcssa, %scevgep79
  %bound1 = icmp ult ptr %69, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound081 = icmp ult ptr %.047.lcssa, %scevgep80
  %bound182 = icmp ult ptr %.052.lcssa, %scevgep
  %found.conflict83 = and i1 %bound081, %bound182
  %conflict.rdx = or i1 %found.conflict, %found.conflict83
  %bound084 = icmp ult ptr %69, %scevgep80
  %bound185 = icmp ult ptr %.052.lcssa, %scevgep79
  %found.conflict86 = and i1 %bound084, %bound185
  %conflict.rdx87 = or i1 %conflict.rdx, %found.conflict86
  br i1 %conflict.rdx87, label %.lr.ph71.preheader, label %vector.main.loop.iter.check

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

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %73, 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 %.052.lcssa, i64 %index
  %next.gep90 = getelementptr i8, ptr %69, i64 %index
  %next.gep92 = getelementptr i8, ptr %.047.lcssa, i64 %index
  %78 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %wide.load94 = load <16 x i8>, ptr %78, align 1, !tbaa !9, !alias.scope !12
  %79 = getelementptr i8, ptr %next.gep90, i64 16
  %wide.load95 = load <16 x i8>, ptr %next.gep90, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %wide.load96 = load <16 x i8>, ptr %79, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %80 = xor <16 x i8> %wide.load95, %wide.load
  %81 = xor <16 x i8> %wide.load96, %wide.load94
  %82 = getelementptr i8, ptr %next.gep92, i64 16
  store <16 x i8> %80, ptr %next.gep92, align 1, !tbaa !9, !alias.scope !17, !noalias !19
  store <16 x i8> %81, ptr %82, align 1, !tbaa !9, !alias.scope !17, !noalias !19
  store <16 x i8> %wide.load, ptr %next.gep90, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  store <16 x i8> %wide.load94, ptr %79, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 32
  %83 = icmp eq i64 %index.next, %n.vec
  br i1 %83, label %middle.block, label %vector.body, !llvm.loop !20

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end108 = getelementptr i8, ptr %.047.lcssa, i64 %n.vec
  %ind.end105 = getelementptr i8, ptr %69, i64 %n.vec
  %ind.end102 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec
  %.cast99 = trunc i64 %n.vec to i32
  %ind.end100 = sub i32 %70, %.cast99
  %n.vec.remaining = and i64 %73, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph71.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.vec98 = and i64 %73, 8589934584
  %.cast = trunc i64 %n.vec98 to i32
  %ind.end = sub i32 %70, %.cast
  %ind.end101 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec98
  %ind.end104 = getelementptr i8, ptr %69, i64 %n.vec98
  %ind.end107 = getelementptr i8, ptr %.047.lcssa, i64 %n.vec98
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index110 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next116, %vec.epilog.vector.body ]
  %next.gep111 = getelementptr i8, ptr %.052.lcssa, i64 %index110
  %next.gep112 = getelementptr i8, ptr %69, i64 %index110
  %next.gep113 = getelementptr i8, ptr %.047.lcssa, i64 %index110
  %wide.load114 = load <8 x i8>, ptr %next.gep111, align 1, !tbaa !9, !alias.scope !23
  %wide.load115 = load <8 x i8>, ptr %next.gep112, align 8, !tbaa !9, !alias.scope !26, !noalias !23
  %84 = xor <8 x i8> %wide.load115, %wide.load114
  store <8 x i8> %84, ptr %next.gep113, align 1, !tbaa !9, !alias.scope !28, !noalias !30
  store <8 x i8> %wide.load114, ptr %next.gep112, align 8, !tbaa !9, !alias.scope !26, !noalias !23
  %index.next116 = add nuw i64 %index110, 8
  %85 = icmp eq i64 %index.next116, %n.vec98
  br i1 %85, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !31

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n117 = icmp eq i64 %73, %n.vec98
  br i1 %cmp.n117, label %._crit_edge72, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.04369.ph = phi i32 [ %70, %iter.check ], [ %70, %vector.memcheck ], [ %ind.end100, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.04468.ph = phi ptr [ %.052.lcssa, %iter.check ], [ %.052.lcssa, %vector.memcheck ], [ %ind.end102, %vec.epilog.iter.check ], [ %ind.end101, %vec.epilog.middle.block ]
  %.04567.ph = phi ptr [ %69, %iter.check ], [ %69, %vector.memcheck ], [ %ind.end105, %vec.epilog.iter.check ], [ %ind.end104, %vec.epilog.middle.block ]
  %.04666.ph = phi ptr [ %.047.lcssa, %iter.check ], [ %.047.lcssa, %vector.memcheck ], [ %ind.end108, %vec.epilog.iter.check ], [ %ind.end107, %vec.epilog.middle.block ]
  %86 = add nsw i32 %.04369.ph, -1
  %xtraiter = and i32 %.04369.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph71.prol.loopexit, label %.lr.ph71.prol

.lr.ph71.prol:                                    ; preds = %.lr.ph71.preheader, %.lr.ph71.prol
  %.04369.prol = phi i32 [ %93, %.lr.ph71.prol ], [ %.04369.ph, %.lr.ph71.preheader ]
  %.04468.prol = phi ptr [ %87, %.lr.ph71.prol ], [ %.04468.ph, %.lr.ph71.preheader ]
  %.04567.prol = phi ptr [ %92, %.lr.ph71.prol ], [ %.04567.ph, %.lr.ph71.preheader ]
  %.04666.prol = phi ptr [ %91, %.lr.ph71.prol ], [ %.04666.ph, %.lr.ph71.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph71.prol ], [ 0, %.lr.ph71.preheader ]
  %87 = getelementptr inbounds i8, ptr %.04468.prol, i64 1
  %88 = load i8, ptr %.04468.prol, align 1, !tbaa !9
  %89 = load i8, ptr %.04567.prol, align 1, !tbaa !9
  %90 = xor i8 %89, %88
  %91 = getelementptr inbounds i8, ptr %.04666.prol, i64 1
  store i8 %90, ptr %.04666.prol, align 1, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %.04567.prol, i64 1
  store i8 %88, ptr %.04567.prol, align 1, !tbaa !9
  %93 = add nsw i32 %.04369.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.ph71.prol.loopexit, label %.lr.ph71.prol, !llvm.loop !32

.lr.ph71.prol.loopexit:                           ; preds = %.lr.ph71.prol, %.lr.ph71.preheader
  %.04369.unr = phi i32 [ %.04369.ph, %.lr.ph71.preheader ], [ %93, %.lr.ph71.prol ]
  %.04468.unr = phi ptr [ %.04468.ph, %.lr.ph71.preheader ], [ %87, %.lr.ph71.prol ]
  %.04567.unr = phi ptr [ %.04567.ph, %.lr.ph71.preheader ], [ %92, %.lr.ph71.prol ]
  %.04666.unr = phi ptr [ %.04666.ph, %.lr.ph71.preheader ], [ %91, %.lr.ph71.prol ]
  %94 = icmp ult i32 %86, 3
  br i1 %94, label %._crit_edge72, label %.lr.ph71

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

._crit_edge72:                                    ; preds = %.lr.ph71.prol.loopexit, %.lr.ph71, %middle.block, %vec.epilog.middle.block, %._crit_edge
  %120 = or disjoint i64 %.053.lcssa, 8
  %121 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !9
  %123 = xor i8 %122, -128
  store i8 %123, ptr %121, align 1, !tbaa !9
  %124 = getelementptr inbounds i8, ptr %10, i64 31
  %125 = load i8, ptr %124, align 1, !tbaa !9
  %126 = xor i8 %125, 2
  store i8 %126, ptr %124, align 1, !tbaa !9
  call void @sliscp_light256_permute_spix(ptr noundef nonnull %10, i32 noundef 9) #3
  %127 = getelementptr inbounds i8, ptr %.052.lcssa, i64 %.053.lcssa
  call void @spix_finalize(ptr noundef nonnull %10, ptr noundef %8, ptr noundef nonnull %10)
  %128 = load i64, ptr %1, align 8, !tbaa !5
  %129 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %128, ptr noundef nonnull %10, ptr noundef %127, i32 noundef 16) #3
  br label %130

130:                                              ; preds = %9, %._crit_edge72
  %.0 = phi i32 [ %129, %._crit_edge72 ], [ -1, %9 ]
  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

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree 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}
!18 = distinct !{!18, !14}
!19 = !{!16, !13}
!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}
!29 = distinct !{!29, !25}
!30 = !{!27, !24}
!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