; LLVM IR from cryspen/libcrux :: sys/hacl/c/src (Hacl_Frodo64)

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

@.str = external hidden unnamed_addr constant [70 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 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

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

declare void @randombytes_(i32 noundef, ptr noundef) #2

declare void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef, ptr noundef, i32 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) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext, i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Matrix_matrix_add(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local i32 @Hacl_Frodo64_crypto_kem_enc(ptr noundef %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [16 x i8], align 16
  %8 = alloca [32 x i8], align 16
  %9 = alloca [32 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca [512 x i16], align 16
  %15 = alloca [512 x i16], align 16
  %16 = alloca [64 x i16], align 16
  %17 = alloca [2176 x i8], align 16
  %18 = alloca [17 x i8], align 16
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [512 x i16], align 16
  %22 = alloca [4096 x i16], align 16
  %23 = alloca [64 x i16], align 16
  %24 = alloca [512 x i16], align 16
  %25 = alloca [64 x i16], align 16
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 16, i1 false)
  %29 = getelementptr inbounds [16 x i8], ptr %7, i64 0, i64 0
  call void @randombytes_(i32 noundef 16, ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #8
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #8
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 32, i1 false)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 976, ptr noundef %30, i32 noundef 16, ptr noundef %31)
  %32 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = getelementptr inbounds [16 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %33, ptr align 16 %34, i64 16, i1 false)
  %35 = getelementptr inbounds [32 x i8], ptr %9, i64 0, i64 0
  %36 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 32, ptr noundef %35, i32 noundef 32, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %37 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  store ptr %37, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %38 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store ptr %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %40, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  store ptr %42, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %14) #8
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 1024, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #8
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 2176, ptr %17) #8
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 2176, i1 false)
  call void @llvm.lifetime.start.p0(i64 17, ptr %18) #8
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 17, i1 false)
  %43 = getelementptr inbounds [17 x i8], ptr %18, i64 0, i64 0
  store i8 -106, ptr %43, align 16, !tbaa !9
  %44 = getelementptr inbounds [17 x i8], ptr %18, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %45, ptr align 1 %46, i64 16, i1 false)
  %47 = getelementptr inbounds [17 x i8], ptr %18, i64 0, i64 0
  %48 = getelementptr inbounds [2176 x i8], ptr %17, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 17, ptr noundef %47, i32 noundef 2176, ptr noundef %48)
  %49 = getelementptr inbounds [17 x i8], ptr %18, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %49, i64 noundef 17)
  %50 = getelementptr inbounds [2176 x i8], ptr %17, i64 0, i64 0
  %51 = getelementptr inbounds [512 x i16], ptr %14, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 64, ptr noundef %50, ptr noundef %51)
  %52 = getelementptr inbounds [2176 x i8], ptr %17, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 1024
  %54 = getelementptr inbounds [512 x i16], ptr %15, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 64, ptr noundef %53, ptr noundef %54)
  %55 = getelementptr inbounds [2176 x i8], ptr %17, i64 0, i64 0
  %56 = getelementptr inbounds i8, ptr %55, i64 2048
  %57 = getelementptr inbounds [64 x i16], ptr %16, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 8, ptr noundef %56, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %58, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 960
  store ptr %60, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %21) #8
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 8192, ptr %22) #8
  call void @llvm.memset.p0.i64(ptr align 16 %22, i8 0, i64 8192, i1 false)
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds [4096 x i16], ptr %22, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext 0, i32 noundef 64, ptr noundef %61, ptr noundef %62)
  %63 = getelementptr inbounds [512 x i16], ptr %14, i64 0, i64 0
  %64 = getelementptr inbounds [4096 x i16], ptr %22, i64 0, i64 0
  %65 = getelementptr inbounds [512 x i16], ptr %21, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 64, i32 noundef 64, ptr noundef %63, ptr noundef %64, ptr noundef %65)
  %66 = getelementptr inbounds [512 x i16], ptr %21, i64 0, i64 0
  %67 = getelementptr inbounds [512 x i16], ptr %15, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 64, ptr noundef %66, ptr noundef %67)
  %68 = getelementptr inbounds [512 x i16], ptr %21, i64 0, i64 0
  %69 = load ptr, ptr %19, align 8, !tbaa !5
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 64, i32 noundef 15, ptr noundef %68, ptr noundef %69)
  call void @llvm.lifetime.start.p0(i64 128, ptr %23) #8
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 1024, ptr %24) #8
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 1024, i1 false)
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds [512 x i16], ptr %24, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef 64, i32 noundef 8, i32 noundef 15, ptr noundef %70, ptr noundef %71)
  %72 = getelementptr inbounds [512 x i16], ptr %14, i64 0, i64 0
  %73 = getelementptr inbounds [512 x i16], ptr %24, i64 0, i64 0
  %74 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 64, i32 noundef 8, ptr noundef %72, ptr noundef %73, ptr noundef %74)
  %75 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %76 = getelementptr inbounds [64 x i16], ptr %16, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 8, ptr noundef %75, ptr noundef %76)
  call void @llvm.lifetime.start.p0(i64 128, ptr %25) #8
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 128, i1 false)
  %77 = getelementptr inbounds [16 x i8], ptr %7, i64 0, i64 0
  %78 = getelementptr inbounds [64 x i16], ptr %25, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Encode_frodo_key_encode(i32 noundef 15, i32 noundef 2, i32 noundef 8, ptr noundef %77, ptr noundef %78)
  %79 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %80 = getelementptr inbounds [64 x i16], ptr %25, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 8, ptr noundef %79, ptr noundef %80)
  %81 = getelementptr inbounds [64 x i16], ptr %25, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %81, i64 noundef 128)
  %82 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %83 = load ptr, ptr %20, align 8, !tbaa !5
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 8, i32 noundef 15, ptr noundef %82, ptr noundef %83)
  %84 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %84, i64 noundef 128)
  %85 = getelementptr inbounds [512 x i16], ptr %14, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %85, i64 noundef 1024)
  %86 = getelementptr inbounds [512 x i16], ptr %15, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %86, i64 noundef 1024)
  %87 = getelementptr inbounds [64 x i16], ptr %16, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %87, i64 noundef 128)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 1096, ptr %26, align 4, !tbaa !10
  br label %88

88:                                               ; preds = %3
  %89 = load i32, ptr %26, align 4, !tbaa !10
  %90 = zext i32 %89 to i64
  %91 = icmp ugt i64 %90, -1
  br i1 %91, label %92, label %94

92:                                               ; preds = %88
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 132)
  call void @exit(i32 noundef 253) #9
  unreachable

94:                                               ; preds = %88
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %26, align 4, !tbaa !10
  %98 = zext i32 %97 to i64
  %99 = call ptr @llvm.stacksave.p0()
  store ptr %99, ptr %27, align 8
  %100 = alloca i8, i64 %98, align 16
  store i64 %98, ptr %28, align 8
  %101 = load i32, ptr %26, align 4, !tbaa !10
  %102 = zext i32 %101 to i64
  %103 = mul i64 %102, 1
  call void @llvm.memset.p0.i64(ptr align 16 %100, i8 0, i64 %103, i1 false)
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %100, ptr align 1 %104, i64 1080, i1 false)
  %105 = getelementptr inbounds i8, ptr %100, i64 1080
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %105, ptr align 1 %106, i64 16, i1 false)
  %107 = load i32, ptr %26, align 4, !tbaa !10
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef %107, ptr noundef %100, i32 noundef 16, ptr noundef %108)
  %109 = load i32, ptr %26, align 4, !tbaa !10
  %110 = zext i32 %109 to i64
  %111 = mul i64 %110, 1
  call void @Lib_Memzero0_memzero0(ptr noundef %100, i64 noundef %111)
  %112 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %112, i64 noundef 32)
  %113 = getelementptr inbounds [16 x i8], ptr %7, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %113, i64 noundef 16)
  %114 = load ptr, ptr %27, align 8
  call void @llvm.stackrestore.p0(ptr %114)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8192, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 17, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 2176, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  ret i32 0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Matrix_matrix_mul(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Encode_frodo_key_encode(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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: 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 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 #6 = { noreturn nounwind "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 #7 = { nocallback nofree nosync nounwind willreturn }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

declare void @randombytes_(i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef, ptr noundef, i32 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) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Matrix_matrix_add(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @Hacl_Frodo64_crypto_kem_enc(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 {
  %4 = alloca [16 x i8], align 16
  %5 = alloca [32 x i8], align 16
  %6 = alloca [32 x i8], align 16
  %7 = alloca [512 x i16], align 16
  %8 = alloca [512 x i16], align 16
  %9 = alloca [64 x i16], align 16
  %10 = alloca [2176 x i8], align 16
  %11 = alloca [17 x i8], align 16
  %12 = alloca [512 x i16], align 16
  %13 = alloca [4096 x i16], align 16
  %14 = alloca [64 x i16], align 16
  %15 = alloca [512 x i16], align 16
  %16 = alloca [64 x i16], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @randombytes_(i32 noundef 16, ptr noundef nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, i8 0, i64 32, i1 false)
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 976, ptr noundef %2, i32 noundef 16, ptr noundef nonnull %6) #7
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %17, ptr noundef nonnull align 16 dereferenceable(16) %4, i64 16, i1 false)
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 32, ptr noundef nonnull %6, i32 noundef 32, ptr noundef nonnull %5) #7
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %7, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %8) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %8, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %9, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 2176, ptr nonnull %10) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2176) %10, i8 0, i64 2176, i1 false)
  call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %11) #7
  store i8 -106, ptr %11, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %11, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %19, ptr noundef nonnull align 16 dereferenceable(16) %5, i64 16, i1 false)
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 17, ptr noundef nonnull %11, i32 noundef 2176, ptr noundef nonnull %10) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %11, i64 noundef 17) #7
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 64, ptr noundef nonnull %10, ptr noundef nonnull %7)
  %20 = getelementptr inbounds i8, ptr %10, i64 1024
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 64, ptr noundef nonnull %20, ptr noundef nonnull %8)
  %21 = getelementptr inbounds i8, ptr %10, i64 2048
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix64(i32 noundef 8, i32 noundef 8, ptr noundef nonnull %21, ptr noundef nonnull %9)
  %22 = getelementptr inbounds i8, ptr %0, i64 960
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %12) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %12, i8 0, i64 1024, i1 false)
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %13) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8192) %13, i8 0, i64 8192, i1 false)
  call void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext 0, i32 noundef 64, ptr noundef %2, ptr noundef nonnull %13)
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 64, i32 noundef 64, ptr noundef nonnull %7, ptr noundef nonnull %13, ptr noundef nonnull %12)
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 64, ptr noundef nonnull %12, ptr noundef nonnull %8)
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 64, i32 noundef 15, ptr noundef nonnull %12, ptr noundef %0)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %14) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %14, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %15) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %15, i8 0, i64 1024, i1 false)
  call void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef 64, i32 noundef 8, i32 noundef 15, ptr noundef nonnull %18, ptr noundef nonnull %15)
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 64, i32 noundef 8, ptr noundef nonnull %7, ptr noundef nonnull %15, ptr noundef nonnull %14)
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 8, ptr noundef nonnull %14, ptr noundef nonnull %9)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %16) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %16, i8 0, i64 128, i1 false)
  call void @Hacl_Impl_Frodo_Encode_frodo_key_encode(i32 noundef 15, i32 noundef 2, i32 noundef 8, ptr noundef nonnull %4, ptr noundef nonnull %16)
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 8, ptr noundef nonnull %14, ptr noundef nonnull %16)
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %16, i64 noundef 128) #7
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 8, i32 noundef 15, ptr noundef nonnull %14, ptr noundef nonnull %22)
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %14, i64 noundef 128) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %7, i64 noundef 1024) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %8, i64 noundef 1024) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %9, i64 noundef 128) #7
  %23 = getelementptr inbounds i8, ptr %5, i64 16
  %24 = call ptr @llvm.stacksave.p0()
  %25 = alloca [1096 x i8], align 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1080) %25, ptr noundef nonnull align 1 dereferenceable(1080) %0, i64 1080, i1 false)
  %26 = getelementptr inbounds i8, ptr %25, i64 1080
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 16 dereferenceable(16) %23, i64 16, i1 false)
  call void @Hacl_Hash_SHA3_shake128_hacl(i32 noundef 1096, ptr noundef nonnull %25, i32 noundef 16, ptr noundef %1) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %25, i64 noundef 1096) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %5, i64 noundef 32) #7
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %4, i64 noundef 16) #7
  call void @llvm.stackrestore.p0(ptr %24)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 2176, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  ret i32 0
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Matrix_matrix_mul(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @Hacl_Impl_Frodo_Encode_frodo_key_encode(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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: 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 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 #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass