ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x616e756b,-0x46(%rbp)
  movw   $0x6c,-0x42(%rbp)
  movabs $0x796d206f6c6c6568,%rax
  movabs $0x736920656d616e20,%rdx
  mov    %rax,-0x40(%rbp)
  mov    %rdx,-0x38(%rbp)
  movabs $0x202e6c616e756b20,%rax
  movabs $0x7369206c616e756b,%rdx
  mov    %rax,-0x30(%rbp)
  mov    %rdx,-0x28(%rbp)
  movabs $0x6b20746c65707320,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x6c616e75,-0x18(%rbp)
  movw   $0x2e,-0x14(%rbp)
  lea    -0x40(%rbp),%rdx
  lea    -0x46(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strrindex@plt>
  mov    %eax,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x4c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D7
type_guessed: string

tool: D7: %i


assistant: ```c
int main(void) {
  char characters[] = "kunal";
  char string[] = "hello my name is kunal. kunal is spelt kunal.";
  int value = strrindex(characters, string);
  printf("%i\n", value);
  return value;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movl   $0x616e756b,0xa(%rsp)
  movw   $0x6c,0xe(%rsp)
  movabs $0x796d206f6c6c6568,%rax
  movabs $0x736920656d616e20,%rdx
  mov    %rax,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  movabs $0x202e6c616e756b20,%rax
  movabs $0x7369206c616e756b,%rdx
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  movabs $0x6b20746c65707320,%rax
  mov    %rax,0x30(%rsp)
  movl   $0x6c616e75,0x38(%rsp)
  movw   $0x2e,0x3c(%rsp)
  lea    0x10(%rsp),%rsi
  lea    0xa(%rsp),%rdi
  call   <strrindex@plt>
  mov    %eax,%ebx
  mov    %eax,%esi
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  mov    %ebx,%eax
  add    $0x50,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D6
datatype: string

tool: D6: %i


assistant: ```c
int main(void) {
  char characters[] = "kunal";
  char string[] = "hello my name is kunal. kunal is spelt kunal.";
  int value = strrindex(characters, string);
  printf("%i\n", value);
  return value;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r12
  mov    $0x2e,%edx
  sub    $0x50,%rsp
  movdqa D4(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    $0x6c,%eax
  lea    0x10(%rsp),%rsi
  lea    0xa(%rsp),%rdi
  movaps %xmm0,0x10(%rsp)
  movdqa D1(%rip),%xmm0
  mov    %ax,0xe(%rsp)
  movabs $0x6b20746c65707320,%rax
  movl   $0x616e756b,0xa(%rsp)
  mov    %rax,0x30(%rsp)
  movl   $0x6c616e75,0x38(%rsp)
  mov    %dx,0x3c(%rsp)
  movaps %xmm0,0x20(%rsp)
  call   <strrindex@plt>
  lea    D23(%rip),%rdi
  mov    %eax,%esi
  mov    %eax,%r12d
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x50,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D4
type_infered: byte[16]
name: parse_data
arguments: data_label: D1
type_infered: byte[16]
name: parse_data
arguments: data_label: D23
type_infered: string

tool: {"D4": [0x68,0x65,0x6c,0x6c,0x6f,0x20,0x6d,0x79,0x20,0x6e,0x61,0x6d,0x65,0x20,0x69,0x73]}

tool: {"D1": [0x20,0x6b,0x75,0x6e,0x61,0x6c,0x2e,0x20,0x6b,0x75,0x6e,0x61,0x6c,0x20,0x69,0x73]}

tool: D23: %i


assistant: ```c
int main(void) {
  char characters[] = "kunal";
  char string[] = "hello my name is kunal. kunal is spelt kunal.";
  int value = strrindex(characters, string);
  printf("%i\n", value);
  return value;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r12
  mov    $0x2e,%edx
  sub    $0x50,%rsp
  movdqa D24(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    $0x6c,%eax
  lea    0x10(%rsp),%rsi
  lea    0xa(%rsp),%rdi
  movaps %xmm0,0x10(%rsp)
  movdqa D3(%rip),%xmm0
  mov    %ax,0xe(%rsp)
  movabs $0x6b20746c65707320,%rax
  movl   $0x616e756b,0xa(%rsp)
  mov    %rax,0x30(%rsp)
  movl   $0x6c616e75,0x38(%rsp)
  mov    %dx,0x3c(%rsp)
  movaps %xmm0,0x20(%rsp)
  call   <strrindex@plt>
  lea    D11(%rip),%rdi
  mov    %eax,%esi
  mov    %eax,%r12d
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x50,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D24
type: byte[16]
name: parse_data
arguments: label: D3
type: byte[16]
name: parse_data
arguments: label: D11
type: string

tool: {"D24": [0x68,0x65,0x6c,0x6c,0x6f,0x20,0x6d,0x79,0x20,0x6e,0x61,0x6d,0x65,0x20,0x69,0x73]}

tool: {"D3": [0x20,0x6b,0x75,0x6e,0x61,0x6c,0x2e,0x20,0x6b,0x75,0x6e,0x61,0x6c,0x20,0x69,0x73]}

tool: D11: %i


assistant: ```c
int main(void) {
  char characters[] = "kunal";
  char string[] = "hello my name is kunal. kunal is spelt kunal.";
  int value = strrindex(characters, string);
  printf("%i\n", value);
  return value;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<CompressGotoTable>:
  endbr64
  test   %ecx,%ecx
  je     L21
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r10
  mov    %ecx,%esi
  mov    $0x0,%r11d
  mov    $0x0,%eax
  mov    $0x0,%edx
  mov    $0x0,%r12d
  mov    $0x1,%ebp
  jmp    L91
L24:
  lea    0x1(%r11),%ecx
  cmp    %eax,%esi
  jbe    L135
  mov    %eax,%edx
  mov    (%rbx,%rdx,4),%edx
  mov    %ecx,%ecx
  mov    %edx,(%r10,%rcx,4)
  lea    0x2(%r11),%ecx
  add    $0x1,%eax
  cmp    %eax,%esi
  je     L0
  mov    %eax,%edi
  lea    (%rbx,%rdi,4),%rdi
  mov    $0x1,%r8d
L13:
  mov    %edx,%r9d
  mov    (%rdi),%edx
  cmp    %r9d,%edx
  je     L70
  add    $0x1,%r8d
  cmp    %eax,%esi
  je     L141
  mov    %ecx,%r9d
  mov    %edx,(%r10,%r9,4)
  add    $0x1,%ecx
  add    $0x1,%eax
  add    $0x4,%rdi
  cmp    %eax,%esi
  jne    L13
  jmp    L70
L141:
  mov    %esi,%eax
L70:
  mov    %r11d,%r11d
  mov    %r8d,(%r10,%r11,4)
  mov    %ecx,%r11d
  mov    %ebp,%edx
L68:
  cmp    %esi,%eax
  jae    L120
L91:
  test   %edx,%edx
  je     L24
  mov    %eax,%edx
  mov    (%rbx,%rdx,4),%edi
  add    $0x1,%eax
  cmp    %eax,%esi
  jbe    L35
  mov    %eax,%edx
  lea    (%rbx,%rdx,4),%rdx
  mov    $0x1,%ecx
L25:
  cmp    (%rdx),%edi
  jne    L84
  add    $0x1,%ecx
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %eax,%esi
  ja     L25
L84:
  mov    %r11d,%edx
  mov    %ecx,(%r10,%rdx,4)
  lea    0x1(%r11),%edx
  mov    %edi,(%r10,%rdx,4)
  add    $0x2,%r11d
  mov    %r12d,%edx
  jmp    L68
L135:
  mov    $0x1,%r8d
  jmp    L70
L0:
  mov    $0x1,%r8d
  jmp    L70
L35:
  mov    $0x1,%ecx
  jmp    L84
L120:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L21:
  ret
```

assistant: ```c
void CompressGotoTable(int *source_data, int *dest_data, unsigned int *compressed_size, unsigned int total_size) {
  unsigned int mode = 0;
  unsigned int index = 0;
  unsigned int write_index = 0;
  int lengthRep = 0;
  int copy_value = 0;
  while (index < total_size) {
    if (mode == 0) {
      unsigned int counter_loc = write_index;
      write_index++;
      lengthRep = 1;
      while (index < total_size) {
        dest_data[write_index] = source_data[index];
        write_index++;
        index++;
        if (index == total_size || source_data[index] == source_data[index - 1]) {
          break;
        }
        lengthRep++;
      }
      dest_data[counter_loc] = lengthRep;
      mode = 1;
    } else if (mode == 1) {
      unsigned int repeat_value;
      repeat_value = source_data[index];
      lengthRep = 1;
      index++;
      while (index < total_size && source_data[index] == repeat_value) {
        lengthRep++;
        index++;
      }
      dest_data[write_index] = lengthRep;
      write_index++;
      dest_data[write_index] = repeat_value;
      write_index++;
      mode = 0;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<CompressGotoTable>:
  endbr64
  test   %ecx,%ecx
  je     L119
  push   %rbp
  mov    %rsi,%r11
  mov    %ecx,%r9d
  xor    %ebp,%ebp
  push   %rbx
  xor    %r8d,%r8d
  mov    %rdi,%rbx
  mov    $0x1,%r10d
L82:
  mov    %r8d,%eax
  mov    (%rbx,%rax,4),%edx
  mov    %r10d,%eax
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%r8),%eax
  cmp    %eax,%r9d
  je     L5
  mov    %eax,%ecx
  mov    $0x1,%edi
  sub    %r8d,%r10d
  lea    (%rbx,%rcx,4),%rsi
  jmp    L31
  nopl   0x0(%rax)
L59:
  add    $0x1,%edi
  cmp    %eax,%r9d
  jbe    L120
  add    $0x1,%eax
  mov    %edx,(%r11,%rcx,4)
  add    $0x4,%rsi
  cmp    %eax,%r9d
  je     L120
L31:
  mov    %edx,%r8d
  mov    (%rsi),%edx
  lea    (%rax,%r10,1),%ecx
  cmp    %r8d,%edx
  jne    L59
  mov    %edi,(%r11,%rbp,4)
  cmp    %eax,%r9d
  jbe    L102
  lea    0x1(%rax),%r8d
  mov    (%rsi),%esi
  cmp    %r8d,%r9d
  jbe    L4
  mov    %r8d,%eax
  mov    $0x1,%edx
  lea    (%rbx,%rax,4),%rax
  jmp    L36
  nopl   0x0(%rax)
L79:
  add    $0x1,%r8d
  add    $0x1,%edx
  add    $0x4,%rax
  cmp    %r8d,%r9d
  jbe    L97
L36:
  cmp    (%rax),%esi
  je     L79
  mov    %ecx,%eax
  lea    0x2(%rcx),%ebp
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%rcx),%eax
  mov    %esi,(%r11,%rax,4)
  cmp    %r8d,%r9d
  jbe    L102
  lea    0x3(%rcx),%r10d
  jmp    L82
L5:
  mov    $0x1,%edi
  nopw   0x0(%rax,%rax,1)
L120:
  mov    %edi,(%r11,%rbp,4)
L102:
  pop    %rbx
  pop    %rbp
  ret
L119:
  ret
L4:
  mov    $0x1,%edx
L97:
  mov    %ecx,%eax
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%rcx),%eax
  mov    %esi,(%r11,%rax,4)
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void CompressGotoTable(int *source_data, int *dest_data, unsigned int *compressed_size, unsigned int total_size) {
  unsigned int mode = 0;
  unsigned int index = 0;
  unsigned int write_index = 0;
  int lengthRep = 0;
  int copy_value = 0;
  while (index < total_size) {
    if (mode == 0) {
      unsigned int counter_loc = write_index;
      write_index++;
      lengthRep = 1;
      while (index < total_size) {
        dest_data[write_index] = source_data[index];
        write_index++;
        index++;
        if (index == total_size || source_data[index] == source_data[index - 1]) {
          break;
        }
        lengthRep++;
      }
      dest_data[counter_loc] = lengthRep;
      mode = 1;
    } else if (mode == 1) {
      unsigned int repeat_value;
      repeat_value = source_data[index];
      lengthRep = 1;
      index++;
      while (index < total_size && source_data[index] == repeat_value) {
        lengthRep++;
        index++;
      }
      dest_data[write_index] = lengthRep;
      write_index++;
      dest_data[write_index] = repeat_value;
      write_index++;
      mode = 0;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<CompressGotoTable>:
  endbr64
  test   %ecx,%ecx
  je     L122
  push   %rbp
  mov    %rsi,%r11
  mov    %ecx,%r9d
  xor    %ebp,%ebp
  push   %rbx
  xor    %r8d,%r8d
  mov    %rdi,%rbx
  mov    $0x1,%r10d
L115:
  mov    %r8d,%eax
  mov    (%rbx,%rax,4),%edx
  mov    %r10d,%eax
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%r8),%eax
  cmp    %eax,%r9d
  je     L10
  mov    %eax,%ecx
  mov    $0x1,%edi
  sub    %r8d,%r10d
  lea    (%rbx,%rcx,4),%rsi
  jmp    L123
  nopl   0x0(%rax)
L121:
  add    $0x1,%edi
  cmp    %eax,%r9d
  jbe    L81
  add    $0x1,%eax
  mov    %edx,(%r11,%rcx,4)
  add    $0x4,%rsi
  cmp    %eax,%r9d
  je     L81
L123:
  mov    %edx,%r8d
  mov    (%rsi),%edx
  lea    (%r10,%rax,1),%ecx
  cmp    %r8d,%edx
  jne    L121
  mov    %edi,(%r11,%rbp,4)
  cmp    %eax,%r9d
  jbe    L118
  lea    0x1(%rax),%r8d
  mov    (%rsi),%esi
  cmp    %r8d,%r9d
  jbe    L65
  mov    %r8d,%eax
  mov    $0x1,%edx
  lea    (%rbx,%rax,4),%rax
  jmp    L91
  nopl   0x0(%rax)
L24:
  add    $0x1,%r8d
  add    $0x1,%edx
  add    $0x4,%rax
  cmp    %r8d,%r9d
  jbe    L59
L91:
  cmp    (%rax),%esi
  je     L24
  mov    %ecx,%eax
  lea    0x2(%rcx),%ebp
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%rcx),%eax
  mov    %esi,(%r11,%rax,4)
  cmp    %r8d,%r9d
  jbe    L118
  lea    0x3(%rcx),%r10d
  jmp    L115
L10:
  mov    $0x1,%edi
  nopw   0x0(%rax,%rax,1)
L81:
  mov    %edi,(%r11,%rbp,4)
L118:
  pop    %rbx
  pop    %rbp
  ret
L122:
  ret
L65:
  mov    $0x1,%edx
L59:
  mov    %ecx,%eax
  mov    %edx,(%r11,%rax,4)
  lea    0x1(%rcx),%eax
  mov    %esi,(%r11,%rax,4)
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void CompressGotoTable(int *source_data, int *dest_data, unsigned int *compressed_size, unsigned int total_size) {
  unsigned int mode = 0;
  unsigned int index = 0;
  unsigned int write_index = 0;
  int lengthRep = 0;
  int copy_value = 0;
  while (index < total_size) {
    if (mode == 0) {
      unsigned int counter_loc = write_index;
      write_index++;
      lengthRep = 1;
      while (index < total_size) {
        dest_data[write_index] = source_data[index];
        write_index++;
        index++;
        if (index == total_size || source_data[index] == source_data[index - 1]) {
          break;
        }
        lengthRep++;
      }
      dest_data[counter_loc] = lengthRep;
      mode = 1;
    } else if (mode == 1) {
      unsigned int repeat_value;
      repeat_value = source_data[index];
      lengthRep = 1;
      index++;
      while (index < total_size && source_data[index] == repeat_value) {
        lengthRep++;
        index++;
      }
      dest_data[write_index] = lengthRep;
      write_index++;
      dest_data[write_index] = repeat_value;
      write_index++;
      mode = 0;
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<make_version_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x10,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L11
  mov    $0x0,%eax
  jmp    L14
L11:
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D4(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x8(%rbp),%rax
L14:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D4
type_infered: string

tool: D4: %s.~%d~

assistant: ```c
char *make_version_name(char *file, int version) {
  char *backup_name;
  backup_name = malloc(strlen(file) + 16);
  if (backup_name == 0)
    return 0;
  sprintf(backup_name, "%s.~%d~", file, version);
  return backup_name;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<make_version_name>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r12d
  call   <strlen@plt>
  lea    0x10(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L0
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  lea    D1(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
L0:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D1
type_guessed: string

tool: D1: %s.~%d~

assistant: ```c
char *make_version_name(char *file, int version) {
  char *backup_name;
  backup_name = malloc(strlen(file) + 16);
  if (backup_name == 0)
    return 0;
  sprintf(backup_name, "%s.~%d~", file, version);
  return backup_name;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<make_version_name>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  call   <strlen@plt>
  lea    0x10(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L1
  mov    %r14d,%ecx
  mov    %r13,%rdx
  lea    D5(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
L1:
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: label: D5
type: string

tool: D5: %s.~%d~

assistant: ```c
char *make_version_name(char *file, int version) {
  char *backup_name;
  backup_name = malloc(strlen(file) + 16);
  if (backup_name == 0)
    return 0;
  sprintf(backup_name, "%s.~%d~", file, version);
  return backup_name;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<make_version_name>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  call   <strlen@plt>
  lea    0x10(%rax),%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L4
  mov    %r14d,%ecx
  mov    %r13,%rdx
  lea    D0(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
L4:
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D0
type_infered: string

tool: D0: %s.~%d~

assistant: ```c
char *make_version_name(char *file, int version) {
  char *backup_name;
  backup_name = malloc(strlen(file) + 16);
  if (backup_name == 0)
    return 0;
  sprintf(backup_name, "%s.~%d~", file, version);
  return backup_name;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<getword>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  nop
L89:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,-0x9(%rbp)
  movsbl -0x9(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L89
  mov    D8(%rip),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x9(%rbp)
  je     L13
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl -0x9(%rbp),%edx
  mov    %dl,(%rax)
L13:
  movsbl -0x9(%rbp),%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %eax,%eax
  jne    L59
  cmpb   $0x5f,-0x9(%rbp)
  je     L59
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  movzbl -0x9(%rbp),%eax
  jmp    L9
L79:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    -0x8(%rbp),%rdx
  mov    %al,(%rdx)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L8
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L8
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <ungetch@plt>
  jmp    L74
L8:
  addq   $0x1,-0x8(%rbp)
L59:
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jg     L79
L74:
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
L9:
  leave
  ret
```

assistant: ```c
char getword(char *word, int limit) {
  char ch;
  char *w = word;
  while (isspace(ch = getch()))
    ;
  if (ch != EOF) {
    *w++ = ch;
  }
  if (!isalpha(ch) && ch != '_') {
    *w = '\0';
    return ch;
  }
  for (; --limit > 0; w++) {
    if (!isalnum(*w = getch()) && *w != '_') {
      ungetch(*w);
      break;
    }
  }
  *w = '\0';
  return *word;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<getword>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %esi,%r14d
L23:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%ebp
  movsbl %al,%r13d
  mov    %r13d,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L23
  mov    %r12,%rbx
  mov    D4(%rip),%rax
  cmp    %bpl,(%rax)
  je     L89
  lea    0x1(%r12),%rbx
  mov    %bpl,(%r12)
L89:
  mov    %r13d,%edi
  call   <isalpha@plt>
  cmp    $0x5f,%bpl
  je     L95
  test   %eax,%eax
  je     L57
L95:
  lea    -0x2(%r14),%eax
  lea    0x1(%rbx,%rax,1),%rbp
  cmp    $0x1,%r14d
  jg     L90
  mov    %rbx,%rbp
  jmp    L83
L57:
  movb   $0x0,(%rbx)
  jmp    L92
L61:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  je     L83
L90:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L61
  movzbl (%rbx),%edi
  cmp    $0x5f,%dil
  je     L61
  movsbl %dil,%edi
  call   <ungetch@plt>
  mov    %rbx,%rbp
L83:
  movb   $0x0,0x0(%rbp)
  movzbl (%r12),%ebp
L92:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char getword(char *word, int limit) {
  char ch;
  char *w = word;
  while (isspace(ch = getch()))
    ;
  if (ch != EOF) {
    *w++ = ch;
  }
  if (!isalpha(ch) && ch != '_') {
    *w = '\0';
    return ch;
  }
  for (; --limit > 0; w++) {
    if (!isalnum(*w = getch()) && *w != '_') {
      ungetch(*w);
      break;
    }
  }
  *w = '\0';
  return *word;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<getword>:
  endbr64
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  nopw   0x0(%rax,%rax,1)
L88:
  xor    %eax,%eax
  call   <getch@plt>
  movsbl %al,%r14d
  mov    %r14d,%edi
  mov    %r14d,%r12d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L88
  mov    D5(%rip),%rax
  mov    %rbp,%rbx
  cmp    %r14b,(%rax)
  je     L61
  mov    %r14b,0x0(%rbp)
  lea    0x1(%rbp),%rbx
L61:
  mov    %r14d,%edi
  call   <isalpha@plt>
  cmp    $0x5f,%r12b
  je     L56
  test   %eax,%eax
  je     L44
L56:
  lea    -0x2(%r13),%eax
  lea    0x1(%rbx,%rax,1),%r12
  cmp    $0x1,%r13d
  jle    L20
  nopl   0x0(%rax,%rax,1)
L19:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L63
  movsbl (%rbx),%edi
  cmp    $0x5f,%dil
  jne    L0
L63:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L19
L58:
  movb   $0x0,(%r12)
  movzbl 0x0(%rbp),%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L44:
  movb   $0x0,(%rbx)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L0:
  call   <ungetch@plt>
L20:
  mov    %rbx,%r12
  jmp    L58
```

assistant: ```c
char getword(char *word, int limit) {
  char ch;
  char *w = word;
  while (isspace(ch = getch()))
    ;
  if (ch != EOF) {
    *w++ = ch;
  }
  if (!isalpha(ch) && ch != '_') {
    *w = '\0';
    return ch;
  }
  for (; --limit > 0; w++) {
    if (!isalnum(*w = getch()) && *w != '_') {
      ungetch(*w);
      break;
    }
  }
  *w = '\0';
  return *word;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<getword>:
  endbr64
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  nopw   0x0(%rax,%rax,1)
L22:
  xor    %eax,%eax
  call   <getch@plt>
  movsbl %al,%r14d
  mov    %r14d,%edi
  mov    %r14d,%r12d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L22
  mov    D4(%rip),%rax
  mov    %rbp,%rbx
  cmp    %r14b,(%rax)
  je     L14
  mov    %r14b,0x0(%rbp)
  lea    0x1(%rbp),%rbx
L14:
  mov    %r14d,%edi
  call   <isalpha@plt>
  cmp    $0x5f,%r12b
  je     L23
  test   %eax,%eax
  je     L39
L23:
  lea    -0x2(%r13),%eax
  lea    0x1(%rbx,%rax,1),%r12
  cmp    $0x1,%r13d
  jle    L88
  nopl   0x0(%rax,%rax,1)
L61:
  xor    %eax,%eax
  call   <getch@plt>
  mov    %al,(%rbx)
  movsbl %al,%edi
  call   <isalnum@plt>
  test   %eax,%eax
  jne    L1
  movsbl (%rbx),%edi
  cmp    $0x5f,%dil
  jne    L60
L1:
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L61
L10:
  movb   $0x0,(%r12)
  movzbl 0x0(%rbp),%r12d
  pop    %rbx
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L39:
  movb   $0x0,(%rbx)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L60:
  call   <ungetch@plt>
L88:
  mov    %rbx,%r12
  jmp    L10
```

assistant: ```c
char getword(char *word, int limit) {
  char ch;
  char *w = word;
  while (isspace(ch = getch()))
    ;
  if (ch != EOF) {
    *w++ = ch;
  }
  if (!isalpha(ch) && ch != '_') {
    *w = '\0';
    return ch;
  }
  for (; --limit > 0; w++) {
    if (!isalnum(*w = getch()) && *w != '_') {
      ungetch(*w);
      break;
    }
  }
  *w = '\0';
  return *word;
}
```