ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here:

```asm
<weapon_bit_name>:
  endbr64
  push   %rbp
  lea    D31(%rip),%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  and    $0x1,%edi
  movb   $0x0,D31(%rip)
  jne    L39
  test   $0x2,%bl
  jne    L148
L91:
  test   $0x4,%bl
  jne    L119
L29:
  test   $0x8,%bl
  jne    L74
L2:
  test   $0x10,%bl
  jne    L6
L126:
  test   $0x20,%bl
  jne    L82
L81:
  test   $0x40,%bl
  jne    L137
L16:
  and    $0x80,%ebx
  jne    L125
L77:
  cmpb   $0x0,D31(%rip)
  lea    D42(%rip),%rax
  lea    D38(%rip),%rdx
  cmove  %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L39:
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bl
  je     L91
L148:
  lea    D129(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bl
  je     L29
L119:
  lea    D81(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bl
  je     L2
L74:
  lea    D73(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bl
  je     L126
L6:
  lea    D39(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bl
  je     L81
L82:
  lea    D51(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bl
  je     L16
L137:
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  and    $0x80,%ebx
  je     L77
L125:
  lea    D70(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L77
```

tool_calls: name: unpack_data
arguments: label: D38
data_type: string
name: unpack_data
arguments: label: D11
data_type: string
name: unpack_data
arguments: label: D129
data_type: string
name: unpack_data
arguments: label: D81
data_type: string
name: unpack_data
arguments: label: D73
data_type: string
name: unpack_data
arguments: label: D39
data_type: string
name: unpack_data
arguments: label: D51
data_type: string
name: unpack_data
arguments: label: D19
data_type: string
name: unpack_data
arguments: label: D70
data_type: string

tool: D38: none

tool: D11:  flaming

tool: D129:  frost

tool: D81:  vampiric

tool: D73:  sharp

tool: D39:  vorpal

tool: D51:  two-handed

tool: D19:  shocking

tool: D70:  poison

assistant: ```c
char *weapon_bit_name(int weapon_flags) {
  static char buf[512];
  buf[0] = '\0';
  if (weapon_flags & (1))
    strcat(buf, " flaming");
  if (weapon_flags & (2))
    strcat(buf, " frost");
  if (weapon_flags & (4))
    strcat(buf, " vampiric");
  if (weapon_flags & (8))
    strcat(buf, " sharp");
  if (weapon_flags & (16))
    strcat(buf, " vorpal");
  if (weapon_flags & (32))
    strcat(buf, " two-handed");
  if (weapon_flags & (64))
    strcat(buf, " shocking");
  if (weapon_flags & (128))
    strcat(buf, " poison");
  return (buf[0] != '\0') ? buf + 1 : "none";
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<weapon_bit_name>:
  endbr64
  push   %rbp
  lea    D52(%rip),%rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x8,%rsp
  and    $0x1,%edi
  movb   $0x0,D52(%rip)
  jne    L141
  test   $0x2,%bl
  jne    L52
L113:
  test   $0x4,%bl
  jne    L152
L24:
  test   $0x8,%bl
  jne    L85
L123:
  test   $0x10,%bl
  jne    L98
L122:
  test   $0x20,%bl
  jne    L40
L28:
  test   $0x40,%bl
  jne    L46
L7:
  and    $0x80,%ebx
  jne    L109
L45:
  cmpb   $0x0,D52(%rip)
  lea    D66(%rip),%rax
  lea    D60(%rip),%rdx
  cmove  %rdx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L141:
  lea    D88(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x2,%bl
  je     L113
L52:
  lea    D2(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x4,%bl
  je     L24
L152:
  lea    D102(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x8,%bl
  je     L123
L85:
  lea    D50(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x10,%bl
  je     L122
L98:
  lea    D56(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x20,%bl
  je     L28
L40:
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  test   $0x40,%bl
  je     L7
L46:
  lea    D3(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  and    $0x80,%ebx
  je     L45
L109:
  lea    D79(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L45
```

tool_calls: name: parse_data
arguments: data_label: D60
type_guessed: string
name: parse_data
arguments: data_label: D88
type_guessed: string
name: parse_data
arguments: data_label: D2
type_guessed: string
name: parse_data
arguments: data_label: D102
type_guessed: string
name: parse_data
arguments: data_label: D50
type_guessed: string
name: parse_data
arguments: data_label: D56
type_guessed: string
name: parse_data
arguments: data_label: D95
type_guessed: string
name: parse_data
arguments: data_label: D3
type_guessed: string
name: parse_data
arguments: data_label: D79
type_guessed: string

tool: D60: none

tool: D88:  flaming

tool: D2:  frost

tool: D102:  vampiric

tool: D50:  sharp

tool: D56:  vorpal

tool: D95:  two-handed

tool: D3:  shocking

tool: D79:  poison

assistant: ```c
char *weapon_bit_name(int weapon_flags) {
  static char buf[512];
  buf[0] = '\0';
  if (weapon_flags & (1))
    strcat(buf, " flaming");
  if (weapon_flags & (2))
    strcat(buf, " frost");
  if (weapon_flags & (4))
    strcat(buf, " vampiric");
  if (weapon_flags & (8))
    strcat(buf, " sharp");
  if (weapon_flags & (16))
    strcat(buf, " vorpal");
  if (weapon_flags & (32))
    strcat(buf, " two-handed");
  if (weapon_flags & (64))
    strcat(buf, " shocking");
  if (weapon_flags & (128))
    strcat(buf, " poison");
  return (buf[0] != '\0') ? buf + 1 : "none";
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<IF_gplot_append>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <getParLong@plt>
  test   %rax,%rax
  je     L13
  mov    $0x0,%eax
  call   <is1Tab@plt>
  test   %eax,%eax
  jne    L5
  mov    $0xc,%edi
  call   <messErr@plt>
  jmp    L13
L5:
  mov    -0x10(%rbp),%rax
  cwtl
  mov    %eax,%edi
  call   <GP_addData@plt>
L13:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

assistant: ```c
void IF_gplot_append(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_addData((short)t);
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<IF_gplot_append>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <getParLong@plt>
  test   %rax,%rax
  jne    L36
L38:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x18,%rsp
  ret
L36:
  mov    $0x0,%eax
  call   <is1Tab@plt>
  test   %eax,%eax
  je     L43
  movswl (%rsp),%edi
  call   <GP_addData@plt>
  jmp    L38
L43:
  mov    $0xc,%edi
  call   <messErr@plt>
  jmp    L38
L40:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void IF_gplot_append(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_addData((short)t);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<IF_gplot_append>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <getParLong@plt>
  test   %rax,%rax
  jne    L33
L15:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  add    $0x18,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L33:
  xor    %eax,%eax
  call   <is1Tab@plt>
  test   %eax,%eax
  je     L42
  movswl (%rsp),%edi
  call   <GP_addData@plt>
  jmp    L15
  cs nopw 0x0(%rax,%rax,1)
L42:
  mov    $0xc,%edi
  call   <messErr@plt>
  jmp    L15
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void IF_gplot_append(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_addData((short)t);
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<IF_gplot_append>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <getParLong@plt>
  test   %rax,%rax
  jne    L22
L8:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x18,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  xor    %eax,%eax
  call   <is1Tab@plt>
  test   %eax,%eax
  je     L16
  movswl (%rsp),%edi
  call   <GP_addData@plt>
  jmp    L8
  cs nopw 0x0(%rax,%rax,1)
L16:
  mov    $0xc,%edi
  call   <messErr@plt>
  jmp    L8
L19:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void IF_gplot_append(void) {
  long t;
  if (getParLong(&t)) {
    if (!is1Tab()) {
      messErr(12);
      return;
    }
    GP_addData((short)t);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L6
L14:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %eax,-0x8(%rbp)
  addl   $0x1,-0x4(%rbp)
L6:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L14
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int foo(int *a, int n) {
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i];
  }
  return sum;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<foo>:
  endbr64
  test   %esi,%esi
  jle    L23
  mov    %rdi,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%rdi,%rdx,4),%rcx
  mov    $0x0,%edx
L6:
  add    (%rax),%edx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L6
L0:
  mov    %edx,%eax
  ret
L23:
  mov    $0x0,%edx
  jmp    L0
```

assistant: ```c
int foo(int *a, int n) {
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i];
  }
  return sum;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<foo>:
  endbr64
  test   %esi,%esi
  jle    L19
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%rdx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L2:
  add    (%rdi),%eax
  add    $0x4,%rdi
  cmp    %rdx,%rdi
  jne    L2
  ret
  nopl   0x0(%rax)
L19:
  xor    %eax,%eax
  ret
```

assistant: ```c
int foo(int *a, int n) {
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i];
  }
  return sum;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<foo>:
  endbr64
  mov    %rdi,%rdx
  test   %esi,%esi
  jle    L6
  lea    -0x1(%rsi),%eax
  cmp    $0x2,%eax
  jbe    L5
  mov    %esi,%ecx
  mov    %rdi,%rax
  pxor   %xmm0,%xmm0
  shr    $0x2,%ecx
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%rdi,%rcx,1),%rcx
  nopl   0x0(%rax,%rax,1)
L62:
  movdqu (%rax),%xmm2
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  cmp    %rcx,%rax
  jne    L62
  movdqa %xmm0,%xmm1
  mov    %esi,%ecx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%ecx
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%eax
  test   $0x3,%sil
  je     L51
L15:
  movslq %ecx,%rdi
  lea    0x0(,%rdi,4),%r8
  add    (%rdx,%rdi,4),%eax
  lea    0x1(%rcx),%edi
  cmp    %edi,%esi
  jle    L55
  add    $0x2,%ecx
  add    0x4(%rdx,%r8,1),%eax
  cmp    %ecx,%esi
  jle    L55
  add    0x8(%rdx,%r8,1),%eax
  ret
  nopl   0x0(%rax)
L6:
  xor    %eax,%eax
L55:
  ret
  nopl   0x0(%rax,%rax,1)
L51:
  ret
L5:
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L15
```

assistant: ```c
int foo(int *a, int n) {
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i];
  }
  return sum;
}
```
user: What is the c source code of the assembly code below?

```asm
<count_common_nodes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  test   %rax,%rax
  je     L62
  mov    -0x30(%rbp),%rax
  test   %rax,%rax
  jne    L30
L62:
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
  jmp    L56
L30:
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x18(%rbp)
L88:
  lea    -0x20(%rbp),%rdx
  lea    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <next_node@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  jne    L105
  cmpq   $0x0,-0x10(%rbp)
  je     L105
  lea    -0x20(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <next_node@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  jne    L105
  cmpq   $0x0,-0x18(%rbp)
  je     L105
  mov    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    $0x3e8,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L104
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  addl   $0x1,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
  jmp    L88
L104:
  nop
L105:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  je     L89
  mov    -0x20(%rbp),%eax
  jmp    L56
L89:
  mov    -0x1c(%rbp),%eax
L56:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

assistant: ```c
int count_common_nodes(char *to, char *from) {
  int err, common;
  char *to_node, *from_node;
  if (!to || !from)
    return -EINVAL;
  err = 0;
  common = 0;
  to_node = NULL;
  from_node = NULL;
  do {
    to_node = next_node(&to, &err);
    if (err || !to_node)
      break;
    from_node = next_node(&from, &err);
    if (err || !from_node)
      break;
    if (strncmp(to_node, from_node, 1000))
      break;
    ++to;
    ++from;
    ++common;
    do {
      free(to_node);
      to_node = NULL;
    } while (0);
    do {
      free(from_node);
      from_node = NULL;
    } while (0);
  } while (1);
  do {
    free(to_node);
    to_node = NULL;
  } while (0);
  do {
    free(from_node);
    from_node = NULL;
  } while (0);
  if (err)
    return err;
  return common;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<count_common_nodes>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  test   %rdi,%rdi
  je     L93
  test   %rsi,%rsi
  je     L93
  movl   $0x0,0x14(%rsp)
  mov    $0x0,%r12d
  lea    0x14(%rsp),%r13
L46:
  lea    0x8(%rsp),%rdi
  mov    %r13,%rsi
  call   <next_node@plt>
  mov    %rax,%rbx
  cmpl   $0x0,0x14(%rsp)
  jne    L63
  test   %rax,%rax
  je     L63
  mov    %rsp,%rdi
  mov    %r13,%rsi
  call   <next_node@plt>
  mov    %rax,%rbp
  cmpl   $0x0,0x14(%rsp)
  jne    L24
  test   %rax,%rax
  je     L24
  mov    $0x3e8,%edx
  mov    %rax,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L24
  addq   $0x1,0x8(%rsp)
  addq   $0x1,(%rsp)
  add    $0x1,%r12d
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L46
L93:
  mov    D6(%rip),%rax
  mov    (%rax),%r12d
  neg    %r12d
  jmp    L23
L63:
  mov    $0x0,%ebp
L24:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  cmovne %eax,%r12d
L23:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  mov    %r12d,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int count_common_nodes(char *to, char *from) {
  int err, common;
  char *to_node, *from_node;
  if (!to || !from)
    return -EINVAL;
  err = 0;
  common = 0;
  to_node = NULL;
  from_node = NULL;
  do {
    to_node = next_node(&to, &err);
    if (err || !to_node)
      break;
    from_node = next_node(&from, &err);
    if (err || !from_node)
      break;
    if (strncmp(to_node, from_node, 1000))
      break;
    ++to;
    ++from;
    ++common;
    do {
      free(to_node);
      to_node = NULL;
    } while (0);
    do {
      free(from_node);
      from_node = NULL;
    } while (0);
  } while (1);
  do {
    free(to_node);
    to_node = NULL;
  } while (0);
  do {
    free(from_node);
    from_node = NULL;
  } while (0);
  if (err)
    return err;
  return common;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<count_common_nodes>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  test   %rdi,%rdi
  je     L80
  test   %rsi,%rsi
  je     L80
  xor    %r12d,%r12d
  lea    0x14(%rsp),%rbx
  lea    0x8(%rsp),%r13
  mov    %rsp,%r14
  movl   $0x0,0x14(%rsp)
  jmp    L9
  nopw   0x0(%rax,%rax,1)
L65:
  test   %rax,%rax
  je     L66
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <next_node@plt>
  mov    %rax,%r15
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jne    L57
  test   %r15,%r15
  je     L57
  mov    $0x3e8,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L57
  mov    %rbp,%rdi
  addq   $0x1,0x8(%rsp)
  add    $0x1,%r12d
  addq   $0x1,(%rsp)
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
L9:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <next_node@plt>
  mov    0x14(%rsp),%edx
  mov    %rax,%rbp
  test   %edx,%edx
  je     L65
L66:
  xor    %r15d,%r15d
L57:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  cmovne %eax,%r12d
L51:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L80:
  mov    D0(%rip),%rax
  mov    (%rax),%r12d
  neg    %r12d
  jmp    L51
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int count_common_nodes(char *to, char *from) {
  int err, common;
  char *to_node, *from_node;
  if (!to || !from)
    return -EINVAL;
  err = 0;
  common = 0;
  to_node = NULL;
  from_node = NULL;
  do {
    to_node = next_node(&to, &err);
    if (err || !to_node)
      break;
    from_node = next_node(&from, &err);
    if (err || !from_node)
      break;
    if (strncmp(to_node, from_node, 1000))
      break;
    ++to;
    ++from;
    ++common;
    do {
      free(to_node);
      to_node = NULL;
    } while (0);
    do {
      free(from_node);
      from_node = NULL;
    } while (0);
  } while (1);
  do {
    free(to_node);
    to_node = NULL;
  } while (0);
  do {
    free(from_node);
    from_node = NULL;
  } while (0);
  if (err)
    return err;
  return common;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<count_common_nodes>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,(%rsp)
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  test   %rdi,%rdi
  je     L47
  test   %rsi,%rsi
  je     L47
  xor    %r12d,%r12d
  lea    0x14(%rsp),%rbx
  lea    0x8(%rsp),%r13
  mov    %rsp,%r14
  movl   $0x0,0x14(%rsp)
  jmp    L23
  nopw   0x0(%rax,%rax,1)
L99:
  test   %rax,%rax
  je     L24
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <next_node@plt>
  mov    %rax,%r15
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jne    L84
  test   %r15,%r15
  je     L84
  mov    $0x3e8,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L84
  mov    %rbp,%rdi
  addq   $0x1,0x8(%rsp)
  add    $0x1,%r12d
  addq   $0x1,(%rsp)
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
L23:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <next_node@plt>
  mov    0x14(%rsp),%edx
  mov    %rax,%rbp
  test   %edx,%edx
  je     L99
L24:
  xor    %r15d,%r15d
L84:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  cmovne %eax,%r12d
L39:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L47:
  mov    D5(%rip),%rax
  mov    (%rax),%r12d
  neg    %r12d
  jmp    L39
L53:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int count_common_nodes(char *to, char *from) {
  int err, common;
  char *to_node, *from_node;
  if (!to || !from)
    return -EINVAL;
  err = 0;
  common = 0;
  to_node = NULL;
  from_node = NULL;
  do {
    to_node = next_node(&to, &err);
    if (err || !to_node)
      break;
    from_node = next_node(&from, &err);
    if (err || !from_node)
      break;
    if (strncmp(to_node, from_node, 1000))
      break;
    ++to;
    ++from;
    ++common;
    do {
      free(to_node);
      to_node = NULL;
    } while (0);
    do {
      free(from_node);
      from_node = NULL;
    } while (0);
  } while (1);
  do {
    free(to_node);
    to_node = NULL;
  } while (0);
  do {
    free(from_node);
    from_node = NULL;
  } while (0);
  if (err)
    return err;
  return common;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<tindice>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <tintoi@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <tintoi@plt>
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L13
L9:
  mov    $0x0,%eax
  call   <lrand48@plt>
  cqto
  idivq  -0x8(%rbp)
  mov    %rdx,%rax
  add    $0x1,%rax
  add    %rax,-0x18(%rbp)
  addq   $0x1,-0x20(%rbp)
L13:
  mov    -0x20(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jl     L9
  pxor   %xmm0,%xmm0
  cvtsi2sdq -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double tindice(char *left, char *right) {
  long long cnt, numdice, sizedice, sum;
  numdice = (long long)tintoi(left);
  sizedice = (long long)tintoi(right);
  for (cnt = sum = 0; cnt < numdice; cnt++) {
    sum += lrand48() % sizedice + 1;
  }
  return (double)sum;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<tindice>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbx
  call   <tintoi@plt>
  mov    %rax,%r13
  mov    %rbx,%rdi
  call   <tintoi@plt>
  test   %r13,%r13
  jle    L4
  mov    %rax,%rbp
  mov    $0x0,%r12d
  mov    $0x0,%ebx
L28:
  mov    $0x0,%eax
  call   <lrand48@plt>
  cqto
  idiv   %rbp
  lea    0x1(%r12,%rdx,1),%r12
  add    $0x1,%rbx
  cmp    %rbx,%r13
  jne    L28
L1:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12,%xmm0
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L4:
  mov    $0x0,%r12d
  jmp    L1
```

assistant: ```c
double tindice(char *left, char *right) {
  long long cnt, numdice, sizedice, sum;
  numdice = (long long)tintoi(left);
  sizedice = (long long)tintoi(right);
  for (cnt = sum = 0; cnt < numdice; cnt++) {
    sum += lrand48() % sizedice + 1;
  }
  return (double)sum;
}
```