ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r15
  lea    D27(%rip),%r14
  lea    D9(%rip),%r13
  jmp    L10
L16:
  test   %eax,%eax
  jle    L29
  movslq %eax,%rbx
  lea    -0x1(%rbx),%r12
  lea    -0x1(%rax),%eax
  sub    %rax,%r12
  mov    $0x0,%ebp
L13:
  lea    0x10(%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %rbx,%rax
  imul   0x10(%rsp),%rax
  add    %rax,%rbp
  sub    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L13
L37:
  mov    %rbp,%rsi
  imul   (%rsp),%rsi
  lea    D20(%rip),%rdi
  call   <printf@plt>
L10:
  lea    0x8(%rsp),%rsi
  mov    %r15,%rdx
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    0x8(%rsp),%rax
  cmp    $0xffffffffffffffff,%rax
  jne    L16
  cmpq   $0xffffffffffffffff,(%rsp)
  je     L73
  mov    $0x0,%ebp
  jmp    L37
L29:
  mov    $0x0,%ebp
  jmp    L37
L73:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  mov    $0x0,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D27
datatype: string
name: unpack_data
arguments: tag: D9
datatype: string
name: unpack_data
arguments: tag: D20
datatype: string

tool: D27: %lld%lld

tool: D9: %lld

tool: D20: %lld


assistant: ```c
int main() {
  long long int m, n, sum = 0, x;
  int i;
  while (1) {
    sum = 0;
    scanf("%lld%lld", &n, &m);
    if (n == -1 && m == -1)
      break;
    for (i = n; i >= 1; i--) {
      scanf("%lld", &x);
      sum += (x * i);
    }
    sum *= m;
    printf("%lld\n", sum);
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    D24(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  lea    0x20(%rsp),%r13
  mov    %rax,0x8(%rsp)
  lea    0x18(%rsp),%rax
  mov    %rax,(%rsp)
  nopl   0x0(%rax)
L40:
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x18(%rsp),%rax
  cmp    $0xffffffffffffffff,%rax
  je     L12
  test   %eax,%eax
  jle    L45
  movslq %eax,%r15
  sub    $0x1,%eax
  xor    %ebx,%ebx
  lea    -0x1(%r15),%r14
  mov    %r14,%rbp
  sub    %rax,%rbp
  jmp    L42
  nopw   0x0(%rax,%rax,1)
L24:
  sub    $0x1,%r14
L42:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x20(%rsp),%rdx
  imul   %r15,%rdx
  mov    %r14,%r15
  add    %rdx,%rbx
  cmp    %rbp,%r14
  jne    L24
  imul   0x10(%rsp),%rbx
  mov    %rbx,%rsi
L65:
  lea    D23(%rip),%rdi
  call   <printf@plt>
  jmp    L40
  nopl   0x0(%rax)
L12:
  cmpq   $0xffffffffffffffff,0x10(%rsp)
  je     L35
L45:
  xor    %esi,%esi
  jmp    L65
L35:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D24
type_guessed: string
name: retrieve_data
arguments: data_tag: D5
type_guessed: string
name: retrieve_data
arguments: data_tag: D23
type_guessed: string

tool: D24: %lld

tool: D5: %lld%lld

tool: D23: %lld


assistant: ```c
int main() {
  long long int m, n, sum = 0, x;
  int i;
  while (1) {
    sum = 0;
    scanf("%lld%lld", &n, &m);
    if (n == -1 && m == -1)
      break;
    for (i = n; i >= 1; i--) {
      scanf("%lld", &x);
      sum += (x * i);
    }
    sum *= m;
    printf("%lld\n", sum);
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    D17(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  lea    0x20(%rsp),%r13
  mov    %rax,0x8(%rsp)
  lea    0x18(%rsp),%rax
  mov    %rax,(%rsp)
  nopl   0x0(%rax)
L23:
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  lea    D22(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x18(%rsp),%rax
  cmp    $0xffffffffffffffff,%rax
  je     L1
  test   %eax,%eax
  jle    L67
  movslq %eax,%r15
  sub    $0x1,%eax
  xor    %ebx,%ebx
  lea    -0x1(%r15),%r14
  mov    %r14,%rbp
  sub    %rax,%rbp
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L5:
  sub    $0x1,%r14
L74:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x20(%rsp),%rdx
  imul   %r15,%rdx
  mov    %r14,%r15
  add    %rdx,%rbx
  cmp    %rbp,%r14
  jne    L5
  imul   0x10(%rsp),%rbx
  mov    %rbx,%rsi
L0:
  lea    D11(%rip),%rdi
  call   <printf@plt>
  jmp    L23
  nopl   0x0(%rax)
L1:
  cmpq   $0xffffffffffffffff,0x10(%rsp)
  je     L19
L67:
  xor    %esi,%esi
  jmp    L0
L19:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D17
type_guessed: string
name: read_data
arguments: data_tag: D22
type_guessed: string
name: read_data
arguments: data_tag: D11
type_guessed: string

tool: D17: %lld

tool: D22: %lld%lld

tool: D11: %lld


assistant: ```c
int main() {
  long long int m, n, sum = 0, x;
  int i;
  while (1) {
    sum = 0;
    scanf("%lld%lld", &n, &m);
    if (n == -1 && m == -1)
      break;
    for (i = n; i >= 1; i--) {
      scanf("%lld", &x);
      sum += (x * i);
    }
    sum *= m;
    printf("%lld\n", sum);
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<memcpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L15
L16:
  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)
L15:
  mov    -0x28(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  test   %rax,%rax
  jne    L16
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
void *memcpy(void *restrict whither, const void *restrict whence, size_t size) {
  char *d = whither;
  const char *s = whence;
  while (size--)
    *d++ = *s++;
  return whither;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<memcpy>:
  endbr64
  mov    %rdi,%rax
  test   %rdx,%rdx
  je     L1
  mov    $0x0,%ecx
L0:
  movzbl (%rsi,%rcx,1),%r8d
  mov    %r8b,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rdx,%rcx
  jne    L0
L1:
  ret
```

assistant: ```c
void *memcpy(void *restrict whither, const void *restrict whence, size_t size) {
  char *d = whither;
  const char *s = whence;
  while (size--)
    *d++ = *s++;
  return whither;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<memcpy>:
  endbr64
  test   %rdx,%rdx
  je     L4
  sub    $0x8,%rsp
  call   <memcpy@plt>
  add    $0x8,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L4:
  mov    %rdi,%rax
  ret
```

assistant: ```c
void *memcpy(void *restrict whither, const void *restrict whence, size_t size) {
  char *d = whither;
  const char *s = whence;
  while (size--)
    *d++ = *s++;
  return whither;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<memcpy>:
  endbr64
  test   %rdx,%rdx
  je     L9
  sub    $0x8,%rsp
  call   <memcpy@plt>
  add    $0x8,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L9:
  mov    %rdi,%rax
  ret
```

assistant: ```c
void *memcpy(void *restrict whither, const void *restrict whence, size_t size) {
  char *d = whither;
  const char *s = whence;
  while (size--)
    *d++ = *s++;
  return whither;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    D13(%rip),%rax
  mov    (%rax),%edx
  mov    D16(%rip),%rax
  mov    (%rax),%eax
  mov    $0x0,%ecx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <setvbuf@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <main_example@plt>
  leave
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  return main_example(argc, argv);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    $0x0,%ecx
  mov    D10(%rip),%rax
  mov    (%rax),%edx
  mov    $0x0,%esi
  mov    D12(%rip),%rax
  mov    (%rax),%edi
  call   <setvbuf@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <main_example@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  return main_example(argc, argv);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %r12
  xor    %ecx,%ecx
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  mov    D0(%rip),%rax
  mov    (%rax),%edx
  mov    D9(%rip),%rax
  mov    (%rax),%edi
  call   <setvbuf@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <main_example@plt>
```

assistant: ```c
int main(int argc, char *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  return main_example(argc, argv);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r12
  xor    %ecx,%ecx
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  mov    %edi,%ebp
  sub    $0x8,%rsp
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <setvbuf@plt>
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <main_example@plt>
```

assistant: ```c
int main(int argc, char *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  return main_example(argc, argv);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<readline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movq   $0x1,-0x20(%rbp)
  jmp    L15
L61:
  nop
L94:
  lea    -0x21(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x1,-0x10(%rbp)
  jne    L103
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl -0x21(%rbp),%edx
  mov    %dl,(%rax)
  movzbl -0x21(%rbp),%eax
  cmp    $0xa,%al
  jne    L82
  jmp    L40
L103:
  cmpq   $0x0,-0x10(%rbp)
  jne    L92
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  jmp    L25
L92:
  mov    D6(%rip),%rax
  mov    (%rax),%rdx
  mov    D12(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L14
  jmp    L94
L14:
  mov    $0xffffffffffffffff,%rax
  jmp    L25
L82:
  addq   $0x1,-0x20(%rbp)
L15:
  mov    -0x20(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jb     L61
L40:
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
L25:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  leave
  ret
```

assistant: ```c
ssize_t readline(int fd, void *vptr, size_t maxlen) {
  ssize_t n, rc;
  char c, *ptr;
  ptr = vptr;
  for (n = 1; n < maxlen; n++) {
  again:
    if ((rc = read(fd, &c, 1)) == 1) {
      *ptr++ = c;
      if (c == '\n')
        break;
    } else if (rc == 0) {
      *ptr = 0;
      return (n - 1);
    } else {
      if (errno == EINTR)
        goto again;
      return -1;
    }
  }
  *ptr = 0;
  return n;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<readline>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%rdx
  jbe    L43
  mov    %edi,%ebx
  lea    -0x1(%rsi,%rdx,1),%r14
  mov    $0x1,%r13d
  lea    0x7(%rsp),%rbp
L70:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <read@plt>
  cmp    $0x1,%rax
  je     L7
  test   %rax,%rax
  je     L71
  mov    D4(%rip),%rdx
  mov    D0(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L70
  mov    $0xffffffffffffffff,%r13
  jmp    L15
L7:
  add    $0x1,%r12
  movzbl 0x7(%rsp),%eax
  mov    %al,-0x1(%r12)
  cmp    $0xa,%al
  je     L16
  add    $0x1,%r13
  cmp    %r14,%r12
  jne    L70
  mov    %r14,%r12
  jmp    L16
L71:
  movb   $0x0,(%r12)
  sub    $0x1,%r13
L15:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L77
  mov    %r13,%rax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L43:
  mov    $0x1,%r13d
L16:
  movb   $0x0,(%r12)
  jmp    L15
L77:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t readline(int fd, void *vptr, size_t maxlen) {
  ssize_t n, rc;
  char c, *ptr;
  ptr = vptr;
  for (n = 1; n < maxlen; n++) {
  again:
    if ((rc = read(fd, &c, 1)) == 1) {
      *ptr++ = c;
      if (c == '\n')
        break;
    } else if (rc == 0) {
      *ptr = 0;
      return (n - 1);
    } else {
      if (errno == EINTR)
        goto again;
      return -1;
    }
  }
  *ptr = 0;
  return n;
}
```
user: What is the c source code of the assembly code below?

```asm
<readline>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%rdx
  jbe    L73
  mov    %edi,%ebx
  lea    -0x1(%rsi,%rdx,1),%r14
  mov    $0x1,%r13d
  lea    0x7(%rsp),%rbp
  jmp    L11
  nopl   0x0(%rax)
L20:
  test   %rax,%rax
  je     L38
  mov    D9(%rip),%rax
  mov    D8(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L8
L11:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <read@plt>
  cmp    $0x1,%rax
  jne    L20
  movzbl 0x7(%rsp),%eax
  add    $0x1,%r12
  mov    %al,-0x1(%r12)
  cmp    $0xa,%al
  je     L41
  add    $0x1,%r13
  cmp    %r14,%r12
  jne    L11
L41:
  movb   $0x0,(%r12)
  jmp    L84
  nopw   0x0(%rax,%rax,1)
L38:
  movb   $0x0,(%r12)
  sub    $0x1,%r13
L84:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L91
  add    $0x10,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L8:
  mov    $0xffffffffffffffff,%r13
  jmp    L84
L73:
  mov    $0x1,%r13d
  jmp    L41
L91:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t readline(int fd, void *vptr, size_t maxlen) {
  ssize_t n, rc;
  char c, *ptr;
  ptr = vptr;
  for (n = 1; n < maxlen; n++) {
  again:
    if ((rc = read(fd, &c, 1)) == 1) {
      *ptr++ = c;
      if (c == '\n')
        break;
    } else if (rc == 0) {
      *ptr = 0;
      return (n - 1);
    } else {
      if (errno == EINTR)
        goto again;
      return -1;
    }
  }
  *ptr = 0;
  return n;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<readline>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%rdx
  jbe    L10
  mov    %edi,%ebx
  lea    -0x1(%rsi,%rdx,1),%r14
  mov    $0x1,%r13d
  lea    0x7(%rsp),%rbp
  jmp    L103
  nopl   0x0(%rax)
L108:
  test   %rax,%rax
  je     L6
  mov    D9(%rip),%rax
  mov    D4(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  jne    L96
L103:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <read@plt>
  cmp    $0x1,%rax
  jne    L108
  movzbl 0x7(%rsp),%eax
  add    $0x1,%r12
  mov    %al,-0x1(%r12)
  cmp    $0xa,%al
  je     L41
  add    $0x1,%r13
  cmp    %r14,%r12
  jne    L103
L41:
  movb   $0x0,(%r12)
  jmp    L11
  nopw   0x0(%rax,%rax,1)
L6:
  movb   $0x0,(%r12)
  sub    $0x1,%r13
L11:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  add    $0x10,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L96:
  mov    $0xffffffffffffffff,%r13
  jmp    L11
L10:
  mov    $0x1,%r13d
  jmp    L41
L12:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
ssize_t readline(int fd, void *vptr, size_t maxlen) {
  ssize_t n, rc;
  char c, *ptr;
  ptr = vptr;
  for (n = 1; n < maxlen; n++) {
  again:
    if ((rc = read(fd, &c, 1)) == 1) {
      *ptr++ = c;
      if (c == '\n')
        break;
    } else if (rc == 0) {
      *ptr = 0;
      return (n - 1);
    } else {
      if (errno == EINTR)
        goto again;
      return -1;
    }
  }
  *ptr = 0;
  return n;
}
```
user: Translate the below assembly code into C programming language:

```asm
<cl_fill>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %ecx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    %r9,-0x30(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x10(%rbp)
  jmp    L6
L19:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L14
L3:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x10(%rbp),%eax
  imul   -0x1c(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L14:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L3
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L6:
  mov    -0x10(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L19
  nop
  nop
  leave
  ret
```

assistant: ```c
void cl_fill(int l, int nfunc, int ntheta, int lmax, const double *wigd, double *out_cl, const double *in_cf) {
  int f, i;
  double cl;
  assert(l <= lmax);
  for (f = 0; f < nfunc; f++) {
    cl = 0.0;
    for (i = 0; i < ntheta; i++)
      cl += wigd[i] * in_cf[f * ntheta + i];
    out_cl[f * (lmax + 1) + l] = cl;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<cl_fill>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r14d
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %ecx,%r15d
  mov    %r8,%rbx
  mov    %r9,0x8(%rsp)
  mov    0x50(%rsp),%r13
  cmp    %ecx,%edi
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r12d,%r12d
  jle    L21
  movslq %r15d,%r15
  lea    0x8(,%r15,8),%r9
  movslq %r14d,%r14
  mov    0x8(%rsp),%rax
  lea    (%rax,%r14,8),%rdi
  mov    $0x0,%r8d
  mov    $0x0,%esi
  mov    %ebp,%ecx
  jmp    L25
L26:
  movslq %r8d,%rax
  lea    0x0(%r13,%rax,8),%rdx
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L41:
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L41
L12:
  movsd  %xmm1,(%rdi)
  add    $0x1,%esi
  add    %r9,%rdi
  add    %ebp,%r8d
  cmp    %esi,%r12d
  je     L21
L25:
  pxor   %xmm1,%xmm1
  test   %ebp,%ebp
  jg     L26
  jmp    L12
L21:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void cl_fill(int l, int nfunc, int ntheta, int lmax, const double *wigd, double *out_cl, const double *in_cf) {
  int f, i;
  double cl;
  assert(l <= lmax);
  for (f = 0; f < nfunc; f++) {
    cl = 0.0;
    for (i = 0; i < ntheta; i++)
      cl += wigd[i] * in_cf[f * ntheta + i];
    out_cl[f * (lmax + 1) + l] = cl;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<cl_fill>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x18,%rsp
  cmp    %ecx,%edi
  setle  %dil
  mov    %r9,0x8(%rsp)
  mov    0x50(%rsp),%r13
  movzbl %dil,%edi
  call   <assert@plt>
  test   %ebp,%ebp
  jle    L3
  mov    0x8(%rsp),%rax
  lea    0x1(%r15),%r10d
  movslq %r14d,%r11
  xor    %r9d,%r9d
  movslq %r10d,%r10
  pxor   %xmm2,%xmm2
  lea    -0x1(%r12),%esi
  xor    %edi,%edi
  shl    $0x3,%r10
  lea    (%rax,%r11,8),%r8
  nopw   0x0(%rax,%rax,1)
L24:
  movapd %xmm2,%xmm1
  test   %r12d,%r12d
  jle    L23
  movslq %r9d,%rax
  movapd %xmm2,%xmm1
  lea    0x0(%r13,%rax,8),%rcx
  xor    %eax,%eax
  nop
L9:
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  mov    %rax,%rdx
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %rdx,%rsi
  jne    L9
L23:
  add    $0x1,%edi
  movsd  %xmm1,(%r8)
  add    %r12d,%r9d
  add    %r10,%r8
  cmp    %edi,%ebp
  jne    L24
L3:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void cl_fill(int l, int nfunc, int ntheta, int lmax, const double *wigd, double *out_cl, const double *in_cf) {
  int f, i;
  double cl;
  assert(l <= lmax);
  for (f = 0; f < nfunc; f++) {
    cl = 0.0;
    for (i = 0; i < ntheta; i++)
      cl += wigd[i] * in_cf[f * ntheta + i];
    out_cl[f * (lmax + 1) + l] = cl;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<cl_fill>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x18,%rsp
  cmp    %ecx,%edi
  setle  %dil
  mov    %r9,0x8(%rsp)
  mov    0x50(%rsp),%rbp
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r12d,%r12d
  jle    L48
  mov    0x8(%rsp),%rax
  movslq %r14d,%r11
  lea    0x1(%r15),%r10d
  mov    %r13d,%r9d
  movslq %r10d,%r10
  and    $0xfffffffe,%r9d
  xor    %ecx,%ecx
  xor    %edi,%edi
  lea    (%rax,%r11,8),%r8
  mov    %r13d,%eax
  shl    $0x3,%r10
  pxor   %xmm3,%xmm3
  shr    %eax
  lea    -0x1(%rax),%esi
  add    $0x1,%rsi
  shl    $0x4,%rsi
  nopl   0x0(%rax)
L17:
  movapd %xmm3,%xmm1
  test   %r13d,%r13d
  jle    L14
  cmp    $0x1,%r13d
  je     L40
  movslq %ecx,%rax
  movapd %xmm3,%xmm1
  lea    0x0(%rbp,%rax,8),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L8:
  movupd (%rdx,%rax,1),%xmm0
  movupd (%rbx,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L8
  movslq %r9d,%rax
  cmp    %r13d,%r9d
  je     L14
L25:
  lea    (%rcx,%rax,1),%edx
  movslq %edx,%rdx
  movsd  0x0(%rbp,%rdx,8),%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
L14:
  add    $0x1,%edi
  movsd  %xmm1,(%r8)
  add    %r13d,%ecx
  add    %r10,%r8
  cmp    %edi,%r12d
  jne    L17
L48:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L40:
  movapd %xmm3,%xmm1
  xor    %eax,%eax
  jmp    L25
```

assistant: ```c
void cl_fill(int l, int nfunc, int ntheta, int lmax, const double *wigd, double *out_cl, const double *in_cf) {
  int f, i;
  double cl;
  assert(l <= lmax);
  for (f = 0; f < nfunc; f++) {
    cl = 0.0;
    for (i = 0; i < ntheta; i++)
      cl += wigd[i] * in_cf[f * ntheta + i];
    out_cl[f * (lmax + 1) + l] = cl;
  }
}
```