; LLVM IR from gost-engine/engine :: gost_ec_sign (gost_ec_verify)

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

@.str = external hidden unnamed_addr constant [67 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [51 x i8], align 1

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

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

declare void @ERR_GOST_error(i32 noundef, i32 noundef, ptr noundef, i32 noundef) #1

declare ptr @BN_CTX_new() #1

declare void @BN_CTX_start(ptr noundef) #1

declare ptr @BN_CTX_get(ptr noundef) #1

declare ptr @EC_POINT_new(ptr noundef) #1

declare void @EC_POINT_free(ptr noundef) #1

declare void @BN_CTX_end(ptr noundef) #1

declare void @BN_CTX_free(ptr noundef) #1

; Function Attrs: noreturn
declare void @OPENSSL_die(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @BN_lebin2bn(ptr noundef, i32 noundef, ptr noundef) #1

declare ptr @EC_KEY_get0_group(ptr noundef) #1

declare i32 @EC_GROUP_get_order(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_div(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_is_zero(ptr noundef) #1

declare i32 @BN_set_word(ptr noundef, i64 noundef) #1

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

declare i32 @EC_POINT_get_affine_coordinates(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @BN_free(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @gost_ec_verify(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %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
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %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 i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %32

29:                                               ; preds = %4
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call ptr @EC_KEY_get0_group(ptr noundef %30)
  br label %33

32:                                               ; preds = %4
  br label %33

33:                                               ; preds = %32, %29
  %34 = phi ptr [ %31, %29 ], [ null, %32 ]
  store ptr %34, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  store ptr null, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 0, ptr %25, align 4, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %44

37:                                               ; preds = %33
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %44

40:                                               ; preds = %37
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  br label %46

44:                                               ; preds = %40, %37, %33
  call void @OPENSSL_die(ptr noundef @.str.3, ptr noundef @.str, i32 noundef 338) #5
  unreachable

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %43
  %47 = phi i32 [ 0, %43 ], [ 1, %45 ]
  %48 = call ptr @BN_CTX_new()
  store ptr %48, ptr %10, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef @.str, i32 noundef 341)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %26, align 4
  br label %251

51:                                               ; preds = %46
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  call void @BN_CTX_start(ptr noundef %52)
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = call ptr @BN_CTX_get(ptr noundef %53)
  store ptr %54, ptr %12, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = call ptr @BN_CTX_get(ptr noundef %55)
  store ptr %56, ptr %14, align 8, !tbaa !5
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = call ptr @BN_CTX_get(ptr noundef %57)
  store ptr %58, ptr %17, align 8, !tbaa !5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = call ptr @BN_CTX_get(ptr noundef %59)
  store ptr %60, ptr %18, align 8, !tbaa !5
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = call ptr @BN_CTX_get(ptr noundef %61)
  store ptr %62, ptr %22, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = call ptr @BN_CTX_get(ptr noundef %63)
  store ptr %64, ptr %21, align 8, !tbaa !5
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = call ptr @BN_CTX_get(ptr noundef %65)
  store ptr %66, ptr %15, align 8, !tbaa !5
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = call ptr @BN_CTX_get(ptr noundef %67)
  store ptr %68, ptr %16, align 8, !tbaa !5
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %92

71:                                               ; preds = %51
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %92

74:                                               ; preds = %71
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %92

77:                                               ; preds = %74
  %78 = load ptr, ptr %18, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %92

80:                                               ; preds = %77
  %81 = load ptr, ptr %22, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %92

83:                                               ; preds = %80
  %84 = load ptr, ptr %21, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %92

86:                                               ; preds = %83
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %92

89:                                               ; preds = %86
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %89, %86, %83, %80, %77, %74, %71, %51
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef @.str, i32 noundef 355)
  br label %237

93:                                               ; preds = %89
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = call ptr @EC_KEY_get0_public_key(ptr noundef %94)
  store ptr %95, ptr %24, align 8, !tbaa !5
  %96 = load ptr, ptr %24, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %104

98:                                               ; preds = %93
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = call i32 @EC_GROUP_get_order(ptr noundef %99, ptr noundef %100, ptr noundef %101)
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %105, label %104

104:                                              ; preds = %98, %93
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef @.str, i32 noundef 361)
  br label %237

105:                                              ; preds = %98
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ECDSA_SIG_get0(ptr noundef %106, ptr noundef %20, ptr noundef %19)
  %107 = load ptr, ptr %19, align 8, !tbaa !5
  %108 = call i32 @BN_is_zero(ptr noundef %107)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %132, label %110

110:                                              ; preds = %105
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = call i32 @BN_is_zero(ptr noundef %111)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %132, label %114

114:                                              ; preds = %110
  %115 = load ptr, ptr %19, align 8, !tbaa !5
  %116 = call i32 @BN_is_negative(ptr noundef %115)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %132, label %118

118:                                              ; preds = %114
  %119 = load ptr, ptr %20, align 8, !tbaa !5
  %120 = call i32 @BN_is_negative(ptr noundef %119)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %132, label %122

122:                                              ; preds = %118
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  %125 = call i32 @BN_ucmp(ptr noundef %123, ptr noundef %124)
  %126 = icmp sge i32 %125, 0
  br i1 %126, label %132, label %127

127:                                              ; preds = %122
  %128 = load ptr, ptr %20, align 8, !tbaa !5
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = call i32 @BN_ucmp(ptr noundef %128, ptr noundef %129)
  %131 = icmp sge i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %127, %122, %118, %114, %110, %105
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 128, ptr noundef @.str, i32 noundef 370)
  br label %237

133:                                              ; preds = %127
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = icmp eq i32 %134, 32
  br i1 %135, label %139, label %136

136:                                              ; preds = %133
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = icmp eq i32 %137, 64
  br i1 %138, label %139, label %140

139:                                              ; preds = %136, %133
  br label %142

140:                                              ; preds = %136
  call void @OPENSSL_die(ptr noundef @.str.4, ptr noundef @.str, i32 noundef 374) #5
  unreachable

141:                                              ; No predecessors!
  br label %142

142:                                              ; preds = %141, %139
  %143 = phi i32 [ 0, %139 ], [ 1, %141 ]
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = call ptr @BN_lebin2bn(ptr noundef %144, i32 noundef %145, ptr noundef null)
  store ptr %146, ptr %13, align 8, !tbaa !5
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %156

149:                                              ; preds = %142
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = call i32 @BN_div(ptr noundef null, ptr noundef %150, ptr noundef %151, ptr noundef %152, ptr noundef %153)
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %157, label %156

156:                                              ; preds = %149, %142
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef @.str, i32 noundef 377)
  br label %237

157:                                              ; preds = %149
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = call i32 @BN_is_zero(ptr noundef %158)
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %166

161:                                              ; preds = %157
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  %163 = call i32 @BN_set_word(ptr noundef %162, i64 noundef 1)
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef @.str, i32 noundef 387)
  br label %237

166:                                              ; preds = %161, %157
  %167 = load ptr, ptr %16, align 8, !tbaa !5
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = call ptr @BN_mod_inverse(ptr noundef %167, ptr noundef %168, ptr noundef %169, ptr noundef %170)
  store ptr %171, ptr %16, align 8, !tbaa !5
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %196

174:                                              ; preds = %166
  %175 = load ptr, ptr %17, align 8, !tbaa !5
  %176 = load ptr, ptr %19, align 8, !tbaa !5
  %177 = load ptr, ptr %16, align 8, !tbaa !5
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = call i32 @BN_mod_mul(ptr noundef %175, ptr noundef %176, ptr noundef %177, ptr noundef %178, ptr noundef %179)
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %196

182:                                              ; preds = %174
  %183 = load ptr, ptr %22, align 8, !tbaa !5
  %184 = load ptr, ptr %12, align 8, !tbaa !5
  %185 = load ptr, ptr %20, align 8, !tbaa !5
  %186 = call i32 @BN_sub(ptr noundef %183, ptr noundef %184, ptr noundef %185)
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %196

188:                                              ; preds = %182
  %189 = load ptr, ptr %18, align 8, !tbaa !5
  %190 = load ptr, ptr %22, align 8, !tbaa !5
  %191 = load ptr, ptr %16, align 8, !tbaa !5
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = call i32 @BN_mod_mul(ptr noundef %189, ptr noundef %190, ptr noundef %191, ptr noundef %192, ptr noundef %193)
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %197, label %196

196:                                              ; preds = %188, %182, %174, %166
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef @.str, i32 noundef 394)
  br label %237

197:                                              ; preds = %188
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = call ptr @EC_POINT_new(ptr noundef %198)
  store ptr %199, ptr %23, align 8, !tbaa !5
  %200 = load ptr, ptr %23, align 8, !tbaa !5
  %201 = icmp ne ptr %200, null
  br i1 %201, label %203, label %202

202:                                              ; preds = %197
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef @.str, i32 noundef 407)
  br label %237

203:                                              ; preds = %197
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  %205 = load ptr, ptr %23, align 8, !tbaa !5
  %206 = load ptr, ptr %17, align 8, !tbaa !5
  %207 = load ptr, ptr %24, align 8, !tbaa !5
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  %210 = call i32 @gost_ec_point_mul(ptr noundef %204, ptr noundef %205, ptr noundef %206, ptr noundef %207, ptr noundef %208, ptr noundef %209)
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %213, label %212

212:                                              ; preds = %203
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 524304, ptr noundef @.str, i32 noundef 411)
  br label %237

213:                                              ; preds = %203
  %214 = load ptr, ptr %11, align 8, !tbaa !5
  %215 = load ptr, ptr %23, align 8, !tbaa !5
  %216 = load ptr, ptr %21, align 8, !tbaa !5
  %217 = load ptr, ptr %10, align 8, !tbaa !5
  %218 = call i32 @EC_POINT_get_affine_coordinates(ptr noundef %214, ptr noundef %215, ptr noundef %216, ptr noundef null, ptr noundef %217)
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %221, label %220

220:                                              ; preds = %213
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 524304, ptr noundef @.str, i32 noundef 415)
  br label %237

221:                                              ; preds = %213
  %222 = load ptr, ptr %15, align 8, !tbaa !5
  %223 = load ptr, ptr %21, align 8, !tbaa !5
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = load ptr, ptr %10, align 8, !tbaa !5
  %226 = call i32 @BN_div(ptr noundef null, ptr noundef %222, ptr noundef %223, ptr noundef %224, ptr noundef %225)
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %229, label %228

228:                                              ; preds = %221
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef @.str, i32 noundef 419)
  br label %237

229:                                              ; preds = %221
  %230 = load ptr, ptr %15, align 8, !tbaa !5
  %231 = load ptr, ptr %20, align 8, !tbaa !5
  %232 = call i32 @BN_cmp(ptr noundef %230, ptr noundef %231)
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %235

234:                                              ; preds = %229
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 127, ptr noundef @.str, i32 noundef 430)
  br label %236

235:                                              ; preds = %229
  store i32 1, ptr %25, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %235, %234
  br label %237

237:                                              ; preds = %236, %228, %220, %212, %202, %196, %165, %156, %132, %104, %92
  %238 = load ptr, ptr %23, align 8, !tbaa !5
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %242

240:                                              ; preds = %237
  %241 = load ptr, ptr %23, align 8, !tbaa !5
  call void @EC_POINT_free(ptr noundef %241)
  br label %242

242:                                              ; preds = %240, %237
  %243 = load ptr, ptr %10, align 8, !tbaa !5
  call void @BN_CTX_end(ptr noundef %243)
  %244 = load ptr, ptr %10, align 8, !tbaa !5
  call void @BN_CTX_free(ptr noundef %244)
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  %246 = icmp ne ptr %245, null
  br i1 %246, label %247, label %249

247:                                              ; preds = %242
  %248 = load ptr, ptr %13, align 8, !tbaa !5
  call void @BN_free(ptr noundef %248)
  br label %249

249:                                              ; preds = %247, %242
  %250 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %250, ptr %5, align 4
  store i32 1, ptr %26, align 4
  br label %251

251:                                              ; preds = %249, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %252 = load i32, ptr %5, align 4
  ret i32 %252
}

declare ptr @EC_KEY_get0_public_key(ptr noundef) #1

declare void @ECDSA_SIG_get0(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_is_negative(ptr noundef) #1

declare i32 @BN_ucmp(ptr noundef, ptr noundef) #1

declare ptr @BN_mod_inverse(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_sub(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @BN_cmp(ptr noundef, ptr noundef) #1

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

!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}


; 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 [67 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [51 x i8], align 1

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

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

declare void @ERR_GOST_error(i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @BN_CTX_new() local_unnamed_addr #1

declare void @BN_CTX_start(ptr noundef) local_unnamed_addr #1

declare ptr @BN_CTX_get(ptr noundef) local_unnamed_addr #1

declare ptr @EC_POINT_new(ptr noundef) local_unnamed_addr #1

declare void @EC_POINT_free(ptr noundef) local_unnamed_addr #1

declare void @BN_CTX_end(ptr noundef) local_unnamed_addr #1

declare void @BN_CTX_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: noreturn
declare void @OPENSSL_die(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @BN_lebin2bn(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @EC_KEY_get0_group(ptr noundef) local_unnamed_addr #1

declare i32 @EC_GROUP_get_order(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_div(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_is_zero(ptr noundef) local_unnamed_addr #1

declare i32 @BN_set_word(ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare i32 @EC_POINT_get_affine_coordinates(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_mod_mul(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @BN_free(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @gost_ec_verify(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %9, label %7

7:                                                ; preds = %4
  %8 = tail call ptr @EC_KEY_get0_group(ptr noundef nonnull %3) #4
  br label %9

9:                                                ; preds = %4, %7
  %10 = phi ptr [ %8, %7 ], [ null, %4 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  %11 = icmp ne ptr %0, null
  %12 = icmp ne ptr %2, null
  %or.cond = and i1 %11, %12
  %13 = icmp ne ptr %10, null
  %or.cond3 = select i1 %or.cond, i1 %13, i1 false
  br i1 %or.cond3, label %15, label %14

14:                                               ; preds = %9
  tail call void @OPENSSL_die(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str, i32 noundef 338) #5
  unreachable

15:                                               ; preds = %9
  %16 = tail call ptr @BN_CTX_new() #4
  %.not113 = icmp eq ptr %16, null
  br i1 %.not113, label %17, label %18

17:                                               ; preds = %15
  tail call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 341) #4
  br label %106

18:                                               ; preds = %15
  tail call void @BN_CTX_start(ptr noundef nonnull %16) #4
  %19 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %20 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %21 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %22 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %23 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %24 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %25 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %26 = tail call ptr @BN_CTX_get(ptr noundef nonnull %16) #4
  %27 = insertelement <8 x ptr> poison, ptr %19, i64 0
  %28 = insertelement <8 x ptr> %27, ptr %20, i64 1
  %29 = insertelement <8 x ptr> %28, ptr %21, i64 2
  %30 = insertelement <8 x ptr> %29, ptr %22, i64 3
  %31 = insertelement <8 x ptr> %30, ptr %23, i64 4
  %32 = insertelement <8 x ptr> %31, ptr %24, i64 5
  %33 = insertelement <8 x ptr> %32, ptr %25, i64 6
  %34 = insertelement <8 x ptr> %33, ptr %26, i64 7
  %.fr = freeze <8 x ptr> %34
  %35 = icmp eq <8 x ptr> %.fr, zeroinitializer
  %36 = bitcast <8 x i1> %35 to i8
  %37 = icmp eq i8 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %18
  tail call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 355) #4
  br label %.thread

39:                                               ; preds = %18
  %40 = tail call ptr @EC_KEY_get0_public_key(ptr noundef %3) #4
  %.not114 = icmp eq ptr %40, null
  br i1 %.not114, label %43, label %41

41:                                               ; preds = %39
  %42 = tail call i32 @EC_GROUP_get_order(ptr noundef nonnull %10, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not115 = icmp eq i32 %42, 0
  br i1 %.not115, label %43, label %44

43:                                               ; preds = %41, %39
  tail call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 361) #4
  br label %.thread

44:                                               ; preds = %41
  call void @ECDSA_SIG_get0(ptr noundef nonnull %2, ptr noundef nonnull %6, ptr noundef nonnull %5) #4
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 @BN_is_zero(ptr noundef %45) #4
  %.not116 = icmp eq i32 %46, 0
  br i1 %.not116, label %47, label %64

47:                                               ; preds = %44
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = call i32 @BN_is_zero(ptr noundef %48) #4
  %.not117 = icmp eq i32 %49, 0
  br i1 %.not117, label %50, label %64

50:                                               ; preds = %47
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call i32 @BN_is_negative(ptr noundef %51) #4
  %.not118 = icmp eq i32 %52, 0
  br i1 %.not118, label %53, label %64

53:                                               ; preds = %50
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @BN_is_negative(ptr noundef %54) #4
  %.not119 = icmp eq i32 %55, 0
  br i1 %.not119, label %56, label %64

56:                                               ; preds = %53
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call i32 @BN_ucmp(ptr noundef %57, ptr noundef nonnull %19) #4
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %64, label %60

60:                                               ; preds = %56
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = call i32 @BN_ucmp(ptr noundef %61, ptr noundef nonnull %19) #4
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %64, label %65

64:                                               ; preds = %60, %56, %53, %50, %47, %44
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 128, ptr noundef nonnull @.str, i32 noundef 370) #4
  br label %.thread

65:                                               ; preds = %60
  switch i32 %1, label %66 [
    i32 64, label %67
    i32 32, label %67
  ]

66:                                               ; preds = %65
  call void @OPENSSL_die(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str, i32 noundef 374) #5
  unreachable

67:                                               ; preds = %65, %65
  %68 = call ptr @BN_lebin2bn(ptr noundef nonnull %0, i32 noundef %1, ptr noundef null) #4
  %.not120 = icmp eq ptr %68, null
  br i1 %.not120, label %71, label %69

69:                                               ; preds = %67
  %70 = call i32 @BN_div(ptr noundef null, ptr noundef nonnull %20, ptr noundef nonnull %68, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not121 = icmp eq i32 %70, 0
  br i1 %.not121, label %71, label %72

71:                                               ; preds = %69, %67
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 377) #4
  br label %.thread

72:                                               ; preds = %69
  %73 = call i32 @BN_is_zero(ptr noundef nonnull %20) #4
  %.not122 = icmp eq i32 %73, 0
  br i1 %.not122, label %77, label %74

74:                                               ; preds = %72
  %75 = call i32 @BN_set_word(ptr noundef nonnull %20, i64 noundef 1) #4
  %.not123 = icmp eq i32 %75, 0
  br i1 %.not123, label %76, label %77

76:                                               ; preds = %74
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 387) #4
  br label %.thread

77:                                               ; preds = %74, %72
  %78 = call ptr @BN_mod_inverse(ptr noundef nonnull %26, ptr noundef nonnull %20, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not124 = icmp eq ptr %78, null
  br i1 %.not124, label %87, label %79

79:                                               ; preds = %77
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = call i32 @BN_mod_mul(ptr noundef nonnull %21, ptr noundef %80, ptr noundef nonnull %78, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not125 = icmp eq i32 %81, 0
  br i1 %.not125, label %87, label %82

82:                                               ; preds = %79
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = call i32 @BN_sub(ptr noundef nonnull %23, ptr noundef nonnull %19, ptr noundef %83) #4
  %.not126 = icmp eq i32 %84, 0
  br i1 %.not126, label %87, label %85

85:                                               ; preds = %82
  %86 = call i32 @BN_mod_mul(ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %78, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not127 = icmp eq i32 %86, 0
  br i1 %.not127, label %87, label %88

87:                                               ; preds = %85, %82, %79, %77
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 394) #4
  br label %.thread

88:                                               ; preds = %85
  %89 = call ptr @EC_POINT_new(ptr noundef nonnull %10) #4
  %.not128 = icmp eq ptr %89, null
  br i1 %.not128, label %90, label %91

90:                                               ; preds = %88
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786688, ptr noundef nonnull @.str, i32 noundef 407) #4
  br label %.thread

91:                                               ; preds = %88
  %92 = call i32 @gost_ec_point_mul(ptr noundef nonnull %10, ptr noundef nonnull %89, ptr noundef nonnull %21, ptr noundef nonnull %40, ptr noundef nonnull %22, ptr noundef nonnull %16)
  %.not129 = icmp eq i32 %92, 0
  br i1 %.not129, label %93, label %94

93:                                               ; preds = %91
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 524304, ptr noundef nonnull @.str, i32 noundef 411) #4
  br label %104

94:                                               ; preds = %91
  %95 = call i32 @EC_POINT_get_affine_coordinates(ptr noundef nonnull %10, ptr noundef nonnull %89, ptr noundef nonnull %24, ptr noundef null, ptr noundef nonnull %16) #4
  %.not130 = icmp eq i32 %95, 0
  br i1 %.not130, label %96, label %97

96:                                               ; preds = %94
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 524304, ptr noundef nonnull @.str, i32 noundef 415) #4
  br label %104

97:                                               ; preds = %94
  %98 = call i32 @BN_div(ptr noundef null, ptr noundef nonnull %25, ptr noundef nonnull %24, ptr noundef nonnull %19, ptr noundef nonnull %16) #4
  %.not131 = icmp eq i32 %98, 0
  br i1 %.not131, label %99, label %100

99:                                               ; preds = %97
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 786691, ptr noundef nonnull @.str, i32 noundef 419) #4
  br label %104

100:                                              ; preds = %97
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = call i32 @BN_cmp(ptr noundef nonnull %25, ptr noundef %101) #4
  %.not132 = icmp eq i32 %102, 0
  br i1 %.not132, label %104, label %103

103:                                              ; preds = %100
  call void @ERR_GOST_error(i32 noundef 110, i32 noundef 127, ptr noundef nonnull @.str, i32 noundef 430) #4
  br label %104

104:                                              ; preds = %93, %96, %99, %103, %100
  %.0 = phi i32 [ 0, %103 ], [ 0, %99 ], [ 0, %96 ], [ 0, %93 ], [ 1, %100 ]
  call void @EC_POINT_free(ptr noundef nonnull %89) #4
  br label %.thread

.thread:                                          ; preds = %38, %43, %71, %76, %87, %90, %64, %104
  %.0140 = phi i32 [ %.0, %104 ], [ 0, %64 ], [ 0, %90 ], [ 0, %87 ], [ 0, %76 ], [ 0, %71 ], [ 0, %43 ], [ 0, %38 ]
  %.0101139 = phi ptr [ %68, %104 ], [ null, %64 ], [ %68, %90 ], [ %68, %87 ], [ %68, %76 ], [ %68, %71 ], [ null, %43 ], [ null, %38 ]
  call void @BN_CTX_end(ptr noundef nonnull %16) #4
  call void @BN_CTX_free(ptr noundef nonnull %16) #4
  %.not134 = icmp eq ptr %.0101139, null
  br i1 %.not134, label %106, label %105

105:                                              ; preds = %.thread
  call void @BN_free(ptr noundef nonnull %.0101139) #4
  br label %106

106:                                              ; preds = %.thread, %105, %17
  %.0102 = phi i32 [ 0, %17 ], [ %.0140, %105 ], [ %.0140, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret i32 %.0102
}

declare ptr @EC_KEY_get0_public_key(ptr noundef) local_unnamed_addr #1

declare void @ECDSA_SIG_get0(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_is_negative(ptr noundef) local_unnamed_addr #1

declare i32 @BN_ucmp(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @BN_mod_inverse(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_sub(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @BN_cmp(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { noreturn "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 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 #4 = { nounwind }
attributes #5 = { noreturn 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"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass