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

```asm
<mountedby>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%edi
  call   <strdup@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L8
L36:
  mov    %r13,(%rsp)
  mov    %rsp,%r12
  lea    D22(%rip),%rbp
  lea    D15(%rip),%r15
L14:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strsep@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L16
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  cmp    %rax,%rbx
  jne    L14
  lea    0x6(%rbx),%rdi
  mov    %r14,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  sete   %bl
  movzbl %bl,%ebx
L16:
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L8:
  lea    D27(%rip),%rsi
  mov    $0x1,%edi
  call   <errx@plt>
  jmp    L36
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D22
type_guessed: string
name: disassemble_data
arguments: data_label: D15
type_guessed: string
name: disassemble_data
arguments: data_label: D27
type_guessed: string

tool: D22: ,

tool: D15: uname=

tool: D27: out of memory

assistant: ```c
int mountedby(struct mntent *mnt, const char *user) {
  char *ds = strdup(mnt->mnt_opts);
  if (!ds)
    errx(1, "out of memory");
  char *s = ds;
  char *tok;
  int ret = 0;
  while ((tok = strsep(&s, ","))) {
    if (strstr(tok, "uname=") == tok) {
      ret = strcmp(tok + 6, user) == 0;
      break;
    }
  }
  free(ds);
  return ret;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<mountedby>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    (%rdi),%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strdup@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L59
L43:
  mov    %r14,(%rsp)
  mov    %rsp,%r12
  lea    D19(%rip),%rbp
  lea    D13(%rip),%r13
  jmp    L6
  nop
L25:
  mov    $0x6,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L19
L6:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strsep@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L25
  xor    %r12d,%r12d
L68:
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L19:
  lea    0x6(%rbx),%rdi
  mov    %r15,%rsi
  xor    %r12d,%r12d
  call   <strcmp@plt>
  test   %rax,%rax
  sete   %r12b
  jmp    L68
L59:
  lea    D21(%rip),%rsi
  mov    $0x1,%edi
  call   <errx@plt>
  jmp    L43
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D19
type: string
name: extract_symbolic_data
arguments: label: D13
type: string
name: extract_symbolic_data
arguments: label: D21
type: string

tool: D19: ,

tool: D13: uname=

tool: D21: out of memory

assistant: ```c
int mountedby(struct mntent *mnt, const char *user) {
  char *ds = strdup(mnt->mnt_opts);
  if (!ds)
    errx(1, "out of memory");
  char *s = ds;
  char *tok;
  int ret = 0;
  while ((tok = strsep(&s, ","))) {
    if (strstr(tok, "uname=") == tok) {
      ret = strcmp(tok + 6, user) == 0;
      break;
    }
  }
  free(ds);
  return ret;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<mountedby>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    (%rdi),%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <strdup@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L35
L14:
  mov    %r14,(%rsp)
  mov    %rsp,%r12
  lea    D19(%rip),%rbp
  lea    D9(%rip),%r13
  jmp    L67
  nop
L21:
  mov    $0x6,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L28
L67:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strsep@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L21
  xor    %r12d,%r12d
L25:
  mov    %r14,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L37
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L28:
  lea    0x6(%rbx),%rdi
  mov    %r15,%rsi
  xor    %r12d,%r12d
  call   <strcmp@plt>
  test   %rax,%rax
  sete   %r12b
  jmp    L25
L35:
  lea    D12(%rip),%rsi
  mov    $0x1,%edi
  call   <errx@plt>
  jmp    L14
L37:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D19
type_infered: string
name: unpack_data
arguments: label: D9
type_infered: string
name: unpack_data
arguments: label: D12
type_infered: string

tool: D19: ,

tool: D9: uname=

tool: D12: out of memory

assistant: ```c
int mountedby(struct mntent *mnt, const char *user) {
  char *ds = strdup(mnt->mnt_opts);
  if (!ds)
    errx(1, "out of memory");
  char *s = ds;
  char *tok;
  int ret = 0;
  while ((tok = strsep(&s, ","))) {
    if (strstr(tok, "uname=") == tok) {
      ret = strcmp(tok + 6, user) == 0;
      break;
    }
  }
  free(ds);
  return ret;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<flat_get_addr_from_rp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <get_unaligned@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  and    $0x80000000,%eax
  test   %rax,%rax
  je     L0
  andq   $0x3fffff,-0x8(%rbp)
  jmp    L2
L0:
  mov    -0x20(%rbp),%rax
  and    $0x40000000,%eax
  test   %rax,%rax
  je     L2
  andq   $0x3ff,-0x8(%rbp)
L2:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval, unsigned long flags) {
  unsigned long addr = get_unaligned(rp);
  (void)flags;
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<flat_get_addr_from_rp>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <get_unaligned@plt>
  test   $0x80000000,%ebx
  je     L8
  and    $0x3fffff,%eax
L0:
  pop    %rbx
  ret
L8:
  mov    %rax,%rdx
  and    $0x3ff,%edx
  test   $0x40000000,%ebx
  cmovne %rdx,%rax
  jmp    L0
```

assistant: ```c
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval, unsigned long flags) {
  unsigned long addr = get_unaligned(rp);
  (void)flags;
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<flat_get_addr_from_rp>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <get_unaligned@plt>
  test   $0x80000000,%ebx
  je     L8
  and    $0x3fffff,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax)
L8:
  mov    %rax,%rdx
  and    $0x3ff,%edx
  test   $0x40000000,%ebx
  pop    %rbx
  cmovne %rdx,%rax
  ret
```

assistant: ```c
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval, unsigned long flags) {
  unsigned long addr = get_unaligned(rp);
  (void)flags;
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<flat_get_addr_from_rp>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <get_unaligned@plt>
  test   $0x80000000,%ebx
  je     L3
  and    $0x3fffff,%eax
  pop    %rbx
  ret
  nopl   0x0(%rax)
L3:
  mov    %rax,%rdx
  and    $0x3ff,%edx
  test   $0x40000000,%ebx
  pop    %rbx
  cmovne %rdx,%rax
  ret
```

assistant: ```c
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval, unsigned long flags) {
  unsigned long addr = get_unaligned(rp);
  (void)flags;
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<usleep>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x12,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cltq
  mov    %rax,-0x20(%rbp)
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x431bde83,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x12,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0xf4240,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  movslq %edx,%rax
  imul   $0x3e8,%rax,%rax
  mov    %rax,-0x18(%rbp)
  lea    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <__nanosleep@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

assistant: ```c
int usleep(useconds_t useconds) {
  struct timespec ts = {.tv_sec = (long int)(useconds / 1000000), .tv_nsec = (long int)(useconds % 1000000) * 1000ul};
  return __nanosleep(&ts, NULL);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<usleep>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  mov    %edi,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  movslq %eax,%rdx
  mov    %rdx,(%rsp)
  imul   $0xf4240,%eax,%eax
  sub    %eax,%edi
  movslq %edi,%rdi
  imul   $0x3e8,%rdi,%rdi
  mov    %rdi,0x8(%rsp)
  mov    %rsp,%rdi
  mov    $0x0,%esi
  call   <__nanosleep@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x28,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int usleep(useconds_t useconds) {
  struct timespec ts = {.tv_sec = (long int)(useconds / 1000000), .tv_nsec = (long int)(useconds % 1000000) * 1000ul};
  return __nanosleep(&ts, NULL);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<usleep>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,%edx
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  sar    $0x1f,%edx
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0xf4240,%eax,%eax
  mov    %rdx,(%rsp)
  sub    %eax,%edi
  movslq %edi,%rdi
  imul   $0x3e8,%rdi,%rdi
  mov    %rdi,0x8(%rsp)
  mov    %rsp,%rdi
  call   <__nanosleep@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L2
  add    $0x28,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int usleep(useconds_t useconds) {
  struct timespec ts = {.tv_sec = (long int)(useconds / 1000000), .tv_nsec = (long int)(useconds % 1000000) * 1000ul};
  return __nanosleep(&ts, NULL);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<usleep>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,%edx
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movslq %edi,%rax
  sar    $0x1f,%edx
  imul   $0x431bde83,%rax,%rax
  sar    $0x32,%rax
  sub    %edx,%eax
  movslq %eax,%rcx
  imul   $0xf4240,%eax,%eax
  movq   %rcx,%xmm0
  sub    %eax,%edi
  movslq %edi,%rdi
  imul   $0x3e8,%rdi,%rdi
  movq   %rdi,%xmm1
  mov    %rsp,%rdi
  punpcklqdq %xmm1,%xmm0
  movaps %xmm0,(%rsp)
  call   <__nanosleep@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0x28,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int usleep(useconds_t useconds) {
  struct timespec ts = {.tv_sec = (long int)(useconds / 1000000), .tv_nsec = (long int)(useconds % 1000000) * 1000ul};
  return __nanosleep(&ts, NULL);
}
```
user: Translate the below assembly code into C programming language:

```asm
<Is_numeric>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  jmp    L10
L31:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L10
  mov    $0x0,%eax
  jmp    L37
L10:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L31
  mov    $0x1,%eax
L37:
  pop    %rbp
  ret
```

assistant: ```c
int Is_numeric(char *s) {
  while (*s)
    if (!isdigit((int)(unsigned char)*(s++)))
      return 0;
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<Is_numeric>:
  endbr64
L7:
  movzbl (%rdi),%eax
  test   %al,%al
  je     L13
  add    $0x1,%rdi
  movzbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L7
  mov    $0x0,%eax
  ret
L13:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int Is_numeric(char *s) {
  while (*s)
    if (!isdigit((int)(unsigned char)*(s++)))
      return 0;
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<Is_numeric>:
  endbr64
  jmp    L8
  cs nopw 0x0(%rax,%rax,1)
L3:
  sub    $0x30,%eax
  add    $0x1,%rdi
  cmp    $0x9,%eax
  ja     L9
L8:
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L3
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L9:
  xor    %eax,%eax
  ret
```

assistant: ```c
int Is_numeric(char *s) {
  while (*s)
    if (!isdigit((int)(unsigned char)*(s++)))
      return 0;
  return 1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<Is_numeric>:
  endbr64
  jmp    L28
  cs nopw 0x0(%rax,%rax,1)
L21:
  sub    $0x30,%eax
  add    $0x1,%rdi
  cmp    $0x9,%eax
  ja     L5
L28:
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L21
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L5:
  xor    %eax,%eax
  ret
```

assistant: ```c
int Is_numeric(char *s) {
  while (*s)
    if (!isdigit((int)(unsigned char)*(s++)))
      return 0;
  return 1;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L34
L72:
  cmpl   $0x5,-0x8(%rbp)
  je     L9
  cmpl   $0x7,-0x8(%rbp)
  jne    L7
  cmpl   $0x0,-0x14(%rbp)
  je     L23
L7:
  cmpl   $0x9,-0x8(%rbp)
  je     L38
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L37
L9:
  nop
L37:
  addl   $0x1,-0x8(%rbp)
L34:
  cmpl   $0x9,-0x8(%rbp)
  jle    L72
  jmp    L48
L23:
  nop
  jmp    L48
L38:
  nop
L48:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int foo(int parm) {
  int varj, varm;
  for (varj = 0; varj < 10; varj++) {
    if (varj == 5)
      continue;
    if (varj == 7 && !parm)
      goto exitlab;
    if (varj == 9)
      break;
    varm = varj;
  }
exitlab:
  return varm;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<foo>:
  endbr64
  mov    $0x1,%ecx
  mov    $0x0,%eax
  jmp    L2
L23:
  mov    %r9d,%edx
L8:
  add    $0x1,%eax
  add    $0x1,%ecx
  mov    %edx,%r9d
L2:
  mov    %eax,%edx
  cmp    $0x5,%eax
  je     L23
  cmp    $0x7,%eax
  sete   %r8b
  test   %edi,%edi
  sete   %sil
  test   %sil,%r8b
  jne    L7
  cmp    $0x9,%eax
  je     L7
  cmp    $0x9,%ecx
  jle    L8
  mov    %eax,%r9d
L7:
  mov    %r9d,%eax
  ret
```

assistant: ```c
int foo(int parm) {
  int varj, varm;
  for (varj = 0; varj < 10; varj++) {
    if (varj == 5)
      continue;
    if (varj == 7 && !parm)
      goto exitlab;
    if (varj == 9)
      break;
    varm = varj;
  }
exitlab:
  return varm;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<foo>:
  endbr64
  xor    %r8d,%r8d
  xor    %eax,%eax
  test   %edi,%edi
  mov    $0x1,%edx
  sete   %cl
  cmp    $0x5,%eax
  je     L59
  cmp    $0x7,%eax
  sete   %sil
  test   %cl,%sil
  jne    L57
L5:
  cmp    $0x9,%eax
  je     L57
  mov    %eax,%r8d
  cmp    $0xa,%edx
  je     L57
L59:
  add    $0x1,%eax
  add    $0x1,%edx
  test   %edi,%edi
  sete   %cl
  cmp    $0x5,%eax
  je     L59
  cmp    $0x7,%eax
  sete   %sil
  test   %cl,%sil
  je     L5
L57:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int foo(int parm) {
  int varj, varm;
  for (varj = 0; varj < 10; varj++) {
    if (varj == 5)
      continue;
    if (varj == 7 && !parm)
      goto exitlab;
    if (varj == 9)
      break;
    varm = varj;
  }
exitlab:
  return varm;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<foo>:
  endbr64
  cmp    $0x1,%edi
  sbb    %eax,%eax
  and    $0xfffffffe,%eax
  add    $0x8,%eax
  ret
```

assistant: ```c
int foo(int parm) {
  int varj, varm;
  for (varj = 0; varj < 10; varj++) {
    if (varj == 5)
      continue;
    if (varj == 7 && !parm)
      goto exitlab;
    if (varj == 9)
      break;
    varm = varj;
  }
exitlab:
  return varm;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<split>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L11
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  jmp    L9
L11:
  mov    -0x18(%rbp),%rax
L9:
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L38
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L44
L38:
  mov    $0x0,%eax
  jmp    L30
L44:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strspn@plt>
  cltq
  add    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcspn@plt>
  mov    -0x20(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
L30:
  leave
  ret
```

assistant: ```c
char *split(const char *c, size_t *l, const char *separator, char **state) {
  char *current;
  current = *state ? *state : (char *)c;
  if (!*current || *c == 0)
    return NULL;
  current += strspn(current, separator);
  *l = strcspn(current, separator);
  *state = current + *l;
  return (char *)current;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<split>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    (%rcx),%rbx
  test   %rbx,%rbx
  cmove  %rdi,%rbx
  cmpb   $0x0,(%rbx)
  je     L2
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %rcx,%r12
  mov    $0x0,%ebp
  cmpb   $0x0,(%rdi)
  je     L19
  mov    %rdx,%rsi
  mov    %rbx,%rdi
  call   <strspn@plt>
  movslq %eax,%rbp
  add    %rbx,%rbp
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcspn@plt>
  mov    %rax,(%r14)
  add    %rbp,%rax
  mov    %rax,(%r12)
L19:
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L2:
  mov    $0x0,%ebp
  jmp    L19
```

assistant: ```c
char *split(const char *c, size_t *l, const char *separator, char **state) {
  char *current;
  current = *state ? *state : (char *)c;
  if (!*current || *c == 0)
    return NULL;
  current += strspn(current, separator);
  *l = strcspn(current, separator);
  *state = current + *l;
  return (char *)current;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<split>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    (%rcx),%rbx
  test   %rbx,%rbx
  cmove  %rdi,%rbx
  xor    %r12d,%r12d
  cmpb   $0x0,(%rbx)
  je     L16
  cmpb   $0x0,(%rdi)
  je     L16
  mov    %rsi,%r14
  mov    %rbx,%rdi
  mov    %rdx,%rsi
  mov    %rdx,%r13
  mov    %rcx,%rbp
  call   <strspn@plt>
  mov    %r13,%rsi
  movslq %eax,%r12
  add    %rbx,%r12
  mov    %r12,%rdi
  call   <strcspn@plt>
  mov    %rax,(%r14)
  add    %r12,%rax
  mov    %rax,0x0(%rbp)
L16:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *split(const char *c, size_t *l, const char *separator, char **state) {
  char *current;
  current = *state ? *state : (char *)c;
  if (!*current || *c == 0)
    return NULL;
  current += strspn(current, separator);
  *l = strcspn(current, separator);
  *state = current + *l;
  return (char *)current;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<split>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    (%rcx),%rbx
  test   %rbx,%rbx
  cmove  %rdi,%rbx
  xor    %r12d,%r12d
  cmpb   $0x0,(%rbx)
  je     L0
  cmpb   $0x0,(%rdi)
  je     L0
  mov    %rsi,%r14
  mov    %rbx,%rdi
  mov    %rdx,%rsi
  mov    %rdx,%r13
  mov    %rcx,%rbp
  call   <strspn@plt>
  mov    %r13,%rsi
  movslq %eax,%r12
  add    %rbx,%r12
  mov    %r12,%rdi
  call   <strcspn@plt>
  mov    %rax,(%r14)
  add    %r12,%rax
  mov    %rax,0x0(%rbp)
L0:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *split(const char *c, size_t *l, const char *separator, char **state) {
  char *current;
  current = *state ? *state : (char *)c;
  if (!*current || *c == 0)
    return NULL;
  current += strspn(current, separator);
  *l = strcspn(current, separator);
  *state = current + *l;
  return (char *)current;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<cmio_ce>:
  endbr64
  divsd  %xmm2,%xmm3
  push   %rbp
  pxor   %xmm0,%xmm0
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    0x80(%rsp),%rbx
  mov    0x90(%rsp),%rbp
  ucomisd %xmm3,%xmm0
  jae    L11
L6:
  cmpl   $0x1,(%rbx)
  jne    L91
  test   %r9d,%r9d
  jg     L26
L91:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  mov    0x8(%rbx),%eax
  movsd  0x0(%rbp),%xmm0
  cmp    $0x1,%eax
  je     L67
  lea    0x20(%rsp),%rdi
  cmp    $0x3,%eax
  je     L19
  lea    D12(%rip),%rdx
  mov    $0x26,%esi
  call   <snprintf@plt>
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L19:
  lea    D23(%rip),%rdx
  mov    $0x26,%esi
  call   <snprintf@plt>
  jmp    L91
  nopl   0x0(%rax,%rax,1)
L67:
  lea    0x20(%rsp),%rdi
  lea    D9(%rip),%rdx
  mov    $0x26,%esi
  movsd  %xmm0,0x8(%rsp)
  call   <snprintf@plt>
  movsd  0x8(%rsp),%xmm0
  lea    0x18(%rsp),%rdx
  lea    0x14(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <cmio_jd2y@plt>
  jmp    L91
L11:
  movapd %xmm3,%xmm0
  mov    %r9d,0x8(%rsp)
  call   <log10@plt>
  mov    0x8(%rsp),%r9d
  jmp    L6
L20:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D12
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D23
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D9
type_guessed: string

tool: D12: (5a,/,9x,a,f14.1,a)

tool: D23: (5a,/,9x,a,f14.3,a)

tool: D9: (5a,/,9x,a,i10,1x,i2,1x,f4.1)

assistant: ```c
int cmio_ce(double time, double tstart, double rcen, double rmax, int nbod, int nbig, double *m, int *stat, char **id, int nclo, int *iclo, int *jclo, int opt[8], int stopflag, double *tclo, double *dclo, double **ixvclo, double **jxvclo, char **mem, int lmem[200], FILE *outfile, int nstored, int ceflush) {
  int year, month;
  double tmp0, t1, rfac, fr, fv, theta, phi, vtheta, vphi;
  static char c[200][80];
  char fstop[38];
  char *mio_fl2c_out, *mio_re2c_out;
  char tstring[6];
  rfac = log10(rmax / rcen);
  for (int k = 0; k < nclo; k++) {
    nstored++;
  }
  if (nstored >= 100 || ceflush == 0) {
    for (int k = 0; k < nstored; k++) {
    }
    nstored = 0;
  }
  stopflag = 0;
  if (opt[0] == 1 && nclo > 0) {
    tmp0 = tclo[0];
    if (opt[2] == 1) {
      snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,i10,1x,i2,1x,f4.1)");
      cmio_jd2y(tmp0, &year, &month, &t1);
    } else {
      if (opt[2] == 3) {
        snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,f14.3,a)");
        t1 = (tmp0 - tstart) / 365.250;
      } else {
        snprintf(fstop, sizeof(fstop), "(5a,/,9x,a,f14.1,a)");
        if (opt[2] == 0) {
          t1 = tmp0;
        }
        if (opt[2] == 2) {
          t1 = tmp0 - tstart;
        }
      }
    }
    stopflag = 1;
  }
  return 0;
}
```