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

; 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 @wage_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 [37 x i8], align 16
  %21 = alloca [16 x i8], align 16
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  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 37, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %32, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = load i64, ptr %15, align 8, !tbaa !9
  %35 = icmp ult i64 %34, 16
  br i1 %35, label %36, label %37

36:                                               ; preds = %9
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %167

37:                                               ; preds = %9
  %38 = load i64, ptr %15, align 8, !tbaa !9
  %39 = sub i64 %38, 16
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %39, ptr %40, align 8, !tbaa !9
  %41 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %42 = load ptr, ptr %19, align 8, !tbaa !5
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  call void @wage_init(ptr noundef %41, ptr noundef %42, ptr noundef %43)
  %44 = load i64, ptr %17, align 8, !tbaa !9
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %51

46:                                               ; preds = %37
  %47 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %48 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  %50 = load i64, ptr %17, align 8, !tbaa !9
  call void @wage_process_ad(ptr noundef %47, ptr noundef %48, ptr noundef %49, i64 noundef %50)
  br label %51

51:                                               ; preds = %46, %37
  %52 = load i64, ptr %15, align 8, !tbaa !9
  %53 = sub i64 %52, 16
  store i64 %53, ptr %15, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %81, %51
  %55 = load i64, ptr %15, align 8, !tbaa !9
  %56 = icmp uge i64 %55, 8
  br i1 %56, label %57, label %98

57:                                               ; preds = %54
  %58 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %59 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @wage_get_rate(ptr noundef %58, ptr noundef %59)
  br label %60

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %61 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %61, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %62, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 8, ptr %27, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %66, %60
  %64 = load i32, ptr %27, align 4, !tbaa !11
  %65 = icmp ugt i32 %64, 0
  br i1 %65, label %66, label %79

66:                                               ; preds = %63
  %67 = load ptr, ptr %26, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i32 1
  store ptr %68, ptr %26, align 8, !tbaa !5
  %69 = load i8, ptr %67, align 1, !tbaa !13
  %70 = zext i8 %69 to i32
  %71 = load ptr, ptr %25, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i32 1
  store ptr %72, ptr %25, align 8, !tbaa !5
  %73 = load i8, ptr %71, align 1, !tbaa !13
  %74 = zext i8 %73 to i32
  %75 = xor i32 %74, %70
  %76 = trunc i32 %75 to i8
  store i8 %76, ptr %71, 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
  br label %63, !llvm.loop !14

79:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  %82 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  call void @wage_set_rate(ptr noundef %82, ptr noundef %83)
  %84 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %85 = load i8, ptr %84, align 16, !tbaa !13
  %86 = zext i8 %85 to i32
  %87 = xor i32 %86, 32
  %88 = trunc i32 %87 to i8
  store i8 %88, ptr %84, align 16, !tbaa !13
  %89 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  call void @wage_permute(ptr noundef %89)
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %90, ptr align 16 %91, i64 8, i1 false)
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 8
  store ptr %93, ptr %14, align 8, !tbaa !5
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 8
  store ptr %95, ptr %11, align 8, !tbaa !5
  %96 = load i64, ptr %15, align 8, !tbaa !9
  %97 = sub i64 %96, 8
  store i64 %97, ptr %15, align 8, !tbaa !9
  br label %54, !llvm.loop !16

98:                                               ; preds = %54
  %99 = load i64, ptr %15, align 8, !tbaa !9
  %100 = trunc i64 %99 to i32
  store i32 %100, ptr %23, align 4, !tbaa !11
  %101 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %102 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @wage_get_rate(ptr noundef %101, ptr noundef %102)
  br label %103

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %104 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %105 = getelementptr inbounds i8, ptr %104, i64 8
  store ptr %105, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %106 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %106, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %107, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  %108 = load i32, ptr %23, align 4, !tbaa !11
  store i32 %108, ptr %31, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %112, %103
  %110 = load i32, ptr %31, align 4, !tbaa !11
  %111 = icmp ugt i32 %110, 0
  br i1 %111, label %112, label %127

112:                                              ; preds = %109
  %113 = load ptr, ptr %29, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i32 1
  store ptr %114, ptr %29, align 8, !tbaa !5
  %115 = load i8, ptr %113, align 1, !tbaa !13
  %116 = zext i8 %115 to i32
  %117 = load ptr, ptr %30, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i32 1
  store ptr %118, ptr %30, align 8, !tbaa !5
  %119 = load i8, ptr %117, align 1, !tbaa !13
  %120 = zext i8 %119 to i32
  %121 = xor i32 %116, %120
  %122 = trunc i32 %121 to i8
  %123 = load ptr, ptr %28, align 8, !tbaa !5
  %124 = getelementptr inbounds i8, ptr %123, i32 1
  store ptr %124, ptr %28, align 8, !tbaa !5
  store i8 %122, ptr %123, align 1, !tbaa !13
  %125 = load i32, ptr %31, align 4, !tbaa !11
  %126 = add i32 %125, -1
  store i32 %126, ptr %31, align 4, !tbaa !11
  br label %109, !llvm.loop !17

127:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = load i32, ptr %23, align 4, !tbaa !11
  %133 = zext i32 %132 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %130, ptr align 1 %131, i64 %133, i1 false)
  %134 = load i32, ptr %23, align 4, !tbaa !11
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 %135
  %137 = load i8, ptr %136, align 1, !tbaa !13
  %138 = zext i8 %137 to i32
  %139 = xor i32 %138, 128
  %140 = trunc i32 %139 to i8
  store i8 %140, ptr %136, align 1, !tbaa !13
  %141 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %142 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @wage_set_rate(ptr noundef %141, ptr noundef %142)
  %143 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %144 = load i8, ptr %143, align 16, !tbaa !13
  %145 = zext i8 %144 to i32
  %146 = xor i32 %145, 32
  %147 = trunc i32 %146 to i8
  store i8 %147, ptr %143, align 16, !tbaa !13
  %148 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  call void @wage_permute(ptr noundef %148)
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %151 = getelementptr inbounds i8, ptr %150, i64 8
  %152 = load i32, ptr %23, align 4, !tbaa !11
  %153 = zext i32 %152 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %149, ptr align 1 %151, i64 %153, i1 false)
  %154 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %155 = load ptr, ptr %19, align 8, !tbaa !5
  call void @wage_absorb_key(ptr noundef %154, ptr noundef %155)
  %156 = getelementptr inbounds [37 x i8], ptr %20, i64 0, i64 0
  %157 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @wage_extract_tag(ptr noundef %156, ptr noundef %157)
  %158 = load ptr, ptr %22, align 8, !tbaa !5
  %159 = load ptr, ptr %12, align 8, !tbaa !5
  %160 = load i64, ptr %159, align 8, !tbaa !9
  %161 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  %163 = load i32, ptr %23, align 4, !tbaa !11
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds i8, ptr %162, i64 %164
  %166 = call i32 @aead_check_tag(ptr noundef %158, i64 noundef %160, ptr noundef %161, ptr noundef %165, i32 noundef 16)
  store i32 %166, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %167

167:                                              ; preds = %129, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 37, ptr %20) #4
  %168 = load i32, ptr %10, align 4
  ret i32 %168
}

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

declare void @wage_init(ptr noundef, ptr noundef, ptr noundef) #2

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

declare void @wage_get_rate(ptr noundef, ptr noundef) #2

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

declare void @wage_set_rate(ptr noundef, ptr noundef) #2

declare void @wage_permute(ptr noundef) #2

; 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) #3

declare void @wage_absorb_key(ptr noundef, ptr noundef) #2

declare void @wage_extract_tag(ptr noundef, ptr noundef) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 @wage_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 [37 x i8], align 16
  %11 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 37, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  %12 = icmp ult i64 %4, 16
  br i1 %12, label %81, label %13

13:                                               ; preds = %9
  %14 = add i64 %4, -16
  store i64 %14, ptr %1, align 8, !tbaa !5
  call void @wage_init(ptr noundef nonnull %10, ptr noundef %8, ptr noundef %7) #4
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %16, label %15

15:                                               ; preds = %13
  call void @wage_process_ad(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %5, i64 noundef %6)
  br label %16

16:                                               ; preds = %15, %13
  %17 = icmp ugt i64 %14, 7
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16, %.lr.ph
  %.04759 = phi ptr [ %25, %.lr.ph ], [ %0, %16 ]
  %.04858 = phi ptr [ %24, %.lr.ph ], [ %3, %16 ]
  %.04957 = phi i64 [ %26, %.lr.ph ], [ %14, %16 ]
  call void @wage_get_rate(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %18 = load <8 x i8>, ptr %.04858, align 1, !tbaa !9
  %19 = load <8 x i8>, ptr %11, align 16, !tbaa !9
  %20 = xor <8 x i8> %19, %18
  store <8 x i8> %20, ptr %11, align 16, !tbaa !9
  call void @wage_set_rate(ptr noundef nonnull %10, ptr noundef nonnull %.04858) #4
  %21 = load i8, ptr %10, align 16, !tbaa !9
  %22 = xor i8 %21, 32
  store i8 %22, ptr %10, align 16, !tbaa !9
  call void @wage_permute(ptr noundef nonnull %10) #4
  %23 = load i64, ptr %11, align 16
  store i64 %23, ptr %.04759, align 1
  %24 = getelementptr inbounds i8, ptr %.04858, i64 8
  %25 = getelementptr inbounds i8, ptr %.04759, i64 8
  %26 = add i64 %.04957, -8
  %27 = icmp ugt i64 %26, 7
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %16
  %.049.lcssa = phi i64 [ %14, %16 ], [ %26, %.lr.ph ]
  %.048.lcssa = phi ptr [ %3, %16 ], [ %24, %.lr.ph ]
  %.047.lcssa = phi ptr [ %0, %16 ], [ %25, %.lr.ph ]
  call void @wage_get_rate(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %28 = getelementptr inbounds i8, ptr %11, i64 8
  %.not5262 = icmp eq i64 %.049.lcssa, 0
  br i1 %.not5262, label %._crit_edge69, label %.lr.ph68.preheader

.lr.ph68.preheader:                               ; preds = %._crit_edge
  %29 = trunc nuw i64 %.049.lcssa to i32
  %30 = add nuw nsw i64 %.049.lcssa, 4294967295
  %31 = and i64 %30, 4294967295
  %32 = add nuw nsw i64 %31, 1
  %min.iters.check = icmp ult i64 %31, 15
  br i1 %min.iters.check, label %.lr.ph68.preheader86, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph68.preheader
  %33 = add nuw nsw i64 %.049.lcssa, 4294967295
  %34 = and i64 %33, 4294967295
  %35 = getelementptr i8, ptr %11, i64 %34
  %scevgep = getelementptr i8, ptr %35, i64 9
  %36 = add nuw nsw i64 %34, 1
  %scevgep76 = getelementptr i8, ptr %.048.lcssa, i64 %36
  %bound0 = icmp ult ptr %11, %scevgep76
  %bound1 = icmp ult ptr %.048.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph68.preheader86, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %32, 8589934584
  %.cast = trunc i64 %n.vec to i32
  %ind.end = sub i32 %29, %.cast
  %ind.end77 = getelementptr i8, ptr %.048.lcssa, i64 %n.vec
  %ind.end79 = getelementptr i8, ptr %11, i64 %n.vec
  %ind.end81 = getelementptr i8, ptr %28, i64 %n.vec
  %load_initial = load <8 x i8>, ptr %11, align 16
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %store_forwarded = phi <8 x i8> [ %load_initial, %vector.ph ], [ %37, %vector.body ]
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %next.gep = getelementptr i8, ptr %.048.lcssa, i64 %index
  %next.gep84 = getelementptr i8, ptr %28, i64 %index
  %wide.load85 = load <8 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %37 = xor <8 x i8> %wide.load85, %store_forwarded
  store <8 x i8> %37, ptr %next.gep84, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 8
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %32, %n.vec
  br i1 %cmp.n, label %._crit_edge69, label %.lr.ph68.preheader86

.lr.ph68.preheader86:                             ; preds = %middle.block, %vector.memcheck, %.lr.ph68.preheader
  %.066.ph = phi i32 [ %29, %vector.memcheck ], [ %29, %.lr.ph68.preheader ], [ %ind.end, %middle.block ]
  %.04065.ph = phi ptr [ %.048.lcssa, %vector.memcheck ], [ %.048.lcssa, %.lr.ph68.preheader ], [ %ind.end77, %middle.block ]
  %.04164.ph = phi ptr [ %11, %vector.memcheck ], [ %11, %.lr.ph68.preheader ], [ %ind.end79, %middle.block ]
  %.04263.ph = phi ptr [ %28, %vector.memcheck ], [ %28, %.lr.ph68.preheader ], [ %ind.end81, %middle.block ]
  %39 = add nsw i32 %.066.ph, -1
  %xtraiter = and i32 %.066.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph68.prol.loopexit, label %.lr.ph68.prol

.lr.ph68.prol:                                    ; preds = %.lr.ph68.preheader86, %.lr.ph68.prol
  %.066.prol = phi i32 [ %46, %.lr.ph68.prol ], [ %.066.ph, %.lr.ph68.preheader86 ]
  %.04065.prol = phi ptr [ %42, %.lr.ph68.prol ], [ %.04065.ph, %.lr.ph68.preheader86 ]
  %.04164.prol = phi ptr [ %40, %.lr.ph68.prol ], [ %.04164.ph, %.lr.ph68.preheader86 ]
  %.04263.prol = phi ptr [ %45, %.lr.ph68.prol ], [ %.04263.ph, %.lr.ph68.preheader86 ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph68.prol ], [ 0, %.lr.ph68.preheader86 ]
  %40 = getelementptr inbounds i8, ptr %.04164.prol, i64 1
  %41 = load i8, ptr %.04164.prol, align 1, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %.04065.prol, i64 1
  %43 = load i8, ptr %.04065.prol, align 1, !tbaa !9
  %44 = xor i8 %43, %41
  %45 = getelementptr inbounds i8, ptr %.04263.prol, i64 1
  store i8 %44, ptr %.04263.prol, align 1, !tbaa !9
  %46 = add nsw i32 %.066.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.ph68.prol.loopexit, label %.lr.ph68.prol, !llvm.loop !20

.lr.ph68.prol.loopexit:                           ; preds = %.lr.ph68.prol, %.lr.ph68.preheader86
  %.066.unr = phi i32 [ %.066.ph, %.lr.ph68.preheader86 ], [ %46, %.lr.ph68.prol ]
  %.04065.unr = phi ptr [ %.04065.ph, %.lr.ph68.preheader86 ], [ %42, %.lr.ph68.prol ]
  %.04164.unr = phi ptr [ %.04164.ph, %.lr.ph68.preheader86 ], [ %40, %.lr.ph68.prol ]
  %.04263.unr = phi ptr [ %.04263.ph, %.lr.ph68.preheader86 ], [ %45, %.lr.ph68.prol ]
  %47 = icmp ult i32 %39, 3
  br i1 %47, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %.lr.ph68.prol.loopexit, %.lr.ph68
  %.066 = phi i32 [ %72, %.lr.ph68 ], [ %.066.unr, %.lr.ph68.prol.loopexit ]
  %.04065 = phi ptr [ %68, %.lr.ph68 ], [ %.04065.unr, %.lr.ph68.prol.loopexit ]
  %.04164 = phi ptr [ %66, %.lr.ph68 ], [ %.04164.unr, %.lr.ph68.prol.loopexit ]
  %.04263 = phi ptr [ %71, %.lr.ph68 ], [ %.04263.unr, %.lr.ph68.prol.loopexit ]
  %48 = getelementptr inbounds i8, ptr %.04164, i64 1
  %49 = load i8, ptr %.04164, align 1, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %.04065, i64 1
  %51 = load i8, ptr %.04065, align 1, !tbaa !9
  %52 = xor i8 %51, %49
  %53 = getelementptr inbounds i8, ptr %.04263, i64 1
  store i8 %52, ptr %.04263, align 1, !tbaa !9
  %54 = getelementptr inbounds i8, ptr %.04164, i64 2
  %55 = load i8, ptr %48, align 1, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %.04065, i64 2
  %57 = load i8, ptr %50, align 1, !tbaa !9
  %58 = xor i8 %57, %55
  %59 = getelementptr inbounds i8, ptr %.04263, i64 2
  store i8 %58, ptr %53, align 1, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %.04164, i64 3
  %61 = load i8, ptr %54, align 1, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %.04065, i64 3
  %63 = load i8, ptr %56, align 1, !tbaa !9
  %64 = xor i8 %63, %61
  %65 = getelementptr inbounds i8, ptr %.04263, i64 3
  store i8 %64, ptr %59, align 1, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %.04164, i64 4
  %67 = load i8, ptr %60, align 1, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %.04065, i64 4
  %69 = load i8, ptr %62, align 1, !tbaa !9
  %70 = xor i8 %69, %67
  %71 = getelementptr inbounds i8, ptr %.04263, i64 4
  store i8 %70, ptr %65, align 1, !tbaa !9
  %72 = add nsw i32 %.066, -4
  %.not52.3 = icmp eq i32 %72, 0
  br i1 %.not52.3, label %._crit_edge69, label %.lr.ph68, !llvm.loop !22

._crit_edge69:                                    ; preds = %.lr.ph68.prol.loopexit, %.lr.ph68, %middle.block, %._crit_edge
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %11, ptr align 1 %.048.lcssa, i64 %.049.lcssa, i1 false)
  %73 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 %.049.lcssa
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %75 = xor i8 %74, -128
  store i8 %75, ptr %73, align 1, !tbaa !9
  call void @wage_set_rate(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %76 = load i8, ptr %10, align 16, !tbaa !9
  %77 = xor i8 %76, 32
  store i8 %77, ptr %10, align 16, !tbaa !9
  call void @wage_permute(ptr noundef nonnull %10) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.047.lcssa, ptr nonnull align 8 %28, i64 %.049.lcssa, i1 false)
  call void @wage_absorb_key(ptr noundef nonnull %10, ptr noundef %8) #4
  call void @wage_extract_tag(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %78 = load i64, ptr %1, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %.048.lcssa, i64 %.049.lcssa
  %80 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %78, ptr noundef nonnull %11, ptr noundef %79, i32 noundef 16) #4
  br label %81

81:                                               ; preds = %9, %._crit_edge69
  %.046 = phi i32 [ %80, %._crit_edge69 ], [ -1, %9 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 37, ptr nonnull %10) #4
  ret i32 %.046
}

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

declare void @wage_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @wage_get_rate(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @wage_set_rate(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @wage_permute(ptr noundef) local_unnamed_addr #2

; 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) #3

declare void @wage_absorb_key(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @wage_extract_tag(ptr noundef, ptr noundef) local_unnamed_addr #2

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = distinct !{!17, !11, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !11, !18}


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