; LLVM IR from trustwallet/wallet-core :: trezor-crypto/crypto/chacha20poly1305 (poly1305-donna)

; 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.poly1305_context = type { i64, [136 x i8] }

@__const.poly1305_power_on_self_test.nacl_key = external hidden unnamed_addr constant [32 x i8], align 16
@__const.poly1305_power_on_self_test.nacl_msg = external hidden unnamed_addr constant [131 x i8], align 16
@__const.poly1305_power_on_self_test.nacl_mac = external hidden unnamed_addr constant [16 x i8], align 16
@__const.poly1305_power_on_self_test.wrap_key = external hidden unnamed_addr constant <{ i8, [31 x i8] }>, align 16
@__const.poly1305_power_on_self_test.wrap_msg = external hidden unnamed_addr constant [16 x i8], align 16
@__const.poly1305_power_on_self_test.wrap_mac = external hidden unnamed_addr constant <{ i8, [15 x i8] }>, align 16
@__const.poly1305_power_on_self_test.total_key = external hidden unnamed_addr constant [32 x i8], align 16
@__const.poly1305_power_on_self_test.total_mac = external hidden unnamed_addr constant [16 x i8], align 16

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

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

; Function Attrs: noinline nounwind uwtable
declare dso_local void @poly1305_finish(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @poly1305_auth(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @poly1305_verify(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @poly1305_power_on_self_test() #0 {
  %1 = alloca [32 x i8], align 16
  %2 = alloca [131 x i8], align 16
  %3 = alloca [16 x i8], align 16
  %4 = alloca [32 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca [16 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca [16 x i8], align 16
  %9 = alloca %struct.poly1305_context, align 8
  %10 = alloca %struct.poly1305_context, align 8
  %11 = alloca [32 x i8], align 16
  %12 = alloca [256 x i8], align 16
  %13 = alloca [16 x i8], align 16
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %1, ptr align 16 @__const.poly1305_power_on_self_test.nacl_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 131, ptr %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.poly1305_power_on_self_test.nacl_msg, i64 131, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.poly1305_power_on_self_test.nacl_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.poly1305_power_on_self_test.wrap_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.poly1305_power_on_self_test.wrap_msg, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.poly1305_power_on_self_test.wrap_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.poly1305_power_on_self_test.total_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 @__const.poly1305_power_on_self_test.total_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr %9) #5
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %23, %0
  %18 = load i64, ptr %14, align 8, !tbaa !5
  %19 = icmp ult i64 %18, 16
  br i1 %19, label %20, label %26

20:                                               ; preds = %17
  %21 = load i64, ptr %14, align 8, !tbaa !5
  %22 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 %21
  store i8 0, ptr %22, align 1, !tbaa !11
  br label %23

23:                                               ; preds = %20
  %24 = load i64, ptr %14, align 8, !tbaa !5
  %25 = add i64 %24, 1
  store i64 %25, ptr %14, align 8, !tbaa !5
  br label %17, !llvm.loop !12

26:                                               ; preds = %17
  %27 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %28 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %29 = getelementptr inbounds [32 x i8], ptr %1, i64 0, i64 0
  call void @poly1305_auth(ptr noundef %27, ptr noundef %28, i64 noundef 131, ptr noundef %29)
  %30 = getelementptr inbounds [16 x i8], ptr %3, i64 0, i64 0
  %31 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %32 = call i32 @poly1305_verify(ptr noundef %30, ptr noundef %31)
  %33 = load i32, ptr %16, align 4, !tbaa !9
  %34 = and i32 %33, %32
  store i32 %34, ptr %16, align 4, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %41, %26
  %36 = load i64, ptr %14, align 8, !tbaa !5
  %37 = icmp ult i64 %36, 16
  br i1 %37, label %38, label %44

38:                                               ; preds = %35
  %39 = load i64, ptr %14, align 8, !tbaa !5
  %40 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 %39
  store i8 0, ptr %40, align 1, !tbaa !11
  br label %41

41:                                               ; preds = %38
  %42 = load i64, ptr %14, align 8, !tbaa !5
  %43 = add i64 %42, 1
  store i64 %43, ptr %14, align 8, !tbaa !5
  br label %35, !llvm.loop !14

44:                                               ; preds = %35
  %45 = getelementptr inbounds [32 x i8], ptr %1, i64 0, i64 0
  call void @poly1305_init(ptr noundef %9, ptr noundef %45)
  %46 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 0
  call void @poly1305_update(ptr noundef %9, ptr noundef %47, i64 noundef 32)
  %48 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 32
  call void @poly1305_update(ptr noundef %9, ptr noundef %49, i64 noundef 64)
  %50 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %51 = getelementptr inbounds i8, ptr %50, i64 96
  call void @poly1305_update(ptr noundef %9, ptr noundef %51, i64 noundef 16)
  %52 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 112
  call void @poly1305_update(ptr noundef %9, ptr noundef %53, i64 noundef 8)
  %54 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 120
  call void @poly1305_update(ptr noundef %9, ptr noundef %55, i64 noundef 4)
  %56 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %57 = getelementptr inbounds i8, ptr %56, i64 124
  call void @poly1305_update(ptr noundef %9, ptr noundef %57, i64 noundef 2)
  %58 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %59 = getelementptr inbounds i8, ptr %58, i64 126
  call void @poly1305_update(ptr noundef %9, ptr noundef %59, i64 noundef 1)
  %60 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 127
  call void @poly1305_update(ptr noundef %9, ptr noundef %61, i64 noundef 1)
  %62 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %63 = getelementptr inbounds i8, ptr %62, i64 128
  call void @poly1305_update(ptr noundef %9, ptr noundef %63, i64 noundef 1)
  %64 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %65 = getelementptr inbounds i8, ptr %64, i64 129
  call void @poly1305_update(ptr noundef %9, ptr noundef %65, i64 noundef 1)
  %66 = getelementptr inbounds [131 x i8], ptr %2, i64 0, i64 0
  %67 = getelementptr inbounds i8, ptr %66, i64 130
  call void @poly1305_update(ptr noundef %9, ptr noundef %67, i64 noundef 1)
  %68 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  call void @poly1305_finish(ptr noundef %9, ptr noundef %68)
  %69 = getelementptr inbounds [16 x i8], ptr %3, i64 0, i64 0
  %70 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %71 = call i32 @poly1305_verify(ptr noundef %69, ptr noundef %70)
  %72 = load i32, ptr %16, align 4, !tbaa !9
  %73 = and i32 %72, %71
  store i32 %73, ptr %16, align 4, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %80, %44
  %75 = load i64, ptr %14, align 8, !tbaa !5
  %76 = icmp ult i64 %75, 16
  br i1 %76, label %77, label %83

77:                                               ; preds = %74
  %78 = load i64, ptr %14, align 8, !tbaa !5
  %79 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 %78
  store i8 0, ptr %79, align 1, !tbaa !11
  br label %80

80:                                               ; preds = %77
  %81 = load i64, ptr %14, align 8, !tbaa !5
  %82 = add i64 %81, 1
  store i64 %82, ptr %14, align 8, !tbaa !5
  br label %74, !llvm.loop !15

83:                                               ; preds = %74
  %84 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %85 = getelementptr inbounds [16 x i8], ptr %5, i64 0, i64 0
  %86 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  call void @poly1305_auth(ptr noundef %84, ptr noundef %85, i64 noundef 16, ptr noundef %86)
  %87 = getelementptr inbounds [16 x i8], ptr %6, i64 0, i64 0
  %88 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %89 = call i32 @poly1305_verify(ptr noundef %87, ptr noundef %88)
  %90 = load i32, ptr %16, align 4, !tbaa !9
  %91 = and i32 %90, %89
  store i32 %91, ptr %16, align 4, !tbaa !9
  %92 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @poly1305_init(ptr noundef %10, ptr noundef %92)
  store i64 0, ptr %14, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %127, %83
  %94 = load i64, ptr %14, align 8, !tbaa !5
  %95 = icmp ult i64 %94, 256
  br i1 %95, label %96, label %130

96:                                               ; preds = %93
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %105, %96
  %98 = load i64, ptr %15, align 8, !tbaa !5
  %99 = icmp ult i64 %98, 32
  br i1 %99, label %100, label %108

100:                                              ; preds = %97
  %101 = load i64, ptr %14, align 8, !tbaa !5
  %102 = trunc i64 %101 to i8
  %103 = load i64, ptr %15, align 8, !tbaa !5
  %104 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 %103
  store i8 %102, ptr %104, align 1, !tbaa !11
  br label %105

105:                                              ; preds = %100
  %106 = load i64, ptr %15, align 8, !tbaa !5
  %107 = add i64 %106, 1
  store i64 %107, ptr %15, align 8, !tbaa !5
  br label %97, !llvm.loop !16

108:                                              ; preds = %97
  store i64 0, ptr %15, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %118, %108
  %110 = load i64, ptr %15, align 8, !tbaa !5
  %111 = load i64, ptr %14, align 8, !tbaa !5
  %112 = icmp ult i64 %110, %111
  br i1 %112, label %113, label %121

113:                                              ; preds = %109
  %114 = load i64, ptr %14, align 8, !tbaa !5
  %115 = trunc i64 %114 to i8
  %116 = load i64, ptr %15, align 8, !tbaa !5
  %117 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 %116
  store i8 %115, ptr %117, align 1, !tbaa !11
  br label %118

118:                                              ; preds = %113
  %119 = load i64, ptr %15, align 8, !tbaa !5
  %120 = add i64 %119, 1
  store i64 %120, ptr %15, align 8, !tbaa !5
  br label %109, !llvm.loop !17

121:                                              ; preds = %109
  %122 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %123 = getelementptr inbounds [256 x i8], ptr %12, i64 0, i64 0
  %124 = load i64, ptr %14, align 8, !tbaa !5
  %125 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  call void @poly1305_auth(ptr noundef %122, ptr noundef %123, i64 noundef %124, ptr noundef %125)
  %126 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  call void @poly1305_update(ptr noundef %10, ptr noundef %126, i64 noundef 16)
  br label %127

127:                                              ; preds = %121
  %128 = load i64, ptr %14, align 8, !tbaa !5
  %129 = add i64 %128, 1
  store i64 %129, ptr %14, align 8, !tbaa !5
  br label %93, !llvm.loop !18

130:                                              ; preds = %93
  %131 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  call void @poly1305_finish(ptr noundef %10, ptr noundef %131)
  %132 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 0
  %133 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %134 = call i32 @poly1305_verify(ptr noundef %132, ptr noundef %133)
  %135 = load i32, ptr %16, align 4, !tbaa !9
  %136 = and i32 %135, %134
  store i32 %136, ptr %16, align 4, !tbaa !9
  %137 = load i32, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  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 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 131, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #5
  ret i32 %137
}

; 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) #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 = { noinline 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: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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", !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}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !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"

%struct.poly1305_context = type { i64, [136 x i8] }

@__const.poly1305_power_on_self_test.nacl_key = external hidden unnamed_addr constant [32 x i8], align 16
@__const.poly1305_power_on_self_test.nacl_msg = external hidden unnamed_addr constant [131 x i8], align 16
@__const.poly1305_power_on_self_test.nacl_mac = external hidden unnamed_addr constant [16 x i8], align 16
@__const.poly1305_power_on_self_test.wrap_key = external hidden unnamed_addr constant <{ i8, [31 x i8] }>, align 16
@__const.poly1305_power_on_self_test.wrap_msg = external hidden unnamed_addr constant [16 x i8], align 16
@__const.poly1305_power_on_self_test.wrap_mac = external hidden unnamed_addr constant <{ i8, [15 x i8] }>, align 16
@__const.poly1305_power_on_self_test.total_key = external hidden unnamed_addr constant [32 x i8], align 16
@__const.poly1305_power_on_self_test.total_mac = external hidden unnamed_addr constant [16 x i8], align 16

; Function Attrs: nounwind uwtable
declare dso_local void @poly1305_init(ptr noundef, ptr noundef) local_unnamed_addr #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: noinline nounwind uwtable
declare dso_local void @poly1305_finish(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @poly1305_auth(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @poly1305_verify(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @poly1305_power_on_self_test() local_unnamed_addr #0 {
.preheader28.peel.next:
  %0 = alloca [32 x i8], align 16
  %1 = alloca [131 x i8], align 16
  %2 = alloca [16 x i8], align 16
  %3 = alloca [32 x i8], align 16
  %4 = alloca [16 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca [32 x i8], align 16
  %7 = alloca [16 x i8], align 16
  %8 = alloca %struct.poly1305_context, align 8
  %9 = alloca %struct.poly1305_context, align 8
  %10 = alloca [32 x i8], align 16
  %11 = alloca [256 x i8], align 16
  %12 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %0) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %0, ptr noundef nonnull align 16 dereferenceable(32) @__const.poly1305_power_on_self_test.nacl_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 131, ptr nonnull %1) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(131) %1, ptr noundef nonnull align 16 dereferenceable(131) @__const.poly1305_power_on_self_test.nacl_msg, i64 131, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %2, ptr noundef nonnull align 16 dereferenceable(16) @__const.poly1305_power_on_self_test.nacl_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %3, ptr noundef nonnull align 16 dereferenceable(32) @__const.poly1305_power_on_self_test.wrap_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) @__const.poly1305_power_on_self_test.wrap_msg, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) @__const.poly1305_power_on_self_test.wrap_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 16 dereferenceable(32) @__const.poly1305_power_on_self_test.total_key, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) @__const.poly1305_power_on_self_test.total_mac, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %8) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(144) %8, i8 0, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %9) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(144) %9, i8 0, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %11) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %11, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %12, i8 0, i64 16, i1 false)
  call void @poly1305_auth(ptr noundef nonnull %12, ptr noundef nonnull %1, i64 noundef 131, ptr noundef nonnull %0)
  %13 = call i32 @poly1305_verify(ptr noundef nonnull %2, ptr noundef nonnull %12)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %12, i8 0, i64 16, i1 false), !tbaa !5
  call void @poly1305_init(ptr noundef nonnull %8, ptr noundef nonnull %0)
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %1, i64 noundef 32)
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %14, i64 noundef 64)
  %15 = getelementptr inbounds i8, ptr %1, i64 96
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %15, i64 noundef 16)
  %16 = getelementptr inbounds i8, ptr %1, i64 112
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %16, i64 noundef 8)
  %17 = getelementptr inbounds i8, ptr %1, i64 120
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %17, i64 noundef 4)
  %18 = getelementptr inbounds i8, ptr %1, i64 124
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %18, i64 noundef 2)
  %19 = getelementptr inbounds i8, ptr %1, i64 126
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %19, i64 noundef 1)
  %20 = getelementptr inbounds i8, ptr %1, i64 127
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %20, i64 noundef 1)
  %21 = getelementptr inbounds i8, ptr %1, i64 128
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %21, i64 noundef 1)
  %22 = getelementptr inbounds i8, ptr %1, i64 129
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %22, i64 noundef 1)
  %23 = getelementptr inbounds i8, ptr %1, i64 130
  call void @poly1305_update(ptr noundef nonnull %8, ptr noundef nonnull %23, i64 noundef 1)
  call void @poly1305_finish(ptr noundef nonnull %8, ptr noundef nonnull %12)
  %24 = call i32 @poly1305_verify(ptr noundef nonnull %2, ptr noundef nonnull %12)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %12, i8 0, i64 16, i1 false), !tbaa !5
  call void @poly1305_auth(ptr noundef nonnull %12, ptr noundef nonnull %4, i64 noundef 16, ptr noundef nonnull %3)
  %25 = call i32 @poly1305_verify(ptr noundef nonnull %5, ptr noundef nonnull %12)
  call void @poly1305_init(ptr noundef nonnull %9, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, i8 0, i64 32, i1 false), !tbaa !5
  call void @poly1305_auth(ptr noundef nonnull %12, ptr noundef nonnull %11, i64 noundef 0, ptr noundef nonnull %10)
  call void @poly1305_update(ptr noundef nonnull %9, ptr noundef nonnull %12, i64 noundef 16)
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader28.peel.next, %._crit_edge
  %.334 = phi i64 [ 1, %.preheader28.peel.next ], [ %27, %._crit_edge ]
  %26 = trunc nuw i64 %.334 to i8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, i8 %26, i64 32, i1 false), !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %11, i8 %26, i64 %.334, i1 false), !tbaa !5
  call void @poly1305_auth(ptr noundef nonnull %12, ptr noundef nonnull %11, i64 noundef %.334, ptr noundef nonnull %10)
  call void @poly1305_update(ptr noundef nonnull %9, ptr noundef nonnull %12, i64 noundef 16)
  %27 = add nuw nsw i64 %.334, 1
  %exitcond.not = icmp eq i64 %27, 256
  br i1 %exitcond.not, label %.loopexit, label %._crit_edge, !llvm.loop !8

.loopexit:                                        ; preds = %._crit_edge
  %28 = and i32 %13, 1
  %29 = and i32 %28, %24
  %30 = and i32 %29, %25
  call void @poly1305_finish(ptr noundef nonnull %9, ptr noundef nonnull %12)
  %31 = call i32 @poly1305_verify(ptr noundef nonnull %7, ptr noundef nonnull %12)
  %32 = and i32 %30, %31
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 131, ptr nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %0) #5
  ret i32 %32
}

; 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) #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 = { noinline 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: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,SCCPPass,SROAPass,SimplifyCFGPass