ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码：

```asm
<strcmp_token>:
  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   <cur_ptr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L14
  mov    $0xffffffff,%eax
  jmp    L28
L14:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  mov    $0x0,%eax
  jmp    L28
L33:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L41
  mov    $0x1,%eax
  jmp    L28
L41:
  addq   $0x1,-0x28(%rbp)
L5:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L33
  mov    $0xffffffff,%eax
L28:
  leave
  ret
```

assistant: ```c
int strcmp_token(struct assembler *a, const char *s, const char delims[]) {
  char *p = cur_ptr(a);
  size_t n = strlen(s);
  if (strncmp(s, p, n)) {
    return -1;
  }
  p += n;
  if (!*p) {
    return 0;
  }
  while (*delims) {
    if (*p == *delims) {
      return 1;
    }
    ++delims;
  }
  return -1;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<strcmp_token>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  call   <cur_ptr@plt>
  mov    %rax,%r13
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    %rax,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %rax,%rdx
  mov    $0xffffffff,%eax
  test   %rdx,%rdx
  jne    L45
  movzbl 0x0(%r13,%r12,1),%edx
  mov    $0x0,%eax
  test   %dl,%dl
  je     L45
  movzbl (%rbx),%eax
  test   %al,%al
  je     L11
L14:
  cmp    %al,%dl
  je     L25
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L14
  mov    $0xffffffff,%eax
  jmp    L45
L11:
  mov    $0xffffffff,%eax
  jmp    L45
L25:
  mov    $0x1,%eax
L45:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int strcmp_token(struct assembler *a, const char *s, const char delims[]) {
  char *p = cur_ptr(a);
  size_t n = strlen(s);
  if (strncmp(s, p, n)) {
    return -1;
  }
  p += n;
  if (!*p) {
    return 0;
  }
  while (*delims) {
    if (*p == *delims) {
      return 1;
    }
    ++delims;
  }
  return -1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<strcmp_token>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  call   <cur_ptr@plt>
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  mov    %rax,%r12
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0xffffffff,%eax
  test   %r8,%r8
  jne    L8
  movzbl 0x0(%r13,%r12,1),%edx
  xor    %eax,%eax
  test   %dl,%dl
  jne    L14
L8:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L1:
  cmp    %al,%dl
  je     L27
  add    $0x1,%rbx
L14:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L1
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L27:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int strcmp_token(struct assembler *a, const char *s, const char delims[]) {
  char *p = cur_ptr(a);
  size_t n = strlen(s);
  if (strncmp(s, p, n)) {
    return -1;
  }
  p += n;
  if (!*p) {
    return 0;
  }
  while (*delims) {
    if (*p == *delims) {
      return 1;
    }
    ++delims;
  }
  return -1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<strcmp_token>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  call   <cur_ptr@plt>
  mov    %rbp,%rdi
  mov    %rax,%r13
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    %rax,%rdx
  mov    %rax,%r12
  call   <strncmp@plt>
  mov    %rax,%r8
  mov    $0xffffffff,%eax
  test   %r8,%r8
  jne    L28
  movzbl 0x0(%r13,%r12,1),%edx
  xor    %eax,%eax
  test   %dl,%dl
  jne    L24
L28:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L4:
  cmp    %al,%dl
  je     L1
  add    $0x1,%rbx
L24:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L4
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L1:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int strcmp_token(struct assembler *a, const char *s, const char delims[]) {
  char *p = cur_ptr(a);
  size_t n = strlen(s);
  if (strncmp(s, p, n)) {
    return -1;
  }
  p += n;
  if (!*p) {
    return 0;
  }
  while (*delims) {
    if (*p == *delims) {
      return 1;
    }
    ++delims;
  }
  return -1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<do_io_submit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  shr    $0x3f,%rax
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L2
  mov    $0xffffffffffffffea,%rax
  jmp    L25
L2:
  mov    -0x18(%rbp),%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <__access_ok@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  je     L12
  mov    $0xfffffffffffffff2,%rax
  jmp    L25
L12:
  mov    -0x8(%rbp),%rax
L25:
  leave
  ret
```

assistant: ```c
long do_io_submit(long nr, struct iocb **iocbpp) {
  long ret = 0;
  if (__builtin_expect(!!(nr < 0), 0))
    return -22;
  if (__builtin_expect(!!(!__access_ok((unsigned long)iocbpp, (nr * sizeof(*iocbpp)))), 0))
    return -14;
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<do_io_submit>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    $0x0,%esi
  mov    %rdi,%rax
  shr    $0x3f,%rax
  mov    %rax,%rdi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L30
  lea    0x0(,%rbx,8),%rsi
  mov    %rbp,%rdi
  call   <__access_ok@plt>
  test   %eax,%eax
  sete   %dil
  movzbl %dil,%edi
  mov    $0x0,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L37
L39:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L37:
  mov    $0xfffffffffffffff2,%rax
  jmp    L39
L30:
  mov    $0xffffffffffffffea,%rax
  jmp    L39
```

assistant: ```c
long do_io_submit(long nr, struct iocb **iocbpp) {
  long ret = 0;
  if (__builtin_expect(!!(nr < 0), 0))
    return -22;
  if (__builtin_expect(!!(!__access_ok((unsigned long)iocbpp, (nr * sizeof(*iocbpp)))), 0))
    return -14;
  return ret;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<do_io_submit>:
  endbr64
  push   %rbp
  mov    %rdi,%rax
  mov    %rsi,%rbp
  xor    %esi,%esi
  push   %rbx
  shr    $0x3f,%rax
  mov    %rdi,%rbx
  mov    %rax,%rdi
  sub    $0x8,%rsp
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L23
  lea    0x0(,%rbx,8),%rsi
  mov    %rbp,%rdi
  call   <__access_ok@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  xor    %esi,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L5
L27:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L23:
  mov    $0xffffffffffffffea,%rax
  jmp    L27
  nopl   0x0(%rax)
L5:
  mov    $0xfffffffffffffff2,%rax
  jmp    L27
```

assistant: ```c
long do_io_submit(long nr, struct iocb **iocbpp) {
  long ret = 0;
  if (__builtin_expect(!!(nr < 0), 0))
    return -22;
  if (__builtin_expect(!!(!__access_ok((unsigned long)iocbpp, (nr * sizeof(*iocbpp)))), 0))
    return -14;
  return ret;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<do_io_submit>:
  endbr64
  push   %rbp
  mov    %rdi,%rax
  mov    %rsi,%rbp
  xor    %esi,%esi
  push   %rbx
  shr    $0x3f,%rax
  mov    %rdi,%rbx
  mov    %rax,%rdi
  sub    $0x8,%rsp
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L22
  lea    0x0(,%rbx,8),%rsi
  mov    %rbp,%rdi
  call   <__access_ok@plt>
  xor    %edi,%edi
  test   %eax,%eax
  sete   %dil
  xor    %esi,%esi
  call   <__builtin_expect@plt>
  test   %rax,%rax
  jne    L14
L5:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L22:
  mov    $0xffffffffffffffea,%rax
  jmp    L5
  nopl   0x0(%rax)
L14:
  mov    $0xfffffffffffffff2,%rax
  jmp    L5
```

assistant: ```c
long do_io_submit(long nr, struct iocb **iocbpp) {
  long ret = 0;
  if (__builtin_expect(!!(nr < 0), 0))
    return -22;
  if (__builtin_expect(!!(!__access_ok((unsigned long)iocbpp, (nr * sizeof(*iocbpp)))), 0))
    return -14;
  return ret;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L18
L29:
  mov    -0xc(%rbp),%eax
  test   %eax,%eax
  je     L8
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%esi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L18:
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L29
  jmp    L36
L8:
  nop
L36:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L43
  call   <__stack_chk_fail@plt>
L43:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D0
type_infered: string
name: parse_data
arguments: tag: D2
type_infered: string

tool: D0: %d


tool: D2: %d

assistant: ```c
int main() {
  int n, a;
  while (scanf("%d", &n) == 1) {
    if (n == 0) {
      break;
    } else {
      printf("%d\n", n / 2);
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  lea    D19(%rip),%rbx
  lea    D17(%rip),%r12
  jmp    L15
L2:
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %eax,%esi
  sar    %esi
  mov    %r12,%rdi
  call   <printf@plt>
L15:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  jne    L38
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jne    L2
L38:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D19
datatype: string
name: extract_symbolic_data
arguments: label: D17
datatype: string

tool: D19: %d

tool: D17: %d


assistant: ```c
int main() {
  int n, a;
  while (scanf("%d", &n) == 1) {
    if (n == 0) {
      break;
    } else {
      printf("%d\n", n / 2);
    }
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r12
  lea    D2(%rip),%r12
  push   %rbp
  push   %rbx
  lea    D16(%rip),%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  jmp    L1
  nopl   0x0(%rax)
L14:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L8
  mov    %eax,%esi
  mov    %r12,%rdi
  shr    $0x1f,%esi
  add    %eax,%esi
  sar    %esi
  call   <printf@plt>
L1:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L14
L8:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D2
type_infered: string
name: unpack_data
arguments: data_label: D16
type_infered: string

tool: D2: %d


tool: D16: %d

assistant: ```c
int main() {
  int n, a;
  while (scanf("%d", &n) == 1) {
    if (n == 0) {
      break;
    } else {
      printf("%d\n", n / 2);
    }
  }
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r12
  lea    D6(%rip),%r12
  push   %rbp
  push   %rbx
  lea    D10(%rip),%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rbp
  jmp    L5
  nopl   0x0(%rax)
L6:
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L3
  mov    %eax,%esi
  mov    %r12,%rdi
  shr    $0x1f,%esi
  add    %eax,%esi
  sar    %esi
  call   <printf@plt>
L5:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L6
L3:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D6
type: string
name: retrieve_data
arguments: data_tag: D10
type: string

tool: D6: %d


tool: D10: %d

assistant: ```c
int main() {
  int n, a;
  while (scanf("%d", &n) == 1) {
    if (n == 0) {
      break;
    } else {
      printf("%d\n", n / 2);
    }
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<CmdOrBitwise>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <Pop@plt>
  mov    %eax,%ebx
  mov    $0x0,%eax
  call   <Pop@plt>
  or     %ebx,%eax
  mov    %eax,%edi
  call   <Push@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int CmdOrBitwise(void) {
  Push(Pop() | Pop());
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<CmdOrBitwise>:
  endbr64
  push   %rbx
  mov    $0x0,%eax
  call   <Pop@plt>
  mov    %eax,%ebx
  mov    $0x0,%eax
  call   <Pop@plt>
  or     %eax,%ebx
  mov    %ebx,%edi
  call   <Push@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
```

assistant: ```c
int CmdOrBitwise(void) {
  Push(Pop() | Pop());
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<CmdOrBitwise>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  call   <Pop@plt>
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <Pop@plt>
  or     %eax,%ebx
  mov    %ebx,%edi
  call   <Push@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int CmdOrBitwise(void) {
  Push(Pop() | Pop());
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<CmdOrBitwise>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  call   <Pop@plt>
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <Pop@plt>
  or     %eax,%ebx
  mov    %ebx,%edi
  call   <Push@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int CmdOrBitwise(void) {
  Push(Pop() | Pop());
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<mob_class_change>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  lea    D37(%rip),%rax
  mov    %rax,%rdx
  mov    $0xa22,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <nullpo_chk@plt>
  test   %eax,%eax
  je     L72
  mov    $0x0,%eax
  jmp    L7
L72:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rcx
  lea    D37(%rip),%rax
  mov    %rax,%rdx
  mov    $0xa23,%esi
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <nullpo_chk@plt>
  test   %eax,%eax
  je     L3
  mov    $0x0,%eax
  jmp    L7
L5:
  addl   $0x1,-0x14(%rbp)
L3:
  mov    -0x14(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L18
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <mobdb_checkid@plt>
  test   %eax,%eax
  jne    L5
L18:
  cmpl   $0x0,-0x14(%rbp)
  jg     L29
  mov    $0x0,%eax
  jmp    L7
L29:
  mov    $0x0,%eax
  call   <rand@plt>
  mov    %eax,%ebx
  mov    $0x0,%eax
  call   <rand@plt>
  sar    $0x8,%eax
  xor    %ebx,%eax
  cltd
  idivl  -0x14(%rbp)
  mov    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <mob_class_change_id@plt>
L7:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D37
type_infered: string
name: extract_symbolic_data
arguments: label: D33
type_infered: string

tool: D37: mob_class_change

tool: D33: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c

assistant: ```c
int mob_class_change(struct mob_data *md, const int *value, int value_count) {
  int count = 0;
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2594, __FUNCTION__, (void *)(md))) {
    return (0);
  };
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2595, __FUNCTION__, (void *)(value))) {
    return (0);
  };
  while (count < value_count && mobdb_checkid(value[count])) {
    count++;
  }
  if (count <= 0)
    return 0;
  return mob_class_change_id(md, value[(rand() ^ (rand() >> 8)) % count]);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<mob_class_change>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r14
  mov    %edx,%r12d
  mov    %rdi,%rcx
  lea    D37(%rip),%rdx
  mov    $0xa22,%esi
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <nullpo_chk@plt>
  mov    $0x0,%ebp
  test   %eax,%eax
  je     L7
L5:
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  mov    %eax,%ebp
  mov    %r14,%rcx
  lea    D37(%rip),%rdx
  mov    $0xa23,%esi
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <nullpo_chk@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L5
  test   %r12d,%r12d
  jle    L68
  mov    %r14,%rbp
  mov    %eax,%ebx
L26:
  mov    0x0(%rbp),%edi
  mov    $0x0,%eax
  call   <mobdb_checkid@plt>
  test   %eax,%eax
  je     L1
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,%r12d
  jne    L26
  mov    %r12d,%ebx
L1:
  mov    %r15d,%ebp
  test   %ebx,%ebx
  jle    L5
  mov    $0x0,%eax
  call   <rand@plt>
  mov    %eax,%ebp
  mov    $0x0,%eax
  call   <rand@plt>
  sar    $0x8,%eax
  xor    %ebp,%eax
  cltd
  idiv   %ebx
  movslq %edx,%rdx
  mov    (%r14,%rdx,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <mob_class_change_id@plt>
  mov    %eax,%ebp
  jmp    L5
L68:
  mov    %eax,%ebp
  jmp    L5
```

tool_calls: name: unpack_data
arguments: data_label: D37
type_guessed: string
name: unpack_data
arguments: data_label: D35
type_guessed: string

tool: D37: mob_class_change

tool: D35: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c

assistant: ```c
int mob_class_change(struct mob_data *md, const int *value, int value_count) {
  int count = 0;
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2594, __FUNCTION__, (void *)(md))) {
    return (0);
  };
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2595, __FUNCTION__, (void *)(value))) {
    return (0);
  };
  while (count < value_count && mobdb_checkid(value[count])) {
    count++;
  }
  if (count <= 0)
    return 0;
  return mob_class_change_id(md, value[(rand() ^ (rand() >> 8)) % count]);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<mob_class_change>:
  endbr64
  push   %r15
  lea    D6(%rip),%r15
  mov    %rdi,%rcx
  xor    %eax,%eax
  push   %r14
  mov    %rsi,%r14
  mov    $0xa22,%esi
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %edx,%r12d
  mov    %r15,%rdx
  push   %rbp
  lea    D3(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  sub    $0x8,%rsp
  call   <nullpo_chk@plt>
  test   %eax,%eax
  je     L3
L7:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  mov    %r14,%rcx
  mov    %r15,%rdx
  mov    $0xa23,%esi
  mov    %rbp,%rdi
  call   <nullpo_chk@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jne    L7
  test   %r12d,%r12d
  jle    L7
  mov    %r14,%rbp
  jmp    L52
  nopl   0x0(%rax,%rax,1)
L51:
  add    $0x1,%ebx
  add    $0x4,%rbp
  cmp    %ebx,%r12d
  je     L20
L52:
  mov    0x0(%rbp),%edi
  xor    %eax,%eax
  call   <mobdb_checkid@plt>
  test   %eax,%eax
  jne    L51
  test   %ebx,%ebx
  je     L7
  mov    %ebx,%r12d
L20:
  xor    %eax,%eax
  call   <rand@plt>
  mov    %eax,%ebx
  xor    %eax,%eax
  call   <rand@plt>
  mov    %r13,%rdi
  sar    $0x8,%eax
  xor    %ebx,%eax
  cltd
  idiv   %r12d
  xor    %eax,%eax
  movslq %edx,%rdx
  mov    (%r14,%rdx,4),%esi
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <mob_class_change_id@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
type_guessed: string
name: disassemble_data
arguments: data_tag: D3
type_guessed: string

tool: D6: mob_class_change

tool: D3: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c

assistant: ```c
int mob_class_change(struct mob_data *md, const int *value, int value_count) {
  int count = 0;
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2594, __FUNCTION__, (void *)(md))) {
    return (0);
  };
  if (nullpo_chk("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AurigaProject/root/refs/heads/master/src/map/mob.c", 2595, __FUNCTION__, (void *)(value))) {
    return (0);
  };
  while (count < value_count && mobdb_checkid(value[count])) {
    count++;
  }
  if (count <= 0)
    return 0;
  return mob_class_change_id(md, value[(rand() ^ (rand() >> 8)) % count]);
}
```