; LLVM IR from square/subzero :: core/external-crypto/modes (xts)

; 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"

%struct.xts_ctx = type { [1 x %struct.aes_crypt_ctx], [1 x %struct.aes_crypt_ctx], [1 x %struct.aes_crypt_ctx] }
%struct.aes_crypt_ctx = type { [60 x i32], %union.aes_inf, [12 x i8] }
%union.aes_inf = type { i32 }

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @xts_encrypt(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [4 x i32], align 16
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = and i32 %21, 7
  %23 = trunc i32 %22 to i8
  store i8 %23, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %24, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = add i32 %26, 7
  %28 = lshr i32 %27, 3
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %25, i64 %29
  store ptr %30, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = lshr i32 %32, 3
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %31, i64 %34
  store ptr %35, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = ptrtoint ptr %36 to i64
  %38 = and i64 %37, 3
  %39 = icmp ne i64 %38, 0
  %40 = xor i1 %39, true
  %41 = zext i1 %40 to i64
  %42 = select i1 %40, ptr @xor_block_aligned, ptr @xor_block
  store ptr %42, ptr %15, align 8, !tbaa !5
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = icmp ult i32 %43, 128
  br i1 %44, label %45, label %46

45:                                               ; preds = %4
  store i32 1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %153

46:                                               ; preds = %4
  %47 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 1 %48, i64 16, i1 false)
  %49 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  %50 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.xts_ctx, ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %52, i64 0, i64 0
  %54 = call i32 @aes_encrypt(ptr noundef %49, ptr noundef %50, ptr noundef %53)
  br label %55

55:                                               ; preds = %60, %46
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = icmp ule ptr %57, %58
  br i1 %59, label %60, label %78

60:                                               ; preds = %55
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  call void %61(ptr noundef %62, ptr noundef %63, ptr noundef %64)
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.xts_ctx, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %68, i64 0, i64 0
  %70 = call i32 @aes_encrypt(ptr noundef %65, ptr noundef %66, ptr noundef %69)
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  call void %71(ptr noundef %72, ptr noundef %73, ptr noundef %74)
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  store ptr %76, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  call void @gf_mulx(ptr noundef %77)
  br label %55, !llvm.loop !12

78:                                               ; preds = %55
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = icmp ult ptr %79, %80
  br i1 %81, label %82, label %152

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 -16
  store ptr %84, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %85 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %85, ptr %18, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %90, %82
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = icmp ult ptr %87, %88
  br i1 %89, label %90, label %100

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  %92 = load i8, ptr %91, align 1, !tbaa !11
  store i8 %92, ptr %19, align 1, !tbaa !11
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load i8, ptr %93, align 1, !tbaa !11
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i32 1
  store ptr %96, ptr %17, align 8, !tbaa !5
  store i8 %94, ptr %95, align 1, !tbaa !11
  %97 = load i8, ptr %19, align 1, !tbaa !11
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i32 1
  store ptr %99, ptr %12, align 8, !tbaa !5
  store i8 %97, ptr %98, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %86, !llvm.loop !14

100:                                              ; preds = %86
  %101 = load i8, ptr %11, align 1, !tbaa !11
  %102 = icmp ne i8 %101, 0
  br i1 %102, label %103, label %137

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  %104 = load i8, ptr %11, align 1, !tbaa !11
  %105 = zext i8 %104 to i32
  %106 = ashr i32 255, %105
  %107 = xor i32 %106, -1
  %108 = trunc i32 %107 to i8
  store i8 %108, ptr %20, align 1, !tbaa !11
  %109 = load i8, ptr %20, align 1, !tbaa !11
  %110 = zext i8 %109 to i32
  %111 = load ptr, ptr %17, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i32 -1
  store ptr %112, ptr %17, align 8, !tbaa !5
  %113 = load i8, ptr %112, align 1, !tbaa !11
  %114 = zext i8 %113 to i32
  %115 = and i32 %114, %110
  %116 = trunc i32 %115 to i8
  store i8 %116, ptr %112, align 1, !tbaa !11
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %117, i32 -1
  store ptr %118, ptr %12, align 8, !tbaa !5
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = zext i8 %119 to i32
  %121 = load i8, ptr %20, align 1, !tbaa !11
  %122 = zext i8 %121 to i32
  %123 = xor i32 %122, -1
  %124 = and i32 %120, %123
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = load i8, ptr %125, align 1, !tbaa !11
  %127 = zext i8 %126 to i32
  %128 = or i32 %127, %124
  %129 = trunc i32 %128 to i8
  store i8 %129, ptr %125, align 1, !tbaa !11
  %130 = load i8, ptr %20, align 1, !tbaa !11
  %131 = zext i8 %130 to i32
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = load i8, ptr %132, align 1, !tbaa !11
  %134 = zext i8 %133 to i32
  %135 = and i32 %134, %131
  %136 = trunc i32 %135 to i8
  store i8 %136, ptr %132, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  br label %137

137:                                              ; preds = %103, %100
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = load ptr, ptr %18, align 8, !tbaa !5
  %141 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  call void %138(ptr noundef %139, ptr noundef %140, ptr noundef %141)
  %142 = load ptr, ptr %18, align 8, !tbaa !5
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.xts_ctx, ptr %144, i32 0, i32 1
  %146 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %145, i64 0, i64 0
  %147 = call i32 @aes_encrypt(ptr noundef %142, ptr noundef %143, ptr noundef %146)
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  %149 = load ptr, ptr %18, align 8, !tbaa !5
  %150 = load ptr, ptr %18, align 8, !tbaa !5
  %151 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 0
  call void %148(ptr noundef %149, ptr noundef %150, ptr noundef %151)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %152

152:                                              ; preds = %137, %78
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %153

153:                                              ; preds = %152, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  %154 = load i32, ptr %5, align 4
  ret i32 %154
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @xor_block_aligned(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @xor_block(ptr noundef, ptr noundef, 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 i32 @aes_encrypt(ptr noundef, ptr noundef, ptr noundef) #4

declare void @gf_mulx(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 #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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @xts_encrypt(ptr noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca [4 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %6 = add i32 %1, 7
  %7 = lshr i32 %6, 3
  %8 = zext nneg i32 %7 to i64
  %9 = getelementptr inbounds i8, ptr %0, i64 %8
  %10 = lshr i32 %1, 3
  %11 = zext nneg i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 %11
  %13 = ptrtoint ptr %0 to i64
  %14 = and i64 %13, 3
  %.not = icmp eq i64 %14, 0
  %15 = select i1 %.not, ptr @xor_block_aligned, ptr @xor_block
  %16 = icmp ult i32 %1, 128
  br i1 %16, label %52, label %.lr.ph

.lr.ph:                                           ; preds = %4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 1 dereferenceable(16) %2, i64 16, i1 false)
  %17 = call i32 @aes_encrypt(ptr noundef nonnull %5, ptr noundef nonnull %5, ptr noundef %3) #5
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = getelementptr inbounds i8, ptr %3, i64 256
  br label %20

20:                                               ; preds = %.lr.ph, %20
  %indvar = phi i64 [ 0, %.lr.ph ], [ %indvar.next, %20 ]
  %21 = phi ptr [ %18, %.lr.ph ], [ %23, %20 ]
  %.05159 = phi ptr [ %0, %.lr.ph ], [ %21, %20 ]
  call void %15(ptr noundef %.05159, ptr noundef %.05159, ptr noundef nonnull %5) #5, !callees !5
  %22 = call i32 @aes_encrypt(ptr noundef %.05159, ptr noundef %.05159, ptr noundef nonnull %19) #5
  call void %15(ptr noundef %.05159, ptr noundef %.05159, ptr noundef nonnull %5) #5, !callees !5
  call void @gf_mulx(ptr noundef nonnull %5) #5
  %23 = getelementptr inbounds i8, ptr %21, i64 16
  %.not56 = icmp ugt ptr %23, %12
  %indvar.next = add i64 %indvar, 1
  br i1 %.not56, label %._crit_edge, label %20, !llvm.loop !6

._crit_edge:                                      ; preds = %20
  %24 = icmp ult ptr %21, %9
  br i1 %24, label %25, label %52

25:                                               ; preds = %._crit_edge
  %26 = getelementptr i8, ptr %21, i64 -16
  %27 = add nsw i64 %8, -16
  %28 = shl i64 %indvar, 4
  %29 = sub i64 %27, %28
  %min.iters.check = icmp ult i64 %29, 16
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %25
  %n.mod.vf = and i64 %8, 15
  %n.vec = sub i64 %29, %n.mod.vf
  %ind.end = getelementptr i8, ptr %21, i64 %n.vec
  %ind.end66 = getelementptr i8, ptr %26, i64 %n.vec
  %load_initial = load <16 x i8>, ptr %26, align 1
  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 %21, i64 %index
  %next.gep68 = getelementptr i8, ptr %26, i64 %index
  %wide.load69 = load <16 x i8>, ptr %next.gep, align 1, !tbaa !8
  store <16 x i8> %wide.load69, ptr %next.gep68, align 1, !tbaa !8
  store <16 x i8> %load_initial, ptr %next.gep, align 1, !tbaa !8
  %index.next = add nuw i64 %index, 16
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %31 = extractelement <16 x i8> %wide.load69, i64 15
  %32 = extractelement <16 x i8> %load_initial, i64 15
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  %cmo = add i64 %n.vec, -1
  %ind.escape = getelementptr i8, ptr %21, i64 %cmo
  %33 = getelementptr i8, ptr %26, i64 %n.vec
  %ind.escape71 = getelementptr i8, ptr %33, i64 -1
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %25
  %.161.ph = phi ptr [ %21, %25 ], [ %ind.end, %middle.block ]
  %.05260.ph = phi ptr [ %26, %25 ], [ %ind.end66, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.161 = phi ptr [ %37, %scalar.ph ], [ %.161.ph, %scalar.ph.preheader ]
  %.05260 = phi ptr [ %36, %scalar.ph ], [ %.05260.ph, %scalar.ph.preheader ]
  %34 = load i8, ptr %.05260, align 1, !tbaa !8
  %35 = load i8, ptr %.161, align 1, !tbaa !8
  %36 = getelementptr inbounds i8, ptr %.05260, i64 1
  store i8 %35, ptr %.05260, align 1, !tbaa !8
  %37 = getelementptr inbounds i8, ptr %.161, i64 1
  store i8 %34, ptr %.161, align 1, !tbaa !8
  %38 = icmp ult ptr %37, %9
  br i1 %38, label %scalar.ph, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %.161.lcssa = phi ptr [ %ind.escape, %middle.block ], [ %.161, %scalar.ph ]
  %.05260.lcssa = phi ptr [ %ind.escape71, %middle.block ], [ %.05260, %scalar.ph ]
  %.lcssa64 = phi i8 [ %32, %middle.block ], [ %34, %scalar.ph ]
  %.lcssa = phi i8 [ %31, %middle.block ], [ %35, %scalar.ph ]
  %39 = and i32 %1, 7
  %.not57 = icmp eq i32 %39, 0
  br i1 %.not57, label %49, label %40

40:                                               ; preds = %.loopexit
  %41 = ashr exact i32 -256, %39
  %42 = trunc i32 %41 to i8
  %43 = and i8 %.lcssa, %42
  %44 = lshr i32 255, %39
  %45 = trunc nuw nsw i32 %44 to i8
  %46 = and i8 %.lcssa64, %45
  %47 = or i8 %46, %43
  store i8 %47, ptr %.05260.lcssa, align 1, !tbaa !8
  %48 = and i8 %.lcssa64, %42
  store i8 %48, ptr %.161.lcssa, align 1, !tbaa !8
  br label %49

49:                                               ; preds = %40, %.loopexit
  call void %15(ptr noundef nonnull %26, ptr noundef nonnull %26, ptr noundef nonnull %5) #5, !callees !5
  %50 = getelementptr inbounds i8, ptr %3, i64 256
  %51 = call i32 @aes_encrypt(ptr noundef nonnull %26, ptr noundef nonnull %26, ptr noundef nonnull %50) #5
  call void %15(ptr noundef nonnull %26, ptr noundef nonnull %26, ptr noundef nonnull %5) #5, !callees !5
  br label %52

52:                                               ; preds = %._crit_edge, %49, %4
  %.0 = phi i32 [ 1, %4 ], [ 0, %49 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  ret i32 %.0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @xor_block_aligned(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @xor_block(ptr noundef, ptr noundef, 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 i32 @aes_encrypt(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @gf_mulx(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 #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 = !{ptr @xor_block, ptr @xor_block_aligned}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !7, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !7, !13, !12}


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