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

```asm
<strstrx>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <strdup@plt>
  mov    %rbp,%rdi
  mov    %rax,%r12
  mov    %rax,0x8(%rsp)
  call   <strdup@plt>
  mov    %r12,%rdi
  mov    %rax,0x10(%rsp)
  call   <mkupper@plt>
  mov    0x10(%rsp),%rdi
  call   <mkupper@plt>
  mov    0x8(%rsp),%rbp
  mov    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  lea    0x8(%rsp),%rdi
  mov    %rax,%r12
  sub    %rbp,%rax
  add    %rax,%rbx
  test   %r12,%r12
  cmovne %rbx,%r12
  call   <freestring@plt>
  lea    0x10(%rsp),%rdi
  call   <freestring@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x20,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *strstrx(char *s1, char *s2) {
  char *ss1, *ss2, *spt;
  ss1 = strdup(s1);
  ss2 = strdup(s2);
  mkupper(ss1);
  mkupper(ss2);
  spt = strstr(ss1, ss2);
  if (spt != NULL) {
    spt = s1 + (spt - ss1);
  }
  freestring(&ss1);
  freestring(&ss2);
  return spt;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xfc0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xfb0(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x1f4,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movl   $0x0,-0xfc0(%rbp)
  jmp    L94
L66:
  cmpl   $0x20,-0xfb4(%rbp)
  je     L7
  cmpl   $0x9,-0xfb4(%rbp)
  jne    L133
L7:
  mov    -0xfc0(%rbp),%eax
  cltq
  mov    -0xfb4(%rbp),%edx
  mov    %edx,-0xfb0(%rbp,%rax,4)
  addl   $0x1,-0xfc0(%rbp)
  addl   $0x1,-0xfbc(%rbp)
  jmp    L94
L133:
  cmpl   $0xa,-0xfb4(%rbp)
  jne    L122
  cmpl   $0x0,-0xfc0(%rbp)
  jle    L91
  mov    -0xfbc(%rbp),%eax
  cmp    -0xfc0(%rbp),%eax
  je     L48
  mov    -0xfb4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
L48:
  movl   $0x0,-0xfc0(%rbp)
  jmp    L94
L91:
  cmpl   $0x0,-0xfc0(%rbp)
  jne    L94
  mov    -0xfb4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  jmp    L94
L122:
  addl   $0x1,-0xfbc(%rbp)
  cmpl   $0x0,-0xfc0(%rbp)
  jle    L137
  movl   $0x0,-0xfb8(%rbp)
  movl   $0x0,-0xfb8(%rbp)
  jmp    L84
L161:
  mov    -0xfb8(%rbp),%eax
  cltq
  mov    -0xfb0(%rbp,%rax,4),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0xfb8(%rbp)
L84:
  mov    -0xfb8(%rbp),%eax
  cmp    -0xfc0(%rbp),%eax
  jl     L161
  mov    -0xfb4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  movl   $0x0,-0xfc0(%rbp)
  jmp    L94
L137:
  cmpl   $0x0,-0xfc0(%rbp)
  jne    L94
  mov    -0xfb4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
L94:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0xfb4(%rbp)
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xfb4(%rbp)
  jne    L66
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L119
  call   <__stack_chk_fail@plt>
L119:
  leave
  ret
```

assistant: ```c
int main() {
  int buf[1000] = {
      0,
  };
  int idx = 0;
  int ch;
  int len;
  while ((ch = getchar()) != EOF) {
    if (ch == ' ' || ch == '\t') {
      buf[idx] = ch;
      idx++;
      len++;
    } else if (ch == '\n') {
      if (idx > 0) {
        if (len != idx) {
          putchar(ch);
        }
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    } else {
      len++;
      if (idx > 0) {
        int j = 0;
        for (j = 0; j < idx; j++) {
          putchar(buf[j]);
        }
        putchar(ch);
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    }
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xfb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xfa8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0x1f4,%ecx
  rep stos %rax,%es:(%rdi)
  mov    $0x0,%r12d
  lea    0x4(%rsp),%r14
  jmp    L74
L0:
  movslq %r12d,%rax
  mov    %ebx,(%rsp,%rax,4)
  add    $0x1,%r12d
  add    $0x1,%r13d
L74:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  mov    D2(%rip),%rax
  cmp    %ebx,(%rax)
  je     L150
  cmp    $0x20,%ebx
  je     L0
  cmp    $0x9,%ebx
  je     L0
  cmp    $0xa,%ebx
  je     L159
  add    $0x1,%r13d
  test   %r12d,%r12d
  jg     L55
  jne    L74
  mov    %ebx,%edi
  call   <putchar@plt>
  jmp    L74
L159:
  test   %r12d,%r12d
  jle    L134
  cmp    %r13d,%r12d
  jne    L72
  mov    $0x0,%r12d
  jmp    L74
L72:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%r12d
  jmp    L74
L134:
  jne    L74
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L74
L55:
  mov    %rsp,%rbp
  lea    -0x1(%r12),%eax
  lea    (%r14,%rax,4),%r12
L122:
  mov    0x0(%rbp),%edi
  call   <putchar@plt>
  add    $0x4,%rbp
  cmp    %r12,%rbp
  jne    L122
  mov    %ebx,%edi
  call   <putchar@plt>
  mov    $0x0,%r12d
  jmp    L74
L150:
  mov    0xfa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L146
  mov    $0x0,%eax
  add    $0xfb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L146:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int buf[1000] = {
      0,
  };
  int idx = 0;
  int ch;
  int len;
  while ((ch = getchar()) != EOF) {
    if (ch == ' ' || ch == '\t') {
      buf[idx] = ch;
      idx++;
      len++;
    } else if (ch == '\n') {
      if (idx > 0) {
        if (len != idx) {
          putchar(ch);
        }
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    } else {
      len++;
      if (idx > 0) {
        int j = 0;
        for (j = 0; j < idx; j++) {
          putchar(buf[j]);
        }
        putchar(ch);
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x1f4,%ecx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0xfc8,%rsp
  mov    D7(%rip),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0xfb8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r14
  mov    %r14,%rdi
  rep stos %rax,%es:(%rdi)
  lea    0x14(%rsp),%rax
  mov    %rax,0x8(%rsp)
L81:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,0x0(%r13)
  je     L115
L3:
  cmp    $0x20,%ebp
  je     L23
  cmp    $0x9,%ebp
  je     L23
  cmp    $0xa,%ebp
  je     L138
  add    $0x1,%r12d
  test   %ebx,%ebx
  jne    L148
  mov    %ebp,%edi
  call   <putchar@plt>
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L23:
  movslq %ebx,%rax
  add    $0x1,%r12d
  add    $0x1,%ebx
  mov    %ebp,0x10(%rsp,%rax,4)
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,0x0(%r13)
  jne    L3
L115:
  mov    0xfb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L106
  add    $0xfc8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L138:
  test   %ebx,%ebx
  je     L75
  cmp    %r12d,%ebx
  jne    L131
  xor    %ebx,%ebx
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L148:
  mov    0x8(%rsp),%rdx
  lea    -0x1(%rbx),%eax
  mov    %r14,%r15
  lea    (%rdx,%rax,4),%rbx
  nop
L103:
  mov    (%r15),%edi
  add    $0x4,%r15
  call   <putchar@plt>
  cmp    %r15,%rbx
  jne    L103
  mov    %ebp,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  jmp    L81
L131:
  mov    $0xa,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  jmp    L81
L75:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L81
L106:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int buf[1000] = {
      0,
  };
  int idx = 0;
  int ch;
  int len;
  while ((ch = getchar()) != EOF) {
    if (ch == ' ' || ch == '\t') {
      buf[idx] = ch;
      idx++;
      len++;
    } else if (ch == '\n') {
      if (idx > 0) {
        if (len != idx) {
          putchar(ch);
        }
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    } else {
      len++;
      if (idx > 0) {
        int j = 0;
        for (j = 0; j < idx; j++) {
          putchar(buf[j]);
        }
        putchar(ch);
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    }
  }
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x1f4,%ecx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0xfc8,%rsp
  mov    D6(%rip),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0xfb8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r14
  mov    %r14,%rdi
  rep stos %rax,%es:(%rdi)
  lea    0x14(%rsp),%rax
  mov    %rax,0x8(%rsp)
L28:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,0x0(%r13)
  je     L100
L12:
  cmp    $0x20,%ebp
  je     L147
  cmp    $0x9,%ebp
  je     L147
  cmp    $0xa,%ebp
  je     L107
  add    $0x1,%r12d
  test   %ebx,%ebx
  jne    L94
  mov    %ebp,%edi
  call   <putchar@plt>
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L147:
  movslq %ebx,%rax
  add    $0x1,%r12d
  add    $0x1,%ebx
  mov    %ebp,0x10(%rsp,%rax,4)
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,0x0(%r13)
  jne    L12
L100:
  mov    0xfb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  add    $0xfc8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L107:
  test   %ebx,%ebx
  je     L24
  cmp    %r12d,%ebx
  jne    L82
  xor    %ebx,%ebx
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L94:
  mov    0x8(%rsp),%rdx
  lea    -0x1(%rbx),%eax
  mov    %r14,%r15
  lea    (%rdx,%rax,4),%rbx
  nop
L137:
  mov    (%r15),%edi
  add    $0x4,%r15
  call   <putchar@plt>
  cmp    %r15,%rbx
  jne    L137
  mov    %ebp,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  jmp    L28
L82:
  mov    $0xa,%edi
  xor    %ebx,%ebx
  call   <putchar@plt>
  jmp    L28
L24:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L28
L79:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int main() {
  int buf[1000] = {
      0,
  };
  int idx = 0;
  int ch;
  int len;
  while ((ch = getchar()) != EOF) {
    if (ch == ' ' || ch == '\t') {
      buf[idx] = ch;
      idx++;
      len++;
    } else if (ch == '\n') {
      if (idx > 0) {
        if (len != idx) {
          putchar(ch);
        }
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    } else {
      len++;
      if (idx > 0) {
        int j = 0;
        for (j = 0; j < idx; j++) {
          putchar(buf[j]);
        }
        putchar(ch);
        idx = 0;
      } else if (idx == 0) {
        putchar(ch);
      }
    }
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<myatoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L29
L21:
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L29:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L2
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L21
L2:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int myatoi(char s[]) {
  int i;
  int n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = 10 * n + s[i] - '0';
  }
  return n;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<myatoi>:
  endbr64
  movzbl (%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  ja     L9
  add    $0x1,%rdi
  mov    $0x0,%edx
L12:
  lea    (%rdx,%rdx,4),%edx
  movsbl %al,%eax
  lea    -0x30(%rax,%rdx,2),%edx
  movzbl (%rdi),%eax
  add    $0x1,%rdi
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  jbe    L12
L15:
  mov    %edx,%eax
  ret
L9:
  mov    $0x0,%edx
  jmp    L15
```

assistant: ```c
int myatoi(char s[]) {
  int i;
  int n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = 10 * n + s[i] - '0';
  }
  return n;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<myatoi>:
  endbr64
  movsbl (%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  ja     L8
  add    $0x1,%rdi
  xor    %r8d,%r8d
  cs nopw 0x0(%rax,%rax,1)
L7:
  lea    (%r8,%r8,4),%edx
  add    $0x1,%rdi
  lea    -0x30(%rax,%rdx,2),%r8d
  movsbl -0x1(%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  jbe    L7
  mov    %r8d,%eax
  ret
  nopl   (%rax)
L8:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int myatoi(char s[]) {
  int i;
  int n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = 10 * n + s[i] - '0';
  }
  return n;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<myatoi>:
  endbr64
  movsbl (%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  ja     L16
  add    $0x1,%rdi
  xor    %r8d,%r8d
  cs nopw 0x0(%rax,%rax,1)
L18:
  lea    (%r8,%r8,4),%edx
  add    $0x1,%rdi
  lea    -0x30(%rax,%rdx,2),%r8d
  movsbl -0x1(%rdi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  jbe    L18
  mov    %r8d,%eax
  ret
  nopl   (%rax)
L16:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int myatoi(char s[]) {
  int i;
  int n = 0;
  for (i = 0; s[i] >= '0' && s[i] <= '9'; ++i) {
    n = 10 * n + s[i] - '0';
  }
  return n;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<consecutivechar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    %al,-0x1c(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L6
L0:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1c(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
L6:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L0
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int consecutivechar(char line[], char c, int pos, int times) {
  int i, limit = pos + times;
  for (i = pos; i < limit; i++)
    line[i] = c;
  return limit;
}
```
user: What is the c source code of the assembly code below?

```asm
<consecutivechar>:
  endbr64
  lea    (%rdx,%rcx,1),%r8d
  cmp    %r8d,%edx
  jge    L0
  movslq %edx,%rdx
  lea    (%rdi,%rdx,1),%rax
  lea    0x1(%rdi,%rdx,1),%rdx
  lea    -0x1(%rcx),%ecx
  add    %rcx,%rdx
L12:
  mov    %sil,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L12
L0:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int consecutivechar(char line[], char c, int pos, int times) {
  int i, limit = pos + times;
  for (i = pos; i < limit; i++)
    line[i] = c;
  return limit;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<consecutivechar>:
  endbr64
  push   %r12
  lea    (%rdx,%rcx,1),%r12d
  cmp    %r12d,%edx
  jge    L4
  lea    -0x1(%rcx),%r8d
  movslq %edx,%rdx
  movsbl %sil,%esi
  add    $0x1,%r8
  add    %rdx,%rdi
  mov    %r8,%rdx
  call   <memset@plt>
L4:
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int consecutivechar(char line[], char c, int pos, int times) {
  int i, limit = pos + times;
  for (i = pos; i < limit; i++)
    line[i] = c;
  return limit;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<consecutivechar>:
  endbr64
  push   %r12
  lea    (%rdx,%rcx,1),%r12d
  cmp    %r12d,%edx
  jge    L9
  lea    -0x1(%rcx),%r8d
  movslq %edx,%rdx
  movsbl %sil,%esi
  add    $0x1,%r8
  add    %rdx,%rdi
  mov    %r8,%rdx
  call   <memset@plt>
L9:
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int consecutivechar(char line[], char c, int pos, int times) {
  int i, limit = pos + times;
  for (i = pos; i < limit; i++)
    line[i] = c;
  return limit;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<freev_>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  mov    0x28(%rsp),%r10
  lea    -0x4(%rdx),%r11
  movl   $0x0,(%rcx)
  lea    0x1(%rdi),%ecx
  mov    %ecx,(%r8)
  cmpl   $0x0,0x48(%rsp)
  jle    L134
  lea    -0x4(%r10),%rbp
  cmpl   $0x0,0x40(%rsp)
  je     L134
  sub    $0x4,%r9
  mov    (%rsi),%eax
  test   %eax,%eax
  jle    L141
  mov    $0x1,%r12d
  jmp    L140
L68:
  mov    (%rsi),%eax
  add    $0x1,%r12
  cmp    %r12d,%eax
  jl     L141
L140:
  mov    -0x4(%rdx,%r12,4),%r13d
  movslq %r13d,%rax
  cmpl   $0x0,0x0(%rbp,%rax,4)
  jle    L68
  mov    (%r8),%eax
  sub    $0x1,%eax
  mov    %eax,(%r8)
  cltq
  mov    %r13d,(%r9,%rax,4)
  jmp    L68
L141:
  add    $0x1,%eax
  cmp    %eax,%edi
  jl     L134
  cltq
  jmp    L88
L175:
  add    $0x1,%rax
  cmp    %eax,%edi
  jl     L134
L88:
  mov    -0x4(%rdx,%rax,4),%r13d
  movslq %r13d,%r12
  cmpl   $0x0,0x0(%rbp,%r12,4)
  jg     L175
  mov    (%rbx),%r12d
  add    $0x1,%r12d
  mov    %r12d,(%rbx)
  movslq %r12d,%r12
  mov    %r13d,(%r9,%r12,4)
  jmp    L175
L134:
  mov    $0x1,%eax
  cmp    %edi,(%r8)
  jle    L117
  cmpl   $0x0,(%rbx)
  jle    L138
L117:
  mov    0x30(%rsp),%rdx
  mov    %eax,(%rdx)
  movl   $0x0,(%rsi)
  test   %edi,%edi
  jle    L101
  lea    0x1(%rdi),%edi
  mov    $0x1,%eax
  jmp    L11
L138:
  mov    0x38(%rsp),%rax
  cmpl   $0x0,(%rax)
  setne  %al
  movzbl %al,%eax
  jmp    L117
L114:
  mov    (%rsi),%ebx
  lea    0x1(%rbx),%edx
  mov    %edx,(%rsi)
  movslq %edx,%rdx
  mov    %eax,(%r11,%rdx,4)
L158:
  add    $0x1,%rax
  cmp    %rdi,%rax
  je     L101
L11:
  cmpl   $0x0,-0x4(%r10,%rax,4)
  jle    L114
  sub    $0x1,%ecx
  movslq %ecx,%rdx
  mov    %eax,(%r11,%rdx,4)
  jmp    L158
L101:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void freev_(int n, int *nfree, int *index, int *nenter, int *ileave, int *indx2, int *iwhere, int *wrk, int *updatd, int cnstnd, int iter) {
  int i, k, iact;
  --iwhere;
  --indx2;
  --index;
  *nenter = 0;
  *ileave = n + 1;
  if (iter > 0 && cnstnd) {
    for (i = 1; i <= *nfree; ++i) {
      k = index[i];
      if (iwhere[k] > 0) {
        --(*ileave);
        indx2[*ileave] = k;
      }
    }
    for (i = *nfree + 1; i <= n; ++i) {
      k = index[i];
      if (iwhere[k] <= 0) {
        ++(*nenter);
        indx2[*nenter] = k;
      }
    }
  }
  *wrk = *ileave < n + 1 || *nenter > 0 || *updatd;
  *nfree = 0;
  iact = n + 1;
  for (i = 1; i <= n; ++i) {
    if (iwhere[i] <= 0) {
      ++(*nfree);
      index[*nfree] = i;
    } else {
      --iact;
      index[iact] = i;
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<freev_>:
  endbr64
  push   %r15
  mov    %edi,%r10d
  mov    %rsi,%rdi
  push   %r14
  lea    0x1(%r10),%esi
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  lea    -0x4(%rdx),%rbp
  push   %rbx
  mov    0x58(%rsp),%eax
  movl   $0x0,(%rcx)
  mov    0x38(%rsp),%rbx
  mov    %esi,%ecx
  mov    %esi,(%r8)
  test   %eax,%eax
  jle    L20
  mov    0x50(%rsp),%eax
  test   %eax,%eax
  je     L20
  mov    (%rdi),%eax
  mov    %rdx,%r11
  lea    -0x4(%rbx),%r13
  sub    $0x4,%r9
  test   %eax,%eax
  jle    L123
  mov    $0x1,%edx
  nopl   (%rax)
L161:
  movslq -0x4(%r11,%rdx,4),%r15
  mov    %r15,%r14
  mov    0x0(%r13,%r15,4),%r15d
  test   %r15d,%r15d
  jle    L2
  mov    (%r8),%eax
  sub    $0x1,%eax
  mov    %eax,(%r8)
  cltq
  mov    %r14d,(%r9,%rax,4)
  mov    (%rdi),%eax
L2:
  add    $0x1,%rdx
  cmp    %edx,%eax
  jge    L161
L123:
  lea    0x1(%rax),%edx
  movslq %edx,%rax
  cmp    %edx,%r10d
  jl     L129
  cs nopw 0x0(%rax,%rax,1)
L79:
  movslq -0x4(%r11,%rax,4),%rdx
  mov    0x0(%r13,%rdx,4),%r15d
  mov    %rdx,%r14
  test   %r15d,%r15d
  jg     L141
  mov    (%r12),%edx
  add    $0x1,%edx
  mov    %edx,(%r12)
  movslq %edx,%rdx
  mov    %r14d,(%r9,%rdx,4)
L141:
  add    $0x1,%rax
  cmp    %eax,%r10d
  jge    L79
L129:
  mov    (%r8),%edx
L63:
  mov    $0x1,%eax
  cmp    %edx,%r10d
  jge    L69
  mov    (%r12),%r9d
  test   %r9d,%r9d
  jle    L153
L69:
  mov    0x40(%rsp),%rdx
  mov    %eax,(%rdx)
  mov    $0x1,%eax
  movl   $0x0,(%rdi)
  test   %r10d,%r10d
  jg     L105
  jmp    L104
  nopl   0x0(%rax)
L16:
  sub    $0x1,%ecx
  movslq %ecx,%rdx
  mov    %eax,0x0(%rbp,%rdx,4)
  add    $0x1,%rax
  cmp    %rax,%rsi
  je     L104
L105:
  mov    -0x4(%rbx,%rax,4),%edx
  test   %edx,%edx
  jg     L16
  mov    (%rdi),%edx
  add    $0x1,%edx
  mov    %edx,(%rdi)
  movslq %edx,%rdx
  mov    %eax,0x0(%rbp,%rdx,4)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L105
L104:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L20:
  mov    %esi,%edx
  jmp    L63
  nopl   0x0(%rax)
L153:
  mov    0x48(%rsp),%rax
  mov    (%rax),%r8d
  xor    %eax,%eax
  test   %r8d,%r8d
  setne  %al
  jmp    L69
```

assistant: ```c
void freev_(int n, int *nfree, int *index, int *nenter, int *ileave, int *indx2, int *iwhere, int *wrk, int *updatd, int cnstnd, int iter) {
  int i, k, iact;
  --iwhere;
  --indx2;
  --index;
  *nenter = 0;
  *ileave = n + 1;
  if (iter > 0 && cnstnd) {
    for (i = 1; i <= *nfree; ++i) {
      k = index[i];
      if (iwhere[k] > 0) {
        --(*ileave);
        indx2[*ileave] = k;
      }
    }
    for (i = *nfree + 1; i <= n; ++i) {
      k = index[i];
      if (iwhere[k] <= 0) {
        ++(*nenter);
        indx2[*nenter] = k;
      }
    }
  }
  *wrk = *ileave < n + 1 || *nenter > 0 || *updatd;
  *nfree = 0;
  iact = n + 1;
  for (i = 1; i <= n; ++i) {
    if (iwhere[i] <= 0) {
      ++(*nfree);
      index[*nfree] = i;
    } else {
      --iact;
      index[iact] = i;
    }
  }
}
```