; LLVM IR from openanolis/openssl :: demos/pkey (EVP_PKEY_DSA_paramvalidate)

; 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.ossl_param_st = type { ptr, i32, ptr, i64, i64 }

@gindex = external dso_local constant i32, align 4
@pcounter = external dso_local constant i32, align 4
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@hexseed = external hidden constant [97 x i8], align 16
@dsapem = external hidden constant [821 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@digest = external hidden constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @create_merged_key(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

declare ptr @EVP_PKEY_CTX_new_from_pkey(ptr noundef, ptr noundef, ptr noundef) #3

declare void @EVP_PKEY_free(ptr noundef) #3

declare void @EVP_PKEY_CTX_free(ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca [6 x %struct.ossl_param_st], align 16
  %15 = alloca [64 x i8], align 16
  %16 = alloca i64, align 8
  %17 = alloca %struct.ossl_param_st, align 8
  %18 = alloca %struct.ossl_param_st, align 8
  %19 = alloca %struct.ossl_param_st, align 8
  %20 = alloca %struct.ossl_param_st, align 8
  %21 = alloca %struct.ossl_param_st, align 8
  %22 = alloca %struct.ossl_param_st, align 8
  %23 = alloca %struct.ossl_param_st, align 8
  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 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 240, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %24 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %25 = call i32 @OPENSSL_hexstr2buf_ex(ptr noundef %24, i64 noundef 64, ptr noundef %16, ptr noundef @hexseed, i8 noundef signext 0)
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %2
  br label %112

28:                                               ; preds = %2
  %29 = call ptr @BIO_new_mem_buf(ptr noundef @dsapem, i32 noundef 820)
  store ptr %29, ptr %13, align 8, !tbaa !9
  %30 = load ptr, ptr %13, align 8, !tbaa !9
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.6) #5
  br label %112

35:                                               ; preds = %28
  %36 = load ptr, ptr %13, align 8, !tbaa !9
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = load ptr, ptr %8, align 8, !tbaa !9
  %39 = call ptr @PEM_read_bio_Parameters_ex(ptr noundef %36, ptr noundef null, ptr noundef %37, ptr noundef %38)
  store ptr %39, ptr %9, align 8, !tbaa !9
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %35
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.7) #5
  br label %112

45:                                               ; preds = %35
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr %9, align 8, !tbaa !9
  %48 = load ptr, ptr %8, align 8, !tbaa !9
  %49 = call ptr @EVP_PKEY_CTX_new_from_pkey(ptr noundef %46, ptr noundef %47, ptr noundef %48)
  store ptr %49, ptr %10, align 8, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !9
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %55

52:                                               ; preds = %45
  %53 = load ptr, ptr @stderr, align 8, !tbaa !9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.5) #5
  br label %112

55:                                               ; preds = %45
  %56 = load ptr, ptr %10, align 8, !tbaa !9
  %57 = call i32 @EVP_PKEY_param_check(ptr noundef %56)
  %58 = icmp sle i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %55
  %60 = load ptr, ptr @stderr, align 8, !tbaa !9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.8) #5
  br label %112

62:                                               ; preds = %55
  %63 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %17, ptr noundef @.str.9, ptr noundef @.str.10, i64 noundef 0)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 8 %17, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #5
  %64 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  %65 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %66 = load i64, ptr %16, align 8, !tbaa !12
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %18, ptr noundef @.str.11, ptr noundef %65, i64 noundef %66)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %64, ptr align 8 %18, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  %67 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 2
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #5
  call void @OSSL_PARAM_construct_int(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %19, ptr noundef @.str.12, ptr noundef @gindex)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %67, ptr align 8 %19, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #5
  %68 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 3
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #5
  call void @OSSL_PARAM_construct_int(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %20, ptr noundef @.str.13, ptr noundef @pcounter)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %68, ptr align 8 %20, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #5
  %69 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 4
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %21)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %69, ptr align 8 %21, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #5
  %70 = load ptr, ptr %9, align 8, !tbaa !9
  %71 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 0
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = load ptr, ptr %8, align 8, !tbaa !9
  %74 = call ptr @create_merged_key(ptr noundef %70, ptr noundef %71, ptr noundef %72, ptr noundef %73)
  store ptr %74, ptr %11, align 8, !tbaa !9
  %75 = load ptr, ptr %11, align 8, !tbaa !9
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %78

77:                                               ; preds = %62
  br label %112

78:                                               ; preds = %62
  %79 = load ptr, ptr %11, align 8, !tbaa !9
  %80 = call i32 @EVP_PKEY_param_check(ptr noundef %79)
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %85

82:                                               ; preds = %78
  %83 = load ptr, ptr @stderr, align 8, !tbaa !9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.14) #5
  br label %112

85:                                               ; preds = %78
  %86 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 4
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %22, ptr noundef @.str.15, ptr noundef @digest, i64 noundef 0)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %86, ptr align 8 %22, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #5
  %87 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 5
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %23)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %87, ptr align 8 %23, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #5
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %14, i64 0, i64 0
  %90 = load ptr, ptr %7, align 8, !tbaa !9
  %91 = load ptr, ptr %8, align 8, !tbaa !9
  %92 = call ptr @create_merged_key(ptr noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91)
  store ptr %92, ptr %12, align 8, !tbaa !9
  %93 = load ptr, ptr %12, align 8, !tbaa !9
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %96

95:                                               ; preds = %85
  br label %112

96:                                               ; preds = %85
  %97 = load ptr, ptr %12, align 8, !tbaa !9
  %98 = call i32 @EVP_PKEY_param_check(ptr noundef %97)
  %99 = icmp sle i32 %98, 0
  br i1 %99, label %100, label %103

100:                                              ; preds = %96
  %101 = load ptr, ptr @stderr, align 8, !tbaa !9
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.16) #5
  br label %112

103:                                              ; preds = %96
  %104 = load ptr, ptr %12, align 8, !tbaa !9
  %105 = call ptr @EVP_PKEY_CTX_get0_pkey(ptr noundef %104)
  %106 = load ptr, ptr %7, align 8, !tbaa !9
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = call i32 @dsa_print_key(ptr noundef %105, i32 noundef 0, ptr noundef %106, ptr noundef %107)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %111, label %110

110:                                              ; preds = %103
  br label %112

111:                                              ; preds = %103
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %111, %110, %100, %95, %82, %77, %59, %52, %42, %32, %27
  %113 = load ptr, ptr %9, align 8, !tbaa !9
  call void @EVP_PKEY_free(ptr noundef %113)
  %114 = load ptr, ptr %12, align 8, !tbaa !9
  call void @EVP_PKEY_CTX_free(ptr noundef %114)
  %115 = load ptr, ptr %11, align 8, !tbaa !9
  call void @EVP_PKEY_CTX_free(ptr noundef %115)
  %116 = load ptr, ptr %10, align 8, !tbaa !9
  call void @EVP_PKEY_CTX_free(ptr noundef %116)
  %117 = load ptr, ptr %13, align 8, !tbaa !9
  %118 = call i32 @BIO_free(ptr noundef %117)
  %119 = load i32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  ret i32 %119
}

declare i32 @OPENSSL_hexstr2buf_ex(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i8 noundef signext) #3

declare ptr @BIO_new_mem_buf(ptr noundef, i32 noundef) #3

declare ptr @PEM_read_bio_Parameters_ex(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @EVP_PKEY_param_check(ptr noundef) #3

declare void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) #3

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

declare void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) #3

declare void @OSSL_PARAM_construct_int(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef) #3

declare void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @dsa_print_key(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare ptr @EVP_PKEY_CTX_get0_pkey(ptr noundef) #3

declare i32 @BIO_free(ptr noundef) #3

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 = { 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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{i64 0, i64 8, !9, i64 8, i64 4, !5, i64 16, i64 8, !9, i64 24, i64 8, !12, i64 32, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !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"

%struct.ossl_param_st = type { ptr, i32, ptr, i64, i64 }

@gindex = external dso_local constant i32, align 4
@pcounter = external dso_local constant i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [37 x i8], align 1
@hexseed = external hidden constant [97 x i8], align 16
@dsapem = external hidden constant [821 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [7 x i8], align 1
@digest = external hidden constant [7 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @create_merged_key(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

declare ptr @EVP_PKEY_CTX_new_from_pkey(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @EVP_PKEY_free(ptr noundef) local_unnamed_addr #3

declare void @EVP_PKEY_CTX_free(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [6 x %struct.ossl_param_st], align 16
  %4 = alloca [64 x i8], align 16
  %5 = alloca i64, align 8
  %6 = alloca %struct.ossl_param_st, align 8
  %7 = alloca %struct.ossl_param_st, align 8
  %8 = alloca %struct.ossl_param_st, align 8
  %9 = alloca %struct.ossl_param_st, align 8
  %10 = alloca %struct.ossl_param_st, align 8
  %11 = alloca %struct.ossl_param_st, align 8
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %12 = call i32 @OPENSSL_hexstr2buf_ex(ptr noundef nonnull %4, i64 noundef 64, ptr noundef nonnull %5, ptr noundef nonnull @hexseed, i8 noundef signext 0) #5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %64, label %13

13:                                               ; preds = %2
  %14 = call ptr @BIO_new_mem_buf(ptr noundef nonnull @dsapem, i32 noundef 820) #5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %19

16:                                               ; preds = %13
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.6) #6
  br label %64

19:                                               ; preds = %13
  %20 = call ptr @PEM_read_bio_Parameters_ex(ptr noundef nonnull %14, ptr noundef null, ptr noundef null, ptr noundef null) #5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.7) #6
  br label %64

25:                                               ; preds = %19
  %26 = call ptr @EVP_PKEY_CTX_new_from_pkey(ptr noundef null, ptr noundef nonnull %20, ptr noundef null) #5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.5) #6
  br label %64

31:                                               ; preds = %25
  %32 = call i32 @EVP_PKEY_param_check(ptr noundef nonnull %26) #5
  %33 = icmp slt i32 %32, 1
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.8) #6
  br label %64

37:                                               ; preds = %31
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %3, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, i64 noundef 0) #5
  %38 = getelementptr inbounds i8, ptr %3, i64 40
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  %39 = load i64, ptr %5, align 8, !tbaa !9
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %6, ptr noundef nonnull @.str.11, ptr noundef nonnull %4, i64 noundef %39) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %38, ptr noundef nonnull align 8 dereferenceable(40) %6, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  %40 = getelementptr inbounds i8, ptr %3, i64 80
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #5
  call void @OSSL_PARAM_construct_int(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %7, ptr noundef nonnull @.str.12, ptr noundef nonnull @gindex) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %40, ptr noundef nonnull align 8 dereferenceable(40) %7, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #5
  %41 = getelementptr inbounds i8, ptr %3, i64 120
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #5
  call void @OSSL_PARAM_construct_int(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %8, ptr noundef nonnull @.str.13, ptr noundef nonnull @pcounter) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %41, ptr noundef nonnull align 8 dereferenceable(40) %8, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  %42 = getelementptr inbounds i8, ptr %3, i64 160
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %42, ptr noundef nonnull align 8 dereferenceable(40) %9, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  %43 = call ptr @create_merged_key(ptr noundef nonnull %20, ptr noundef nonnull %3, ptr noundef null, ptr noundef null)
  %44 = icmp eq ptr %43, null
  br i1 %44, label %64, label %45

45:                                               ; preds = %37
  %46 = call i32 @EVP_PKEY_param_check(ptr noundef nonnull %43) #5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %45
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.14) #6
  br label %64

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %10, ptr noundef nonnull @.str.15, ptr noundef nonnull @digest, i64 noundef 0) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %42, ptr noundef nonnull align 8 dereferenceable(40) %10, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #5
  %52 = getelementptr inbounds i8, ptr %3, i64 200
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %52, ptr noundef nonnull align 8 dereferenceable(40) %11, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  %53 = call ptr @create_merged_key(ptr noundef nonnull %20, ptr noundef nonnull %3, ptr noundef null, ptr noundef null)
  %54 = icmp eq ptr %53, null
  br i1 %54, label %64, label %55

55:                                               ; preds = %51
  %56 = call i32 @EVP_PKEY_param_check(ptr noundef nonnull %53) #5
  %57 = icmp slt i32 %56, 1
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load ptr, ptr @stderr, align 8, !tbaa !5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str.16) #6
  br label %64

61:                                               ; preds = %55
  %62 = call ptr @EVP_PKEY_CTX_get0_pkey(ptr noundef nonnull %53) #5
  %63 = call i32 @dsa_print_key(ptr noundef %62, i32 noundef 0, ptr noundef null, ptr noundef null)
  %.not42 = icmp eq i32 %63, 0
  %spec.select = zext i1 %.not42 to i32
  br label %64

64:                                               ; preds = %61, %51, %37, %2, %58, %48, %34, %28, %22, %16
  %.032 = phi i32 [ 1, %16 ], [ 1, %22 ], [ 1, %28 ], [ 1, %34 ], [ 1, %37 ], [ 1, %48 ], [ 1, %51 ], [ 1, %58 ], [ 1, %2 ], [ %spec.select, %61 ]
  %.031 = phi ptr [ null, %16 ], [ null, %22 ], [ %20, %28 ], [ %20, %34 ], [ %20, %37 ], [ %20, %48 ], [ %20, %51 ], [ %20, %58 ], [ null, %2 ], [ %20, %61 ]
  %.030 = phi ptr [ null, %16 ], [ null, %22 ], [ null, %28 ], [ %26, %34 ], [ %26, %37 ], [ %26, %48 ], [ %26, %51 ], [ %26, %58 ], [ null, %2 ], [ %26, %61 ]
  %.029 = phi ptr [ null, %16 ], [ null, %22 ], [ null, %28 ], [ null, %34 ], [ null, %37 ], [ %43, %48 ], [ %43, %51 ], [ %43, %58 ], [ null, %2 ], [ %43, %61 ]
  %.028 = phi ptr [ null, %16 ], [ null, %22 ], [ null, %28 ], [ null, %34 ], [ null, %37 ], [ null, %48 ], [ null, %51 ], [ %53, %58 ], [ null, %2 ], [ %53, %61 ]
  %.0 = phi ptr [ null, %16 ], [ %14, %22 ], [ %14, %28 ], [ %14, %34 ], [ %14, %37 ], [ %14, %48 ], [ %14, %51 ], [ %14, %58 ], [ null, %2 ], [ %14, %61 ]
  call void @EVP_PKEY_free(ptr noundef %.031) #5
  call void @EVP_PKEY_CTX_free(ptr noundef %.028) #5
  call void @EVP_PKEY_CTX_free(ptr noundef %.029) #5
  call void @EVP_PKEY_CTX_free(ptr noundef %.030) #5
  %65 = call i32 @BIO_free(ptr noundef %.0) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %3) #5
  ret i32 %.032
}

declare i32 @OPENSSL_hexstr2buf_ex(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i8 noundef signext) local_unnamed_addr #3

declare ptr @BIO_new_mem_buf(ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @PEM_read_bio_Parameters_ex(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @EVP_PKEY_param_check(ptr noundef) local_unnamed_addr #3

declare void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

declare void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @OSSL_PARAM_construct_int(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @dsa_print_key(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @EVP_PKEY_CTX_get0_pkey(ptr noundef) local_unnamed_addr #3

declare i32 @BIO_free(ptr noundef) local_unnamed_addr #3

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 = { 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 #3 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{i64 0, i64 8, !5, i64 8, i64 4, !12, i64 16, i64 8, !5, i64 24, i64 8, !9, i64 32, i64 8, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass