; 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_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 [37 x i8], align 16
  %20 = alloca [8 x i8], align 1
  %21 = alloca i32, align 4
  %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 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 37, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %28 = load ptr, ptr %16, align 8, !tbaa !5
  %29 = load i64, ptr %13, align 8, !tbaa !9
  %30 = add i64 %29, 16
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %30, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %33 = load ptr, ptr %18, align 8, !tbaa !5
  %34 = load ptr, ptr %17, align 8, !tbaa !5
  call void @wage_init(ptr noundef %32, ptr noundef %33, ptr noundef %34)
  %35 = load i64, ptr %15, align 8, !tbaa !9
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %42

37:                                               ; preds = %9
  %38 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %39 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = load i64, ptr %15, align 8, !tbaa !9
  call void @wage_process_ad(ptr noundef %38, ptr noundef %39, ptr noundef %40, i64 noundef %41)
  br label %42

42:                                               ; preds = %37, %9
  br label %43

43:                                               ; preds = %70, %42
  %44 = load i64, ptr %13, align 8, !tbaa !9
  %45 = icmp uge i64 %44, 8
  br i1 %45, label %46, label %87

46:                                               ; preds = %43
  %47 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %48 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  call void @wage_get_rate(ptr noundef %47, ptr noundef %48)
  br label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %50 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  store ptr %50, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %51, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 8, ptr %24, align 4, !tbaa !11
  br label %52

52:                                               ; preds = %55, %49
  %53 = load i32, ptr %24, align 4, !tbaa !11
  %54 = icmp ugt i32 %53, 0
  br i1 %54, label %55, label %68

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

68:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  %71 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %72 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  call void @wage_set_rate(ptr noundef %71, ptr noundef %72)
  %73 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %74 = load i8, ptr %73, align 16, !tbaa !13
  %75 = zext i8 %74 to i32
  %76 = xor i32 %75, 32
  %77 = trunc i32 %76 to i8
  store i8 %77, ptr %73, align 16, !tbaa !13
  %78 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  call void @wage_permute(ptr noundef %78)
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %79, ptr align 1 %80, i64 8, i1 false)
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 8
  store ptr %82, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  store ptr %84, ptr %12, align 8, !tbaa !5
  %85 = load i64, ptr %13, align 8, !tbaa !9
  %86 = sub i64 %85, 8
  store i64 %86, ptr %13, align 8, !tbaa !9
  br label %43, !llvm.loop !16

87:                                               ; preds = %43
  %88 = load i64, ptr %13, align 8, !tbaa !9
  %89 = trunc i64 %88 to i32
  store i32 %89, ptr %21, align 4, !tbaa !11
  %90 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %91 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  call void @wage_get_rate(ptr noundef %90, ptr noundef %91)
  br label %92

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %93 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  store ptr %93, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %94, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %95 = load i32, ptr %21, align 4, !tbaa !11
  store i32 %95, ptr %27, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %99, %92
  %97 = load i32, ptr %27, align 4, !tbaa !11
  %98 = icmp ugt i32 %97, 0
  br i1 %98, label %99, label %112

99:                                               ; preds = %96
  %100 = load ptr, ptr %26, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i32 1
  store ptr %101, ptr %26, align 8, !tbaa !5
  %102 = load i8, ptr %100, align 1, !tbaa !13
  %103 = zext i8 %102 to i32
  %104 = load ptr, ptr %25, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i32 1
  store ptr %105, ptr %25, align 8, !tbaa !5
  %106 = load i8, ptr %104, align 1, !tbaa !13
  %107 = zext i8 %106 to i32
  %108 = xor i32 %107, %103
  %109 = trunc i32 %108 to i8
  store i8 %109, ptr %104, align 1, !tbaa !13
  %110 = load i32, ptr %27, align 4, !tbaa !11
  %111 = add i32 %110, -1
  store i32 %111, ptr %27, align 4, !tbaa !11
  br label %96, !llvm.loop !17

112:                                              ; preds = %96
  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 %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %21, align 4, !tbaa !11
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !13
  %119 = zext i8 %118 to i32
  %120 = xor i32 %119, 128
  %121 = trunc i32 %120 to i8
  store i8 %121, ptr %117, align 1, !tbaa !13
  %122 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %123 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  call void @wage_set_rate(ptr noundef %122, ptr noundef %123)
  %124 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %125 = load i8, ptr %124, align 16, !tbaa !13
  %126 = zext i8 %125 to i32
  %127 = xor i32 %126, 32
  %128 = trunc i32 %127 to i8
  store i8 %128, ptr %124, align 16, !tbaa !13
  %129 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  call void @wage_permute(ptr noundef %129)
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds [8 x i8], ptr %20, i64 0, i64 0
  %132 = load i32, ptr %21, align 4, !tbaa !11
  %133 = zext i32 %132 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %130, ptr align 1 %131, i64 %133, i1 false)
  %134 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  call void @wage_absorb_key(ptr noundef %134, ptr noundef %135)
  %136 = getelementptr inbounds [37 x i8], ptr %19, i64 0, i64 0
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = load i32, ptr %21, align 4, !tbaa !11
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %137, i64 %139
  call void @wage_extract_tag(ptr noundef %136, ptr noundef %140)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 37, ptr %19) #4
  ret i32 0
}

; 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

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 noundef i32 @wage_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 [37 x i8], align 16
  %11 = alloca [8 x i8], align 8
  call void @llvm.lifetime.start.p0(i64 37, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %12 = add i64 %3, 16
  store i64 %12, 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 %5, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %9
  call void @wage_process_ad(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %4, i64 noundef %5)
  br label %14

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

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

._crit_edge:                                      ; preds = %.lr.ph, %14
  %.037.lcssa = phi i64 [ %3, %14 ], [ %24, %.lr.ph ]
  %.036.lcssa = phi ptr [ %2, %14 ], [ %23, %.lr.ph ]
  %.035.lcssa = phi ptr [ %0, %14 ], [ %22, %.lr.ph ]
  call void @wage_get_rate(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %.not3949 = icmp eq i64 %.037.lcssa, 0
  br i1 %.not3949, label %._crit_edge55, label %iter.check

iter.check:                                       ; preds = %._crit_edge
  %26 = trunc nuw i64 %.037.lcssa to i32
  %27 = add nuw nsw i64 %.037.lcssa, 4294967295
  %28 = and i64 %27, 4294967295
  %29 = add nuw nsw i64 %28, 1
  %min.iters.check = icmp ult i64 %28, 7
  br i1 %min.iters.check, label %.lr.ph54.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %30 = add nuw nsw i64 %.037.lcssa, 4294967295
  %31 = and i64 %30, 4294967295
  %32 = add nuw nsw i64 %31, 1
  %scevgep = getelementptr i8, ptr %11, i64 %32
  %scevgep62 = getelementptr i8, ptr %.036.lcssa, i64 %32
  %bound0 = icmp ult ptr %11, %scevgep62
  %bound1 = icmp ult ptr %.036.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph54.preheader, label %vector.main.loop.iter.check

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

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %29, 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 %.036.lcssa, i64 %index
  %next.gep65 = getelementptr i8, ptr %11, i64 %index
  %33 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !9, !alias.scope !12
  %wide.load67 = load <16 x i8>, ptr %33, align 1, !tbaa !9, !alias.scope !12
  %34 = getelementptr i8, ptr %next.gep65, i64 16
  %wide.load68 = load <16 x i8>, ptr %next.gep65, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %wide.load69 = load <16 x i8>, ptr %34, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %35 = xor <16 x i8> %wide.load68, %wide.load
  %36 = xor <16 x i8> %wide.load69, %wide.load67
  store <16 x i8> %35, ptr %next.gep65, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  store <16 x i8> %36, ptr %34, align 8, !tbaa !9, !alias.scope !15, !noalias !12
  %index.next = add nuw i64 %index, 32
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !17

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end78 = getelementptr i8, ptr %11, i64 %n.vec
  %ind.end75 = getelementptr i8, ptr %.036.lcssa, i64 %n.vec
  %.cast72 = trunc i64 %n.vec to i32
  %ind.end73 = sub i32 %26, %.cast72
  %n.vec.remaining = and i64 %29, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph54.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.vec71 = and i64 %29, 8589934584
  %.cast = trunc i64 %n.vec71 to i32
  %ind.end = sub i32 %26, %.cast
  %ind.end74 = getelementptr i8, ptr %.036.lcssa, i64 %n.vec71
  %ind.end77 = getelementptr i8, ptr %11, i64 %n.vec71
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index80 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next85, %vec.epilog.vector.body ]
  %next.gep81 = getelementptr i8, ptr %.036.lcssa, i64 %index80
  %next.gep82 = getelementptr i8, ptr %11, i64 %index80
  %wide.load83 = load <8 x i8>, ptr %next.gep81, align 1, !tbaa !9, !alias.scope !20
  %wide.load84 = load <8 x i8>, ptr %next.gep82, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  %38 = xor <8 x i8> %wide.load84, %wide.load83
  store <8 x i8> %38, ptr %next.gep82, align 8, !tbaa !9, !alias.scope !23, !noalias !20
  %index.next85 = add nuw i64 %index80, 8
  %39 = icmp eq i64 %index.next85, %n.vec71
  br i1 %39, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !25

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n86 = icmp eq i64 %29, %n.vec71
  br i1 %cmp.n86, label %._crit_edge55, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.052.ph = phi i32 [ %26, %iter.check ], [ %26, %vector.memcheck ], [ %ind.end73, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.03051.ph = phi ptr [ %.036.lcssa, %iter.check ], [ %.036.lcssa, %vector.memcheck ], [ %ind.end75, %vec.epilog.iter.check ], [ %ind.end74, %vec.epilog.middle.block ]
  %.03150.ph = phi ptr [ %11, %iter.check ], [ %11, %vector.memcheck ], [ %ind.end78, %vec.epilog.iter.check ], [ %ind.end77, %vec.epilog.middle.block ]
  %40 = add nsw i32 %.052.ph, -1
  %xtraiter = and i32 %.052.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph54.prol.loopexit, label %.lr.ph54.prol

.lr.ph54.prol:                                    ; preds = %.lr.ph54.preheader, %.lr.ph54.prol
  %.052.prol = phi i32 [ %46, %.lr.ph54.prol ], [ %.052.ph, %.lr.ph54.preheader ]
  %.03051.prol = phi ptr [ %41, %.lr.ph54.prol ], [ %.03051.ph, %.lr.ph54.preheader ]
  %.03150.prol = phi ptr [ %43, %.lr.ph54.prol ], [ %.03150.ph, %.lr.ph54.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph54.prol ], [ 0, %.lr.ph54.preheader ]
  %41 = getelementptr inbounds i8, ptr %.03051.prol, i64 1
  %42 = load i8, ptr %.03051.prol, align 1, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %.03150.prol, i64 1
  %44 = load i8, ptr %.03150.prol, align 1, !tbaa !9
  %45 = xor i8 %44, %42
  store i8 %45, ptr %.03150.prol, align 1, !tbaa !9
  %46 = add nsw i32 %.052.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.ph54.prol.loopexit, label %.lr.ph54.prol, !llvm.loop !26

.lr.ph54.prol.loopexit:                           ; preds = %.lr.ph54.prol, %.lr.ph54.preheader
  %.052.unr = phi i32 [ %.052.ph, %.lr.ph54.preheader ], [ %46, %.lr.ph54.prol ]
  %.03051.unr = phi ptr [ %.03051.ph, %.lr.ph54.preheader ], [ %41, %.lr.ph54.prol ]
  %.03150.unr = phi ptr [ %.03150.ph, %.lr.ph54.preheader ], [ %43, %.lr.ph54.prol ]
  %47 = icmp ult i32 %40, 3
  br i1 %47, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.prol.loopexit, %.lr.ph54
  %.052 = phi i32 [ %68, %.lr.ph54 ], [ %.052.unr, %.lr.ph54.prol.loopexit ]
  %.03051 = phi ptr [ %63, %.lr.ph54 ], [ %.03051.unr, %.lr.ph54.prol.loopexit ]
  %.03150 = phi ptr [ %65, %.lr.ph54 ], [ %.03150.unr, %.lr.ph54.prol.loopexit ]
  %48 = getelementptr inbounds i8, ptr %.03051, i64 1
  %49 = load i8, ptr %.03051, align 1, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %.03150, i64 1
  %51 = load i8, ptr %.03150, align 1, !tbaa !9
  %52 = xor i8 %51, %49
  store i8 %52, ptr %.03150, align 1, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %.03051, i64 2
  %54 = load i8, ptr %48, align 1, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %.03150, i64 2
  %56 = load i8, ptr %50, align 1, !tbaa !9
  %57 = xor i8 %56, %54
  store i8 %57, ptr %50, align 1, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %.03051, i64 3
  %59 = load i8, ptr %53, align 1, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %.03150, i64 3
  %61 = load i8, ptr %55, align 1, !tbaa !9
  %62 = xor i8 %61, %59
  store i8 %62, ptr %55, align 1, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %.03051, i64 4
  %64 = load i8, ptr %58, align 1, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %.03150, i64 4
  %66 = load i8, ptr %60, align 1, !tbaa !9
  %67 = xor i8 %66, %64
  store i8 %67, ptr %60, align 1, !tbaa !9
  %68 = add nsw i32 %.052, -4
  %.not39.3 = icmp eq i32 %68, 0
  br i1 %.not39.3, label %._crit_edge55, label %.lr.ph54, !llvm.loop !28

._crit_edge55:                                    ; preds = %.lr.ph54.prol.loopexit, %.lr.ph54, %middle.block, %vec.epilog.middle.block, %._crit_edge
  %69 = getelementptr inbounds [8 x i8], ptr %11, i64 0, i64 %.037.lcssa
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = xor i8 %70, -128
  store i8 %71, ptr %69, align 1, !tbaa !9
  call void @wage_set_rate(ptr noundef nonnull %10, ptr noundef nonnull %11) #4
  %72 = load i8, ptr %10, align 16, !tbaa !9
  %73 = xor i8 %72, 32
  store i8 %73, 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 %.035.lcssa, ptr nonnull align 8 %11, i64 %.037.lcssa, i1 false)
  call void @wage_absorb_key(ptr noundef nonnull %10, ptr noundef %8) #4
  %74 = getelementptr inbounds i8, ptr %.035.lcssa, i64 %.037.lcssa
  call void @wage_extract_tag(ptr noundef nonnull %10, ptr noundef %74) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 37, ptr nonnull %10) #4
  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

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

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 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !11, !18, !19}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = distinct !{!28, !11, !18}


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