ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<settpref>:
  endbr64
  mov    %rdi,%rax
  mov    %esi,%edi
  mov    (%rax),%ecx
  cmp    $0xffff,%esi
  jne    L228
  cmp    $0x132,%ecx
  je     L75
  cmp    $0xffff,%ecx
  je     L86
  mov    0x4(%rax),%edx
  lea    0x4(%rax),%rsi
  mov    %rsi,%rdi
  cmp    $0x132,%edx
  je     L99
  cmp    $0xffff,%edx
  je     L214
  cmpl   $0xffff,0x8(%rax)
  je     L89
  cmp    $0x9003,%ecx
  je     L36
L161:
  cmp    $0x9003,%edx
  je     L137
  cmp    $0xffff,%edx
  je     L120
L189:
  cmpl   $0xffff,0x8(%rax)
  lea    0x8(%rax),%rdi
  je     L120
L137:
  mov    $0x9004,%edi
L228:
  cmp    %edi,%ecx
  je     L121
  cmp    $0xffff,%ecx
  je     L66
  mov    0x4(%rax),%edx
  lea    0x4(%rax),%rsi
L67:
  cmp    %edx,%edi
  je     L121
  cmp    $0xffff,%edx
  je     L112
  lea    0x8(%rax),%rsi
  mov    0x8(%rax),%eax
  cmp    %edi,%eax
  je     L17
  cmp    $0xffff,%eax
  je     L112
L121:
  ret
L86:
  mov    %rax,%rdi
L214:
  movl   $0x132,(%rdi)
  mov    (%rax),%ecx
  cmp    $0x9003,%ecx
  je     L45
  cmp    $0xffff,%ecx
  je     L171
L75:
  mov    0x4(%rax),%edx
  lea    0x4(%rax),%rdi
  jmp    L161
L99:
  cmp    $0x9003,%ecx
  jne    L189
L36:
  mov    $0x9004,%edi
  jmp    L67
L89:
  lea    0x8(%rax),%rdi
  jmp    L214
L171:
  mov    %rax,%rdi
L120:
  movl   $0x9003,(%rdi)
  mov    $0x9004,%edi
  mov    (%rax),%ecx
  jmp    L228
L66:
  mov    %rax,%rsi
L112:
  mov    %edi,(%rsi)
  ret
L17:
  ret
L45:
  mov    0x4(%rax),%edx
  lea    0x4(%rax),%rsi
  jmp    L36
```

assistant: ```c
void settpref(u_int16_t *tpref, u_int16_t tag) {
  int i;
  if (tag == 0xffff) {
    settpref(tpref, 0x0132);
    settpref(tpref, 0x9003);
    settpref(tpref, 0x9004);
    return;
  }
  for (i = 0; i < 3; i++) {
    if (tpref[i] == tag)
      break;
    if (tpref[i] == 0xffff) {
      tpref[i] = tag;
      break;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<xdr_rmtcall_args>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x30(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x30(%rbp),%rax
  lea    0x28(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L28
  mov    -0x30(%rbp),%rax
  lea    0x20(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L28
  mov    -0x30(%rbp),%rax
  lea    0x18(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L28
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L77
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  jmp    L22
L77:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    0x10(%rax),%rcx
  mov    -0x30(%rbp),%rax
  mov    0x8(%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   *%rcx
  test   %eax,%eax
  jne    L63
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  jmp    L22
L63:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  sub    -0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <XDR_SETPOS@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L17
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  jmp    L22
L17:
  mov    -0x8(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <XDR_SETPOS@plt>
  mov    D30(%rip),%rax
  mov    (%rax),%eax
  jmp    L22
L28:
  mov    D21(%rip),%rax
  mov    (%rax),%eax
L22:
  leave
  ret
```

assistant: ```c
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) {
  u_int lenposition, argposition, position;
  assert(xdrs != NULL);
  assert(cap != NULL);
  if (xdr_u_long(xdrs, &(cap->prog)) && xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {
    lenposition = XDR_GETPOS(xdrs);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    argposition = XDR_GETPOS(xdrs);
    if (!(*(cap->xdr_args))(xdrs, cap->args_ptr))
      return (FALSE);
    position = XDR_GETPOS(xdrs);
    cap->arglen = (u_long)position - (u_long)argposition;
    XDR_SETPOS(xdrs, lenposition);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    XDR_SETPOS(xdrs, position);
    return (TRUE);
  }
  return (FALSE);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<xdr_rmtcall_args>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %rbp,%rbp
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  lea    0x28(%rbp),%rsi
  mov    %rbx,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L94
L55:
  mov    D25(%rip),%rax
  mov    (%rax),%eax
L71:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L94:
  lea    0x20(%rbp),%rsi
  mov    %rbx,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L55
  lea    0x18(%rbp),%rsi
  mov    %rbx,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L55
  mov    %rbx,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,%r12
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L47
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  jmp    L71
L47:
  mov    %rbx,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,%r14
  mov    0x8(%rbp),%esi
  mov    %rbx,%rdi
  call   *0x10(%rbp)
  test   %eax,%eax
  jne    L38
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  jmp    L71
L38:
  mov    %rbx,%rdi
  call   <XDR_GETPOS@plt>
  mov    %rax,%r13
  sub    %r14,%rax
  mov    %rax,0x0(%rbp)
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <XDR_SETPOS@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L59
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  jmp    L71
L59:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <XDR_SETPOS@plt>
  mov    D48(%rip),%rax
  mov    (%rax),%eax
  jmp    L71
```

assistant: ```c
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) {
  u_int lenposition, argposition, position;
  assert(xdrs != NULL);
  assert(cap != NULL);
  if (xdr_u_long(xdrs, &(cap->prog)) && xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {
    lenposition = XDR_GETPOS(xdrs);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    argposition = XDR_GETPOS(xdrs);
    if (!(*(cap->xdr_args))(xdrs, cap->args_ptr))
      return (FALSE);
    position = XDR_GETPOS(xdrs);
    cap->arglen = (u_long)position - (u_long)argposition;
    XDR_SETPOS(xdrs, lenposition);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    XDR_SETPOS(xdrs, position);
    return (TRUE);
  }
  return (FALSE);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<xdr_rmtcall_args>:
  endbr64
  push   %r14
  test   %rdi,%rdi
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  setne  %dil
  push   %rbx
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %r12,%r12
  setne  %dil
  call   <assert@plt>
  lea    0x28(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L37
L58:
  mov    D6(%rip),%rax
  mov    (%rax),%eax
L52:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L37:
  lea    0x20(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L58
  lea    0x18(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L58
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L58
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    0x8(%r12),%esi
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   *0x10(%r12)
  test   %eax,%eax
  je     L58
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r14
  sub    %rbx,%rax
  mov    %rax,(%r12)
  call   <XDR_SETPOS@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L58
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <XDR_SETPOS@plt>
  mov    D13(%rip),%rax
  mov    (%rax),%eax
  jmp    L52
```

assistant: ```c
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) {
  u_int lenposition, argposition, position;
  assert(xdrs != NULL);
  assert(cap != NULL);
  if (xdr_u_long(xdrs, &(cap->prog)) && xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {
    lenposition = XDR_GETPOS(xdrs);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    argposition = XDR_GETPOS(xdrs);
    if (!(*(cap->xdr_args))(xdrs, cap->args_ptr))
      return (FALSE);
    position = XDR_GETPOS(xdrs);
    cap->arglen = (u_long)position - (u_long)argposition;
    XDR_SETPOS(xdrs, lenposition);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    XDR_SETPOS(xdrs, position);
    return (TRUE);
  }
  return (FALSE);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<xdr_rmtcall_args>:
  endbr64
  push   %r14
  test   %rdi,%rdi
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  setne  %dil
  push   %rbx
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %r12,%r12
  setne  %dil
  call   <assert@plt>
  lea    0x28(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  jne    L52
L0:
  mov    D14(%rip),%rax
  mov    (%rax),%eax
L40:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L52:
  lea    0x20(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L0
  lea    0x18(%r12),%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L0
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L0
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    0x8(%r12),%esi
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   *0x10(%r12)
  test   %eax,%eax
  je     L0
  mov    %rbp,%rdi
  call   <XDR_GETPOS@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %rax,%r14
  sub    %rbx,%rax
  mov    %rax,(%r12)
  call   <XDR_SETPOS@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <xdr_u_long@plt>
  test   %rax,%rax
  je     L0
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <XDR_SETPOS@plt>
  mov    D8(%rip),%rax
  mov    (%rax),%eax
  jmp    L40
```

assistant: ```c
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) {
  u_int lenposition, argposition, position;
  assert(xdrs != NULL);
  assert(cap != NULL);
  if (xdr_u_long(xdrs, &(cap->prog)) && xdr_u_long(xdrs, &(cap->vers)) && xdr_u_long(xdrs, &(cap->proc))) {
    lenposition = XDR_GETPOS(xdrs);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    argposition = XDR_GETPOS(xdrs);
    if (!(*(cap->xdr_args))(xdrs, cap->args_ptr))
      return (FALSE);
    position = XDR_GETPOS(xdrs);
    cap->arglen = (u_long)position - (u_long)argposition;
    XDR_SETPOS(xdrs, lenposition);
    if (!xdr_u_long(xdrs, &(cap->arglen)))
      return (FALSE);
    XDR_SETPOS(xdrs, position);
    return (TRUE);
  }
  return (FALSE);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<evil_chmod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    $0x0,%eax
  call   <is_licensed_prog@plt>
  test   %rax,%rax
  jne    L27
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <is_protected_file@plt>
  test   %rax,%rax
  jne    L0
  jmp    L8
L27:
  nop
L8:
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <real_chmod@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  jmp    L13
L0:
  nop
  mov    D19(%rip),%rax
  mov    (%rax),%edx
  mov    D3(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
L13:
  leave
  ret
```

assistant: ```c
int evil_chmod(const char *path, mode_t mode) {
  int ret = 0;
  if (is_licensed_prog())
    goto green;
  if (is_protected_file(path))
    goto red;
green:
  ret = real_chmod(path, mode);
  return ret;
red:
  errno = EPERM;
  return -1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<evil_chmod>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    $0x0,%eax
  call   <is_licensed_prog@plt>
  test   %rax,%rax
  je     L2
L19:
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <real_chmod@plt>
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L2:
  mov    %rbx,%rdi
  call   <is_protected_file@plt>
  test   %rax,%rax
  je     L19
  mov    D4(%rip),%rax
  mov    (%rax),%edx
  mov    D3(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L13
```

assistant: ```c
int evil_chmod(const char *path, mode_t mode) {
  int ret = 0;
  if (is_licensed_prog())
    goto green;
  if (is_protected_file(path))
    goto red;
green:
  ret = real_chmod(path, mode);
  return ret;
red:
  errno = EPERM;
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<evil_chmod>:
  endbr64
  push   %r12
  xor    %eax,%eax
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <is_licensed_prog@plt>
  test   %rax,%rax
  je     L2
L0:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1090 <real_chmod@plt>
  nop
L2:
  mov    %rbp,%rdi
  call   <is_protected_file@plt>
  test   %rax,%rax
  je     L0
  mov    D13(%rip),%rax
  mov    (%rax),%edx
  mov    D19(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int evil_chmod(const char *path, mode_t mode) {
  int ret = 0;
  if (is_licensed_prog())
    goto green;
  if (is_protected_file(path))
    goto red;
green:
  ret = real_chmod(path, mode);
  return ret;
red:
  errno = EPERM;
  return -1;
}
```
user: What is the c source code of the assembly code below:

```asm
<evil_chmod>:
  endbr64
  push   %r12
  xor    %eax,%eax
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <is_licensed_prog@plt>
  test   %rax,%rax
  je     L10
L15:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1090 <real_chmod@plt>
  nop
L10:
  mov    %rbp,%rdi
  call   <is_protected_file@plt>
  test   %rax,%rax
  je     L15
  mov    D17(%rip),%rax
  mov    (%rax),%edx
  mov    D6(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int evil_chmod(const char *path, mode_t mode) {
  int ret = 0;
  if (is_licensed_prog())
    goto green;
  if (is_protected_file(path))
    goto red;
green:
  ret = real_chmod(path, mode);
  return ret;
red:
  errno = EPERM;
  return -1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mutate_seed>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %edx,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %ax,-0xe(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  shr    $0x10,%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %ax,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x28(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %edx,%eax
  add    %eax,%ecx
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%edx
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  imul   %edx,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  shr    $0x10,%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %ax,-0xa(%rbp)
  movzwl -0xe(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x28(%rbp),%rax
  lea    0x2(%rax),%rdx
  movzwl -0xc(%rbp),%eax
  mov    %ax,(%rdx)
  mov    -0x28(%rbp),%rax
  lea    0x4(%rax),%rdx
  movzwl -0xa(%rbp),%eax
  mov    %ax,(%rdx)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
void mutate_seed(unsigned short x[], unsigned short *y) {
  unsigned short s[3];
  unsigned long t;
  t = x[0] * y[0] + y[3];
  s[0] = t & 0xffff;
  t = x[1] * y[0] + x[0] * y[1] + (t >> 16);
  s[1] = t & 0xffff;
  t = x[1] * y[1] + x[0] * y[2] + x[2] * y[0] + (t >> 16);
  s[2] = t & 0xffff;
  x[0] = s[0];
  x[1] = s[1];
  x[2] = s[2];
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<mutate_seed>:
  endbr64
  push   %rbx
  mov    %rdi,%rdx
  mov    %rsi,%rax
  movzwl (%rdi),%r10d
  movzwl (%rsi),%r8d
  mov    %r10d,%esi
  imul   %r8d,%esi
  movzwl 0x6(%rax),%ecx
  add    %ecx,%esi
  movslq %esi,%rsi
  movzwl 0x2(%rdi),%edi
  movzwl 0x2(%rax),%r11d
  mov    %rsi,%r9
  shr    $0x10,%r9
  mov    %r8d,%ecx
  imul   %edi,%ecx
  mov    %r10d,%ebx
  imul   %r11d,%ebx
  add    %ebx,%ecx
  movslq %ecx,%rcx
  add    %r9,%rcx
  mov    %rcx,%r9
  shr    $0x10,%r9
  movzwl 0x4(%rax),%eax
  imul   %r10d,%eax
  imul   %r11d,%edi
  add    %edi,%eax
  movzwl 0x4(%rdx),%edi
  imul   %r8d,%edi
  add    %edi,%eax
  cltq
  add    %r9,%rax
  mov    %si,(%rdx)
  mov    %cx,0x2(%rdx)
  mov    %ax,0x4(%rdx)
  pop    %rbx
  ret
```

assistant: ```c
void mutate_seed(unsigned short x[], unsigned short *y) {
  unsigned short s[3];
  unsigned long t;
  t = x[0] * y[0] + y[3];
  s[0] = t & 0xffff;
  t = x[1] * y[0] + x[0] * y[1] + (t >> 16);
  s[1] = t & 0xffff;
  t = x[1] * y[1] + x[0] * y[2] + x[2] * y[0] + (t >> 16);
  s[2] = t & 0xffff;
  x[0] = s[0];
  x[1] = s[1];
  x[2] = s[2];
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<mutate_seed>:
  endbr64
  push   %rbx
  movzwl (%rdi),%r10d
  mov    %rsi,%rax
  mov    %rdi,%rdx
  movzwl (%rsi),%r8d
  movzwl 0x6(%rax),%ecx
  mov    %r10d,%esi
  movzwl 0x2(%rax),%r11d
  movzwl 0x2(%rdi),%edi
  mov    %r10d,%ebx
  imul   %r8d,%esi
  movzwl 0x4(%rax),%eax
  imul   %r11d,%ebx
  imul   %r10d,%eax
  add    %ecx,%esi
  mov    %r8d,%ecx
  imul   %edi,%ecx
  movslq %esi,%r9
  mov    %si,(%rdx)
  imul   %r11d,%edi
  shr    $0x10,%r9
  add    %ebx,%ecx
  pop    %rbx
  add    %edi,%eax
  movzwl 0x4(%rdx),%edi
  movslq %ecx,%rcx
  add    %r9,%rcx
  imul   %r8d,%edi
  mov    %rcx,%r9
  mov    %cx,0x2(%rdx)
  shr    $0x10,%r9
  add    %edi,%eax
  cltq
  add    %r9,%rax
  mov    %ax,0x4(%rdx)
  ret
```

assistant: ```c
void mutate_seed(unsigned short x[], unsigned short *y) {
  unsigned short s[3];
  unsigned long t;
  t = x[0] * y[0] + y[3];
  s[0] = t & 0xffff;
  t = x[1] * y[0] + x[0] * y[1] + (t >> 16);
  s[1] = t & 0xffff;
  t = x[1] * y[1] + x[0] * y[2] + x[2] * y[0] + (t >> 16);
  s[2] = t & 0xffff;
  x[0] = s[0];
  x[1] = s[1];
  x[2] = s[2];
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<mutate_seed>:
  endbr64
  push   %rbx
  movzwl (%rdi),%r10d
  mov    %rsi,%rax
  mov    %rdi,%rdx
  movzwl (%rsi),%r8d
  movzwl 0x6(%rax),%ecx
  mov    %r10d,%esi
  movzwl 0x2(%rax),%r11d
  movzwl 0x2(%rdi),%edi
  mov    %r10d,%ebx
  imul   %r8d,%esi
  movzwl 0x4(%rax),%eax
  imul   %r11d,%ebx
  imul   %r10d,%eax
  add    %ecx,%esi
  mov    %r8d,%ecx
  imul   %edi,%ecx
  movslq %esi,%r9
  mov    %si,(%rdx)
  imul   %r11d,%edi
  shr    $0x10,%r9
  add    %ebx,%ecx
  pop    %rbx
  add    %edi,%eax
  movzwl 0x4(%rdx),%edi
  movslq %ecx,%rcx
  add    %r9,%rcx
  imul   %r8d,%edi
  mov    %rcx,%r9
  mov    %cx,0x2(%rdx)
  shr    $0x10,%r9
  add    %edi,%eax
  cltq
  add    %r9,%rax
  mov    %ax,0x4(%rdx)
  ret
```

assistant: ```c
void mutate_seed(unsigned short x[], unsigned short *y) {
  unsigned short s[3];
  unsigned long t;
  t = x[0] * y[0] + y[3];
  s[0] = t & 0xffff;
  t = x[1] * y[0] + x[0] * y[1] + (t >> 16);
  s[1] = t & 0xffff;
  t = x[1] * y[1] + x[0] * y[2] + x[2] * y[0] + (t >> 16);
  s[2] = t & 0xffff;
  x[0] = s[0];
  x[1] = s[1];
  x[2] = s[2];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sortp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L1
L22:
  movl   $0x0,-0x10(%rbp)
  jmp    L37
L39:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L31
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
L31:
  addl   $0x1,-0x10(%rbp)
L37:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L39
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  subl   $0x1,-0xc(%rbp)
L1:
  cmpl   $0x1,-0xc(%rbp)
  jg     L22
  nop
  nop
  leave
  ret
```

assistant: ```c
void sortp(char *str[], int n) {
  int maxpos = 0, i, size;
  char *tmp;
  for (size = n; size > 1; size--) {
    for (i = 0; i < size; i++)
      if (strcmp(str[i], str[maxpos]) > 0)
        maxpos = i;
    tmp = str[maxpos];
    str[maxpos] = str[size - 1];
    str[size - 1] = tmp;
  }
}
```