ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<get_varible_strlen_max>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L36
L18:
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L1
L26:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  sub    %rdx,%rax
  shl    $0x9,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x9,%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jle    L3
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L3:
  addl   $0x1,-0xc(%rbp)
L1:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L26
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x10(%rbp)
L36:
  cmpl   $0x6,-0x10(%rbp)
  jle    L18
  nop
  nop
  leave
  ret
```

assistant: ```c
void get_varible_strlen_max(int var_strlen_max[], char box_line_list[][7][512], int list_count) {
  int i, j;
  int max;
  int str_len;
  for (i = 0; i < 7; i++) {
    max = 0;
    for (j = 0; j < list_count; j++) {
      str_len = strlen(box_line_list[j][i]);
      if (str_len > max) {
        max = str_len;
      }
    }
    var_strlen_max[i] = max;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<get_varible_strlen_max>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edx,%r15d
  mov    %rdi,%r14
  mov    %rsi,%r13
  lea    0xe00(%rsi),%rcx
  mov    %rcx,0x8(%rsp)
  lea    -0x1(%rdx),%eax
  lea    0x0(,%rax,8),%r12
  sub    %rax,%r12
  shl    $0x9,%r12
  add    %rcx,%r12
L3:
  mov    %r13,%rbx
  mov    $0x0,%ebp
  test   %r15d,%r15d
  jle    L18
L12:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %eax,%ebp
  cmovl  %eax,%ebp
  add    $0xe00,%rbx
  cmp    %r12,%rbx
  jne    L12
L18:
  mov    %ebp,(%r14)
  add    $0x4,%r14
  add    $0x200,%r13
  add    $0x200,%r12
  cmp    %r13,0x8(%rsp)
  jne    L3
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void get_varible_strlen_max(int var_strlen_max[], char box_line_list[][7][512], int list_count) {
  int i, j;
  int max;
  int str_len;
  for (i = 0; i < 7; i++) {
    max = 0;
    for (j = 0; j < list_count; j++) {
      str_len = strlen(box_line_list[j][i]);
      if (str_len > max) {
        max = str_len;
      }
    }
    var_strlen_max[i] = max;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_varible_strlen_max>:
  endbr64
  push   %r15
  lea    -0x1(%rdx),%eax
  lea    0xe00(%rsi),%rcx
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    0x0(,%rax,8),%rbp
  push   %rbx
  sub    %rax,%rbp
  shl    $0x9,%rbp
  add    %rcx,%rbp
  sub    $0x18,%rsp
  mov    %rcx,0x8(%rsp)
  nopl   0x0(%rax)
L4:
  mov    %r12,%rbx
  xor    %r15d,%r15d
  test   %r14d,%r14d
  jle    L18
  nopl   0x0(%rax,%rax,1)
L13:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %eax,%r15d
  cmovl  %eax,%r15d
  add    $0xe00,%rbx
  cmp    %rbp,%rbx
  jne    L13
L18:
  mov    %r15d,0x0(%r13)
  add    $0x200,%r12
  add    $0x4,%r13
  add    $0x200,%rbp
  cmp    %r12,0x8(%rsp)
  jne    L4
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void get_varible_strlen_max(int var_strlen_max[], char box_line_list[][7][512], int list_count) {
  int i, j;
  int max;
  int str_len;
  for (i = 0; i < 7; i++) {
    max = 0;
    for (j = 0; j < list_count; j++) {
      str_len = strlen(box_line_list[j][i]);
      if (str_len > max) {
        max = str_len;
      }
    }
    var_strlen_max[i] = max;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_varible_strlen_max>:
  endbr64
  push   %r15
  lea    -0x1(%rdx),%eax
  lea    0xe00(%rsi),%rcx
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    0x0(,%rax,8),%rbp
  push   %rbx
  sub    %rax,%rbp
  shl    $0x9,%rbp
  add    %rcx,%rbp
  sub    $0x18,%rsp
  mov    %rcx,0x8(%rsp)
  nopl   0x0(%rax)
L10:
  mov    %r12,%rbx
  xor    %r15d,%r15d
  test   %r14d,%r14d
  jle    L2
  nopl   0x0(%rax,%rax,1)
L3:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    %eax,%r15d
  cmovl  %eax,%r15d
  add    $0xe00,%rbx
  cmp    %rbp,%rbx
  jne    L3
L2:
  mov    %r15d,0x0(%r13)
  add    $0x200,%r12
  add    $0x4,%r13
  add    $0x200,%rbp
  cmp    %r12,0x8(%rsp)
  jne    L10
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void get_varible_strlen_max(int var_strlen_max[], char box_line_list[][7][512], int list_count) {
  int i, j;
  int max;
  int str_len;
  for (i = 0; i < 7; i++) {
    max = 0;
    for (j = 0; j < list_count; j++) {
      str_len = strlen(box_line_list[j][i]);
      if (str_len > max) {
        max = str_len;
      }
    }
    var_strlen_max[i] = max;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<unputstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L1
L7:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <unput@plt>
  subl   $0x1,-0x4(%rbp)
L1:
  cmpl   $0x0,-0x4(%rbp)
  jns    L7
  nop
  nop
  leave
  ret
```

assistant: ```c
void unputstr(const char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0; i--)
    unput(s[i]);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<unputstr>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <strlen@plt>
  mov    %eax,%ebx
  sub    $0x1,%ebx
  js     L12
  movslq %ebx,%rbx
  add    %rbp,%rbx
  movslq %eax,%rdx
  lea    -0x2(%rbp,%rdx,1),%rbp
  lea    -0x1(%rax),%eax
  sub    %rax,%rbp
L10:
  movsbl (%rbx),%edi
  call   <unput@plt>
  sub    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L10
L12:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void unputstr(const char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0; i--)
    unput(s[i]);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<unputstr>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %eax,%edx
  sub    $0x1,%edx
  js     L17
  movslq %edx,%rbx
  cltq
  mov    %edx,%edx
  add    %rbp,%rbx
  lea    -0x2(%rbp,%rax,1),%rbp
  sub    %rdx,%rbp
  nopl   0x0(%rax,%rax,1)
L12:
  movsbl (%rbx),%edi
  sub    $0x1,%rbx
  call   <unput@plt>
  cmp    %rbp,%rbx
  jne    L12
L17:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void unputstr(const char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0; i--)
    unput(s[i]);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<unputstr>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %eax,%edx
  sub    $0x1,%edx
  js     L16
  movslq %edx,%rbx
  cltq
  mov    %edx,%edx
  add    %rbp,%rbx
  lea    -0x2(%rbp,%rax,1),%rbp
  sub    %rdx,%rbp
  nopl   0x0(%rax,%rax,1)
L2:
  movsbl (%rbx),%edi
  sub    $0x1,%rbx
  call   <unput@plt>
  cmp    %rbp,%rbx
  jne    L2
L16:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void unputstr(const char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0; i--)
    unput(s[i]);
}
```
user: Translate the below assembly code into C programming language:

```asm
<fgets>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L10
L11:
  cmpl   $0xa,-0xc(%rbp)
  je     L77
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
L10:
  subl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jle    L1
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0xc(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L11
  jmp    L1
L77:
  nop
L1:
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L13
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L13
  mov    $0x0,%eax
  jmp    L53
L13:
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L53:
  leave
  ret
```

assistant: ```c
char *fgets(char *str, int n, FILE *stream) {
  int c = EOF;
  char *p = str;
  while ((--n > 0) && ((c = getc(stream)) != EOF)) {
    if (c == '\n')
      break;
    *p++ = c;
  }
  if ((c == EOF) && (p == str))
    return (NULL);
  *p = '\0';
  return (str);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<fgets>:
  endbr64
  cmp    $0x1,%esi
  jle    L45
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rdx,%rbp
  lea    -0x2(%rsi),%eax
  lea    0x1(%rdi,%rax,1),%r12
  mov    %rdi,%rbx
L48:
  mov    %rbp,%rdi
  call   <getc@plt>
  mov    D15(%rip),%rdx
  cmp    %eax,(%rdx)
  je     L49
  cmp    $0xa,%eax
  je     L49
  add    $0x1,%rbx
  mov    %al,-0x1(%rbx)
  cmp    %r12,%rbx
  jne    L48
  mov    %r12,%rbx
L49:
  mov    D15(%rip),%rdx
  cmp    %eax,(%rdx)
  jne    L3
  cmp    %rbx,%r13
  je     L37
L3:
  movb   $0x0,(%rbx)
  mov    %r13,%rax
L11:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L45:
  mov    $0x0,%eax
  ret
L37:
  mov    $0x0,%eax
  jmp    L11
```

assistant: ```c
char *fgets(char *str, int n, FILE *stream) {
  int c = EOF;
  char *p = str;
  while ((--n > 0) && ((c = getc(stream)) != EOF)) {
    if (c == '\n')
      break;
    *p++ = c;
  }
  if ((c == EOF) && (p == str))
    return (NULL);
  *p = '\0';
  return (str);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fgets>:
  endbr64
  cmp    $0x1,%esi
  jle    L18
  lea    -0x2(%rsi),%eax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  lea    0x1(%rdi,%rax,1),%r12
  push   %rbp
  mov    D6(%rip),%rbp
  push   %rbx
  mov    %rdx,%rbx
  jmp    L9
  nop
L16:
  cmp    $0xa,%eax
  je     L98
  add    $0x1,%r14
  mov    %al,-0x1(%r14)
  cmp    %r12,%r14
  je     L30
L9:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    0x0(%rbp),%edx
  cmp    %eax,%edx
  jne    L16
L98:
  cmp    %r14,%r13
  je     L66
L21:
  movb   $0x0,(%r14)
  mov    %r13,%rax
L59:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L66:
  cmp    %eax,%edx
  jne    L21
  xor    %eax,%eax
  jmp    L59
  nopl   0x0(%rax,%rax,1)
L30:
  mov    0x0(%rbp),%edx
  cmp    %r14,%r13
  jne    L21
  jmp    L66
L18:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *fgets(char *str, int n, FILE *stream) {
  int c = EOF;
  char *p = str;
  while ((--n > 0) && ((c = getc(stream)) != EOF)) {
    if (c == '\n')
      break;
    *p++ = c;
  }
  if ((c == EOF) && (p == str))
    return (NULL);
  *p = '\0';
  return (str);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<fgets>:
  endbr64
  cmp    $0x1,%esi
  jle    L94
  lea    -0x2(%rsi),%eax
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  lea    0x1(%rdi,%rax,1),%r12
  push   %rbp
  mov    D3(%rip),%rbp
  push   %rbx
  mov    %rdx,%rbx
  jmp    L17
  nop
L54:
  cmp    $0xa,%eax
  je     L46
  add    $0x1,%r14
  mov    %al,-0x1(%r14)
  cmp    %r12,%r14
  je     L15
L17:
  mov    %rbx,%rdi
  call   <getc@plt>
  mov    0x0(%rbp),%edx
  cmp    %eax,%edx
  jne    L54
L46:
  cmp    %r14,%r13
  je     L83
L78:
  movb   $0x0,(%r14)
  mov    %r13,%rax
L1:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L83:
  cmp    %eax,%edx
  jne    L78
  xor    %eax,%eax
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L15:
  mov    0x0(%rbp),%edx
  cmp    %r14,%r13
  jne    L78
  jmp    L83
L94:
  xor    %eax,%eax
  ret
```

assistant: ```c
char *fgets(char *str, int n, FILE *stream) {
  int c = EOF;
  char *p = str;
  while ((--n > 0) && ((c = getc(stream)) != EOF)) {
    if (c == '\n')
      break;
    *p++ = c;
  }
  if ((c == EOF) && (p == str))
    return (NULL);
  *p = '\0';
  return (str);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<vecteur_intersection>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L24
L77:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L74
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x40(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  movl   $0x0,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
L74:
  addl   $0x1,-0x10(%rbp)
L61:
  mov    -0x10(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L21
  cmpl   $0x1,-0xc(%rbp)
  je     L77
L21:
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L24:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L61
  movl   $0x0,-0x14(%rbp)
  jmp    L32
L81:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <ExisteElem@plt>
  test   %rax,%rax
  je     L58
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  lea    -0x18(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <DeleteElem@plt>
L58:
  addl   $0x1,-0x14(%rbp)
L32:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L81
  mov    -0x18(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
int vecteur_intersection(int vecteur1[], int size1, int vecteur2[], int size2, int vecteur3[], int *size3) {
  int i;
  int j = 0;
  int test = 1;
  int k = 0;
  for (i = 0; i < size1; i++) {
    while ((j < size2) && (test == 1)) {
      if (vecteur1[i] == vecteur2[j]) {
        vecteur3[k] = vecteur1[i];
        test = 0;
        k++;
      }
      j++;
    }
    j = 0;
    test = 1;
  }
  for (i = 0; i < k; i++) {
    if (ExisteElem(vecteur3, k, vecteur3[i + 1]))
      DeleteElem(vecteur3, &k, i + 1);
  }
  *size3 = k;
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<vecteur_intersection>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,%r11
  mov    %r9,%rbp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x8(%rsp)
  xor    %edx,%edx
  movl   $0x0,0x4(%rsp)
  test   %esi,%esi
  jle    L84
  mov    %ecx,%r10d
  mov    %r8,%rbx
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%r12
  lea    -0x1(%rcx),%eax
  lea    0x4(%r11,%rax,4),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x1,%r9d
  jmp    L60
L47:
  add    $0x4,%rax
  cmp    %rsi,%rax
  je     L39
L145:
  cmp    (%rax),%edx
  jne    L47
  movslq %ecx,%rax
  mov    %edx,(%rbx,%rax,4)
  add    $0x1,%ecx
  mov    %r9d,%r8d
L39:
  add    $0x4,%rdi
  cmp    %r12,%rdi
  je     L94
L60:
  test   %r10d,%r10d
  jle    L39
  mov    (%rdi),%edx
  mov    %r11,%rax
  jmp    L145
L94:
  test   %r8b,%r8b
  je     L143
  mov    %ecx,0x4(%rsp)
  mov    %ecx,%esi
  test   %ecx,%ecx
  jle    L79
  mov    $0x1,%r12d
  lea    0x4(%rsp),%r13
  jmp    L4
L88:
  mov    0x4(%rsp),%esi
  add    $0x1,%r12
  lea    -0x1(%r12),%eax
  cmp    %eax,%esi
  jle    L79
L4:
  mov    (%rbx,%r12,4),%edx
  mov    %rbx,%rdi
  call   <ExisteElem@plt>
  test   %rax,%rax
  je     L88
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <DeleteElem@plt>
  jmp    L88
L84:
  mov    $0x0,%esi
L79:
  mov    %esi,0x0(%rbp)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L104
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L143:
  mov    0x4(%rsp),%esi
  jmp    L79
L104:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int vecteur_intersection(int vecteur1[], int size1, int vecteur2[], int size2, int vecteur3[], int *size3) {
  int i;
  int j = 0;
  int test = 1;
  int k = 0;
  for (i = 0; i < size1; i++) {
    while ((j < size2) && (test == 1)) {
      if (vecteur1[i] == vecteur2[j]) {
        vecteur3[k] = vecteur1[i];
        test = 0;
        k++;
      }
      j++;
    }
    j = 0;
    test = 1;
  }
  for (i = 0; i < k; i++) {
    if (ExisteElem(vecteur3, k, vecteur3[i + 1]))
      DeleteElem(vecteur3, &k, i + 1);
  }
  *size3 = k;
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<vecteur_intersection>:
  endbr64
  push   %r14
  mov    %rdx,%r11
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x8(%rsp)
  xor    %edx,%edx
  movl   $0x0,0x4(%rsp)
  test   %esi,%esi
  jle    L82
  mov    %esi,%eax
  mov    %ecx,%r10d
  mov    %r8,%rbp
  xor    %esi,%esi
  sub    $0x1,%eax
  xor    %r8d,%r8d
  lea    0x4(%rdi,%rax,4),%r9
  lea    -0x1(%rcx),%eax
  lea    0x4(%r11,%rax,4),%rcx
  nopl   0x0(%rax,%rax,1)
L97:
  test   %r10d,%r10d
  jle    L8
  mov    (%rdi),%edx
  mov    %r11,%rax
  jmp    L93
  nopl   0x0(%rax)
L112:
  add    $0x4,%rax
  cmp    %rcx,%rax
  je     L8
L93:
  cmp    (%rax),%edx
  jne    L112
  movslq %esi,%rax
  mov    $0x1,%r8d
  add    $0x1,%esi
  mov    %edx,0x0(%rbp,%rax,4)
L8:
  add    $0x4,%rdi
  cmp    %r9,%rdi
  jne    L97
  test   %r8b,%r8b
  je     L82
  mov    %esi,0x4(%rsp)
  test   %esi,%esi
  je     L110
  mov    $0x1,%r12d
  lea    0x4(%rsp),%r13
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L95:
  add    $0x1,%r12
  mov    0x4(%rsp),%esi
  lea    -0x1(%r12),%eax
  cmp    %eax,%esi
  jle    L110
L57:
  mov    0x0(%rbp,%r12,4),%edx
  mov    %rbp,%rdi
  call   <ExisteElem@plt>
  test   %rax,%rax
  je     L95
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <DeleteElem@plt>
  jmp    L95
L82:
  xor    %esi,%esi
L110:
  mov    %esi,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L59:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int vecteur_intersection(int vecteur1[], int size1, int vecteur2[], int size2, int vecteur3[], int *size3) {
  int i;
  int j = 0;
  int test = 1;
  int k = 0;
  for (i = 0; i < size1; i++) {
    while ((j < size2) && (test == 1)) {
      if (vecteur1[i] == vecteur2[j]) {
        vecteur3[k] = vecteur1[i];
        test = 0;
        k++;
      }
      j++;
    }
    j = 0;
    test = 1;
  }
  for (i = 0; i < k; i++) {
    if (ExisteElem(vecteur3, k, vecteur3[i + 1]))
      DeleteElem(vecteur3, &k, i + 1);
  }
  *size3 = k;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<vecteur_intersection>:
  endbr64
  push   %r14
  mov    %rdx,%r11
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x8(%rsp)
  xor    %edx,%edx
  movl   $0x0,0x4(%rsp)
  test   %esi,%esi
  jle    L57
  mov    %esi,%eax
  mov    %ecx,%r10d
  mov    %r8,%rbp
  xor    %esi,%esi
  sub    $0x1,%eax
  xor    %r8d,%r8d
  lea    0x4(%rdi,%rax,4),%r9
  lea    -0x1(%rcx),%eax
  lea    0x4(%r11,%rax,4),%rcx
  nopl   0x0(%rax,%rax,1)
L117:
  test   %r10d,%r10d
  jle    L86
  mov    (%rdi),%edx
  mov    %r11,%rax
  jmp    L127
  nopl   0x0(%rax)
L71:
  add    $0x4,%rax
  cmp    %rax,%rcx
  je     L86
L127:
  cmp    (%rax),%edx
  jne    L71
  movslq %esi,%rax
  mov    $0x1,%r8d
  add    $0x1,%esi
  mov    %edx,0x0(%rbp,%rax,4)
L86:
  add    $0x4,%rdi
  cmp    %r9,%rdi
  jne    L117
  test   %r8b,%r8b
  je     L57
  mov    %esi,0x4(%rsp)
  test   %esi,%esi
  je     L59
  mov    $0x1,%r12d
  lea    0x4(%rsp),%r14
  nopw   0x0(%rax,%rax,1)
L138:
  mov    0x0(%rbp,%r12,4),%edx
  mov    %rbp,%rdi
  call   <ExisteElem@plt>
  test   %rax,%rax
  jne    L15
  add    $0x1,%r12
  mov    0x4(%rsp),%esi
  lea    -0x1(%r12),%eax
  cmp    %eax,%esi
  jg     L138
L59:
  mov    %esi,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L15:
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r12
  call   <DeleteElem@plt>
  mov    0x4(%rsp),%esi
  lea    -0x1(%r12),%eax
  cmp    %esi,%eax
  jl     L138
  jmp    L59
L57:
  xor    %esi,%esi
  jmp    L59
L110:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int vecteur_intersection(int vecteur1[], int size1, int vecteur2[], int size2, int vecteur3[], int *size3) {
  int i;
  int j = 0;
  int test = 1;
  int k = 0;
  for (i = 0; i < size1; i++) {
    while ((j < size2) && (test == 1)) {
      if (vecteur1[i] == vecteur2[j]) {
        vecteur3[k] = vecteur1[i];
        test = 0;
        k++;
      }
      j++;
    }
    j = 0;
    test = 1;
  }
  for (i = 0; i < k; i++) {
    if (ExisteElem(vecteur3, k, vecteur3[i + 1]))
      DeleteElem(vecteur3, &k, i + 1);
  }
  *size3 = k;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<arm_fleet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getint@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  js     L3
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L3
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <modstats@plt>
  jmp    L19
L3:
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L19:
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D3
type: string
name: parse_data
arguments: label: D19
type: string

tool: D3: Please select starship index:


tool: D19: Bad index!


assistant: ```c
void arm_fleet(int *starships[], int starships_num) {
  int selection = 0;
  printf("Please select starship index:\n");
  selection = getint();
  if (selection >= 0 && selection < starships_num) {
    modstats(starships[selection]);
  } else {
    printf("Bad index!\n");
  }
}
```