; LLVM IR from gost-engine/engine :: gost_pmeth (register_pmeth_gost)

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

; Function Attrs: nounwind uwtable
define dso_local i32 @register_pmeth_gost(i32 noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  %8 = load i32, ptr %5, align 4, !tbaa !5
  %9 = load i32, ptr %7, align 4, !tbaa !5
  %10 = call ptr @EVP_PKEY_meth_new(i32 noundef %8, i32 noundef %9)
  %11 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %10, ptr %11, align 8, !tbaa !9
  %12 = load ptr, ptr %6, align 8, !tbaa !9
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = icmp ne ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  br label %141

16:                                               ; preds = %3
  %17 = load i32, ptr %5, align 4, !tbaa !5
  switch i32 %17, label %133 [
    i32 811, label %18
    i32 817, label %18
    i32 979, label %39
    i32 980, label %60
    i32 815, label %81
    i32 976, label %94
    i32 1192, label %107
    i32 1017, label %120
    i32 1178, label %120
  ]

18:                                               ; preds = %16, %16
  %19 = load ptr, ptr %6, align 8, !tbaa !9
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %20, ptr noundef @pkey_gost_ctrl, ptr noundef @pkey_gost_ec_ctrl_str_256)
  %21 = load ptr, ptr %6, align 8, !tbaa !9
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_sign(ptr noundef %22, ptr noundef null, ptr noundef @pkey_gost_ec_cp_sign)
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_verify(ptr noundef %24, ptr noundef null, ptr noundef @pkey_gost_ec_cp_verify)
  %25 = load ptr, ptr %6, align 8, !tbaa !9
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %26, ptr noundef null, ptr noundef @pkey_gost2001cp_keygen)
  %27 = load ptr, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_encrypt(ptr noundef %28, ptr noundef @pkey_gost_encrypt_init, ptr noundef @pkey_gost_encrypt)
  %29 = load ptr, ptr %6, align 8, !tbaa !9
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_decrypt(ptr noundef %30, ptr noundef null, ptr noundef @pkey_gost_decrypt)
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_derive(ptr noundef %32, ptr noundef @pkey_gost_derive_init, ptr noundef @pkey_gost_ec_derive)
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_paramgen(ptr noundef %34, ptr noundef @pkey_gost_paramgen_init, ptr noundef @pkey_gost2001_paramgen)
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_check(ptr noundef %36, ptr noundef @pkey_gost_check)
  %37 = load ptr, ptr %6, align 8, !tbaa !9
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_public_check(ptr noundef %38, ptr noundef @pkey_gost_check)
  br label %134

39:                                               ; preds = %16
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %41, ptr noundef @pkey_gost_ctrl, ptr noundef @pkey_gost_ec_ctrl_str_256)
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_sign(ptr noundef %43, ptr noundef null, ptr noundef @pkey_gost_ec_cp_sign)
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_verify(ptr noundef %45, ptr noundef null, ptr noundef @pkey_gost_ec_cp_verify)
  %46 = load ptr, ptr %6, align 8, !tbaa !9
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %47, ptr noundef null, ptr noundef @pkey_gost2012cp_keygen)
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_encrypt(ptr noundef %49, ptr noundef @pkey_gost_encrypt_init, ptr noundef @pkey_gost_encrypt)
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_decrypt(ptr noundef %51, ptr noundef null, ptr noundef @pkey_gost_decrypt)
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_derive(ptr noundef %53, ptr noundef @pkey_gost_derive_init, ptr noundef @pkey_gost_ec_derive)
  %54 = load ptr, ptr %6, align 8, !tbaa !9
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_paramgen(ptr noundef %55, ptr noundef @pkey_gost_paramgen_init, ptr noundef @pkey_gost2012_paramgen)
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_check(ptr noundef %57, ptr noundef @pkey_gost_check)
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_public_check(ptr noundef %59, ptr noundef @pkey_gost_check)
  br label %134

60:                                               ; preds = %16
  %61 = load ptr, ptr %6, align 8, !tbaa !9
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %62, ptr noundef @pkey_gost_ctrl, ptr noundef @pkey_gost_ec_ctrl_str_512)
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_sign(ptr noundef %64, ptr noundef null, ptr noundef @pkey_gost_ec_cp_sign)
  %65 = load ptr, ptr %6, align 8, !tbaa !9
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_verify(ptr noundef %66, ptr noundef null, ptr noundef @pkey_gost_ec_cp_verify)
  %67 = load ptr, ptr %6, align 8, !tbaa !9
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %68, ptr noundef null, ptr noundef @pkey_gost2012cp_keygen)
  %69 = load ptr, ptr %6, align 8, !tbaa !9
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_encrypt(ptr noundef %70, ptr noundef @pkey_gost_encrypt_init, ptr noundef @pkey_gost_encrypt)
  %71 = load ptr, ptr %6, align 8, !tbaa !9
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_decrypt(ptr noundef %72, ptr noundef null, ptr noundef @pkey_gost_decrypt)
  %73 = load ptr, ptr %6, align 8, !tbaa !9
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_derive(ptr noundef %74, ptr noundef @pkey_gost_derive_init, ptr noundef @pkey_gost_ec_derive)
  %75 = load ptr, ptr %6, align 8, !tbaa !9
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_paramgen(ptr noundef %76, ptr noundef @pkey_gost_paramgen_init, ptr noundef @pkey_gost2012_paramgen)
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_check(ptr noundef %78, ptr noundef @pkey_gost_check)
  %79 = load ptr, ptr %6, align 8, !tbaa !9
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_public_check(ptr noundef %80, ptr noundef @pkey_gost_check)
  br label %134

81:                                               ; preds = %16
  %82 = load ptr, ptr %6, align 8, !tbaa !9
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %83, ptr noundef @pkey_gost_mac_ctrl, ptr noundef @pkey_gost_mac_ctrl_str)
  %84 = load ptr, ptr %6, align 8, !tbaa !9
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_signctx(ptr noundef %85, ptr noundef @pkey_gost_mac_signctx_init, ptr noundef @pkey_gost_mac_signctx)
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %87, ptr noundef null, ptr noundef @pkey_gost_mac_keygen)
  %88 = load ptr, ptr %6, align 8, !tbaa !9
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_init(ptr noundef %89, ptr noundef @pkey_gost_mac_init)
  %90 = load ptr, ptr %6, align 8, !tbaa !9
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_cleanup(ptr noundef %91, ptr noundef @pkey_gost_mac_cleanup)
  %92 = load ptr, ptr %6, align 8, !tbaa !9
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_copy(ptr noundef %93, ptr noundef @pkey_gost_mac_copy)
  store i32 1, ptr %4, align 4
  br label %141

94:                                               ; preds = %16
  %95 = load ptr, ptr %6, align 8, !tbaa !9
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %96, ptr noundef @pkey_gost_mac_ctrl, ptr noundef @pkey_gost_mac_ctrl_str)
  %97 = load ptr, ptr %6, align 8, !tbaa !9
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_signctx(ptr noundef %98, ptr noundef @pkey_gost_mac_signctx_init, ptr noundef @pkey_gost_mac_signctx)
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %100, ptr noundef null, ptr noundef @pkey_gost_mac_keygen_12)
  %101 = load ptr, ptr %6, align 8, !tbaa !9
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_init(ptr noundef %102, ptr noundef @pkey_gost_mac_init)
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_cleanup(ptr noundef %104, ptr noundef @pkey_gost_mac_cleanup)
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_copy(ptr noundef %106, ptr noundef @pkey_gost_mac_copy)
  store i32 1, ptr %4, align 4
  br label %141

107:                                              ; preds = %16
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %109, ptr noundef @pkey_gost_magma_mac_ctrl, ptr noundef @pkey_gost_magma_mac_ctrl_str)
  %110 = load ptr, ptr %6, align 8, !tbaa !9
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_signctx(ptr noundef %111, ptr noundef @pkey_gost_magma_mac_signctx_init, ptr noundef @pkey_gost_mac_signctx)
  %112 = load ptr, ptr %6, align 8, !tbaa !9
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %113, ptr noundef null, ptr noundef @pkey_gost_magma_mac_keygen)
  %114 = load ptr, ptr %6, align 8, !tbaa !9
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_init(ptr noundef %115, ptr noundef @pkey_gost_magma_mac_init)
  %116 = load ptr, ptr %6, align 8, !tbaa !9
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_cleanup(ptr noundef %117, ptr noundef @pkey_gost_mac_cleanup)
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_copy(ptr noundef %119, ptr noundef @pkey_gost_mac_copy)
  store i32 1, ptr %4, align 4
  br label %141

120:                                              ; preds = %16, %16
  %121 = load ptr, ptr %6, align 8, !tbaa !9
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_ctrl(ptr noundef %122, ptr noundef @pkey_gost_grasshopper_mac_ctrl, ptr noundef @pkey_gost_grasshopper_mac_ctrl_str)
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  %124 = load ptr, ptr %123, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_signctx(ptr noundef %124, ptr noundef @pkey_gost_grasshopper_mac_signctx_init, ptr noundef @pkey_gost_mac_signctx)
  %125 = load ptr, ptr %6, align 8, !tbaa !9
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_keygen(ptr noundef %126, ptr noundef null, ptr noundef @pkey_gost_grasshopper_mac_keygen)
  %127 = load ptr, ptr %6, align 8, !tbaa !9
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_init(ptr noundef %128, ptr noundef @pkey_gost_grasshopper_mac_init)
  %129 = load ptr, ptr %6, align 8, !tbaa !9
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_cleanup(ptr noundef %130, ptr noundef @pkey_gost_mac_cleanup)
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_copy(ptr noundef %132, ptr noundef @pkey_gost_mac_copy)
  store i32 1, ptr %4, align 4
  br label %141

133:                                              ; preds = %16
  store i32 0, ptr %4, align 4
  br label %141

134:                                              ; preds = %60, %39, %18
  %135 = load ptr, ptr %6, align 8, !tbaa !9
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_init(ptr noundef %136, ptr noundef @pkey_gost_init)
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_cleanup(ptr noundef %138, ptr noundef @pkey_gost_cleanup)
  %139 = load ptr, ptr %6, align 8, !tbaa !9
  %140 = load ptr, ptr %139, align 8, !tbaa !9
  call void @EVP_PKEY_meth_set_copy(ptr noundef %140, ptr noundef @pkey_gost_copy)
  store i32 1, ptr %4, align 4
  br label %141

141:                                              ; preds = %134, %133, %120, %107, %94, %81, %15
  %142 = load i32, ptr %4, align 4
  ret i32 %142
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pkey_gost_mac_cleanup(ptr noundef) #0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pkey_gost_cleanup(ptr noundef) #0

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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" }

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

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


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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @register_pmeth_gost(i32 noundef %0, ptr nocapture noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call ptr @EVP_PKEY_meth_new(i32 noundef %0, i32 noundef %2) #2
  store ptr %4, ptr %1, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %33, label %5

5:                                                ; preds = %3
  switch i32 %0, label %33 [
    i32 811, label %20
    i32 817, label %20
    i32 979, label %6
    i32 980, label %7
    i32 815, label %8
    i32 976, label %11
    i32 1192, label %14
    i32 1017, label %17
    i32 1178, label %17
  ]

6:                                                ; preds = %5
  br label %20

7:                                                ; preds = %5
  br label %20

8:                                                ; preds = %5
  tail call void @EVP_PKEY_meth_set_ctrl(ptr noundef nonnull %4, ptr noundef nonnull @pkey_gost_mac_ctrl, ptr noundef nonnull @pkey_gost_mac_ctrl_str) #2
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_signctx(ptr noundef %9, ptr noundef nonnull @pkey_gost_mac_signctx_init, ptr noundef nonnull @pkey_gost_mac_signctx) #2
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_keygen(ptr noundef %10, ptr noundef null, ptr noundef nonnull @pkey_gost_mac_keygen) #2
  br label %.sink.split

11:                                               ; preds = %5
  tail call void @EVP_PKEY_meth_set_ctrl(ptr noundef nonnull %4, ptr noundef nonnull @pkey_gost_mac_ctrl, ptr noundef nonnull @pkey_gost_mac_ctrl_str) #2
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_signctx(ptr noundef %12, ptr noundef nonnull @pkey_gost_mac_signctx_init, ptr noundef nonnull @pkey_gost_mac_signctx) #2
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_keygen(ptr noundef %13, ptr noundef null, ptr noundef nonnull @pkey_gost_mac_keygen_12) #2
  br label %.sink.split

14:                                               ; preds = %5
  tail call void @EVP_PKEY_meth_set_ctrl(ptr noundef nonnull %4, ptr noundef nonnull @pkey_gost_magma_mac_ctrl, ptr noundef nonnull @pkey_gost_magma_mac_ctrl_str) #2
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_signctx(ptr noundef %15, ptr noundef nonnull @pkey_gost_magma_mac_signctx_init, ptr noundef nonnull @pkey_gost_mac_signctx) #2
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_keygen(ptr noundef %16, ptr noundef null, ptr noundef nonnull @pkey_gost_magma_mac_keygen) #2
  br label %.sink.split

17:                                               ; preds = %5, %5
  tail call void @EVP_PKEY_meth_set_ctrl(ptr noundef nonnull %4, ptr noundef nonnull @pkey_gost_grasshopper_mac_ctrl, ptr noundef nonnull @pkey_gost_grasshopper_mac_ctrl_str) #2
  %18 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_signctx(ptr noundef %18, ptr noundef nonnull @pkey_gost_grasshopper_mac_signctx_init, ptr noundef nonnull @pkey_gost_mac_signctx) #2
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_keygen(ptr noundef %19, ptr noundef null, ptr noundef nonnull @pkey_gost_grasshopper_mac_keygen) #2
  br label %.sink.split

20:                                               ; preds = %5, %5, %7, %6
  %pkey_gost_ec_ctrl_str_512.sink = phi ptr [ @pkey_gost_ec_ctrl_str_512, %7 ], [ @pkey_gost_ec_ctrl_str_256, %6 ], [ @pkey_gost_ec_ctrl_str_256, %5 ], [ @pkey_gost_ec_ctrl_str_256, %5 ]
  %pkey_gost2012cp_keygen.sink = phi ptr [ @pkey_gost2012cp_keygen, %7 ], [ @pkey_gost2012cp_keygen, %6 ], [ @pkey_gost2001cp_keygen, %5 ], [ @pkey_gost2001cp_keygen, %5 ]
  %pkey_gost2012_paramgen.sink = phi ptr [ @pkey_gost2012_paramgen, %7 ], [ @pkey_gost2012_paramgen, %6 ], [ @pkey_gost2001_paramgen, %5 ], [ @pkey_gost2001_paramgen, %5 ]
  tail call void @EVP_PKEY_meth_set_ctrl(ptr noundef nonnull %4, ptr noundef nonnull @pkey_gost_ctrl, ptr noundef nonnull %pkey_gost_ec_ctrl_str_512.sink) #2
  %21 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_sign(ptr noundef %21, ptr noundef null, ptr noundef nonnull @pkey_gost_ec_cp_sign) #2
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_verify(ptr noundef %22, ptr noundef null, ptr noundef nonnull @pkey_gost_ec_cp_verify) #2
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_keygen(ptr noundef %23, ptr noundef null, ptr noundef nonnull %pkey_gost2012cp_keygen.sink) #2
  %24 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_encrypt(ptr noundef %24, ptr noundef nonnull @pkey_gost_encrypt_init, ptr noundef nonnull @pkey_gost_encrypt) #2
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_decrypt(ptr noundef %25, ptr noundef null, ptr noundef nonnull @pkey_gost_decrypt) #2
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_derive(ptr noundef %26, ptr noundef nonnull @pkey_gost_derive_init, ptr noundef nonnull @pkey_gost_ec_derive) #2
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_paramgen(ptr noundef %27, ptr noundef nonnull @pkey_gost_paramgen_init, ptr noundef nonnull %pkey_gost2012_paramgen.sink) #2
  %28 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_check(ptr noundef %28, ptr noundef nonnull @pkey_gost_check) #2
  %29 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_public_check(ptr noundef %29, ptr noundef nonnull @pkey_gost_check) #2
  br label %.sink.split

.sink.split:                                      ; preds = %8, %11, %14, %17, %20
  %pkey_gost_init.sink = phi ptr [ @pkey_gost_init, %20 ], [ @pkey_gost_grasshopper_mac_init, %17 ], [ @pkey_gost_magma_mac_init, %14 ], [ @pkey_gost_mac_init, %11 ], [ @pkey_gost_mac_init, %8 ]
  %pkey_gost_cleanup.sink = phi ptr [ @pkey_gost_cleanup, %20 ], [ @pkey_gost_mac_cleanup, %17 ], [ @pkey_gost_mac_cleanup, %14 ], [ @pkey_gost_mac_cleanup, %11 ], [ @pkey_gost_mac_cleanup, %8 ]
  %pkey_gost_copy.sink = phi ptr [ @pkey_gost_copy, %20 ], [ @pkey_gost_mac_copy, %17 ], [ @pkey_gost_mac_copy, %14 ], [ @pkey_gost_mac_copy, %11 ], [ @pkey_gost_mac_copy, %8 ]
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_init(ptr noundef %30, ptr noundef nonnull %pkey_gost_init.sink) #2
  %31 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_cleanup(ptr noundef %31, ptr noundef nonnull %pkey_gost_cleanup.sink) #2
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @EVP_PKEY_meth_set_copy(ptr noundef %32, ptr noundef nonnull %pkey_gost_copy.sink) #2
  br label %33

33:                                               ; preds = %.sink.split, %5, %3
  %.0 = phi i32 [ 0, %3 ], [ 0, %5 ], [ 1, %.sink.split ]
  ret i32 %.0
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pkey_gost_mac_cleanup(ptr noundef) #0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @pkey_gost_cleanup(ptr noundef) #0

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass