; LLVM IR from rweather/lightweight-crypto :: src/arduino/LWC_Benchmark (internal-chachapoly)

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

%union.chacha20_state_t = type { [16 x i32] }
%struct.poly1305_state_t = type { [5 x i32], [5 x i32], [4 x i32] }

@tag256 = external hidden constant [17 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @internal_chachapoly_aead_decrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %union.chacha20_state_t, align 4
  %21 = alloca %union.chacha20_state_t, align 4
  %22 = alloca %struct.poly1305_state_t, align 4
  %23 = alloca [16 x i8], align 16
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i64 %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store i64 %6, ptr %17, align 8, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #5
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = load i64, ptr %15, align 8, !tbaa !9
  %29 = icmp ult i64 %28, 16
  br i1 %29, label %30, label %31

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

31:                                               ; preds = %9
  %32 = load i64, ptr %15, align 8, !tbaa !9
  %33 = sub i64 %32, 16
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %33, ptr %34, align 8, !tbaa !9
  %35 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 16 @tag256, i64 16, i1 false)
  %36 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %37, ptr align 1 %38, i64 32, i1 false)
  %39 = getelementptr inbounds [16 x i32], ptr %20, i64 0, i64 12
  store i32 0, ptr %39, align 4, !tbaa !11
  %40 = getelementptr inbounds [16 x i32], ptr %20, i64 0, i64 13
  store i32 0, ptr %40, align 4, !tbaa !11
  %41 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %42 = getelementptr inbounds i8, ptr %41, i64 56
  %43 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %42, ptr align 1 %43, i64 8, i1 false)
  %44 = getelementptr inbounds [16 x i32], ptr %21, i64 0, i64 0
  %45 = getelementptr inbounds [16 x i32], ptr %20, i64 0, i64 0
  call void @chachaCore(ptr noundef %44, ptr noundef %45)
  %46 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  call void @poly1305_init(ptr noundef %22, ptr noundef %46)
  %47 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  %48 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %47, ptr align 1 %49, i64 16, i1 false)
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  %51 = load i64, ptr %17, align 8, !tbaa !9
  call void @poly1305_update(ptr noundef %22, ptr noundef %50, i64 noundef %51, i8 noundef zeroext 0)
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load i64, ptr %53, align 8, !tbaa !9
  call void @poly1305_update(ptr noundef %22, ptr noundef %52, i64 noundef %54, i8 noundef zeroext 0)
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  %58 = load i64, ptr %57, align 8, !tbaa !9
  call void @chacha_encrypt(ptr noundef %20, ptr noundef %21, ptr noundef %55, ptr noundef %56, i64 noundef %58)
  br label %59

59:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %60 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %60, ptr %25, align 8, !tbaa !12
  %61 = load i64, ptr %25, align 8, !tbaa !12
  %62 = trunc i64 %61 to i8
  %63 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  store i8 %62, ptr %63, align 4, !tbaa !11
  %64 = load i64, ptr %25, align 8, !tbaa !12
  %65 = lshr i64 %64, 8
  %66 = trunc i64 %65 to i8
  %67 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 1
  store i8 %66, ptr %67, align 1, !tbaa !11
  %68 = load i64, ptr %25, align 8, !tbaa !12
  %69 = lshr i64 %68, 16
  %70 = trunc i64 %69 to i8
  %71 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 2
  store i8 %70, ptr %71, align 2, !tbaa !11
  %72 = load i64, ptr %25, align 8, !tbaa !12
  %73 = lshr i64 %72, 24
  %74 = trunc i64 %73 to i8
  %75 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 3
  store i8 %74, ptr %75, align 1, !tbaa !11
  %76 = load i64, ptr %25, align 8, !tbaa !12
  %77 = lshr i64 %76, 32
  %78 = trunc i64 %77 to i8
  %79 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 4
  store i8 %78, ptr %79, align 4, !tbaa !11
  %80 = load i64, ptr %25, align 8, !tbaa !12
  %81 = lshr i64 %80, 40
  %82 = trunc i64 %81 to i8
  %83 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 5
  store i8 %82, ptr %83, align 1, !tbaa !11
  %84 = load i64, ptr %25, align 8, !tbaa !12
  %85 = lshr i64 %84, 48
  %86 = trunc i64 %85 to i8
  %87 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 6
  store i8 %86, ptr %87, align 2, !tbaa !11
  %88 = load i64, ptr %25, align 8, !tbaa !12
  %89 = lshr i64 %88, 56
  %90 = trunc i64 %89 to i8
  %91 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 7
  store i8 %90, ptr %91, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %92

92:                                               ; preds = %59
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load i64, ptr %95, align 8, !tbaa !9
  store i64 %96, ptr %26, align 8, !tbaa !12
  %97 = load i64, ptr %26, align 8, !tbaa !12
  %98 = trunc i64 %97 to i8
  %99 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %100 = getelementptr inbounds i8, ptr %99, i64 8
  %101 = getelementptr inbounds i8, ptr %100, i64 0
  store i8 %98, ptr %101, align 1, !tbaa !11
  %102 = load i64, ptr %26, align 8, !tbaa !12
  %103 = lshr i64 %102, 8
  %104 = trunc i64 %103 to i8
  %105 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %106 = getelementptr inbounds i8, ptr %105, i64 8
  %107 = getelementptr inbounds i8, ptr %106, i64 1
  store i8 %104, ptr %107, align 1, !tbaa !11
  %108 = load i64, ptr %26, align 8, !tbaa !12
  %109 = lshr i64 %108, 16
  %110 = trunc i64 %109 to i8
  %111 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  %113 = getelementptr inbounds i8, ptr %112, i64 2
  store i8 %110, ptr %113, align 1, !tbaa !11
  %114 = load i64, ptr %26, align 8, !tbaa !12
  %115 = lshr i64 %114, 24
  %116 = trunc i64 %115 to i8
  %117 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %118 = getelementptr inbounds i8, ptr %117, i64 8
  %119 = getelementptr inbounds i8, ptr %118, i64 3
  store i8 %116, ptr %119, align 1, !tbaa !11
  %120 = load i64, ptr %26, align 8, !tbaa !12
  %121 = lshr i64 %120, 32
  %122 = trunc i64 %121 to i8
  %123 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %124 = getelementptr inbounds i8, ptr %123, i64 8
  %125 = getelementptr inbounds i8, ptr %124, i64 4
  store i8 %122, ptr %125, align 1, !tbaa !11
  %126 = load i64, ptr %26, align 8, !tbaa !12
  %127 = lshr i64 %126, 40
  %128 = trunc i64 %127 to i8
  %129 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %130 = getelementptr inbounds i8, ptr %129, i64 8
  %131 = getelementptr inbounds i8, ptr %130, i64 5
  store i8 %128, ptr %131, align 1, !tbaa !11
  %132 = load i64, ptr %26, align 8, !tbaa !12
  %133 = lshr i64 %132, 48
  %134 = trunc i64 %133 to i8
  %135 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %136 = getelementptr inbounds i8, ptr %135, i64 8
  %137 = getelementptr inbounds i8, ptr %136, i64 6
  store i8 %134, ptr %137, align 1, !tbaa !11
  %138 = load i64, ptr %26, align 8, !tbaa !12
  %139 = lshr i64 %138, 56
  %140 = trunc i64 %139 to i8
  %141 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %142 = getelementptr inbounds i8, ptr %141, i64 8
  %143 = getelementptr inbounds i8, ptr %142, i64 7
  store i8 %140, ptr %143, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %144

144:                                              ; preds = %94
  br label %145

145:                                              ; preds = %144
  %146 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  call void @poly1305_update(ptr noundef %22, ptr noundef %146, i64 noundef 16, i8 noundef zeroext 1)
  %147 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %148 = getelementptr inbounds [16 x i8], ptr %23, i64 0, i64 0
  call void @poly1305_finalize(ptr noundef %22, ptr noundef %147, ptr noundef %148)
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = getelementptr inbounds [64 x i8], ptr %21, i64 0, i64 0
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = load i64, ptr %154, align 8, !tbaa !9
  %156 = getelementptr inbounds i8, ptr %153, i64 %155
  %157 = call i32 @aead_check_tag(ptr noundef %149, i64 noundef %151, ptr noundef %152, ptr noundef %156, i32 noundef 16)
  store i32 %157, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %158

158:                                              ; preds = %145, %30
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #5
  %159 = load i32, ptr %10, align 4
  ret i32 %159
}

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

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

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

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

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

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

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

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

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #4

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 = { 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" }
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 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}


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

%union.chacha20_state_t = type { [16 x i32] }
%struct.poly1305_state_t = type { [5 x i32], [5 x i32], [4 x i32] }

@tag256 = external hidden local_unnamed_addr constant [17 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local i32 @internal_chachapoly_aead_decrypt(ptr noundef %0, ptr nocapture noundef %1, ptr nocapture noundef readnone %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, ptr nocapture noundef readonly %7, ptr nocapture noundef readonly %8) local_unnamed_addr #0 {
  %10 = alloca %union.chacha20_state_t, align 4
  %11 = alloca %union.chacha20_state_t, align 4
  %12 = alloca %struct.poly1305_state_t, align 4
  %13 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #5
  %14 = icmp ult i64 %4, 16
  br i1 %14, label %74, label %15

15:                                               ; preds = %9
  %16 = add i64 %4, -16
  store i64 %16, ptr %1, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 16 dereferenceable(16) @tag256, i64 16, i1 false)
  %17 = getelementptr inbounds i8, ptr %10, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %17, ptr noundef nonnull align 1 dereferenceable(32) %8, i64 32, i1 false)
  %18 = getelementptr inbounds i8, ptr %10, i64 48
  store i32 0, ptr %18, align 4, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %10, i64 52
  store i32 0, ptr %19, align 4, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %10, i64 56
  %21 = load i64, ptr %7, align 1
  store i64 %21, ptr %20, align 4
  call void @chachaCore(ptr noundef nonnull %11, ptr noundef nonnull %10)
  call void @poly1305_init(ptr noundef nonnull %12, ptr noundef nonnull %11)
  %22 = getelementptr inbounds i8, ptr %11, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(16) %22, i64 16, i1 false)
  call void @poly1305_update(ptr noundef nonnull %12, ptr noundef %5, i64 noundef %6, i8 noundef zeroext 0)
  %23 = load i64, ptr %1, align 8, !tbaa !5
  call void @poly1305_update(ptr noundef nonnull %12, ptr noundef %3, i64 noundef %23, i8 noundef zeroext 0)
  %24 = load i64, ptr %1, align 8, !tbaa !5
  call void @chacha_encrypt(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %0, ptr noundef %3, i64 noundef %24)
  %25 = trunc i64 %6 to i8
  store i8 %25, ptr %11, align 4, !tbaa !9
  %26 = lshr i64 %6, 8
  %27 = trunc i64 %26 to i8
  %28 = getelementptr inbounds i8, ptr %11, i64 1
  store i8 %27, ptr %28, align 1, !tbaa !9
  %29 = lshr i64 %6, 16
  %30 = trunc i64 %29 to i8
  %31 = getelementptr inbounds i8, ptr %11, i64 2
  store i8 %30, ptr %31, align 2, !tbaa !9
  %32 = lshr i64 %6, 24
  %33 = trunc i64 %32 to i8
  %34 = getelementptr inbounds i8, ptr %11, i64 3
  store i8 %33, ptr %34, align 1, !tbaa !9
  %35 = lshr i64 %6, 32
  %36 = trunc i64 %35 to i8
  %37 = getelementptr inbounds i8, ptr %11, i64 4
  store i8 %36, ptr %37, align 4, !tbaa !9
  %38 = lshr i64 %6, 40
  %39 = trunc i64 %38 to i8
  %40 = getelementptr inbounds i8, ptr %11, i64 5
  store i8 %39, ptr %40, align 1, !tbaa !9
  %41 = lshr i64 %6, 48
  %42 = trunc i64 %41 to i8
  %43 = getelementptr inbounds i8, ptr %11, i64 6
  store i8 %42, ptr %43, align 2, !tbaa !9
  %44 = lshr i64 %6, 56
  %45 = trunc nuw i64 %44 to i8
  %46 = getelementptr inbounds i8, ptr %11, i64 7
  store i8 %45, ptr %46, align 1, !tbaa !9
  %47 = load i64, ptr %1, align 8, !tbaa !5
  %48 = trunc i64 %47 to i8
  %49 = getelementptr inbounds i8, ptr %11, i64 8
  store i8 %48, ptr %49, align 4, !tbaa !9
  %50 = lshr i64 %47, 8
  %51 = trunc i64 %50 to i8
  %52 = getelementptr inbounds i8, ptr %11, i64 9
  store i8 %51, ptr %52, align 1, !tbaa !9
  %53 = lshr i64 %47, 16
  %54 = trunc i64 %53 to i8
  %55 = getelementptr inbounds i8, ptr %11, i64 10
  store i8 %54, ptr %55, align 2, !tbaa !9
  %56 = lshr i64 %47, 24
  %57 = trunc i64 %56 to i8
  %58 = getelementptr inbounds i8, ptr %11, i64 11
  store i8 %57, ptr %58, align 1, !tbaa !9
  %59 = lshr i64 %47, 32
  %60 = trunc i64 %59 to i8
  %61 = getelementptr inbounds i8, ptr %11, i64 12
  store i8 %60, ptr %61, align 4, !tbaa !9
  %62 = lshr i64 %47, 40
  %63 = trunc i64 %62 to i8
  %64 = getelementptr inbounds i8, ptr %11, i64 13
  store i8 %63, ptr %64, align 1, !tbaa !9
  %65 = lshr i64 %47, 48
  %66 = trunc i64 %65 to i8
  %67 = getelementptr inbounds i8, ptr %11, i64 14
  store i8 %66, ptr %67, align 2, !tbaa !9
  %68 = lshr i64 %47, 56
  %69 = trunc nuw i64 %68 to i8
  %70 = getelementptr inbounds i8, ptr %11, i64 15
  store i8 %69, ptr %70, align 1, !tbaa !9
  call void @poly1305_update(ptr noundef nonnull %12, ptr noundef nonnull %11, i64 noundef 16, i8 noundef zeroext 1)
  call void @poly1305_finalize(ptr noundef nonnull %12, ptr noundef nonnull %11, ptr noundef nonnull %13)
  %71 = load i64, ptr %1, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %3, i64 %71
  %73 = call i32 @aead_check_tag(ptr noundef %0, i64 noundef %71, ptr noundef nonnull %11, ptr noundef %72, i32 noundef 16) #5
  br label %74

74:                                               ; preds = %9, %15
  %.0 = phi i32 [ %73, %15 ], [ -1, %9 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #5
  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

; 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: nounwind uwtable
declare hidden void @chachaCore(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

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

declare i32 @aead_check_tag(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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 = { 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" }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass