; LLVM IR from square/subzero :: core/external-crypto/modes/ltc (ltc_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_state = type { [1 x %struct.aes_crypt_ctx], [16 x i8], [16 x i8], [16 x i8], [16 x i8], [16 x i8], i32, i32, i32, i64, i64, [16 x [256 x [16 x i8]]] }
%struct.aes_crypt_ctx = type { [60 x i32], %union.aes_inf, [12 x i8] }
%union.aes_inf = type { i32 }

@gcm_shift_table = external dso_local constant [512 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @gcm_init(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca [16 x i8], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.gcm_state, ptr %16, i32 0, i32 0
  %18 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %17, i64 0, i64 0
  %19 = call i32 @aes_encrypt_key(ptr noundef %14, i32 noundef %15, ptr noundef %18)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  store i32 1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %166

22:                                               ; preds = %3
  %23 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 16, i1 false)
  %24 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.gcm_state, ptr %25, i32 0, i32 1
  %27 = getelementptr inbounds [16 x i8], ptr %26, i64 0, i64 0
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.gcm_state, ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds [1 x %struct.aes_crypt_ctx], ptr %29, i64 0, i64 0
  %31 = call i32 @aes_encrypt(ptr noundef %24, ptr noundef %27, ptr noundef %30)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.gcm_state, ptr %32, i32 0, i32 5
  %34 = getelementptr inbounds [16 x i8], ptr %33, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %34, i8 0, i64 16, i1 false)
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.gcm_state, ptr %35, i32 0, i32 2
  %37 = getelementptr inbounds [16 x i8], ptr %36, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %37, i8 0, i64 16, i1 false)
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.gcm_state, ptr %38, i32 0, i32 7
  store i32 0, ptr %39, align 4, !tbaa !11
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.gcm_state, ptr %40, i32 0, i32 6
  store i32 0, ptr %41, align 16, !tbaa !14
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.gcm_state, ptr %42, i32 0, i32 8
  store i32 0, ptr %43, align 8, !tbaa !15
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.gcm_state, ptr %44, i32 0, i32 9
  store i64 0, ptr %45, align 16, !tbaa !16
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.gcm_state, ptr %46, i32 0, i32 10
  store i64 0, ptr %47, align 8, !tbaa !17
  %48 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %48, i8 0, i64 16, i1 false)
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %67, %22
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = icmp slt i32 %50, 256
  br i1 %51, label %52, label %70

52:                                               ; preds = %49
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = trunc i32 %53 to i8
  %55 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  store i8 %54, ptr %55, align 16, !tbaa !18
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.gcm_state, ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds [16 x i8], ptr %57, i64 0, i64 0
  %59 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.gcm_state, ptr %60, i32 0, i32 11
  %62 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %61, i64 0, i64 0
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [256 x [16 x i8]], ptr %62, i64 0, i64 %64
  %66 = getelementptr inbounds [16 x i8], ptr %65, i64 0, i64 0
  call void @gcm_gf_mult(ptr noundef %58, ptr noundef %59, ptr noundef %66)
  br label %67

67:                                               ; preds = %52
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %10, align 4, !tbaa !9
  br label %49, !llvm.loop !19

70:                                               ; preds = %49
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %162, %70
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = icmp slt i32 %72, 16
  br i1 %73, label %74, label %165

74:                                               ; preds = %71
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %158, %74
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp slt i32 %76, 256
  br i1 %77, label %78, label %161

78:                                               ; preds = %75
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.gcm_state, ptr %79, i32 0, i32 11
  %81 = load i32, ptr %9, align 4, !tbaa !9
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %80, i64 0, i64 %83
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [256 x [16 x i8]], ptr %84, i64 0, i64 %86
  %88 = getelementptr inbounds [16 x i8], ptr %87, i64 0, i64 15
  %89 = load i8, ptr %88, align 1, !tbaa !18
  %90 = zext i8 %89 to i32
  store i32 %90, ptr %12, align 4, !tbaa !9
  store i32 15, ptr %11, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %120, %78
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %94, label %123

94:                                               ; preds = %91
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.gcm_state, ptr %95, i32 0, i32 11
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %96, i64 0, i64 %99
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [256 x [16 x i8]], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [16 x i8], ptr %103, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !18
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.gcm_state, ptr %109, i32 0, i32 11
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [256 x [16 x i8]], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [16 x i8], ptr %116, i64 0, i64 %118
  store i8 %108, ptr %119, align 1, !tbaa !18
  br label %120

120:                                              ; preds = %94
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %11, align 4, !tbaa !9
  br label %91, !llvm.loop !21

123:                                              ; preds = %91
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = shl i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [512 x i8], ptr @gcm_shift_table, i64 0, i64 %126
  %128 = load i8, ptr %127, align 1, !tbaa !18
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.gcm_state, ptr %129, i32 0, i32 11
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [256 x [16 x i8]], ptr %133, i64 0, i64 %135
  %137 = getelementptr inbounds [16 x i8], ptr %136, i64 0, i64 0
  store i8 %128, ptr %137, align 16, !tbaa !18
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = shl i32 %138, 1
  %140 = add nsw i32 %139, 1
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [512 x i8], ptr @gcm_shift_table, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !18
  %144 = zext i8 %143 to i32
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.gcm_state, ptr %145, i32 0, i32 11
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %146, i64 0, i64 %148
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [256 x [16 x i8]], ptr %149, i64 0, i64 %151
  %153 = getelementptr inbounds [16 x i8], ptr %152, i64 0, i64 1
  %154 = load i8, ptr %153, align 1, !tbaa !18
  %155 = zext i8 %154 to i32
  %156 = xor i32 %155, %144
  %157 = trunc i32 %156 to i8
  store i8 %157, ptr %153, align 1, !tbaa !18
  br label %158

158:                                              ; preds = %123
  %159 = load i32, ptr %10, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %10, align 4, !tbaa !9
  br label %75, !llvm.loop !22

161:                                              ; preds = %75
  br label %162

162:                                              ; preds = %161
  %163 = load i32, ptr %9, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %9, align 4, !tbaa !9
  br label %71, !llvm.loop !23

165:                                              ; preds = %71
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %166

166:                                              ; preds = %165, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  %167 = load i32, ptr %4, align 4
  ret i32 %167
}

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

declare i32 @aes_encrypt_key(ptr noundef, i32 noundef, ptr noundef) #2

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

declare i32 @aes_encrypt(ptr noundef, ptr noundef, ptr noundef) #2

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

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

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: write) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 340}
!12 = !{!"", !7, i64 0, !7, i64 256, !7, i64 272, !7, i64 288, !7, i64 304, !7, i64 320, !10, i64 336, !10, i64 340, !10, i64 344, !13, i64 352, !13, i64 360, !7, i64 368}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 336}
!15 = !{!12, !10, i64 344}
!16 = !{!12, !13, i64 352}
!17 = !{!12, !13, i64 360}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}


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

@gcm_shift_table = external dso_local local_unnamed_addr constant [512 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @gcm_init(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %5 = tail call i32 @aes_encrypt_key(ptr noundef %0, i32 noundef %1, ptr noundef %2) #4
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %6, label %.loopexit

6:                                                ; preds = %3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %7 = getelementptr inbounds i8, ptr %2, i64 256
  %8 = call i32 @aes_encrypt(ptr noundef nonnull %4, ptr noundef nonnull %7, ptr noundef %2) #4
  %9 = getelementptr inbounds i8, ptr %2, i64 320
  %10 = getelementptr inbounds i8, ptr %2, i64 272
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %10, i8 0, i64 16, i1 false)
  %11 = getelementptr inbounds i8, ptr %2, i64 352
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(28) %9, i8 0, i64 28, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %12 = getelementptr inbounds i8, ptr %2, i64 368
  br label %13

13:                                               ; preds = %6, %13
  %indvars.iv = phi i64 [ 0, %6 ], [ %indvars.iv.next, %13 ]
  %14 = trunc i64 %indvars.iv to i8
  store i8 %14, ptr %4, align 16, !tbaa !5
  %15 = getelementptr inbounds [256 x [16 x i8]], ptr %12, i64 0, i64 %indvars.iv
  call void @gcm_gf_mult(ptr noundef nonnull %7, ptr noundef nonnull %4, ptr noundef nonnull %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %.preheader, label %13, !llvm.loop !8

.preheader:                                       ; preds = %13, %48
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %48 ], [ 1, %13 ]
  %16 = add nsw i64 %indvars.iv62, -1
  br label %17

17:                                               ; preds = %.preheader, %17
  %indvars.iv58 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next59, %17 ]
  %18 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 15
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 14
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58, i64 15
  store i8 %21, ptr %22, align 1, !tbaa !5
  %23 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 13
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58, i64 14
  store i8 %24, ptr %25, align 1, !tbaa !5
  %26 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 12
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58, i64 13
  store i8 %27, ptr %28, align 1, !tbaa !5
  %29 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 8
  %30 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58, i64 9
  %31 = load <4 x i8>, ptr %29, align 1, !tbaa !5
  store <4 x i8> %31, ptr %30, align 1, !tbaa !5
  %32 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %16, i64 %indvars.iv58, i64 0
  %33 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58, i64 1
  %34 = load <8 x i8>, ptr %32, align 1, !tbaa !5
  store <8 x i8> %34, ptr %33, align 1, !tbaa !5
  %35 = zext i8 %19 to i32
  %36 = shl nuw nsw i32 %35, 1
  %37 = zext nneg i32 %36 to i64
  %38 = getelementptr inbounds [512 x i8], ptr @gcm_shift_table, i64 0, i64 %37
  %39 = load i8, ptr %38, align 2, !tbaa !5
  %40 = getelementptr inbounds [16 x [256 x [16 x i8]]], ptr %12, i64 0, i64 %indvars.iv62, i64 %indvars.iv58
  store i8 %39, ptr %40, align 16, !tbaa !5
  %41 = or disjoint i32 %36, 1
  %42 = zext nneg i32 %41 to i64
  %43 = getelementptr inbounds [512 x i8], ptr @gcm_shift_table, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %40, i64 1
  %46 = extractelement <8 x i8> %34, i64 0
  %47 = xor i8 %46, %44
  store i8 %47, ptr %45, align 1, !tbaa !5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next59, 256
  br i1 %exitcond61.not, label %48, label %17, !llvm.loop !10

48:                                               ; preds = %17
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next63, 16
  br i1 %exitcond65.not, label %.loopexit, label %.preheader, !llvm.loop !11

.loopexit:                                        ; preds = %48, %3
  %.0 = phi i32 [ 1, %3 ], [ 0, %48 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #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 i32 @aes_encrypt_key(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @aes_encrypt(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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: write) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass