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

```asm
<main>:
  endbr64
  sub    $0x38,%rsp
  lea    D15(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  lea    D34(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%edx
  lea    0x10(%rsp),%rdi
  mov    $0xcccccccd,%r9d
  mov    %rdi,%rsi
  test   %edx,%edx
  jle    L33
  nopl   0x0(%rax,%rax,1)
L8:
  mov    %edx,%eax
  mov    %edx,%r8d
  add    $0x4,%rsi
  imul   %r9,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%r8d
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    %r8d,-0x4(%rsi)
  cmp    $0x9,%ecx
  jg     L8
  mov    %eax,0xc(%rsp)
L33:
  mov    %rdi,%rax
  lea    0x24(%rsp),%rcx
  mov    %rdi,%rdx
L14:
  mov    0x10(%rdx),%edi
  cmp    %edi,(%rax)
  jne    L17
  add    $0x4,%rax
  sub    $0x4,%rdx
  cmp    %rcx,%rax
  jne    L14
  lea    D17(%rip),%rdi
  call   <printf@plt>
  jmp    L43
L17:
  lea    D30(%rip),%rdi
  call   <printf@plt>
L43:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L56
  xor    %eax,%eax
  add    $0x38,%rsp
  ret
L56:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D15
datatype: string
name: retrieve_data
arguments: tag: D34
datatype: string
name: retrieve_data
arguments: tag: D17
datatype: string
name: retrieve_data
arguments: tag: D30
datatype: string

tool: D15: Please enter a number (maximum 5 digits):


tool: D34: %d

tool: D17: The reverse of the digits is the same


tool: D30: The reverse of the digits is NOT the same


assistant: ```c
int main() {
  int LEN = 5;
  int input_num, digits_array[LEN];
  int i;
  int reverse_index;
  printf("Please enter a number (maximum 5 digits):\n");
  scanf("%d", &input_num);
  while (input_num > 0) {
    digits_array[i] = input_num % 10;
    i++;
    input_num = input_num / 10;
  }
  for (i = 0; i < LEN; i++) {
    reverse_index = (LEN - 1) - i;
    if (digits_array[i] != digits_array[reverse_index])
      break;
  }
  if (i == LEN)
    printf("The reverse of the digits is the same\n");
  else
    printf("The reverse of the digits is NOT the same\n");
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  sub    $0x38,%rsp
  lea    D19(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  lea    D26(%rip),%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jle    L28
  lea    0x10(%rsp),%rsi
  mov    $0xcccccccd,%r8d
  nopl   0x0(%rax,%rax,1)
L14:
  mov    %edx,%eax
  mov    %edx,%edi
  add    $0x4,%rsi
  imul   %r8,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%edi
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    %edi,-0x4(%rsi)
  cmp    $0x9,%ecx
  jg     L14
  mov    %eax,0xc(%rsp)
L28:
  mov    0x20(%rsp),%eax
  cmp    %eax,0x10(%rsp)
  jne    L31
  mov    0x1c(%rsp),%eax
  cmp    %eax,0x14(%rsp)
  jne    L31
  lea    D17(%rip),%rdi
  call   <printf@plt>
L34:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L49
  xor    %eax,%eax
  add    $0x38,%rsp
  ret
L31:
  lea    D31(%rip),%rdi
  call   <printf@plt>
  jmp    L34
L49:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D19
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D26
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D17
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D31
type_guessed: string

tool: D19: Please enter a number (maximum 5 digits):


tool: D26: %d

tool: D17: The reverse of the digits is the same


tool: D31: The reverse of the digits is NOT the same


assistant: ```c
int main() {
  int LEN = 5;
  int input_num, digits_array[LEN];
  int i;
  int reverse_index;
  printf("Please enter a number (maximum 5 digits):\n");
  scanf("%d", &input_num);
  while (input_num > 0) {
    digits_array[i] = input_num % 10;
    i++;
    input_num = input_num / 10;
  }
  for (i = 0; i < LEN; i++) {
    reverse_index = (LEN - 1) - i;
    if (digits_array[i] != digits_array[reverse_index])
      break;
  }
  if (i == LEN)
    printf("The reverse of the digits is the same\n");
  else
    printf("The reverse of the digits is NOT the same\n");
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strlocase>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L12
L8:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L27
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jg     L27
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    0x20(%rax),%ecx
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L27:
  addl   $0x1,-0x14(%rbp)
L12:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rbx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %rax,%rbx
  jb     L8
  mov    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *strlocase(str)
char *str;
{
  int i;
  for (i = 0; i < strlen(str); i++) {
    if ((str[i] >= 'A' && str[i] <= 'Z')) {
      str[i] = str[i] - 'A' + 'a';
    }
  }
  return (str);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<strlocase>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    $0x0,%ebx
  jmp    L21
L7:
  add    $0x1,%rbx
L21:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  jbe    L27
  movzbl 0x0(%rbp,%rbx,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  ja     L7
  add    $0x20,%eax
  mov    %al,0x0(%rbp,%rbx,1)
  jmp    L7
L27:
  mov    %rbp,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
char *strlocase(str)
char *str;
{
  int i;
  for (i = 0; i < strlen(str); i++) {
    if ((str[i] >= 'A' && str[i] <= 'Z')) {
      str[i] = str[i] - 'A' + 'a';
    }
  }
  return (str);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<strlocase>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L24:
  movzbl (%r12,%rbx,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  ja     L6
  add    $0x20,%eax
  mov    %al,(%r12,%rbx,1)
L6:
  add    $0x1,%rbx
L10:
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  ja     L24
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
char *strlocase(str)
char *str;
{
  int i;
  for (i = 0; i < strlen(str); i++) {
    if ((str[i] >= 'A' && str[i] <= 'Z')) {
      str[i] = str[i] - 'A' + 'a';
    }
  }
  return (str);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<strlocase>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L16:
  movzbl (%r12,%rbx,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  ja     L20
  add    $0x20,%eax
  mov    %al,(%r12,%rbx,1)
L20:
  add    $0x1,%rbx
L1:
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    %rbx,%rax
  ja     L16
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  ret
```

assistant: ```c
char *strlocase(str)
char *str;
{
  int i;
  for (i = 0; i < strlen(str); i++) {
    if ((str[i] >= 'A' && str[i] <= 'Z')) {
      str[i] = str[i] - 'A' + 'a';
    }
  }
  return (str);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<__write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <gendep__register_write@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <real_write@plt>
  leave
  ret
```

assistant: ```c
ssize_t __write(int fd, __const void *buf, size_t count) {
  gendep__register_write(fd, buf, count);
  return (real_write(fd, buf, count));
}
```
user: What is the c source code of the assembly code below?

```asm
<__write>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  call   <gendep__register_write@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <real_write@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
ssize_t __write(int fd, __const void *buf, size_t count) {
  gendep__register_write(fd, buf, count);
  return (real_write(fd, buf, count));
}
```
user: What is the c source code of the assembly code below?

```asm
<__write>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  call   <gendep__register_write@plt>
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <real_write@plt>
```

assistant: ```c
ssize_t __write(int fd, __const void *buf, size_t count) {
  gendep__register_write(fd, buf, count);
  return (real_write(fd, buf, count));
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ehMaiscula>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  nop
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x4(%rbp)
  jge    L4
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L44
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jg     L44
  mov    $0x1,%eax
  jmp    L4
L44:
  mov    $0x0,%eax
  jmp    L4
L4:
  leave
  ret
```

assistant: ```c
ehMaiscula(char nome[]) {
  for (int i = 0; i < strlen(nome); i++) {
    if (nome[i] >= 'A' && nome[i] <= 'Z') {
      return 1;
    } else {
      return 0;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ehMaiscula>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L1
  movzbl (%rbx),%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  setbe  %al
  movzbl %al,%eax
L1:
  pop    %rbx
  ret
```

assistant: ```c
ehMaiscula(char nome[]) {
  for (int i = 0; i < strlen(nome); i++) {
    if (nome[i] >= 'A' && nome[i] <= 'Z') {
      return 1;
    } else {
      return 0;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ehMaiscula>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L5
  movzbl (%rbx),%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  setbe  %al
  movzbl %al,%eax
L5:
  pop    %rbx
  ret
```

assistant: ```c
ehMaiscula(char nome[]) {
  for (int i = 0; i < strlen(nome); i++) {
    if (nome[i] >= 'A' && nome[i] <= 'Z') {
      return 1;
    } else {
      return 0;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ehMaiscula>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L4
  movzbl (%rbx),%eax
  sub    $0x41,%eax
  cmp    $0x19,%al
  setbe  %al
  movzbl %al,%eax
L4:
  pop    %rbx
  ret
```

assistant: ```c
ehMaiscula(char nome[]) {
  for (int i = 0; i < strlen(nome); i++) {
    if (nome[i] >= 'A' && nome[i] <= 'Z') {
      return 1;
    } else {
      return 0;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<dt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,%eax
  mov    %al,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x18(%rbp),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  mov    -0x20(%rbp),%rax
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
  movsd  D41(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsbl -0x34(%rbp),%eax
  cmp    $0x72,%eax
  je     L35
  cmp    $0x72,%eax
  jg     L34
  cmp    $0x65,%eax
  je     L72
  cmp    $0x69,%eax
  jne    L34
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,D17(%rip)
  jmp    L48
L72:
  movsd  D17(%rip),%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,D53(%rip)
  jmp    L48
L35:
  movsd  D53(%rip),%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L48
L34:
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L48:
  movsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L51
  call   <__stack_chk_fail@plt>
L51:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D41
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D53
datatype: string

tool: {"D41": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

tool: D53: Invalid timing mode


assistant: ```c
double dt(char mode) {
  static double t_init;
  double t_now, delta_t;
  struct timeval tv;
  gettimeofday(&tv, 0);
  t_now = (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
  delta_t = 0.0;
  switch (mode) {
  case 'i':
    t_init = t_now;
    break;
  case 'e':
    delta_t = t_now - t_init;
    t_init = t_now;
    break;
  case 'r':
    delta_t = t_now - t_init;
    break;
  default:
    printf("Invalid timing mode\n");
  }
  return delta_t;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<is_ignored>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  je     L60
  cmpq   $0x0,-0x20(%rbp)
  jne    L42
L60:
  mov    $0x0,%eax
  jmp    L39
L42:
  movl   $0x0,-0x4(%rbp)
  jmp    L38
L58:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jne    L47
  mov    $0x1,%eax
  jmp    L39
L47:
  addl   $0x1,-0x4(%rbp)
L38:
  mov    -0x4(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L58
  mov    $0x0,%eax
L39:
  pop    %rbp
  ret
```

assistant: ```c
int is_ignored(int value, int *ignored, int ignoreAmount) {
  int i;
  if (ignoreAmount == 0 || ignored == NULL) {
    return 0;
  }
  for (i = 0; i < ignoreAmount; i++) {
    if (value == ignored[i]) {
      return 1;
    }
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<is_ignored>:
  endbr64
  mov    $0x0,%eax
  test   %rsi,%rsi
  je     L4
  test   %edx,%edx
  jle    L33
  mov    %rsi,%rax
  lea    -0x1(%rdx),%edx
  lea    0x4(%rsi,%rdx,4),%rdx
L37:
  cmp    %edi,(%rax)
  je     L14
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L37
  mov    $0x0,%eax
  ret
L33:
  mov    $0x0,%eax
  ret
L14:
  mov    $0x1,%eax
L4:
  ret
```

assistant: ```c
int is_ignored(int value, int *ignored, int ignoreAmount) {
  int i;
  if (ignoreAmount == 0 || ignored == NULL) {
    return 0;
  }
  for (i = 0; i < ignoreAmount; i++) {
    if (value == ignored[i]) {
      return 1;
    }
  }
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<is_ignored>:
  endbr64
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L10
  test   %edx,%edx
  jle    L10
  lea    -0x1(%rdx),%eax
  lea    0x4(%rsi,%rax,4),%rax
  jmp    L24
  nopl   0x0(%rax)
L16:
  add    $0x4,%rsi
  cmp    %rax,%rsi
  je     L40
L24:
  cmp    %edi,(%rsi)
  jne    L16
  mov    $0x1,%eax
L10:
  ret
  nopl   0x0(%rax,%rax,1)
L40:
  xor    %eax,%eax
  ret
```

assistant: ```c
int is_ignored(int value, int *ignored, int ignoreAmount) {
  int i;
  if (ignoreAmount == 0 || ignored == NULL) {
    return 0;
  }
  for (i = 0; i < ignoreAmount; i++) {
    if (value == ignored[i]) {
      return 1;
    }
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<is_ignored>:
  endbr64
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L9
  test   %edx,%edx
  jle    L9
  lea    -0x1(%rdx),%eax
  lea    0x4(%rsi,%rax,4),%rax
  jmp    L25
  nopl   0x0(%rax)
L8:
  add    $0x4,%rsi
  cmp    %rax,%rsi
  je     L17
L25:
  cmp    %edi,(%rsi)
  jne    L8
  mov    $0x1,%eax
L9:
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  xor    %eax,%eax
  ret
```

assistant: ```c
int is_ignored(int value, int *ignored, int ignoreAmount) {
  int i;
  if (ignoreAmount == 0 || ignored == NULL) {
    return 0;
  }
  for (i = 0; i < ignoreAmount; i++) {
    if (value == ignored[i]) {
      return 1;
    }
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fgetln>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  cmpq   $0x0,D128(%rip)
  je     L3
L8:
  mov    %r13,%rdx
  mov    D171(%rip),%rsi
  mov    D128(%rip),%rdi
  call   <fgets@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L20
  movq   $0x0,(%r12)
L37:
  mov    (%r12),%rdi
  add    D128(%rip),%rdi
  mov    $0xa,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L88
  mov    D81(%rip),%rax
  mov    (%rax),%rbp
  add    D171(%rip),%rbp
  mov    %rbp,%rsi
  mov    D128(%rip),%rdi
  call   <realloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L70
  mov    %rax,D89(%rip)
  add    D171(%rip),%rbx
  mov    %rbx,%rdi
  mov    %r13,%rdx
  mov    D81(%rip),%rax
  mov    (%rax),%rsi
  call   <fgets@plt>
  test   %rax,%rax
  je     L93
  mov    D171(%rip),%rax
  mov    %rax,(%r12)
  mov    %rbp,D89(%rip)
  jmp    L37
L3:
  mov    D81(%rip),%rax
  mov    (%rax),%rdi
  mov    %rdi,D89(%rip)
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    %rax,D89(%rip)
  test   %rax,%rax
  jne    L8
  jmp    L20
L70:
  mov    D89(%rip),%rbp
  mov    0x0(%rbp),%r12d
  mov    D89(%rip),%rdi
  call   <free@plt>
  mov    %r12d,0x0(%rbp)
  movq   $0x0,D89(%rip)
  jmp    L20
L93:
  mov    D89(%rip),%rbx
  mov    D89(%rip),%rax
  movb   $0x0,(%rbx,%rax,1)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,(%r12)
  jmp    L20
L88:
  mov    D89(%rip),%rbx
  sub    %rbx,%rax
  add    $0x1,%rax
  mov    %rax,(%r12)
L20:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *fgetln(FILE *fp, size_t *len) {
  static char *buf = NULL;
  static size_t bufsiz = 0;
  char *ptr;
  if (buf == NULL) {
    bufsiz = BUFSIZ;
    if ((buf = malloc(bufsiz)) == NULL)
      return NULL;
  }
  if (fgets(buf, bufsiz, fp) == NULL)
    return NULL;
  *len = 0;
  while ((ptr = strchr(&buf[*len], '\n')) == NULL) {
    size_t nbufsiz = bufsiz + BUFSIZ;
    char *nbuf = realloc(buf, nbufsiz);
    if (nbuf == NULL) {
      int oerrno = errno;
      free(buf);
      errno = oerrno;
      buf = NULL;
      return NULL;
    } else
      buf = nbuf;
    if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL) {
      buf[bufsiz] = '\0';
      *len = strlen(buf);
      return buf;
    }
    *len = bufsiz;
    bufsiz = nbufsiz;
  }
  *len = (ptr - buf) + 1;
  return buf;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<fgetln>:
  endbr64
  push   %r14
  mov    %rdi,%r14
  mov    D78(%rip),%rdi
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    D146(%rip),%rbp
  push   %rbx
  test   %rdi,%rdi
  je     L24
L61:
  mov    %r14,%rdx
  mov    %rbp,%rsi
  call   <fgets@plt>
  test   %rax,%rax
  je     L0
  movq   $0x0,0x0(%r13)
  xor    %edi,%edi
  jmp    L3
  nopl   0x0(%rax)
L10:
  mov    D155(%rip),%rbp
  mov    D78(%rip),%rdi
  mov    0x0(%rbp),%rbx
  add    D146(%rip),%rbx
  mov    %rbx,%rsi
  call   <realloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L63
  mov    D146(%rip),%rdi
  mov    0x0(%rbp),%rsi
  mov    %r14,%rdx
  mov    %rax,D10(%rip)
  add    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L40
  mov    D146(%rip),%rdi
  mov    %rbx,D10(%rip)
  mov    %rdi,0x0(%r13)
L3:
  add    D10(%rip),%rdi
  mov    $0xa,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L10
  mov    D10(%rip),%r12
  sub    %r12,%rax
  add    $0x1,%rax
  mov    %rax,0x0(%r13)
L2:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L63:
  mov    D10(%rip),%rbx
  mov    D10(%rip),%rdi
  mov    (%rbx),%ebp
  call   <free@plt>
  mov    %r12,%rax
  movq   $0x0,D10(%rip)
  mov    %ebp,(%rbx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L24:
  mov    D155(%rip),%rax
  mov    (%rax),%rbp
  mov    %rbp,%rdi
  mov    %rbp,D58(%rip)
  call   <malloc@plt>
  mov    %rax,D58(%rip)
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L61
L0:
  xor    %r12d,%r12d
  jmp    L2
  nopl   0x0(%rax)
L40:
  mov    D58(%rip),%r12
  mov    D58(%rip),%rax
  movb   $0x0,(%r12,%rax,1)
  mov    %r12,%rdi
  call   <strlen@plt>
  pop    %rbx
  pop    %rbp
  mov    %rax,0x0(%r13)
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *fgetln(FILE *fp, size_t *len) {
  static char *buf = NULL;
  static size_t bufsiz = 0;
  char *ptr;
  if (buf == NULL) {
    bufsiz = BUFSIZ;
    if ((buf = malloc(bufsiz)) == NULL)
      return NULL;
  }
  if (fgets(buf, bufsiz, fp) == NULL)
    return NULL;
  *len = 0;
  while ((ptr = strchr(&buf[*len], '\n')) == NULL) {
    size_t nbufsiz = bufsiz + BUFSIZ;
    char *nbuf = realloc(buf, nbufsiz);
    if (nbuf == NULL) {
      int oerrno = errno;
      free(buf);
      errno = oerrno;
      buf = NULL;
      return NULL;
    } else
      buf = nbuf;
    if (fgets(&buf[bufsiz], BUFSIZ, fp) == NULL) {
      buf[bufsiz] = '\0';
      *len = strlen(buf);
      return buf;
    }
    *len = bufsiz;
    bufsiz = nbufsiz;
  }
  *len = (ptr - buf) + 1;
  return buf;
}
```