; LLVM IR from openssl/openssl :: crypto/ec (curve25519)

; 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.ge_p3 = type { [10 x i32], [10 x i32], [10 x i32], [10 x i32] }
%struct.ge_p2 = type { [10 x i32], [10 x i32], [10 x i32] }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@__const.ossl_ed25519_verify.l_low = external hidden unnamed_addr constant [16 x i8], align 16
@allzeroes = external hidden constant [15 x i8], align 1

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

declare ptr @EVP_MD_fetch(ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @EVP_MD_CTX_new() #1

declare i32 @EVP_DigestUpdate(ptr noundef, ptr noundef, i64 noundef) #1

declare i32 @EVP_DigestFinal_ex(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @hash_init_with_dom(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @x25519_sc_reduce(ptr noundef) #2

declare void @EVP_MD_free(ptr noundef) #1

declare void @EVP_MD_CTX_free(ptr noundef) #1

; 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
declare hidden i32 @ge_frombytes_vartime(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @ossl_ed25519_verify(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %4, i8 noundef zeroext %5, i8 noundef zeroext %6, ptr noundef %7, i64 noundef %8, ptr noundef %9, ptr noundef %10) #2 {
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca %struct.ge_p3, align 4
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %struct.ge_p2, align 4
  %33 = alloca [32 x i8], align 16
  %34 = alloca [64 x i8], align 16
  %35 = alloca [16 x i8], align 16
  %36 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store i64 %1, ptr %14, align 8, !tbaa !9
  store ptr %2, ptr %15, align 8, !tbaa !5
  store ptr %3, ptr %16, align 8, !tbaa !5
  store i8 %4, ptr %17, align 1, !tbaa !11
  store i8 %5, ptr %18, align 1, !tbaa !11
  store i8 %6, ptr %19, align 1, !tbaa !11
  store ptr %7, ptr %20, align 8, !tbaa !5
  store i64 %8, ptr %21, align 8, !tbaa !9
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 160, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  store ptr null, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 0, ptr %31, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 120, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %34) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %35, ptr align 16 @__const.ossl_ed25519_verify.l_low, i64 16, i1 false)
  %37 = load ptr, ptr %20, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %11
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %39, %11
  %41 = load i8, ptr %19, align 1, !tbaa !11
  %42 = zext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %48

44:                                               ; preds = %40
  %45 = load i64, ptr %21, align 8, !tbaa !9
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

48:                                               ; preds = %44, %40
  %49 = load i8, ptr %17, align 1, !tbaa !11
  %50 = icmp ne i8 %49, 0
  br i1 %50, label %55, label %51

51:                                               ; preds = %48
  %52 = load i64, ptr %21, align 8, !tbaa !9
  %53 = icmp ugt i64 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %51
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

55:                                               ; preds = %51, %48
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %56, ptr %26, align 8, !tbaa !5
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 32
  store ptr %58, ptr %27, align 8, !tbaa !5
  %59 = load ptr, ptr %27, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 31
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = zext i8 %61 to i32
  %63 = icmp sgt i32 %62, 16
  br i1 %63, label %64, label %65

64:                                               ; preds = %55
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

65:                                               ; preds = %55
  %66 = load ptr, ptr %27, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 31
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = zext i8 %68 to i32
  %70 = icmp eq i32 %69, 16
  br i1 %70, label %71, label %118

71:                                               ; preds = %65
  %72 = load ptr, ptr %27, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i64 16
  %74 = call i32 @memcmp(ptr noundef %73, ptr noundef @allzeroes, i64 noundef 15) #6
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %71
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

77:                                               ; preds = %71
  store i32 15, ptr %24, align 4, !tbaa !12
  br label %78

78:                                               ; preds = %110, %77
  %79 = load i32, ptr %24, align 4, !tbaa !12
  %80 = icmp sge i32 %79, 0
  br i1 %80, label %81, label %113

81:                                               ; preds = %78
  %82 = load ptr, ptr %27, align 8, !tbaa !5
  %83 = load i32, ptr %24, align 4, !tbaa !12
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = zext i8 %86 to i32
  %88 = load i32, ptr %24, align 4, !tbaa !12
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [16 x i8], ptr %35, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !11
  %92 = zext i8 %91 to i32
  %93 = icmp slt i32 %87, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %81
  br label %113

95:                                               ; preds = %81
  %96 = load ptr, ptr %27, align 8, !tbaa !5
  %97 = load i32, ptr %24, align 4, !tbaa !12
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i8, ptr %96, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = zext i8 %100 to i32
  %102 = load i32, ptr %24, align 4, !tbaa !12
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [16 x i8], ptr %35, i64 0, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !11
  %106 = zext i8 %105 to i32
  %107 = icmp sgt i32 %101, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %95
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

109:                                              ; preds = %95
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %24, align 4, !tbaa !12
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %24, align 4, !tbaa !12
  br label %78, !llvm.loop !14

113:                                              ; preds = %94, %78
  %114 = load i32, ptr %24, align 4, !tbaa !12
  %115 = icmp slt i32 %114, 0
  br i1 %115, label %116, label %117

116:                                              ; preds = %113
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

117:                                              ; preds = %113
  br label %118

118:                                              ; preds = %117, %65
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = call i32 @ge_frombytes_vartime(ptr noundef %25, ptr noundef %119)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %118
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

123:                                              ; preds = %118
  %124 = getelementptr inbounds %struct.ge_p3, ptr %25, i32 0, i32 0
  %125 = getelementptr inbounds [10 x i32], ptr %124, i64 0, i64 0
  %126 = getelementptr inbounds %struct.ge_p3, ptr %25, i32 0, i32 0
  %127 = getelementptr inbounds [10 x i32], ptr %126, i64 0, i64 0
  call void @fe_neg(ptr noundef %125, ptr noundef %127)
  %128 = getelementptr inbounds %struct.ge_p3, ptr %25, i32 0, i32 3
  %129 = getelementptr inbounds [10 x i32], ptr %128, i64 0, i64 0
  %130 = getelementptr inbounds %struct.ge_p3, ptr %25, i32 0, i32 3
  %131 = getelementptr inbounds [10 x i32], ptr %130, i64 0, i64 0
  call void @fe_neg(ptr noundef %129, ptr noundef %131)
  %132 = load ptr, ptr %22, align 8, !tbaa !5
  %133 = load ptr, ptr %23, align 8, !tbaa !5
  %134 = call ptr @EVP_MD_fetch(ptr noundef %132, ptr noundef @.str, ptr noundef %133)
  store ptr %134, ptr %28, align 8, !tbaa !5
  %135 = load ptr, ptr %28, align 8, !tbaa !5
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %138

137:                                              ; preds = %123
  store i32 0, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

138:                                              ; preds = %123
  %139 = call ptr @EVP_MD_CTX_new()
  store ptr %139, ptr %29, align 8, !tbaa !5
  %140 = load ptr, ptr %29, align 8, !tbaa !5
  %141 = icmp eq ptr %140, null
  br i1 %141, label %142, label %143

142:                                              ; preds = %138
  br label %184

143:                                              ; preds = %138
  %144 = load ptr, ptr %29, align 8, !tbaa !5
  %145 = load ptr, ptr %28, align 8, !tbaa !5
  %146 = load i8, ptr %17, align 1, !tbaa !11
  %147 = load i8, ptr %18, align 1, !tbaa !11
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = load i64, ptr %21, align 8, !tbaa !9
  %150 = call i32 @hash_init_with_dom(ptr noundef %144, ptr noundef %145, i8 noundef zeroext %146, i8 noundef zeroext %147, ptr noundef %148, i64 noundef %149)
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %173

152:                                              ; preds = %143
  %153 = load ptr, ptr %29, align 8, !tbaa !5
  %154 = load ptr, ptr %26, align 8, !tbaa !5
  %155 = call i32 @EVP_DigestUpdate(ptr noundef %153, ptr noundef %154, i64 noundef 32)
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %173

157:                                              ; preds = %152
  %158 = load ptr, ptr %29, align 8, !tbaa !5
  %159 = load ptr, ptr %16, align 8, !tbaa !5
  %160 = call i32 @EVP_DigestUpdate(ptr noundef %158, ptr noundef %159, i64 noundef 32)
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %173

162:                                              ; preds = %157
  %163 = load ptr, ptr %29, align 8, !tbaa !5
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = load i64, ptr %14, align 8, !tbaa !9
  %166 = call i32 @EVP_DigestUpdate(ptr noundef %163, ptr noundef %164, i64 noundef %165)
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %173

168:                                              ; preds = %162
  %169 = load ptr, ptr %29, align 8, !tbaa !5
  %170 = getelementptr inbounds [64 x i8], ptr %34, i64 0, i64 0
  %171 = call i32 @EVP_DigestFinal_ex(ptr noundef %169, ptr noundef %170, ptr noundef %30)
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %174, label %173

173:                                              ; preds = %168, %162, %157, %152, %143
  br label %184

174:                                              ; preds = %168
  %175 = getelementptr inbounds [64 x i8], ptr %34, i64 0, i64 0
  call void @x25519_sc_reduce(ptr noundef %175)
  %176 = getelementptr inbounds [64 x i8], ptr %34, i64 0, i64 0
  %177 = load ptr, ptr %27, align 8, !tbaa !5
  call void @ge_double_scalarmult_vartime(ptr noundef %32, ptr noundef %176, ptr noundef %25, ptr noundef %177)
  %178 = getelementptr inbounds [32 x i8], ptr %33, i64 0, i64 0
  call void @ge_tobytes(ptr noundef %178, ptr noundef %32)
  %179 = getelementptr inbounds [32 x i8], ptr %33, i64 0, i64 0
  %180 = load ptr, ptr %26, align 8, !tbaa !5
  %181 = call i32 @CRYPTO_memcmp(ptr noundef %179, ptr noundef %180, i64 noundef 32)
  %182 = icmp eq i32 %181, 0
  %183 = zext i1 %182 to i32
  store i32 %183, ptr %31, align 4, !tbaa !12
  br label %184

184:                                              ; preds = %174, %173, %142
  %185 = load ptr, ptr %28, align 8, !tbaa !5
  call void @EVP_MD_free(ptr noundef %185)
  %186 = load ptr, ptr %29, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %186)
  %187 = load i32, ptr %31, align 4, !tbaa !12
  store i32 %187, ptr %12, align 4
  store i32 1, ptr %36, align 4
  br label %188

188:                                              ; preds = %184, %137, %122, %116, %108, %76, %64, %54, %47
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 160, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  %189 = load i32, ptr %12, align 4
  ret i32 %189
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

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

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

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

declare i32 @CRYPTO_memcmp(ptr noundef, ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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: readwrite) }
attributes #4 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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.ge_p3 = type { [10 x i32], [10 x i32], [10 x i32], [10 x i32] }
%struct.ge_p2 = type { [10 x i32], [10 x i32], [10 x i32] }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@__const.ossl_ed25519_verify.l_low = external hidden unnamed_addr constant [16 x i8], align 16
@allzeroes = external hidden constant [15 x i8], align 1

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

declare ptr @EVP_MD_fetch(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #1

declare i32 @EVP_DigestUpdate(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @EVP_DigestFinal_ex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @hash_init_with_dom(ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, ptr noundef, i64 noundef) local_unnamed_addr #2

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

declare void @EVP_MD_free(ptr noundef) local_unnamed_addr #1

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #1

; 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
declare hidden i32 @ge_frombytes_vartime(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @ossl_ed25519_verify(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %4, i8 noundef zeroext %5, i8 noundef zeroext %6, ptr noundef %7, i64 noundef %8, ptr noundef %9, ptr noundef %10) local_unnamed_addr #2 {
  %12 = alloca %struct.ge_p3, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.ge_p2, align 4
  %15 = alloca [32 x i8], align 16
  %16 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %16) #4
  %17 = icmp eq ptr %7, null
  %spec.select = select i1 %17, i64 0, i64 %8
  %18 = icmp ne i8 %6, 0
  %19 = icmp eq i64 %spec.select, 0
  %or.cond = and i1 %18, %19
  br i1 %or.cond, label %.thread, label %20

20:                                               ; preds = %11
  %21 = icmp eq i8 %4, 0
  %22 = icmp ne i64 %spec.select, 0
  %or.cond3 = and i1 %21, %22
  br i1 %or.cond3, label %.thread, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %2, i64 32
  %25 = getelementptr inbounds i8, ptr %2, i64 63
  %26 = load i8, ptr %25, align 1, !tbaa !5
  %27 = icmp ugt i8 %26, 16
  br i1 %27, label %.thread, label %28

28:                                               ; preds = %23
  %29 = icmp eq i8 %26, 16
  br i1 %29, label %30, label %.loopexit

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %2, i64 48
  %bcmp = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(15) %31, ptr noundef nonnull dereferenceable(15) @allzeroes, i64 15)
  %.not = icmp eq i32 %bcmp, 0
  br i1 %.not, label %.preheader.preheader, label %.thread

.preheader.preheader:                             ; preds = %30
  %32 = getelementptr inbounds i8, ptr %2, i64 47
  %33 = load i8, ptr %32, align 1, !tbaa !5
  %34 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 15), align 1, !tbaa !5
  %35 = icmp ult i8 %33, %34
  br i1 %35, label %.loopexit, label %123

.preheader.1:                                     ; preds = %123
  %36 = getelementptr inbounds i8, ptr %2, i64 46
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 14), align 2, !tbaa !5
  %39 = icmp ult i8 %37, %38
  br i1 %39, label %.loopexit, label %40

40:                                               ; preds = %.preheader.1
  %41 = icmp ugt i8 %37, %38
  br i1 %41, label %.thread, label %.preheader.2

.preheader.2:                                     ; preds = %40
  %42 = getelementptr inbounds i8, ptr %2, i64 45
  %43 = load i8, ptr %42, align 1, !tbaa !5
  %44 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 13), align 1, !tbaa !5
  %45 = icmp ult i8 %43, %44
  br i1 %45, label %.loopexit, label %46

46:                                               ; preds = %.preheader.2
  %47 = icmp ugt i8 %43, %44
  br i1 %47, label %.thread, label %.preheader.3

.preheader.3:                                     ; preds = %46
  %48 = getelementptr inbounds i8, ptr %2, i64 44
  %49 = load i8, ptr %48, align 1, !tbaa !5
  %50 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 12), align 4, !tbaa !5
  %51 = icmp ult i8 %49, %50
  br i1 %51, label %.loopexit, label %52

52:                                               ; preds = %.preheader.3
  %53 = icmp ugt i8 %49, %50
  br i1 %53, label %.thread, label %.preheader.4

.preheader.4:                                     ; preds = %52
  %54 = getelementptr inbounds i8, ptr %2, i64 43
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %56 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 11), align 1, !tbaa !5
  %57 = icmp ult i8 %55, %56
  br i1 %57, label %.loopexit, label %58

58:                                               ; preds = %.preheader.4
  %59 = icmp ugt i8 %55, %56
  br i1 %59, label %.thread, label %.preheader.5

.preheader.5:                                     ; preds = %58
  %60 = getelementptr inbounds i8, ptr %2, i64 42
  %61 = load i8, ptr %60, align 1, !tbaa !5
  %62 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 10), align 2, !tbaa !5
  %63 = icmp ult i8 %61, %62
  br i1 %63, label %.loopexit, label %64

64:                                               ; preds = %.preheader.5
  %65 = icmp ugt i8 %61, %62
  br i1 %65, label %.thread, label %.preheader.6

.preheader.6:                                     ; preds = %64
  %66 = getelementptr inbounds i8, ptr %2, i64 41
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %68 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 9), align 1, !tbaa !5
  %69 = icmp ult i8 %67, %68
  br i1 %69, label %.loopexit, label %70

70:                                               ; preds = %.preheader.6
  %71 = icmp ugt i8 %67, %68
  br i1 %71, label %.thread, label %.preheader.7

.preheader.7:                                     ; preds = %70
  %72 = getelementptr inbounds i8, ptr %2, i64 40
  %73 = load i8, ptr %72, align 1, !tbaa !5
  %74 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 8), align 8, !tbaa !5
  %75 = icmp ult i8 %73, %74
  br i1 %75, label %.loopexit, label %76

76:                                               ; preds = %.preheader.7
  %77 = icmp ugt i8 %73, %74
  br i1 %77, label %.thread, label %.preheader.8

.preheader.8:                                     ; preds = %76
  %78 = getelementptr inbounds i8, ptr %2, i64 39
  %79 = load i8, ptr %78, align 1, !tbaa !5
  %80 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 7), align 1, !tbaa !5
  %81 = icmp ult i8 %79, %80
  br i1 %81, label %.loopexit, label %82

82:                                               ; preds = %.preheader.8
  %83 = icmp ugt i8 %79, %80
  br i1 %83, label %.thread, label %.preheader.9

.preheader.9:                                     ; preds = %82
  %84 = getelementptr inbounds i8, ptr %2, i64 38
  %85 = load i8, ptr %84, align 1, !tbaa !5
  %86 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 6), align 2, !tbaa !5
  %87 = icmp ult i8 %85, %86
  br i1 %87, label %.loopexit, label %88

88:                                               ; preds = %.preheader.9
  %89 = icmp ugt i8 %85, %86
  br i1 %89, label %.thread, label %.preheader.10

.preheader.10:                                    ; preds = %88
  %90 = getelementptr inbounds i8, ptr %2, i64 37
  %91 = load i8, ptr %90, align 1, !tbaa !5
  %92 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 5), align 1, !tbaa !5
  %93 = icmp ult i8 %91, %92
  br i1 %93, label %.loopexit, label %94

94:                                               ; preds = %.preheader.10
  %95 = icmp ugt i8 %91, %92
  br i1 %95, label %.thread, label %.preheader.11

.preheader.11:                                    ; preds = %94
  %96 = getelementptr inbounds i8, ptr %2, i64 36
  %97 = load i8, ptr %96, align 1, !tbaa !5
  %98 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 4), align 4, !tbaa !5
  %99 = icmp ult i8 %97, %98
  br i1 %99, label %.loopexit, label %100

100:                                              ; preds = %.preheader.11
  %101 = icmp ugt i8 %97, %98
  br i1 %101, label %.thread, label %.preheader.12

.preheader.12:                                    ; preds = %100
  %102 = getelementptr inbounds i8, ptr %2, i64 35
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 3), align 1, !tbaa !5
  %105 = icmp ult i8 %103, %104
  br i1 %105, label %.loopexit, label %106

106:                                              ; preds = %.preheader.12
  %107 = icmp ugt i8 %103, %104
  br i1 %107, label %.thread, label %.preheader.13

.preheader.13:                                    ; preds = %106
  %108 = getelementptr inbounds i8, ptr %2, i64 34
  %109 = load i8, ptr %108, align 1, !tbaa !5
  %110 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 2), align 2, !tbaa !5
  %111 = icmp ult i8 %109, %110
  br i1 %111, label %.loopexit, label %112

112:                                              ; preds = %.preheader.13
  %113 = icmp ugt i8 %109, %110
  br i1 %113, label %.thread, label %.preheader.14

.preheader.14:                                    ; preds = %112
  %114 = getelementptr inbounds i8, ptr %2, i64 33
  %115 = load i8, ptr %114, align 1, !tbaa !5
  %116 = load i8, ptr getelementptr inbounds (i8, ptr @__const.ossl_ed25519_verify.l_low, i64 1), align 1, !tbaa !5
  %117 = icmp ult i8 %115, %116
  br i1 %117, label %.loopexit, label %118

118:                                              ; preds = %.preheader.14
  %119 = icmp ugt i8 %115, %116
  br i1 %119, label %.thread, label %.preheader.15

.preheader.15:                                    ; preds = %118
  %120 = load i8, ptr %24, align 1, !tbaa !5
  %121 = load i8, ptr @__const.ossl_ed25519_verify.l_low, align 16, !tbaa !5
  %122 = icmp ult i8 %120, %121
  br i1 %122, label %.loopexit, label %.thread

123:                                              ; preds = %.preheader.preheader
  %124 = icmp ugt i8 %33, %34
  br i1 %124, label %.thread, label %.preheader.1

.loopexit:                                        ; preds = %.preheader.preheader, %.preheader.1, %.preheader.2, %.preheader.3, %.preheader.4, %.preheader.5, %.preheader.6, %.preheader.7, %.preheader.8, %.preheader.9, %.preheader.10, %.preheader.11, %.preheader.12, %.preheader.13, %.preheader.14, %.preheader.15, %28
  %125 = call i32 @ge_frombytes_vartime(ptr noundef nonnull %12, ptr noundef %3)
  %.not54 = icmp eq i32 %125, 0
  br i1 %.not54, label %126, label %.thread

126:                                              ; preds = %.loopexit
  call void @fe_neg(ptr noundef nonnull %12, ptr noundef nonnull %12)
  %127 = getelementptr inbounds i8, ptr %12, i64 120
  call void @fe_neg(ptr noundef nonnull %127, ptr noundef nonnull %127)
  %128 = call ptr @EVP_MD_fetch(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef %10) #4
  %129 = icmp eq ptr %128, null
  br i1 %129, label %.thread, label %130

130:                                              ; preds = %126
  %131 = call ptr @EVP_MD_CTX_new() #4
  %132 = icmp eq ptr %131, null
  br i1 %132, label %147, label %133

133:                                              ; preds = %130
  %134 = call i32 @hash_init_with_dom(ptr noundef nonnull %131, ptr noundef nonnull %128, i8 noundef zeroext %4, i8 noundef zeroext %5, ptr noundef %7, i64 noundef %spec.select)
  %.not55 = icmp eq i32 %134, 0
  br i1 %.not55, label %147, label %135

135:                                              ; preds = %133
  %136 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %131, ptr noundef nonnull %2, i64 noundef 32) #4
  %.not56 = icmp eq i32 %136, 0
  br i1 %.not56, label %147, label %137

137:                                              ; preds = %135
  %138 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %131, ptr noundef %3, i64 noundef 32) #4
  %.not57 = icmp eq i32 %138, 0
  br i1 %.not57, label %147, label %139

139:                                              ; preds = %137
  %140 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %131, ptr noundef %0, i64 noundef %1) #4
  %.not58 = icmp eq i32 %140, 0
  br i1 %.not58, label %147, label %141

141:                                              ; preds = %139
  %142 = call i32 @EVP_DigestFinal_ex(ptr noundef nonnull %131, ptr noundef nonnull %16, ptr noundef nonnull %13) #4
  %.not59 = icmp eq i32 %142, 0
  br i1 %.not59, label %147, label %143

143:                                              ; preds = %141
  call void @x25519_sc_reduce(ptr noundef nonnull %16)
  call void @ge_double_scalarmult_vartime(ptr noundef nonnull %14, ptr noundef nonnull %16, ptr noundef nonnull %12, ptr noundef nonnull %24)
  call void @ge_tobytes(ptr noundef nonnull %15, ptr noundef nonnull %14)
  %144 = call i32 @CRYPTO_memcmp(ptr noundef nonnull %15, ptr noundef nonnull %2, i64 noundef 32) #4
  %145 = icmp eq i32 %144, 0
  %146 = zext i1 %145 to i32
  br label %147

147:                                              ; preds = %133, %135, %137, %139, %141, %130, %143
  %.0 = phi i32 [ 0, %130 ], [ %146, %143 ], [ 0, %141 ], [ 0, %139 ], [ 0, %137 ], [ 0, %135 ], [ 0, %133 ]
  call void @EVP_MD_free(ptr noundef nonnull %128) #4
  call void @EVP_MD_CTX_free(ptr noundef %131) #4
  br label %.thread

.thread:                                          ; preds = %.preheader.15, %123, %40, %46, %52, %58, %64, %70, %76, %82, %88, %94, %100, %106, %112, %118, %126, %.loopexit, %30, %23, %20, %11, %147
  %.046 = phi i32 [ %.0, %147 ], [ 0, %11 ], [ 0, %20 ], [ 0, %23 ], [ 0, %30 ], [ 0, %.loopexit ], [ 0, %126 ], [ 0, %118 ], [ 0, %112 ], [ 0, %106 ], [ 0, %100 ], [ 0, %94 ], [ 0, %88 ], [ 0, %82 ], [ 0, %76 ], [ 0, %70 ], [ 0, %64 ], [ 0, %58 ], [ 0, %52 ], [ 0, %46 ], [ 0, %40 ], [ 0, %123 ], [ 0, %.preheader.15 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %12) #4
  ret i32 %.046
}

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

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

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

declare i32 @CRYPTO_memcmp(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { nofree nounwind willreturn memory(argmem: read) }
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"}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass