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

```asm
<cos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movsd  %xmm0,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  fldl   -0x18(%rbp)
  fsincos
  fstpl  -0x18(%rbp)
  fstpl  -0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double cos(double x) {
  double sin;
  __asm__ __volatile__("fldl %2;"
                       "fsincos;"
                       "fstpl %1;"
                       "fstpl %0"
                       : "=m"(sin), "=m"(x)
                       : "m"(x));
  return x;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<cos>:
  endbr64
  sub    $0x28,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  fldl   0x8(%rsp)
  fsincos
  fstpl  0x8(%rsp)
  fstpl  0x10(%rsp)
  movsd  0x8(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x28,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
double cos(double x) {
  double sin;
  __asm__ __volatile__("fldl %2;"
                       "fsincos;"
                       "fstpl %1;"
                       "fstpl %0"
                       : "=m"(sin), "=m"(x)
                       : "m"(x));
  return x;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<cos>:
  endbr64
  sub    $0x28,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  fldl   0x8(%rsp)
  fsincos
  fstpl  0x8(%rsp)
  fstpl  0x10(%rsp)
  movsd  0x8(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x28,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
double cos(double x) {
  double sin;
  __asm__ __volatile__("fldl %2;"
                       "fsincos;"
                       "fstpl %1;"
                       "fstpl %0"
                       : "=m"(sin), "=m"(x)
                       : "m"(x));
  return x;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<cos>:
  endbr64
  sub    $0x28,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  fldl   0x8(%rsp)
  fsincos
  fstpl  0x8(%rsp)
  fstpl  0x10(%rsp)
  movsd  0x8(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x28,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
double cos(double x) {
  double sin;
  __asm__ __volatile__("fldl %2;"
                       "fsincos;"
                       "fstpl %1;"
                       "fstpl %0"
                       : "=m"(sin), "=m"(x)
                       : "m"(x));
  return x;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mul3div4>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  sar    $0x1f,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  and    $0x3,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  sar    $0x2,%eax
  pop    %rbp
  ret
```

assistant: ```c
int mul3div4(int x) {
  int mul3 = x + (x << 1);
  int mul3_mask = mul3 >> ((sizeof(int) << 3) - 1);
  int bias = mul3_mask & 3;
  return (mul3 + bias) >> 2;
}
```
user: What is the c source code of the assembly code below?

```asm
<mul3div4>:
  endbr64
  lea    (%rdi,%rdi,2),%edx
  mov    %edx,%eax
  sar    $0x1f,%eax
  and    $0x3,%eax
  add    %edx,%eax
  sar    $0x2,%eax
  ret
```

assistant: ```c
int mul3div4(int x) {
  int mul3 = x + (x << 1);
  int mul3_mask = mul3 >> ((sizeof(int) << 3) - 1);
  int bias = mul3_mask & 3;
  return (mul3 + bias) >> 2;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mul3div4>:
  endbr64
  lea    (%rdi,%rdi,2),%edx
  mov    %edx,%eax
  sar    $0x1f,%eax
  and    $0x3,%eax
  add    %edx,%eax
  sar    $0x2,%eax
  ret
```

assistant: ```c
int mul3div4(int x) {
  int mul3 = x + (x << 1);
  int mul3_mask = mul3 >> ((sizeof(int) << 3) - 1);
  int bias = mul3_mask & 3;
  return (mul3 + bias) >> 2;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x240,%rsp
  mov    %edi,-0x234(%rbp)
  mov    %rsi,-0x240(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x1,-0x234(%rbp)
  jle    L8
  mov    -0x240(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <chdir@plt>
  jmp    L8
L63:
  addq   $0x1,-0x220(%rbp)
  mov    -0x220(%rbp),%rax
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x218(%rbp)
  cmpq   $0x0,-0x218(%rbp)
  je     L44
  mov    -0x218(%rbp),%rax
  movb   $0x0,(%rax)
L44:
  lea    -0x224(%rbp),%rdx
  mov    -0x220(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <lstat@plt>
  test   %eax,%eax
  jne    L8
  mov    -0x224(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L8
  mov    -0x220(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L8:
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  lea    -0x210(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L62
  lea    -0x210(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x220(%rbp)
  cmpq   $0x0,-0x220(%rbp)
  jne    L63
L62:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L45
  call   <__stack_chk_fail@plt>
L45:
  leave
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  char *fn, buf[512], *n;
  struct stat st;
  if (argc > 1)
    chdir(argv[1]);
  while (fgets(buf, 512, stdin) != NULL && (fn = strchr(buf, ' ')) != NULL) {
    if ((n = strchr(++fn, '\n')) != NULL)
      *n = '\0';
    if (!lstat(fn, &st) && S_ISREG(st.st_mode))
      puts(fn);
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jg     L88
L7:
  mov    D1(%rip),%rbp
  jmp    L102
L88:
  mov    0x8(%rsi),%rdi
  call   <chdir@plt>
  jmp    L7
L46:
  movb   $0x0,(%rax)
L21:
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  call   <lstat@plt>
  test   %eax,%eax
  je     L94
L102:
  lea    0x10(%rsp),%rdi
  mov    0x0(%rbp),%edx
  mov    $0x200,%esi
  call   <fgets@plt>
  test   %rax,%rax
  je     L100
  lea    0x10(%rsp),%rdi
  mov    $0x20,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L100
  lea    0x1(%rax),%rbx
  mov    $0xa,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L46
  jmp    L21
L94:
  mov    0xc(%rsp),%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L102
  mov    %rbx,%rdi
  call   <puts@plt>
  jmp    L102
L100:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    $0x0,%eax
  add    $0x228,%rsp
  pop    %rbx
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(int argc, char **argv) {
  char *fn, buf[512], *n;
  struct stat st;
  if (argc > 1)
    chdir(argv[1]);
  while (fgets(buf, 512, stdin) != NULL && (fn = strchr(buf, ' ')) != NULL) {
    if ((n = strchr(++fn, '\n')) != NULL)
      *n = '\0';
    if (!lstat(fn, &st) && S_ISREG(st.st_mode))
      puts(fn);
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L23
  mov    0x8(%rsi),%rdi
  call   <chdir@plt>
L23:
  mov    D7(%rip),%r12
  lea    0x10(%rsp),%rbx
  lea    0xc(%rsp),%r13
  jmp    L7
  nopl   (%rax)
L83:
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L88
  lea    0x1(%rax),%rbp
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L70
  movb   $0x0,(%rax)
L70:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <lstat@plt>
  test   %eax,%eax
  je     L80
L7:
  mov    (%r12),%edx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L83
L88:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L47
  add    $0x228,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L80:
  mov    0xc(%rsp),%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L7
  mov    %rbp,%rdi
  call   <puts@plt>
  jmp    L7
L47:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(int argc, char **argv) {
  char *fn, buf[512], *n;
  struct stat st;
  if (argc > 1)
    chdir(argv[1]);
  while (fgets(buf, 512, stdin) != NULL && (fn = strchr(buf, ' ')) != NULL) {
    if ((n = strchr(++fn, '\n')) != NULL)
      *n = '\0';
    if (!lstat(fn, &st) && S_ISREG(st.st_mode))
      puts(fn);
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L88
  mov    0x8(%rsi),%rdi
  call   <chdir@plt>
L88:
  mov    D3(%rip),%r12
  lea    0x10(%rsp),%rbx
  lea    0xc(%rsp),%r13
  jmp    L83
  nopl   (%rax)
L49:
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L36
  lea    0x1(%rax),%rbp
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L73
  movb   $0x0,(%rax)
L73:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <lstat@plt>
  test   %eax,%eax
  je     L23
L83:
  mov    (%r12),%edx
  mov    $0x200,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L49
L36:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L67
  add    $0x228,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L23:
  mov    0xc(%rsp),%edi
  call   <S_ISREG@plt>
  test   %rax,%rax
  je     L83
  mov    %rbp,%rdi
  call   <puts@plt>
  jmp    L83
L67:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main(int argc, char **argv) {
  char *fn, buf[512], *n;
  struct stat st;
  if (argc > 1)
    chdir(argv[1]);
  while (fgets(buf, 512, stdin) != NULL && (fn = strchr(buf, ' ')) != NULL) {
    if ((n = strchr(++fn, '\n')) != NULL)
      *n = '\0';
    if (!lstat(fn, &st) && S_ISREG(st.st_mode))
      puts(fn);
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<lib_mod_event>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    %r9,-0x30(%rbp)
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int lib_mod_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) {
  ;
  ;
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<lib_mod_event>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
int lib_mod_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) {
  ;
  ;
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<lib_mod_event>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int lib_mod_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) {
  ;
  ;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<lib_mod_event>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int lib_mod_event(struct mod *mod, int msg, long param1, long param2, long param3, long param4) {
  ;
  ;
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<reverseStack>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <isEmpty@plt>
  test   %rax,%rax
  jne    L11
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <pop@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <reverseStack>
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <insertAtBottom@plt>
  jmp    L13
L11:
  nop
L13:
  leave
  ret
```

assistant: ```c
void reverseStack(struct stack *stack) {
  if (isEmpty(stack))
    return;
  int top = pop(stack);
  reverseStack(stack);
  insertAtBottom(stack, top);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<reverseStack>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  call   <isEmpty@plt>
  test   %rax,%rax
  je     L2
L14:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L2:
  mov    %rbx,%rdi
  call   <pop@plt>
  mov    %eax,%ebp
  mov    %rbx,%rdi
  call   <reverseStack>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <insertAtBottom@plt>
  jmp    L14
```

assistant: ```c
void reverseStack(struct stack *stack) {
  if (isEmpty(stack))
    return;
  int top = pop(stack);
  reverseStack(stack);
  insertAtBottom(stack, top);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<reverseStack>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  call   <isEmpty@plt>
  test   %rax,%rax
  je     L26
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L26:
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <isEmpty@plt>
  test   %rax,%rax
  jne    L12
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <isEmpty@plt>
  test   %rax,%rax
  je     L43
L13:
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
L12:
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <insertAtBottom@plt>
  nopw   0x0(%rax,%rax,1)
L43:
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r14d
  call   <isEmpty@plt>
  test   %rax,%rax
  jne    L41
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <reverseStack>
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
L41:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
  jmp    L13
```

assistant: ```c
void reverseStack(struct stack *stack) {
  if (isEmpty(stack))
    return;
  int top = pop(stack);
  reverseStack(stack);
  insertAtBottom(stack, top);
}
```
user: Translate the below assembly code into C programming language:

```asm
<reverseStack>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  call   <isEmpty@plt>
  test   %rax,%rax
  je     L6
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L6:
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r12d
  call   <isEmpty@plt>
  test   %rax,%rax
  jne    L29
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <isEmpty@plt>
  test   %rax,%rax
  je     L32
L38:
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
L29:
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <insertAtBottom@plt>
  nopw   0x0(%rax,%rax,1)
L32:
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r14d
  call   <isEmpty@plt>
  test   %rax,%rax
  jne    L21
  mov    %rbp,%rdi
  call   <pop@plt>
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <reverseStack>
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
L21:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <insertAtBottom@plt>
  jmp    L38
```

assistant: ```c
void reverseStack(struct stack *stack) {
  if (isEmpty(stack))
    return;
  int top = pop(stack);
  reverseStack(stack);
  insertAtBottom(stack, top);
}
```
user: What is the c source code of the assembly code below:

```asm
<getWord>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L44
L41:
  addl   $0x1,-0xc(%rbp)
L44:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jge    L59
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L41
L59:
  movl   $0x0,-0x8(%rbp)
  jmp    L21
L56:
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
L21:
  mov    -0x8(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L51
  mov    -0x8(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x4(%rbp)
  jle    L51
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L56
L51:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  leave
  ret
```

assistant: ```c
int getWord(char *dst, const char *str, int limit) {
  int i, j, len = strlen(str);
  for (i = 0; i < len && isspace(str[i]); i++)
    ;
  for (j = 0; j < limit && (j + i) < len && !isspace(str[i + j]); j++)
    dst[j] = str[i + j];
  dst[j] = '\0';
  return i + j;
}
```
user: Translate the below assembly code into C programming language:

```asm
<getWord>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r12
  mov    %edx,%r13d
  mov    %rsi,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L114
  mov    %eax,%r15d
  mov    %r12,%rbx
  mov    $0x0,%ebp
L79:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L115
  add    $0x1,%ebp
  add    $0x1,%rbx
  cmp    %ebp,%r15d
  jne    L79
L41:
  mov    %r15d,%ebp
  mov    $0x0,%r13d
L107:
  movslq %r13d,%rax
  movb   $0x0,(%r14,%rax,1)
  lea    0x0(%rbp,%r13,1),%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  test   %r13d,%r13d
  jle    L24
  cmp    %ebp,%r15d
  jle    L48
  sub    $0x1,%r15d
  sub    %ebp,%r15d
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%ebx
  movslq %ebp,%rax
  add    %rax,%r12
L13:
  mov    %ebx,%r13d
  movsbl (%r12,%rbx,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L107
  movzbl (%r12,%rbx,1),%eax
  mov    %al,(%r14,%rbx,1)
  lea    0x1(%rbx),%r13d
  cmp    0x8(%rsp),%rbx
  je     L107
  lea    0x1(%rbx),%rax
  cmp    %r15,%rbx
  je     L107
  mov    %rax,%rbx
  jmp    L13
L24:
  mov    $0x0,%r13d
  jmp    L107
L48:
  mov    $0x0,%r13d
  jmp    L107
L114:
  mov    $0x0,%r15d
  jmp    L41
```

assistant: ```c
int getWord(char *dst, const char *str, int limit) {
  int i, j, len = strlen(str);
  for (i = 0; i < len && isspace(str[i]); i++)
    ;
  for (j = 0; j < limit && (j + i) < len && !isspace(str[i + j]); j++)
    dst[j] = str[i + j];
  dst[j] = '\0';
  return i + j;
}
```
user: What is the c source code of the assembly code below?

```asm
<getWord>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rdi
  mov    %edx,(%rsp)
  call   <strlen@plt>
  test   %eax,%eax
  jle    L86
  mov    %eax,%r14d
  mov    %r12,%rbx
  xor    %ebp,%ebp
  jmp    L82
  nopw   0x0(%rax,%rax,1)
L93:
  add    $0x1,%ebp
  add    $0x1,%rbx
  cmp    %ebp,%r14d
  je     L86
L82:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L93
  mov    (%rsp),%eax
  test   %eax,%eax
  jle    L120
  cmp    %ebp,%r14d
  jle    L120
  lea    0x1(%rbp),%ebx
  sub    %ebp,%r14d
  mov    0x8(%rsp),%r15
  xor    %r13d,%r13d
  mov    %r14d,0x4(%rsp)
  movslq %ebx,%rbx
  jmp    L58
  nopl   (%rax)
L43:
  movzbl -0x1(%r12,%rbx,1),%eax
  add    $0x1,%r13d
  mov    %ebx,%r14d
  mov    %al,(%r15)
  cmp    %r13d,(%rsp)
  je     L103
  add    $0x1,%rbx
  add    $0x1,%r15
  cmp    %r13d,0x4(%rsp)
  je     L128
L58:
  movsbl -0x1(%r12,%rbx,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L43
  mov    %r15,0x8(%rsp)
  lea    0x0(%rbp,%r13,1),%r14d
L86:
  mov    0x8(%rsp),%rax
  movb   $0x0,(%rax)
  add    $0x18,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L103:
  movslq (%rsp),%r13
  add    %r13,0x8(%rsp)
  jmp    L86
  nopl   0x0(%rax,%rax,1)
L128:
  movslq 0x4(%rsp),%r15
  add    %r15,0x8(%rsp)
  jmp    L86
L120:
  mov    %ebp,%r14d
  jmp    L86
```

assistant: ```c
int getWord(char *dst, const char *str, int limit) {
  int i, j, len = strlen(str);
  for (i = 0; i < len && isspace(str[i]); i++)
    ;
  for (j = 0; j < limit && (j + i) < len && !isspace(str[i + j]); j++)
    dst[j] = str[i + j];
  dst[j] = '\0';
  return i + j;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<getWord>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rdi
  mov    %edx,(%rsp)
  call   <strlen@plt>
  test   %eax,%eax
  jle    L58
  mov    %eax,%r14d
  mov    %r12,%rbx
  xor    %ebp,%ebp
  jmp    L100
  nopw   0x0(%rax,%rax,1)
L62:
  add    $0x1,%ebp
  add    $0x1,%rbx
  cmp    %ebp,%r14d
  je     L58
L100:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L62
  mov    (%rsp),%eax
  test   %eax,%eax
  jle    L118
  cmp    %ebp,%r14d
  jle    L118
  lea    0x1(%rbp),%ebx
  sub    %ebp,%r14d
  mov    0x8(%rsp),%r15
  xor    %r13d,%r13d
  mov    %r14d,0x4(%rsp)
  movslq %ebx,%rbx
  jmp    L49
  nopl   (%rax)
L47:
  movzbl -0x1(%r12,%rbx,1),%eax
  add    $0x1,%r13d
  mov    %ebx,%r14d
  mov    %al,(%r15)
  cmp    %r13d,(%rsp)
  je     L68
  add    $0x1,%rbx
  add    $0x1,%r15
  cmp    %r13d,0x4(%rsp)
  je     L14
L49:
  movsbl -0x1(%r12,%rbx,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L47
  mov    %r15,0x8(%rsp)
  lea    0x0(%rbp,%r13,1),%r14d
L58:
  mov    0x8(%rsp),%rax
  movb   $0x0,(%rax)
  add    $0x18,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L68:
  movslq (%rsp),%r13
  add    %r13,0x8(%rsp)
  jmp    L58
  nopl   0x0(%rax,%rax,1)
L14:
  movslq 0x4(%rsp),%r15
  add    %r15,0x8(%rsp)
  jmp    L58
L118:
  mov    %ebp,%r14d
  jmp    L58
```

assistant: ```c
int getWord(char *dst, const char *str, int limit) {
  int i, j, len = strlen(str);
  for (i = 0; i < len && isspace(str[i]); i++)
    ;
  for (j = 0; j < limit && (j + i) < len && !isspace(str[i + j]); j++)
    dst[j] = str[i + j];
  dst[j] = '\0';
  return i + j;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<core_extend>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <core_nil@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  mov    $0x0,%eax
  call   <core_swap@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void core_extend(void) {
  core_nil();
  core_cons();
  core_cons();
  core_swap();
  core_cons();
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<core_extend>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <core_nil@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  mov    $0x0,%eax
  call   <core_swap@plt>
  mov    $0x0,%eax
  call   <core_cons@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void core_extend(void) {
  core_nil();
  core_cons();
  core_cons();
  core_swap();
  core_cons();
}
```