ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<readerscr>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  call   <gerase@plt>
  mov    $0x2,%esi
  mov    $0x14,%edi
  call   <gmove@plt>
  test   %ebx,%ebx
  je     L18
  lea    D7(%rip),%rdi
  call   <gputs@plt>
L5:
  lea    D5(%rip),%rdi
  call   <gputs@plt>
  mov    $0x15,%edi
  mov    $0x2,%esi
  call   <gmove@plt>
  lea    D36(%rip),%rdi
  pop    %rbx
  jmp    1080 <gputs@plt>
  nopl   (%rax)
L18:
  lea    D17(%rip),%rdi
  call   <gputs@plt>
  jmp    L5
```

tool_calls: name: disassemble_data
arguments: label: D7
type_infered: string
name: disassemble_data
arguments: label: D5
type_infered: string
name: disassemble_data
arguments: label: D36
type_infered: string
name: disassemble_data
arguments: label: D17
type_infered: string

tool: D7: Mail:  (v)iew current  (d)elete  

tool: D5: (j)down  (k)up  (n)ext  (p)revious

tool: D36: Press SPACE to Exit.

tool: D17: News:  (v)iew current  

assistant: ```c
void readerscr(int mode) {
  gerase(0);
  gmove(20, 2);
  if (mode)
    gputs("Mail:  (v)iew current  (d)elete  ");
  else
    gputs("News:  (v)iew current  ");
  gputs("(j)down  (k)up  (n)ext  (p)revious");
  gmove(21, 2);
  gputs("Press SPACE to Exit.");
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<dbg_stderr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L18
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L18:
  mov    $0x0,%eax
  call   <check_verbose@plt>
  test   %rax,%rax
  je     L2
  mov    -0xc8(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  mov    -0xb4(%rbp),%edx
  mov    -0xc8(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <vfprintf@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
L2:
  nop
  leave
  ret
```

assistant: ```c
void dbg_stderr(char *fmt, ...) {
  if (check_verbose()) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<dbg_stderr>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <check_verbose@plt>
  test   %rax,%rax
  jne    L2
L19:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L2:
  mov    %rbx,%rsi
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    D2(%rip),%rax
  mov    (%rax),%edi
  call   <vfprintf@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  jmp    L19
```

assistant: ```c
void dbg_stderr(char *fmt, ...) {
  if (check_verbose()) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<dbg_stderr>:
  endbr64
  push   %r12
  xor    %eax,%eax
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <check_verbose@plt>
  test   %rax,%rax
  jne    L3
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L3:
  xor    %r12d,%r12d
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    D7(%rip),%rax
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    (%rax),%edi
  call   <vfprintf@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void dbg_stderr(char *fmt, ...) {
  if (check_verbose()) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<dbg_stderr>:
  endbr64
  push   %r12
  xor    %eax,%eax
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <check_verbose@plt>
  test   %rax,%rax
  jne    L8
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L8:
  xor    %r12d,%r12d
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    D0(%rip),%rax
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    (%rax),%edi
  call   <vfprintf@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void dbg_stderr(char *fmt, ...) {
  if (check_verbose()) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<scout_any_segment>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %al,-0x1c(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <scout_pchar@plt>
  mov    %rax,-0x18(%rbp)
  jmp    L13
L25:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <scout_pchar@plt>
  mov    %rax,-0x18(%rbp)
L13:
  cmpq   $0x0,-0x18(%rbp)
  je     L12
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,-0x1c(%rbp)
  jne    L25
L12:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
const char *scout_any_segment(const char *c, char exclude) {
  const char *p = NULL;
  c = scout_pchar(c);
  while (c != NULL && *c != exclude) {
    p = c++;
    c = scout_pchar(c);
  }
  return p;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<scout_any_segment>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %esi,%ebp
  call   <scout_pchar@plt>
  mov    %rax,%rbx
  mov    $0x0,%edx
  test   %rax,%rax
  je     L34
L25:
  cmp    %bpl,(%rbx)
  je     L30
  lea    0x1(%rbx),%rdi
  call   <scout_pchar@plt>
  mov    %rbx,%rdx
  test   %rax,%rax
  je     L30
  mov    %rax,%rbx
  jmp    L25
L34:
  mov    %rax,%rdx
L30:
  mov    %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
const char *scout_any_segment(const char *c, char exclude) {
  const char *p = NULL;
  c = scout_pchar(c);
  while (c != NULL && *c != exclude) {
    p = c++;
    c = scout_pchar(c);
  }
  return p;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<scout_any_segment>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <scout_pchar@plt>
  xor    %r8d,%r8d
  test   %rax,%rax
  jne    L31
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L23:
  lea    0x1(%rbx),%rdi
  call   <scout_pchar@plt>
  mov    %rbx,%r8
  test   %rax,%rax
  je     L4
L31:
  mov    %rax,%rbx
  cmp    %bpl,(%rax)
  jne    L23
L4:
  add    $0x8,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
const char *scout_any_segment(const char *c, char exclude) {
  const char *p = NULL;
  c = scout_pchar(c);
  while (c != NULL && *c != exclude) {
    p = c++;
    c = scout_pchar(c);
  }
  return p;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<scout_any_segment>:
  endbr64
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <scout_pchar@plt>
  xor    %r8d,%r8d
  test   %rax,%rax
  jne    L22
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L23:
  lea    0x1(%rbx),%rdi
  call   <scout_pchar@plt>
  mov    %rbx,%r8
  test   %rax,%rax
  je     L4
L22:
  mov    %rax,%rbx
  cmp    %bpl,(%rax)
  jne    L23
L4:
  add    $0x8,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
const char *scout_any_segment(const char *c, char exclude) {
  const char *p = NULL;
  c = scout_pchar(c);
  while (c != NULL && *c != exclude) {
    p = c++;
    c = scout_pchar(c);
  }
  return p;
}
```
user: Translate the below assembly code into C programming language:

```asm
<round_to_next_multiple>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  cltd
  idivl  -0x18(%rbp)
  mov    %edx,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jne    L16
  mov    -0x14(%rbp),%eax
  jmp    L2
L16:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  sub    -0x4(%rbp),%eax
L2:
  pop    %rbp
  ret
```

assistant: ```c
int round_to_next_multiple(int number, int multiple) {
  int remaining = number % multiple;
  if (remaining == 0)
    return number;
  else
    return number + multiple - remaining;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<round_to_next_multiple>:
  endbr64
  mov    %edi,%eax
  cltd
  idiv   %esi
  add    %edi,%esi
  sub    %edx,%esi
  test   %edx,%edx
  cmovne %esi,%edi
  mov    %edi,%eax
  ret
```

assistant: ```c
int round_to_next_multiple(int number, int multiple) {
  int remaining = number % multiple;
  if (remaining == 0)
    return number;
  else
    return number + multiple - remaining;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<round_to_next_multiple>:
  endbr64
  mov    %edi,%eax
  mov    %edi,%r8d
  cltd
  idiv   %esi
  add    %edi,%esi
  sub    %edx,%esi
  test   %edx,%edx
  cmovne %esi,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int round_to_next_multiple(int number, int multiple) {
  int remaining = number % multiple;
  if (remaining == 0)
    return number;
  else
    return number + multiple - remaining;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<round_to_next_multiple>:
  endbr64
  mov    %edi,%eax
  mov    %edi,%r8d
  cltd
  idiv   %esi
  add    %edi,%esi
  sub    %edx,%esi
  test   %edx,%edx
  cmovne %esi,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int round_to_next_multiple(int number, int multiple) {
  int remaining = number % multiple;
  if (remaining == 0)
    return number;
  else
    return number + multiple - remaining;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  cmpl   $0x2,-0x14(%rbp)
  jg     L54
  mov    $0x0,%eax
  call   <usage@plt>
  mov    $0x0,%eax
  jmp    L0
L54:
  addq   $0x8,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x63,%eax
  cmp    $0x12,%eax
  ja     L16
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D29(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D29(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x14(%rbp),%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mw_create@plt>
  test   %eax,%eax
  je     L76
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L76
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <print_stats@plt>
  jmp    L38
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_data@plt>
  jmp    L38
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dump_data@plt>
  jmp    L38
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <update_meta@plt>
  jmp    L38
L16:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L38
L76:
  nop
L38:
  mov    $0x0,%eax
L0:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D28
type: string

tool: D28: Error: Unrecognized command: %s


assistant: ```c
int main(int argc, char **argv) {
  char *cmd;
  char *fname;
  if (argc < 3) {
    usage();
    return 0;
  }
  argv++;
  cmd = *(argv++);
  fname = *(argv++);
  switch (*cmd) {
  case 'c':
    if (mw_create(fname, argv, argc)) {
      usage();
    }
    break;
  case 's':
    print_stats(fname);
    break;
  case 'f':
    get_data(fname, argv);
    break;
  case 'd':
    dump_data(fname, argv);
    break;
  case 'u':
    update_meta(fname, argv);
    break;
  default:
    printf("Error: Unrecognized command: %s\n", cmd);
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jle    L26
  mov    0x8(%rsi),%rdx
  lea    0x18(%rsi),%r9
  mov    0x10(%rsi),%r8
  movzbl (%rdx),%eax
  sub    $0x63,%eax
  cmp    $0x12,%al
  ja     L84
  movzbl %al,%eax
  lea    D11(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
L26:
  mov    $0x0,%eax
  call   <usage@plt>
L81:
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
  mov    %edi,%edx
  mov    %r9,%rsi
  mov    %r8,%rdi
  call   <mw_create@plt>
  test   %eax,%eax
  je     L81
  mov    $0x0,%eax
  call   <usage@plt>
  jmp    L81
  mov    %r8,%rdi
  call   <print_stats@plt>
  jmp    L81
  mov    %r9,%rsi
  mov    %r8,%rdi
  call   <get_data@plt>
  jmp    L81
  mov    %r9,%rsi
  mov    %r8,%rdi
  call   <dump_data@plt>
  jmp    L81
  mov    %r9,%rsi
  mov    %r8,%rdi
  call   <update_meta@plt>
  jmp    L81
L84:
  mov    %rdx,%rsi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  jmp    L81
```

tool_calls: name: extract_symbolic_data
arguments: label: D11
type_guessed: string
name: extract_symbolic_data
arguments: label: D1
type_guessed: string

tool: 

tool: D1: Error: Unrecognized command: %s


assistant: ```c
int main(int argc, char **argv) {
  char *cmd;
  char *fname;
  if (argc < 3) {
    usage();
    return 0;
  }
  argv++;
  cmd = *(argv++);
  fname = *(argv++);
  switch (*cmd) {
  case 'c':
    if (mw_create(fname, argv, argc)) {
      usage();
    }
    break;
  case 's':
    print_stats(fname);
    break;
  case 'f':
    get_data(fname, argv);
    break;
  case 'd':
    dump_data(fname, argv);
    break;
  case 'u':
    update_meta(fname, argv);
    break;
  default:
    printf("Error: Unrecognized command: %s\n", cmd);
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jle    L44
  mov    0x8(%rsi),%r8
  mov    %edi,%edx
  lea    0x18(%rsi),%r9
  mov    0x10(%rsi),%rdi
  movzbl (%r8),%eax
  sub    $0x63,%eax
  cmp    $0x12,%al
  ja     L77
  lea    D14(%rip),%rcx
  movzbl %al,%eax
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  mov    %r9,%rsi
  call   <mw_create@plt>
  test   %eax,%eax
  je     L11
L44:
  xor    %eax,%eax
  call   <usage@plt>
L11:
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
L77:
  mov    %r8,%rsi
  lea    D4(%rip),%rdi
  call   <printf@plt>
  jmp    L11
  mov    %r9,%rsi
  call   <dump_data@plt>
  jmp    L11
  mov    %r9,%rsi
  call   <get_data@plt>
  jmp    L11
  call   <print_stats@plt>
  jmp    L11
  mov    %r9,%rsi
  call   <update_meta@plt>
  jmp    L11
```

tool_calls: name: parse_data
arguments: data_label: D4
type: string

tool: D4: Error: Unrecognized command: %s


assistant: ```c
int main(int argc, char **argv) {
  char *cmd;
  char *fname;
  if (argc < 3) {
    usage();
    return 0;
  }
  argv++;
  cmd = *(argv++);
  fname = *(argv++);
  switch (*cmd) {
  case 'c':
    if (mw_create(fname, argv, argc)) {
      usage();
    }
    break;
  case 's':
    print_stats(fname);
    break;
  case 'f':
    get_data(fname, argv);
    break;
  case 'd':
    dump_data(fname, argv);
    break;
  case 'u':
    update_meta(fname, argv);
    break;
  default:
    printf("Error: Unrecognized command: %s\n", cmd);
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jle    L45
  mov    0x8(%rsi),%r8
  mov    %edi,%edx
  lea    0x18(%rsi),%r9
  mov    0x10(%rsi),%rdi
  movzbl (%r8),%eax
  sub    $0x63,%eax
  cmp    $0x12,%al
  ja     L6
  lea    D3(%rip),%rcx
  movzbl %al,%eax
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  mov    %r9,%rsi
  call   <mw_create@plt>
  test   %eax,%eax
  je     L57
L45:
  xor    %eax,%eax
  call   <usage@plt>
L57:
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
L6:
  mov    %r8,%rsi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  jmp    L57
  mov    %r9,%rsi
  call   <dump_data@plt>
  jmp    L57
  mov    %r9,%rsi
  call   <get_data@plt>
  jmp    L57
  call   <print_stats@plt>
  jmp    L57
  mov    %r9,%rsi
  call   <update_meta@plt>
  jmp    L57
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type_guessed: string

tool: D2: Error: Unrecognized command: %s


assistant: ```c
int main(int argc, char **argv) {
  char *cmd;
  char *fname;
  if (argc < 3) {
    usage();
    return 0;
  }
  argv++;
  cmd = *(argv++);
  fname = *(argv++);
  switch (*cmd) {
  case 'c':
    if (mw_create(fname, argv, argc)) {
      usage();
    }
    break;
  case 's':
    print_stats(fname);
    break;
  case 'f':
    get_data(fname, argv);
    break;
  case 'd':
    dump_data(fname, argv);
    break;
  case 'u':
    update_meta(fname, argv);
    break;
  default:
    printf("Error: Unrecognized command: %s\n", cmd);
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<PJWHash_ex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L14
L5:
  mov    -0x18(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  and    $0xf0000000,%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L28
  mov    -0x14(%rbp),%eax
  sar    $0x18,%eax
  xor    -0x18(%rbp),%eax
  and    $0xfffffff,%eax
  mov    %eax,-0x18(%rbp)
L28:
  addq   $0x1,-0x10(%rbp)
L14:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jne    L5
  mov    -0x18(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int PJWHash_ex(const void *key, const int key_len, const int init_value) {
  unsigned char *pKey;
  unsigned char *pEnd;
  int hash;
  int test;
  hash = init_value;
  pEnd = (unsigned char *)key + key_len;
  for (pKey = (unsigned char *)key; pKey != pEnd; pKey++) {
    hash = (hash << (int)((int)(sizeof(int) * 8) / 8)) + (*(pKey));
    if ((test = hash & (int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))) != 0) {
      hash = ((hash ^ (test >> (int)(((int)(sizeof(int) * 8) * 3) / 4))) & (~(int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))));
    }
  }
  return hash;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<PJWHash_ex>:
  endbr64
  mov    %edx,%eax
  movslq %esi,%rsi
  add    %rdi,%rsi
  cmp    %rsi,%rdi
  jne    L12
L11:
  ret
L25:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  je     L11
L12:
  shl    $0x4,%eax
  movzbl (%rdi),%edx
  add    %edx,%eax
  mov    %eax,%edx
  and    $0xf0000000,%edx
  je     L25
  sar    $0x18,%edx
  xor    %edx,%eax
  and    $0xfffffff,%eax
  jmp    L25
```

assistant: ```c
int PJWHash_ex(const void *key, const int key_len, const int init_value) {
  unsigned char *pKey;
  unsigned char *pEnd;
  int hash;
  int test;
  hash = init_value;
  pEnd = (unsigned char *)key + key_len;
  for (pKey = (unsigned char *)key; pKey != pEnd; pKey++) {
    hash = (hash << (int)((int)(sizeof(int) * 8) / 8)) + (*(pKey));
    if ((test = hash & (int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))) != 0) {
      hash = ((hash ^ (test >> (int)(((int)(sizeof(int) * 8) * 3) / 4))) & (~(int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))));
    }
  }
  return hash;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<PJWHash_ex>:
  endbr64
  movslq %esi,%rsi
  mov    %edx,%eax
  add    %rdi,%rsi
  cmp    %rsi,%rdi
  je     L9
  nopl   0x0(%rax)
L5:
  movzbl (%rdi),%edx
  shl    $0x4,%eax
  add    %edx,%eax
  mov    %eax,%edx
  and    $0xf0000000,%edx
  je     L18
  sar    $0x18,%edx
  xor    %edx,%eax
  and    $0xfffffff,%eax
L18:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  jne    L5
L9:
  ret
```

assistant: ```c
int PJWHash_ex(const void *key, const int key_len, const int init_value) {
  unsigned char *pKey;
  unsigned char *pEnd;
  int hash;
  int test;
  hash = init_value;
  pEnd = (unsigned char *)key + key_len;
  for (pKey = (unsigned char *)key; pKey != pEnd; pKey++) {
    hash = (hash << (int)((int)(sizeof(int) * 8) / 8)) + (*(pKey));
    if ((test = hash & (int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))) != 0) {
      hash = ((hash ^ (test >> (int)(((int)(sizeof(int) * 8) * 3) / 4))) & (~(int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))));
    }
  }
  return hash;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<PJWHash_ex>:
  endbr64
  movslq %esi,%rsi
  mov    %edx,%eax
  add    %rdi,%rsi
  cmp    %rsi,%rdi
  je     L6
  nopl   0x0(%rax)
L24:
  movzbl (%rdi),%edx
  shl    $0x4,%eax
  add    %edx,%eax
  mov    %eax,%edx
  and    $0xf0000000,%edx
  je     L11
  sar    $0x18,%edx
  xor    %edx,%eax
  and    $0xfffffff,%eax
L11:
  add    $0x1,%rdi
  cmp    %rdi,%rsi
  jne    L24
L6:
  ret
```

assistant: ```c
int PJWHash_ex(const void *key, const int key_len, const int init_value) {
  unsigned char *pKey;
  unsigned char *pEnd;
  int hash;
  int test;
  hash = init_value;
  pEnd = (unsigned char *)key + key_len;
  for (pKey = (unsigned char *)key; pKey != pEnd; pKey++) {
    hash = (hash << (int)((int)(sizeof(int) * 8) / 8)) + (*(pKey));
    if ((test = hash & (int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))) != 0) {
      hash = ((hash ^ (test >> (int)(((int)(sizeof(int) * 8) * 3) / 4))) & (~(int)((unsigned int)(0xFFFFFFFF) << ((int)(sizeof(int) * 8) - (int)((int)(sizeof(int) * 8) / 8)))));
    }
  }
  return hash;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<getstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L35
L49:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  mov    %eax,-0x4(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L63
  cmpl   $0x20,-0x4(%rbp)
  je     L63
  cmpl   $0xa,-0x4(%rbp)
  je     L63
  cmpl   $0x9,-0x4(%rbp)
  je     L63
  cmpl   $0x2c,-0x4(%rbp)
  je     L63
  cmpl   $0x3d,-0x4(%rbp)
  je     L63
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
L35:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L49
L63:
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int getstr(FILE *f, char *str) {
  int c;
  while (!feof(f)) {
    c = fgetc(f);
    if ((c == EOF) || (c == ' ') || (c == '\n') || (c == '\t') || (c == ',') || (c == '=')) {
      break;
    }
    *str++ = c;
  }
  *str = 0;
  return c;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<getstr>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  movabs $0x2000100100000600,%r13
  jmp    L23
L28:
  add    $0x1,%rbp
  mov    %bl,-0x1(%rbp)
L23:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L0
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %eax,%ebx
  mov    D0(%rip),%rax
  cmp    %ebx,(%rax)
  je     L0
  cmp    $0x3d,%ebx
  ja     L28
  bt     %rbx,%r13
  jae    L28
L0:
  movb   $0x0,0x0(%rbp)
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int getstr(FILE *f, char *str) {
  int c;
  while (!feof(f)) {
    c = fgetc(f);
    if ((c == EOF) || (c == ' ') || (c == '\n') || (c == '\t') || (c == ',') || (c == '=')) {
      break;
    }
    *str++ = c;
  }
  *str = 0;
  return c;
}
```