; LLVM IR from openssl/openssl :: crypto/ml_dsa (ml_dsa_key)

; 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.ml_dsa_key_st = type { ptr, ptr, ptr, ptr, [32 x i8], [64 x i8], [32 x i8], ptr, ptr, ptr, i32, %struct.vector_st, %struct.vector_st, %struct.vector_st, %struct.vector_st }
%struct.vector_st = type { ptr, i64 }
%struct.ml_dsa_params_st = type { ptr, i32, i32, i32, i32, i32, i64, i64, i32, i32, i32, i32, i64, i64, i64 }

@.str = external hidden unnamed_addr constant [76 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 @CRYPTO_memdup(ptr noundef, i64 noundef, ptr noundef, i32 noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_ml_dsa_key_pub_alloc(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_ml_dsa_key_priv_alloc(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_ml_dsa_key_dup(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %191

11:                                               ; preds = %2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %12, i32 0, i32 7
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %27

16:                                               ; preds = %11
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %17, i32 0, i32 8
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = icmp ne ptr %19, null
  br i1 %20, label %26, label %21

21:                                               ; preds = %16
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %22, i32 0, i32 9
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %21, %16
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %191

27:                                               ; preds = %21, %11
  %28 = call ptr @CRYPTO_zalloc(i64 noundef 256, ptr noundef @.str, i32 noundef 191)
  store ptr %28, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %187

31:                                               ; preds = %27
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %35, i32 0, i32 0
  store ptr %34, ptr %36, align 8, !tbaa !17
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %40, i32 0, i32 1
  store ptr %39, ptr %41, align 8, !tbaa !18
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %42, i32 0, i32 10
  %44 = load i32, ptr %43, align 8, !tbaa !19
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %45, i32 0, i32 10
  store i32 %44, ptr %46, align 8, !tbaa !19
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = and i32 %47, 3
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %168

50:                                               ; preds = %31
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %51, i32 0, i32 7
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %98

55:                                               ; preds = %50
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %56, i32 0, i32 4
  %58 = getelementptr inbounds [32 x i8], ptr %57, i64 0, i64 0
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %59, i32 0, i32 4
  %61 = getelementptr inbounds [32 x i8], ptr %60, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %61, i64 32, i1 false)
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %62, i32 0, i32 5
  %64 = getelementptr inbounds [64 x i8], ptr %63, i64 0, i64 0
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %65, i32 0, i32 5
  %67 = getelementptr inbounds [64 x i8], ptr %66, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 8 %67, i64 64, i1 false)
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %68, i32 0, i32 11
  %70 = getelementptr inbounds %struct.vector_st, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !20
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %83

73:                                               ; preds = %55
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = call i32 @ossl_ml_dsa_key_pub_alloc(ptr noundef %74)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  br label %189

78:                                               ; preds = %73
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %79, i32 0, i32 11
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %81, i32 0, i32 11
  call void @vector_copy(ptr noundef %80, ptr noundef %82)
  br label %83

83:                                               ; preds = %78, %55
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %84, i32 0, i32 7
  %86 = load ptr, ptr %85, align 8, !tbaa !11
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %90 = getelementptr inbounds %struct.ml_dsa_params_st, ptr %89, i32 0, i32 13
  %91 = load i64, ptr %90, align 8, !tbaa !21
  %92 = call ptr @CRYPTO_memdup(ptr noundef %86, i64 noundef %91, ptr noundef @.str, i32 noundef 207)
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %93, i32 0, i32 7
  store ptr %92, ptr %94, align 8, !tbaa !11
  %95 = icmp eq ptr %92, null
  br i1 %95, label %96, label %97

96:                                               ; preds = %83
  br label %189

97:                                               ; preds = %83
  br label %98

98:                                               ; preds = %97, %50
  %99 = load i32, ptr %5, align 4, !tbaa !9
  %100 = and i32 %99, 1
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %167

102:                                              ; preds = %98
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %103, i32 0, i32 8
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %152

107:                                              ; preds = %102
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %108, i32 0, i32 6
  %110 = getelementptr inbounds [32 x i8], ptr %109, i64 0, i64 0
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %111, i32 0, i32 6
  %113 = getelementptr inbounds [32 x i8], ptr %112, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %110, ptr align 8 %113, i64 32, i1 false)
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %114, i32 0, i32 14
  %116 = getelementptr inbounds %struct.vector_st, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !23
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %137

119:                                              ; preds = %107
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call i32 @ossl_ml_dsa_key_priv_alloc(ptr noundef %120)
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  br label %189

124:                                              ; preds = %119
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %125, i32 0, i32 14
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %127, i32 0, i32 14
  call void @vector_copy(ptr noundef %126, ptr noundef %128)
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %129, i32 0, i32 13
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %131, i32 0, i32 13
  call void @vector_copy(ptr noundef %130, ptr noundef %132)
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %133, i32 0, i32 12
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %135, i32 0, i32 12
  call void @vector_copy(ptr noundef %134, ptr noundef %136)
  br label %137

137:                                              ; preds = %124, %107
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %138, i32 0, i32 8
  %140 = load ptr, ptr %139, align 8, !tbaa !15
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !18
  %144 = getelementptr inbounds %struct.ml_dsa_params_st, ptr %143, i32 0, i32 12
  %145 = load i64, ptr %144, align 8, !tbaa !24
  %146 = call ptr @CRYPTO_memdup(ptr noundef %140, i64 noundef %145, ptr noundef @.str, i32 noundef 222)
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %147, i32 0, i32 8
  store ptr %146, ptr %148, align 8, !tbaa !15
  %149 = icmp eq ptr %146, null
  br i1 %149, label %150, label %151

150:                                              ; preds = %137
  br label %189

151:                                              ; preds = %137
  br label %152

152:                                              ; preds = %151, %102
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %153, i32 0, i32 9
  %155 = load ptr, ptr %154, align 8, !tbaa !16
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %166

157:                                              ; preds = %152
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %158, i32 0, i32 9
  %160 = load ptr, ptr %159, align 8, !tbaa !16
  %161 = call ptr @CRYPTO_memdup(ptr noundef %160, i64 noundef 32, ptr noundef @.str, i32 noundef 227)
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %162, i32 0, i32 9
  store ptr %161, ptr %163, align 8, !tbaa !16
  %164 = icmp eq ptr %161, null
  br i1 %164, label %165, label %166

165:                                              ; preds = %157
  br label %189

166:                                              ; preds = %157, %152
  br label %167

167:                                              ; preds = %166, %98
  br label %168

168:                                              ; preds = %167, %31
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %169, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !25
  %172 = call i32 @EVP_MD_up_ref(ptr noundef %171)
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %173, i32 0, i32 3
  %175 = load ptr, ptr %174, align 8, !tbaa !26
  %176 = call i32 @EVP_MD_up_ref(ptr noundef %175)
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !25
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %180, i32 0, i32 2
  store ptr %179, ptr %181, align 8, !tbaa !25
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %182, i32 0, i32 3
  %184 = load ptr, ptr %183, align 8, !tbaa !26
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.ml_dsa_key_st, ptr %185, i32 0, i32 3
  store ptr %184, ptr %186, align 8, !tbaa !26
  br label %187

187:                                              ; preds = %168, %27
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %188, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %191

189:                                              ; preds = %165, %150, %123, %96, %77
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  call void @ossl_ml_dsa_key_free(ptr noundef %190)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %191

191:                                              ; preds = %189, %187, %26, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %192 = load ptr, ptr %3, align 8
  ret ptr %192
}

; 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: inlinehint nounwind uwtable
declare hidden void @vector_copy(ptr noundef, ptr noundef) #4

declare i32 @EVP_MD_up_ref(ptr 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 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 160}
!12 = !{!"ml_dsa_key_st", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 64, !7, i64 128, !6, i64 160, !6, i64 168, !6, i64 176, !10, i64 184, !13, i64 192, !13, i64 208, !13, i64 224, !13, i64 240}
!13 = !{!"vector_st", !6, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 168}
!16 = !{!12, !6, i64 176}
!17 = !{!12, !6, i64 0}
!18 = !{!12, !6, i64 8}
!19 = !{!12, !10, i64 184}
!20 = !{!12, !6, i64 192}
!21 = !{!22, !14, i64 72}
!22 = !{!"ml_dsa_params_st", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !14, i64 32, !14, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !14, i64 64, !14, i64 72, !14, i64 80}
!23 = !{!12, !6, i64 240}
!24 = !{!22, !14, i64 64}
!25 = !{!12, !6, i64 16}
!26 = !{!12, !6, i64 24}


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

@.str = external hidden unnamed_addr constant [76 x i8], align 1

declare ptr @CRYPTO_memdup(ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare ptr @CRYPTO_zalloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ossl_ml_dsa_key_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_ml_dsa_key_pub_alloc(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ossl_ml_dsa_key_priv_alloc(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_ml_dsa_key_dup(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = icmp eq ptr %0, null
  br i1 %3, label %87, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %14

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %87

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 176
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %.not53 = icmp eq ptr %13, null
  br i1 %.not53, label %14, label %87

14:                                               ; preds = %11, %4
  %15 = tail call ptr @CRYPTO_zalloc(i64 noundef 256, ptr noundef nonnull @.str, i32 noundef 191) #4
  %.not54 = icmp eq ptr %15, null
  br i1 %.not54, label %87, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load <2 x ptr>, ptr %0, align 8, !tbaa !15
  store <2 x ptr> %18, ptr %15, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %0, i64 184
  %20 = load i32, ptr %19, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %15, i64 184
  store i32 %20, ptr %21, align 8, !tbaa !16
  %22 = and i32 %1, 3
  %.not55 = icmp eq i32 %22, 0
  br i1 %.not55, label %77, label %23

23:                                               ; preds = %16
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %.not56 = icmp eq ptr %24, null
  br i1 %.not56, label %44, label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %15, i64 32
  %27 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(32) %27, i64 32, i1 false)
  %28 = getelementptr inbounds i8, ptr %15, i64 64
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %28, ptr noundef nonnull align 8 dereferenceable(64) %29, i64 64, i1 false)
  %30 = getelementptr inbounds i8, ptr %0, i64 192
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %.not57 = icmp eq ptr %31, null
  br i1 %.not57, label %36, label %32

32:                                               ; preds = %25
  %33 = tail call i32 @ossl_ml_dsa_key_pub_alloc(ptr noundef nonnull %15)
  %.not58 = icmp eq i32 %33, 0
  br i1 %.not58, label %86, label %34

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %15, i64 192
  tail call void @vector_copy(ptr noundef nonnull %35, ptr noundef nonnull %30)
  br label %36

36:                                               ; preds = %34, %25
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load ptr, ptr %17, align 8, !tbaa !18
  %39 = getelementptr inbounds i8, ptr %38, i64 72
  %40 = load i64, ptr %39, align 8, !tbaa !19
  %41 = tail call ptr @CRYPTO_memdup(ptr noundef %37, i64 noundef %40, ptr noundef nonnull @.str, i32 noundef 207) #4
  %42 = getelementptr inbounds i8, ptr %15, i64 160
  store ptr %41, ptr %42, align 8, !tbaa !5
  %43 = icmp eq ptr %41, null
  br i1 %43, label %86, label %44

44:                                               ; preds = %36, %23
  %45 = and i32 %1, 1
  %.not59 = icmp eq i32 %45, 0
  br i1 %.not59, label %77, label %46

46:                                               ; preds = %44
  %47 = getelementptr inbounds i8, ptr %0, i64 168
  %48 = load ptr, ptr %47, align 8, !tbaa !13
  %.not60 = icmp eq ptr %48, null
  br i1 %.not60, label %70, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %15, i64 128
  %51 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %50, ptr noundef nonnull align 8 dereferenceable(32) %51, i64 32, i1 false)
  %52 = getelementptr inbounds i8, ptr %0, i64 240
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %.not61 = icmp eq ptr %53, null
  br i1 %.not61, label %62, label %54

54:                                               ; preds = %49
  %55 = tail call i32 @ossl_ml_dsa_key_priv_alloc(ptr noundef nonnull %15)
  %.not62 = icmp eq i32 %55, 0
  br i1 %.not62, label %86, label %56

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %15, i64 240
  tail call void @vector_copy(ptr noundef nonnull %57, ptr noundef nonnull %52)
  %58 = getelementptr inbounds i8, ptr %15, i64 224
  %59 = getelementptr inbounds i8, ptr %0, i64 224
  tail call void @vector_copy(ptr noundef nonnull %58, ptr noundef nonnull %59)
  %60 = getelementptr inbounds i8, ptr %15, i64 208
  %61 = getelementptr inbounds i8, ptr %0, i64 208
  tail call void @vector_copy(ptr noundef nonnull %60, ptr noundef nonnull %61)
  br label %62

62:                                               ; preds = %56, %49
  %63 = load ptr, ptr %47, align 8, !tbaa !13
  %64 = load ptr, ptr %17, align 8, !tbaa !18
  %65 = getelementptr inbounds i8, ptr %64, i64 64
  %66 = load i64, ptr %65, align 8, !tbaa !22
  %67 = tail call ptr @CRYPTO_memdup(ptr noundef %63, i64 noundef %66, ptr noundef nonnull @.str, i32 noundef 222) #4
  %68 = getelementptr inbounds i8, ptr %15, i64 168
  store ptr %67, ptr %68, align 8, !tbaa !13
  %69 = icmp eq ptr %67, null
  br i1 %69, label %86, label %70

70:                                               ; preds = %62, %46
  %71 = getelementptr inbounds i8, ptr %0, i64 176
  %72 = load ptr, ptr %71, align 8, !tbaa !14
  %.not63 = icmp eq ptr %72, null
  br i1 %.not63, label %77, label %73

73:                                               ; preds = %70
  %74 = tail call ptr @CRYPTO_memdup(ptr noundef nonnull %72, i64 noundef 32, ptr noundef nonnull @.str, i32 noundef 227) #4
  %75 = getelementptr inbounds i8, ptr %15, i64 176
  store ptr %74, ptr %75, align 8, !tbaa !14
  %76 = icmp eq ptr %74, null
  br i1 %76, label %86, label %77

77:                                               ; preds = %44, %73, %70, %16
  %78 = getelementptr inbounds i8, ptr %0, i64 16
  %79 = load ptr, ptr %78, align 8, !tbaa !23
  %80 = tail call i32 @EVP_MD_up_ref(ptr noundef %79) #4
  %81 = getelementptr inbounds i8, ptr %0, i64 24
  %82 = load ptr, ptr %81, align 8, !tbaa !24
  %83 = tail call i32 @EVP_MD_up_ref(ptr noundef %82) #4
  %84 = getelementptr inbounds i8, ptr %15, i64 16
  %85 = load <2 x ptr>, ptr %78, align 8, !tbaa !15
  store <2 x ptr> %85, ptr %84, align 8, !tbaa !15
  br label %87

86:                                               ; preds = %73, %62, %54, %36, %32
  tail call void @ossl_ml_dsa_key_free(ptr noundef nonnull %15)
  br label %87

87:                                               ; preds = %14, %77, %8, %11, %2, %86
  %.0 = phi ptr [ null, %86 ], [ null, %2 ], [ null, %11 ], [ null, %8 ], [ %15, %77 ], [ null, %14 ]
  ret ptr %.0
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @vector_copy(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @EVP_MD_up_ref(ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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, !7, i64 160}
!6 = !{!"ml_dsa_key_st", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, i64 32, !8, i64 64, !8, i64 128, !7, i64 160, !7, i64 168, !7, i64 176, !10, i64 184, !11, i64 192, !11, i64 208, !11, i64 224, !11, i64 240}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"vector_st", !7, i64 0, !12, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !7, i64 168}
!14 = !{!6, !7, i64 176}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !10, i64 184}
!17 = !{!6, !7, i64 192}
!18 = !{!6, !7, i64 8}
!19 = !{!20, !12, i64 72}
!20 = !{!"ml_dsa_params_st", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !12, i64 32, !12, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !12, i64 64, !12, i64 72, !12, i64 80}
!21 = !{!6, !7, i64 240}
!22 = !{!20, !12, i64 64}
!23 = !{!6, !7, i64 16}
!24 = !{!6, !7, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass