ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<socket_connect>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x34(%rbp)
  lea    -0x20(%rbp),%rax
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  lea    -0x10(%rbp),%rdx
  mov    -0x4c(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <uint2str@plt>
  lea    -0x30(%rbp),%rcx
  lea    -0x20(%rbp),%rdx
  lea    -0x10(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  je     L36
  mov    $0xffffffff,%eax
  jmp    L1
L36:
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L66
L41:
  mov    -0x50(%rbp),%edx
  lea    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <try_connect@plt>
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  jns    L51
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x28(%rbp)
L66:
  cmpq   $0x0,-0x28(%rbp)
  jne    L41
  jmp    L37
L51:
  nop
L37:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <freeaddrinfo@plt>
  mov    -0x34(%rbp),%eax
L1:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

assistant: ```c
int socket_connect(const char *hostname, uint16_t port, int flags) {
  int sock = -1, deferred;
  struct addrinfo hints, *result, *r;
  memset(&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_STREAM;
  char portstr[8];
  uint2str(port, portstr);
  if (getaddrinfo(hostname, portstr, &hints, &result))
    return -1;
  for (r = result; r; r = r->ai_next) {
    sock = try_connect(r, &deferred, flags);
    if (sock >= 0)
      break;
  }
  freeaddrinfo(result);
  return sock;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<socket_connect>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %edx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r14
  mov    $0x10,%edx
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x18(%rsp)
  lea    0x20(%rsp),%r13
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <uint2str@plt>
  lea    0x8(%rsp),%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L48
  mov    0x8(%rsp),%rbp
  test   %rbp,%rbp
  je     L34
  lea    0x4(%rsp),%r13
L61:
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <try_connect@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jns    L57
  mov    0x0(%rbp),%rbp
  test   %rbp,%rbp
  jne    L61
L57:
  mov    0x8(%rsp),%rdi
  call   <freeaddrinfo@plt>
L43:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    %ebx,%eax
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L34:
  mov    $0xffffffff,%ebx
  jmp    L57
L48:
  mov    $0xffffffff,%ebx
  jmp    L43
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int socket_connect(const char *hostname, uint16_t port, int flags) {
  int sock = -1, deferred;
  struct addrinfo hints, *result, *r;
  memset(&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_STREAM;
  char portstr[8];
  uint2str(port, portstr);
  if (getaddrinfo(hostname, portstr, &hints, &result))
    return -1;
  for (r = result; r; r = r->ai_next) {
    sock = try_connect(r, &deferred, flags);
    if (sock >= 0)
      break;
  }
  freeaddrinfo(result);
  return sock;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<socket_connect>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  xor    %esi,%esi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    $0x10,%edx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r14
  lea    0x20(%rsp),%r13
  mov    %r14,%rdi
  call   <memset@plt>
  mov    D7(%rip),%rax
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    (%rax),%eax
  mov    %eax,0x18(%rsp)
  call   <uint2str@plt>
  lea    0x8(%rsp),%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L41
  mov    0x8(%rsp),%rbp
  test   %rbp,%rbp
  je     L69
  lea    0x4(%rsp),%r13
  jmp    L18
  nopw   0x0(%rax,%rax,1)
L15:
  mov    0x0(%rbp),%rbp
  test   %rbp,%rbp
  je     L52
L18:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <try_connect@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L15
L52:
  mov    0x8(%rsp),%rbp
L26:
  mov    %rbp,%rdi
  call   <freeaddrinfo@plt>
L66:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L69:
  mov    $0xffffffff,%r12d
  jmp    L26
L41:
  mov    $0xffffffff,%r12d
  jmp    L66
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int socket_connect(const char *hostname, uint16_t port, int flags) {
  int sock = -1, deferred;
  struct addrinfo hints, *result, *r;
  memset(&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_STREAM;
  char portstr[8];
  uint2str(port, portstr);
  if (getaddrinfo(hostname, portstr, &hints, &result))
    return -1;
  for (r = result; r; r = r->ai_next) {
    sock = try_connect(r, &deferred, flags);
    if (sock >= 0)
      break;
  }
  freeaddrinfo(result);
  return sock;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<socket_connect>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  xor    %esi,%esi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %edx,%ebx
  mov    $0x10,%edx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r14
  lea    0x20(%rsp),%r13
  mov    %r14,%rdi
  call   <memset@plt>
  mov    D3(%rip),%rax
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    (%rax),%eax
  mov    %eax,0x18(%rsp)
  call   <uint2str@plt>
  lea    0x8(%rsp),%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L22
  mov    0x8(%rsp),%rbp
  test   %rbp,%rbp
  je     L14
  lea    0x4(%rsp),%r13
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L53:
  mov    0x0(%rbp),%rbp
  test   %rbp,%rbp
  je     L0
L45:
  mov    %ebx,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <try_connect@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  js     L53
L0:
  mov    0x8(%rsp),%rbp
L39:
  mov    %rbp,%rdi
  call   <freeaddrinfo@plt>
L5:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L14:
  mov    $0xffffffff,%r12d
  jmp    L39
L22:
  mov    $0xffffffff,%r12d
  jmp    L5
L68:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int socket_connect(const char *hostname, uint16_t port, int flags) {
  int sock = -1, deferred;
  struct addrinfo hints, *result, *r;
  memset(&hints, 0, sizeof(hints));
  hints.ai_socktype = SOCK_STREAM;
  char portstr[8];
  uint2str(port, portstr);
  if (getaddrinfo(hostname, portstr, &hints, &result))
    return -1;
  for (r = result; r; r = r->ai_next) {
    sock = try_connect(r, &deferred, flags);
    if (sock >= 0)
      break;
  }
  freeaddrinfo(result);
  return sock;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sstrncpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L52
  subq   $0x1,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L52
L27:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzbl (%rax),%eax
  test   %al,%al
  je     L7
  subq   $0x1,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L27
  jmp    L52
L7:
  nop
L52:
  cmpq   $0x0,-0x18(%rbp)
  jne    L66
  cmpq   $0x0,-0x38(%rbp)
  je     L66
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
L66:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void sstrncpy(char *dst, const char *src, size_t size) {
  size_t len = size;
  char *dstptr = dst;
  char *srcptr = (char *)src;
  if (len && --len)
    do {
      if (!(*dstptr++ = *srcptr++))
        break;
    } while (--len);
  if (!len && size)
    *dstptr = 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<sstrncpy>:
  endbr64
  test   %rdx,%rdx
  je     L46
  sub    $0x1,%rdx
  je     L2
L38:
  add    $0x1,%rsi
  add    $0x1,%rdi
  movzbl -0x1(%rsi),%eax
  mov    %al,-0x1(%rdi)
  test   %al,%al
  je     L0
  sub    $0x1,%rdx
  jne    L38
  jmp    L2
L0:
  test   %rdx,%rdx
  jne    L46
L2:
  movb   $0x0,(%rdi)
L46:
  ret
```

assistant: ```c
void sstrncpy(char *dst, const char *src, size_t size) {
  size_t len = size;
  char *dstptr = dst;
  char *srcptr = (char *)src;
  if (len && --len)
    do {
      if (!(*dstptr++ = *srcptr++))
        break;
    } while (--len);
  if (!len && size)
    *dstptr = 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<sstrncpy>:
  endbr64
  test   %rdx,%rdx
  je     L8
  cmp    $0x1,%rdx
  je     L17
  mov    %rdi,%rax
  jmp    L33
  nopl   0x0(%rax)
L19:
  mov    %rdx,%rcx
  sub    %rax,%rcx
  lea    -0x1(%rdi,%rcx,1),%rcx
  test   %rcx,%rcx
  je     L42
L33:
  movzbl (%rsi),%ecx
  add    $0x1,%rsi
  add    $0x1,%rax
  mov    %cl,-0x1(%rax)
  test   %cl,%cl
  jne    L19
L8:
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  mov    %rax,%rdi
L17:
  movb   $0x0,(%rdi)
  ret
```

assistant: ```c
void sstrncpy(char *dst, const char *src, size_t size) {
  size_t len = size;
  char *dstptr = dst;
  char *srcptr = (char *)src;
  if (len && --len)
    do {
      if (!(*dstptr++ = *srcptr++))
        break;
    } while (--len);
  if (!len && size)
    *dstptr = 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<sstrncpy>:
  endbr64
  test   %rdx,%rdx
  je     L2
  cmp    $0x1,%rdx
  je     L43
  mov    %rdi,%rax
  jmp    L4
  nopl   0x0(%rax)
L36:
  mov    %rdx,%rcx
  sub    %rax,%rcx
  lea    -0x1(%rdi,%rcx,1),%rcx
  test   %rcx,%rcx
  je     L48
L4:
  movzbl (%rsi),%ecx
  add    $0x1,%rsi
  add    $0x1,%rax
  mov    %cl,-0x1(%rax)
  test   %cl,%cl
  jne    L36
L2:
  ret
  nopl   0x0(%rax,%rax,1)
L48:
  mov    %rax,%rdi
L43:
  movb   $0x0,(%rdi)
  ret
```

assistant: ```c
void sstrncpy(char *dst, const char *src, size_t size) {
  size_t len = size;
  char *dstptr = dst;
  char *srcptr = (char *)src;
  if (len && --len)
    do {
      if (!(*dstptr++ = *srcptr++))
        break;
    } while (--len);
  if (!len && size)
    *dstptr = 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<compare>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %rsi,-0x20(%rbp)
  mov    %al,-0x14(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L58
L33:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x14(%rbp)
  jle    L39
  mov    $0x1,%eax
  jmp    L17
L39:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    %al,-0x14(%rbp)
  jge    L4
  mov    $0xffffffff,%eax
  jmp    L17
L4:
  addl   $0x1,-0x4(%rbp)
L58:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L33
  mov    $0x0,%eax
L17:
  pop    %rbp
  ret
```

assistant: ```c
int compare(char chr, char *str) {
  for (int i = 0; str[i] != 0; i++) {
    if (str[i] < chr) {
      return 1;
    } else if (str[i] > chr) {
      return -1;
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<compare>:
  endbr64
  movzbl (%rsi),%eax
  test   %al,%al
  je     L22
  add    $0x1,%rsi
L37:
  cmp    %al,%dil
  jg     L7
  jl     L18
  add    $0x1,%rsi
  movzbl -0x1(%rsi),%eax
  test   %al,%al
  jne    L37
  mov    $0x0,%eax
  ret
L22:
  mov    $0x0,%eax
  ret
L7:
  mov    $0x1,%eax
  ret
L18:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int compare(char chr, char *str) {
  for (int i = 0; str[i] != 0; i++) {
    if (str[i] < chr) {
      return 1;
    } else if (str[i] > chr) {
      return -1;
    }
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<compare>:
  endbr64
  movzbl (%rsi),%eax
  test   %al,%al
  je     L9
  add    $0x1,%rsi
  jmp    L4
  nopl   0x0(%rax)
L29:
  jl     L18
  movzbl (%rsi),%eax
  add    $0x1,%rsi
  test   %al,%al
  je     L9
L4:
  cmp    %al,%dil
  jle    L29
  mov    $0x1,%eax
  ret
L9:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L18:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int compare(char chr, char *str) {
  for (int i = 0; str[i] != 0; i++) {
    if (str[i] < chr) {
      return 1;
    } else if (str[i] > chr) {
      return -1;
    }
  }
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<compare>:
  endbr64
  movzbl (%rsi),%eax
  test   %al,%al
  je     L1
  add    $0x1,%rsi
  jmp    L4
  nopl   0x0(%rax)
L25:
  jl     L28
  movzbl (%rsi),%eax
  add    $0x1,%rsi
  test   %al,%al
  je     L1
L4:
  cmp    %al,%dil
  jle    L25
  mov    $0x1,%eax
  ret
L1:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L28:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int compare(char chr, char *str) {
  for (int i = 0; str[i] != 0; i++) {
    if (str[i] < chr) {
      return 1;
    } else if (str[i] > chr) {
      return -1;
    }
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<otp_log>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %edi,-0xc4(%rbp)
  mov    %rsi,-0xd0(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L6
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L6:
  mov    -0xd0(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb4(%rbp),%edx
  mov    -0xd0(%rbp),%rcx
  mov    -0xc4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <vsyslog@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  nop
  leave
  ret
```

assistant: ```c
void otp_log(int level, const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  vsyslog(level, format, ap);
  va_end(ap);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<otp_log>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %rsi,%rbx
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <vsyslog@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void otp_log(int level, const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  vsyslog(level, format, ap);
  va_end(ap);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<otp_log>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %r12d,%edi
  mov    %rsi,%rbp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <vsyslog@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void otp_log(int level, const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  vsyslog(level, format, ap);
  va_end(ap);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<otp_log>:
  endbr64
  push   %r13
  mov    %edi,%r13d
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %r12d,%edi
  mov    %rsi,%rbp
  call   <va_start@plt>
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <vsyslog@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void otp_log(int level, const char *format, ...) {
  va_list ap;
  va_start(ap, format);
  vsyslog(level, format, ap);
  va_end(ap);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<mp_mul_cmul>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <cdft@plt>
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <cdft@plt>
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x28(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x10,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x2,-0x14(%rbp)
  jle    L9
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    -0x14(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <mp_mul_rcmul@plt>
L9:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x14(%rbp),%eax
  mov    $0xffffffff,%esi
  mov    %eax,%edi
  call   <cdft@plt>
  nop
  leave
  ret
```

assistant: ```c
void mp_mul_cmul(int nfft, double d1[], double d2[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcmul(int n, double *a, double *b);
  double xr, xi;
  cdft(nfft, 1, &d1[1]);
  cdft(nfft, 1, &d2[1]);
  d2[0] += d1[0];
  xr = d1[1] * d2[1] + d1[2] * d2[2];
  xi = d1[1] * d2[2] + d1[2] * d2[1];
  d2[1] = xr;
  d2[2] = xi;
  if (nfft > 2) {
    mp_mul_rcmul(nfft, &d1[1], &d2[1]);
  }
  d2[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d2[1]);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<mp_mul_cmul>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %rdx,%rbx
  lea    0x8(%rsi),%r14
  mov    %r14,%rdx
  mov    $0x1,%esi
  call   <cdft@plt>
  lea    0x8(%rbx),%r13
  mov    %r13,%rdx
  mov    $0x1,%esi
  mov    %ebp,%edi
  call   <cdft@plt>
  movsd  (%rbx),%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  0x8(%r12),%xmm0
  movsd  0x8(%rbx),%xmm1
  movsd  0x10(%r12),%xmm3
  movsd  0x10(%rbx),%xmm4
  movapd %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  movapd %xmm3,%xmm5
  mulsd  %xmm4,%xmm5
  addsd  %xmm5,%xmm2
  movsd  %xmm2,0x8(%rbx)
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rbx)
  cmp    $0x2,%ebp
  jg     L17
L7:
  movslq %ebp,%rax
  add    $0x1,%rax
  lea    (%rbx,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  mov    %r13,%rdx
  mov    $0xffffffff,%esi
  mov    %ebp,%edi
  call   <cdft@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L17:
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <mp_mul_rcmul@plt>
  jmp    L7
```

assistant: ```c
void mp_mul_cmul(int nfft, double d1[], double d2[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcmul(int n, double *a, double *b);
  double xr, xi;
  cdft(nfft, 1, &d1[1]);
  cdft(nfft, 1, &d2[1]);
  d2[0] += d1[0];
  xr = d1[1] * d2[1] + d1[2] * d2[2];
  xi = d1[1] * d2[2] + d1[2] * d2[1];
  d2[1] = xr;
  d2[2] = xi;
  if (nfft > 2) {
    mp_mul_rcmul(nfft, &d1[1], &d2[1]);
  }
  d2[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d2[1]);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mp_mul_cmul>:
  endbr64
  push   %r14
  lea    0x8(%rsi),%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    $0x1,%esi
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  mov    %r14,%rdx
  lea    0x8(%rbx),%r13
  call   <cdft@plt>
  mov    %r13,%rdx
  mov    $0x1,%esi
  mov    %ebp,%edi
  call   <cdft@plt>
  movsd  (%rbx),%xmm0
  addsd  (%r12),%xmm0
  movsd  0x8(%rbx),%xmm1
  movsd  0x10(%rbx),%xmm4
  movsd  %xmm0,(%rbx)
  movsd  0x8(%r12),%xmm0
  movsd  0x10(%r12),%xmm3
  movapd %xmm0,%xmm2
  movapd %xmm3,%xmm5
  mulsd  %xmm1,%xmm2
  mulsd  %xmm4,%xmm5
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm1
  addsd  %xmm5,%xmm2
  addsd  %xmm1,%xmm0
  movsd  %xmm2,0x8(%rbx)
  movsd  %xmm0,0x10(%rbx)
  cmp    $0x2,%ebp
  jg     L13
L3:
  movslq %ebp,%rax
  mov    %ebp,%edi
  mov    $0xffffffff,%esi
  add    $0x1,%rax
  lea    (%rbx,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  mulsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  mov    %r13,%rdx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <cdft@plt>
  nopl   (%rax)
L13:
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <mp_mul_rcmul@plt>
  jmp    L3
```

assistant: ```c
void mp_mul_cmul(int nfft, double d1[], double d2[]) {
  void cdft(int n, int isgn, double *a);
  void mp_mul_rcmul(int n, double *a, double *b);
  double xr, xi;
  cdft(nfft, 1, &d1[1]);
  cdft(nfft, 1, &d2[1]);
  d2[0] += d1[0];
  xr = d1[1] * d2[1] + d1[2] * d2[2];
  xi = d1[1] * d2[2] + d1[2] * d2[1];
  d2[1] = xr;
  d2[2] = xi;
  if (nfft > 2) {
    mp_mul_rcmul(nfft, &d1[1], &d2[1]);
  }
  d2[nfft + 1] *= d1[nfft + 1];
  cdft(nfft, -1, &d2[1]);
}
```