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

; 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 [86 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_shake256_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_matrix1344(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_Frodo1344_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 [32 x i8], align 16
  %8 = alloca [64 x i8], align 16
  %9 = alloca [64 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 [10752 x i16], align 16
  %15 = alloca [10752 x i16], align 16
  %16 = alloca [64 x i16], align 16
  %17 = alloca [43136 x i8], align 16
  %18 = alloca [33 x i8], align 16
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [10752 x i16], align 16
  %22 = alloca [1806336 x i16], align 16
  %23 = alloca [64 x i16], align 16
  %24 = alloca [10752 x i16], align 16
  %25 = alloca [64 x i16], align 16
  %26 = alloca i32, align 4
  %27 = alloca ptr, 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 32, ptr %7) #7
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 32, i1 false)
  %28 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @randombytes_(i32 noundef 32, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 16 %8, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 64, i1 false)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 21520, ptr noundef %29, i32 noundef 32, ptr noundef %30)
  %31 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %32 = getelementptr inbounds i8, ptr %31, i64 32
  %33 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 16 %33, i64 32, i1 false)
  %34 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %35 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 64, ptr noundef %34, i32 noundef 64, ptr noundef %35)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %36 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  store ptr %36, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %37 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  %38 = getelementptr inbounds i8, ptr %37, i64 32
  store ptr %38, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %39, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  store ptr %41, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 21504, ptr %14) #7
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 21504, i1 false)
  call void @llvm.lifetime.start.p0(i64 21504, ptr %15) #7
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 21504, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #7
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 43136, ptr %17) #7
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 43136, i1 false)
  call void @llvm.lifetime.start.p0(i64 33, ptr %18) #7
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 33, i1 false)
  %42 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  store i8 -106, ptr %42, align 16, !tbaa !9
  %43 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 %45, i64 32, i1 false)
  %46 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  %47 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 33, ptr noundef %46, i32 noundef 43136, ptr noundef %47)
  %48 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %48, i64 noundef 33)
  %49 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %50 = getelementptr inbounds [10752 x i16], ptr %14, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 1344, ptr noundef %49, ptr noundef %50)
  %51 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %52 = getelementptr inbounds i8, ptr %51, i64 21504
  %53 = getelementptr inbounds [10752 x i16], ptr %15, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 1344, ptr noundef %52, ptr noundef %53)
  %54 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 43008
  %56 = getelementptr inbounds [64 x i16], ptr %16, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 8, ptr noundef %55, ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %57, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 21504
  store ptr %59, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 21504, ptr %21) #7
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 21504, i1 false)
  br label %60

60:                                               ; preds = %3
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 3612672, ptr %22) #7
  call void @llvm.memset.p0.i64(ptr align 16 %22, i8 0, i64 3612672, i1 false)
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds [1806336 x i16], ptr %22, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext 0, i32 noundef 1344, ptr noundef %63, ptr noundef %64)
  %65 = getelementptr inbounds [10752 x i16], ptr %14, i64 0, i64 0
  %66 = getelementptr inbounds [1806336 x i16], ptr %22, i64 0, i64 0
  %67 = getelementptr inbounds [10752 x i16], ptr %21, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 1344, i32 noundef 1344, ptr noundef %65, ptr noundef %66, ptr noundef %67)
  %68 = getelementptr inbounds [10752 x i16], ptr %21, i64 0, i64 0
  %69 = getelementptr inbounds [10752 x i16], ptr %15, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 1344, ptr noundef %68, ptr noundef %69)
  %70 = getelementptr inbounds [10752 x i16], ptr %21, i64 0, i64 0
  %71 = load ptr, ptr %19, align 8, !tbaa !5
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 1344, i32 noundef 16, ptr noundef %70, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 128, ptr %23) #7
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 21504, ptr %24) #7
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 21504, i1 false)
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds [10752 x i16], ptr %24, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef 1344, i32 noundef 8, i32 noundef 16, ptr noundef %72, ptr noundef %73)
  %74 = getelementptr inbounds [10752 x i16], ptr %14, i64 0, i64 0
  %75 = getelementptr inbounds [10752 x i16], ptr %24, i64 0, i64 0
  %76 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 1344, i32 noundef 8, ptr noundef %74, ptr noundef %75, ptr noundef %76)
  %77 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %78 = 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 %77, ptr noundef %78)
  call void @llvm.lifetime.start.p0(i64 128, ptr %25) #7
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 128, i1 false)
  %79 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %80 = getelementptr inbounds [64 x i16], ptr %25, i64 0, i64 0
  call void @Hacl_Impl_Frodo_Encode_frodo_key_encode(i32 noundef 16, i32 noundef 4, i32 noundef 8, ptr noundef %79, ptr noundef %80)
  %81 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %82 = 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 %81, ptr noundef %82)
  %83 = getelementptr inbounds [64 x i16], ptr %25, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %83, i64 noundef 128)
  %84 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  %85 = load ptr, ptr %20, align 8, !tbaa !5
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 8, i32 noundef 16, ptr noundef %84, ptr noundef %85)
  %86 = getelementptr inbounds [64 x i16], ptr %23, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %86, i64 noundef 128)
  %87 = getelementptr inbounds [10752 x i16], ptr %14, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %87, i64 noundef 21504)
  %88 = getelementptr inbounds [10752 x i16], ptr %15, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %88, i64 noundef 21504)
  %89 = getelementptr inbounds [64 x i16], ptr %16, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %89, i64 noundef 128)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 21664, ptr %26, align 4, !tbaa !10
  br label %90

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

94:                                               ; preds = %90
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 129)
  call void @exit(i32 noundef 253) #8
  unreachable

96:                                               ; preds = %90
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %99 = load i32, ptr %26, align 4, !tbaa !10
  %100 = zext i32 %99 to i64
  %101 = mul i64 %100, 1
  %102 = alloca i8, i64 %101, align 16
  store ptr %102, ptr %27, align 8, !tbaa !5
  %103 = load ptr, ptr %27, align 8, !tbaa !5
  %104 = load i32, ptr %26, align 4, !tbaa !10
  %105 = zext i32 %104 to i64
  %106 = mul i64 %105, 1
  call void @llvm.memset.p0.i64(ptr align 1 %103, i8 0, i64 %106, i1 false)
  %107 = load ptr, ptr %27, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %107, ptr align 1 %108, i64 21632, i1 false)
  %109 = load ptr, ptr %27, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 21632
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %110, ptr align 1 %111, i64 32, i1 false)
  %112 = load i32, ptr %26, align 4, !tbaa !10
  %113 = load ptr, ptr %27, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef %112, ptr noundef %113, i32 noundef 32, ptr noundef %114)
  %115 = load ptr, ptr %27, align 8, !tbaa !5
  %116 = load i32, ptr %26, align 4, !tbaa !10
  %117 = zext i32 %116 to i64
  %118 = mul i64 %117, 1
  call void @Lib_Memzero0_memzero0(ptr noundef %115, i64 noundef %118)
  %119 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %119, i64 noundef 64)
  %120 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %120, i64 noundef 32)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 21504, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 3612672, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 21504, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 33, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 43136, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 21504, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 21504, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #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) #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

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 = { nounwind }
attributes #8 = { 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_shake256_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_matrix1344(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_Frodo1344_crypto_kem_enc(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 {
  %4 = alloca [32 x i8], align 16
  %5 = alloca [64 x i8], align 16
  %6 = alloca [64 x i8], align 16
  %7 = alloca [10752 x i16], align 16
  %8 = alloca [10752 x i16], align 16
  %9 = alloca [64 x i16], align 16
  %10 = alloca [43136 x i8], align 16
  %11 = alloca [33 x i8], align 16
  %12 = alloca [10752 x i16], align 16
  %13 = alloca [1806336 x i16], align 16
  %14 = alloca [64 x i16], align 16
  %15 = alloca [10752 x i16], align 16
  %16 = alloca [64 x i16], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, i8 0, i64 32, i1 false)
  call void @randombytes_(i32 noundef 32, ptr noundef nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %5, i8 0, i64 64, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %6, i8 0, i64 64, i1 false)
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 21520, ptr noundef %2, i32 noundef 32, ptr noundef nonnull %6) #6
  %17 = getelementptr inbounds i8, ptr %6, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %17, ptr noundef nonnull align 16 dereferenceable(32) %4, i64 32, i1 false)
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 64, ptr noundef nonnull %6, i32 noundef 64, ptr noundef nonnull %5) #6
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  call void @llvm.lifetime.start.p0(i64 21504, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21504) %7, i8 0, i64 21504, i1 false)
  call void @llvm.lifetime.start.p0(i64 21504, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21504) %8, i8 0, i64 21504, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #6
  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 43136, ptr nonnull %10) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(43136) %10, i8 0, i64 43136, i1 false)
  call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %11) #6
  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(32) %19, ptr noundef nonnull align 16 dereferenceable(32) %5, i64 32, i1 false)
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 33, ptr noundef nonnull %11, i32 noundef 43136, ptr noundef nonnull %10) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %11, i64 noundef 33) #6
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 1344, ptr noundef nonnull %10, ptr noundef nonnull %7)
  %20 = getelementptr inbounds i8, ptr %10, i64 21504
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 1344, ptr noundef nonnull %20, ptr noundef nonnull %8)
  %21 = getelementptr inbounds i8, ptr %10, i64 43008
  call void @Hacl_Impl_Frodo_Sample_frodo_sample_matrix1344(i32 noundef 8, i32 noundef 8, ptr noundef nonnull %21, ptr noundef nonnull %9)
  %22 = getelementptr inbounds i8, ptr %0, i64 21504
  call void @llvm.lifetime.start.p0(i64 21504, ptr nonnull %12) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21504) %12, i8 0, i64 21504, i1 false)
  call void @llvm.lifetime.start.p0(i64 3612672, ptr nonnull %13) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3612672) %13, i8 0, i64 3612672, i1 false)
  call void @Hacl_Impl_Frodo_Params_frodo_gen_matrix(i8 noundef zeroext 0, i32 noundef 1344, ptr noundef %2, ptr noundef nonnull %13)
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 1344, i32 noundef 1344, ptr noundef nonnull %7, ptr noundef nonnull %13, ptr noundef nonnull %12)
  call void @Hacl_Impl_Matrix_matrix_add(i32 noundef 8, i32 noundef 1344, ptr noundef nonnull %12, ptr noundef nonnull %8)
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 1344, i32 noundef 16, ptr noundef nonnull %12, ptr noundef %0)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %14) #6
  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 21504, ptr nonnull %15) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(21504) %15, i8 0, i64 21504, i1 false)
  call void @Hacl_Impl_Frodo_Pack_frodo_unpack(i32 noundef 1344, i32 noundef 8, i32 noundef 16, ptr noundef nonnull %18, ptr noundef nonnull %15)
  call void @Hacl_Impl_Matrix_matrix_mul(i32 noundef 8, i32 noundef 1344, 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) #6
  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 16, i32 noundef 4, 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) #6
  call void @Hacl_Impl_Frodo_Pack_frodo_pack(i32 noundef 8, i32 noundef 8, i32 noundef 16, ptr noundef nonnull %14, ptr noundef nonnull %22)
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %14, i64 noundef 128) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %7, i64 noundef 21504) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %8, i64 noundef 21504) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %9, i64 noundef 128) #6
  %23 = getelementptr inbounds i8, ptr %5, i64 32
  %24 = alloca [21664 x i8], align 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(21632) %24, ptr noundef nonnull align 1 dereferenceable(21632) %0, i64 21632, i1 false)
  %25 = getelementptr inbounds i8, ptr %24, i64 21632
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %25, ptr noundef nonnull align 16 dereferenceable(32) %23, i64 32, i1 false)
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 21664, ptr noundef nonnull %24, i32 noundef 32, ptr noundef %1) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %24, i64 noundef 21664) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %5, i64 noundef 64) #6
  call void @Lib_Memzero0_memzero0(ptr noundef nonnull %4, i64 noundef 32) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 21504, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 3612672, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 21504, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 43136, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 21504, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 21504, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  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

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 = { 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