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

```asm
<tokenize>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%ecx
  mov    %rsi,0x8(%rsp)
  test   %cl,%cl
  je     L8
  mov    %rdi,%r15
  xor    %ebp,%ebp
  xor    %r10d,%r10d
  xor    %edx,%edx
  lea    0x8(%rsp),%r13
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L98:
  cmp    $0x8,%cl
  jle    L73
  movabs $0x34200000000,%rdi
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %rdi,%rax
  jne    L44
  movabs $0x100000200,%rdi
  test   %rdi,%rax
  jne    L31
  cmp    $0x22,%cl
  je     L15
L73:
  movzbl (%r12),%ecx
  mov    %r12,%r15
  mov    %rbx,%rdx
L51:
  test   %cl,%cl
  je     L96
L16:
  lea    0x1(%rdx),%rbx
  lea    (%r14,%r10,1),%rsi
  lea    (%r14,%rbx,1),%r12
  cmp    $0x29,%cl
  jle    L98
  cmp    $0x7c,%cl
  jne    L73
L44:
  sub    %r10,%rdx
  mov    %r13,%rdi
  call   <new_tok@plt>
  mov    %r15,%rsi
  mov    $0x1,%edx
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <new_tok@plt>
  mov    (%rsp),%r15d
  mov    %r12,%rsi
  mov    %rbx,%rdx
  movzbl (%r12),%ecx
  mov    %rbx,%r10
  add    %eax,%r15d
  add    %r15d,%ebp
  mov    %r12,%r15
  test   %cl,%cl
  jne    L16
L96:
  sub    %r10,%rdx
L110:
  mov    %r13,%rdi
  call   <new_tok@plt>
  add    $0x18,%rsp
  pop    %rbx
  add    %ebp,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L27:
  add    $0x1,%rbx
L15:
  movzbl (%r14,%rbx,1),%ecx
  mov    %rdx,%rax
  lea    (%r14,%rbx,1),%r15
  mov    %rbx,%rdx
  cmp    $0x22,%cl
  je     L19
  test   %cl,%cl
  jne    L27
  cmp    $0x22,%cl
  jne    L51
  nopl   (%rax)
L19:
  lea    0x2(%rax),%rdx
  lea    (%r14,%rdx,1),%r15
  movzbl (%r15),%ecx
  jmp    L51
  nopl   0x0(%rax)
L31:
  sub    %r10,%rdx
  mov    %r13,%rdi
  mov    %r12,%r15
  call   <new_tok@plt>
  movzbl (%r12),%ecx
  mov    %r12,%rsi
  mov    %rbx,%rdx
  add    %eax,%ebp
  mov    %rbx,%r10
  jmp    L51
L8:
  mov    %rdi,%rsi
  xor    %edx,%edx
  lea    0x8(%rsp),%r13
  xor    %ebp,%ebp
  jmp    L110
```

assistant: ```c
unsigned int tokenize(const char *expr, struct tst_expr_tok *last) {
  size_t i, j;
  unsigned int token_cnt = 0;
  for (j = i = 0; expr[i]; i++) {
    switch (expr[i]) {
    case '(':
    case ')':
    case '!':
    case '&':
    case '|':
      token_cnt += new_tok(&last, &expr[j], i - j);
      token_cnt += new_tok(&last, &expr[i], 1);
      j = i + 1;
      break;
    case '\t':
    case ' ':
      token_cnt += new_tok(&last, &expr[j], i - j);
      j = i + 1;
      break;
    case '"':
      while (expr[i + 1] != '"' && expr[i + 1])
        i++;
      if (expr[i + 1] == '"')
        i++;
      break;
    default:
      break;
    }
  }
  token_cnt += new_tok(&last, &expr[j], i - j);
  return token_cnt;
}
```
user: Translate the below assembly code into C programming language:

```asm
<tokenize>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%ecx
  mov    %rsi,0x8(%rsp)
  test   %cl,%cl
  je     L120
  mov    %rdi,%r15
  xor    %ebp,%ebp
  xor    %r10d,%r10d
  xor    %edx,%edx
  lea    0x8(%rsp),%r13
  jmp    L63
  cs nopw 0x0(%rax,%rax,1)
L81:
  cmp    $0x8,%cl
  jle    L65
  movabs $0x34200000000,%rdi
  mov    $0x1,%eax
  shl    %cl,%rax
  test   %rdi,%rax
  jne    L83
  movabs $0x100000200,%rdi
  test   %rdi,%rax
  jne    L32
  cmp    $0x22,%cl
  je     L116
L65:
  movzbl (%r12),%ecx
  mov    %r12,%r15
  mov    %rbx,%rdx
L69:
  test   %cl,%cl
  je     L130
L63:
  lea    0x1(%rdx),%rbx
  lea    (%r14,%r10,1),%rsi
  lea    (%r14,%rbx,1),%r12
  cmp    $0x29,%cl
  jle    L81
  cmp    $0x7c,%cl
  jne    L65
L83:
  sub    %r10,%rdx
  mov    %r13,%rdi
  call   <new_tok@plt>
  mov    %r15,%rsi
  mov    $0x1,%edx
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <new_tok@plt>
  mov    (%rsp),%r15d
  mov    %r12,%rsi
  mov    %rbx,%rdx
  movzbl (%r12),%ecx
  mov    %rbx,%r10
  add    %eax,%r15d
  add    %r15d,%ebp
  mov    %r12,%r15
  test   %cl,%cl
  jne    L63
L130:
  sub    %r10,%rdx
L15:
  mov    %r13,%rdi
  call   <new_tok@plt>
  add    $0x18,%rsp
  pop    %rbx
  add    %ebp,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L75:
  add    $0x1,%rbx
L116:
  movzbl (%r14,%rbx,1),%ecx
  mov    %rdx,%rax
  lea    (%r14,%rbx,1),%r15
  mov    %rbx,%rdx
  cmp    $0x22,%cl
  je     L115
  test   %cl,%cl
  jne    L75
  cmp    $0x22,%cl
  jne    L69
  nopl   (%rax)
L115:
  lea    0x2(%rax),%rdx
  lea    (%r14,%rdx,1),%r15
  movzbl (%r15),%ecx
  jmp    L69
  nopl   0x0(%rax)
L32:
  sub    %r10,%rdx
  mov    %r13,%rdi
  mov    %r12,%r15
  call   <new_tok@plt>
  movzbl (%r12),%ecx
  mov    %r12,%rsi
  mov    %rbx,%rdx
  add    %eax,%ebp
  mov    %rbx,%r10
  jmp    L69
L120:
  mov    %rdi,%rsi
  xor    %edx,%edx
  lea    0x8(%rsp),%r13
  xor    %ebp,%ebp
  jmp    L15
```

assistant: ```c
unsigned int tokenize(const char *expr, struct tst_expr_tok *last) {
  size_t i, j;
  unsigned int token_cnt = 0;
  for (j = i = 0; expr[i]; i++) {
    switch (expr[i]) {
    case '(':
    case ')':
    case '!':
    case '&':
    case '|':
      token_cnt += new_tok(&last, &expr[j], i - j);
      token_cnt += new_tok(&last, &expr[i], 1);
      j = i + 1;
      break;
    case '\t':
    case ' ':
      token_cnt += new_tok(&last, &expr[j], i - j);
      j = i + 1;
      break;
    case '"':
      while (expr[i + 1] != '"' && expr[i + 1])
        i++;
      if (expr[i + 1] == '"')
        i++;
      break;
    default:
      break;
    }
  }
  token_cnt += new_tok(&last, &expr[j], i - j);
  return token_cnt;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x23,-0xc(%rbp)
  movl   $0x1c,-0x8(%rbp)
  jmp    L10
L9:
  mov    -0xc(%rbp),%eax
  cltd
  idivl  -0x8(%rbp)
  mov    %edx,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
L10:
  cmpl   $0x0,-0x8(%rbp)
  jne    L9
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

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

tool: D7: %d


assistant: ```c
main() {
  int u, v, t;
  u = 35;
  v = 28;
  while (v != 0) {
    t = u % v;
    u = v;
    v = t;
  }
  printf("%d\n", u);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1c,%ecx
  mov    $0x23,%eax
L6:
  mov    %ecx,%esi
  cltd
  idiv   %ecx
  mov    %edx,%ecx
  mov    %esi,%eax
  test   %edx,%edx
  jne    L6
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: label: D6
type_infered: string

tool: D6: %d


assistant: ```c
main() {
  int u, v, t;
  u = 35;
  v = 28;
  while (v != 0) {
    t = u % v;
    u = v;
    v = t;
  }
  printf("%d\n", u);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1c,%edx
  mov    $0x23,%eax
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %edx,%ecx
  mov    %edx,%esi
  cltd
  idiv   %ecx
  mov    %ecx,%eax
  test   %edx,%edx
  jne    L5
  lea    D7(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D7
data_type: string

tool: D7: %d


assistant: ```c
main() {
  int u, v, t;
  u = 35;
  v = 28;
  while (v != 0) {
    t = u % v;
    u = v;
    v = t;
  }
  printf("%d\n", u);
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x1c,%edx
  mov    $0x23,%eax
  nopw   0x0(%rax,%rax,1)
L5:
  mov    %edx,%ecx
  mov    %edx,%esi
  cltd
  idiv   %ecx
  mov    %ecx,%eax
  test   %edx,%edx
  jne    L5
  lea    D1(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
data_type: string

tool: D1: %d


assistant: ```c
main() {
  int u, v, t;
  u = 35;
  v = 28;
  while (v != 0) {
    t = u % v;
    u = v;
    v = t;
  }
  printf("%d\n", u);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<skipToNonWhite>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
L6:
  mov    $0x0,%eax
  call   <cppGetc@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L6
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int skipToNonWhite() {
  int c;
  do
    c = cppGetc();
  while (isspace(c));
  return c;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<skipToNonWhite>:
  endbr64
  push   %rbx
L5:
  mov    $0x0,%eax
  call   <cppGetc@plt>
  mov    %eax,%ebx
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L5
  mov    %ebx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int skipToNonWhite() {
  int c;
  do
    c = cppGetc();
  while (isspace(c));
  return c;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<skipToNonWhite>:
  endbr64
  push   %r12
  cs nopw 0x0(%rax,%rax,1)
L1:
  xor    %eax,%eax
  call   <cppGetc@plt>
  mov    %eax,%edi
  mov    %eax,%r12d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L1
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int skipToNonWhite() {
  int c;
  do
    c = cppGetc();
  while (isspace(c));
  return c;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<skipToNonWhite>:
  endbr64
  push   %r12
  cs nopw 0x0(%rax,%rax,1)
L4:
  xor    %eax,%eax
  call   <cppGetc@plt>
  mov    %eax,%edi
  mov    %eax,%r12d
  call   <isspace@plt>
  test   %rax,%rax
  jne    L4
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int skipToNonWhite() {
  int c;
  do
    c = cppGetc();
  while (isspace(c));
  return c;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<wzfile_date>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <wfile_status@plt>
  cmp    $0x1,%eax
  jne    L3
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <wfile_date@plt>
  jmp    L24
L3:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <wfile_is_gzfile@plt>
  test   %rax,%rax
  je     L18
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <wzfile_convert_to_uncompressed_name@plt>
  jmp    L8
L18:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <wzfile_convert_to_compressed_name@plt>
L8:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <wfile_date@plt>
L24:
  leave
  ret
```

assistant: ```c
void wzfile_date(char *filename, struct tm *date) {
  static char newname[512];
  if (wfile_status(filename) == 1) {
    wfile_date(filename, date);
    return;
  }
  if (wfile_is_gzfile(filename))
    wzfile_convert_to_uncompressed_name(newname, filename);
  else
    wzfile_convert_to_compressed_name(newname, filename);
  wfile_date(newname, date);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<wzfile_date>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  call   <wfile_status@plt>
  cmp    $0x1,%eax
  je     L3
  mov    %rbx,%rdi
  call   <wfile_is_gzfile@plt>
  test   %rax,%rax
  je     L19
  mov    %rbx,%rsi
  lea    D1(%rip),%rdi
  call   <wzfile_convert_to_uncompressed_name@plt>
L26:
  mov    %rbp,%rsi
  lea    D1(%rip),%rdi
  call   <wfile_date@plt>
L37:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L3:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <wfile_date@plt>
  jmp    L37
L19:
  mov    %rbx,%rsi
  lea    D1(%rip),%rdi
  call   <wzfile_convert_to_compressed_name@plt>
  jmp    L26
```

assistant: ```c
void wzfile_date(char *filename, struct tm *date) {
  static char newname[512];
  if (wfile_status(filename) == 1) {
    wfile_date(filename, date);
    return;
  }
  if (wfile_is_gzfile(filename))
    wzfile_convert_to_uncompressed_name(newname, filename);
  else
    wzfile_convert_to_compressed_name(newname, filename);
  wfile_date(newname, date);
}
```
user: What is the c source code of the assembly code below?

```asm
<wzfile_date>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <wfile_status@plt>
  cmp    $0x1,%eax
  je     L1
  mov    %rbp,%rdi
  call   <wfile_is_gzfile@plt>
  mov    %rbp,%rsi
  lea    D0(%rip),%rbp
  mov    %rbp,%rdi
  test   %rax,%rax
  je     L11
  call   <wzfile_convert_to_uncompressed_name@plt>
L1:
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    10a0 <wfile_date@plt>
  nopl   0x0(%rax)
L11:
  call   <wzfile_convert_to_compressed_name@plt>
  jmp    L1
```

assistant: ```c
void wzfile_date(char *filename, struct tm *date) {
  static char newname[512];
  if (wfile_status(filename) == 1) {
    wfile_date(filename, date);
    return;
  }
  if (wfile_is_gzfile(filename))
    wzfile_convert_to_uncompressed_name(newname, filename);
  else
    wzfile_convert_to_compressed_name(newname, filename);
  wfile_date(newname, date);
}
```
user: Translate the below assembly code into C programming language:

```asm
<wzfile_date>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <wfile_status@plt>
  cmp    $0x1,%eax
  je     L28
  mov    %rbp,%rdi
  call   <wfile_is_gzfile@plt>
  mov    %rbp,%rsi
  lea    D2(%rip),%rbp
  mov    %rbp,%rdi
  test   %rax,%rax
  je     L8
  call   <wzfile_convert_to_uncompressed_name@plt>
L28:
  add    $0x8,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    10a0 <wfile_date@plt>
  nopl   0x0(%rax)
L8:
  call   <wzfile_convert_to_compressed_name@plt>
  jmp    L28
```

assistant: ```c
void wzfile_date(char *filename, struct tm *date) {
  static char newname[512];
  if (wfile_status(filename) == 1) {
    wfile_date(filename, date);
    return;
  }
  if (wfile_is_gzfile(filename))
    wzfile_convert_to_uncompressed_name(newname, filename);
  else
    wzfile_convert_to_compressed_name(newname, filename);
  wfile_date(newname, date);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nbsend>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  mov    %eax,-0x8(%rbp)
  mov    D29(%rip),%rax
  mov    (%rax),%eax
  and    -0x8(%rbp),%eax
  test   %eax,%eax
  jne    L7
  mov    D29(%rip),%rax
  mov    (%rax),%eax
  or     -0x8(%rbp),%eax
  mov    %eax,%edx
  mov    D48(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  jmp    L7
L90:
  nop
L2:
  mov    -0xc(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x14(%rbp),%eax
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <send@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L111
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L67
  mov    D78(%rip),%rax
  mov    (%rax),%rdx
  mov    D44(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L67
L111:
  mov    -0x18(%rbp),%eax
  sub    -0xc(%rbp),%eax
  jmp    L100
L67:
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L47
  mov    D78(%rip),%rax
  mov    (%rax),%rdx
  mov    D53(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L47
  jmp    L2
L47:
  cmpl   $0xffffffff,-0x4(%rbp)
  jne    L11
  mov    $0xffffffff,%eax
  jmp    L100
L11:
  mov    -0x4(%rbp),%eax
  sub    %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  add    %rax,-0x20(%rbp)
L7:
  cmpl   $0x0,-0xc(%rbp)
  jne    L90
  mov    -0x18(%rbp),%eax
  sub    -0xc(%rbp),%eax
L100:
  leave
  ret
```

assistant: ```c
int nbsend(int s, void *buf, int len) {
  int oldfl, ret, comp = len;
  oldfl = fcntl(s, F_GETFL, 0);
  if (!(oldfl & O_NONBLOCK))
    fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
  while (comp) {
  nbsend_restart:
    ret = send(s, (char *)buf, comp, 0);
    if (ret == 0 || (ret == -1 && errno == EWOULDBLOCK))
      return (len - comp);
    if (ret == -1 && errno == EINTR) {
      goto nbsend_restart;
    } else if (ret == -1)
      return (-1);
    comp -= ret;
    buf = (char *)buf + ret;
  }
  return (len - comp);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<nbsend>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %edx,%r13d
  mov    $0x0,%edx
  mov    D44(%rip),%rax
  mov    (%rax),%esi
  call   <fcntl@plt>
  mov    D6(%rip),%rdx
  mov    (%rdx),%edx
  test   %eax,%edx
  je     L60
L11:
  test   %r13d,%r13d
  je     L66
  mov    %r13d,%ebx
  jmp    L51
L60:
  or     %eax,%edx
  mov    D16(%rip),%rax
  mov    (%rax),%esi
  mov    %r12d,%edi
  call   <fcntl@plt>
  jmp    L11
L15:
  mov    D45(%rip),%rcx
  mov    D41(%rip),%rdx
  mov    (%rdx),%rdi
  cmp    %rdi,(%rcx)
  je     L83
  mov    D45(%rip),%rcx
  mov    D13(%rip),%rdx
  mov    (%rdx),%rsi
  cmp    %rsi,(%rcx)
  jne    L12
L51:
  mov    $0x0,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L83
  cmp    $0xffffffff,%eax
  je     L15
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jne    L51
L66:
  mov    %r13d,%eax
  jmp    L12
L83:
  mov    %r13d,%eax
  sub    %ebx,%eax
L12:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int nbsend(int s, void *buf, int len) {
  int oldfl, ret, comp = len;
  oldfl = fcntl(s, F_GETFL, 0);
  if (!(oldfl & O_NONBLOCK))
    fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
  while (comp) {
  nbsend_restart:
    ret = send(s, (char *)buf, comp, 0);
    if (ret == 0 || (ret == -1 && errno == EWOULDBLOCK))
      return (len - comp);
    if (ret == -1 && errno == EINTR) {
      goto nbsend_restart;
    } else if (ret == -1)
      return (-1);
    comp -= ret;
    buf = (char *)buf + ret;
  }
  return (len - comp);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<nbsend>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  xor    %edx,%edx
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    D55(%rip),%rax
  mov    (%rax),%esi
  call   <fcntl@plt>
  mov    D15(%rip),%rdx
  mov    (%rdx),%edx
  test   %eax,%edx
  je     L48
L46:
  test   %r13d,%r13d
  je     L41
  mov    %r13d,%ebx
L26:
  xor    %ecx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L7
  cmp    $0xffffffff,%eax
  je     L88
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jne    L26
  mov    %r13d,%eax
L77:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L88:
  mov    D17(%rip),%rdx
  mov    (%rdx),%rcx
  mov    D28(%rip),%rdx
  cmp    (%rdx),%rcx
  je     L7
  mov    D5(%rip),%rdx
  cmp    (%rdx),%rcx
  je     L26
  jmp    L77
  nopl   0x0(%rax)
L7:
  add    $0x8,%rsp
  mov    %r13d,%eax
  sub    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L48:
  or     %eax,%edx
  mov    D25(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  call   <fcntl@plt>
  jmp    L46
L41:
  xor    %eax,%eax
  jmp    L77
```

assistant: ```c
int nbsend(int s, void *buf, int len) {
  int oldfl, ret, comp = len;
  oldfl = fcntl(s, F_GETFL, 0);
  if (!(oldfl & O_NONBLOCK))
    fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
  while (comp) {
  nbsend_restart:
    ret = send(s, (char *)buf, comp, 0);
    if (ret == 0 || (ret == -1 && errno == EWOULDBLOCK))
      return (len - comp);
    if (ret == -1 && errno == EINTR) {
      goto nbsend_restart;
    } else if (ret == -1)
      return (-1);
    comp -= ret;
    buf = (char *)buf + ret;
  }
  return (len - comp);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<nbsend>:
  endbr64
  push   %r13
  mov    %edx,%r13d
  xor    %edx,%edx
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    D54(%rip),%rax
  mov    (%rax),%esi
  call   <fcntl@plt>
  mov    D5(%rip),%rdx
  mov    (%rdx),%edx
  test   %eax,%edx
  je     L48
L76:
  test   %r13d,%r13d
  je     L6
  mov    %r13d,%ebx
L98:
  xor    %ecx,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <send@plt>
  test   %eax,%eax
  je     L85
  cmp    $0xffffffff,%eax
  je     L24
  movslq %eax,%rdx
  add    %rdx,%rbp
  sub    %eax,%ebx
  jne    L98
  mov    %r13d,%eax
L84:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L24:
  mov    D33(%rip),%rdx
  mov    (%rdx),%rcx
  mov    D6(%rip),%rdx
  cmp    (%rdx),%rcx
  je     L85
  mov    D37(%rip),%rdx
  cmp    (%rdx),%rcx
  je     L98
  jmp    L84
  nopl   0x0(%rax)
L85:
  add    $0x8,%rsp
  mov    %r13d,%eax
  sub    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L48:
  or     %eax,%edx
  mov    D38(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  call   <fcntl@plt>
  jmp    L76
L6:
  xor    %eax,%eax
  jmp    L84
```

assistant: ```c
int nbsend(int s, void *buf, int len) {
  int oldfl, ret, comp = len;
  oldfl = fcntl(s, F_GETFL, 0);
  if (!(oldfl & O_NONBLOCK))
    fcntl(s, F_SETFL, oldfl | O_NONBLOCK);
  while (comp) {
  nbsend_restart:
    ret = send(s, (char *)buf, comp, 0);
    if (ret == 0 || (ret == -1 && errno == EWOULDBLOCK))
      return (len - comp);
    if (ret == -1 && errno == EINTR) {
      goto nbsend_restart;
    } else if (ret == -1)
      return (-1);
    comp -= ret;
    buf = (char *)buf + ret;
  }
  return (len - comp);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<filnamcmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L6
L5:
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xa(%rbp)
  cmpb   $0x60,-0xa(%rbp)
  jle    L77
  cmpb   $0x7a,-0xa(%rbp)
  jg     L77
  movzbl -0xa(%rbp),%eax
  sub    $0x20,%eax
  mov    %al,-0xa(%rbp)
L77:
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x9(%rbp)
  cmpb   $0x60,-0x9(%rbp)
  jle    L118
  cmpb   $0x7a,-0x9(%rbp)
  jg     L118
  movzbl -0x9(%rbp),%eax
  sub    $0x20,%eax
  mov    %al,-0x9(%rbp)
L118:
  cmpb   $0x2f,-0xa(%rbp)
  jne    L66
  movb   $0x5c,-0xa(%rbp)
L66:
  cmpb   $0x2f,-0x9(%rbp)
  jne    L97
  movb   $0x5c,-0x9(%rbp)
L97:
  movzbl -0xa(%rbp),%eax
  cmp    -0x9(%rbp),%al
  je     L60
  mov    $0xffffffffffffffff,%rax
  jmp    L45
L60:
  addq   $0x1,-0x8(%rbp)
L6:
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  mov    -0x8(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L43
  mov    $0x0,%eax
  jmp    L45
L43:
  mov    $0xffffffffffffffff,%rax
L45:
  pop    %rbp
  ret
```

assistant: ```c
long filnamcmp(const char *st0, const char *st1) {
  long i;
  char ch0, ch1;
  for (i = 0; st0[i]; i++) {
    ch0 = st0[i];
    if ((ch0 >= 'a') && (ch0 <= 'z'))
      ch0 -= 32;
    ch1 = st1[i];
    if ((ch1 >= 'a') && (ch1 <= 'z'))
      ch1 -= 32;
    if (ch0 == '/')
      ch0 = '\\';
    if (ch1 == '/')
      ch1 = '\\';
    if (ch0 != ch1)
      return (-1);
  }
  if (!st1[i])
    return (0);
  return (-1);
}
```