; 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_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 [40 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 40, 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 [40 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 @ace_init(ptr noundef %33, ptr noundef %34, ptr noundef %35, ptr noundef %36, i64 noundef %37)
  br label %38

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

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 [40 x i8], ptr %19, i64 0, i64 0
  store ptr %44, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %45, 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 %46

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

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

64:                                               ; preds = %46
  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 %65

65:                                               ; preds = %64
  br label %66

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

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

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

87:                                               ; preds = %90, %82
  %88 = load i32, ptr %28, align 4, !tbaa !11
  %89 = icmp ugt i32 %88, 0
  br i1 %89, label %90, label %105

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

105:                                              ; preds = %87
  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 %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %20, align 4, !tbaa !11
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [40 x i8], ptr %19, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !13
  %112 = zext i8 %111 to i32
  %113 = xor i32 %112, 128
  %114 = trunc i32 %113 to i8
  store i8 %114, ptr %110, align 1, !tbaa !13
  %115 = getelementptr inbounds [40 x i8], ptr %19, i64 0, i64 39
  %116 = load i8, ptr %115, align 1, !tbaa !13
  %117 = zext i8 %116 to i32
  %118 = xor i32 %117, 2
  %119 = trunc i32 %118 to i8
  store i8 %119, ptr %115, align 1, !tbaa !13
  %120 = getelementptr inbounds [40 x i8], ptr %19, i64 0, i64 0
  call void @sliscp_light320_permute(ptr noundef %120)
  %121 = load i64, ptr %13, align 8, !tbaa !9
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 %121
  store ptr %123, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds [40 x i8], ptr %19, i64 0, i64 0
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ace_finalize(ptr noundef %124, ptr noundef %125, ptr noundef %126)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 40, 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 @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

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 @ace_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 [40 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #3
  %11 = add i64 %3, 16
  store i64 %11, ptr %1, align 8, !tbaa !5
  call void @ace_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 %.preheader.lr.ph, label %._crit_edge

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

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

._crit_edge:                                      ; preds = %.preheader, %9
  %.040.lcssa = phi i64 [ %3, %9 ], [ %63, %.preheader ]
  %.039.lcssa = phi ptr [ %2, %9 ], [ %62, %.preheader ]
  %.038.lcssa = phi ptr [ %0, %9 ], [ %61, %.preheader ]
  %.not51 = icmp eq i64 %.040.lcssa, 0
  br i1 %.not51, label %._crit_edge57, label %iter.check

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

vector.memcheck:                                  ; preds = %iter.check
  %69 = add nuw nsw i64 %.040.lcssa, 4294967295
  %70 = and i64 %69, 4294967295
  %71 = add nuw nsw i64 %70, 1
  %scevgep = getelementptr i8, ptr %10, i64 %71
  %scevgep64 = getelementptr i8, ptr %.038.lcssa, i64 %71
  %scevgep65 = getelementptr i8, ptr %.039.lcssa, i64 %71
  %bound0 = icmp ult ptr %10, %scevgep64
  %bound1 = icmp ult ptr %.038.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound066 = icmp ult ptr %10, %scevgep65
  %bound167 = icmp ult ptr %.039.lcssa, %scevgep
  %found.conflict68 = and i1 %bound066, %bound167
  %conflict.rdx = or i1 %found.conflict, %found.conflict68
  %bound069 = icmp ult ptr %.038.lcssa, %scevgep65
  %bound170 = icmp ult ptr %.039.lcssa, %scevgep64
  %found.conflict71 = and i1 %bound069, %bound170
  %conflict.rdx72 = or i1 %conflict.rdx, %found.conflict71
  br i1 %conflict.rdx72, label %.lr.ph.preheader, label %vector.main.loop.iter.check

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

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %68, 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.gep75 = getelementptr i8, ptr %10, i64 %index
  %next.gep77 = getelementptr i8, ptr %.038.lcssa, i64 %index
  %72 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %wide.load79 = load <16 x i8>, ptr %72, align 1, !tbaa !9, !alias.scope !12
  %73 = getelementptr i8, ptr %next.gep75, i64 16
  %wide.load80 = load <16 x i8>, ptr %next.gep75, align 16, !tbaa !9, !alias.scope !15, !noalias !17
  %wide.load81 = load <16 x i8>, ptr %73, align 16, !tbaa !9, !alias.scope !15, !noalias !17
  %74 = xor <16 x i8> %wide.load80, %wide.load
  %75 = xor <16 x i8> %wide.load81, %wide.load79
  store <16 x i8> %74, ptr %next.gep75, align 16, !tbaa !9, !alias.scope !15, !noalias !17
  store <16 x i8> %75, ptr %73, align 16, !tbaa !9, !alias.scope !15, !noalias !17
  %76 = getelementptr i8, ptr %next.gep77, i64 16
  store <16 x i8> %74, ptr %next.gep77, align 1, !tbaa !9, !alias.scope !19, !noalias !12
  store <16 x i8> %75, ptr %76, align 1, !tbaa !9, !alias.scope !19, !noalias !12
  %index.next = add nuw i64 %index, 32
  %77 = icmp eq i64 %index.next, %n.vec
  br i1 %77, label %middle.block, label %vector.body, !llvm.loop !20

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end93 = getelementptr i8, ptr %.038.lcssa, i64 %n.vec
  %ind.end90 = getelementptr i8, ptr %10, i64 %n.vec
  %ind.end87 = getelementptr i8, ptr %.039.lcssa, i64 %n.vec
  %.cast84 = trunc i64 %n.vec to i32
  %ind.end85 = sub i32 %65, %.cast84
  %n.vec.remaining = and i64 %68, 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.vec83 = and i64 %68, 8589934584
  %.cast = trunc i64 %n.vec83 to i32
  %ind.end = sub i32 %65, %.cast
  %ind.end86 = getelementptr i8, ptr %.039.lcssa, i64 %n.vec83
  %ind.end89 = getelementptr i8, ptr %10, i64 %n.vec83
  %ind.end92 = getelementptr i8, ptr %.038.lcssa, i64 %n.vec83
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index95 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next101, %vec.epilog.vector.body ]
  %next.gep96 = getelementptr i8, ptr %.039.lcssa, i64 %index95
  %next.gep97 = getelementptr i8, ptr %10, i64 %index95
  %next.gep98 = getelementptr i8, ptr %.038.lcssa, i64 %index95
  %wide.load99 = load <8 x i8>, ptr %next.gep96, align 1, !tbaa !9, !alias.scope !23
  %wide.load100 = load <8 x i8>, ptr %next.gep97, align 8, !tbaa !9, !alias.scope !26, !noalias !28
  %78 = xor <8 x i8> %wide.load100, %wide.load99
  store <8 x i8> %78, ptr %next.gep97, align 8, !tbaa !9, !alias.scope !26, !noalias !28
  store <8 x i8> %78, ptr %next.gep98, align 1, !tbaa !9, !alias.scope !30, !noalias !23
  %index.next101 = add nuw i64 %index95, 8
  %79 = icmp eq i64 %index.next101, %n.vec83
  br i1 %79, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !31

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n102 = icmp eq i64 %68, %n.vec83
  br i1 %cmp.n102, label %._crit_edge57, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.055.ph = phi i32 [ %65, %iter.check ], [ %65, %vector.memcheck ], [ %ind.end85, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.03154.ph = phi ptr [ %.039.lcssa, %iter.check ], [ %.039.lcssa, %vector.memcheck ], [ %ind.end87, %vec.epilog.iter.check ], [ %ind.end86, %vec.epilog.middle.block ]
  %.03253.ph = phi ptr [ %10, %iter.check ], [ %10, %vector.memcheck ], [ %ind.end90, %vec.epilog.iter.check ], [ %ind.end89, %vec.epilog.middle.block ]
  %.03352.ph = phi ptr [ %.038.lcssa, %iter.check ], [ %.038.lcssa, %vector.memcheck ], [ %ind.end93, %vec.epilog.iter.check ], [ %ind.end92, %vec.epilog.middle.block ]
  %80 = 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.ph.prol.loopexit, label %.lr.ph.prol

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

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.055.unr = phi i32 [ %.055.ph, %.lr.ph.preheader ], [ %87, %.lr.ph.prol ]
  %.03154.unr = phi ptr [ %.03154.ph, %.lr.ph.preheader ], [ %81, %.lr.ph.prol ]
  %.03253.unr = phi ptr [ %.03253.ph, %.lr.ph.preheader ], [ %83, %.lr.ph.prol ]
  %.03352.unr = phi ptr [ %.03352.ph, %.lr.ph.preheader ], [ %86, %.lr.ph.prol ]
  %88 = icmp ult i32 %80, 3
  br i1 %88, label %._crit_edge57, label %.lr.ph

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

._crit_edge57:                                    ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %vec.epilog.middle.block, %._crit_edge
  %114 = getelementptr inbounds [40 x i8], ptr %10, i64 0, i64 %.040.lcssa
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = xor i8 %115, -128
  store i8 %116, ptr %114, align 1, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %10, i64 39
  %118 = load i8, ptr %117, align 1, !tbaa !9
  %119 = xor i8 %118, 2
  store i8 %119, ptr %117, align 1, !tbaa !9
  call void @sliscp_light320_permute(ptr noundef nonnull %10) #3
  %120 = getelementptr inbounds i8, ptr %.038.lcssa, i64 %.040.lcssa
  call void @ace_finalize(ptr noundef nonnull %10, ptr noundef %8, ptr noundef %120)
  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

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