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

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

@_121665 = external hidden constant <{ i64, i64, [14 x i64] }>, align 16

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @crypto_scalarmult_curve25519_tweet(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [32 x i8], align 16
  %8 = alloca [80 x i64], align 16
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca [16 x i64], align 16
  %12 = alloca [16 x i64], align 16
  %13 = alloca [16 x i64], align 16
  %14 = alloca [16 x i64], align 16
  %15 = alloca [16 x i64], align 16
  %16 = alloca [16 x i64], align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 640, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %13) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #2
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %17

17:                                               ; preds = %27, %3
  %18 = load i64, ptr %10, align 8, !tbaa !9
  %19 = icmp slt i64 %18, 31
  br i1 %19, label %20, label %30

20:                                               ; preds = %17
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load i64, ptr %10, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %21, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %25 = load i64, ptr %10, align 8, !tbaa !9
  %26 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %25
  store i8 %24, ptr %26, align 1, !tbaa !11
  br label %27

27:                                               ; preds = %20
  %28 = load i64, ptr %10, align 8, !tbaa !9
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %10, align 8, !tbaa !9
  br label %17, !llvm.loop !12

30:                                               ; preds = %17
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 31
  %33 = load i8, ptr %32, align 1, !tbaa !11
  %34 = zext i8 %33 to i32
  %35 = and i32 %34, 127
  %36 = or i32 %35, 64
  %37 = trunc i32 %36 to i8
  %38 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 31
  store i8 %37, ptr %38, align 1, !tbaa !11
  %39 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %40 = load i8, ptr %39, align 16, !tbaa !11
  %41 = zext i8 %40 to i32
  %42 = and i32 %41, 248
  %43 = trunc i32 %42 to i8
  store i8 %43, ptr %39, align 16, !tbaa !11
  %44 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  call void @unpack25519(ptr noundef %44, ptr noundef %45)
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %61, %30
  %47 = load i64, ptr %10, align 8, !tbaa !9
  %48 = icmp slt i64 %47, 16
  br i1 %48, label %49, label %64

49:                                               ; preds = %46
  %50 = load i64, ptr %10, align 8, !tbaa !9
  %51 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = load i64, ptr %10, align 8, !tbaa !9
  %54 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 %53
  store i64 %52, ptr %54, align 8, !tbaa !9
  %55 = load i64, ptr %10, align 8, !tbaa !9
  %56 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 %55
  store i64 0, ptr %56, align 8, !tbaa !9
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 %57
  store i64 0, ptr %58, align 8, !tbaa !9
  %59 = load i64, ptr %10, align 8, !tbaa !9
  %60 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 %59
  store i64 0, ptr %60, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %49
  %62 = load i64, ptr %10, align 8, !tbaa !9
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %10, align 8, !tbaa !9
  br label %46, !llvm.loop !14

64:                                               ; preds = %46
  %65 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  store i64 1, ptr %65, align 16, !tbaa !9
  %66 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  store i64 1, ptr %66, align 16, !tbaa !9
  store i64 254, ptr %10, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %147, %64
  %68 = load i64, ptr %10, align 8, !tbaa !9
  %69 = icmp sge i64 %68, 0
  br i1 %69, label %70, label %150

70:                                               ; preds = %67
  %71 = load i64, ptr %10, align 8, !tbaa !9
  %72 = ashr i64 %71, 3
  %73 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = zext i8 %74 to i32
  %76 = load i64, ptr %10, align 8, !tbaa !9
  %77 = and i64 %76, 7
  %78 = trunc i64 %77 to i32
  %79 = ashr i32 %75, %78
  %80 = and i32 %79, 1
  %81 = sext i32 %80 to i64
  store i64 %81, ptr %9, align 8, !tbaa !9
  %82 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %83 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %84 = load i64, ptr %9, align 8, !tbaa !9
  %85 = trunc i64 %84 to i32
  call void @sel25519(ptr noundef %82, ptr noundef %83, i32 noundef %85)
  %86 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %87 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %88 = load i64, ptr %9, align 8, !tbaa !9
  %89 = trunc i64 %88 to i32
  call void @sel25519(ptr noundef %86, ptr noundef %87, i32 noundef %89)
  %90 = getelementptr inbounds [16 x i64], ptr %15, i64 0, i64 0
  %91 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %92 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  call void @A(ptr noundef %90, ptr noundef %91, ptr noundef %92)
  %93 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %94 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %95 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  call void @Z(ptr noundef %93, ptr noundef %94, ptr noundef %95)
  %96 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %97 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %98 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  call void @A(ptr noundef %96, ptr noundef %97, ptr noundef %98)
  %99 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %100 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %101 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  call void @Z(ptr noundef %99, ptr noundef %100, ptr noundef %101)
  %102 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %103 = getelementptr inbounds [16 x i64], ptr %15, i64 0, i64 0
  call void @S(ptr noundef %102, ptr noundef %103)
  %104 = getelementptr inbounds [16 x i64], ptr %16, i64 0, i64 0
  %105 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  call void @S(ptr noundef %104, ptr noundef %105)
  %106 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %107 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %108 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  call void @M(ptr noundef %106, ptr noundef %107, ptr noundef %108)
  %109 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %110 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %111 = getelementptr inbounds [16 x i64], ptr %15, i64 0, i64 0
  call void @M(ptr noundef %109, ptr noundef %110, ptr noundef %111)
  %112 = getelementptr inbounds [16 x i64], ptr %15, i64 0, i64 0
  %113 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %114 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  call void @A(ptr noundef %112, ptr noundef %113, ptr noundef %114)
  %115 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %116 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %117 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  call void @Z(ptr noundef %115, ptr noundef %116, ptr noundef %117)
  %118 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %119 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  call void @S(ptr noundef %118, ptr noundef %119)
  %120 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %121 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %122 = getelementptr inbounds [16 x i64], ptr %16, i64 0, i64 0
  call void @Z(ptr noundef %120, ptr noundef %121, ptr noundef %122)
  %123 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %124 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  call void @M(ptr noundef %123, ptr noundef %124, ptr noundef @_121665)
  %125 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %126 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %127 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  call void @A(ptr noundef %125, ptr noundef %126, ptr noundef %127)
  %128 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %129 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %130 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  call void @M(ptr noundef %128, ptr noundef %129, ptr noundef %130)
  %131 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %132 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %133 = getelementptr inbounds [16 x i64], ptr %16, i64 0, i64 0
  call void @M(ptr noundef %131, ptr noundef %132, ptr noundef %133)
  %134 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %135 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %136 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  call void @M(ptr noundef %134, ptr noundef %135, ptr noundef %136)
  %137 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %138 = getelementptr inbounds [16 x i64], ptr %15, i64 0, i64 0
  call void @S(ptr noundef %137, ptr noundef %138)
  %139 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 0
  %140 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 0
  %141 = load i64, ptr %9, align 8, !tbaa !9
  %142 = trunc i64 %141 to i32
  call void @sel25519(ptr noundef %139, ptr noundef %140, i32 noundef %142)
  %143 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 0
  %144 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 0
  %145 = load i64, ptr %9, align 8, !tbaa !9
  %146 = trunc i64 %145 to i32
  call void @sel25519(ptr noundef %143, ptr noundef %144, i32 noundef %146)
  br label %147

147:                                              ; preds = %70
  %148 = load i64, ptr %10, align 8, !tbaa !9
  %149 = add nsw i64 %148, -1
  store i64 %149, ptr %10, align 8, !tbaa !9
  br label %67, !llvm.loop !15

150:                                              ; preds = %67
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %179, %150
  %152 = load i64, ptr %10, align 8, !tbaa !9
  %153 = icmp slt i64 %152, 16
  br i1 %153, label %154, label %182

154:                                              ; preds = %151
  %155 = load i64, ptr %10, align 8, !tbaa !9
  %156 = getelementptr inbounds [16 x i64], ptr %11, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !9
  %158 = load i64, ptr %10, align 8, !tbaa !9
  %159 = add nsw i64 %158, 16
  %160 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 %159
  store i64 %157, ptr %160, align 8, !tbaa !9
  %161 = load i64, ptr %10, align 8, !tbaa !9
  %162 = getelementptr inbounds [16 x i64], ptr %13, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !9
  %164 = load i64, ptr %10, align 8, !tbaa !9
  %165 = add nsw i64 %164, 32
  %166 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 %165
  store i64 %163, ptr %166, align 8, !tbaa !9
  %167 = load i64, ptr %10, align 8, !tbaa !9
  %168 = getelementptr inbounds [16 x i64], ptr %12, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !9
  %170 = load i64, ptr %10, align 8, !tbaa !9
  %171 = add nsw i64 %170, 48
  %172 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 %171
  store i64 %169, ptr %172, align 8, !tbaa !9
  %173 = load i64, ptr %10, align 8, !tbaa !9
  %174 = getelementptr inbounds [16 x i64], ptr %14, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !9
  %176 = load i64, ptr %10, align 8, !tbaa !9
  %177 = add nsw i64 %176, 64
  %178 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 %177
  store i64 %175, ptr %178, align 8, !tbaa !9
  br label %179

179:                                              ; preds = %154
  %180 = load i64, ptr %10, align 8, !tbaa !9
  %181 = add nsw i64 %180, 1
  store i64 %181, ptr %10, align 8, !tbaa !9
  br label %151, !llvm.loop !16

182:                                              ; preds = %151
  %183 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %184 = getelementptr inbounds i64, ptr %183, i64 32
  %185 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %186 = getelementptr inbounds i64, ptr %185, i64 32
  call void @inv25519(ptr noundef %184, ptr noundef %186)
  %187 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %188 = getelementptr inbounds i64, ptr %187, i64 16
  %189 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %190 = getelementptr inbounds i64, ptr %189, i64 16
  %191 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %192 = getelementptr inbounds i64, ptr %191, i64 32
  call void @M(ptr noundef %188, ptr noundef %190, ptr noundef %192)
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds [80 x i64], ptr %8, i64 0, i64 0
  %195 = getelementptr inbounds i64, ptr %194, i64 16
  call void @pack25519(ptr noundef %193, ptr noundef %195)
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 128, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 640, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #2
  ret i32 0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @sel25519(ptr noundef, ptr noundef, i32 noundef) #1

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !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"

@_121665 = external hidden constant <{ i64, i64, [14 x i64] }>, align 16

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @crypto_scalarmult_curve25519_tweet(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca [32 x i8], align 16
  %5 = alloca [80 x i64], align 16
  %6 = alloca [16 x i64], align 16
  %7 = alloca [16 x i64], align 16
  %8 = alloca [16 x i64], align 16
  %9 = alloca [16 x i64], align 16
  %10 = alloca [16 x i64], align 16
  %11 = alloca [16 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 640, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(31) %4, ptr noundef nonnull align 1 dereferenceable(31) %1, i64 31, i1 false), !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 31
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = and i8 %13, 63
  %15 = or disjoint i8 %14, 64
  %16 = getelementptr inbounds i8, ptr %4, i64 31
  store i8 %15, ptr %16, align 1, !tbaa !5
  %17 = load i8, ptr %4, align 16, !tbaa !5
  %18 = and i8 %17, -8
  store i8 %18, ptr %4, align 16, !tbaa !5
  call void @unpack25519(ptr noundef nonnull %5, ptr noundef %2)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %8, i8 0, i64 128, i1 false), !tbaa !8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %6, i8 0, i64 128, i1 false), !tbaa !8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %9, i8 0, i64 128, i1 false), !tbaa !8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %7, ptr noundef nonnull align 16 dereferenceable(128) %5, i64 128, i1 false), !tbaa !8
  store i64 1, ptr %9, align 16, !tbaa !8
  store i64 1, ptr %6, align 16, !tbaa !8
  br label %19

19:                                               ; preds = %3, %19
  %.234 = phi i64 [ 254, %3 ], [ %28, %19 ]
  %20 = lshr i64 %.234, 3
  %21 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 %20
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = zext i8 %22 to i32
  %24 = trunc i64 %.234 to i32
  %25 = and i32 %24, 7
  %26 = lshr i32 %23, %25
  %27 = and i32 %26, 1
  call void @sel25519(ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef %27)
  call void @sel25519(ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef %27)
  call void @A(ptr noundef nonnull %10, ptr noundef nonnull %6, ptr noundef nonnull %8)
  call void @Z(ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %8)
  call void @A(ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull %9)
  call void @Z(ptr noundef nonnull %7, ptr noundef nonnull %7, ptr noundef nonnull %9)
  call void @S(ptr noundef nonnull %9, ptr noundef nonnull %10)
  call void @S(ptr noundef nonnull %11, ptr noundef nonnull %6)
  call void @M(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %6)
  call void @M(ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull %10)
  call void @A(ptr noundef nonnull %10, ptr noundef nonnull %6, ptr noundef nonnull %8)
  call void @Z(ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %8)
  call void @S(ptr noundef nonnull %7, ptr noundef nonnull %6)
  call void @Z(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %11)
  call void @M(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull @_121665)
  call void @A(ptr noundef nonnull %6, ptr noundef nonnull %6, ptr noundef nonnull %9)
  call void @M(ptr noundef nonnull %8, ptr noundef nonnull %8, ptr noundef nonnull %6)
  call void @M(ptr noundef nonnull %6, ptr noundef nonnull %9, ptr noundef nonnull %11)
  call void @M(ptr noundef nonnull %9, ptr noundef nonnull %7, ptr noundef nonnull %5)
  call void @S(ptr noundef nonnull %7, ptr noundef nonnull %10)
  call void @sel25519(ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef %27)
  call void @sel25519(ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef %27)
  %28 = add nsw i64 %.234, -1
  %.not = icmp eq i64 %.234, 0
  br i1 %.not, label %.preheader.preheader, label %19, !llvm.loop !10

.preheader.preheader:                             ; preds = %19
  %29 = getelementptr inbounds i8, ptr %5, i64 128
  %30 = getelementptr inbounds i8, ptr %5, i64 256
  %31 = getelementptr inbounds i8, ptr %5, i64 384
  %32 = getelementptr inbounds i8, ptr %5, i64 512
  %33 = load <2 x i64>, ptr %6, align 16, !tbaa !8
  store <2 x i64> %33, ptr %29, align 16, !tbaa !8
  %34 = load <2 x i64>, ptr %8, align 16, !tbaa !8
  store <2 x i64> %34, ptr %30, align 16, !tbaa !8
  %35 = load <2 x i64>, ptr %7, align 16, !tbaa !8
  store <2 x i64> %35, ptr %31, align 16, !tbaa !8
  %36 = load <2 x i64>, ptr %9, align 16, !tbaa !8
  store <2 x i64> %36, ptr %32, align 16, !tbaa !8
  %37 = getelementptr inbounds i8, ptr %6, i64 16
  %38 = getelementptr inbounds i8, ptr %5, i64 144
  %39 = getelementptr inbounds i8, ptr %8, i64 16
  %40 = getelementptr inbounds i8, ptr %5, i64 272
  %41 = getelementptr inbounds i8, ptr %7, i64 16
  %42 = getelementptr inbounds i8, ptr %5, i64 400
  %43 = getelementptr inbounds i8, ptr %9, i64 16
  %44 = getelementptr inbounds i8, ptr %5, i64 528
  %45 = load <2 x i64>, ptr %37, align 16, !tbaa !8
  store <2 x i64> %45, ptr %38, align 16, !tbaa !8
  %46 = load <2 x i64>, ptr %39, align 16, !tbaa !8
  store <2 x i64> %46, ptr %40, align 16, !tbaa !8
  %47 = load <2 x i64>, ptr %41, align 16, !tbaa !8
  store <2 x i64> %47, ptr %42, align 16, !tbaa !8
  %48 = load <2 x i64>, ptr %43, align 16, !tbaa !8
  store <2 x i64> %48, ptr %44, align 16, !tbaa !8
  %49 = getelementptr inbounds i8, ptr %6, i64 32
  %50 = getelementptr inbounds i8, ptr %5, i64 160
  %51 = getelementptr inbounds i8, ptr %8, i64 32
  %52 = getelementptr inbounds i8, ptr %5, i64 288
  %53 = getelementptr inbounds i8, ptr %7, i64 32
  %54 = getelementptr inbounds i8, ptr %5, i64 416
  %55 = getelementptr inbounds i8, ptr %9, i64 32
  %56 = getelementptr inbounds i8, ptr %5, i64 544
  %57 = load <2 x i64>, ptr %49, align 16, !tbaa !8
  store <2 x i64> %57, ptr %50, align 16, !tbaa !8
  %58 = load <2 x i64>, ptr %51, align 16, !tbaa !8
  store <2 x i64> %58, ptr %52, align 16, !tbaa !8
  %59 = load <2 x i64>, ptr %53, align 16, !tbaa !8
  store <2 x i64> %59, ptr %54, align 16, !tbaa !8
  %60 = load <2 x i64>, ptr %55, align 16, !tbaa !8
  store <2 x i64> %60, ptr %56, align 16, !tbaa !8
  %61 = getelementptr inbounds i8, ptr %6, i64 48
  %62 = getelementptr inbounds i8, ptr %5, i64 176
  %63 = getelementptr inbounds i8, ptr %8, i64 48
  %64 = getelementptr inbounds i8, ptr %5, i64 304
  %65 = getelementptr inbounds i8, ptr %7, i64 48
  %66 = getelementptr inbounds i8, ptr %5, i64 432
  %67 = getelementptr inbounds i8, ptr %9, i64 48
  %68 = getelementptr inbounds i8, ptr %5, i64 560
  %69 = load <2 x i64>, ptr %61, align 16, !tbaa !8
  store <2 x i64> %69, ptr %62, align 16, !tbaa !8
  %70 = load <2 x i64>, ptr %63, align 16, !tbaa !8
  store <2 x i64> %70, ptr %64, align 16, !tbaa !8
  %71 = load <2 x i64>, ptr %65, align 16, !tbaa !8
  store <2 x i64> %71, ptr %66, align 16, !tbaa !8
  %72 = load <2 x i64>, ptr %67, align 16, !tbaa !8
  store <2 x i64> %72, ptr %68, align 16, !tbaa !8
  %73 = getelementptr inbounds i8, ptr %6, i64 64
  %74 = getelementptr inbounds i8, ptr %5, i64 192
  %75 = getelementptr inbounds i8, ptr %8, i64 64
  %76 = getelementptr inbounds i8, ptr %5, i64 320
  %77 = getelementptr inbounds i8, ptr %7, i64 64
  %78 = getelementptr inbounds i8, ptr %5, i64 448
  %79 = getelementptr inbounds i8, ptr %9, i64 64
  %80 = getelementptr inbounds i8, ptr %5, i64 576
  %81 = load <2 x i64>, ptr %73, align 16, !tbaa !8
  store <2 x i64> %81, ptr %74, align 16, !tbaa !8
  %82 = load <2 x i64>, ptr %75, align 16, !tbaa !8
  store <2 x i64> %82, ptr %76, align 16, !tbaa !8
  %83 = load <2 x i64>, ptr %77, align 16, !tbaa !8
  store <2 x i64> %83, ptr %78, align 16, !tbaa !8
  %84 = load <2 x i64>, ptr %79, align 16, !tbaa !8
  store <2 x i64> %84, ptr %80, align 16, !tbaa !8
  %85 = getelementptr inbounds i8, ptr %6, i64 80
  %86 = getelementptr inbounds i8, ptr %5, i64 208
  %87 = getelementptr inbounds i8, ptr %8, i64 80
  %88 = getelementptr inbounds i8, ptr %5, i64 336
  %89 = getelementptr inbounds i8, ptr %7, i64 80
  %90 = getelementptr inbounds i8, ptr %5, i64 464
  %91 = getelementptr inbounds i8, ptr %9, i64 80
  %92 = getelementptr inbounds i8, ptr %5, i64 592
  %93 = load <2 x i64>, ptr %85, align 16, !tbaa !8
  store <2 x i64> %93, ptr %86, align 16, !tbaa !8
  %94 = load <2 x i64>, ptr %87, align 16, !tbaa !8
  store <2 x i64> %94, ptr %88, align 16, !tbaa !8
  %95 = load <2 x i64>, ptr %89, align 16, !tbaa !8
  store <2 x i64> %95, ptr %90, align 16, !tbaa !8
  %96 = load <2 x i64>, ptr %91, align 16, !tbaa !8
  store <2 x i64> %96, ptr %92, align 16, !tbaa !8
  %97 = getelementptr inbounds i8, ptr %6, i64 96
  %98 = getelementptr inbounds i8, ptr %5, i64 224
  %99 = getelementptr inbounds i8, ptr %8, i64 96
  %100 = getelementptr inbounds i8, ptr %5, i64 352
  %101 = getelementptr inbounds i8, ptr %7, i64 96
  %102 = getelementptr inbounds i8, ptr %5, i64 480
  %103 = getelementptr inbounds i8, ptr %9, i64 96
  %104 = getelementptr inbounds i8, ptr %5, i64 608
  %105 = load <2 x i64>, ptr %97, align 16, !tbaa !8
  store <2 x i64> %105, ptr %98, align 16, !tbaa !8
  %106 = load <2 x i64>, ptr %99, align 16, !tbaa !8
  store <2 x i64> %106, ptr %100, align 16, !tbaa !8
  %107 = load <2 x i64>, ptr %101, align 16, !tbaa !8
  store <2 x i64> %107, ptr %102, align 16, !tbaa !8
  %108 = load <2 x i64>, ptr %103, align 16, !tbaa !8
  store <2 x i64> %108, ptr %104, align 16, !tbaa !8
  %109 = getelementptr inbounds i8, ptr %6, i64 112
  %110 = getelementptr inbounds i8, ptr %5, i64 240
  %111 = getelementptr inbounds i8, ptr %8, i64 112
  %112 = getelementptr inbounds i8, ptr %5, i64 368
  %113 = getelementptr inbounds i8, ptr %7, i64 112
  %114 = getelementptr inbounds i8, ptr %5, i64 496
  %115 = getelementptr inbounds i8, ptr %9, i64 112
  %116 = getelementptr inbounds i8, ptr %5, i64 624
  %117 = load <2 x i64>, ptr %109, align 16, !tbaa !8
  store <2 x i64> %117, ptr %110, align 16, !tbaa !8
  %118 = load <2 x i64>, ptr %111, align 16, !tbaa !8
  store <2 x i64> %118, ptr %112, align 16, !tbaa !8
  %119 = load <2 x i64>, ptr %113, align 16, !tbaa !8
  store <2 x i64> %119, ptr %114, align 16, !tbaa !8
  %120 = load <2 x i64>, ptr %115, align 16, !tbaa !8
  store <2 x i64> %120, ptr %116, align 16, !tbaa !8
  call void @inv25519(ptr noundef nonnull %30, ptr noundef nonnull %30)
  call void @M(ptr noundef nonnull %29, ptr noundef nonnull %29, ptr noundef nonnull %30)
  call void @pack25519(ptr noundef %0, ptr noundef nonnull %29)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 640, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  ret i32 0
}

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

; Function Attrs: nounwind uwtable
declare hidden void @sel25519(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pack25519(ptr noundef, ptr noundef) local_unnamed_addr #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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass