; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (dstu4145-params)

; 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.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%struct.DSTU4145Params = type { %struct.DSTUEllipticCurve, ptr, %struct.asn_struct_ctx_s }
%struct.DSTUEllipticCurve = type { i32, %union.DSTUEllipticCurve_u, %struct.asn_struct_ctx_s }
%union.DSTUEllipticCurve_u = type { %struct.ECBinary }
%struct.ECBinary = type { ptr, %struct.BinaryField, i64, %struct.OCTET_STRING, %struct.ASN__PRIMITIVE_TYPE_s, %struct.OCTET_STRING, %struct.asn_struct_ctx_s }
%struct.BinaryField = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.member = type { i32, %union.BinaryField__member_u, %struct.asn_struct_ctx_s }
%union.BinaryField__member_u = type { %struct.Pentanomial }
%struct.Pentanomial = type { %struct.ASN__PRIMITIVE_TYPE_s, %struct.ASN__PRIMITIVE_TYPE_s, %struct.ASN__PRIMITIVE_TYPE_s, %struct.asn_struct_ctx_s }

@.str = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @dstu4145_params_get_std_oid(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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #2

; Function Attrs: nounwind
declare void @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 @dstu4145_params_get_ec(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca [5 x i32], align 16
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = 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 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 20, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store ptr null, ptr %20, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %2
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %28, label %26

26:                                               ; preds = %23
  store i32 2, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 490, i32 noundef %27, ptr noundef null)
  br label %396

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %36, label %34

34:                                               ; preds = %31
  store i32 2, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 491, i32 noundef %35, ptr noundef null)
  br label %396

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %48

43:                                               ; preds = %38
  br label %44

44:                                               ; preds = %43
  store i32 15, ptr %6, align 4, !tbaa !9
  %45 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 494, i32 noundef %45, ptr noundef null)
  br label %396

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47, %38
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = call ptr @get_DSTU4145Params_desc()
  %54 = call ptr @asn_any2type(ptr noundef %52, ptr noundef %53)
  store ptr %54, ptr %18, align 8, !tbaa !5
  %55 = icmp eq ptr null, %54
  br i1 %55, label %56, label %58

56:                                               ; preds = %49
  store i32 2, ptr %6, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 497, i32 noundef %57)
  br label %396

58:                                               ; preds = %49
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.DSTU4145Params, ptr %61, i32 0, i32 0
  store ptr %62, ptr %19, align 8, !tbaa !5
  %63 = load ptr, ptr %19, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !18
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %72

67:                                               ; preds = %60
  br label %68

68:                                               ; preds = %67
  store i32 15, ptr %6, align 4, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 501, i32 noundef %69, ptr noundef null)
  br label %396

70:                                               ; No predecessors!
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71, %60
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %19, align 8, !tbaa !5
  %75 = call i32 @dstu4145_params_get_std_oid(ptr noundef %74, ptr noundef %7)
  store i32 %75, ptr %6, align 4, !tbaa !9
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %73
  %79 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 504, i32 noundef %79)
  br label %396

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %108

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = call i32 @ecid_from_oid(ptr noundef %86)
  store i32 %87, ptr %21, align 4, !tbaa !9
  %88 = load i32, ptr %21, align 4, !tbaa !9
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %95

90:                                               ; preds = %85
  br label %91

91:                                               ; preds = %90
  store i32 10, ptr %6, align 4, !tbaa !9
  %92 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 509, i32 noundef %92, ptr noundef null)
  store i32 4, ptr %22, align 4
  br label %105

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94, %85
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %21, align 4, !tbaa !9
  %98 = call ptr @ec_alloc_default(i32 noundef %97)
  store ptr %98, ptr %20, align 8, !tbaa !5
  %99 = icmp eq ptr null, %98
  br i1 %99, label %100, label %102

100:                                              ; preds = %96
  store i32 2, ptr %6, align 4, !tbaa !9
  %101 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 511, i32 noundef %101)
  store i32 4, ptr %22, align 4
  br label %105

102:                                              ; preds = %96
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  store i32 0, ptr %22, align 4
  br label %105

105:                                              ; preds = %104, %100, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %106 = load i32, ptr %22, align 4
  switch i32 %106, label %405 [
    i32 0, label %107
    i32 4, label %396
  ]

107:                                              ; preds = %105
  br label %393

108:                                              ; preds = %82
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %109, i32 0, i32 1
  %111 = getelementptr inbounds %struct.ECBinary, ptr %110, i32 0, i32 1
  %112 = getelementptr inbounds %struct.BinaryField, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !20
  %114 = getelementptr inbounds %struct.member, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !21
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %122

117:                                              ; preds = %108
  br label %118

118:                                              ; preds = %117
  store i32 15, ptr %6, align 4, !tbaa !9
  %119 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 515, i32 noundef %119, ptr noundef null)
  br label %396

120:                                              ; No predecessors!
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121, %108
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %123, i32 0, i32 1
  %125 = getelementptr inbounds %struct.ECBinary, ptr %124, i32 0, i32 2
  %126 = load i64, ptr %125, align 8, !tbaa !20
  store i64 %126, ptr %12, align 8, !tbaa !11
  br label %127

127:                                              ; preds = %122
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %128, i32 0, i32 1
  %130 = getelementptr inbounds %struct.ECBinary, ptr %129, i32 0, i32 3
  %131 = call i32 @asn_OCTSTRING2ba(ptr noundef %130, ptr noundef %13)
  store i32 %131, ptr %6, align 4, !tbaa !9
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %127
  %135 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 519, i32 noundef %135)
  br label %396

136:                                              ; preds = %127
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %140, i32 0, i32 1
  %142 = getelementptr inbounds %struct.ECBinary, ptr %141, i32 0, i32 4
  %143 = call i32 @asn_INTEGER2ba(ptr noundef %142, ptr noundef %14)
  store i32 %143, ptr %6, align 4, !tbaa !9
  %144 = load i32, ptr %6, align 4, !tbaa !9
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %148

146:                                              ; preds = %139
  %147 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 520, i32 noundef %147)
  br label %396

148:                                              ; preds = %139
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = call i32 @ba_swap(ptr noundef %152)
  store i32 %153, ptr %6, align 4, !tbaa !9
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %158

156:                                              ; preds = %151
  %157 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 521, i32 noundef %157)
  br label %396

158:                                              ; preds = %151
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %19, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %162, i32 0, i32 1
  %164 = getelementptr inbounds %struct.ECBinary, ptr %163, i32 0, i32 5
  %165 = call i32 @asn_OCTSTRING2ba(ptr noundef %164, ptr noundef %15)
  store i32 %165, ptr %6, align 4, !tbaa !9
  %166 = load i32, ptr %6, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %161
  %169 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 523, i32 noundef %169)
  br label %396

170:                                              ; preds = %161
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %19, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %174, i32 0, i32 1
  %176 = getelementptr inbounds %struct.ECBinary, ptr %175, i32 0, i32 1
  %177 = getelementptr inbounds %struct.BinaryField, ptr %176, i32 0, i32 0
  %178 = call i32 @asn_INTEGER2long(ptr noundef %177, ptr noundef %11)
  store i32 %178, ptr %6, align 4, !tbaa !9
  %179 = load i32, ptr %6, align 4, !tbaa !9
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %183

181:                                              ; preds = %173
  %182 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 525, i32 noundef %182)
  br label %396

183:                                              ; preds = %173
  br label %184

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  %186 = load ptr, ptr %19, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %186, i32 0, i32 1
  %188 = getelementptr inbounds %struct.ECBinary, ptr %187, i32 0, i32 1
  %189 = getelementptr inbounds %struct.BinaryField, ptr %188, i32 0, i32 1
  %190 = load ptr, ptr %189, align 8, !tbaa !20
  %191 = getelementptr inbounds %struct.member, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !21
  %193 = icmp eq i32 %192, 1
  br i1 %193, label %194, label %229

194:                                              ; preds = %185
  store i32 3, ptr %9, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %19, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %196, i32 0, i32 1
  %198 = getelementptr inbounds %struct.ECBinary, ptr %197, i32 0, i32 1
  %199 = getelementptr inbounds %struct.BinaryField, ptr %198, i32 0, i32 0
  %200 = call i32 @asn_INTEGER2long(ptr noundef %199, ptr noundef %8)
  store i32 %200, ptr %6, align 4, !tbaa !9
  %201 = load i32, ptr %6, align 4, !tbaa !9
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %205

203:                                              ; preds = %195
  %204 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 529, i32 noundef %204)
  br label %396

205:                                              ; preds = %195
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  %208 = load i64, ptr %8, align 8, !tbaa !11
  %209 = trunc i64 %208 to i32
  %210 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 0
  store i32 %209, ptr %210, align 16, !tbaa !9
  br label %211

211:                                              ; preds = %207
  %212 = load ptr, ptr %19, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %212, i32 0, i32 1
  %214 = getelementptr inbounds %struct.ECBinary, ptr %213, i32 0, i32 1
  %215 = getelementptr inbounds %struct.BinaryField, ptr %214, i32 0, i32 1
  %216 = load ptr, ptr %215, align 8, !tbaa !20
  %217 = getelementptr inbounds %struct.member, ptr %216, i32 0, i32 1
  %218 = call i32 @asn_INTEGER2long(ptr noundef %217, ptr noundef %8)
  store i32 %218, ptr %6, align 4, !tbaa !9
  %219 = load i32, ptr %6, align 4, !tbaa !9
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %223

221:                                              ; preds = %211
  %222 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 531, i32 noundef %222)
  br label %396

223:                                              ; preds = %211
  br label %224

224:                                              ; preds = %223
  br label %225

225:                                              ; preds = %224
  %226 = load i64, ptr %8, align 8, !tbaa !11
  %227 = trunc i64 %226 to i32
  %228 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 1
  store i32 %227, ptr %228, align 4, !tbaa !9
  br label %318

229:                                              ; preds = %185
  %230 = load ptr, ptr %19, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %230, i32 0, i32 1
  %232 = getelementptr inbounds %struct.ECBinary, ptr %231, i32 0, i32 1
  %233 = getelementptr inbounds %struct.BinaryField, ptr %232, i32 0, i32 1
  %234 = load ptr, ptr %233, align 8, !tbaa !20
  %235 = getelementptr inbounds %struct.member, ptr %234, i32 0, i32 0
  %236 = load i32, ptr %235, align 8, !tbaa !21
  %237 = icmp eq i32 %236, 2
  br i1 %237, label %238, label %312

238:                                              ; preds = %229
  store i32 5, ptr %9, align 4, !tbaa !9
  br label %239

239:                                              ; preds = %238
  %240 = load ptr, ptr %19, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %240, i32 0, i32 1
  %242 = getelementptr inbounds %struct.ECBinary, ptr %241, i32 0, i32 1
  %243 = getelementptr inbounds %struct.BinaryField, ptr %242, i32 0, i32 0
  %244 = call i32 @asn_INTEGER2long(ptr noundef %243, ptr noundef %8)
  store i32 %244, ptr %6, align 4, !tbaa !9
  %245 = load i32, ptr %6, align 4, !tbaa !9
  %246 = icmp ne i32 %245, 0
  br i1 %246, label %247, label %249

247:                                              ; preds = %239
  %248 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 536, i32 noundef %248)
  br label %396

249:                                              ; preds = %239
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  %252 = load i64, ptr %8, align 8, !tbaa !11
  %253 = trunc i64 %252 to i32
  %254 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 0
  store i32 %253, ptr %254, align 16, !tbaa !9
  br label %255

255:                                              ; preds = %251
  %256 = load ptr, ptr %19, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %256, i32 0, i32 1
  %258 = getelementptr inbounds %struct.ECBinary, ptr %257, i32 0, i32 1
  %259 = getelementptr inbounds %struct.BinaryField, ptr %258, i32 0, i32 1
  %260 = load ptr, ptr %259, align 8, !tbaa !20
  %261 = getelementptr inbounds %struct.member, ptr %260, i32 0, i32 1
  %262 = getelementptr inbounds %struct.Pentanomial, ptr %261, i32 0, i32 2
  %263 = call i32 @asn_INTEGER2long(ptr noundef %262, ptr noundef %8)
  store i32 %263, ptr %6, align 4, !tbaa !9
  %264 = load i32, ptr %6, align 4, !tbaa !9
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %266, label %268

266:                                              ; preds = %255
  %267 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 538, i32 noundef %267)
  br label %396

268:                                              ; preds = %255
  br label %269

269:                                              ; preds = %268
  br label %270

270:                                              ; preds = %269
  %271 = load i64, ptr %8, align 8, !tbaa !11
  %272 = trunc i64 %271 to i32
  %273 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 1
  store i32 %272, ptr %273, align 4, !tbaa !9
  br label %274

274:                                              ; preds = %270
  %275 = load ptr, ptr %19, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %275, i32 0, i32 1
  %277 = getelementptr inbounds %struct.ECBinary, ptr %276, i32 0, i32 1
  %278 = getelementptr inbounds %struct.BinaryField, ptr %277, i32 0, i32 1
  %279 = load ptr, ptr %278, align 8, !tbaa !20
  %280 = getelementptr inbounds %struct.member, ptr %279, i32 0, i32 1
  %281 = getelementptr inbounds %struct.Pentanomial, ptr %280, i32 0, i32 1
  %282 = call i32 @asn_INTEGER2long(ptr noundef %281, ptr noundef %8)
  store i32 %282, ptr %6, align 4, !tbaa !9
  %283 = load i32, ptr %6, align 4, !tbaa !9
  %284 = icmp ne i32 %283, 0
  br i1 %284, label %285, label %287

285:                                              ; preds = %274
  %286 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 540, i32 noundef %286)
  br label %396

287:                                              ; preds = %274
  br label %288

288:                                              ; preds = %287
  br label %289

289:                                              ; preds = %288
  %290 = load i64, ptr %8, align 8, !tbaa !11
  %291 = trunc i64 %290 to i32
  %292 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 2
  store i32 %291, ptr %292, align 8, !tbaa !9
  br label %293

293:                                              ; preds = %289
  %294 = load ptr, ptr %19, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.DSTUEllipticCurve, ptr %294, i32 0, i32 1
  %296 = getelementptr inbounds %struct.ECBinary, ptr %295, i32 0, i32 1
  %297 = getelementptr inbounds %struct.BinaryField, ptr %296, i32 0, i32 1
  %298 = load ptr, ptr %297, align 8, !tbaa !20
  %299 = getelementptr inbounds %struct.member, ptr %298, i32 0, i32 1
  %300 = getelementptr inbounds %struct.Pentanomial, ptr %299, i32 0, i32 0
  %301 = call i32 @asn_INTEGER2long(ptr noundef %300, ptr noundef %8)
  store i32 %301, ptr %6, align 4, !tbaa !9
  %302 = load i32, ptr %6, align 4, !tbaa !9
  %303 = icmp ne i32 %302, 0
  br i1 %303, label %304, label %306

304:                                              ; preds = %293
  %305 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 542, i32 noundef %305)
  br label %396

306:                                              ; preds = %293
  br label %307

307:                                              ; preds = %306
  br label %308

308:                                              ; preds = %307
  %309 = load i64, ptr %8, align 8, !tbaa !11
  %310 = trunc i64 %309 to i32
  %311 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 3
  store i32 %310, ptr %311, align 4, !tbaa !9
  br label %317

312:                                              ; preds = %229
  br label %313

313:                                              ; preds = %312
  store i32 10, ptr %6, align 4, !tbaa !9
  %314 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 546, i32 noundef %314, ptr noundef null)
  br label %396

315:                                              ; No predecessors!
  br label %316

316:                                              ; preds = %315
  br label %317

317:                                              ; preds = %316, %308
  br label %318

318:                                              ; preds = %317, %225
  br label %319

319:                                              ; preds = %318
  %320 = load ptr, ptr %4, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %320, i32 0, i32 0
  %322 = call i32 @dstu_params_type(ptr noundef %321, ptr noundef %16, ptr noundef %17)
  store i32 %322, ptr %6, align 4, !tbaa !9
  %323 = load i32, ptr %6, align 4, !tbaa !9
  %324 = icmp ne i32 %323, 0
  br i1 %324, label %325, label %327

325:                                              ; preds = %319
  %326 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 549, i32 noundef %326)
  br label %396

327:                                              ; preds = %319
  br label %328

328:                                              ; preds = %327
  br label %329

329:                                              ; preds = %328
  %330 = load i8, ptr %16, align 1, !tbaa !23, !range !25, !noundef !26
  %331 = trunc i8 %330 to i1
  br i1 %331, label %353, label %332

332:                                              ; preds = %329
  br label %333

333:                                              ; preds = %332
  %334 = load ptr, ptr %13, align 8, !tbaa !5
  %335 = call i32 @ba_swap(ptr noundef %334)
  store i32 %335, ptr %6, align 4, !tbaa !9
  %336 = load i32, ptr %6, align 4, !tbaa !9
  %337 = icmp ne i32 %336, 0
  br i1 %337, label %338, label %340

338:                                              ; preds = %333
  %339 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 552, i32 noundef %339)
  br label %396

340:                                              ; preds = %333
  br label %341

341:                                              ; preds = %340
  br label %342

342:                                              ; preds = %341
  br label %343

343:                                              ; preds = %342
  %344 = load ptr, ptr %15, align 8, !tbaa !5
  %345 = call i32 @ba_swap(ptr noundef %344)
  store i32 %345, ptr %6, align 4, !tbaa !9
  %346 = load i32, ptr %6, align 4, !tbaa !9
  %347 = icmp ne i32 %346, 0
  br i1 %347, label %348, label %350

348:                                              ; preds = %343
  %349 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 553, i32 noundef %349)
  br label %396

350:                                              ; preds = %343
  br label %351

351:                                              ; preds = %350
  br label %352

352:                                              ; preds = %351
  br label %353

353:                                              ; preds = %352, %329
  %354 = load i8, ptr %17, align 1, !tbaa !23, !range !25, !noundef !26
  %355 = trunc i8 %354 to i1
  br i1 %355, label %356, label %374

356:                                              ; preds = %353
  br label %357

357:                                              ; preds = %356
  %358 = load i64, ptr %11, align 8, !tbaa !11
  %359 = trunc i64 %358 to i32
  %360 = sext i32 %359 to i64
  %361 = load i64, ptr %12, align 8, !tbaa !11
  %362 = trunc i64 %361 to i32
  %363 = sext i32 %362 to i64
  %364 = load ptr, ptr %13, align 8, !tbaa !5
  %365 = load ptr, ptr %14, align 8, !tbaa !5
  %366 = load ptr, ptr %15, align 8, !tbaa !5
  %367 = call ptr @ec_alloc_binary_onb(i64 noundef %360, i64 noundef %363, ptr noundef %364, ptr noundef %365, ptr noundef %366, ptr noundef null)
  store ptr %367, ptr %20, align 8, !tbaa !5
  %368 = icmp eq ptr null, %367
  br i1 %368, label %369, label %371

369:                                              ; preds = %357
  store i32 2, ptr %6, align 4, !tbaa !9
  %370 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 557, i32 noundef %370)
  br label %396

371:                                              ; preds = %357
  br label %372

372:                                              ; preds = %371
  br label %373

373:                                              ; preds = %372
  br label %392

374:                                              ; preds = %353
  br label %375

375:                                              ; preds = %374
  %376 = getelementptr inbounds [5 x i32], ptr %10, i64 0, i64 0
  %377 = load i32, ptr %9, align 4, !tbaa !9
  %378 = sext i32 %377 to i64
  %379 = load i64, ptr %12, align 8, !tbaa !11
  %380 = trunc i64 %379 to i32
  %381 = sext i32 %380 to i64
  %382 = load ptr, ptr %13, align 8, !tbaa !5
  %383 = load ptr, ptr %14, align 8, !tbaa !5
  %384 = load ptr, ptr %15, align 8, !tbaa !5
  %385 = call ptr @ec_alloc_binary_pb(ptr noundef %376, i64 noundef %378, i64 noundef %381, ptr noundef %382, ptr noundef %383, ptr noundef %384, ptr noundef null)
  store ptr %385, ptr %20, align 8, !tbaa !5
  %386 = icmp eq ptr null, %385
  br i1 %386, label %387, label %389

387:                                              ; preds = %375
  store i32 2, ptr %6, align 4, !tbaa !9
  %388 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 560, i32 noundef %388)
  br label %396

389:                                              ; preds = %375
  br label %390

390:                                              ; preds = %389
  br label %391

391:                                              ; preds = %390
  br label %392

392:                                              ; preds = %391, %373
  br label %393

393:                                              ; preds = %392, %107
  %394 = load ptr, ptr %20, align 8, !tbaa !5
  %395 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %394, ptr %395, align 8, !tbaa !5
  store ptr null, ptr %20, align 8, !tbaa !5
  br label %396

396:                                              ; preds = %393, %387, %369, %348, %338, %325, %313, %304, %285, %266, %247, %221, %203, %181, %168, %156, %146, %134, %118, %105, %78, %68, %56, %44, %34, %26
  %397 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %397) #5
  %398 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ec_free(ptr noundef %398)
  %399 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ba_free(ptr noundef %399)
  %400 = load ptr, ptr %14, align 8, !tbaa !5
  call void @ba_free(ptr noundef %400)
  %401 = load ptr, ptr %15, align 8, !tbaa !5
  call void @ba_free(ptr noundef %401)
  %402 = call ptr @get_DSTU4145Params_desc()
  %403 = load ptr, ptr %18, align 8, !tbaa !5
  call void @asn_free(ptr noundef %402, ptr noundef %403)
  %404 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %404, ptr %3, align 4
  store i32 1, ptr %22, align 4
  br label %405

405:                                              ; preds = %396, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 20, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, 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
  %406 = load i32, ptr %3, align 4
  ret i32 %406
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

declare ptr @get_DSTU4145Params_desc() #2

declare i32 @ecid_from_oid(ptr noundef) #2

declare ptr @ec_alloc_default(i32 noundef) #2

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

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

declare i32 @ba_swap(ptr noundef) #2

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

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

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

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

declare void @ec_free(ptr noundef) #2

declare void @ba_free(ptr noundef) #2

declare void @asn_free(ptr noundef, ptr noundef) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"AlgorithmIdentifier", !15, i64 0, !6, i64 16, !16, i64 24}
!15 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!16 = !{!"asn_struct_ctx_s", !17, i64 0, !17, i64 2, !10, i64 4, !6, i64 8, !12, i64 16}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !10, i64 0}
!19 = !{!"DSTUEllipticCurve", !10, i64 0, !7, i64 8, !16, i64 192}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !10, i64 0}
!22 = !{!"member", !10, i64 0, !7, i64 8, !16, i64 80}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}


; 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 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @dstu4145_params_get_std_oid(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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture 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 i32 @dstu4145_params_get_ec(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca [5 x i32], align 16
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %5, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  %.not = icmp eq ptr %0, null
  %.sink138.sroa.gep = getelementptr inbounds i8, ptr %5, i64 4
  %.sink138.sroa.gep140 = getelementptr inbounds i8, ptr %5, i64 12
  br i1 %.not, label %12, label %13

12:                                               ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 490, i32 noundef 2, ptr noundef null) #5
  br label %.thread

13:                                               ; preds = %2
  %.not113 = icmp eq ptr %1, null
  br i1 %.not113, label %14, label %15

14:                                               ; preds = %13
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 491, i32 noundef 2, ptr noundef null) #5
  br label %.thread

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %15
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 494, i32 noundef 15, ptr noundef null) #5
  br label %.thread

20:                                               ; preds = %15
  %21 = tail call ptr @get_DSTU4145Params_desc() #5
  %22 = tail call ptr @asn_any2type(ptr noundef nonnull %17, ptr noundef %21) #5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 497, i32 noundef 2) #5
  br label %.thread

25:                                               ; preds = %20
  %26 = load i32, ptr %22, align 8, !tbaa !16
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 501, i32 noundef 15, ptr noundef null) #5
  br label %.thread

29:                                               ; preds = %25
  %30 = call i32 @dstu4145_params_get_std_oid(ptr noundef nonnull %22, ptr noundef nonnull %3)
  %.not114 = icmp eq i32 %30, 0
  br i1 %.not114, label %32, label %31

31:                                               ; preds = %29
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 504, i32 noundef %30) #5
  br label %.thread

32:                                               ; preds = %29
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %.not115 = icmp eq ptr %33, null
  br i1 %.not115, label %42, label %34

34:                                               ; preds = %32
  %35 = call i32 @ecid_from_oid(ptr noundef nonnull %33) #5
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 509, i32 noundef 10, ptr noundef null) #5
  br label %.thread

38:                                               ; preds = %34
  %39 = call ptr @ec_alloc_default(i32 noundef %35) #5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %146

41:                                               ; preds = %38
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 511, i32 noundef 2) #5
  br label %.thread

42:                                               ; preds = %32
  %43 = getelementptr inbounds i8, ptr %22, i64 16
  %44 = getelementptr inbounds i8, ptr %22, i64 32
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %42
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 515, i32 noundef 15, ptr noundef null) #5
  br label %.thread

49:                                               ; preds = %42
  %50 = getelementptr inbounds i8, ptr %22, i64 64
  %51 = load i64, ptr %50, align 8, !tbaa !18
  %52 = getelementptr inbounds i8, ptr %22, i64 72
  %53 = call i32 @asn_OCTSTRING2ba(ptr noundef nonnull %52, ptr noundef nonnull %7) #5
  %.not116 = icmp eq i32 %53, 0
  br i1 %.not116, label %55, label %54

54:                                               ; preds = %49
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 519, i32 noundef %53) #5
  br label %.thread

55:                                               ; preds = %49
  %56 = getelementptr inbounds i8, ptr %22, i64 112
  %57 = call i32 @asn_INTEGER2ba(ptr noundef nonnull %56, ptr noundef nonnull %8) #5
  %.not117 = icmp eq i32 %57, 0
  br i1 %.not117, label %59, label %58

58:                                               ; preds = %55
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 520, i32 noundef %57) #5
  br label %.thread

59:                                               ; preds = %55
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = call i32 @ba_swap(ptr noundef %60) #5
  %.not118 = icmp eq i32 %61, 0
  br i1 %.not118, label %63, label %62

62:                                               ; preds = %59
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 521, i32 noundef %61) #5
  br label %.thread

63:                                               ; preds = %59
  %64 = getelementptr inbounds i8, ptr %22, i64 128
  %65 = call i32 @asn_OCTSTRING2ba(ptr noundef nonnull %64, ptr noundef nonnull %9) #5
  %.not119 = icmp eq i32 %65, 0
  br i1 %.not119, label %67, label %66

66:                                               ; preds = %63
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 523, i32 noundef %65) #5
  br label %.thread

67:                                               ; preds = %63
  %68 = call i32 @asn_INTEGER2long(ptr noundef nonnull %43, ptr noundef nonnull %6) #5
  %.not120 = icmp eq i32 %68, 0
  br i1 %.not120, label %70, label %69

69:                                               ; preds = %67
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 525, i32 noundef %68) #5
  br label %.thread

70:                                               ; preds = %67
  %71 = load ptr, ptr %44, align 8, !tbaa !18
  %72 = load i32, ptr %71, align 8, !tbaa !19
  switch i32 %72, label %109 [
    i32 1, label %73
    i32 2, label %83
  ]

73:                                               ; preds = %70
  %74 = call i32 @asn_INTEGER2long(ptr noundef nonnull %43, ptr noundef nonnull %4) #5
  %.not125 = icmp eq i32 %74, 0
  br i1 %.not125, label %76, label %75

75:                                               ; preds = %73
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 529, i32 noundef %74) #5
  br label %.thread

76:                                               ; preds = %73
  %77 = load i64, ptr %4, align 8, !tbaa !21
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr %5, align 16, !tbaa !22
  %79 = load ptr, ptr %44, align 8, !tbaa !18
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  %81 = call i32 @asn_INTEGER2long(ptr noundef nonnull %80, ptr noundef nonnull %4) #5
  %.not126 = icmp eq i32 %81, 0
  br i1 %.not126, label %110, label %82

82:                                               ; preds = %76
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 531, i32 noundef %81) #5
  br label %.thread

83:                                               ; preds = %70
  %84 = call i32 @asn_INTEGER2long(ptr noundef nonnull %43, ptr noundef nonnull %4) #5
  %.not121 = icmp eq i32 %84, 0
  br i1 %.not121, label %86, label %85

85:                                               ; preds = %83
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 536, i32 noundef %84) #5
  br label %.thread

86:                                               ; preds = %83
  %87 = load i64, ptr %4, align 8, !tbaa !21
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %5, align 16, !tbaa !22
  %89 = load ptr, ptr %44, align 8, !tbaa !18
  %90 = getelementptr inbounds i8, ptr %89, i64 40
  %91 = call i32 @asn_INTEGER2long(ptr noundef nonnull %90, ptr noundef nonnull %4) #5
  %.not122 = icmp eq i32 %91, 0
  br i1 %.not122, label %93, label %92

92:                                               ; preds = %86
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 538, i32 noundef %91) #5
  br label %.thread

93:                                               ; preds = %86
  %94 = load i64, ptr %4, align 8, !tbaa !21
  %95 = trunc i64 %94 to i32
  %96 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %95, ptr %96, align 4, !tbaa !22
  %97 = load ptr, ptr %44, align 8, !tbaa !18
  %98 = getelementptr inbounds i8, ptr %97, i64 24
  %99 = call i32 @asn_INTEGER2long(ptr noundef nonnull %98, ptr noundef nonnull %4) #5
  %.not123 = icmp eq i32 %99, 0
  br i1 %.not123, label %101, label %100

100:                                              ; preds = %93
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 540, i32 noundef %99) #5
  br label %.thread

101:                                              ; preds = %93
  %102 = load i64, ptr %4, align 8, !tbaa !21
  %103 = trunc i64 %102 to i32
  %104 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %103, ptr %104, align 8, !tbaa !22
  %105 = load ptr, ptr %44, align 8, !tbaa !18
  %106 = getelementptr inbounds i8, ptr %105, i64 8
  %107 = call i32 @asn_INTEGER2long(ptr noundef nonnull %106, ptr noundef nonnull %4) #5
  %.not124 = icmp eq i32 %107, 0
  br i1 %.not124, label %110, label %108

108:                                              ; preds = %101
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 542, i32 noundef %107) #5
  br label %.thread

109:                                              ; preds = %70
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 546, i32 noundef 10, ptr noundef null) #5
  br label %.thread

110:                                              ; preds = %101, %76
  %.sink138.sroa.phi = phi ptr [ %.sink138.sroa.gep, %76 ], [ %.sink138.sroa.gep140, %101 ]
  %.080 = phi i64 [ 3, %76 ], [ 5, %101 ]
  %.sink139 = load i64, ptr %4, align 8, !tbaa !21
  %111 = trunc i64 %.sink139 to i32
  store i32 %111, ptr %.sink138.sroa.phi, align 4, !tbaa !22
  %112 = call i32 @dstu_params_type(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not127 = icmp eq i32 %112, 0
  br i1 %.not127, label %114, label %113

113:                                              ; preds = %110
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 549, i32 noundef %112) #5
  br label %.thread

114:                                              ; preds = %110
  %115 = load i8, ptr %10, align 1, !tbaa !23, !range !25, !noundef !26
  %116 = trunc nuw i8 %115 to i1
  br i1 %116, label %125, label %117

117:                                              ; preds = %114
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = call i32 @ba_swap(ptr noundef %118) #5
  %.not128 = icmp eq i32 %119, 0
  br i1 %.not128, label %121, label %120

120:                                              ; preds = %117
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 552, i32 noundef %119) #5
  br label %.thread

121:                                              ; preds = %117
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = call i32 @ba_swap(ptr noundef %122) #5
  %.not129 = icmp eq i32 %123, 0
  br i1 %.not129, label %125, label %124

124:                                              ; preds = %121
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 553, i32 noundef %123) #5
  br label %.thread

125:                                              ; preds = %121, %114
  %126 = load i8, ptr %11, align 1, !tbaa !23, !range !25, !noundef !26
  %127 = trunc nuw i8 %126 to i1
  br i1 %127, label %128, label %138

128:                                              ; preds = %125
  %129 = load i64, ptr %6, align 8, !tbaa !21
  %sext130 = shl i64 %129, 32
  %130 = ashr exact i64 %sext130, 32
  %sext131 = shl i64 %51, 32
  %131 = ashr exact i64 %sext131, 32
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = call ptr @ec_alloc_binary_onb(i64 noundef %130, i64 noundef %131, ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef null) #5
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %146

137:                                              ; preds = %128
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 557, i32 noundef 2) #5
  br label %.thread

138:                                              ; preds = %125
  %sext = shl i64 %51, 32
  %139 = ashr exact i64 %sext, 32
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = call ptr @ec_alloc_binary_pb(ptr noundef nonnull %5, i64 noundef %.080, i64 noundef %139, ptr noundef %140, ptr noundef %141, ptr noundef %142, ptr noundef null) #5
  %144 = icmp eq ptr %143, null
  br i1 %144, label %145, label %146

145:                                              ; preds = %138
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 560, i32 noundef 2) #5
  br label %.thread

146:                                              ; preds = %38, %128, %138
  %.1 = phi ptr [ %135, %128 ], [ %143, %138 ], [ %39, %38 ]
  store ptr %.1, ptr %1, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %41, %37, %146, %145, %137, %124, %120, %113, %109, %108, %100, %92, %85, %82, %75, %69, %66, %62, %58, %54, %48, %31, %28, %24, %19, %14, %12
  %.079 = phi ptr [ null, %19 ], [ null, %24 ], [ %22, %28 ], [ %22, %31 ], [ %22, %146 ], [ %22, %48 ], [ %22, %54 ], [ %22, %58 ], [ %22, %62 ], [ %22, %66 ], [ %22, %69 ], [ %22, %75 ], [ %22, %82 ], [ %22, %113 ], [ %22, %137 ], [ %22, %145 ], [ %22, %120 ], [ %22, %124 ], [ %22, %85 ], [ %22, %92 ], [ %22, %100 ], [ %22, %108 ], [ %22, %109 ], [ null, %14 ], [ null, %12 ], [ %22, %37 ], [ %22, %41 ]
  %.3 = phi i32 [ 15, %19 ], [ 2, %24 ], [ 15, %28 ], [ %30, %31 ], [ 0, %146 ], [ 15, %48 ], [ %53, %54 ], [ %57, %58 ], [ %61, %62 ], [ %65, %66 ], [ %68, %69 ], [ %74, %75 ], [ %81, %82 ], [ %112, %113 ], [ 2, %137 ], [ 2, %145 ], [ %119, %120 ], [ %123, %124 ], [ %84, %85 ], [ %91, %92 ], [ %99, %100 ], [ %107, %108 ], [ 10, %109 ], [ 2, %14 ], [ 2, %12 ], [ 10, %37 ], [ 2, %41 ]
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %147) #5
  call void @ec_free(ptr noundef null) #5
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  call void @ba_free(ptr noundef %148) #5
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ba_free(ptr noundef %149) #5
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ba_free(ptr noundef %150) #5
  %151 = call ptr @get_DSTU4145Params_desc() #5
  call void @asn_free(ptr noundef %151, ptr noundef %.079) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.3
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

declare ptr @get_DSTU4145Params_desc() local_unnamed_addr #2

declare i32 @ecid_from_oid(ptr noundef) local_unnamed_addr #2

declare ptr @ec_alloc_default(i32 noundef) local_unnamed_addr #2

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

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

declare i32 @ba_swap(ptr noundef) local_unnamed_addr #2

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

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

declare ptr @ec_alloc_binary_onb(i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @ec_alloc_binary_pb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ec_free(ptr noundef) local_unnamed_addr #2

declare void @ba_free(ptr noundef) local_unnamed_addr #2

declare void @asn_free(ptr noundef, ptr noundef) local_unnamed_addr #2

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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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: write) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"AlgorithmIdentifier", !11, i64 0, !6, i64 16, !13, i64 24}
!11 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"asn_struct_ctx_s", !14, i64 0, !14, i64 2, !12, i64 4, !6, i64 8, !15, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !12, i64 0}
!17 = !{!"DSTUEllipticCurve", !12, i64 0, !7, i64 8, !13, i64 192}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !12, i64 0}
!20 = !{!"member", !12, i64 0, !7, i64 8, !13, i64 80}
!21 = !{!15, !15, i64 0}
!22 = !{!12, !12, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}


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