ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fs_recursive_copy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x0,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <fs_exsists@plt>
  test   %eax,%eax
  jne    L1
  mov    $0x0,%eax
  jmp    L68
L1:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <fs_is_dir@plt>
  test   %eax,%eax
  jne    L18
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fs_cp@plt>
  jmp    L68
L18:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <fs_mkdir@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x20(%rbp)
  jmp    L42
L14:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L42
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fs_concat_path@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fs_concat_path@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fs_recursive_copy>
  mov    %eax,-0x24(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L42:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L14
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  mov    -0x24(%rbp),%eax
L68:
  leave
  ret
```

assistant: ```c
int fs_recursive_copy(const char *restrict source, const char *restrict destination) {
  int return_value = 0;
  DIR *source_directory;
  struct dirent *source_directory_list_item;
  char *restrict new_source;
  char *restrict new_destination;
  if (!fs_exsists(source))
    return 0;
  if (!fs_is_dir(source))
    return fs_cp(source, destination);
  fs_mkdir(destination);
  source_directory = opendir(source);
  while ((source_directory_list_item = readdir(source_directory))) {
    if ((source_directory_list_item->d_name)[0] != '.') {
      new_source = fs_concat_path(source, source_directory_list_item->d_name);
      new_destination = fs_concat_path(destination, source_directory_list_item->d_name);
      return_value = fs_recursive_copy(new_source, new_destination);
      free(new_source);
      free(new_destination);
    }
  }
  closedir(source_directory);
  return return_value;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<fs_recursive_copy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  call   <fs_exsists@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L14
L10:
  mov    %r12d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  mov    %r13,%rdi
  call   <fs_is_dir@plt>
  test   %eax,%eax
  je     L37
  mov    %r14,%rdi
  call   <fs_mkdir@plt>
  mov    %r13,%rdi
  call   <opendir@plt>
  mov    %rax,%rbp
  mov    $0x0,%r12d
L59:
  mov    %rbp,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L46
  mov    (%rbx),%rsi
  cmpb   $0x2e,(%rsi)
  je     L59
  mov    %r13,%rdi
  call   <fs_concat_path@plt>
  mov    %rax,%r15
  mov    (%rbx),%rsi
  mov    %r14,%rdi
  call   <fs_concat_path@plt>
  mov    %rax,%rbx
  mov    %rax,%rsi
  mov    %r15,%rdi
  call   <fs_recursive_copy>
  mov    %eax,%r12d
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L59
L37:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <fs_cp@plt>
  mov    %eax,%r12d
  jmp    L10
L46:
  mov    %rbp,%rdi
  call   <closedir@plt>
  jmp    L10
```

assistant: ```c
int fs_recursive_copy(const char *restrict source, const char *restrict destination) {
  int return_value = 0;
  DIR *source_directory;
  struct dirent *source_directory_list_item;
  char *restrict new_source;
  char *restrict new_destination;
  if (!fs_exsists(source))
    return 0;
  if (!fs_is_dir(source))
    return fs_cp(source, destination);
  fs_mkdir(destination);
  source_directory = opendir(source);
  while ((source_directory_list_item = readdir(source_directory))) {
    if ((source_directory_list_item->d_name)[0] != '.') {
      new_source = fs_concat_path(source, source_directory_list_item->d_name);
      new_destination = fs_concat_path(destination, source_directory_list_item->d_name);
      return_value = fs_recursive_copy(new_source, new_destination);
      free(new_source);
      free(new_destination);
    }
  }
  closedir(source_directory);
  return return_value;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<fs_recursive_copy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <fs_exsists@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L1
L65:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L1:
  mov    %rbp,%rdi
  call   <fs_is_dir@plt>
  test   %eax,%eax
  je     L48
  mov    %r13,%rdi
  xor    %r12d,%r12d
  call   <fs_mkdir@plt>
  mov    %rbp,%rdi
  call   <opendir@plt>
  mov    %rax,%r14
  jmp    L32
  nopl   0x0(%rax,%rax,1)
L25:
  mov    (%rbx),%rsi
  cmpb   $0x2e,(%rsi)
  jne    L33
L32:
  mov    %r14,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L25
  mov    %r14,%rdi
  call   <closedir@plt>
  jmp    L65
  nopw   0x0(%rax,%rax,1)
L33:
  mov    %rbp,%rdi
  call   <fs_concat_path@plt>
  mov    (%rbx),%rsi
  mov    %r13,%rdi
  mov    %rax,0x8(%rsp)
  call   <fs_concat_path@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%rsi
  mov    %rax,%r15
  call   <fs_recursive_copy>
  mov    0x8(%rsp),%rdi
  mov    %eax,%r12d
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L48:
  add    $0x18,%rsp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1140 <fs_cp@plt>
```

assistant: ```c
int fs_recursive_copy(const char *restrict source, const char *restrict destination) {
  int return_value = 0;
  DIR *source_directory;
  struct dirent *source_directory_list_item;
  char *restrict new_source;
  char *restrict new_destination;
  if (!fs_exsists(source))
    return 0;
  if (!fs_is_dir(source))
    return fs_cp(source, destination);
  fs_mkdir(destination);
  source_directory = opendir(source);
  while ((source_directory_list_item = readdir(source_directory))) {
    if ((source_directory_list_item->d_name)[0] != '.') {
      new_source = fs_concat_path(source, source_directory_list_item->d_name);
      new_destination = fs_concat_path(destination, source_directory_list_item->d_name);
      return_value = fs_recursive_copy(new_source, new_destination);
      free(new_source);
      free(new_destination);
    }
  }
  closedir(source_directory);
  return return_value;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fs_recursive_copy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <fs_exsists@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L25
L57:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L25:
  mov    %rbp,%rdi
  call   <fs_is_dir@plt>
  test   %eax,%eax
  je     L22
  mov    %r13,%rdi
  xor    %r12d,%r12d
  call   <fs_mkdir@plt>
  mov    %rbp,%rdi
  call   <opendir@plt>
  mov    %rax,%r14
  jmp    L43
  nopl   0x0(%rax,%rax,1)
L34:
  mov    (%rbx),%rsi
  cmpb   $0x2e,(%rsi)
  jne    L26
L43:
  mov    %r14,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L34
  mov    %r14,%rdi
  call   <closedir@plt>
  jmp    L57
  nopw   0x0(%rax,%rax,1)
L26:
  mov    %rbp,%rdi
  call   <fs_concat_path@plt>
  mov    (%rbx),%rsi
  mov    %r13,%rdi
  mov    %rax,0x8(%rsp)
  call   <fs_concat_path@plt>
  mov    0x8(%rsp),%rdi
  mov    %rax,%rsi
  mov    %rax,%r15
  call   <fs_recursive_copy>
  mov    0x8(%rsp),%rdi
  mov    %eax,%r12d
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  jmp    L43
  nopw   0x0(%rax,%rax,1)
L22:
  add    $0x18,%rsp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1140 <fs_cp@plt>
```

assistant: ```c
int fs_recursive_copy(const char *restrict source, const char *restrict destination) {
  int return_value = 0;
  DIR *source_directory;
  struct dirent *source_directory_list_item;
  char *restrict new_source;
  char *restrict new_destination;
  if (!fs_exsists(source))
    return 0;
  if (!fs_is_dir(source))
    return fs_cp(source, destination);
  fs_mkdir(destination);
  source_directory = opendir(source);
  while ((source_directory_list_item = readdir(source_directory))) {
    if ((source_directory_list_item->d_name)[0] != '.') {
      new_source = fs_concat_path(source, source_directory_list_item->d_name);
      new_destination = fs_concat_path(destination, source_directory_list_item->d_name);
      return_value = fs_recursive_copy(new_source, new_destination);
      free(new_source);
      free(new_destination);
    }
  }
  closedir(source_directory);
  return return_value;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<SHA256_Xcompare_43>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movabs $0xec8cbc7342a70218,%rax
  movabs $0x3ad10b5368d1f814,%rdx
  mov    %rax,(%rsp)
  mov    %rdx,0x8(%rsp)
  movl   $0x62f499b2,0x10(%rsp)
  movabs $0x2c536e6191286edb,%rax
  movabs $0x55861850c9a6eaab,%rdx
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  movabs $0xc9351e2c360e5d3f,%rax
  movabs $0x4032d6c7fef94a1e,%rdx
  mov    %rax,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  lea    0x40(%rsp),%rbx
  mov    $0x20,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    %rsp,%r12
  mov    $0x14,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <SHA256_VST@plt>
  lea    0x20(%rsp),%rbp
  lea    D19(%rip),%rcx
  mov    $0x20,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <check_test@plt>
  mov    $0x20,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    $0x14,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <SHA256_NSS@plt>
  lea    D27(%rip),%rcx
  mov    $0x20,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <check_test@plt>
  mov    $0x20,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    $0x14,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <SHA256_sodium@plt>
  lea    D21(%rip),%rcx
  mov    $0x20,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <check_test@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x70,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D19
type_guessed: string
name: parse_data
arguments: tag: D27
type_guessed: string
name: parse_data
arguments: tag: D21
type_guessed: string

tool: D19: Disagreement between given answer and SHA256_VST in SHA256_Xcompare_43


tool: D27: Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_43


tool: D21: Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_43


assistant: ```c
void SHA256_Xcompare_43() {
  unsigned char input[20] = {24, 2, 167, 66, 115, 188, 140, 236, 20, 248, 209, 104, 83, 11, 209, 58, 178, 153, 244, 98};
  unsigned char result0[32] = {0xDB, 0x6E, 0x28, 0x91, 0x61, 0x6E, 0x53, 0x2C, 0xAB, 0xEA, 0xA6, 0xC9, 0x50, 0x18, 0x86, 0x55, 0x3F, 0x5D, 0x0E, 0x36, 0x2C, 0x1E, 0x35, 0xC9, 0x1E, 0x4A, 0xF9, 0xFE, 0xC7, 0xD6, 0x32, 0x40};
  unsigned char result1[32];
  memset(result1, 0, 32);
  SHA256_VST(input, result1, 20);
  check_test(result0, result1, 32, "Disagreement between given answer and SHA256_VST in SHA256_Xcompare_43\n");
  memset(result1, 0, 32);
  SHA256_NSS(input, result1, 20);
  check_test(result0, result1, 32, "Disagreement between given answer and SHA256_NSS in SHA256_Xcompare_43\n");
  memset(result1, 0, 32);
  SHA256_sodium(input, result1, 20);
  check_test(result0, result1, 32, "Disagreement between given answer and SHA256_sodium in SHA256_Xcompare_43\n");
}
```
user: Translate the below assembly code into C programming language:

```asm
<hydra_reconnect>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %edx,-0x8(%rbp)
  mov    %ecx,%eax
  mov    %al,-0x14(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L3
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <hydra_disconnect@plt>
  mov    %eax,-0x4(%rbp)
L3:
  movzbl -0x14(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L14
  mov    -0x8(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <hydra_connect_tcp@plt>
  mov    %eax,-0x4(%rbp)
  jmp    L19
L14:
  mov    -0x8(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <hydra_connect_ssl@plt>
  mov    %eax,-0x4(%rbp)
L19:
  nop
  leave
  ret
```

assistant: ```c
void hydra_reconnect(int s, char *ip, int port, unsigned char options) {
  if (s >= 0)
    s = hydra_disconnect(s);
  if ((options & 1) == 0) {
    s = hydra_connect_tcp(ip, port);
  } else {
    s = hydra_connect_ssl(ip, port);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<hydra_reconnect>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %edx,%ebp
  mov    %ecx,%r12d
  test   %edi,%edi
  jns    L18
L35:
  test   $0x1,%r12b
  jne    L12
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <hydra_connect_tcp@plt>
L20:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L18:
  call   <hydra_disconnect@plt>
  jmp    L35
L12:
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <hydra_connect_ssl@plt>
  jmp    L20
```

assistant: ```c
void hydra_reconnect(int s, char *ip, int port, unsigned char options) {
  if (s >= 0)
    s = hydra_disconnect(s);
  if ((options & 1) == 0) {
    s = hydra_connect_tcp(ip, port);
  } else {
    s = hydra_connect_ssl(ip, port);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hydra_reconnect>:
  endbr64
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %ecx,%ebx
  test   %edi,%edi
  js     L15
  call   <hydra_disconnect@plt>
L15:
  and    $0x1,%ebx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  jne    L17
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1090 <hydra_connect_tcp@plt>
  nopl   (%rax)
L17:
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1070 <hydra_connect_ssl@plt>
```

assistant: ```c
void hydra_reconnect(int s, char *ip, int port, unsigned char options) {
  if (s >= 0)
    s = hydra_disconnect(s);
  if ((options & 1) == 0) {
    s = hydra_connect_tcp(ip, port);
  } else {
    s = hydra_connect_ssl(ip, port);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<hydra_reconnect>:
  endbr64
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %ecx,%ebx
  test   %edi,%edi
  js     L2
  call   <hydra_disconnect@plt>
L2:
  and    $0x1,%ebx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  jne    L3
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1090 <hydra_connect_tcp@plt>
  nopl   (%rax)
L3:
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1070 <hydra_connect_ssl@plt>
```

assistant: ```c
void hydra_reconnect(int s, char *ip, int port, unsigned char options) {
  if (s >= 0)
    s = hydra_disconnect(s);
  if ((options & 1) == 0) {
    s = hydra_connect_tcp(ip, port);
  } else {
    s = hydra_connect_ssl(ip, port);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x220,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x218(%rbp)
  movl   $0x0,-0x21c(%rbp)
  jmp    L33
L64:
  mov    -0x21c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x21c(%rbp)
  movzbl -0x21d(%rbp),%edx
  cltq
  mov    %dl,-0x210(%rbp,%rax,1)
  movzbl -0x21d(%rbp),%eax
  cmp    $0xa,%al
  jne    L19
  mov    $0x0,%edi
  call   <time@plt>
  sub    $0x5,%eax
  movslq %eax,%rdx
  mov    -0x218(%rbp),%rax
  cmp    %rax,%rdx
  jle    L1
  movl   $0x0,-0x21c(%rbp)
  mov    -0x21c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x210(%rbp,%rax,1)
  lea    -0x210(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <time@plt>
  jmp    L33
L1:
  movl   $0x0,-0x21c(%rbp)
  jmp    L33
L19:
  cmpl   $0x1f4,-0x21c(%rbp)
  jle    L33
  movl   $0x1f4,-0x21c(%rbp)
L33:
  lea    -0x21d(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <read@plt>
  cmp    $0x1,%eax
  je     L64
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L31
  call   <__stack_chk_fail@plt>
L31:
  leave
  ret
```

assistant: ```c
int main() {
  char ch, line[512];
  time_t lasttm = 0;
  int c = 0;
  while (read(0, &ch, 1) == 1) {
    line[c++] = ch;
    if (ch == '\n')
      if (lasttm < time(NULL) - 5) {
        line[c - 1] = c = 0;
        puts(line);
        time(&lasttm);
      } else
        c = 0;
    else if (c > 500)
      c = 500;
  }
  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
  movq   $0x0,0x8(%rsp)
  mov    $0x0,%ebx
  lea    0x7(%rsp),%rbp
L43:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <read@plt>
  cmp    $0x1,%eax
  jne    L16
  lea    0x1(%rbx),%edx
  movzbl 0x7(%rsp),%eax
  movslq %ebx,%rbx
  mov    %al,0x10(%rsp,%rbx,1)
  mov    $0x1f4,%ebx
  cmp    %ebx,%edx
  cmovle %edx,%ebx
  cmp    $0xa,%al
  jne    L43
  mov    $0x0,%edi
  call   <time@plt>
  sub    $0x5,%eax
  cltq
  mov    $0x0,%ebx
  cmp    0x8(%rsp),%rax
  jle    L43
  movb   $0x0,0xf(%rsp)
  lea    0x10(%rsp),%rdi
  call   <puts@plt>
  lea    0x8(%rsp),%rdi
  call   <time@plt>
  jmp    L43
L16:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  mov    $0x0,%eax
  add    $0x228,%rsp
  pop    %rbx
  pop    %rbp
  ret
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  char ch, line[512];
  time_t lasttm = 0;
  int c = 0;
  while (read(0, &ch, 1) == 1) {
    line[c++] = ch;
    if (ch == '\n')
      if (lasttm < time(NULL) - 5) {
        line[c - 1] = c = 0;
        puts(line);
        time(&lasttm);
      } else
        c = 0;
    else if (c > 500)
      c = 500;
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x1f4,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%r12
  movq   $0x0,0x8(%rsp)
  jmp    L18
  nopl   0x0(%rax)
L50:
  cmp    $0x1f5,%ebp
  cmove  %r13d,%ebp
L15:
  movslq %ebp,%rbx
L18:
  xor    %edi,%edi
  mov    $0x1,%edx
  mov    %r12,%rsi
  call   <read@plt>
  cmp    $0x1,%eax
  jne    L23
  movzbl 0x7(%rsp),%eax
  lea    0x1(%rbx),%ebp
  mov    %al,0x10(%rsp,%rbx,1)
  cmp    $0xa,%al
  jne    L50
  xor    %edi,%edi
  xor    %ebp,%ebp
  call   <time@plt>
  sub    $0x5,%eax
  cltq
  cmp    0x8(%rsp),%rax
  jle    L15
  lea    0x10(%rsp),%rdi
  movb   $0x0,0xf(%rsp)
  call   <puts@plt>
  lea    0x8(%rsp),%rdi
  call   <time@plt>
  jmp    L15
  nopl   0x0(%rax)
L23:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x228,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L28:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  char ch, line[512];
  time_t lasttm = 0;
  int c = 0;
  while (read(0, &ch, 1) == 1) {
    line[c++] = ch;
    if (ch == '\n')
      if (lasttm < time(NULL) - 5) {
        line[c - 1] = c = 0;
        puts(line);
        time(&lasttm);
      } else
        c = 0;
    else if (c > 500)
      c = 500;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x1f4,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%r12
  movq   $0x0,0x8(%rsp)
  jmp    L41
  nopl   0x0(%rax)
L14:
  cmp    $0x1f5,%ebp
  cmove  %r13d,%ebp
L21:
  movslq %ebp,%rbx
L41:
  xor    %edi,%edi
  mov    $0x1,%edx
  mov    %r12,%rsi
  call   <read@plt>
  cmp    $0x1,%eax
  jne    L35
  movzbl 0x7(%rsp),%eax
  lea    0x1(%rbx),%ebp
  mov    %al,0x10(%rsp,%rbx,1)
  cmp    $0xa,%al
  jne    L14
  xor    %edi,%edi
  xor    %ebp,%ebp
  call   <time@plt>
  sub    $0x5,%eax
  cltq
  cmp    0x8(%rsp),%rax
  jle    L21
  lea    0x10(%rsp),%rdi
  movb   $0x0,0xf(%rsp)
  call   <puts@plt>
  lea    0x8(%rsp),%rdi
  call   <time@plt>
  jmp    L21
  nopl   0x0(%rax)
L35:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L39
  add    $0x228,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L39:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  char ch, line[512];
  time_t lasttm = 0;
  int c = 0;
  while (read(0, &ch, 1) == 1) {
    line[c++] = ch;
    if (ch == '\n')
      if (lasttm < time(NULL) - 5) {
        line[c - 1] = c = 0;
        puts(line);
        time(&lasttm);
      } else
        c = 0;
    else if (c > 500)
      c = 500;
  }
  return 0;
}
```