; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (private-key)

; 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.PrivateKeyInfo = type { %struct.ASN__PRIMITIVE_TYPE_s, %struct.AlgorithmIdentifier, %struct.OCTET_STRING, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%struct.ECPrivateKey = type { %struct.ASN__PRIMITIVE_TYPE_s, %struct.OCTET_STRING, ptr, ptr, %struct.asn_struct_ctx_s }

@OID_RSA = external global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

declare zeroext i1 @oid_is_equal(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @private_key_get_info(ptr noundef, ptr noundef, ptr noundef) #1

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

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) #0

declare ptr @get_PrivateKeyInfo_desc() #0

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

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

declare void @ba_free(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @spki_get_algo_param(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @spki_get_pubkey(ptr noundef, ptr noundef) #1

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

declare i64 @ba_get_len(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @private_key_ecdh(i1 noundef zeroext %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = zext i1 %0 to i8
  store i8 %28, ptr %6, align 1, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  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 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  store i8 0, ptr %19, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store ptr null, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store ptr null, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store ptr null, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store ptr null, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store ptr null, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store ptr null, ptr %25, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %4
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = icmp ne ptr %30, null
  br i1 %31, label %34, label %32

32:                                               ; preds = %29
  store i32 2, ptr %10, align 4, !tbaa !11
  %33 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1088, i32 noundef %33, ptr noundef null)
  br label %329

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %8, align 8, !tbaa !9
  %39 = icmp ne ptr %38, null
  br i1 %39, label %42, label %40

40:                                               ; preds = %37
  store i32 2, ptr %10, align 4, !tbaa !11
  %41 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1089, i32 noundef %41, ptr noundef null)
  br label %329

42:                                               ; preds = %37
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr %9, align 8, !tbaa !9
  %47 = icmp ne ptr %46, null
  br i1 %47, label %50, label %48

48:                                               ; preds = %45
  store i32 2, ptr %10, align 4, !tbaa !11
  %49 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1090, i32 noundef %49, ptr noundef null)
  br label %329

50:                                               ; preds = %45
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %7, align 8, !tbaa !9
  %55 = call i32 @private_key_get_info(ptr noundef %54, ptr noundef %14, ptr noundef %15)
  store i32 %55, ptr %10, align 4, !tbaa !11
  %56 = load i32, ptr %10, align 4, !tbaa !11
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %53
  %59 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1094, i32 noundef %59)
  br label %329

60:                                               ; preds = %53
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  %65 = call i32 @spki_get_algo_param(ptr noundef %64, ptr noundef %16, ptr noundef %17)
  store i32 %65, ptr %10, align 4, !tbaa !11
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %63
  %69 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1097, i32 noundef %69)
  br label %329

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr %14, align 8, !tbaa !9
  %74 = load ptr, ptr %16, align 8, !tbaa !9
  %75 = call i32 @strcmp(ptr noundef %73, ptr noundef %74) #6
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %86, label %77

77:                                               ; preds = %72
  %78 = load ptr, ptr %15, align 8, !tbaa !9
  %79 = load ptr, ptr %17, align 8, !tbaa !9
  %80 = call i32 @strcmp(ptr noundef %78, ptr noundef %79) #6
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %86, label %82

82:                                               ; preds = %77
  %83 = load ptr, ptr @OID_RSA, align 8, !tbaa !9
  %84 = load ptr, ptr %14, align 8, !tbaa !9
  %85 = call zeroext i1 @oid_is_equal(ptr noundef %83, ptr noundef %84)
  br i1 %85, label %86, label %91

86:                                               ; preds = %82, %77, %72
  br label %87

87:                                               ; preds = %86
  store i32 1057, ptr %10, align 4, !tbaa !11
  %88 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1101, i32 noundef %88, ptr noundef null)
  br label %329

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90, %82
  %92 = load ptr, ptr %17, align 8, !tbaa !9
  %93 = call i32 @ecid_from_oid(ptr noundef %92)
  store i32 %93, ptr %18, align 4, !tbaa !11
  %94 = load i32, ptr %18, align 4, !tbaa !11
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %101

96:                                               ; preds = %91
  br label %97

97:                                               ; preds = %96
  store i32 1049, ptr %10, align 4, !tbaa !11
  %98 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1106, i32 noundef %98, ptr noundef null)
  br label %329

99:                                               ; No predecessors!
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100, %91
  %102 = load i32, ptr %18, align 4, !tbaa !11
  %103 = icmp ule i32 %102, 15
  %104 = zext i1 %103 to i8
  store i8 %104, ptr %19, align 1, !tbaa !5
  br label %105

105:                                              ; preds = %101
  %106 = call ptr @get_PrivateKeyInfo_desc()
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  %108 = call ptr @asn_decode_ba_with_alloc(ptr noundef %106, ptr noundef %107)
  store ptr %108, ptr %11, align 8, !tbaa !9
  %109 = icmp eq ptr null, %108
  br i1 %109, label %110, label %112

110:                                              ; preds = %105
  store i32 2, ptr %10, align 4, !tbaa !11
  %111 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1110, i32 noundef %111)
  br label %329

112:                                              ; preds = %105
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %11, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.PrivateKeyInfo, ptr %116, i32 0, i32 2
  %118 = call i32 @asn_OCTSTRING2ba(ptr noundef %117, ptr noundef %20)
  store i32 %118, ptr %10, align 4, !tbaa !11
  %119 = load i32, ptr %10, align 4, !tbaa !11
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %123

121:                                              ; preds = %115
  %122 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1111, i32 noundef %122)
  br label %329

123:                                              ; preds = %115
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = load i8, ptr %19, align 1, !tbaa !5, !range !13, !noundef !14
  %127 = trunc i8 %126 to i1
  br i1 %127, label %128, label %139

128:                                              ; preds = %125
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr %20, align 8, !tbaa !9
  %131 = call i32 @ba_swap(ptr noundef %130)
  store i32 %131, ptr %10, align 4, !tbaa !11
  %132 = load i32, ptr %10, align 4, !tbaa !11
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %129
  %135 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1113, i32 noundef %135)
  br label %329

136:                                              ; preds = %129
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %162

139:                                              ; preds = %125
  br label %140

140:                                              ; preds = %139
  %141 = call ptr @get_ECPrivateKey_desc()
  %142 = load ptr, ptr %20, align 8, !tbaa !9
  %143 = call ptr @asn_decode_ba_with_alloc(ptr noundef %141, ptr noundef %142)
  store ptr %143, ptr %12, align 8, !tbaa !9
  %144 = icmp eq ptr null, %143
  br i1 %144, label %145, label %147

145:                                              ; preds = %140
  store i32 2, ptr %10, align 4, !tbaa !11
  %146 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1116, i32 noundef %146)
  br label %329

147:                                              ; preds = %140
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %20, align 8, !tbaa !9
  call void @ba_free(ptr noundef %150)
  store ptr null, ptr %20, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %149
  %152 = load ptr, ptr %12, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.ECPrivateKey, ptr %152, i32 0, i32 1
  %154 = call i32 @asn_OCTSTRING2ba(ptr noundef %153, ptr noundef %20)
  store i32 %154, ptr %10, align 4, !tbaa !11
  %155 = load i32, ptr %10, align 4, !tbaa !11
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %159

157:                                              ; preds = %151
  %158 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1119, i32 noundef %158)
  br label %329

159:                                              ; preds = %151
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161, %138
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %8, align 8, !tbaa !9
  %165 = call i32 @spki_get_pubkey(ptr noundef %164, ptr noundef %21)
  store i32 %165, ptr %10, align 4, !tbaa !11
  %166 = load i32, ptr %10, align 4, !tbaa !11
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %163
  %169 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1123, i32 noundef %169)
  br label %329

170:                                              ; preds = %163
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %18, align 4, !tbaa !11
  %174 = call ptr @ec_alloc_default(i32 noundef %173)
  store ptr %174, ptr %13, align 8, !tbaa !9
  %175 = load i8, ptr %19, align 1, !tbaa !5, !range !13, !noundef !14
  %176 = trunc i8 %175 to i1
  br i1 %176, label %177, label %209

177:                                              ; preds = %172
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %13, align 8, !tbaa !9
  %180 = load ptr, ptr %21, align 8, !tbaa !9
  %181 = call i32 @dstu4145_decompress_pubkey(ptr noundef %179, ptr noundef %180, ptr noundef %22, ptr noundef %23)
  store i32 %181, ptr %10, align 4, !tbaa !11
  %182 = load i32, ptr %10, align 4, !tbaa !11
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %186

184:                                              ; preds = %178
  %185 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1129, i32 noundef %185)
  br label %329

186:                                              ; preds = %178
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %22, align 8, !tbaa !9
  %191 = call i32 @ba_swap(ptr noundef %190)
  store i32 %191, ptr %10, align 4, !tbaa !11
  %192 = load i32, ptr %10, align 4, !tbaa !11
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %196

194:                                              ; preds = %189
  %195 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1131, i32 noundef %195)
  br label %329

196:                                              ; preds = %189
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %23, align 8, !tbaa !9
  %201 = call i32 @ba_swap(ptr noundef %200)
  store i32 %201, ptr %10, align 4, !tbaa !11
  %202 = load i32, ptr %10, align 4, !tbaa !11
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %206

204:                                              ; preds = %199
  %205 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1132, i32 noundef %205)
  br label %329

206:                                              ; preds = %199
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  br label %311

209:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store i64 0, ptr %26, align 8, !tbaa !15
  %210 = load ptr, ptr %21, align 8, !tbaa !9
  %211 = call ptr @ba_get_buf(ptr noundef %210)
  %212 = getelementptr inbounds i8, ptr %211, i64 0
  %213 = load i8, ptr %212, align 1, !tbaa !17
  %214 = zext i8 %213 to i32
  %215 = icmp eq i32 %214, 4
  br i1 %215, label %216, label %242

216:                                              ; preds = %209
  %217 = load ptr, ptr %21, align 8, !tbaa !9
  %218 = call i64 @ba_get_len(ptr noundef %217)
  %219 = sub i64 %218, 1
  %220 = udiv i64 %219, 2
  store i64 %220, ptr %26, align 8, !tbaa !15
  br label %221

221:                                              ; preds = %216
  %222 = load ptr, ptr %21, align 8, !tbaa !9
  %223 = load i64, ptr %26, align 8, !tbaa !15
  %224 = call ptr @ba_copy_with_alloc(ptr noundef %222, i64 noundef 1, i64 noundef %223)
  store ptr %224, ptr %22, align 8, !tbaa !9
  %225 = icmp eq ptr null, %224
  br i1 %225, label %226, label %228

226:                                              ; preds = %221
  store i32 2, ptr %10, align 4, !tbaa !11
  %227 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1142, i32 noundef %227)
  store i32 4, ptr %27, align 4
  br label %308

228:                                              ; preds = %221
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %21, align 8, !tbaa !9
  %233 = load i64, ptr %26, align 8, !tbaa !15
  %234 = add i64 %233, 1
  %235 = call ptr @ba_copy_with_alloc(ptr noundef %232, i64 noundef %234, i64 noundef 0)
  store ptr %235, ptr %23, align 8, !tbaa !9
  %236 = icmp eq ptr null, %235
  br i1 %236, label %237, label %239

237:                                              ; preds = %231
  store i32 2, ptr %10, align 4, !tbaa !11
  %238 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1143, i32 noundef %238)
  store i32 4, ptr %27, align 4
  br label %308

239:                                              ; preds = %231
  br label %240

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240
  br label %307

242:                                              ; preds = %209
  %243 = load ptr, ptr %21, align 8, !tbaa !9
  %244 = call ptr @ba_get_buf(ptr noundef %243)
  %245 = getelementptr inbounds i8, ptr %244, i64 0
  %246 = load i8, ptr %245, align 1, !tbaa !17
  %247 = zext i8 %246 to i32
  %248 = icmp eq i32 %247, 2
  br i1 %248, label %249, label %271

249:                                              ; preds = %242
  br label %250

250:                                              ; preds = %249
  %251 = load ptr, ptr %21, align 8, !tbaa !9
  %252 = load i64, ptr %26, align 8, !tbaa !15
  %253 = call ptr @ba_copy_with_alloc(ptr noundef %251, i64 noundef 1, i64 noundef %252)
  store ptr %253, ptr %22, align 8, !tbaa !9
  %254 = icmp eq ptr null, %253
  br i1 %254, label %255, label %257

255:                                              ; preds = %250
  store i32 2, ptr %10, align 4, !tbaa !11
  %256 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1146, i32 noundef %256)
  store i32 4, ptr %27, align 4
  br label %308

257:                                              ; preds = %250
  br label %258

258:                                              ; preds = %257
  br label %259

259:                                              ; preds = %258
  br label %260

260:                                              ; preds = %259
  %261 = load ptr, ptr %13, align 8, !tbaa !9
  %262 = load ptr, ptr %22, align 8, !tbaa !9
  %263 = call i32 @ec_point_decompress(ptr noundef %261, ptr noundef %262, i32 noundef 0, ptr noundef %23)
  store i32 %263, ptr %10, align 4, !tbaa !11
  %264 = load i32, ptr %10, align 4, !tbaa !11
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %266, label %268

266:                                              ; preds = %260
  %267 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1147, i32 noundef %267)
  store i32 4, ptr %27, align 4
  br label %308

268:                                              ; preds = %260
  br label %269

269:                                              ; preds = %268
  br label %270

270:                                              ; preds = %269
  br label %306

271:                                              ; preds = %242
  %272 = load ptr, ptr %21, align 8, !tbaa !9
  %273 = call ptr @ba_get_buf(ptr noundef %272)
  %274 = getelementptr inbounds i8, ptr %273, i64 0
  %275 = load i8, ptr %274, align 1, !tbaa !17
  %276 = zext i8 %275 to i32
  %277 = icmp eq i32 %276, 3
  br i1 %277, label %278, label %300

278:                                              ; preds = %271
  br label %279

279:                                              ; preds = %278
  %280 = load ptr, ptr %21, align 8, !tbaa !9
  %281 = load i64, ptr %26, align 8, !tbaa !15
  %282 = call ptr @ba_copy_with_alloc(ptr noundef %280, i64 noundef 1, i64 noundef %281)
  store ptr %282, ptr %22, align 8, !tbaa !9
  %283 = icmp eq ptr null, %282
  br i1 %283, label %284, label %286

284:                                              ; preds = %279
  store i32 2, ptr %10, align 4, !tbaa !11
  %285 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1150, i32 noundef %285)
  store i32 4, ptr %27, align 4
  br label %308

286:                                              ; preds = %279
  br label %287

287:                                              ; preds = %286
  br label %288

288:                                              ; preds = %287
  br label %289

289:                                              ; preds = %288
  %290 = load ptr, ptr %13, align 8, !tbaa !9
  %291 = load ptr, ptr %22, align 8, !tbaa !9
  %292 = call i32 @ec_point_decompress(ptr noundef %290, ptr noundef %291, i32 noundef 1, ptr noundef %23)
  store i32 %292, ptr %10, align 4, !tbaa !11
  %293 = load i32, ptr %10, align 4, !tbaa !11
  %294 = icmp ne i32 %293, 0
  br i1 %294, label %295, label %297

295:                                              ; preds = %289
  %296 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1151, i32 noundef %296)
  store i32 4, ptr %27, align 4
  br label %308

297:                                              ; preds = %289
  br label %298

298:                                              ; preds = %297
  br label %299

299:                                              ; preds = %298
  br label %305

300:                                              ; preds = %271
  br label %301

301:                                              ; preds = %300
  store i32 1059, ptr %10, align 4, !tbaa !11
  %302 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 1154, i32 noundef %302, ptr noundef null)
  store i32 4, ptr %27, align 4
  br label %308

303:                                              ; No predecessors!
  br label %304

304:                                              ; preds = %303
  br label %305

305:                                              ; preds = %304, %299
  br label %306

306:                                              ; preds = %305, %270
  br label %307

307:                                              ; preds = %306, %241
  store i32 0, ptr %27, align 4
  br label %308

308:                                              ; preds = %307, %301, %295, %284, %266, %255, %237, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  %309 = load i32, ptr %27, align 4
  switch i32 %309, label %346 [
    i32 0, label %310
    i32 4, label %329
  ]

310:                                              ; preds = %308
  br label %311

311:                                              ; preds = %310, %208
  br label %312

312:                                              ; preds = %311
  %313 = load ptr, ptr %13, align 8, !tbaa !9
  %314 = load i8, ptr %6, align 1, !tbaa !5, !range !13, !noundef !14
  %315 = trunc i8 %314 to i1
  %316 = load ptr, ptr %20, align 8, !tbaa !9
  %317 = load ptr, ptr %22, align 8, !tbaa !9
  %318 = load ptr, ptr %23, align 8, !tbaa !9
  %319 = call i32 @ec_dh(ptr noundef %313, i1 noundef zeroext %315, ptr noundef %316, ptr noundef %317, ptr noundef %318, ptr noundef %24, ptr noundef %25)
  store i32 %319, ptr %10, align 4, !tbaa !11
  %320 = load i32, ptr %10, align 4, !tbaa !11
  %321 = icmp ne i32 %320, 0
  br i1 %321, label %322, label %324

322:                                              ; preds = %312
  %323 = load i32, ptr %10, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 1159, i32 noundef %323)
  br label %329

324:                                              ; preds = %312
  br label %325

325:                                              ; preds = %324
  br label %326

326:                                              ; preds = %325
  %327 = load ptr, ptr %24, align 8, !tbaa !9
  %328 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %327, ptr %328, align 8, !tbaa !9
  store ptr null, ptr %24, align 8, !tbaa !9
  br label %329

329:                                              ; preds = %326, %322, %308, %204, %194, %184, %168, %157, %145, %134, %121, %110, %97, %87, %68, %58, %48, %40, %32
  %330 = call ptr @get_PrivateKeyInfo_desc()
  %331 = load ptr, ptr %11, align 8, !tbaa !9
  call void @asn_free(ptr noundef %330, ptr noundef %331)
  %332 = call ptr @get_ECPrivateKey_desc()
  %333 = load ptr, ptr %12, align 8, !tbaa !9
  call void @asn_free(ptr noundef %332, ptr noundef %333)
  %334 = load ptr, ptr %13, align 8, !tbaa !9
  call void @ec_free(ptr noundef %334)
  %335 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %335) #5
  %336 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %336) #5
  %337 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %337) #5
  %338 = load ptr, ptr %17, align 8, !tbaa !9
  call void @free(ptr noundef %338) #5
  %339 = load ptr, ptr %20, align 8, !tbaa !9
  call void @ba_free(ptr noundef %339)
  %340 = load ptr, ptr %21, align 8, !tbaa !9
  call void @ba_free(ptr noundef %340)
  %341 = load ptr, ptr %22, align 8, !tbaa !9
  call void @ba_free(ptr noundef %341)
  %342 = load ptr, ptr %23, align 8, !tbaa !9
  call void @ba_free(ptr noundef %342)
  %343 = load ptr, ptr %24, align 8, !tbaa !9
  call void @ba_free(ptr noundef %343)
  %344 = load ptr, ptr %25, align 8, !tbaa !9
  call void @ba_free(ptr noundef %344)
  %345 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %345, ptr %5, align 4
  store i32 1, ptr %27, align 4
  br label %346

346:                                              ; preds = %329, %308
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %10) #5
  %347 = load i32, ptr %5, align 4
  ret i32 %347
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

declare i32 @ecid_from_oid(ptr noundef) #0

declare i32 @ba_swap(ptr noundef) #0

declare ptr @get_ECPrivateKey_desc() #0

declare ptr @ec_alloc_default(i32 noundef) #0

declare i32 @dstu4145_decompress_pubkey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @ba_get_buf(ptr noundef) #0

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) #0

declare i32 @ec_point_decompress(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

declare i32 @ec_dh(ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @ec_free(ptr noundef) #0

attributes #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"_Bool", !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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!7, !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"

@OID_RSA = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

declare zeroext i1 @oid_is_equal(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @private_key_get_info(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @get_PrivateKeyInfo_desc() local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

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

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

declare void @ba_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @spki_get_algo_param(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @spki_get_pubkey(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare i64 @ba_get_len(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @private_key_ecdh(i1 noundef zeroext %0, ptr noundef %1, ptr noundef %2, ptr noundef writeonly %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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 ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store ptr null, ptr %6, align 8, !tbaa !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 8, ptr nonnull %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %15, label %16

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

16:                                               ; preds = %4
  %.not97 = icmp eq ptr %2, null
  br i1 %.not97, label %17, label %18

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

18:                                               ; preds = %16
  %.not98 = icmp eq ptr %3, null
  br i1 %.not98, label %19, label %20

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

20:                                               ; preds = %18
  %21 = call i32 @private_key_get_info(ptr noundef nonnull %1, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %.not99 = icmp eq i32 %21, 0
  br i1 %.not99, label %23, label %22

22:                                               ; preds = %20
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1094, i32 noundef %21) #5
  br label %.thread

23:                                               ; preds = %20
  %24 = call i32 @spki_get_algo_param(ptr noundef nonnull %2, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %.not100 = icmp eq i32 %24, 0
  br i1 %.not100, label %26, label %25

25:                                               ; preds = %23
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1097, i32 noundef %24) #5
  br label %.thread

26:                                               ; preds = %23
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %27, ptr noundef nonnull dereferenceable(1) %28) #6
  %.not101 = icmp eq i32 %29, 0
  br i1 %.not101, label %30, label %37

30:                                               ; preds = %26
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %31, ptr noundef nonnull dereferenceable(1) %32) #6
  %.not102 = icmp eq i32 %33, 0
  br i1 %.not102, label %34, label %37

34:                                               ; preds = %30
  %35 = load ptr, ptr @OID_RSA, align 8, !tbaa !5
  %36 = call zeroext i1 @oid_is_equal(ptr noundef %35, ptr noundef %27) #5
  br i1 %36, label %37, label %38

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

38:                                               ; preds = %34
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call i32 @ecid_from_oid(ptr noundef %39) #5
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %43

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

43:                                               ; preds = %38
  %44 = icmp ult i32 %40, 16
  %45 = call ptr @get_PrivateKeyInfo_desc() #5
  %46 = call ptr @asn_decode_ba_with_alloc(ptr noundef %45, ptr noundef nonnull %1) #5
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %49

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

49:                                               ; preds = %43
  %50 = getelementptr inbounds i8, ptr %46, i64 64
  %51 = call i32 @asn_OCTSTRING2ba(ptr noundef nonnull %50, ptr noundef nonnull %9) #5
  %.not103 = icmp eq i32 %51, 0
  br i1 %.not103, label %53, label %52

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

53:                                               ; preds = %49
  br i1 %44, label %54, label %58

54:                                               ; preds = %53
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call i32 @ba_swap(ptr noundef %55) #5
  %.not105 = icmp eq i32 %56, 0
  br i1 %.not105, label %69, label %57

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

58:                                               ; preds = %53
  %59 = call ptr @get_ECPrivateKey_desc() #5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = call ptr @asn_decode_ba_with_alloc(ptr noundef %59, ptr noundef %60) #5
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %64

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

64:                                               ; preds = %58
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ba_free(ptr noundef %65) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %61, i64 16
  %67 = call i32 @asn_OCTSTRING2ba(ptr noundef nonnull %66, ptr noundef nonnull %9) #5
  %.not104 = icmp eq i32 %67, 0
  br i1 %.not104, label %69, label %68

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

69:                                               ; preds = %54, %64
  %.067 = phi ptr [ null, %54 ], [ %61, %64 ]
  %70 = call i32 @spki_get_pubkey(ptr noundef nonnull %2, ptr noundef nonnull %10)
  %.not106 = icmp eq i32 %70, 0
  br i1 %.not106, label %72, label %71

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

72:                                               ; preds = %69
  %73 = call ptr @ec_alloc_default(i32 noundef %40) #5
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  br i1 %44, label %75, label %86

75:                                               ; preds = %72
  %76 = call i32 @dstu4145_decompress_pubkey(ptr noundef %73, ptr noundef %74, ptr noundef nonnull %11, ptr noundef nonnull %12) #5
  %.not109 = icmp eq i32 %76, 0
  br i1 %.not109, label %78, label %77

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

78:                                               ; preds = %75
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = call i32 @ba_swap(ptr noundef %79) #5
  %.not110 = icmp eq i32 %80, 0
  br i1 %.not110, label %82, label %81

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

82:                                               ; preds = %78
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = call i32 @ba_swap(ptr noundef %83) #5
  %.not111 = icmp eq i32 %84, 0
  br i1 %.not111, label %._crit_edge, label %85

._crit_edge:                                      ; preds = %82
  %.pre = load ptr, ptr %11, align 8, !tbaa !5
  br label %130

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

86:                                               ; preds = %72
  %87 = call ptr @ba_get_buf(ptr noundef %74) #5
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = icmp eq i8 %88, 4
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  br i1 %89, label %91, label %105

91:                                               ; preds = %86
  %92 = call i64 @ba_get_len(ptr noundef %90) #5
  %93 = add i64 %92, -1
  %94 = lshr i64 %93, 1
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = call ptr @ba_copy_with_alloc(ptr noundef %95, i64 noundef 1, i64 noundef %94) #5
  store ptr %96, ptr %11, align 8, !tbaa !5
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %99

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

99:                                               ; preds = %91
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = add nuw i64 %94, 1
  %102 = call ptr @ba_copy_with_alloc(ptr noundef %100, i64 noundef %101, i64 noundef 0) #5
  store ptr %102, ptr %12, align 8, !tbaa !5
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %130

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

105:                                              ; preds = %86
  %106 = call ptr @ba_get_buf(ptr noundef %90) #5
  %107 = load i8, ptr %106, align 1, !tbaa !9
  %108 = icmp eq i8 %107, 2
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  br i1 %108, label %110, label %117

110:                                              ; preds = %105
  %111 = call ptr @ba_copy_with_alloc(ptr noundef %109, i64 noundef 1, i64 noundef 0) #5
  store ptr %111, ptr %11, align 8, !tbaa !5
  %112 = icmp eq ptr %111, null
  br i1 %112, label %113, label %114

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

114:                                              ; preds = %110
  %115 = call i32 @ec_point_decompress(ptr noundef %73, ptr noundef nonnull %111, i32 noundef 0, ptr noundef nonnull %12) #5
  %.not108 = icmp eq i32 %115, 0
  br i1 %.not108, label %130, label %116

116:                                              ; preds = %114
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1147, i32 noundef %115) #5
  br label %.thread

117:                                              ; preds = %105
  %118 = call ptr @ba_get_buf(ptr noundef %109) #5
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = icmp eq i8 %119, 3
  br i1 %120, label %121, label %129

121:                                              ; preds = %117
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = call ptr @ba_copy_with_alloc(ptr noundef %122, i64 noundef 1, i64 noundef 0) #5
  store ptr %123, ptr %11, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %125, label %126

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

126:                                              ; preds = %121
  %127 = call i32 @ec_point_decompress(ptr noundef %73, ptr noundef nonnull %123, i32 noundef 1, ptr noundef nonnull %12) #5
  %.not107 = icmp eq i32 %127, 0
  br i1 %.not107, label %130, label %128

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

129:                                              ; preds = %117
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 1154, i32 noundef 1059, ptr noundef null) #5
  br label %.thread

130:                                              ; preds = %._crit_edge, %114, %126, %99
  %131 = phi ptr [ %.pre, %._crit_edge ], [ %111, %114 ], [ %123, %126 ], [ %96, %99 ]
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = call i32 @ec_dh(ptr noundef %73, i1 noundef zeroext %0, ptr noundef %132, ptr noundef %131, ptr noundef %133, ptr noundef nonnull %13, ptr noundef nonnull %14) #5
  %.not112 = icmp eq i32 %134, 0
  br i1 %.not112, label %136, label %135

135:                                              ; preds = %130
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 1159, i32 noundef %134) #5
  br label %.thread

136:                                              ; preds = %130
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %137, ptr %3, align 8, !tbaa !5
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %129, %128, %125, %116, %113, %104, %98, %136, %135, %85, %81, %77, %71, %68, %63, %57, %52, %48, %42, %37, %25, %22, %19, %17, %15
  %.2 = phi i32 [ %21, %22 ], [ %24, %25 ], [ 1057, %37 ], [ 1049, %42 ], [ 2, %48 ], [ %51, %52 ], [ %56, %57 ], [ %70, %71 ], [ %76, %77 ], [ %80, %81 ], [ %84, %85 ], [ %134, %135 ], [ 0, %136 ], [ 2, %63 ], [ %67, %68 ], [ 2, %19 ], [ 2, %17 ], [ 2, %15 ], [ 1059, %129 ], [ %127, %128 ], [ 2, %125 ], [ %115, %116 ], [ 2, %113 ], [ 2, %104 ], [ 2, %98 ]
  %.068 = phi ptr [ null, %22 ], [ null, %25 ], [ null, %37 ], [ null, %42 ], [ null, %48 ], [ %46, %52 ], [ %46, %57 ], [ %46, %71 ], [ %46, %77 ], [ %46, %81 ], [ %46, %85 ], [ %46, %135 ], [ %46, %136 ], [ %46, %63 ], [ %46, %68 ], [ null, %19 ], [ null, %17 ], [ null, %15 ], [ %46, %129 ], [ %46, %128 ], [ %46, %125 ], [ %46, %116 ], [ %46, %113 ], [ %46, %104 ], [ %46, %98 ]
  %.1 = phi ptr [ null, %22 ], [ null, %25 ], [ null, %37 ], [ null, %42 ], [ null, %48 ], [ null, %52 ], [ null, %57 ], [ %.067, %71 ], [ %.067, %77 ], [ %.067, %81 ], [ %.067, %85 ], [ %.067, %135 ], [ %.067, %136 ], [ null, %63 ], [ %61, %68 ], [ null, %19 ], [ null, %17 ], [ null, %15 ], [ %.067, %129 ], [ %.067, %128 ], [ %.067, %125 ], [ %.067, %116 ], [ %.067, %113 ], [ %.067, %104 ], [ %.067, %98 ]
  %.066 = phi ptr [ null, %22 ], [ null, %25 ], [ null, %37 ], [ null, %42 ], [ null, %48 ], [ null, %52 ], [ null, %57 ], [ null, %71 ], [ %73, %77 ], [ %73, %81 ], [ %73, %85 ], [ %73, %135 ], [ %73, %136 ], [ null, %63 ], [ null, %68 ], [ null, %19 ], [ null, %17 ], [ null, %15 ], [ %73, %129 ], [ %73, %128 ], [ %73, %125 ], [ %73, %116 ], [ %73, %113 ], [ %73, %104 ], [ %73, %98 ]
  %138 = call ptr @get_PrivateKeyInfo_desc() #5
  call void @asn_free(ptr noundef %138, ptr noundef %.068) #5
  %139 = call ptr @get_ECPrivateKey_desc() #5
  call void @asn_free(ptr noundef %139, ptr noundef %.1) #5
  call void @ec_free(ptr noundef %.066) #5
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %140) #5
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %141) #5
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %142) #5
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %143) #5
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ba_free(ptr noundef %144) #5
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ba_free(ptr noundef %145) #5
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  call void @ba_free(ptr noundef %146) #5
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  call void @ba_free(ptr noundef %147) #5
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ba_free(ptr noundef %148) #5
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  call void @ba_free(ptr noundef %149) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr nonnull %5) #5
  ret i32 %.2
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

declare i32 @ecid_from_oid(ptr noundef) local_unnamed_addr #0

declare i32 @ba_swap(ptr noundef) local_unnamed_addr #0

declare ptr @get_ECPrivateKey_desc() local_unnamed_addr #0

declare ptr @ec_alloc_default(i32 noundef) local_unnamed_addr #0

declare i32 @dstu4145_decompress_pubkey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @ba_get_buf(ptr noundef) local_unnamed_addr #0

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare i32 @ec_point_decompress(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare i32 @ec_dh(ptr noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @ec_free(ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}


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