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

; 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 @ace_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 [40 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 40, 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 %151

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 [40 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 @ace_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 = %81, %39
  %51 = load i64, ptr %15, align 8, !tbaa !9
  %52 = icmp uge i64 %51, 8
  br i1 %52, label %53, label %94

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 [40 x i8], ptr %20, i64 0, i64 0
  store ptr %56, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %57, 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 %58

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

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

79:                                               ; preds = %58
  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 %80

80:                                               ; preds = %79
  br label %81

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

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

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

102:                                              ; preds = %105, %97
  %103 = load i32, ptr %32, align 4, !tbaa !11
  %104 = icmp ugt i32 %103, 0
  br i1 %104, label %105, label %123

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

123:                                              ; preds = %102
  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 %124

124:                                              ; preds = %123
  br label %125

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

151:                                              ; preds = %125, %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 40, ptr %20) #3
  %152 = load i32, ptr %10, align 4
  ret i32 %152
}

; 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 @ace_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_light320_permute(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @ace_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 @ace_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 [40 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #3
  %11 = icmp ult i64 %4, 16
  br i1 %11, label %125, label %12

12:                                               ; preds = %9
  %13 = add i64 %4, -16
  store i64 %13, ptr %1, align 8, !tbaa !5
  call void @ace_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 %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %12
  %15 = getelementptr inbounds i8, ptr %10, i64 39
  %16 = getelementptr inbounds i8, ptr %10, i64 1
  %17 = getelementptr inbounds i8, ptr %10, i64 2
  %18 = getelementptr inbounds i8, ptr %10, i64 3
  %19 = getelementptr inbounds i8, ptr %10, i64 4
  %20 = getelementptr inbounds i8, ptr %10, i64 5
  %21 = getelementptr inbounds i8, ptr %10, i64 6
  %22 = getelementptr inbounds i8, ptr %10, i64 7
  br label %.preheader

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

._crit_edge:                                      ; preds = %.preheader, %12
  %.053.lcssa = phi i64 [ %13, %12 ], [ %65, %.preheader ]
  %.052.lcssa = phi ptr [ %3, %12 ], [ %63, %.preheader ]
  %.047.lcssa = phi ptr [ %0, %12 ], [ %64, %.preheader ]
  %.not65 = icmp eq i64 %.053.lcssa, 0
  br i1 %.not65, label %._crit_edge71, label %iter.check

iter.check:                                       ; preds = %._crit_edge
  %67 = trunc nuw i64 %.053.lcssa to i32
  %68 = add nuw nsw i64 %.053.lcssa, 4294967295
  %69 = and i64 %68, 4294967295
  %70 = add nuw nsw i64 %69, 1
  %min.iters.check = icmp ult i64 %69, 7
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %71 = add nuw nsw i64 %.053.lcssa, 4294967295
  %72 = and i64 %71, 4294967295
  %73 = add nuw nsw i64 %72, 1
  %scevgep = getelementptr i8, ptr %.047.lcssa, i64 %73
  %scevgep78 = getelementptr i8, ptr %10, i64 %73
  %scevgep79 = getelementptr i8, ptr %.052.lcssa, i64 %73
  %bound0 = icmp ult ptr %.047.lcssa, %scevgep78
  %bound1 = icmp ult ptr %10, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound080 = icmp ult ptr %.047.lcssa, %scevgep79
  %bound181 = icmp ult ptr %.052.lcssa, %scevgep
  %found.conflict82 = and i1 %bound080, %bound181
  %conflict.rdx = or i1 %found.conflict, %found.conflict82
  %bound083 = icmp ult ptr %10, %scevgep79
  %bound184 = icmp ult ptr %.052.lcssa, %scevgep78
  %found.conflict85 = and i1 %bound083, %bound184
  %conflict.rdx86 = or i1 %conflict.rdx, %found.conflict85
  br i1 %conflict.rdx86, label %.lr.ph.preheader, label %vector.main.loop.iter.check

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

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %70, 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.gep89 = getelementptr i8, ptr %10, i64 %index
  %next.gep91 = getelementptr i8, ptr %.047.lcssa, i64 %index
  %74 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %wide.load93 = load <16 x i8>, ptr %74, align 1, !tbaa !9, !alias.scope !12
  %75 = getelementptr i8, ptr %next.gep89, i64 16
  %wide.load94 = load <16 x i8>, ptr %next.gep89, align 16, !tbaa !9, !alias.scope !15, !noalias !12
  %wide.load95 = load <16 x i8>, ptr %75, align 16, !tbaa !9, !alias.scope !15, !noalias !12
  %76 = xor <16 x i8> %wide.load94, %wide.load
  %77 = xor <16 x i8> %wide.load95, %wide.load93
  %78 = getelementptr i8, ptr %next.gep91, i64 16
  store <16 x i8> %76, ptr %next.gep91, align 1, !tbaa !9, !alias.scope !17, !noalias !19
  store <16 x i8> %77, ptr %78, align 1, !tbaa !9, !alias.scope !17, !noalias !19
  store <16 x i8> %wide.load, ptr %next.gep89, align 16, !tbaa !9, !alias.scope !15, !noalias !12
  store <16 x i8> %wide.load93, ptr %75, align 16, !tbaa !9, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 32
  %79 = icmp eq i64 %index.next, %n.vec
  br i1 %79, label %middle.block, label %vector.body, !llvm.loop !20

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end107 = getelementptr i8, ptr %.047.lcssa, i64 %n.vec
  %ind.end104 = getelementptr i8, ptr %10, i64 %n.vec
  %ind.end101 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec
  %.cast98 = trunc i64 %n.vec to i32
  %ind.end99 = sub i32 %67, %.cast98
  %n.vec.remaining = and i64 %70, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec97 = and i64 %70, 8589934584
  %.cast = trunc i64 %n.vec97 to i32
  %ind.end = sub i32 %67, %.cast
  %ind.end100 = getelementptr i8, ptr %.052.lcssa, i64 %n.vec97
  %ind.end103 = getelementptr i8, ptr %10, i64 %n.vec97
  %ind.end106 = getelementptr i8, ptr %.047.lcssa, i64 %n.vec97
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index109 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next115, %vec.epilog.vector.body ]
  %next.gep110 = getelementptr i8, ptr %.052.lcssa, i64 %index109
  %next.gep111 = getelementptr i8, ptr %10, i64 %index109
  %next.gep112 = getelementptr i8, ptr %.047.lcssa, i64 %index109
  %wide.load113 = load <8 x i8>, ptr %next.gep110, align 1, !tbaa !9, !alias.scope !23
  %wide.load114 = load <8 x i8>, ptr %next.gep111, align 8, !tbaa !9, !alias.scope !26, !noalias !23
  %80 = xor <8 x i8> %wide.load114, %wide.load113
  store <8 x i8> %80, ptr %next.gep112, align 1, !tbaa !9, !alias.scope !28, !noalias !30
  store <8 x i8> %wide.load113, ptr %next.gep111, align 8, !tbaa !9, !alias.scope !26, !noalias !23
  %index.next115 = add nuw i64 %index109, 8
  %81 = icmp eq i64 %index.next115, %n.vec97
  br i1 %81, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !31

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n116 = icmp eq i64 %70, %n.vec97
  br i1 %cmp.n116, label %._crit_edge71, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.04369.ph = phi i32 [ %67, %iter.check ], [ %67, %vector.memcheck ], [ %ind.end99, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.04468.ph = phi ptr [ %.052.lcssa, %iter.check ], [ %.052.lcssa, %vector.memcheck ], [ %ind.end101, %vec.epilog.iter.check ], [ %ind.end100, %vec.epilog.middle.block ]
  %.04567.ph = phi ptr [ %10, %iter.check ], [ %10, %vector.memcheck ], [ %ind.end104, %vec.epilog.iter.check ], [ %ind.end103, %vec.epilog.middle.block ]
  %.04666.ph = phi ptr [ %.047.lcssa, %iter.check ], [ %.047.lcssa, %vector.memcheck ], [ %ind.end107, %vec.epilog.iter.check ], [ %ind.end106, %vec.epilog.middle.block ]
  %82 = 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.ph.prol.loopexit, label %.lr.ph.prol

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

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.04369.unr = phi i32 [ %.04369.ph, %.lr.ph.preheader ], [ %89, %.lr.ph.prol ]
  %.04468.unr = phi ptr [ %.04468.ph, %.lr.ph.preheader ], [ %83, %.lr.ph.prol ]
  %.04567.unr = phi ptr [ %.04567.ph, %.lr.ph.preheader ], [ %88, %.lr.ph.prol ]
  %.04666.unr = phi ptr [ %.04666.ph, %.lr.ph.preheader ], [ %87, %.lr.ph.prol ]
  %90 = icmp ult i32 %82, 3
  br i1 %90, label %._crit_edge71, label %.lr.ph

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

._crit_edge71:                                    ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %vec.epilog.middle.block, %._crit_edge
  %116 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 %.053.lcssa
  %117 = load i8, ptr %116, align 1, !tbaa !9
  %118 = xor i8 %117, -128
  store i8 %118, ptr %116, align 1, !tbaa !9
  %119 = getelementptr inbounds i8, ptr %10, i64 39
  %120 = load i8, ptr %119, align 1, !tbaa !9
  %121 = xor i8 %120, 2
  store i8 %121, ptr %119, align 1, !tbaa !9
  call void @sliscp_light320_permute(ptr noundef nonnull %10) #3
  %122 = getelementptr inbounds i8, ptr %.052.lcssa, i64 %.053.lcssa
  call void @ace_finalize(ptr noundef nonnull %10, ptr noundef %8, ptr noundef nonnull %10)
  %123 = load i64, ptr %1, align 8, !tbaa !5
  %124 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %123, ptr noundef nonnull %10, ptr noundef %122, i32 noundef 16) #3
  br label %125

125:                                              ; preds = %9, %._crit_edge71
  %.0 = phi i32 [ %124, %._crit_edge71 ], [ -1, %9 ]
  call void @llvm.lifetime.end.p0(i64 40, 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 @ace_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_light320_permute(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @ace_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