#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
scalar_t__ EC_GROUP_get_curve_name(int /*<<< orphan*/);
int /*<<< orphan*/ EC_KEY_get0_group(int /*<<< orphan*/);
int /*<<< orphan*/ EVP_PKEY_get0(int /*<<< orphan*/ *);
int param_cmp_gost01(const EVP_PKEY *a, const EVP_PKEY *b) {
  if (EC_GROUP_get_curve_name(
          EC_KEY_get0_group(EVP_PKEY_get0((EVP_PKEY *)a))) ==
      EC_GROUP_get_curve_name(
          EC_KEY_get0_group(EVP_PKEY_get0((EVP_PKEY *)b)))) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<param_cmp_gost01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <EVP_PKEY_get0@plt>
mov    %eax,%edi
call   1040 <EC_KEY_get0_group@plt>
mov    %eax,%edi
call   1050 <EC_GROUP_get_curve_name@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <EVP_PKEY_get0@plt>
mov    %eax,%edi
call   1040 <EC_KEY_get0_group@plt>
mov    %eax,%edi
call   1050 <EC_GROUP_get_curve_name@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    118e <param_cmp_gost01+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1195 <param_cmp_gost01+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_cmp_gost01>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <EVP_PKEY_get0@plt>
mov    %eax,%edi
call   1040 <EC_KEY_get0_group@plt>
mov    %eax,%edi
call   1050 <EC_GROUP_get_curve_name@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <EVP_PKEY_get0@plt>
mov    %eax,%edi
call   1040 <EC_KEY_get0_group@plt>
mov    %eax,%edi
call   1050 <EC_GROUP_get_curve_name@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @param_cmp_gost01(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = call i32 @EVP_PKEY_get0(i32* %6)
%8 = call i32 @EC_KEY_get0_group(i32 %7)
%9 = call i64 @EC_GROUP_get_curve_name(i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @EVP_PKEY_get0(i32* %10)
%12 = call i32 @EC_KEY_get0_group(i32 %11)
%13 = call i64 @EC_GROUP_get_curve_name(i32 %12)
%14 = icmp eq i64 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @param_cmp_gost01(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_get0(i32* %0)
%4 = tail call i32 @EC_KEY_get0_group(i32 %3)
%5 = tail call i64 @EC_GROUP_get_curve_name(i32 %4)
%6 = tail call i32 @EVP_PKEY_get0(i32* %1)
%7 = tail call i32 @EC_KEY_get0_group(i32 %6)
%8 = tail call i64 @EC_GROUP_get_curve_name(i32 %7)
%9 = icmp eq i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}