ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<dnrm2_>:
  endbr64
  movslq (%rdi),%rax
  movslq (%rdx),%rcx
  test   %rax,%rax
  jle    L54
  test   %rcx,%rcx
  jle    L54
  cmp    $0x1,%rax
  je     L35
  sub    $0x1,%rax
  movsd  D18(%rip),%xmm6
  mov    %rcx,%rdi
  pxor   %xmm3,%xmm3
  imul   %rcx,%rax
  neg    %rdi
  movq   D0(%rip),%xmm5
  movapd %xmm3,%xmm2
  shl    $0x3,%rdi
  movapd %xmm6,%xmm0
  lea    (%rsi,%rax,8),%rdx
  jmp    L30
  nopw   0x0(%rax,%rax,1)
L92:
  divsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm2
  mulsd  %xmm2,%xmm0
  movapd %xmm4,%xmm2
  addsd  %xmm6,%xmm0
L8:
  add    %rdi,%rdx
  sub    %rcx,%rax
  js     L3
L30:
  movsd  (%rdx),%xmm1
  ucomisd %xmm3,%xmm1
  jp     L93
  je     L8
L93:
  movapd %xmm1,%xmm4
  andpd  %xmm5,%xmm4
  comisd %xmm2,%xmm4
  ja     L92
  divsd  %xmm2,%xmm1
  add    %rdi,%rdx
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  sub    %rcx,%rax
  jns    L30
L3:
  ucomisd %xmm0,%xmm3
  ja     L95
  sqrtsd %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  ret
  nopl   0x0(%rax)
L54:
  pxor   %xmm0,%xmm0
  ret
  nopl   (%rax)
L35:
  movsd  (%rsi),%xmm0
  andpd  D0(%rip),%xmm0
  ret
L95:
  sub    $0x18,%rsp
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  add    $0x18,%rsp
  mulsd  %xmm2,%xmm0
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D18
datatype: f64
name: parse_data
arguments: data_tag: D0
datatype: qword[2]

tool: D18: 1

tool: {"D0": [0x7fffffffffffffff,0x0000000000000000]}

assistant: ```c
double dnrm2_(int *n, double *x, int *incx) {
  long int ix, nn, iincx;
  double norm, scale, absxi, ssq, temp;
  nn = *n;
  iincx = *incx;
  if (nn > 0 && iincx > 0) {
    if (nn == 1) {
      norm = fabs(x[0]);
    } else {
      scale = 0.0;
      ssq = 1.0;
      for (ix = (nn - 1) * iincx; ix >= 0; ix -= iincx) {
        if (x[ix] != 0.0) {
          absxi = fabs(x[ix]);
          if (scale < absxi) {
            temp = scale / absxi;
            ssq = ssq * (temp * temp) + 1.0;
            scale = absxi;
          } else {
            temp = absxi / scale;
            ssq += temp * temp;
          }
        }
      }
      norm = scale * sqrt(ssq);
    }
  } else
    norm = 0.0;
  return norm;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<is_magic_syscall>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D3(%rip),%rax
  mov    (%rax),%esi
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  lea    -0x20(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    %rcx,%r8
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <syscall@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x20(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x1c(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%edx
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
  cmp    %eax,%edx
  sete   %al
  movzbl %al,%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x0,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

assistant: ```c
int is_magic_syscall(pid_t pid, int *syscall_no, int *command, int *is_entry) {
  long res;
  struct user_regs_struct regs;
  int is_magic;
  res = syscall(SYS_ptrace, PTRACE_GETREGS, pid, NULL, &regs);
  assert(res == 0);
  *syscall_no = regs.orig_rax;
  *command = regs.rdx;
  *is_entry = regs.rax == -ENOSYS ? 1 : 0;
  is_magic = regs.rdi == 0x7a711e06171129a2UL && regs.rsi == 0xc6925d1ed6dcd674UL;
  return is_magic;
}
```
user: What is the c source code of the assembly code below?

```asm
<is_magic_syscall>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r8
  mov    $0x0,%ecx
  mov    %edi,%edx
  mov    D19(%rip),%rax
  mov    (%rax),%esi
  mov    D25(%rip),%rax
  mov    (%rax),%edi
  call   <syscall@plt>
  test   %rax,%rax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    (%rsp),%eax
  mov    %eax,(%r12)
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%rbp)
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  add    0x10(%rsp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,(%rbx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_magic_syscall(pid_t pid, int *syscall_no, int *command, int *is_entry) {
  long res;
  struct user_regs_struct regs;
  int is_magic;
  res = syscall(SYS_ptrace, PTRACE_GETREGS, pid, NULL, &regs);
  assert(res == 0);
  *syscall_no = regs.orig_rax;
  *command = regs.rdx;
  *is_entry = regs.rax == -ENOSYS ? 1 : 0;
  is_magic = regs.rdi == 0x7a711e06171129a2UL && regs.rsi == 0xc6925d1ed6dcd674UL;
  return is_magic;
}
```
user: What is the c source code of the assembly code below?

```asm
<is_magic_syscall>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  mov    %edi,%edx
  push   %rbx
  mov    %rcx,%rbx
  xor    %ecx,%ecx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D4(%rip),%rax
  mov    %rsp,%r8
  mov    (%rax),%esi
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <syscall@plt>
  xor    %edi,%edi
  test   %rax,%rax
  sete   %dil
  call   <assert@plt>
  mov    (%rsp),%eax
  mov    %eax,(%r12)
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%rbp)
  mov    D24(%rip),%rax
  mov    (%rax),%eax
  add    0x10(%rsp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,(%rbx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_magic_syscall(pid_t pid, int *syscall_no, int *command, int *is_entry) {
  long res;
  struct user_regs_struct regs;
  int is_magic;
  res = syscall(SYS_ptrace, PTRACE_GETREGS, pid, NULL, &regs);
  assert(res == 0);
  *syscall_no = regs.orig_rax;
  *command = regs.rdx;
  *is_entry = regs.rax == -ENOSYS ? 1 : 0;
  is_magic = regs.rdi == 0x7a711e06171129a2UL && regs.rsi == 0xc6925d1ed6dcd674UL;
  return is_magic;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<is_magic_syscall>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  mov    %edi,%edx
  push   %rbx
  mov    %rcx,%rbx
  xor    %ecx,%ecx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D19(%rip),%rax
  mov    %rsp,%r8
  mov    (%rax),%esi
  mov    D29(%rip),%rax
  mov    (%rax),%edi
  call   <syscall@plt>
  xor    %edi,%edi
  test   %rax,%rax
  sete   %dil
  call   <assert@plt>
  mov    (%rsp),%eax
  mov    %eax,(%r12)
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%rbp)
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  add    0x10(%rsp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,(%rbx)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_magic_syscall(pid_t pid, int *syscall_no, int *command, int *is_entry) {
  long res;
  struct user_regs_struct regs;
  int is_magic;
  res = syscall(SYS_ptrace, PTRACE_GETREGS, pid, NULL, &regs);
  assert(res == 0);
  *syscall_no = regs.orig_rax;
  *command = regs.rdx;
  *is_entry = regs.rax == -ENOSYS ? 1 : 0;
  is_magic = regs.rdi == 0x7a711e06171129a2UL && regs.rsi == 0xc6925d1ed6dcd674UL;
  return is_magic;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<minmax>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L15
L14:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L36
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
L36:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jge    L38
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
L38:
  addl   $0x1,-0x10(%rbp)
L15:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L14
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D7
type_guessed: string

tool: D7: %d


assistant: ```c
void minmax(int n, int *arr) {
  int k = 0, sum, min = arr[0], max = arr[0];
  while (k < n) {
    if (min > arr[k]) {
      min = arr[k];
    }
    if (max < arr[k]) {
      max = arr[k];
    }
    k++;
  }
  sum = min + max;
  printf("%d\n", sum);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<minmax>:
  endbr64
  sub    $0x8,%rsp
  mov    (%rsi),%ecx
  test   %edi,%edi
  jle    L6
  mov    %rsi,%rdx
  lea    -0x1(%rdi),%eax
  lea    0x4(%rsi,%rax,4),%rdi
  mov    %ecx,%esi
L2:
  mov    (%rdx),%eax
  cmp    %eax,%ecx
  cmovg  %eax,%ecx
  cmp    %eax,%esi
  cmovl  %eax,%esi
  add    $0x4,%rdx
  cmp    %rdi,%rdx
  jne    L2
L16:
  add    %ecx,%esi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
L6:
  mov    %ecx,%esi
  jmp    L16
```

tool_calls: name: disassemble_data
arguments: data_tag: D7
type_infered: string

tool: D7: %d


assistant: ```c
void minmax(int n, int *arr) {
  int k = 0, sum, min = arr[0], max = arr[0];
  while (k < n) {
    if (min > arr[k]) {
      min = arr[k];
    }
    if (max < arr[k]) {
      max = arr[k];
    }
    k++;
  }
  sum = min + max;
  printf("%d\n", sum);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<minmax>:
  endbr64
  mov    (%rsi),%ecx
  test   %edi,%edi
  jle    L16
  lea    0x4(%rsi),%rdx
  lea    -0x1(%rdi),%eax
  mov    %ecx,%esi
  lea    (%rdx,%rax,4),%rdi
  mov    %ecx,%eax
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L13:
  mov    (%rdx),%eax
  add    $0x4,%rdx
L11:
  cmp    %eax,%ecx
  cmovg  %eax,%ecx
  cmp    %eax,%esi
  cmovl  %eax,%esi
  cmp    %rdi,%rdx
  jne    L13
  add    %ecx,%esi
  lea    D2(%rip),%rdi
  jmp    1050 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L16:
  mov    %ecx,%esi
  lea    D2(%rip),%rdi
  add    %ecx,%esi
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: label: D2
data_type: string

tool: D2: %d


assistant: ```c
void minmax(int n, int *arr) {
  int k = 0, sum, min = arr[0], max = arr[0];
  while (k < n) {
    if (min > arr[k]) {
      min = arr[k];
    }
    if (max < arr[k]) {
      max = arr[k];
    }
    k++;
  }
  sum = min + max;
  printf("%d\n", sum);
}
```
user: Translate the below assembly code into C programming language:

```asm
<minmax>:
  endbr64
  mov    %rsi,%rcx
  mov    %edi,%edx
  mov    (%rsi),%esi
  test   %edi,%edi
  jle    L13
  lea    -0x1(%rdi),%eax
  cmp    $0x2,%eax
  jbe    L18
  movd   %esi,%xmm5
  mov    %edi,%esi
  mov    %rcx,%rax
  shr    $0x2,%esi
  pshufd $0x0,%xmm5,%xmm0
  sub    $0x1,%esi
  movdqa %xmm0,%xmm1
  shl    $0x4,%rsi
  lea    0x10(%rcx,%rsi,1),%rsi
L15:
  movdqu (%rax),%xmm3
  movdqa %xmm0,%xmm2
  add    $0x10,%rax
  pcmpgtd %xmm3,%xmm2
  movdqa %xmm3,%xmm4
  pand   %xmm2,%xmm4
  pandn  %xmm0,%xmm2
  movdqa %xmm2,%xmm0
  movdqa %xmm1,%xmm2
  pcmpgtd %xmm3,%xmm2
  por    %xmm4,%xmm0
  pand   %xmm2,%xmm1
  pandn  %xmm3,%xmm2
  por    %xmm2,%xmm1
  cmp    %rax,%rsi
  jne    L15
  movdqa %xmm1,%xmm3
  mov    %edx,%edi
  psrldq $0x8,%xmm3
  and    $0xfffffffc,%edi
  movdqa %xmm3,%xmm2
  pcmpgtd %xmm1,%xmm2
  pand   %xmm2,%xmm3
  pandn  %xmm1,%xmm2
  por    %xmm3,%xmm2
  movdqa %xmm2,%xmm3
  psrldq $0x4,%xmm3
  movdqa %xmm3,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm3
  pandn  %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  psrldq $0x8,%xmm2
  por    %xmm3,%xmm1
  movd   %xmm1,%eax
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm0,%xmm1
  movd   %xmm1,%esi
  test   $0x3,%dl
  je     L61
L39:
  movslq %edi,%r8
  lea    0x0(,%r8,4),%r9
  mov    (%rcx,%r8,4),%r8d
  cmp    %r8d,%esi
  cmovg  %r8d,%esi
  cmp    %r8d,%eax
  cmovl  %r8d,%eax
  lea    0x1(%rdi),%r8d
  cmp    %r8d,%edx
  jle    L61
  mov    0x4(%rcx,%r9,1),%r8d
  cmp    %r8d,%esi
  cmovg  %r8d,%esi
  cmp    %r8d,%eax
  cmovl  %r8d,%eax
  add    $0x2,%edi
  cmp    %edi,%edx
  jle    L61
  mov    0x8(%rcx,%r9,1),%edx
  cmp    %edx,%esi
  cmovg  %edx,%esi
  cmp    %edx,%eax
  cmovl  %edx,%eax
L61:
  add    %eax,%esi
  lea    D2(%rip),%rdi
  jmp    1050 <printf@plt>
L13:
  mov    %esi,%eax
  lea    D2(%rip),%rdi
  add    %eax,%esi
  jmp    1050 <printf@plt>
L18:
  mov    %esi,%eax
  xor    %edi,%edi
  jmp    L39
```

tool_calls: name: parse_data
arguments: data_tag: D2
datatype: string

tool: D2: %d


assistant: ```c
void minmax(int n, int *arr) {
  int k = 0, sum, min = arr[0], max = arr[0];
  while (k < n) {
    if (min > arr[k]) {
      min = arr[k];
    }
    if (max < arr[k]) {
      max = arr[k];
    }
    k++;
  }
  sum = min + max;
  printf("%d\n", sum);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<strcspn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    $0x0,%ebx
  jmp    L29
L0:
  movsbl %r12b,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L3
  add    $0x1,%ebx
  addq   $0x1,-0x18(%rbp)
L29:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%r12d
  test   %r12b,%r12b
  jne    L0
  jmp    L12
L3:
  nop
L12:
  mov    %ebx,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int strcspn(char *string, char *control) {
  register int count = 0;
  register char ch;
  while (ch = *string) {
    if (strchr(control, ch))
      break;
    else
      count++;
    string++;
  }
  return count;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<strcspn>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r12
  movzbl (%rdi),%esi
  test   %sil,%sil
  je     L25
  mov    %rdi,%rbx
  mov    $0x0,%ebp
L2:
  movsbl %sil,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L3
  add    $0x1,%ebp
  add    $0x1,%rbx
  movzbl (%rbx),%esi
  test   %sil,%sil
  jne    L2
L3:
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L25:
  mov    $0x0,%ebp
  jmp    L3
```

assistant: ```c
int strcspn(char *string, char *control) {
  register int count = 0;
  register char ch;
  while (ch = *string) {
    if (strchr(control, ch))
      break;
    else
      count++;
    string++;
  }
  return count;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strcspn>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  movsbl (%rdi),%esi
  test   %sil,%sil
  je     L29
  mov    %rdi,%rbx
  xor    %r12d,%r12d
  jmp    L20
  nopl   0x0(%rax,%rax,1)
L10:
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  add    $0x1,%r12d
  test   %sil,%sil
  je     L42
L20:
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L10
L42:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L29:
  xor    %r12d,%r12d
  jmp    L42
```

assistant: ```c
int strcspn(char *string, char *control) {
  register int count = 0;
  register char ch;
  while (ch = *string) {
    if (strchr(control, ch))
      break;
    else
      count++;
    string++;
  }
  return count;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<strcspn>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  movsbl (%rdi),%esi
  test   %sil,%sil
  je     L28
  mov    %rdi,%rbx
  xor    %r12d,%r12d
  jmp    L40
  nopl   0x0(%rax,%rax,1)
L21:
  movsbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  add    $0x1,%r12d
  test   %sil,%sil
  je     L6
L40:
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L21
L6:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  xor    %r12d,%r12d
  jmp    L6
```

assistant: ```c
int strcspn(char *string, char *control) {
  register int count = 0;
  register char ch;
  while (ch = *string) {
    if (strchr(control, ch))
      break;
    else
      count++;
    string++;
  }
  return count;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<skip_to>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ftell@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0x70(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jle    L33
  mov    -0x70(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %rax,%rdx
  mov    D7(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jg     L33
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x70(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %rax,%r14
  mov    $0x0,%r15d
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L11:
  cmp    %rdx,%rsp
  je     L8
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L11
L8:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L12
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L12:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x50(%rbp),%rsi
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    %rax,-0x50(%rbp)
  je     L70
  mov    $0xffffffff,%eax
  mov    %rbx,%rsp
  jmp    L59
L70:
  mov    %rbx,%rsp
L33:
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    -0x70(%rbp),%rcx
  mov    -0x68(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fseek@plt>
L59:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L19
  call   <__stack_chk_fail@plt>
L19:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
int skip_to(FILE *file, long offset) {
  long old_offset;
  old_offset = ftell(file);
  if (offset > old_offset && offset - old_offset <= BUFSIZ) {
    size_t skip_bytes = offset - old_offset;
    char buf[skip_bytes];
    if (fread(buf, skip_bytes, 1, file) != skip_bytes)
      return -1;
  }
  return fseek(file, offset, SEEK_SET);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<skip_to>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <ftell@plt>
  cmp    %rbx,%rax
  jge    L16
  mov    %rbx,%r13
  sub    %rax,%r13
  mov    D8(%rip),%rax
  cmp    (%rax),%r13
  jle    L58
L16:
  mov    D16(%rip),%rax
  mov    (%rax),%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <fseek@plt>
L66:
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L58:
  mov    %rsp,%r14
  lea    0xf(%r13),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L67:
  cmp    %rdx,%rsp
  je     L60
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L67
L60:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L63
  orq    $0x0,-0x8(%rsp,%rax,1)
L63:
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    %r13,%rsi
  mov    %rsp,%rdi
  call   <fread@plt>
  cmp    %r13,%rax
  jne    L48
  mov    %r14,%rsp
  jmp    L16
L48:
  mov    %r14,%rsp
  mov    $0xffffffff,%eax
  jmp    L66
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int skip_to(FILE *file, long offset) {
  long old_offset;
  old_offset = ftell(file);
  if (offset > old_offset && offset - old_offset <= BUFSIZ) {
    size_t skip_bytes = offset - old_offset;
    char buf[skip_bytes];
    if (fread(buf, skip_bytes, 1, file) != skip_bytes)
      return -1;
  }
  return fseek(file, offset, SEEK_SET);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<skip_to>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <ftell@plt>
  cmp    %r12,%rax
  jge    L57
  mov    %r12,%rbx
  sub    %rax,%rbx
  mov    D1(%rip),%rax
  cmp    (%rax),%rbx
  jle    L16
L57:
  mov    D3(%rip),%rax
  mov    %r12,%rsi
  mov    %r13,%rdi
  mov    (%rax),%edx
  call   <fseek@plt>
L50:
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L97
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L16:
  lea    0xf(%rbx),%rax
  mov    %rsp,%rcx
  mov    %rsp,%r14
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  and    $0xfffffffffffffff0,%rdx
  sub    %rax,%rcx
L45:
  cmp    %rcx,%rsp
  je     L18
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L45
  nopl   0x0(%rax)
L18:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L86
L48:
  mov    %r13,%rcx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %rsp,%rdi
  call   <fread@plt>
  cmp    %rbx,%rax
  jne    L75
  mov    %r14,%rsp
  jmp    L57
  cs nopw 0x0(%rax,%rax,1)
L86:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L48
L75:
  mov    %r14,%rsp
  mov    $0xffffffff,%eax
  jmp    L50
L97:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int skip_to(FILE *file, long offset) {
  long old_offset;
  old_offset = ftell(file);
  if (offset > old_offset && offset - old_offset <= BUFSIZ) {
    size_t skip_bytes = offset - old_offset;
    char buf[skip_bytes];
    if (fread(buf, skip_bytes, 1, file) != skip_bytes)
      return -1;
  }
  return fseek(file, offset, SEEK_SET);
}
```