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

; 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.gcm_ctx = type { [256 x [4 x i32]], [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], [1 x %struct.aes_crypt_ctx], i32, i32, i32, i32 }
%struct.aes_crypt_ctx = type { [60 x i32], %union.aes_inf, [12 x i8] }
%union.aes_inf = type { i32 }

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

; Function Attrs: nounwind uwtable
declare dso_local void @gf_mul_hh(ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @gcm_init_message(ptr noundef %0, i64 noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.gcm_ctx, ptr %10, i32 0, i32 1
  %12 = getelementptr inbounds [4 x i32], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 16, i1 false)
  %13 = load i64, ptr %5, align 8, !tbaa !9
  %14 = icmp eq i64 %13, 12
  br i1 %14, label %15, label %24

15:                                               ; preds = %3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.gcm_ctx, ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds [4 x i32], ptr %17, i64 0, i64 0
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 1 %19, i64 12, i1 false)
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.gcm_ctx, ptr %20, i32 0, i32 1
  %22 = getelementptr inbounds [4 x i32], ptr %21, i64 0, i64 0
  %23 = getelementptr inbounds i8, ptr %22, i64 15
  store i8 1, ptr %23, align 1, !tbaa !13
  br label %104

24:                                               ; preds = %3
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %8, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %30, %24
  %28 = load i32, ptr %8, align 4, !tbaa !11
  %29 = icmp uge i32 %28, 16
  br i1 %29, label %30, label %46

30:                                               ; preds = %27
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.gcm_ctx, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds [4 x i32], ptr %32, i64 0, i64 0
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.gcm_ctx, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds [4 x i32], ptr %35, i64 0, i64 0
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  call void @xor_block_aligned(ptr noundef %33, ptr noundef %36, ptr noundef %37)
  %38 = load i32, ptr %8, align 4, !tbaa !11
  %39 = sub i32 %38, 16
  store i32 %39, ptr %8, align 4, !tbaa !11
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  store ptr %41, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.gcm_ctx, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds [4 x i32], ptr %43, i64 0, i64 0
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  call void @gf_mul_hh(ptr noundef %44, ptr noundef %45)
  br label %27, !llvm.loop !14

46:                                               ; preds = %27
  %47 = load i32, ptr %8, align 4, !tbaa !11
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %73

49:                                               ; preds = %46
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.gcm_ctx, ptr %50, i32 0, i32 1
  %52 = getelementptr inbounds [4 x i32], ptr %51, i64 0, i64 0
  store ptr %52, ptr %9, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %57, %49
  %54 = load i32, ptr %8, align 4, !tbaa !11
  %55 = add i32 %54, -1
  store i32 %55, ptr %8, align 4, !tbaa !11
  %56 = icmp ugt i32 %54, 0
  br i1 %56, label %57, label %68

57:                                               ; preds = %53
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i32 1
  store ptr %59, ptr %4, align 8, !tbaa !5
  %60 = load i8, ptr %58, align 1, !tbaa !13
  %61 = zext i8 %60 to i32
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i32 1
  store ptr %63, ptr %9, align 8, !tbaa !5
  %64 = load i8, ptr %62, align 1, !tbaa !13
  %65 = zext i8 %64 to i32
  %66 = xor i32 %65, %61
  %67 = trunc i32 %66 to i8
  store i8 %67, ptr %62, align 1, !tbaa !13
  br label %53, !llvm.loop !16

68:                                               ; preds = %53
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.gcm_ctx, ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds [4 x i32], ptr %70, i64 0, i64 0
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @gf_mul_hh(ptr noundef %71, ptr noundef %72)
  br label %73

73:                                               ; preds = %68, %46
  %74 = load i64, ptr %5, align 8, !tbaa !9
  %75 = shl i64 %74, 3
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr %8, align 4, !tbaa !11
  store i32 15, ptr %7, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %94, %73
  %78 = load i32, ptr %8, align 4, !tbaa !11
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %99

80:                                               ; preds = %77
  %81 = load i32, ptr %8, align 4, !tbaa !11
  %82 = trunc i32 %81 to i8
  %83 = zext i8 %82 to i32
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.gcm_ctx, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds [4 x i32], ptr %85, i64 0, i64 0
  %87 = load i32, ptr %7, align 4, !tbaa !11
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !13
  %91 = zext i8 %90 to i32
  %92 = xor i32 %91, %83
  %93 = trunc i32 %92 to i8
  store i8 %93, ptr %89, align 1, !tbaa !13
  br label %94

94:                                               ; preds = %80
  %95 = load i32, ptr %7, align 4, !tbaa !11
  %96 = add i32 %95, -1
  store i32 %96, ptr %7, align 4, !tbaa !11
  %97 = load i32, ptr %8, align 4, !tbaa !11
  %98 = lshr i32 %97, 8
  store i32 %98, ptr %8, align 4, !tbaa !11
  br label %77, !llvm.loop !17

99:                                               ; preds = %77
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.gcm_ctx, ptr %100, i32 0, i32 1
  %102 = getelementptr inbounds [4 x i32], ptr %101, i64 0, i64 0
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  call void @gf_mul_hh(ptr noundef %102, ptr noundef %103)
  br label %104

104:                                              ; preds = %99, %15
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.gcm_ctx, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds [4 x i32], ptr %106, i64 0, i64 0
  %108 = getelementptr inbounds i8, ptr %107, i64 12
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.gcm_ctx, ptr %110, i32 0, i32 7
  store i32 %109, ptr %111, align 16, !tbaa !18
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.gcm_ctx, ptr %112, i32 0, i32 3
  %114 = getelementptr inbounds [4 x i32], ptr %113, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %114, i8 0, i64 16, i1 false)
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.gcm_ctx, ptr %115, i32 0, i32 4
  %117 = getelementptr inbounds [4 x i32], ptr %116, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %117, i8 0, i64 16, i1 false)
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.gcm_ctx, ptr %118, i32 0, i32 8
  store i32 0, ptr %119, align 4, !tbaa !20
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.gcm_ctx, ptr %120, i32 0, i32 10
  store i32 0, ptr %121, align 4, !tbaa !21
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.gcm_ctx, ptr %122, i32 0, i32 9
  store i32 0, ptr %123, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret i32 0
}

; 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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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", !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}
!18 = !{!19, !12, i64 4432}
!19 = !{!"", !7, i64 0, !7, i64 4096, !7, i64 4112, !7, i64 4128, !7, i64 4144, !7, i64 4160, !7, i64 4176, !12, i64 4432, !12, i64 4436, !12, i64 4440, !12, i64 4444}
!20 = !{!19, !12, i64 4436}
!21 = !{!19, !12, i64 4444}
!22 = !{!19, !12, i64 4440}


; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: nounwind uwtable
declare dso_local void @gf_mul_hh(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @gcm_init_message(ptr noundef %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %2, i64 4096
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %5 = icmp eq i64 %1, 12
  br i1 %5, label %6, label %8

6:                                                ; preds = %3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %4, ptr noundef nonnull align 1 dereferenceable(12) %0, i64 12, i1 false)
  %7 = getelementptr inbounds i8, ptr %2, i64 4111
  store i8 1, ptr %7, align 1, !tbaa !5
  br label %59

8:                                                ; preds = %3
  %9 = trunc i64 %1 to i32
  %10 = icmp ugt i32 %9, 15
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.03644 = phi i32 [ %11, %.lr.ph ], [ %9, %8 ]
  %.03843 = phi ptr [ %12, %.lr.ph ], [ %0, %8 ]
  tail call void @xor_block_aligned(ptr noundef nonnull %4, ptr noundef nonnull %4, ptr noundef %.03843)
  %11 = add i32 %.03644, -16
  %12 = getelementptr inbounds i8, ptr %.03843, i64 16
  tail call void @gf_mul_hh(ptr noundef nonnull %4, ptr noundef %2)
  %13 = icmp ugt i32 %11, 15
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph, %8
  %.038.lcssa = phi ptr [ %0, %8 ], [ %12, %.lr.ph ]
  %.036.lcssa = phi i32 [ %9, %8 ], [ %11, %.lr.ph ]
  %.not = icmp eq i32 %.036.lcssa, 0
  br i1 %.not, label %50, label %iter.check

iter.check:                                       ; preds = %._crit_edge
  %14 = zext nneg i32 %.036.lcssa to i64
  %min.iters.check = icmp ult i32 %.036.lcssa, 8
  br i1 %min.iters.check, label %.preheader.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %15 = add nsw i32 %.036.lcssa, -1
  %16 = zext i32 %15 to i64
  %17 = getelementptr i8, ptr %2, i64 %16
  %scevgep = getelementptr i8, ptr %17, i64 4097
  %18 = zext nneg i32 %.036.lcssa to i64
  %scevgep58 = getelementptr i8, ptr %.038.lcssa, i64 %18
  %bound0 = icmp ult ptr %4, %scevgep58
  %bound1 = icmp ult ptr %.038.lcssa, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.preheader.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.memcheck
  %n.vec67 = and i64 %14, 8
  %ind.end = getelementptr i8, ptr %4, i64 %n.vec67
  %.cast = trunc nuw nsw i64 %n.vec67 to i32
  %ind.end69 = sub nsw i32 %.036.lcssa, %.cast
  %ind.end73 = getelementptr i8, ptr %.038.lcssa, i64 %n.vec67
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index76 = phi i64 [ 0, %vec.epilog.ph ], [ %index.next81, %vec.epilog.vector.body ]
  %next.gep77 = getelementptr i8, ptr %4, i64 %index76
  %next.gep78 = getelementptr i8, ptr %.038.lcssa, i64 %index76
  %wide.load79 = load <8 x i8>, ptr %next.gep78, align 1, !tbaa !5, !alias.scope !10
  %wide.load80 = load <8 x i8>, ptr %next.gep77, align 1, !tbaa !5, !alias.scope !13, !noalias !10
  %19 = xor <8 x i8> %wide.load80, %wide.load79
  store <8 x i8> %19, ptr %next.gep77, align 1, !tbaa !5, !alias.scope !13, !noalias !10
  %index.next81 = add nuw i64 %index76, 8
  %20 = icmp eq i64 %index.next81, %n.vec67
  br i1 %20, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !15

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n82 = icmp eq i64 %n.vec67, %14
  br i1 %cmp.n82, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check
  %.048.ph = phi ptr [ %4, %iter.check ], [ %4, %vector.memcheck ], [ %ind.end, %vec.epilog.middle.block ]
  %.147.ph = phi i32 [ %.036.lcssa, %iter.check ], [ %.036.lcssa, %vector.memcheck ], [ %ind.end69, %vec.epilog.middle.block ]
  %.13946.ph = phi ptr [ %.038.lcssa, %iter.check ], [ %.038.lcssa, %vector.memcheck ], [ %ind.end73, %vec.epilog.middle.block ]
  %21 = add i32 %.147.ph, -1
  %xtraiter = and i32 %.147.ph, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %.preheader.prol
  %.048.prol = phi ptr [ %25, %.preheader.prol ], [ %.048.ph, %.preheader.preheader ]
  %.147.prol = phi i32 [ %22, %.preheader.prol ], [ %.147.ph, %.preheader.preheader ]
  %.13946.prol = phi ptr [ %23, %.preheader.prol ], [ %.13946.ph, %.preheader.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.preheader.prol ], [ 0, %.preheader.preheader ]
  %22 = add i32 %.147.prol, -1
  %23 = getelementptr inbounds i8, ptr %.13946.prol, i64 1
  %24 = load i8, ptr %.13946.prol, align 1, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %.048.prol, i64 1
  %26 = load i8, ptr %.048.prol, align 1, !tbaa !5
  %27 = xor i8 %26, %24
  store i8 %27, ptr %.048.prol, align 1, !tbaa !5
  %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 %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !18

.preheader.prol.loopexit:                         ; preds = %.preheader.prol, %.preheader.preheader
  %.048.unr = phi ptr [ %.048.ph, %.preheader.preheader ], [ %25, %.preheader.prol ]
  %.147.unr = phi i32 [ %.147.ph, %.preheader.preheader ], [ %22, %.preheader.prol ]
  %.13946.unr = phi ptr [ %.13946.ph, %.preheader.preheader ], [ %23, %.preheader.prol ]
  %28 = icmp ult i32 %21, 3
  br i1 %28, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.preheader.prol.loopexit, %.preheader
  %.048 = phi ptr [ %47, %.preheader ], [ %.048.unr, %.preheader.prol.loopexit ]
  %.147 = phi i32 [ %44, %.preheader ], [ %.147.unr, %.preheader.prol.loopexit ]
  %.13946 = phi ptr [ %45, %.preheader ], [ %.13946.unr, %.preheader.prol.loopexit ]
  %29 = getelementptr inbounds i8, ptr %.13946, i64 1
  %30 = load i8, ptr %.13946, align 1, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %.048, i64 1
  %32 = load i8, ptr %.048, align 1, !tbaa !5
  %33 = xor i8 %32, %30
  store i8 %33, ptr %.048, align 1, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %.13946, i64 2
  %35 = load i8, ptr %29, align 1, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %.048, i64 2
  %37 = load i8, ptr %31, align 1, !tbaa !5
  %38 = xor i8 %37, %35
  store i8 %38, ptr %31, align 1, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %.13946, i64 3
  %40 = load i8, ptr %34, align 1, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %.048, i64 3
  %42 = load i8, ptr %36, align 1, !tbaa !5
  %43 = xor i8 %42, %40
  store i8 %43, ptr %36, align 1, !tbaa !5
  %44 = add i32 %.147, -4
  %45 = getelementptr inbounds i8, ptr %.13946, i64 4
  %46 = load i8, ptr %39, align 1, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %.048, i64 4
  %48 = load i8, ptr %41, align 1, !tbaa !5
  %49 = xor i8 %48, %46
  store i8 %49, ptr %41, align 1, !tbaa !5
  %.not41.3 = icmp eq i32 %44, 0
  br i1 %.not41.3, label %.loopexit, label %.preheader, !llvm.loop !20

.loopexit:                                        ; preds = %.preheader.prol.loopexit, %.preheader, %vec.epilog.middle.block
  tail call void @gf_mul_hh(ptr noundef nonnull %4, ptr noundef %2)
  br label %50

50:                                               ; preds = %.loopexit, %._crit_edge
  %51 = shl i32 %9, 3
  %.not4249 = icmp eq i32 %51, 0
  br i1 %.not4249, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %50, %.lr.ph53
  %.251 = phi i32 [ %58, %.lr.ph53 ], [ %51, %50 ]
  %.03750 = phi i32 [ %57, %.lr.ph53 ], [ 15, %50 ]
  %52 = zext i32 %.03750 to i64
  %53 = getelementptr inbounds i8, ptr %4, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = trunc i32 %.251 to i8
  %56 = xor i8 %54, %55
  store i8 %56, ptr %53, align 1, !tbaa !5
  %57 = add nsw i32 %.03750, -1
  %58 = lshr i32 %.251, 8
  %.not42 = icmp ult i32 %.251, 256
  br i1 %.not42, label %._crit_edge54, label %.lr.ph53, !llvm.loop !21

._crit_edge54:                                    ; preds = %.lr.ph53, %50
  tail call void @gf_mul_hh(ptr noundef nonnull %4, ptr noundef %2)
  br label %59

59:                                               ; preds = %._crit_edge54, %6
  %60 = getelementptr inbounds i8, ptr %2, i64 4108
  %61 = load i32, ptr %60, align 4, !tbaa !22
  %62 = getelementptr inbounds i8, ptr %2, i64 4432
  store i32 %61, ptr %62, align 16, !tbaa !24
  %63 = getelementptr inbounds i8, ptr %2, i64 4128
  %64 = getelementptr inbounds i8, ptr %2, i64 4436
  store i32 0, ptr %64, align 4, !tbaa !26
  %65 = getelementptr inbounds i8, ptr %2, i64 4444
  store i32 0, ptr %65, align 4, !tbaa !27
  %66 = getelementptr inbounds i8, ptr %2, i64 4440
  store i32 0, ptr %66, align 8, !tbaa !28
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %63, i8 0, i64 32, i1 false)
  ret i32 0
}

; 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

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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" }

!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 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !9, !16}
!21 = distinct !{!21, !9}
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !6, i64 0}
!24 = !{!25, !23, i64 4432}
!25 = !{!"", !6, i64 0, !6, i64 4096, !6, i64 4112, !6, i64 4128, !6, i64 4144, !6, i64 4160, !6, i64 4176, !23, i64 4432, !23, i64 4436, !23, i64 4440, !23, i64 4444}
!26 = !{!25, !23, i64 4436}
!27 = !{!25, !23, i64 4444}
!28 = !{!25, !23, i64 4440}


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