user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<sm2_ec_group>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <EC_GFp_mont_method@plt>
  mov    %eax,%edi
  call   <EC_GROUP_new@plt>
  mov    %rax,%r12
  xor    %eax,%eax
  call   <BN_CTX_new@plt>
  lea    0x8(%rsp),%rdi
  lea    D10(%rip),%rsi
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  mov    %rax,%rbp
  movq   $0x0,0x18(%rsp)
  call   <BN_hex2bn@plt>
  lea    0x10(%rsp),%rdi
  lea    D50(%rip),%rsi
  call   <BN_hex2bn@plt>
  lea    0x18(%rsp),%rdi
  lea    D30(%rip),%rsi
  call   <BN_hex2bn@plt>
  mov    0x18(%rsp),%rcx
  mov    %rbp,%r8
  mov    %r12,%rdi
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  call   <EC_GROUP_set_curve_GFp@plt>
  cmp    $0x1,%eax
  jne    L21
  lea    0x20(%rsp),%rdi
  lea    D52(%rip),%rsi
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  call   <BN_hex2bn@plt>
  lea    0x28(%rsp),%rdi
  lea    D8(%rip),%rsi
  call   <BN_hex2bn@plt>
  lea    D2(%rip),%rsi
  lea    0x30(%rsp),%rdi
  call   <BN_hex2bn@plt>
  mov    %r12,%rdi
  call   <EC_POINT_new@plt>
  mov    0x28(%rsp),%rcx
  mov    %rbp,%r8
  mov    %r12,%rdi
  mov    0x20(%rsp),%rdx
  mov    %rax,%rsi
  mov    %rax,%r13
  call   <EC_POINT_set_affine_coordinates_GFp@plt>
  xor    %eax,%eax
  call   <BN_value_one@plt>
  mov    0x30(%rsp),%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %eax,%ecx
  call   <EC_GROUP_set_generator@plt>
  mov    0x8(%rsp),%rdi
  call   <BN_free@plt>
  mov    0x10(%rsp),%rdi
  call   <BN_free@plt>
  mov    0x18(%rsp),%rdi
  call   <BN_free@plt>
  mov    0x20(%rsp),%rdi
  call   <BN_free@plt>
  mov    0x28(%rsp),%rdi
  call   <BN_free@plt>
  mov    0x30(%rsp),%rdi
  call   <BN_free@plt>
  mov    %rbp,%rdi
  call   <BN_CTX_free@plt>
L17:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x40,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L21:
  xor    %r12d,%r12d
  jmp    L17
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D10
data_type: string
name: extract_symbolic_data
arguments: data_label: D50
data_type: string
name: extract_symbolic_data
arguments: data_label: D30
data_type: string
name: extract_symbolic_data
arguments: data_label: D52
data_type: string
name: extract_symbolic_data
arguments: data_label: D8
data_type: string
name: extract_symbolic_data
arguments: data_label: D2
data_type: string

tool: D10: 8542D69E4C044F18E8B92435BF6FF7DE457283915C45517D722EDB8B08F1DFC3

tool: D50: 787968B4FA32C3FD2417842E73BBFEFF2F3C848B6831D7E0EC65228B3937E498

tool: D30: 63E4C6D3B23B0C849CF84241484BFE48F61D59A5B16BA06E6E12D1DA27C5249A

tool: D52: 421DEBD61B62EAB6746434EBC3CC315E32220B3BADD50BDC4C4E6C147FEDD43D

tool: D8: 0680512BCBB42C07D47349D2153B70C4E5D7FDFCBFA36EA1A85841B9E46E09A2

tool: D2: 8542D69E4C044F18E8B92435BF6FF7DD297720630485628D5AE74EE7C32E79B7

assistant: ```c
EC_GROUP *sm2_ec_group() {
  EC_GROUP *ecg = EC_GROUP_new(EC_GFp_mont_method());
  BN_CTX *ctx = BN_CTX_new();
  BIGNUM *p = NULL, *a = NULL, *b = NULL;
  BN_hex2bn(&p, "8542D69E4C044F18E8B92435BF6FF7DE457283915C45517D722EDB8B08F1DFC3");
  BN_hex2bn(&a, "787968B4FA32C3FD2417842E73BBFEFF2F3C848B6831D7E0EC65228B3937E498");
  BN_hex2bn(&b, "63E4C6D3B23B0C849CF84241484BFE48F61D59A5B16BA06E6E12D1DA27C5249A");
  if (EC_GROUP_set_curve_GFp(ecg, p, a, b, ctx) != 1)
    return 0;
  ;
  BIGNUM *Gx = NULL, *Gy = NULL, *N = NULL;
  BN_hex2bn(&Gx, "421DEBD61B62EAB6746434EBC3CC315E32220B3BADD50BDC4C4E6C147FEDD43D");
  BN_hex2bn(&Gy, "0680512BCBB42C07D47349D2153B70C4E5D7FDFCBFA36EA1A85841B9E46E09A2");
  BN_hex2bn(&N, "8542D69E4C044F18E8B92435BF6FF7DD297720630485628D5AE74EE7C32E79B7");
  EC_POINT *generator = EC_POINT_new(ecg);
  EC_POINT_set_affine_coordinates_GFp(ecg, generator, Gx, Gy, ctx);
  EC_GROUP_set_generator(ecg, generator, N, BN_value_one());
  BN_free(p);
  BN_free(a);
  BN_free(b);
  BN_free(Gx);
  BN_free(Gy);
  BN_free(N);
  BN_CTX_free(ctx);
  return ecg;
}
```