ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<strToHex>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x8,%rsp
L19:
  movsbl (%r14,%r13,2),%edi
  call   <charToHex@plt>
  movsbl 0x1(%r14,%r13,2),%edi
  mov    %eax,%ebx
  call   <charToHex@plt>
  shl    $0x4,%ebx
  or     %eax,%ebx
  mov    %bl,(%r15,%r13,1)
  add    $0x1,%r13
  cmp    $0x4,%r13
  jne    L19
  xor    %r13d,%r13d
L8:
  movsbl 0x0(%rbp,%r13,2),%edi
  call   <charToHex@plt>
  movsbl 0x1(%rbp,%r13,2),%edi
  mov    %eax,%ebx
  call   <charToHex@plt>
  shl    $0x4,%ebx
  or     %eax,%ebx
  mov    %bl,(%r12,%r13,1)
  add    $0x1,%r13
  cmp    $0x4,%r13
  jne    L8
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void strToHex(char p1[8], unsigned char h1[4], char p2[8], unsigned char h2[4]) {
  int i;
  for (i = 0; i < 4; i++) {
    h1[i] = (charToHex(p1[i * 2]) << 4) | charToHex(p1[i * 2 + 1]);
  }
  for (i = 0; i < 4; i++) {
    h2[i] = (charToHex(p2[i * 2]) << 4) | charToHex(p2[i * 2 + 1]);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<smash_tilde>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  jmp    L23
L3:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7e,%al
  jne    L26
  mov    -0x8(%rbp),%rax
  movb   $0x2d,(%rax)
L26:
  addq   $0x1,-0x8(%rbp)
L23:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L3
  nop
  pop    %rbp
  ret
```

assistant: ```c
void smash_tilde(char *str) {
  for (; *str != '\0'; str++)
    if (*str == '~')
      *str = '-';
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<smash_tilde>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L13
L29:
  ret
L2:
  add    $0x1,%rdi
  movzbl (%rdi),%eax
  test   %al,%al
  je     L29
L13:
  cmp    $0x7e,%al
  jne    L2
  movb   $0x2d,(%rdi)
  jmp    L2
```

assistant: ```c
void smash_tilde(char *str) {
  for (; *str != '\0'; str++)
    if (*str == '~')
      *str = '-';
  return;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<smash_tilde>:
  endbr64
  jmp    L5
  cs nopw 0x0(%rax,%rax,1)
L4:
  cmp    $0x7e,%al
  jne    L24
  movb   $0x2d,(%rdi)
L24:
  add    $0x1,%rdi
L5:
  movzbl (%rdi),%eax
  test   %al,%al
  jne    L4
  ret
```

assistant: ```c
void smash_tilde(char *str) {
  for (; *str != '\0'; str++)
    if (*str == '~')
      *str = '-';
  return;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<smash_tilde>:
  endbr64
  jmp    L7
  cs nopw 0x0(%rax,%rax,1)
L18:
  add    $0x1,%rdi
L7:
  movzbl (%rdi),%eax
  test   %al,%al
  je     L3
L30:
  cmp    $0x7e,%al
  jne    L18
  movb   $0x2d,(%rdi)
  movzbl 0x1(%rdi),%eax
  add    $0x1,%rdi
  test   %al,%al
  jne    L30
  ret
  nop
L3:
  ret
```

assistant: ```c
void smash_tilde(char *str) {
  for (; *str != '\0'; str++)
    if (*str == '~')
      *str = '-';
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<syscon_store_quaddobl_polynomial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %rcx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x40(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L35:
  cmp    %rdx,%rsp
  je     L30
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L35
L30:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L34
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L34:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L2
L28:
  mov    -0x48(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x38(%rbp),%rax
  mov    -0x48(%rbp),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rax,%rdx,4)
  addl   $0x1,-0x48(%rbp)
L2:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L28
  mov    -0x30(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  lea    -0x24(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rsi
  mov    $0x184,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L26
  call   <__stack_chk_fail@plt>
L26:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int syscon_store_quaddobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(388, a, b, c, 0);
  return fail;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<syscon_store_quaddobl_polynomial>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %esi,%r9d
  mov    %edx,%r8d
  mov    %rcx,%rsi
  mov    %fs:0x28,%rdx
  mov    %rdx,-0x8(%rbp)
  xor    %edx,%edx
  movslq %edi,%rdx
  lea    0xf(,%rdx,4),%rdx
  mov    %rdx,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rcx
  sub    %rdx,%rcx
L4:
  cmp    %rcx,%rsp
  je     L38
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L4
L38:
  mov    %rdi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L10
  orq    $0x0,-0x8(%rsp,%rdx,1)
L10:
  mov    %rsp,%rdi
  mov    %eax,-0x14(%rbp)
  mov    %r9d,-0x10(%rbp)
  mov    %r8d,-0xc(%rbp)
  test   %eax,%eax
  jle    L54
  mov    %eax,%ecx
  mov    $0x0,%eax
L48:
  movsbl (%rsi,%rax,1),%edx
  mov    %edx,(%rdi,%rax,4)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L48
L54:
  lea    -0x14(%rbp),%rsi
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    %rdi,%rdx
  mov    $0x184,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L45
  leave
  ret
L45:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int syscon_store_quaddobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(388, a, b, c, 0);
  return fail;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<syscon_store_quaddobl_polynomial>:
  endbr64
  push   %rbp
  mov    %esi,%r8d
  movslq %edi,%rsi
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    0xf(,%rsi,4),%rax
  mov    %rsp,%r10
  mov    %rax,%r9
  and    $0xfffffffffffff000,%rax
  sub    %rax,%r10
  and    $0xfffffffffffffff0,%r9
  cmp    %r10,%rsp
  je     L28
L35:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %r10,%rsp
  jne    L35
L28:
  and    $0xfff,%r9d
  sub    %r9,%rsp
  test   %r9,%r9
  jne    L26
L51:
  mov    %edi,-0x14(%rbp)
  mov    %rsp,%r9
  mov    %r8d,-0x10(%rbp)
  mov    %edx,-0xc(%rbp)
  test   %edi,%edi
  jle    L15
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L0:
  movsbl (%rcx,%rax,1),%edx
  mov    %edx,(%r9,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L0
L15:
  xor    %r8d,%r8d
  xor    %ecx,%ecx
  mov    %r9,%rdx
  mov    $0x184,%edi
  lea    -0x14(%rbp),%rsi
  call   <_ada_use_c2phc4c@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L39
  leave
  ret
  nopl   0x0(%rax,%rax,1)
L26:
  orq    $0x0,-0x8(%rsp,%r9,1)
  jmp    L51
L39:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int syscon_store_quaddobl_polynomial(int nc, int n, int k, char *p) {
  int a[3], b[nc], i, fail;
  double *c;
  a[0] = nc;
  a[1] = n;
  a[2] = k;
  for (i = 0; i < nc; i++)
    b[i] = (int)p[i];
  fail = _ada_use_c2phc4c(388, a, b, c, 0);
  return fail;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<str_copyf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xd0(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L9
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L9:
  mov    -0xd0(%rbp),%rdx
  mov    -0xb4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xb4(%rbp),%ecx
  mov    -0xd0(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <str_vformat@plt>
  mov    -0xb4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  nop
  leave
  ret
```

assistant: ```c
void str_copyf(struct str *sa, const char *fmt, ...) {
  va_list va;
  va_start(va, fmt);
  str_vformat(sa, 0, fmt, va);
  va_end(va);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<str_copyf>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    $0x0,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %rbx,%rdx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <str_vformat@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void str_copyf(struct str *sa, const char *fmt, ...) {
  va_list va;
  va_start(va, fmt);
  str_vformat(sa, 0, fmt, va);
  va_end(va);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<str_copyf>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  xor    %ebp,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r12,%rdx
  mov    %r13,%rdi
  xor    %esi,%esi
  call   <str_vformat@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void str_copyf(struct str *sa, const char *fmt, ...) {
  va_list va;
  va_start(va, fmt);
  str_vformat(sa, 0, fmt, va);
  va_end(va);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<str_copyf>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  xor    %ebp,%ebp
  mov    %ebp,%edi
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r12,%rdx
  mov    %r13,%rdi
  xor    %esi,%esi
  call   <str_vformat@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void str_copyf(struct str *sa, const char *fmt, ...) {
  va_list va;
  va_start(va, fmt);
  str_vformat(sa, 0, fmt, va);
  va_end(va);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<handlers_c>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D6(%rip),%rax
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
type: string

tool: D6: $Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $

assistant: ```c
char const *handlers_c() {
  static char const rcsid[] = "$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $";
  return (rcsid);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<handlers_c>:
  endbr64
  lea    D5(%rip),%rax
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D5
type_infered: string

tool: D5: $Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $

assistant: ```c
char const *handlers_c() {
  static char const rcsid[] = "$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $";
  return (rcsid);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<handlers_c>:
  endbr64
  lea    D7(%rip),%rax
  ret
```

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

tool: D7: $Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $

assistant: ```c
char const *handlers_c() {
  static char const rcsid[] = "$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $";
  return (rcsid);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<handlers_c>:
  endbr64
  lea    D4(%rip),%rax
  ret
```

tool_calls: name: disassemble_data
arguments: label: D4
data_type: string

tool: D4: $Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $

assistant: ```c
char const *handlers_c() {
  static char const rcsid[] = "$Id: handlers.c 347 2014-05-21 15:15:57Z kny48981 $";
  return (rcsid);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<parse_ip_netmask>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x28(%rbp)
  jne    L81
  mov    $0xfffffff6,%eax
  jmp    L16
L81:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L4
  mov    -0x38(%rbp),%rax
  movl   $0xffffffff,(%rax)
  mov    $0x0,%eax
  jmp    L16
L4:
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L17
  mov    $0xfffffffe,%eax
  jmp    L16
L17:
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <is_positive_number@plt>
  cmp    $0x1,%eax
  jne    L63
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <make_mask@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %eax,%eax
  jne    L30
  mov    -0x38(%rbp),%rax
  movl   $0x0,(%rax)
  mov    $0xffffffff,%eax
  jmp    L16
L30:
  mov    -0x1c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x1,%eax
  jmp    L16
L63:
  lea    -0x1c(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <parse_ip_address@plt>
  cmp    $0x1,%eax
  jne    L42
  mov    -0x1c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x1,%eax
  jmp    L16
L42:
  mov    -0x38(%rbp),%rax
  movl   $0x0,(%rax)
  mov    $0xffffffff,%eax
L16:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L37
  call   <__stack_chk_fail@plt>
L37:
  leave
  ret
```

assistant: ```c
int parse_ip_netmask(char *c, char **ip, unsigned int *mask) {
  char *p, *q;
  unsigned int netmask;
  if (c == NULL) {
    return -10;
  }
  p = c;
  if ((q = strchr(p, '/')) == NULL) {
    *mask = 0xFFFFFFFF;
    return 0;
  } else {
    *ip = (char *)malloc(q - p + 1);
    if ((*ip) == NULL)
      return -2;
    memcpy(*ip, p, q - p);
    (*ip)[q - p] = 0;
    q++;
    if (is_positive_number(q) == 1) {
      if ((netmask = make_mask(atoi(q))) == 0) {
        *mask = 0;
        return -1;
      } else {
        *mask = netmask;
        return 1;
      }
    } else if (parse_ip_address(q, &netmask) == 1) {
      *mask = netmask;
      return 1;
    } else {
      *mask = 0;
      return -1;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<parse_ip_netmask>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L0
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L53
  mov    %rax,%r14
  sub    %rbp,%r14
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,(%r12)
  test   %rax,%rax
  je     L36
  mov    %r14d,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
  mov    (%r12),%rax
  movb   $0x0,(%rax,%r14,1)
  add    $0x1,%rbx
  mov    %rbx,%rdi
  call   <is_positive_number@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  je     L84
  lea    0x4(%rsp),%rsi
  mov    %rbx,%rdi
  call   <parse_ip_address@plt>
  mov    %eax,%ebp
  cmp    $0x1,%eax
  jne    L89
  mov    0x4(%rsp),%eax
  mov    %eax,0x0(%r13)
L98:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L112
  mov    %ebp,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L53:
  movl   $0xffffffff,0x0(%r13)
  mov    $0x0,%ebp
  jmp    L98
L84:
  mov    %rbx,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <make_mask@plt>
  test   %eax,%eax
  je     L5
  mov    %eax,0x0(%r13)
  jmp    L98
L5:
  movl   $0x0,0x0(%r13)
  mov    $0xffffffff,%ebp
  jmp    L98
L89:
  movl   $0x0,0x0(%r13)
  mov    $0xffffffff,%ebp
  jmp    L98
L0:
  mov    $0xfffffff6,%ebp
  jmp    L98
L36:
  mov    $0xfffffffe,%ebp
  jmp    L98
L112:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parse_ip_netmask(char *c, char **ip, unsigned int *mask) {
  char *p, *q;
  unsigned int netmask;
  if (c == NULL) {
    return -10;
  }
  p = c;
  if ((q = strchr(p, '/')) == NULL) {
    *mask = 0xFFFFFFFF;
    return 0;
  } else {
    *ip = (char *)malloc(q - p + 1);
    if ((*ip) == NULL)
      return -2;
    memcpy(*ip, p, q - p);
    (*ip)[q - p] = 0;
    q++;
    if (is_positive_number(q) == 1) {
      if ((netmask = make_mask(atoi(q))) == 0) {
        *mask = 0;
        return -1;
      } else {
        *mask = netmask;
        return 1;
      }
    } else if (parse_ip_address(q, &netmask) == 1) {
      *mask = netmask;
      return 1;
    } else {
      *mask = 0;
      return -1;
    }
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<parse_ip_netmask>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L63
  mov    %rsi,%r12
  mov    $0x2f,%esi
  mov    %rdi,%rbp
  mov    %rdx,%r13
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L29
  mov    %rax,%r14
  sub    %rbp,%r14
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L38
  mov    %rbp,%rsi
  mov    %r14d,%edx
  lea    0x1(%rbx),%rbp
  call   <memcpy@plt>
  mov    (%r12),%rax
  mov    %rbp,%rdi
  movb   $0x0,(%rax,%r14,1)
  call   <is_positive_number@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  je     L106
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <parse_ip_address@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  jne    L60
  mov    0x4(%rsp),%eax
L27:
  mov    %eax,0x0(%r13)
L21:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L106:
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <make_mask@plt>
  test   %eax,%eax
  jne    L27
L60:
  movl   $0x0,0x0(%r13)
  mov    $0xffffffff,%r12d
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L29:
  movl   $0xffffffff,0x0(%r13)
  xor    %r12d,%r12d
  jmp    L21
L63:
  mov    $0xfffffff6,%r12d
  jmp    L21
L38:
  mov    $0xfffffffe,%r12d
  jmp    L21
L46:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parse_ip_netmask(char *c, char **ip, unsigned int *mask) {
  char *p, *q;
  unsigned int netmask;
  if (c == NULL) {
    return -10;
  }
  p = c;
  if ((q = strchr(p, '/')) == NULL) {
    *mask = 0xFFFFFFFF;
    return 0;
  } else {
    *ip = (char *)malloc(q - p + 1);
    if ((*ip) == NULL)
      return -2;
    memcpy(*ip, p, q - p);
    (*ip)[q - p] = 0;
    q++;
    if (is_positive_number(q) == 1) {
      if ((netmask = make_mask(atoi(q))) == 0) {
        *mask = 0;
        return -1;
      } else {
        *mask = netmask;
        return 1;
      }
    } else if (parse_ip_address(q, &netmask) == 1) {
      *mask = netmask;
      return 1;
    } else {
      *mask = 0;
      return -1;
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_ip_netmask>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L54
  mov    %rsi,%r12
  mov    $0x2f,%esi
  mov    %rdi,%rbp
  mov    %rdx,%r13
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L9
  mov    %rax,%r14
  sub    %rbp,%r14
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L5
  mov    %rbp,%rsi
  mov    %r14d,%edx
  lea    0x1(%rbx),%rbp
  call   <memcpy@plt>
  mov    (%r12),%rax
  mov    %rbp,%rdi
  movb   $0x0,(%rax,%r14,1)
  call   <is_positive_number@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  je     L90
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <parse_ip_address@plt>
  mov    %eax,%r12d
  cmp    $0x1,%eax
  jne    L57
  mov    0x4(%rsp),%eax
L73:
  mov    %eax,0x0(%r13)
L62:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L90:
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%edi
  call   <make_mask@plt>
  test   %eax,%eax
  jne    L73
L57:
  movl   $0x0,0x0(%r13)
  mov    $0xffffffff,%r12d
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L9:
  movl   $0xffffffff,0x0(%r13)
  xor    %r12d,%r12d
  jmp    L62
L54:
  mov    $0xfffffff6,%r12d
  jmp    L62
L5:
  mov    $0xfffffffe,%r12d
  jmp    L62
L28:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parse_ip_netmask(char *c, char **ip, unsigned int *mask) {
  char *p, *q;
  unsigned int netmask;
  if (c == NULL) {
    return -10;
  }
  p = c;
  if ((q = strchr(p, '/')) == NULL) {
    *mask = 0xFFFFFFFF;
    return 0;
  } else {
    *ip = (char *)malloc(q - p + 1);
    if ((*ip) == NULL)
      return -2;
    memcpy(*ip, p, q - p);
    (*ip)[q - p] = 0;
    q++;
    if (is_positive_number(q) == 1) {
      if ((netmask = make_mask(atoi(q))) == 0) {
        *mask = 0;
        return -1;
      } else {
        *mask = netmask;
        return 1;
      }
    } else if (parse_ip_address(q, &netmask) == 1) {
      *mask = netmask;
      return 1;
    } else {
      *mask = 0;
      return -1;
    }
  }
}
```