; LLVM IR from ARMmbed/mbed-crypto :: programs/random (gen_random_ctr_drbg)

; 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.mbedtls_ctr_drbg_context = type { [16 x i8], i32, i32, i64, i32, %struct.mbedtls_aes_context, ptr, ptr }
%struct.mbedtls_aes_context = type { i32, ptr, [68 x i32] }
%struct.mbedtls_entropy_context = type { i32, %struct.mbedtls_sha512_context, i32, [20 x %struct.mbedtls_entropy_source_state] }
%struct.mbedtls_sha512_context = type { [2 x i64], [8 x i64], [128 x i8], i32 }
%struct.mbedtls_entropy_source_state = type { ptr, ptr, i64, i64, i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [56 x i8], align 1
@stdout = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.mbedtls_ctr_drbg_context, align 8
  %12 = alloca %struct.mbedtls_entropy_context, align 8
  %13 = alloca [1024 x i8], align 16
  %14 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 344, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 1032, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #4
  call void @mbedtls_ctr_drbg_init(ptr noundef %11)
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 2
  br i1 %16, label %17, label %24

17:                                               ; preds = %2
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str, ptr noundef %21) #4
  %23 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %23, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %106

24:                                               ; preds = %2
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = call noalias ptr @fopen(ptr noundef %27, ptr noundef @.str.1)
  store ptr %28, ptr %6, align 8, !tbaa !9
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %36

30:                                               ; preds = %24
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = getelementptr inbounds ptr, ptr %31, i64 1
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %33)
  %35 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %35, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %106

36:                                               ; preds = %24
  call void @mbedtls_entropy_init(ptr noundef %12)
  %37 = call i32 @mbedtls_ctr_drbg_seed(ptr noundef %11, ptr noundef @mbedtls_entropy_func, ptr noundef %12, ptr noundef @.str.3, i64 noundef 10)
  store i32 %37, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %36
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %41)
  br label %101

43:                                               ; preds = %36
  call void @mbedtls_ctr_drbg_set_prediction_resistance(ptr noundef %11, i32 noundef 0)
  %44 = call i32 @mbedtls_ctr_drbg_update_seed_file(ptr noundef %11, ptr noundef @.str.5)
  store i32 %44, ptr %9, align 4, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = icmp eq i32 %45, -58
  br i1 %46, label %47, label %56

47:                                               ; preds = %43
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %49 = call i32 @mbedtls_ctr_drbg_write_seed_file(ptr noundef %11, ptr noundef @.str.5)
  store i32 %49, ptr %9, align 4, !tbaa !5
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %47
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %53)
  br label %101

55:                                               ; preds = %47
  br label %63

56:                                               ; preds = %43
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %56
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %60)
  br label %101

62:                                               ; preds = %56
  br label %63

63:                                               ; preds = %62, %55
  store i32 0, ptr %7, align 4, !tbaa !5
  store i32 768, ptr %8, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %97, %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %100

68:                                               ; preds = %64
  %69 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %70 = call i32 @mbedtls_ctr_drbg_random(ptr noundef %11, ptr noundef %69, i64 noundef 1024)
  store i32 %70, ptr %9, align 4, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %75

73:                                               ; preds = %68
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %101

75:                                               ; preds = %68
  %76 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  %78 = call i64 @fwrite(ptr noundef %76, i64 noundef 1, i64 noundef 1024, ptr noundef %77)
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = mul i64 1024, %80
  %82 = udiv i64 %81, 1024
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  %84 = getelementptr inbounds ptr, ptr %83, i64 1
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  %88 = sitofp i32 %87 to float
  %89 = fmul float 1.000000e+02, %88
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sitofp i32 %90 to float
  %92 = fdiv float %89, %91
  %93 = fpext float %92 to double
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %82, ptr noundef %85, double noundef %93)
  %95 = load ptr, ptr @stdout, align 8, !tbaa !9
  %96 = call i32 @fflush(ptr noundef %95)
  br label %97

97:                                               ; preds = %75
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %7, align 4, !tbaa !5
  br label %64, !llvm.loop !11

100:                                              ; preds = %64
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %100, %73, %59, %52, %40
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  %104 = call i32 @fclose(ptr noundef %103)
  call void @mbedtls_ctr_drbg_free(ptr noundef %11)
  call void @mbedtls_entropy_free(ptr noundef %12)
  %105 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %105, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %106

106:                                              ; preds = %101, %30, %17
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 1032, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 344, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %107 = load i32, ptr %3, align 4
  ret i32 %107
}

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

declare void @mbedtls_ctr_drbg_init(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare void @mbedtls_entropy_init(ptr noundef) #2

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

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

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

declare i32 @mbedtls_ctr_drbg_update_seed_file(ptr noundef, ptr noundef) #2

declare i32 @mbedtls_ctr_drbg_write_seed_file(ptr noundef, ptr noundef) #2

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

declare void @mbedtls_ctr_drbg_free(ptr noundef) #2

declare void @mbedtls_entropy_free(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

%struct.mbedtls_ctr_drbg_context = type { [16 x i8], i32, i32, i64, i32, %struct.mbedtls_aes_context, ptr, ptr }
%struct.mbedtls_aes_context = type { i32, ptr, [68 x i32] }
%struct.mbedtls_entropy_context = type { i32, %struct.mbedtls_sha512_context, i32, [20 x %struct.mbedtls_entropy_source_state] }
%struct.mbedtls_sha512_context = type { [2 x i64], [8 x i64], [128 x i8], i32 }
%struct.mbedtls_entropy_source_state = type { ptr, ptr, i64, i64, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [56 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.mbedtls_ctr_drbg_context, align 8
  %4 = alloca %struct.mbedtls_entropy_context, align 8
  %5 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 344, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 1032, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #4
  call void @mbedtls_ctr_drbg_init(ptr noundef nonnull %3) #4
  %6 = icmp slt i32 %0, 2
  br i1 %6, label %7, label %11

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str, ptr noundef %9) #5
  br label %49

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = call noalias ptr @fopen(ptr noundef %13, ptr noundef nonnull @.str.1)
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %19

16:                                               ; preds = %11
  %17 = load ptr, ptr %12, align 8, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %17)
  br label %49

19:                                               ; preds = %11
  call void @mbedtls_entropy_init(ptr noundef nonnull %4) #4
  %20 = call i32 @mbedtls_ctr_drbg_seed(ptr noundef nonnull %3, ptr noundef nonnull @mbedtls_entropy_func, ptr noundef nonnull %4, ptr noundef nonnull @.str.3, i64 noundef 10) #4
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %23, label %21

21:                                               ; preds = %19
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %20)
  br label %.loopexit

23:                                               ; preds = %19
  call void @mbedtls_ctr_drbg_set_prediction_resistance(ptr noundef nonnull %3, i32 noundef 0) #4
  %24 = call i32 @mbedtls_ctr_drbg_update_seed_file(ptr noundef nonnull %3, ptr noundef nonnull @.str.5) #4
  switch i32 %24, label %30 [
    i32 -58, label %25
    i32 0, label %.preheader
  ]

25:                                               ; preds = %23
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %27 = call i32 @mbedtls_ctr_drbg_write_seed_file(ptr noundef nonnull %3, ptr noundef nonnull @.str.5) #4
  %.not31 = icmp eq i32 %27, 0
  br i1 %.not31, label %.preheader, label %28

.preheader:                                       ; preds = %23, %25
  %.02533.ph = phi i32 [ 0, %25 ], [ %24, %23 ]
  br label %32

28:                                               ; preds = %25
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %27)
  br label %.loopexit

30:                                               ; preds = %23
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %24)
  br label %.loopexit

32:                                               ; preds = %.preheader, %36
  %.02533 = phi i32 [ %39, %36 ], [ %.02533.ph, %.preheader ]
  %33 = call i32 @mbedtls_ctr_drbg_random(ptr noundef nonnull %3, ptr noundef nonnull %5, i64 noundef 1024) #4
  %.not32 = icmp eq i32 %33, 0
  br i1 %.not32, label %36, label %34

34:                                               ; preds = %32
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %.loopexit

36:                                               ; preds = %32
  %37 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 1024, ptr noundef nonnull %14)
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = add nuw nsw i32 %.02533, 1
  %40 = uitofp nneg i32 %39 to float
  %41 = fmul float %40, 1.000000e+02
  %42 = fdiv float %41, 7.680000e+02
  %43 = fpext float %42 to double
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef 768, ptr noundef %38, double noundef %43)
  %45 = load ptr, ptr @stdout, align 8, !tbaa !5
  %46 = call i32 @fflush(ptr noundef %45)
  %exitcond.not = icmp eq i32 %39, 768
  br i1 %exitcond.not, label %.loopexit, label %32, !llvm.loop !9

.loopexit:                                        ; preds = %36, %34, %30, %28, %21
  %.0 = phi i32 [ 1, %21 ], [ 1, %28 ], [ 1, %34 ], [ 1, %30 ], [ 0, %36 ]
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  %48 = call i32 @fclose(ptr noundef nonnull %14)
  call void @mbedtls_ctr_drbg_free(ptr noundef nonnull %3) #4
  call void @mbedtls_entropy_free(ptr noundef nonnull %4) #4
  br label %49

49:                                               ; preds = %.loopexit, %16, %7
  %.024 = phi i32 [ 1, %7 ], [ 1, %16 ], [ %.0, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 1032, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 344, ptr nonnull %3) #4
  ret i32 %.024
}

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

declare void @mbedtls_ctr_drbg_init(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare void @mbedtls_entropy_init(ptr noundef) local_unnamed_addr #2

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

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

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

declare i32 @mbedtls_ctr_drbg_update_seed_file(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @mbedtls_ctr_drbg_write_seed_file(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

declare void @mbedtls_ctr_drbg_free(ptr noundef) local_unnamed_addr #2

declare void @mbedtls_entropy_free(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 #4 = { nounwind }
attributes #5 = { cold 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass