; LLVM IR from openssl/openssl :: crypto/ec (ec_asn1)

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

@.str.2 = external hidden unnamed_addr constant [69 x i8], align 1
@__func__.EC_GROUP_get_ecparameters = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @ECPARAMETERS_new() #0

; Function Attrs: nounwind uwtable
declare dso_local void @ECPARAMETERS_free(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @EC_GROUP_get_ecparameters(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %21

16:                                               ; preds = %2
  %17 = call ptr @ECPARAMETERS_new()
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 394, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null)
  br label %120

20:                                               ; preds = %16
  br label %23

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %22, ptr %7, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %21, %20
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ec_parameters_st, ptr %24, i32 0, i32 0
  store i32 1, ptr %25, align 8, !tbaa !11
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ec_parameters_st, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = call i32 @ec_asn1_group2fieldid(ptr noundef %26, ptr noundef %29)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %23
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 405, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null)
  br label %120

33:                                               ; preds = %23
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.ec_parameters_st, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = call i32 @ec_asn1_group2curve(ptr noundef %34, ptr noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %41, label %40

40:                                               ; preds = %33
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 411, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null)
  br label %120

41:                                               ; preds = %33
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call ptr @EC_GROUP_get0_generator(ptr noundef %42)
  store ptr %43, ptr %10, align 8, !tbaa !5
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 417, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 113, ptr noundef null)
  br label %120

46:                                               ; preds = %41
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = call i32 @EC_GROUP_get_point_conversion_form(ptr noundef %47)
  store i32 %48, ptr %11, align 4, !tbaa !16
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load i32, ptr %11, align 4, !tbaa !16
  %52 = call i64 @EC_POINT_point2buf(ptr noundef %49, ptr noundef %50, i32 noundef %51, ptr noundef %9, ptr noundef null)
  store i64 %52, ptr %6, align 8, !tbaa !9
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %46
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 425, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null)
  br label %120

56:                                               ; preds = %46
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ec_parameters_st, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  %60 = icmp eq ptr %59, null
  br i1 %60, label %61, label %68

61:                                               ; preds = %56
  %62 = call ptr @ASN1_OCTET_STRING_new()
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.ec_parameters_st, ptr %63, i32 0, i32 3
  store ptr %62, ptr %64, align 8, !tbaa !17
  %65 = icmp eq ptr %62, null
  br i1 %65, label %66, label %68

66:                                               ; preds = %61
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %67, ptr noundef @.str.2, i32 noundef 429)
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 430, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null)
  br label %120

68:                                               ; preds = %61, %56
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ec_parameters_st, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i64, ptr %6, align 8, !tbaa !9
  %74 = trunc i64 %73 to i32
  call void @ASN1_STRING_set0(ptr noundef %71, ptr noundef %72, i32 noundef %74)
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = call ptr @EC_GROUP_get0_order(ptr noundef %75)
  store ptr %76, ptr %8, align 8, !tbaa !5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %68
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 438, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null)
  br label %120

80:                                               ; preds = %68
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ec_parameters_st, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !18
  store ptr %84, ptr %12, align 8, !tbaa !5
  %85 = call ptr @BN_to_ASN1_INTEGER(ptr noundef %81, ptr noundef %84)
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ec_parameters_st, ptr %86, i32 0, i32 4
  store ptr %85, ptr %87, align 8, !tbaa !18
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ec_parameters_st, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !18
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %96

92:                                               ; preds = %80
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ec_parameters_st, ptr %94, i32 0, i32 4
  store ptr %93, ptr %95, align 8, !tbaa !18
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 444, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null)
  br label %120

96:                                               ; preds = %80
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = call ptr @EC_GROUP_get0_cofactor(ptr noundef %97)
  store ptr %98, ptr %8, align 8, !tbaa !5
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %118

101:                                              ; preds = %96
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ec_parameters_st, ptr %103, i32 0, i32 5
  %105 = load ptr, ptr %104, align 8, !tbaa !19
  store ptr %105, ptr %12, align 8, !tbaa !5
  %106 = call ptr @BN_to_ASN1_INTEGER(ptr noundef %102, ptr noundef %105)
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ec_parameters_st, ptr %107, i32 0, i32 5
  store ptr %106, ptr %108, align 8, !tbaa !19
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ec_parameters_st, ptr %109, i32 0, i32 5
  %111 = load ptr, ptr %110, align 8, !tbaa !19
  %112 = icmp eq ptr %111, null
  br i1 %112, label %113, label %117

113:                                              ; preds = %101
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ec_parameters_st, ptr %115, i32 0, i32 5
  store ptr %114, ptr %116, align 8, !tbaa !19
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.2, i32 noundef 454, ptr noundef @__func__.EC_GROUP_get_ecparameters)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null)
  br label %120

117:                                              ; preds = %101
  br label %118

118:                                              ; preds = %117, %96
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %119, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %126

120:                                              ; preds = %113, %92, %79, %66, %55, %45, %40, %32, %19
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = icmp eq ptr %121, null
  br i1 %122, label %123, label %125

123:                                              ; preds = %120
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  call void @ECPARAMETERS_free(ptr noundef %124)
  br label %125

125:                                              ; preds = %123, %120
  store ptr null, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %126

126:                                              ; preds = %125, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %127 = load ptr, ptr %3, align 8
  ret ptr %127
}

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

declare void @ERR_new() #2

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

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) #2

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

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

declare ptr @EC_GROUP_get0_generator(ptr noundef) #2

declare i32 @EC_GROUP_get_point_conversion_form(ptr noundef) #2

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

declare ptr @ASN1_OCTET_STRING_new() #2

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

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

declare ptr @EC_GROUP_get0_order(ptr noundef) #2

declare ptr @BN_to_ASN1_INTEGER(ptr noundef, ptr noundef) #2

declare ptr @EC_GROUP_get0_cofactor(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 }

!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 = !{!12, !13, i64 0}
!12 = !{!"ec_parameters_st", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 16}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !6, i64 24}
!18 = !{!12, !6, i64 32}
!19 = !{!12, !6, i64 40}


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

@.str.2 = external hidden unnamed_addr constant [69 x i8], align 1
@__func__.EC_GROUP_get_ecparameters = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @ECPARAMETERS_new() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @EC_GROUP_get_ecparameters(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store ptr null, ptr %3, align 8, !tbaa !5
  %4 = icmp eq ptr %1, null
  br i1 %4, label %5, label %8

5:                                                ; preds = %2
  %6 = tail call ptr @ECPARAMETERS_new()
  %7 = icmp eq ptr %6, null
  br i1 %7, label %.thread, label %8

.thread:                                          ; preds = %5
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 394, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null) #3
  br label %58

8:                                                ; preds = %2, %5
  %.036 = phi ptr [ %6, %5 ], [ %1, %2 ]
  store i32 1, ptr %.036, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %.036, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = tail call i32 @ec_asn1_group2fieldid(ptr noundef %0, ptr noundef %10)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %13

12:                                               ; preds = %8
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 405, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null) #3
  br label %57

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %.036, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = tail call i32 @ec_asn1_group2curve(ptr noundef %0, ptr noundef %15)
  %.not44 = icmp eq i32 %16, 0
  br i1 %.not44, label %17, label %18

17:                                               ; preds = %13
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 411, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null) #3
  br label %57

18:                                               ; preds = %13
  %19 = tail call ptr @EC_GROUP_get0_generator(ptr noundef %0) #3
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 417, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 113, ptr noundef null) #3
  br label %57

22:                                               ; preds = %18
  %23 = tail call i32 @EC_GROUP_get_point_conversion_form(ptr noundef %0) #3
  %24 = call i64 @EC_POINT_point2buf(ptr noundef %0, ptr noundef nonnull %19, i32 noundef %23, ptr noundef nonnull %3, ptr noundef null) #3
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 425, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null) #3
  br label %57

27:                                               ; preds = %22
  %28 = getelementptr inbounds i8, ptr %.036, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %36

31:                                               ; preds = %27
  %32 = call ptr @ASN1_OCTET_STRING_new() #3
  store ptr %32, ptr %28, align 8, !tbaa !14
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %35, ptr noundef nonnull @.str.2, i32 noundef 429) #3
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 430, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null) #3
  br label %57

36:                                               ; preds = %31, %27
  %37 = phi ptr [ %32, %31 ], [ %29, %27 ]
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = trunc i64 %24 to i32
  call void @ASN1_STRING_set0(ptr noundef nonnull %37, ptr noundef %38, i32 noundef %39) #3
  %40 = call ptr @EC_GROUP_get0_order(ptr noundef %0) #3
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %36
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 438, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524304, ptr noundef null) #3
  br label %57

43:                                               ; preds = %36
  %44 = getelementptr inbounds i8, ptr %.036, i64 32
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = call ptr @BN_to_ASN1_INTEGER(ptr noundef nonnull %40, ptr noundef %45) #3
  store ptr %46, ptr %44, align 8, !tbaa !15
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  store ptr %45, ptr %44, align 8, !tbaa !15
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 444, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null) #3
  br label %57

49:                                               ; preds = %43
  %50 = call ptr @EC_GROUP_get0_cofactor(ptr noundef %0) #3
  %.not45 = icmp eq ptr %50, null
  br i1 %.not45, label %59, label %51

51:                                               ; preds = %49
  %52 = getelementptr inbounds i8, ptr %.036, i64 40
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = call ptr @BN_to_ASN1_INTEGER(ptr noundef nonnull %50, ptr noundef %53) #3
  store ptr %54, ptr %52, align 8, !tbaa !16
  %55 = icmp eq ptr %54, null
  br i1 %55, label %56, label %59

56:                                               ; preds = %51
  store ptr %53, ptr %52, align 8, !tbaa !16
  call void @ERR_new() #3
  call void @ERR_set_debug(ptr noundef nonnull @.str.2, i32 noundef 454, ptr noundef nonnull @__func__.EC_GROUP_get_ecparameters) #3
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 16, i32 noundef 524301, ptr noundef null) #3
  br label %57

57:                                               ; preds = %56, %48, %42, %34, %26, %21, %17, %12
  br i1 %4, label %58, label %59

58:                                               ; preds = %.thread, %57
  %.147 = phi ptr [ null, %.thread ], [ %.036, %57 ]
  call void @ECPARAMETERS_free(ptr noundef %.147)
  br label %59

59:                                               ; preds = %57, %58, %49, %51
  %.0 = phi ptr [ %.036, %51 ], [ %.036, %49 ], [ null, %58 ], [ null, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret ptr %.0
}

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

declare void @ERR_new() local_unnamed_addr #2

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

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

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

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

declare ptr @EC_GROUP_get0_generator(ptr noundef) local_unnamed_addr #2

declare i32 @EC_GROUP_get_point_conversion_form(ptr noundef) local_unnamed_addr #2

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

declare ptr @ASN1_OCTET_STRING_new() local_unnamed_addr #2

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

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

declare ptr @EC_GROUP_get0_order(ptr noundef) local_unnamed_addr #2

declare ptr @BN_to_ASN1_INTEGER(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @EC_GROUP_get0_cofactor(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 = { 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, !11, i64 0}
!10 = !{!"ec_parameters_st", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 16}
!14 = !{!10, !6, i64 24}
!15 = !{!10, !6, i64 32}
!16 = !{!10, !6, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass