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

; 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 @photon_beetle_hash(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca [32 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %18 = load i64, ptr %6, align 8, !tbaa !9
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %20, label %23

20:                                               ; preds = %3
  %21 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 31, i1 false)
  %22 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  store i8 32, ptr %22, align 1, !tbaa !11
  br label %163

23:                                               ; preds = %3
  %24 = load i64, ptr %6, align 8, !tbaa !9
  %25 = icmp ule i64 %24, 16
  br i1 %25, label %26, label %51

26:                                               ; preds = %23
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr %8, align 4, !tbaa !12
  %29 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !12
  %32 = zext i32 %31 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 1 %30, i64 %32, i1 false)
  %33 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %34 = load i32, ptr %8, align 4, !tbaa !12
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %33, i64 %35
  %37 = load i32, ptr %8, align 4, !tbaa !12
  %38 = zext i32 %37 to i64
  %39 = sub i64 32, %38
  %40 = sub i64 %39, 1
  call void @llvm.memset.p0.i64(ptr align 1 %36, i8 0, i64 %40, i1 false)
  %41 = load i32, ptr %8, align 4, !tbaa !12
  %42 = icmp ult i32 %41, 16
  br i1 %42, label %43, label %48

43:                                               ; preds = %26
  %44 = load i32, ptr %8, align 4, !tbaa !12
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %45
  store i8 1, ptr %46, align 1, !tbaa !11
  %47 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  store i8 32, ptr %47, align 1, !tbaa !11
  br label %50

48:                                               ; preds = %26
  %49 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  store i8 64, ptr %49, align 1, !tbaa !11
  br label %50

50:                                               ; preds = %48, %43
  br label %162

51:                                               ; preds = %23
  %52 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %52, ptr align 1 %53, i64 16, i1 false)
  %54 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  call void @llvm.memset.p0.i64(ptr align 1 %55, i8 0, i64 16, i1 false)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store ptr %57, ptr %5, align 8, !tbaa !5
  %58 = load i64, ptr %6, align 8, !tbaa !9
  %59 = sub i64 %58, 16
  store i64 %59, ptr %6, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %86, %51
  %61 = load i64, ptr %6, align 8, !tbaa !9
  %62 = icmp ugt i64 %61, 4
  br i1 %62, label %63, label %91

63:                                               ; preds = %60
  %64 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @photon256_permute(ptr noundef %64)
  br label %65

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %66 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  store ptr %66, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %67, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 4, ptr %11, align 4, !tbaa !12
  br label %68

68:                                               ; preds = %71, %65
  %69 = load i32, ptr %11, align 4, !tbaa !12
  %70 = icmp ugt i32 %69, 0
  br i1 %70, label %71, label %84

71:                                               ; preds = %68
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i32 1
  store ptr %73, ptr %10, align 8, !tbaa !5
  %74 = load i8, ptr %72, align 1, !tbaa !11
  %75 = zext i8 %74 to i32
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i32 1
  store ptr %77, ptr %9, align 8, !tbaa !5
  %78 = load i8, ptr %76, align 1, !tbaa !11
  %79 = zext i8 %78 to i32
  %80 = xor i32 %79, %75
  %81 = trunc i32 %80 to i8
  store i8 %81, ptr %76, align 1, !tbaa !11
  %82 = load i32, ptr %11, align 4, !tbaa !12
  %83 = add i32 %82, -1
  store i32 %83, ptr %11, align 4, !tbaa !12
  br label %68, !llvm.loop !14

84:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 4
  store ptr %88, ptr %5, align 8, !tbaa !5
  %89 = load i64, ptr %6, align 8, !tbaa !9
  %90 = sub i64 %89, 4
  store i64 %90, ptr %6, align 8, !tbaa !9
  br label %60, !llvm.loop !16

91:                                               ; preds = %60
  %92 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @photon256_permute(ptr noundef %92)
  %93 = load i64, ptr %6, align 8, !tbaa !9
  %94 = trunc i64 %93 to i32
  store i32 %94, ptr %8, align 4, !tbaa !12
  %95 = load i32, ptr %8, align 4, !tbaa !12
  %96 = icmp eq i32 %95, 4
  br i1 %96, label %97, label %125

97:                                               ; preds = %91
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %99 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  store ptr %99, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %100, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 4, ptr %14, align 4, !tbaa !12
  br label %101

101:                                              ; preds = %104, %98
  %102 = load i32, ptr %14, align 4, !tbaa !12
  %103 = icmp ugt i32 %102, 0
  br i1 %103, label %104, label %117

104:                                              ; preds = %101
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %105, i32 1
  store ptr %106, ptr %13, align 8, !tbaa !5
  %107 = load i8, ptr %105, align 1, !tbaa !11
  %108 = zext i8 %107 to i32
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i32 1
  store ptr %110, ptr %12, align 8, !tbaa !5
  %111 = load i8, ptr %109, align 1, !tbaa !11
  %112 = zext i8 %111 to i32
  %113 = xor i32 %112, %108
  %114 = trunc i32 %113 to i8
  store i8 %114, ptr %109, align 1, !tbaa !11
  %115 = load i32, ptr %14, align 4, !tbaa !12
  %116 = add i32 %115, -1
  store i32 %116, ptr %14, align 4, !tbaa !12
  br label %101, !llvm.loop !17

117:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118
  %120 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  %121 = load i8, ptr %120, align 1, !tbaa !11
  %122 = zext i8 %121 to i32
  %123 = xor i32 %122, 32
  %124 = trunc i32 %123 to i8
  store i8 %124, ptr %120, align 1, !tbaa !11
  br label %161

125:                                              ; preds = %91
  br label %126

126:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %127 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  store ptr %127, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %128, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %129 = load i32, ptr %8, align 4, !tbaa !12
  store i32 %129, ptr %17, align 4, !tbaa !12
  br label %130

130:                                              ; preds = %133, %126
  %131 = load i32, ptr %17, align 4, !tbaa !12
  %132 = icmp ugt i32 %131, 0
  br i1 %132, label %133, label %146

133:                                              ; preds = %130
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i32 1
  store ptr %135, ptr %16, align 8, !tbaa !5
  %136 = load i8, ptr %134, align 1, !tbaa !11
  %137 = zext i8 %136 to i32
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i32 1
  store ptr %139, ptr %15, align 8, !tbaa !5
  %140 = load i8, ptr %138, align 1, !tbaa !11
  %141 = zext i8 %140 to i32
  %142 = xor i32 %141, %137
  %143 = trunc i32 %142 to i8
  store i8 %143, ptr %138, align 1, !tbaa !11
  %144 = load i32, ptr %17, align 4, !tbaa !12
  %145 = add i32 %144, -1
  store i32 %145, ptr %17, align 4, !tbaa !12
  br label %130, !llvm.loop !18

146:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %8, align 4, !tbaa !12
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %150
  %152 = load i8, ptr %151, align 1, !tbaa !11
  %153 = zext i8 %152 to i32
  %154 = xor i32 %153, 1
  %155 = trunc i32 %154 to i8
  store i8 %155, ptr %151, align 1, !tbaa !11
  %156 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  %157 = load i8, ptr %156, align 1, !tbaa !11
  %158 = zext i8 %157 to i32
  %159 = xor i32 %158, 64
  %160 = trunc i32 %159 to i8
  store i8 %160, ptr %156, align 1, !tbaa !11
  br label %161

161:                                              ; preds = %148, %119
  br label %162

162:                                              ; preds = %161, %50
  br label %163

163:                                              ; preds = %162, %20
  %164 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @photon256_permute(ptr noundef %164)
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %165, ptr align 16 %166, i64 16, i1 false)
  %167 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @photon256_permute(ptr noundef %167)
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i64 16
  %170 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %169, ptr align 16 %170, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @photon256_permute(ptr noundef) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !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 @photon_beetle_hash(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %5 = icmp eq i64 %2, 0
  br i1 %5, label %6, label %8

6:                                                ; preds = %3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(31) %4, i8 0, i64 31, i1 false)
  %7 = getelementptr inbounds i8, ptr %4, i64 31
  store i8 32, ptr %7, align 1, !tbaa !5
  br label %84

8:                                                ; preds = %3
  %9 = icmp ult i64 %2, 17
  br i1 %9, label %10, label %17

10:                                               ; preds = %8
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %4, ptr align 1 %1, i64 %2, i1 false)
  %11 = getelementptr inbounds i8, ptr %4, i64 %2
  %12 = sub nuw nsw i64 31, %2
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %11, i8 0, i64 %12, i1 false)
  %.not49 = icmp eq i64 %2, 16
  br i1 %.not49, label %15, label %13

13:                                               ; preds = %10
  store i8 1, ptr %11, align 1, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %4, i64 31
  store i8 32, ptr %14, align 1, !tbaa !5
  br label %84

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %4, i64 31
  store i8 64, ptr %16, align 1, !tbaa !5
  br label %84

17:                                               ; preds = %8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 1 dereferenceable(16) %1, i64 16, i1 false)
  %18 = getelementptr inbounds i8, ptr %4, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %18, i8 0, i64 16, i1 false)
  %19 = getelementptr inbounds i8, ptr %1, i64 16
  %20 = add i64 %2, -16
  %21 = icmp ugt i64 %20, 4
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %17, %.lr.ph
  %.04354 = phi i64 [ %26, %.lr.ph ], [ %20, %17 ]
  %.04453 = phi ptr [ %25, %.lr.ph ], [ %19, %17 ]
  call void @photon256_permute(ptr noundef nonnull %4) #5
  %22 = load <4 x i8>, ptr %.04453, align 1, !tbaa !5
  %23 = load <4 x i8>, ptr %4, align 16, !tbaa !5
  %24 = xor <4 x i8> %23, %22
  store <4 x i8> %24, ptr %4, align 16, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %.04453, i64 4
  %26 = add i64 %.04354, -4
  %27 = icmp ugt i64 %26, 4
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph, %17
  %.044.lcssa = phi ptr [ %19, %17 ], [ %25, %.lr.ph ]
  %.043.lcssa = phi i64 [ %20, %17 ], [ %26, %.lr.ph ]
  call void @photon256_permute(ptr noundef nonnull %4) #5
  %28 = icmp eq i64 %.043.lcssa, 4
  br i1 %28, label %.preheader.preheader, label %iter.check

.preheader.preheader:                             ; preds = %._crit_edge
  %29 = load <4 x i8>, ptr %.044.lcssa, align 1, !tbaa !5
  %30 = load <4 x i8>, ptr %4, align 16, !tbaa !5
  %31 = xor <4 x i8> %30, %29
  store <4 x i8> %31, ptr %4, align 16, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %4, i64 31
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = xor i8 %33, 32
  store i8 %34, ptr %32, align 1, !tbaa !5
  br label %84

iter.check:                                       ; preds = %._crit_edge
  %35 = trunc nuw i64 %.043.lcssa to i32
  %36 = add nuw nsw i64 %.043.lcssa, 4294967295
  %37 = and i64 %36, 4294967295
  %38 = add nuw nsw i64 %37, 1
  %min.iters.check = icmp ult i64 %37, 7
  br i1 %min.iters.check, label %.lr.ph61.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %39 = add nuw nsw i64 %.043.lcssa, 4294967295
  %40 = and i64 %39, 4294967295
  %41 = add nuw nsw i64 %40, 1
  %scevgep = getelementptr i8, ptr %4, i64 %41
  %scevgep69 = getelementptr i8, ptr %.044.lcssa, i64 %41
  %bound0 = icmp ult ptr %4, %scevgep69
  %bound1 = icmp ult ptr %.044.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph61.preheader, label %vector.main.loop.iter.check

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

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %38, 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 %.044.lcssa, i64 %index
  %next.gep72 = getelementptr i8, ptr %4, i64 %index
  %42 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !5, !alias.scope !10
  %wide.load74 = load <16 x i8>, ptr %42, align 1, !tbaa !5, !alias.scope !10
  %43 = getelementptr i8, ptr %next.gep72, i64 16
  %wide.load75 = load <16 x i8>, ptr %next.gep72, align 16, !tbaa !5, !alias.scope !13, !noalias !10
  %wide.load76 = load <16 x i8>, ptr %43, align 16, !tbaa !5, !alias.scope !13, !noalias !10
  %44 = xor <16 x i8> %wide.load75, %wide.load
  %45 = xor <16 x i8> %wide.load76, %wide.load74
  store <16 x i8> %44, ptr %next.gep72, align 16, !tbaa !5, !alias.scope !13, !noalias !10
  store <16 x i8> %45, ptr %43, align 16, !tbaa !5, !alias.scope !13, !noalias !10
  %index.next = add nuw i64 %index, 32
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !15

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end85 = getelementptr i8, ptr %4, i64 %n.vec
  %ind.end82 = getelementptr i8, ptr %.044.lcssa, i64 %n.vec
  %.cast79 = trunc i64 %n.vec to i32
  %ind.end80 = sub i32 %35, %.cast79
  %n.vec.remaining = and i64 %38, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph61.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.vec78 = and i64 %38, 8589934584
  %.cast = trunc i64 %n.vec78 to i32
  %ind.end = sub i32 %35, %.cast
  %ind.end81 = getelementptr i8, ptr %.044.lcssa, i64 %n.vec78
  %ind.end84 = getelementptr i8, ptr %4, i64 %n.vec78
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index87 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next92, %vec.epilog.vector.body ]
  %next.gep88 = getelementptr i8, ptr %.044.lcssa, i64 %index87
  %next.gep89 = getelementptr i8, ptr %4, i64 %index87
  %wide.load90 = load <8 x i8>, ptr %next.gep88, align 1, !tbaa !5, !alias.scope !18
  %wide.load91 = load <8 x i8>, ptr %next.gep89, align 8, !tbaa !5, !alias.scope !21, !noalias !18
  %47 = xor <8 x i8> %wide.load91, %wide.load90
  store <8 x i8> %47, ptr %next.gep89, align 8, !tbaa !5, !alias.scope !21, !noalias !18
  %index.next92 = add nuw i64 %index87, 8
  %48 = icmp eq i64 %index.next92, %n.vec78
  br i1 %48, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !23

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n93 = icmp eq i64 %38, %n.vec78
  br i1 %cmp.n93, label %._crit_edge62, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.059.ph = phi i32 [ %35, %iter.check ], [ %35, %vector.memcheck ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.03558.ph = phi ptr [ %.044.lcssa, %iter.check ], [ %.044.lcssa, %vector.memcheck ], [ %ind.end82, %vec.epilog.iter.check ], [ %ind.end81, %vec.epilog.middle.block ]
  %.03657.ph = phi ptr [ %4, %iter.check ], [ %4, %vector.memcheck ], [ %ind.end85, %vec.epilog.iter.check ], [ %ind.end84, %vec.epilog.middle.block ]
  %49 = add nsw i32 %.059.ph, -1
  %xtraiter = and i32 %.059.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph61.prol.loopexit, label %.lr.ph61.prol

.lr.ph61.prol:                                    ; preds = %.lr.ph61.preheader, %.lr.ph61.prol
  %.059.prol = phi i32 [ %55, %.lr.ph61.prol ], [ %.059.ph, %.lr.ph61.preheader ]
  %.03558.prol = phi ptr [ %50, %.lr.ph61.prol ], [ %.03558.ph, %.lr.ph61.preheader ]
  %.03657.prol = phi ptr [ %52, %.lr.ph61.prol ], [ %.03657.ph, %.lr.ph61.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph61.prol ], [ 0, %.lr.ph61.preheader ]
  %50 = getelementptr inbounds i8, ptr %.03558.prol, i64 1
  %51 = load i8, ptr %.03558.prol, align 1, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %.03657.prol, i64 1
  %53 = load i8, ptr %.03657.prol, align 1, !tbaa !5
  %54 = xor i8 %53, %51
  store i8 %54, ptr %.03657.prol, align 1, !tbaa !5
  %55 = add nsw i32 %.059.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.ph61.prol.loopexit, label %.lr.ph61.prol, !llvm.loop !24

.lr.ph61.prol.loopexit:                           ; preds = %.lr.ph61.prol, %.lr.ph61.preheader
  %.059.unr = phi i32 [ %.059.ph, %.lr.ph61.preheader ], [ %55, %.lr.ph61.prol ]
  %.03558.unr = phi ptr [ %.03558.ph, %.lr.ph61.preheader ], [ %50, %.lr.ph61.prol ]
  %.03657.unr = phi ptr [ %.03657.ph, %.lr.ph61.preheader ], [ %52, %.lr.ph61.prol ]
  %56 = icmp ult i32 %49, 3
  br i1 %56, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %.lr.ph61.prol.loopexit, %.lr.ph61
  %.059 = phi i32 [ %77, %.lr.ph61 ], [ %.059.unr, %.lr.ph61.prol.loopexit ]
  %.03558 = phi ptr [ %72, %.lr.ph61 ], [ %.03558.unr, %.lr.ph61.prol.loopexit ]
  %.03657 = phi ptr [ %74, %.lr.ph61 ], [ %.03657.unr, %.lr.ph61.prol.loopexit ]
  %57 = getelementptr inbounds i8, ptr %.03558, i64 1
  %58 = load i8, ptr %.03558, align 1, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %.03657, i64 1
  %60 = load i8, ptr %.03657, align 1, !tbaa !5
  %61 = xor i8 %60, %58
  store i8 %61, ptr %.03657, align 1, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %.03558, i64 2
  %63 = load i8, ptr %57, align 1, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %.03657, i64 2
  %65 = load i8, ptr %59, align 1, !tbaa !5
  %66 = xor i8 %65, %63
  store i8 %66, ptr %59, align 1, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %.03558, i64 3
  %68 = load i8, ptr %62, align 1, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %.03657, i64 3
  %70 = load i8, ptr %64, align 1, !tbaa !5
  %71 = xor i8 %70, %68
  store i8 %71, ptr %64, align 1, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %.03558, i64 4
  %73 = load i8, ptr %67, align 1, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %.03657, i64 4
  %75 = load i8, ptr %69, align 1, !tbaa !5
  %76 = xor i8 %75, %73
  store i8 %76, ptr %69, align 1, !tbaa !5
  %77 = add nsw i32 %.059, -4
  %.not.3 = icmp eq i32 %77, 0
  br i1 %.not.3, label %._crit_edge62, label %.lr.ph61, !llvm.loop !26

._crit_edge62:                                    ; preds = %.lr.ph61.prol.loopexit, %.lr.ph61, %vec.epilog.middle.block, %middle.block
  %78 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 %.043.lcssa
  %79 = load i8, ptr %78, align 1, !tbaa !5
  %80 = xor i8 %79, 1
  store i8 %80, ptr %78, align 1, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %4, i64 31
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = xor i8 %82, 64
  store i8 %83, ptr %81, align 1, !tbaa !5
  br label %84

84:                                               ; preds = %15, %13, %._crit_edge62, %.preheader.preheader, %6
  call void @photon256_permute(ptr noundef nonnull %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %0, ptr noundef nonnull align 16 dereferenceable(16) %4, i64 16, i1 false)
  call void @photon256_permute(ptr noundef nonnull %4) #5
  %85 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %85, ptr noundef nonnull align 16 dereferenceable(16) %4, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @photon256_permute(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11}
!11 = distinct !{!11, !12}
!12 = distinct !{!12, !"LVerDomain"}
!13 = !{!14}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !9, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = !{!19}
!19 = distinct !{!19, !20}
!20 = distinct !{!20, !"LVerDomain"}
!21 = !{!22}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !9, !16, !17}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = distinct !{!26, !9, !16}


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