; LLVM IR from cryspen/libcrux :: sys/hacl/c/src (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 [81 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
  %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 32, ptr %7) #8
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 32, i1 false)
  %29 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @randombytes_(i32 noundef 32, ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #8
  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) #8
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 64, i1 false)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 21520, ptr noundef %30, i32 noundef 32, ptr noundef %31)
  %32 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  %34 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %33, ptr align 16 %34, i64 32, i1 false)
  %35 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %36 = getelementptr inbounds [64 x i8], ptr %8, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 64, ptr noundef %35, i32 noundef 64, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %37 = getelementptr inbounds [64 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 [64 x i8], ptr %8, i64 0, i64 0
  %39 = getelementptr inbounds i8, ptr %38, i64 32
  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 21504, ptr %14) #8
  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) #8
  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) #8
  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) #8
  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) #8
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 33, i1 false)
  %43 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  store i8 -106, ptr %43, align 16, !tbaa !9
  %44 = getelementptr inbounds [33 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 32, i1 false)
  %47 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  %48 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  call void @Hacl_Hash_SHA3_shake256_hacl(i32 noundef 33, ptr noundef %47, i32 noundef 43136, ptr noundef %48)
  %49 = getelementptr inbounds [33 x i8], ptr %18, i64 0, i64 0
  call void @Lib_Memzero0_memzero0(ptr noundef %49, i64 noundef 33)
  %50 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %51 = 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 %50, ptr noundef %51)
  %52 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %53 = getelementptr inbounds i8, ptr %52, i64 21504
  %54 = 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 %53, ptr noundef %54)
  %55 = getelementptr inbounds [43136 x i8], ptr %17, i64 0, i64 0
  %56 = getelementptr inbounds i8, ptr %55, i64 43008
  %57 = 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 %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 21504
  store ptr %60, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 21504, ptr %21) #8
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 21504, i1 false)
  br label %61

61:                                               ; preds = %3
  br label %62

62:                                               ; preds = %61
  br label %63

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

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

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

97:                                               ; preds = %91
  br label %98

98:                                               ; preds = %97
  br label %99

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