; LLVM IR from kcchu/rust-tweetnacl :: tweetnacl (crypto_sign_ed25519_tweet_open)

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @crypto_verify_32_tweet(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: nounwind uwtable
declare dso_local i32 @crypto_hash_sha512_tweet(ptr noundef, ptr noundef, i64 noundef) #0

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

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

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

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

21:                                               ; preds = %5
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %125

22:                                               ; preds = %5
  %23 = getelementptr inbounds [4 x [16 x i64]], ptr %16, i64 0, i64 0
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = call i32 @unpackneg(ptr noundef %23, ptr noundef %24)
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %125

28:                                               ; preds = %22
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %44, %28
  %30 = load i32, ptr %12, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = load i64, ptr %10, align 8, !tbaa !9
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %34, label %47

34:                                               ; preds = %29
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load i32, ptr %12, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %35, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !13
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i32, ptr %12, align 4, !tbaa !11
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %40, i64 %42
  store i8 %39, ptr %43, align 1, !tbaa !13
  br label %44

44:                                               ; preds = %34
  %45 = load i32, ptr %12, align 4, !tbaa !11
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %12, align 4, !tbaa !11
  br label %29, !llvm.loop !14

47:                                               ; preds = %29
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %62, %47
  %49 = load i32, ptr %12, align 4, !tbaa !11
  %50 = icmp slt i32 %49, 32
  br i1 %50, label %51, label %65

51:                                               ; preds = %48
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = load i32, ptr %12, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !13
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !11
  %59 = add nsw i32 %58, 32
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %57, i64 %60
  store i8 %56, ptr %61, align 1, !tbaa !13
  br label %62

62:                                               ; preds = %51
  %63 = load i32, ptr %12, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %12, align 4, !tbaa !11
  br label %48, !llvm.loop !16

65:                                               ; preds = %48
  %66 = getelementptr inbounds [64 x i8], ptr %14, i64 0, i64 0
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i64, ptr %10, align 8, !tbaa !9
  %69 = call i32 @crypto_hash_sha512_tweet(ptr noundef %66, ptr noundef %67, i64 noundef %68)
  %70 = getelementptr inbounds [64 x i8], ptr %14, i64 0, i64 0
  call void @reduce(ptr noundef %70)
  %71 = getelementptr inbounds [4 x [16 x i64]], ptr %15, i64 0, i64 0
  %72 = getelementptr inbounds [4 x [16 x i64]], ptr %16, i64 0, i64 0
  %73 = getelementptr inbounds [64 x i8], ptr %14, i64 0, i64 0
  call void @scalarmult(ptr noundef %71, ptr noundef %72, ptr noundef %73)
  %74 = getelementptr inbounds [4 x [16 x i64]], ptr %16, i64 0, i64 0
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i64 32
  call void @scalarbase(ptr noundef %74, ptr noundef %76)
  %77 = getelementptr inbounds [4 x [16 x i64]], ptr %15, i64 0, i64 0
  %78 = getelementptr inbounds [4 x [16 x i64]], ptr %16, i64 0, i64 0
  call void @add(ptr noundef %77, ptr noundef %78)
  %79 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %80 = getelementptr inbounds [4 x [16 x i64]], ptr %15, i64 0, i64 0
  call void @pack(ptr noundef %79, ptr noundef %80)
  %81 = load i64, ptr %10, align 8, !tbaa !9
  %82 = sub i64 %81, 64
  store i64 %82, ptr %10, align 8, !tbaa !9
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  %85 = call i32 @crypto_verify_32_tweet(ptr noundef %83, ptr noundef %84)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %102

87:                                               ; preds = %65
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %88

88:                                               ; preds = %98, %87
  %89 = load i32, ptr %12, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr %10, align 8, !tbaa !9
  %92 = icmp ult i64 %90, %91
  br i1 %92, label %93, label %101

93:                                               ; preds = %88
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %94, i64 %96
  store i8 0, ptr %97, align 1, !tbaa !13
  br label %98

98:                                               ; preds = %93
  %99 = load i32, ptr %12, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %12, align 4, !tbaa !11
  br label %88, !llvm.loop !17

101:                                              ; preds = %88
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %125

102:                                              ; preds = %65
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %119, %102
  %104 = load i32, ptr %12, align 4, !tbaa !11
  %105 = sext i32 %104 to i64
  %106 = load i64, ptr %10, align 8, !tbaa !9
  %107 = icmp ult i64 %105, %106
  br i1 %107, label %108, label %122

108:                                              ; preds = %103
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = load i32, ptr %12, align 4, !tbaa !11
  %111 = add nsw i32 %110, 64
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %109, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load i32, ptr %12, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i8, ptr %115, i64 %117
  store i8 %114, ptr %118, align 1, !tbaa !13
  br label %119

119:                                              ; preds = %108
  %120 = load i32, ptr %12, align 4, !tbaa !11
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %12, align 4, !tbaa !11
  br label %103, !llvm.loop !18

122:                                              ; preds = %103
  %123 = load i64, ptr %10, align 8, !tbaa !9
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %123, ptr %124, align 8, !tbaa !9
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %125

125:                                              ; preds = %122, %101, %27, %21
  call void @llvm.lifetime.end.p0(i64 512, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 512, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  %126 = load i32, ptr %6, align 4
  ret i32 %126
}

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

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

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

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 = { 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 = !{!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 = distinct !{!18, !15}


; 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: nounwind uwtable
declare dso_local i32 @crypto_verify_32_tweet(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: nounwind uwtable
declare dso_local i32 @crypto_hash_sha512_tweet(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @crypto_sign_ed25519_tweet_open(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr noundef %2, i64 noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = ptrtoint ptr %2 to i64
  %7 = ptrtoint ptr %0 to i64
  %8 = ptrtoint ptr %2 to i64
  %9 = ptrtoint ptr %0 to i64
  %10 = alloca [32 x i8], align 16
  %11 = alloca [64 x i8], align 16
  %12 = alloca [4 x [16 x i64]], align 16
  %13 = alloca [4 x [16 x i64]], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %13) #3
  store i64 -1, ptr %1, align 8, !tbaa !5
  %14 = icmp ult i64 %3, 64
  br i1 %14, label %.loopexit, label %15

15:                                               ; preds = %5
  %16 = call i32 @unpackneg(ptr noundef nonnull %13, ptr noundef %4)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %vector.memcheck, label %.loopexit

vector.memcheck:                                  ; preds = %15
  %17 = sub i64 %9, %8
  %diff.check = icmp ult i64 %17, 32
  br i1 %diff.check, label %.preheader44.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %3, -32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %18 = getelementptr inbounds i8, ptr %2, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %wide.load = load <16 x i8>, ptr %18, align 1, !tbaa !9
  %wide.load65 = load <16 x i8>, ptr %19, align 1, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %0, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <16 x i8> %wide.load, ptr %20, align 1, !tbaa !9
  store <16 x i8> %wide.load65, ptr %21, align 1, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %3
  br i1 %cmp.n, label %.preheader43.preheader, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %3, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.preheader44.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vec.epilog.iter.check
  %n.vec67 = and i64 %3, -8
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index68 = phi i64 [ %n.vec, %vec.epilog.ph ], [ %index.next70, %vec.epilog.vector.body ]
  %23 = getelementptr inbounds i8, ptr %2, i64 %index68
  %wide.load69 = load <8 x i8>, ptr %23, align 1, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %0, i64 %index68
  store <8 x i8> %wide.load69, ptr %24, align 1, !tbaa !9
  %index.next70 = add nuw i64 %index68, 8
  %25 = icmp eq i64 %index.next70, %n.vec67
  br i1 %25, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n71 = icmp eq i64 %n.vec67, %3
  br i1 %cmp.n71, label %.preheader43.preheader, label %.preheader44.preheader

.preheader44.preheader:                           ; preds = %vec.epilog.middle.block, %vector.memcheck, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec67, %vec.epilog.middle.block ]
  %xtraiter = and i64 %3, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader44.prol.loopexit, label %.preheader44.prol

.preheader44.prol:                                ; preds = %.preheader44.preheader, %.preheader44.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.preheader44.prol ], [ %indvars.iv.ph, %.preheader44.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.preheader44.prol ], [ 0, %.preheader44.preheader ]
  %26 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.prol
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.prol
  store i8 %27, ptr %28, align 1, !tbaa !9
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.preheader44.prol.loopexit, label %.preheader44.prol, !llvm.loop !15

.preheader44.prol.loopexit:                       ; preds = %.preheader44.prol, %.preheader44.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.preheader44.preheader ], [ %indvars.iv.next.prol, %.preheader44.prol ]
  %29 = sub i64 %indvars.iv.ph, %3
  %30 = icmp ugt i64 %29, -4
  br i1 %30, label %.preheader43.preheader, label %.preheader44

.preheader44:                                     ; preds = %.preheader44.prol.loopexit, %.preheader44
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader44 ], [ %indvars.iv.unr, %.preheader44.prol.loopexit ]
  %31 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv
  store i8 %32, ptr %33, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next
  store i8 %35, ptr %36, align 1, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %37 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next.1
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next.1
  store i8 %38, ptr %39, align 1, !tbaa !9
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %40 = getelementptr inbounds i8, ptr %2, i64 %indvars.iv.next.2
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next.2
  store i8 %41, ptr %42, align 1, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %3
  br i1 %exitcond.not.3, label %.preheader43.preheader, label %.preheader44, !llvm.loop !17

.preheader43.preheader:                           ; preds = %.preheader44.prol.loopexit, %.preheader44, %vec.epilog.middle.block, %middle.block
  %43 = load i8, ptr %4, align 1, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 %43, ptr %44, align 1, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %4, i64 1
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %0, i64 33
  store i8 %46, ptr %47, align 1, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %4, i64 2
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %0, i64 34
  store i8 %49, ptr %50, align 1, !tbaa !9
  %51 = getelementptr inbounds i8, ptr %4, i64 3
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = getelementptr inbounds i8, ptr %0, i64 35
  store i8 %52, ptr %53, align 1, !tbaa !9
  %54 = getelementptr inbounds i8, ptr %4, i64 4
  %55 = load i8, ptr %54, align 1, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %0, i64 36
  store i8 %55, ptr %56, align 1, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %4, i64 5
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %0, i64 37
  store i8 %58, ptr %59, align 1, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %4, i64 6
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %0, i64 38
  store i8 %61, ptr %62, align 1, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %4, i64 7
  %64 = load i8, ptr %63, align 1, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %0, i64 39
  store i8 %64, ptr %65, align 1, !tbaa !9
  %66 = getelementptr inbounds i8, ptr %4, i64 8
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 %67, ptr %68, align 1, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %4, i64 9
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %0, i64 41
  store i8 %70, ptr %71, align 1, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %4, i64 10
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %0, i64 42
  store i8 %73, ptr %74, align 1, !tbaa !9
  %75 = getelementptr inbounds i8, ptr %4, i64 11
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %0, i64 43
  store i8 %76, ptr %77, align 1, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %4, i64 12
  %79 = load i8, ptr %78, align 1, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %0, i64 44
  store i8 %79, ptr %80, align 1, !tbaa !9
  %81 = getelementptr inbounds i8, ptr %4, i64 13
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = getelementptr inbounds i8, ptr %0, i64 45
  store i8 %82, ptr %83, align 1, !tbaa !9
  %84 = getelementptr inbounds i8, ptr %4, i64 14
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = getelementptr inbounds i8, ptr %0, i64 46
  store i8 %85, ptr %86, align 1, !tbaa !9
  %87 = getelementptr inbounds i8, ptr %4, i64 15
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %0, i64 47
  store i8 %88, ptr %89, align 1, !tbaa !9
  %90 = getelementptr inbounds i8, ptr %4, i64 16
  %91 = load i8, ptr %90, align 1, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 %91, ptr %92, align 1, !tbaa !9
  %93 = getelementptr inbounds i8, ptr %4, i64 17
  %94 = load i8, ptr %93, align 1, !tbaa !9
  %95 = getelementptr inbounds i8, ptr %0, i64 49
  store i8 %94, ptr %95, align 1, !tbaa !9
  %96 = getelementptr inbounds i8, ptr %4, i64 18
  %97 = load i8, ptr %96, align 1, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %0, i64 50
  store i8 %97, ptr %98, align 1, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %4, i64 19
  %100 = load i8, ptr %99, align 1, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %0, i64 51
  store i8 %100, ptr %101, align 1, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %4, i64 20
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = getelementptr inbounds i8, ptr %0, i64 52
  store i8 %103, ptr %104, align 1, !tbaa !9
  %105 = getelementptr inbounds i8, ptr %4, i64 21
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %0, i64 53
  store i8 %106, ptr %107, align 1, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %4, i64 22
  %109 = load i8, ptr %108, align 1, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %0, i64 54
  store i8 %109, ptr %110, align 1, !tbaa !9
  %111 = getelementptr inbounds i8, ptr %4, i64 23
  %112 = load i8, ptr %111, align 1, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %0, i64 55
  store i8 %112, ptr %113, align 1, !tbaa !9
  %114 = getelementptr inbounds i8, ptr %4, i64 24
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = getelementptr inbounds i8, ptr %0, i64 56
  store i8 %115, ptr %116, align 1, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %4, i64 25
  %118 = load i8, ptr %117, align 1, !tbaa !9
  %119 = getelementptr inbounds i8, ptr %0, i64 57
  store i8 %118, ptr %119, align 1, !tbaa !9
  %120 = getelementptr inbounds i8, ptr %4, i64 26
  %121 = load i8, ptr %120, align 1, !tbaa !9
  %122 = getelementptr inbounds i8, ptr %0, i64 58
  store i8 %121, ptr %122, align 1, !tbaa !9
  %123 = getelementptr inbounds i8, ptr %4, i64 27
  %124 = load i8, ptr %123, align 1, !tbaa !9
  %125 = getelementptr inbounds i8, ptr %0, i64 59
  store i8 %124, ptr %125, align 1, !tbaa !9
  %126 = getelementptr inbounds i8, ptr %4, i64 28
  %127 = load i8, ptr %126, align 1, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %0, i64 60
  store i8 %127, ptr %128, align 1, !tbaa !9
  %129 = getelementptr inbounds i8, ptr %4, i64 29
  %130 = load i8, ptr %129, align 1, !tbaa !9
  %131 = getelementptr inbounds i8, ptr %0, i64 61
  store i8 %130, ptr %131, align 1, !tbaa !9
  %132 = getelementptr inbounds i8, ptr %4, i64 30
  %133 = load i8, ptr %132, align 1, !tbaa !9
  %134 = getelementptr inbounds i8, ptr %0, i64 62
  store i8 %133, ptr %134, align 1, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %4, i64 31
  %136 = load i8, ptr %135, align 1, !tbaa !9
  %137 = getelementptr inbounds i8, ptr %0, i64 63
  store i8 %136, ptr %137, align 1, !tbaa !9
  %138 = call i32 @crypto_hash_sha512_tweet(ptr noundef nonnull %11, ptr noundef nonnull %0, i64 noundef %3)
  call void @reduce(ptr noundef nonnull %11)
  call void @scalarmult(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %11)
  %139 = getelementptr inbounds i8, ptr %2, i64 32
  call void @scalarbase(ptr noundef nonnull %13, ptr noundef nonnull %139)
  call void @add(ptr noundef nonnull %12, ptr noundef nonnull %13)
  call void @pack(ptr noundef nonnull %10, ptr noundef nonnull %12)
  %140 = add i64 %3, -64
  %141 = call i32 @crypto_verify_32_tweet(ptr noundef nonnull %2, ptr noundef nonnull %10)
  %.not41 = icmp eq i32 %141, 0
  br i1 %.not41, label %.preheader, label %.preheader42

.preheader42:                                     ; preds = %.preheader43.preheader
  %.not50 = icmp eq i64 %140, 0
  br i1 %.not50, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader42
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %0, i8 0, i64 %140, i1 false), !tbaa !9
  br label %.loopexit

.preheader:                                       ; preds = %.preheader43.preheader
  %invariant.gep = getelementptr i8, ptr %2, i64 64
  %.not51 = icmp eq i64 %140, 0
  br i1 %.not51, label %._crit_edge, label %iter.check77

iter.check77:                                     ; preds = %.preheader
  %min.iters.check75 = icmp ult i64 %140, 8
  br i1 %min.iters.check75, label %.lr.ph49.preheader, label %vector.memcheck72

vector.memcheck72:                                ; preds = %iter.check77
  %142 = add i64 %7, -64
  %143 = sub i64 %142, %6
  %diff.check73 = icmp ult i64 %143, 32
  br i1 %diff.check73, label %.lr.ph49.preheader, label %vector.main.loop.iter.check79

vector.main.loop.iter.check79:                    ; preds = %vector.memcheck72
  %min.iters.check78 = icmp ult i64 %140, 32
  br i1 %min.iters.check78, label %vec.epilog.ph91, label %vector.ph80

vector.ph80:                                      ; preds = %vector.main.loop.iter.check79
  %n.vec82 = and i64 %140, -32
  br label %vector.body83

vector.body83:                                    ; preds = %vector.body83, %vector.ph80
  %index84 = phi i64 [ 0, %vector.ph80 ], [ %index.next87, %vector.body83 ]
  %144 = getelementptr inbounds i8, ptr %invariant.gep, i64 %index84
  %145 = getelementptr inbounds i8, ptr %144, i64 16
  %wide.load85 = load <16 x i8>, ptr %144, align 1, !tbaa !9
  %wide.load86 = load <16 x i8>, ptr %145, align 1, !tbaa !9
  %146 = getelementptr inbounds i8, ptr %0, i64 %index84
  %147 = getelementptr inbounds i8, ptr %146, i64 16
  store <16 x i8> %wide.load85, ptr %146, align 1, !tbaa !9
  store <16 x i8> %wide.load86, ptr %147, align 1, !tbaa !9
  %index.next87 = add nuw i64 %index84, 32
  %148 = icmp eq i64 %index.next87, %n.vec82
  br i1 %148, label %middle.block74, label %vector.body83, !llvm.loop !18

middle.block74:                                   ; preds = %vector.body83
  %cmp.n88 = icmp eq i64 %140, %n.vec82
  br i1 %cmp.n88, label %._crit_edge, label %vec.epilog.iter.check92

vec.epilog.iter.check92:                          ; preds = %middle.block74
  %n.vec.remaining93 = and i64 %3, 24
  %min.epilog.iters.check94 = icmp eq i64 %n.vec.remaining93, 0
  br i1 %min.epilog.iters.check94, label %.lr.ph49.preheader, label %vec.epilog.ph91

vec.epilog.ph91:                                  ; preds = %vector.main.loop.iter.check79, %vec.epilog.iter.check92
  %vec.epilog.resume.val95 = phi i64 [ %n.vec82, %vec.epilog.iter.check92 ], [ 0, %vector.main.loop.iter.check79 ]
  %n.vec97 = and i64 %140, -8
  br label %vec.epilog.vector.body99

vec.epilog.vector.body99:                         ; preds = %vec.epilog.vector.body99, %vec.epilog.ph91
  %index100 = phi i64 [ %vec.epilog.resume.val95, %vec.epilog.ph91 ], [ %index.next102, %vec.epilog.vector.body99 ]
  %149 = getelementptr inbounds i8, ptr %invariant.gep, i64 %index100
  %wide.load101 = load <8 x i8>, ptr %149, align 1, !tbaa !9
  %150 = getelementptr inbounds i8, ptr %0, i64 %index100
  store <8 x i8> %wide.load101, ptr %150, align 1, !tbaa !9
  %index.next102 = add nuw i64 %index100, 8
  %151 = icmp eq i64 %index.next102, %n.vec97
  br i1 %151, label %vec.epilog.middle.block89, label %vec.epilog.vector.body99, !llvm.loop !19

vec.epilog.middle.block89:                        ; preds = %vec.epilog.vector.body99
  %cmp.n103 = icmp eq i64 %140, %n.vec97
  br i1 %cmp.n103, label %._crit_edge, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %vec.epilog.middle.block89, %vector.memcheck72, %iter.check77, %vec.epilog.iter.check92
  %indvars.iv60.ph = phi i64 [ 0, %iter.check77 ], [ 0, %vector.memcheck72 ], [ %n.vec82, %vec.epilog.iter.check92 ], [ %n.vec97, %vec.epilog.middle.block89 ]
  %152 = add i64 %3, -65
  %153 = sub i64 %152, %indvars.iv60.ph
  %xtraiter104 = and i64 %3, 3
  %lcmp.mod105.not = icmp eq i64 %xtraiter104, 0
  br i1 %lcmp.mod105.not, label %.lr.ph49.prol.loopexit, label %.lr.ph49.prol

.lr.ph49.prol:                                    ; preds = %.lr.ph49.preheader, %.lr.ph49.prol
  %indvars.iv60.prol = phi i64 [ %indvars.iv.next61.prol, %.lr.ph49.prol ], [ %indvars.iv60.ph, %.lr.ph49.preheader ]
  %prol.iter106 = phi i64 [ %prol.iter106.next, %.lr.ph49.prol ], [ 0, %.lr.ph49.preheader ]
  %gep.prol = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv60.prol
  %154 = load i8, ptr %gep.prol, align 1, !tbaa !9
  %155 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv60.prol
  store i8 %154, ptr %155, align 1, !tbaa !9
  %indvars.iv.next61.prol = add nuw nsw i64 %indvars.iv60.prol, 1
  %prol.iter106.next = add i64 %prol.iter106, 1
  %prol.iter106.cmp.not = icmp eq i64 %prol.iter106.next, %xtraiter104
  br i1 %prol.iter106.cmp.not, label %.lr.ph49.prol.loopexit, label %.lr.ph49.prol, !llvm.loop !20

.lr.ph49.prol.loopexit:                           ; preds = %.lr.ph49.prol, %.lr.ph49.preheader
  %indvars.iv60.unr = phi i64 [ %indvars.iv60.ph, %.lr.ph49.preheader ], [ %indvars.iv.next61.prol, %.lr.ph49.prol ]
  %156 = icmp ult i64 %153, 3
  br i1 %156, label %._crit_edge, label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph49.prol.loopexit, %.lr.ph49
  %indvars.iv60 = phi i64 [ %indvars.iv.next61.3, %.lr.ph49 ], [ %indvars.iv60.unr, %.lr.ph49.prol.loopexit ]
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv60
  %157 = load i8, ptr %gep, align 1, !tbaa !9
  %158 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv60
  store i8 %157, ptr %158, align 1, !tbaa !9
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %gep.1 = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv.next61
  %159 = load i8, ptr %gep.1, align 1, !tbaa !9
  %160 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next61
  store i8 %159, ptr %160, align 1, !tbaa !9
  %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2
  %gep.2 = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv.next61.1
  %161 = load i8, ptr %gep.2, align 1, !tbaa !9
  %162 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next61.1
  store i8 %161, ptr %162, align 1, !tbaa !9
  %indvars.iv.next61.2 = add nuw nsw i64 %indvars.iv60, 3
  %gep.3 = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv.next61.2
  %163 = load i8, ptr %gep.3, align 1, !tbaa !9
  %164 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next61.2
  store i8 %163, ptr %164, align 1, !tbaa !9
  %indvars.iv.next61.3 = add nuw nsw i64 %indvars.iv60, 4
  %exitcond63.not.3 = icmp eq i64 %indvars.iv.next61.3, %140
  br i1 %exitcond63.not.3, label %._crit_edge, label %.lr.ph49, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph49.prol.loopexit, %.lr.ph49, %middle.block74, %vec.epilog.middle.block89, %.preheader
  store i64 %140, ptr %1, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.preheader, %.preheader42, %15, %5, %._crit_edge
  %.035 = phi i32 [ 0, %._crit_edge ], [ -1, %5 ], [ -1, %15 ], [ -1, %.preheader42 ], [ -1, %.lr.ph.preheader ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #3
  ret i32 %.035
}

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !11, !12}
!18 = distinct !{!18, !11, !12, !13}
!19 = distinct !{!19, !11, !12, !13}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !11, !12}


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