; LLVM IR from openssl/openssl :: crypto/ec/curve448 (eddsa)

; 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.curve448_scalar_s = type { [7 x i64] }
%struct.curve448_point_s = type { [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s] }
%struct.gf_s = type { [8 x i64] }

@ossl_curve448_precomputed_base = external global ptr, align 8

; Function Attrs: nounwind uwtable
declare hidden i32 @oneshot_hash(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 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: nounwind uwtable
declare hidden void @clamp(ptr noundef) #0

declare void @ossl_curve448_scalar_decode_long(ptr noundef, ptr noundef, i64 noundef) #2

declare void @ossl_curve448_scalar_halve(ptr noundef, ptr noundef) #2

declare void @ossl_curve448_precomputed_scalarmul(ptr noundef, ptr noundef, ptr noundef) #2

declare void @ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa(ptr noundef, ptr noundef) #2

declare void @ossl_curve448_scalar_destroy(ptr noundef) #2

declare void @ossl_curve448_point_destroy(ptr noundef) #2

declare void @OPENSSL_cleanse(ptr noundef, i64 noundef) #2

; 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
define dso_local i32 @ossl_c448_ed448_sign(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i64 noundef %8, ptr noundef %9) #0 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i8, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca [1 x %struct.curve448_scalar_s], align 16
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca [1 x %struct.curve448_scalar_s], align 16
  %26 = alloca [57 x i8], align 16
  %27 = alloca i32, align 4
  %28 = alloca [1 x %struct.curve448_scalar_s], align 16
  %29 = alloca i32, align 4
  %30 = alloca [114 x i8], align 16
  %31 = alloca [114 x i8], align 16
  %32 = alloca [1 x %struct.curve448_scalar_s], align 16
  %33 = alloca [1 x %struct.curve448_point_s], align 16
  %34 = alloca [114 x i8], align 16
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %3, ptr %15, align 8, !tbaa !5
  store ptr %4, ptr %16, align 8, !tbaa !5
  store i64 %5, ptr %17, align 8, !tbaa !9
  store i8 %6, ptr %18, align 1, !tbaa !11
  store ptr %7, ptr %19, align 8, !tbaa !5
  store i64 %8, ptr %20, align 8, !tbaa !9
  store ptr %9, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %35 = call ptr @EVP_MD_CTX_new()
  store ptr %35, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 56, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 57, ptr %26) #5
  call void @llvm.memset.p0.i64(ptr align 16 %26, i8 0, i64 57, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr %28) #5
  %36 = load ptr, ptr %23, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %39

38:                                               ; preds = %10
  store i32 0, ptr %11, align 4
  store i32 1, ptr %29, align 4
  br label %164

39:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 114, ptr %30) #5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  %43 = load ptr, ptr %21, align 8, !tbaa !5
  %44 = call i32 @oneshot_hash(ptr noundef %40, ptr noundef %41, i64 noundef 114, ptr noundef %42, i64 noundef 57, ptr noundef %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %39
  store i32 2, ptr %29, align 4
  br label %75

47:                                               ; preds = %39
  %48 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  call void @clamp(ptr noundef %48)
  %49 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %22, i64 0, i64 0
  %50 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  call void @ossl_curve448_scalar_decode_long(ptr noundef %49, ptr noundef %50, i64 noundef 57)
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %23, align 8, !tbaa !5
  %53 = load i8, ptr %18, align 1, !tbaa !11
  %54 = load ptr, ptr %19, align 8, !tbaa !5
  %55 = load i64, ptr %20, align 8, !tbaa !9
  %56 = load ptr, ptr %21, align 8, !tbaa !5
  %57 = call i32 @hash_init_with_dom(ptr noundef %51, ptr noundef %52, i8 noundef zeroext %53, i8 noundef zeroext 0, ptr noundef %54, i64 noundef %55, ptr noundef %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %71

59:                                               ; preds = %47
  %60 = load ptr, ptr %23, align 8, !tbaa !5
  %61 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  %62 = getelementptr inbounds i8, ptr %61, i64 57
  %63 = call i32 @EVP_DigestUpdate(ptr noundef %60, ptr noundef %62, i64 noundef 57)
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %71

65:                                               ; preds = %59
  %66 = load ptr, ptr %23, align 8, !tbaa !5
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = load i64, ptr %17, align 8, !tbaa !9
  %69 = call i32 @EVP_DigestUpdate(ptr noundef %66, ptr noundef %67, i64 noundef %68)
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %73, label %71

71:                                               ; preds = %65, %59, %47
  %72 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %72, i64 noundef 114)
  store i32 2, ptr %29, align 4
  br label %75

73:                                               ; preds = %65
  %74 = getelementptr inbounds [114 x i8], ptr %30, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %74, i64 noundef 114)
  store i32 0, ptr %29, align 4
  br label %75

75:                                               ; preds = %73, %71, %46
  call void @llvm.lifetime.end.p0(i64 114, ptr %30) #5
  %76 = load i32, ptr %29, align 4
  switch i32 %76, label %164 [
    i32 0, label %77
    i32 2, label %161
  ]

77:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 114, ptr %31) #5
  %78 = load ptr, ptr %23, align 8, !tbaa !5
  %79 = getelementptr inbounds [114 x i8], ptr %31, i64 0, i64 0
  %80 = call i32 @EVP_DigestFinalXOF(ptr noundef %78, ptr noundef %79, i64 noundef 114)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  store i32 2, ptr %29, align 4
  br label %87

83:                                               ; preds = %77
  %84 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %25, i64 0, i64 0
  %85 = getelementptr inbounds [114 x i8], ptr %31, i64 0, i64 0
  call void @ossl_curve448_scalar_decode_long(ptr noundef %84, ptr noundef %85, i64 noundef 114)
  %86 = getelementptr inbounds [114 x i8], ptr %31, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %86, i64 noundef 114)
  store i32 0, ptr %29, align 4
  br label %87

87:                                               ; preds = %83, %82
  call void @llvm.lifetime.end.p0(i64 114, ptr %31) #5
  %88 = load i32, ptr %29, align 4
  switch i32 %88, label %164 [
    i32 0, label %89
    i32 2, label %161
  ]

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 56, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr %33) #5
  %90 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %32, i64 0, i64 0
  %91 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %25, i64 0, i64 0
  call void @ossl_curve448_scalar_halve(ptr noundef %90, ptr noundef %91)
  store i32 2, ptr %27, align 4, !tbaa !12
  br label %92

92:                                               ; preds = %98, %89
  %93 = load i32, ptr %27, align 4, !tbaa !12
  %94 = icmp ult i32 %93, 4
  br i1 %94, label %95, label %101

95:                                               ; preds = %92
  %96 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %32, i64 0, i64 0
  %97 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %32, i64 0, i64 0
  call void @ossl_curve448_scalar_halve(ptr noundef %96, ptr noundef %97)
  br label %98

98:                                               ; preds = %95
  %99 = load i32, ptr %27, align 4, !tbaa !12
  %100 = shl i32 %99, 1
  store i32 %100, ptr %27, align 4, !tbaa !12
  br label %92, !llvm.loop !14

101:                                              ; preds = %92
  %102 = getelementptr inbounds [1 x %struct.curve448_point_s], ptr %33, i64 0, i64 0
  %103 = load ptr, ptr @ossl_curve448_precomputed_base, align 8, !tbaa !5
  %104 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %32, i64 0, i64 0
  call void @ossl_curve448_precomputed_scalarmul(ptr noundef %102, ptr noundef %103, ptr noundef %104)
  %105 = getelementptr inbounds [57 x i8], ptr %26, i64 0, i64 0
  %106 = getelementptr inbounds [1 x %struct.curve448_point_s], ptr %33, i64 0, i64 0
  call void @ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa(ptr noundef %105, ptr noundef %106)
  %107 = getelementptr inbounds [1 x %struct.curve448_point_s], ptr %33, i64 0, i64 0
  call void @ossl_curve448_point_destroy(ptr noundef %107)
  %108 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %32, i64 0, i64 0
  call void @ossl_curve448_scalar_destroy(ptr noundef %108)
  call void @llvm.lifetime.end.p0(i64 256, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 114, ptr %34) #5
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load ptr, ptr %23, align 8, !tbaa !5
  %111 = load i8, ptr %18, align 1, !tbaa !11
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  %113 = load i64, ptr %20, align 8, !tbaa !9
  %114 = load ptr, ptr %21, align 8, !tbaa !5
  %115 = call i32 @hash_init_with_dom(ptr noundef %109, ptr noundef %110, i8 noundef zeroext %111, i8 noundef zeroext 0, ptr noundef %112, i64 noundef %113, ptr noundef %114)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %138

117:                                              ; preds = %101
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  %119 = getelementptr inbounds [57 x i8], ptr %26, i64 0, i64 0
  %120 = call i32 @EVP_DigestUpdate(ptr noundef %118, ptr noundef %119, i64 noundef 57)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %138

122:                                              ; preds = %117
  %123 = load ptr, ptr %23, align 8, !tbaa !5
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = call i32 @EVP_DigestUpdate(ptr noundef %123, ptr noundef %124, i64 noundef 57)
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %138

127:                                              ; preds = %122
  %128 = load ptr, ptr %23, align 8, !tbaa !5
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = load i64, ptr %17, align 8, !tbaa !9
  %131 = call i32 @EVP_DigestUpdate(ptr noundef %128, ptr noundef %129, i64 noundef %130)
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %138

133:                                              ; preds = %127
  %134 = load ptr, ptr %23, align 8, !tbaa !5
  %135 = getelementptr inbounds [114 x i8], ptr %34, i64 0, i64 0
  %136 = call i32 @EVP_DigestFinalXOF(ptr noundef %134, ptr noundef %135, i64 noundef 114)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %139, label %138

138:                                              ; preds = %133, %127, %122, %117, %101
  store i32 2, ptr %29, align 4
  br label %143

139:                                              ; preds = %133
  %140 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  %141 = getelementptr inbounds [114 x i8], ptr %34, i64 0, i64 0
  call void @ossl_curve448_scalar_decode_long(ptr noundef %140, ptr noundef %141, i64 noundef 114)
  %142 = getelementptr inbounds [114 x i8], ptr %34, i64 0, i64 0
  call void @OPENSSL_cleanse(ptr noundef %142, i64 noundef 114)
  store i32 0, ptr %29, align 4
  br label %143

143:                                              ; preds = %139, %138
  call void @llvm.lifetime.end.p0(i64 114, ptr %34) #5
  %144 = load i32, ptr %29, align 4
  switch i32 %144, label %164 [
    i32 0, label %145
    i32 2, label %161
  ]

145:                                              ; preds = %143
  %146 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  %147 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  %148 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %22, i64 0, i64 0
  call void @ossl_curve448_scalar_mul(ptr noundef %146, ptr noundef %147, ptr noundef %148)
  %149 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  %150 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  %151 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %25, i64 0, i64 0
  call void @ossl_curve448_scalar_add(ptr noundef %149, ptr noundef %150, ptr noundef %151)
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  call void @OPENSSL_cleanse(ptr noundef %152, i64 noundef 114)
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = getelementptr inbounds [57 x i8], ptr %26, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %153, ptr align 16 %154, i64 57, i1 false)
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 57
  %157 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  call void @ossl_curve448_scalar_encode(ptr noundef %156, ptr noundef %157)
  %158 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %22, i64 0, i64 0
  call void @ossl_curve448_scalar_destroy(ptr noundef %158)
  %159 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %25, i64 0, i64 0
  call void @ossl_curve448_scalar_destroy(ptr noundef %159)
  %160 = getelementptr inbounds [1 x %struct.curve448_scalar_s], ptr %28, i64 0, i64 0
  call void @ossl_curve448_scalar_destroy(ptr noundef %160)
  store i32 -1, ptr %24, align 4, !tbaa !12
  br label %161

161:                                              ; preds = %145, %143, %87, %75
  %162 = load ptr, ptr %23, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %162)
  %163 = load i32, ptr %24, align 4, !tbaa !12
  store i32 %163, ptr %11, align 4
  store i32 1, ptr %29, align 4
  br label %164

164:                                              ; preds = %161, %143, %87, %75, %38
  call void @llvm.lifetime.end.p0(i64 56, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 57, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %22) #5
  %165 = load i32, ptr %11, align 4
  ret i32 %165
}

declare ptr @EVP_MD_CTX_new() #2

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

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

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

declare i32 @EVP_DigestFinalXOF(ptr noundef, ptr noundef, i64 noundef) #2

declare void @ossl_curve448_scalar_mul(ptr noundef, ptr noundef, ptr noundef) #2

declare void @ossl_curve448_scalar_add(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @ossl_curve448_scalar_encode(ptr noundef, ptr noundef) #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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.curve448_scalar_s = type { [7 x i64] }
%struct.curve448_point_s = type { [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s], [1 x %struct.gf_s] }
%struct.gf_s = type { [8 x i64] }

@ossl_curve448_precomputed_base = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
declare hidden i32 @oneshot_hash(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 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: nounwind uwtable
declare hidden void @clamp(ptr noundef) local_unnamed_addr #0

declare void @ossl_curve448_scalar_decode_long(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @ossl_curve448_scalar_halve(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ossl_curve448_precomputed_scalarmul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ossl_curve448_scalar_destroy(ptr noundef) local_unnamed_addr #2

declare void @ossl_curve448_point_destroy(ptr noundef) local_unnamed_addr #2

declare void @OPENSSL_cleanse(ptr noundef, i64 noundef) local_unnamed_addr #2

; 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
define dso_local noundef i32 @ossl_c448_ed448_sign(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i64 noundef %8, ptr noundef %9) local_unnamed_addr #0 {
  %11 = alloca [1 x %struct.curve448_scalar_s], align 16
  %12 = alloca [1 x %struct.curve448_scalar_s], align 16
  %13 = alloca [57 x i8], align 16
  %14 = alloca [1 x %struct.curve448_scalar_s], align 16
  %15 = alloca [114 x i8], align 16
  %16 = alloca [114 x i8], align 16
  %17 = alloca [1 x %struct.curve448_scalar_s], align 16
  %18 = alloca [1 x %struct.curve448_point_s], align 16
  %19 = alloca [114 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #5
  %20 = tail call ptr @EVP_MD_CTX_new() #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 57, ptr nonnull %13) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(57) %13, i8 0, i64 57, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %14) #5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %49, label %22

22:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 114, ptr nonnull %15) #5
  %23 = call i32 @oneshot_hash(ptr noundef %0, ptr noundef nonnull %15, i64 noundef 114, ptr noundef %2, i64 noundef 57, ptr noundef %9)
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %.thread, label %24

24:                                               ; preds = %22
  call void @clamp(ptr noundef nonnull %15)
  call void @ossl_curve448_scalar_decode_long(ptr noundef nonnull %11, ptr noundef nonnull %15, i64 noundef 57) #5
  %25 = call i32 @hash_init_with_dom(ptr noundef %0, ptr noundef nonnull %20, i8 noundef zeroext %6, i8 noundef zeroext 0, ptr noundef %7, i64 noundef %8, ptr noundef %9)
  %.not42 = icmp eq i32 %25, 0
  br i1 %.not42, label %31, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %15, i64 57
  %28 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %20, ptr noundef nonnull %27, i64 noundef 57) #5
  %.not43 = icmp eq i32 %28, 0
  br i1 %.not43, label %31, label %29

29:                                               ; preds = %26
  %30 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %20, ptr noundef %4, i64 noundef %5) #5
  %.not44 = icmp eq i32 %30, 0
  br i1 %.not44, label %31, label %32

31:                                               ; preds = %29, %26, %24
  call void @OPENSSL_cleanse(ptr noundef nonnull %15, i64 noundef 114) #5
  br label %.thread

.thread:                                          ; preds = %31, %22
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %15) #5
  br label %48

32:                                               ; preds = %29
  call void @OPENSSL_cleanse(ptr noundef nonnull %15, i64 noundef 114) #5
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 114, ptr nonnull %16) #5
  %33 = call i32 @EVP_DigestFinalXOF(ptr noundef nonnull %20, ptr noundef nonnull %16, i64 noundef 114) #5
  %.not45 = icmp eq i32 %33, 0
  br i1 %.not45, label %34, label %35

34:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %16) #5
  br label %48

35:                                               ; preds = %32
  call void @ossl_curve448_scalar_decode_long(ptr noundef nonnull %12, ptr noundef nonnull %16, i64 noundef 114) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %16, i64 noundef 114) #5
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %18) #5
  call void @ossl_curve448_scalar_halve(ptr noundef nonnull %17, ptr noundef nonnull %12) #5
  call void @ossl_curve448_scalar_halve(ptr noundef nonnull %17, ptr noundef nonnull %17) #5
  %36 = load ptr, ptr @ossl_curve448_precomputed_base, align 8, !tbaa !5
  call void @ossl_curve448_precomputed_scalarmul(ptr noundef nonnull %18, ptr noundef %36, ptr noundef nonnull %17) #5
  call void @ossl_curve448_point_mul_by_ratio_and_encode_like_eddsa(ptr noundef nonnull %13, ptr noundef nonnull %18) #5
  call void @ossl_curve448_point_destroy(ptr noundef nonnull %18) #5
  call void @ossl_curve448_scalar_destroy(ptr noundef nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 114, ptr nonnull %19) #5
  %37 = call i32 @hash_init_with_dom(ptr noundef %0, ptr noundef nonnull %20, i8 noundef zeroext %6, i8 noundef zeroext 0, ptr noundef %7, i64 noundef %8, ptr noundef %9)
  %.not46 = icmp eq i32 %37, 0
  br i1 %.not46, label %.thread64, label %38

38:                                               ; preds = %35
  %39 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %20, ptr noundef nonnull %13, i64 noundef 57) #5
  %.not47 = icmp eq i32 %39, 0
  br i1 %.not47, label %.thread64, label %40

40:                                               ; preds = %38
  %41 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %20, ptr noundef %3, i64 noundef 57) #5
  %.not48 = icmp eq i32 %41, 0
  br i1 %.not48, label %.thread64, label %42

42:                                               ; preds = %40
  %43 = call i32 @EVP_DigestUpdate(ptr noundef nonnull %20, ptr noundef %4, i64 noundef %5) #5
  %.not49 = icmp eq i32 %43, 0
  br i1 %.not49, label %.thread64, label %44

44:                                               ; preds = %42
  %45 = call i32 @EVP_DigestFinalXOF(ptr noundef nonnull %20, ptr noundef nonnull %19, i64 noundef 114) #5
  %.not50 = icmp eq i32 %45, 0
  br i1 %.not50, label %.thread64, label %46

.thread64:                                        ; preds = %44, %42, %40, %38, %35
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %19) #5
  br label %48

46:                                               ; preds = %44
  call void @ossl_curve448_scalar_decode_long(ptr noundef nonnull %14, ptr noundef nonnull %19, i64 noundef 114) #5
  call void @OPENSSL_cleanse(ptr noundef nonnull %19, i64 noundef 114) #5
  call void @llvm.lifetime.end.p0(i64 114, ptr nonnull %19) #5
  call void @ossl_curve448_scalar_mul(ptr noundef nonnull %14, ptr noundef nonnull %14, ptr noundef nonnull %11) #5
  call void @ossl_curve448_scalar_add(ptr noundef nonnull %14, ptr noundef nonnull %14, ptr noundef nonnull %12) #5
  call void @OPENSSL_cleanse(ptr noundef %1, i64 noundef 114) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(57) %1, ptr noundef nonnull align 16 dereferenceable(57) %13, i64 57, i1 false)
  %47 = getelementptr inbounds i8, ptr %1, i64 57
  call void @ossl_curve448_scalar_encode(ptr noundef nonnull %47, ptr noundef nonnull %14) #5
  call void @ossl_curve448_scalar_destroy(ptr noundef nonnull %11) #5
  call void @ossl_curve448_scalar_destroy(ptr noundef nonnull %12) #5
  call void @ossl_curve448_scalar_destroy(ptr noundef nonnull %14) #5
  br label %48

48:                                               ; preds = %.thread64, %34, %.thread, %46
  %.039 = phi i32 [ 0, %34 ], [ -1, %46 ], [ 0, %.thread ], [ 0, %.thread64 ]
  call void @EVP_MD_CTX_free(ptr noundef nonnull %20) #5
  br label %49

49:                                               ; preds = %10, %48
  %.040 = phi i32 [ %.039, %48 ], [ 0, %10 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 57, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #5
  ret i32 %.040
}

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #2

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

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

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

declare i32 @EVP_DigestFinalXOF(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @ossl_curve448_scalar_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ossl_curve448_scalar_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare void @ossl_curve448_scalar_encode(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass