ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<setresuid>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    %edx,%edi
  push   %rbp
  mov    %esi,%ebp
  sub    $0x8,%rsp
  call   <setreuid@plt>
  test   %eax,%eax
  je     L3
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  add    $0x8,%rsp
  mov    %ebp,%esi
  mov    %r12d,%edi
  pop    %rbp
  pop    %r12
  jmp    1050 <setreuid@plt>
```

assistant: ```c
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  int rc;
  rc = setreuid(suid, euid);
  if (rc)
    return (rc);
  return (setreuid(ruid, euid));
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<setresuid>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    %edx,%edi
  push   %rbp
  mov    %esi,%ebp
  sub    $0x8,%rsp
  call   <setreuid@plt>
  test   %eax,%eax
  je     L3
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  add    $0x8,%rsp
  mov    %ebp,%esi
  mov    %r12d,%edi
  pop    %rbp
  pop    %r12
  jmp    1050 <setreuid@plt>
```

assistant: ```c
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
  int rc;
  rc = setreuid(suid, euid);
  if (rc)
    return (rc);
  return (setreuid(ruid, euid));
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<nchi_rndc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x24(%rbp)
  movsd  %xmm0,-0x30(%rbp)
  movsd  %xmm1,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L7
L13:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  movsd  -0x38(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <gennch@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0x14(%rbp)
L7:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L13
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void nchi_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = gennch(a, b);
}
```
user: Translate the below assembly code into C programming language:

```asm
<nchi_rndc>:
  endbr64
  test   %edi,%edi
  jle    L5
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movq   %xmm0,%rbp
  movq   %xmm1,%r12
  mov    %rsi,%rbx
  lea    -0x1(%rdi),%eax
  lea    0x8(%rsi,%rax,8),%r13
L7:
  movq   %r12,%xmm1
  movq   %rbp,%xmm0
  call   <gennch@plt>
  movsd  %xmm0,(%rbx)
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L7
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  ret
```

assistant: ```c
void nchi_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = gennch(a, b);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nchi_rndc>:
  endbr64
  test   %edi,%edi
  jle    L9
  push   %r14
  lea    -0x1(%rdi),%eax
  movq   %xmm0,%r14
  push   %rbp
  lea    0x8(%rsi,%rax,8),%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
L8:
  movq   %r14,%xmm0
  movsd  %xmm1,0x8(%rsp)
  add    $0x8,%rbx
  call   <gennch@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,-0x8(%rbx)
  cmp    %rbp,%rbx
  jne    L8
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r14
  ret
  nopl   (%rax)
L9:
  ret
```

assistant: ```c
void nchi_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = gennch(a, b);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<nchi_rndc>:
  endbr64
  test   %edi,%edi
  jle    L1
  push   %r14
  lea    -0x1(%rdi),%eax
  movq   %xmm0,%r14
  push   %rbp
  lea    0x8(%rsi,%rax,8),%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
L7:
  movq   %r14,%xmm0
  movsd  %xmm1,0x8(%rsp)
  add    $0x8,%rbx
  call   <gennch@plt>
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,-0x8(%rbx)
  cmp    %rbp,%rbx
  jne    L7
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r14
  ret
  nopl   (%rax)
L1:
  ret
```

assistant: ```c
void nchi_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = gennch(a, b);
}
```
user: Translate the below assembly code into C programming language:

```asm
<del_dvec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x8(%rbp)
  nop
  leave
  ret
```

assistant: ```c
void del_dvec(double *p) {
  free(p);
  p = NULL;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<del_dvec>:
  endbr64
  sub    $0x8,%rsp
  call   <free@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void del_dvec(double *p) {
  free(p);
  p = NULL;
}
```
user: Translate the below assembly code into C programming language:

```asm
<del_dvec>:
  endbr64
  jmp    1050 <free@plt>
```

assistant: ```c
void del_dvec(double *p) {
  free(p);
  p = NULL;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<del_dvec>:
  endbr64
  jmp    1050 <free@plt>
```

assistant: ```c
void del_dvec(double *p) {
  free(p);
  p = NULL;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<plndrm1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x18000(%rsp),%r11
L4:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L4
  sub    $0x6d0,%rsp
  mov    %rdi,-0x186c8(%rbp)
  mov    %esi,-0x186cc(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x186c8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x186b8(%rbp)
  movl   $0x0,-0x186bc(%rbp)
  jmp    L9
L20:
  mov    -0x186bc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x186c8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x186bc(%rbp),%eax
  cltq
  mov    %dl,-0x186b0(%rbp,%rax,1)
  addl   $0x1,-0x186bc(%rbp)
L9:
  mov    -0x186bc(%rbp),%eax
  cmp    -0x186cc(%rbp),%eax
  jl     L20
  mov    -0x186cc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x186bc(%rbp)
  jmp    L26
L46:
  mov    -0x186bc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x186c8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x186bc(%rbp),%edx
  lea    -0x1(%rdx),%ecx
  movzbl (%rax),%edx
  movslq %ecx,%rax
  mov    %dl,-0x186b0(%rbp,%rax,1)
  addl   $0x1,-0x186bc(%rbp)
L26:
  mov    -0x186bc(%rbp),%eax
  cmp    -0x186b8(%rbp),%eax
  jl     L46
  lea    -0x186b0(%rbp),%rax
  mov    %rax,%rdi
  call   <plndrm@plt>
  mov    %eax,-0x186b4(%rbp)
  mov    -0x186b4(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
int plndrm1(char a[], int l) {
  int i, len, p;
  char b[100006];
  len = strlen(a);
  for (i = 0; i < l; i++)
    b[i] = a[i];
  for (i = l + 1; i < len; i++)
    b[i - 1] = a[i];
  p = plndrm(b);
  return p;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<plndrm1>:
  endbr64
  push   %rbp
  push   %rbx
  lea    -0x18000(%rsp),%r11
L18:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L18
  sub    $0x6b8,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x186a8(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  test   %ebx,%ebx
  jle    L57
  mov    %ebx,%esi
  mov    $0x0,%edx
L9:
  movzbl 0x0(%rbp,%rdx,1),%ecx
  mov    %cl,(%rsp,%rdx,1)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L9
L57:
  lea    0x1(%rbx),%edx
  cmp    %edx,%eax
  jle    L52
  movslq %edx,%rdx
  lea    -0x1(%rsp),%rsi
L10:
  movzbl 0x0(%rbp,%rdx,1),%ecx
  mov    %cl,(%rsi,%rdx,1)
  add    $0x1,%rdx
  cmp    %edx,%eax
  jg     L10
L52:
  mov    %rsp,%rdi
  call   <plndrm@plt>
  mov    0x186a8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x186b8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int plndrm1(char a[], int l) {
  int i, len, p;
  char b[100006];
  len = strlen(a);
  for (i = 0; i < l; i++)
    b[i] = a[i];
  for (i = l + 1; i < len; i++)
    b[i - 1] = a[i];
  p = plndrm(b);
  return p;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<plndrm1>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x18000(%rsp),%r11
L23:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L23
  sub    $0x6b8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x186a8(%rsp)
  xor    %eax,%eax
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rsp,%r13
  call   <strlen@plt>
  mov    %eax,%r12d
  test   %ebp,%ebp
  jle    L34
  movslq %ebp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <memcpy@plt>
L34:
  lea    0x1(%rbp),%eax
  cmp    %eax,%r12d
  jle    L10
  sub    %ebp,%r12d
  cltq
  lea    -0x2(%r12),%edx
  lea    -0x1(%r13,%rax,1),%rdi
  add    $0x1,%rdx
  lea    (%rbx,%rax,1),%rsi
  call   <memcpy@plt>
L10:
  mov    %r13,%rdi
  call   <plndrm@plt>
  mov    0x186a8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x186b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int plndrm1(char a[], int l) {
  int i, len, p;
  char b[100006];
  len = strlen(a);
  for (i = 0; i < l; i++)
    b[i] = a[i];
  for (i = l + 1; i < len; i++)
    b[i - 1] = a[i];
  p = plndrm(b);
  return p;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<plndrm1>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x18000(%rsp),%r11
L8:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L8
  sub    $0x6b8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x186a8(%rsp)
  xor    %eax,%eax
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %rsp,%r13
  call   <strlen@plt>
  mov    %eax,%r12d
  test   %ebp,%ebp
  jle    L21
  movslq %ebp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <memcpy@plt>
L21:
  lea    0x1(%rbp),%eax
  cmp    %eax,%r12d
  jle    L28
  sub    %ebp,%r12d
  cltq
  lea    -0x2(%r12),%edx
  lea    -0x1(%r13,%rax,1),%rdi
  add    $0x1,%rdx
  lea    (%rbx,%rax,1),%rsi
  call   <memcpy@plt>
L28:
  mov    %r13,%rdi
  call   <plndrm@plt>
  mov    0x186a8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x186b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int plndrm1(char a[], int l) {
  int i, len, p;
  char b[100006];
  len = strlen(a);
  for (i = 0; i < l; i++)
    b[i] = a[i];
  for (i = l + 1; i < len; i++)
    b[i - 1] = a[i];
  p = plndrm(b);
  return p;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<writeHeader>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L18
L8:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x14(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <writeLine@plt>
  addl   $0x1,-0x4(%rbp)
L18:
  mov    -0x4(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L8
  nop
  nop
  leave
  ret
```

assistant: ```c
void writeHeader(int sfd, const char *header[], int sz) {
  int i;
  for (i = 0; i < sz; i++)
    writeLine(sfd, header[i], strlen(header[i]));
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<writeHeader>:
  endbr64
  test   %edx,%edx
  jle    L2
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %rsi,%rbx
  lea    -0x1(%rdx),%eax
  lea    0x8(%rsi,%rax,8),%r12
L1:
  mov    (%rbx),%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    (%rbx),%rsi
  mov    %ebp,%edi
  call   <writeLine@plt>
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L1
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  ret
```

assistant: ```c
void writeHeader(int sfd, const char *header[], int sz) {
  int i;
  for (i = 0; i < sz; i++)
    writeLine(sfd, header[i], strlen(header[i]));
}
```
user: Translate the below assembly code into C programming language:

```asm
<writeHeader>:
  endbr64
  test   %edx,%edx
  jle    L11
  lea    -0x1(%rdx),%eax
  push   %r12
  lea    0x8(%rsi,%rax,8),%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  nopl   0x0(%rax)
L9:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <strlen@plt>
  mov    -0x8(%rbx),%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <writeLine@plt>
  cmp    %r12,%rbx
  jne    L9
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  ret
```

assistant: ```c
void writeHeader(int sfd, const char *header[], int sz) {
  int i;
  for (i = 0; i < sz; i++)
    writeLine(sfd, header[i], strlen(header[i]));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<writeHeader>:
  endbr64
  test   %edx,%edx
  jle    L14
  lea    -0x1(%rdx),%eax
  push   %r12
  lea    0x8(%rsi,%rax,8),%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  nopl   0x0(%rax)
L5:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
  call   <strlen@plt>
  mov    -0x8(%rbx),%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <writeLine@plt>
  cmp    %r12,%rbx
  jne    L5
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L14:
  ret
```

assistant: ```c
void writeHeader(int sfd, const char *header[], int sz) {
  int i;
  for (i = 0; i < sz; i++)
    writeLine(sfd, header[i], strlen(header[i]));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<readdir_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    -0x18(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L22
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    (%rdx),%edx
  mov    %edx,(%rax)
L22:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L11
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  jmp    L16
L11:
  mov    $0x0,%eax
L16:
  leave
  ret
```

assistant: ```c
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  *result = readdir(dirp);
  if (*result)
    *entry = **result;
  return *result ? 0 : errno;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<readdir_r>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  call   <readdir@plt>
  mov    %rax,(%rbx)
  test   %rax,%rax
  je     L4
  mov    (%rax),%eax
  mov    %eax,0x0(%rbp)
  cmpq   $0x0,(%rbx)
  je     L4
  mov    $0x0,%eax
L6:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L4:
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  jmp    L6
```

assistant: ```c
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  *result = readdir(dirp);
  if (*result)
    *entry = **result;
  return *result ? 0 : errno;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<readdir_r>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  call   <readdir@plt>
  mov    %rax,(%rbx)
  test   %rax,%rax
  je     L6
  mov    (%rax),%eax
  mov    %eax,0x0(%rbp)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L6:
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  *result = readdir(dirp);
  if (*result)
    *entry = **result;
  return *result ? 0 : errno;
}
```
user: What is the c source code of the assembly code below?

```asm
<readdir_r>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  call   <readdir@plt>
  mov    %rax,(%rbx)
  test   %rax,%rax
  je     L4
  mov    (%rax),%eax
  mov    %eax,0x0(%rbp)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L4:
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  *result = readdir(dirp);
  if (*result)
    *entry = **result;
  return *result ? 0 : errno;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<key>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %esi,-0x8(%rbp)
  mov    %edx,-0xc(%rbp)
  mov    %al,-0x4(%rbp)
  movzbl -0x4(%rbp),%eax
  cmp    $0x1b,%eax
  je     L60
  cmp    $0x1b,%eax
  jl     L9
  cmp    $0x7a,%eax
  jg     L9
  cmp    $0x61,%eax
  jl     L9
  sub    $0x61,%eax
  cmp    $0x19,%eax
  ja     L9
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D15(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D15(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x0,%eax
  call   <set_brighten@plt>
  jmp    L107
  mov    $0x0,%eax
  call   <set_saturate@plt>
  jmp    L107
  mov    $0x0,%eax
  call   <set_contrast@plt>
  jmp    L107
  mov    $0x0,%eax
  call   <set_sharpen@plt>
  jmp    L107
  mov    $0x0,%eax
  call   <set_balance@plt>
  jmp    L107
  mov    $0x0,%eax
  call   <help@plt>
  jmp    L107
L60:
  mov    $0x0,%edi
  call   <exit@plt>
  nop
L107:
  mov    $0x0,%eax
  call   <glutPostRedisplay@plt>
  jmp    L99
L9:
  nop
L99:
  leave
  ret
```

assistant: ```c
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'b':
    set_brighten();
    break;
  case 's':
    set_saturate();
    break;
  case 'c':
    set_contrast();
    break;
  case 'z':
    set_sharpen();
    break;
  case 'a':
    set_balance();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    break;
  default:
    return;
  }
  glutPostRedisplay();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<key>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1b,%dil
  je     L80
  lea    -0x61(%rdi),%eax
  cmp    $0x19,%al
  ja     L56
  ja     L56
  movzbl %al,%edi
  lea    D5(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x0,%eax
  call   <set_brighten@plt>
L29:
  mov    $0x0,%eax
  call   <glutPostRedisplay@plt>
L56:
  add    $0x8,%rsp
  ret
  mov    $0x0,%eax
  call   <set_saturate@plt>
  jmp    L29
  mov    $0x0,%eax
  call   <set_contrast@plt>
  jmp    L29
  mov    $0x0,%eax
  call   <set_sharpen@plt>
  jmp    L29
  mov    $0x0,%eax
  call   <set_balance@plt>
  jmp    L29
  mov    $0x0,%eax
  call   <help@plt>
  jmp    L29
L80:
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L29
```

assistant: ```c
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'b':
    set_brighten();
    break;
  case 's':
    set_saturate();
    break;
  case 'c':
    set_contrast();
    break;
  case 'z':
    set_sharpen();
    break;
  case 'a':
    set_balance();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    break;
  default:
    return;
  }
  glutPostRedisplay();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<key>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1b,%dil
  je     L12
  sub    $0x61,%edi
  cmp    $0x19,%dil
  ja     L11
  lea    D6(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L11:
  add    $0x8,%rsp
  ret
  nopl   (%rax)
  xor    %eax,%eax
  call   <set_balance@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_brighten@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_contrast@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <help@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_saturate@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_sharpen@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
L12:
  xor    %edi,%edi
  call   <exit@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
```

assistant: ```c
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'b':
    set_brighten();
    break;
  case 's':
    set_saturate();
    break;
  case 'c':
    set_contrast();
    break;
  case 'z':
    set_sharpen();
    break;
  case 'a':
    set_balance();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    break;
  default:
    return;
  }
  glutPostRedisplay();
}
```
user: What is the c source code of the assembly code below:

```asm
<key>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1b,%dil
  je     L11
  sub    $0x61,%edi
  cmp    $0x19,%dil
  ja     L9
  lea    D5(%rip),%rdx
  movzbl %dil,%edi
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L9:
  add    $0x8,%rsp
  ret
  nopl   (%rax)
  xor    %eax,%eax
  call   <set_balance@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_brighten@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_contrast@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <help@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_saturate@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
  xor    %eax,%eax
  call   <set_sharpen@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
  nopw   0x0(%rax,%rax,1)
L11:
  xor    %edi,%edi
  call   <exit@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1100 <glutPostRedisplay@plt>
```

assistant: ```c
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'b':
    set_brighten();
    break;
  case 's':
    set_saturate();
    break;
  case 'c':
    set_contrast();
    break;
  case 'z':
    set_sharpen();
    break;
  case 'a':
    set_balance();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(0);
    break;
  default:
    return;
  }
  glutPostRedisplay();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<strcat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *strcat(char *destination, const char *source) {
  strcpy(destination + strlen(destination), source);
  return destination;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strcat>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  call   <strlen@plt>
  movslq %eax,%rdi
  add    %rbx,%rdi
  mov    %rbp,%rsi
  call   <strcpy@plt>
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char *strcat(char *destination, const char *source) {
  strcpy(destination + strlen(destination), source);
  return destination;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<strcat>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %rbp,%rsi
  movslq %eax,%rdi
  add    %r12,%rdi
  call   <strcpy@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strcat(char *destination, const char *source) {
  strcpy(destination + strlen(destination), source);
  return destination;
}
```