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

```asm
<smileDsp_winBar>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  lea    0x0(,%rdi,8),%edi
  call   <malloc@plt>
  mov    %rax,%rsi
  mov    %rbx,%rcx
  shr    $0x3f,%rcx
  add    %rbx,%rcx
  sar    %rcx
  cmp    $0x1,%rbx
  jle    L15
  mov    %rax,%rdx
  mov    $0x0,%eax
  lea    -0x1(%rbx),%rdi
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdi,%xmm1
L42:
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rax
  jl     L42
  lea    0x0(,%rcx,8),%rdx
  cmp    $0x1,%rbx
  mov    $0x8,%eax
  cmovle %rax,%rdx
  add    %rsi,%rdx
L27:
  cmp    %rcx,%rbx
  jle    L22
  sub    $0x1,%rbx
  mov    %rbx,%rax
  sub    %rcx,%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rbx,%xmm1
L16:
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rdx
  sub    $0x1,%rax
  cmp    $0xffffffffffffffff,%rax
  jne    L16
L22:
  mov    %rsi,%rax
  pop    %rbx
  ret
L15:
  mov    %rax,%rdx
  jmp    L27
```

assistant: ```c
double *smileDsp_winBar(long _N) {
  long i;
  double *ret = (double *)malloc(sizeof(double) * _N);
  double *x = ret;
  for (i = 0; i < _N / 2; i++) {
    *x = 2.0 * (double)(i) / (double)(_N - 1);
    x++;
  }
  for (i = _N / 2; i < _N; i++) {
    *x = 2.0 * (double)(_N - 1 - i) / (double)(_N - 1);
    x++;
  }
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<smileDsp_winBar>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rbx,%rcx
  shr    $0x3f,%rcx
  mov    %rax,%r8
  add    %rbx,%rcx
  sar    %rcx
  cmp    $0x1,%rbx
  jle    L37
  lea    -0x1(%rbx),%rax
  pxor   %xmm1,%xmm1
  mov    %r8,%rdx
  cvtsi2sd %rax,%xmm1
  xor    %eax,%eax
  nopl   0x0(%rax)
L34:
  pxor   %xmm0,%xmm0
  add    $0x8,%rdx
  cvtsi2sd %rax,%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdx)
  cmp    %rcx,%rax
  jl     L34
  cmp    $0x1,%rbx
  lea    0x0(,%rcx,8),%rdx
  mov    $0x8,%eax
  cmovle %rax,%rdx
  add    %r8,%rdx
L35:
  cmp    %rcx,%rbx
  jle    L38
  lea    -0x1(%rbx),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  sub    %rcx,%rax
L45:
  pxor   %xmm0,%xmm0
  add    $0x8,%rdx
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdx)
  sub    $0x1,%rax
  jae    L45
L38:
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   (%rax)
L37:
  mov    %rax,%rdx
  jmp    L35
```

assistant: ```c
double *smileDsp_winBar(long _N) {
  long i;
  double *ret = (double *)malloc(sizeof(double) * _N);
  double *x = ret;
  for (i = 0; i < _N / 2; i++) {
    *x = 2.0 * (double)(i) / (double)(_N - 1);
    x++;
  }
  for (i = _N / 2; i < _N; i++) {
    *x = 2.0 * (double)(_N - 1 - i) / (double)(_N - 1);
    x++;
  }
  return ret;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<smileDsp_winBar>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rbx,%rcx
  shr    $0x3f,%rcx
  mov    %rax,%r8
  add    %rbx,%rcx
  sar    %rcx
  cmp    $0x1,%rbx
  jle    L6
  lea    -0x1(%rbx),%rax
  pxor   %xmm1,%xmm1
  mov    %r8,%rdx
  cvtsi2sd %rax,%xmm1
  xor    %eax,%eax
  nopl   0x0(%rax)
L44:
  pxor   %xmm0,%xmm0
  add    $0x8,%rdx
  cvtsi2sd %rax,%xmm0
  add    $0x1,%rax
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdx)
  cmp    %rcx,%rax
  jl     L44
  cmp    $0x1,%rbx
  lea    0x0(,%rcx,8),%rdx
  mov    $0x8,%eax
  cmovle %rax,%rdx
  add    %r8,%rdx
L47:
  cmp    %rcx,%rbx
  jle    L3
  lea    -0x1(%rbx),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  sub    %rcx,%rax
L24:
  pxor   %xmm0,%xmm0
  add    $0x8,%rdx
  cvtsi2sd %rax,%xmm0
  addsd  %xmm0,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rdx)
  sub    $0x1,%rax
  jae    L24
L3:
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   (%rax)
L6:
  mov    %rax,%rdx
  jmp    L47
```

assistant: ```c
double *smileDsp_winBar(long _N) {
  long i;
  double *ret = (double *)malloc(sizeof(double) * _N);
  double *x = ret;
  for (i = 0; i < _N / 2; i++) {
    *x = 2.0 * (double)(i) / (double)(_N - 1);
    x++;
  }
  for (i = _N / 2; i < _N; i++) {
    *x = 2.0 * (double)(_N - 1 - i) / (double)(_N - 1);
    x++;
  }
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<createhash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L14
L4:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    $0x85,%eax
  add    %eax,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L14:
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L4
  mov    -0x8(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x4ec4ec4f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  leave
  ret
```

assistant: ```c
int createhash(char *a) {
  int i;
  int len = strlen(a);
  int sum = 0;
  for (i = 0; i < len; i++) {
    sum += (int)a[i] + 133;
  }
  return sum % 13;
}
```
user: What is the c source code of the assembly code below:

```asm
<createhash>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L14
  mov    %rbx,%rdx
  lea    -0x1(%rax),%eax
  lea    0x1(%rbx,%rax,1),%rsi
  mov    $0x0,%ecx
L2:
  movsbl (%rdx),%eax
  lea    0x85(%rcx,%rax,1),%ecx
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L2
L6:
  movslq %ecx,%rax
  imul   $0x4ec4ec4f,%rax,%rax
  sar    $0x22,%rax
  mov    %ecx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,2),%edx
  lea    (%rax,%rdx,4),%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  pop    %rbx
  ret
L14:
  mov    $0x0,%ecx
  jmp    L6
```

assistant: ```c
int createhash(char *a) {
  int i;
  int len = strlen(a);
  int sum = 0;
  for (i = 0; i < len; i++) {
    sum += (int)a[i] + 133;
  }
  return sum % 13;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<createhash>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L10
  sub    $0x1,%eax
  mov    %rbx,%rdi
  xor    %edx,%edx
  lea    0x1(%rbx,%rax,1),%rcx
  xchg   %ax,%ax
L6:
  movsbl (%rdi),%eax
  add    $0x1,%rdi
  lea    0x85(%rdx,%rax,1),%edx
  cmp    %rdi,%rcx
  jne    L6
  mov    %edx,%eax
  pop    %rbx
  imul   $0x4ec4ec4f,%rax,%rax
  shr    $0x22,%rax
  lea    (%rax,%rax,2),%ecx
  lea    (%rax,%rcx,4),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  ret
  nopl   0x0(%rax)
L10:
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int createhash(char *a) {
  int i;
  int len = strlen(a);
  int sum = 0;
  for (i = 0; i < len; i++) {
    sum += (int)a[i] + 133;
  }
  return sum % 13;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<test_case_reals>:
  endbr64
  ret
```

assistant: ```c
void test_case_reals(struct test_suite *test_suite, struct test_context *test_context) {
  do {
    float value__ = 1.42f;
    float expected__ = 1.42f;
    const char *value_str_ = "1.42f";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 42,
                 "%s is equal to %.9g "
                 "but should be equal to %.9g",
                 value_str_, value__, expected__);
    }
  } while (0);
  do {
    double value__ = -1.42e5;
    double expected__ = -1.42e5;
    const char *value_str_ = "-1.42e5";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 43,
                 "%s is equal to %.17g "
                 "but should be equal to %.17g",
                 value_str_, value__, expected__);
    }
  } while (0);
}
```
user: Translate the below assembly code into C programming language:

```asm
<test_case_reals>:
  endbr64
  ret
```

assistant: ```c
void test_case_reals(struct test_suite *test_suite, struct test_context *test_context) {
  do {
    float value__ = 1.42f;
    float expected__ = 1.42f;
    const char *value_str_ = "1.42f";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 42,
                 "%s is equal to %.9g "
                 "but should be equal to %.9g",
                 value_str_, value__, expected__);
    }
  } while (0);
  do {
    double value__ = -1.42e5;
    double expected__ = -1.42e5;
    const char *value_str_ = "-1.42e5";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 43,
                 "%s is equal to %.17g "
                 "but should be equal to %.17g",
                 value_str_, value__, expected__);
    }
  } while (0);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<test_case_reals>:
  endbr64
  ret
```

assistant: ```c
void test_case_reals(struct test_suite *test_suite, struct test_context *test_context) {
  do {
    float value__ = 1.42f;
    float expected__ = 1.42f;
    const char *value_str_ = "1.42f";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 42,
                 "%s is equal to %.9g "
                 "but should be equal to %.9g",
                 value_str_, value__, expected__);
    }
  } while (0);
  do {
    double value__ = -1.42e5;
    double expected__ = -1.42e5;
    const char *value_str_ = "-1.42e5";
    if (value__ != expected__) {
      test_abort(test_context, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/galdor/libutest/refs/heads/master/tests/main.c", 43,
                 "%s is equal to %.17g "
                 "but should be equal to %.17g",
                 value_str_, value__, expected__);
    }
  } while (0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  cmpl   $0x0,-0x8(%rbp)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void foo() {
  unsigned int frame, focus;
  (struct bar *)focus == (focus ? ((struct bar *)frame) : 0);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<foo>:
  endbr64
  ret
```

assistant: ```c
void foo() {
  unsigned int frame, focus;
  (struct bar *)focus == (focus ? ((struct bar *)frame) : 0);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<foo>:
  endbr64
  ret
```

assistant: ```c
void foo() {
  unsigned int frame, focus;
  (struct bar *)focus == (focus ? ((struct bar *)frame) : 0);
}
```
user: What is the c source code of the assembly code below:

```asm
<foo>:
  endbr64
  ret
```

assistant: ```c
void foo() {
  unsigned int frame, focus;
  (struct bar *)focus == (focus ? ((struct bar *)frame) : 0);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<itoa2>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rax
  mov    %rsi,%rdi
  mov    %rcx,%rbp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x18(%rsp)
  xor    %ecx,%ecx
  mov    %rsp,%rcx
  lea    0xf(%rsp),%rsi
L20:
  movb   $0x20,(%rcx)
  add    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L20
  movb   $0x0,0xf(%rsp)
  test   %rax,%rax
  jns    L138
  mov    $0xffffffffffffffff,%r10
  cmp    $0xa,%edx
  jne    L138
L129:
  imul   %r10,%rax
  mov    $0xe,%ebx
  movslq %edx,%rsi
  mov    $0xf,%r11d
  jmp    L93
L138:
  mov    $0x1,%r10d
  jmp    L129
L47:
  sub    $0x1,%rbx
  cmp    $0xffffffffffffffff,%rbx
  je     L117
L93:
  mov    %rax,%r8
  mov    $0x0,%edx
  div    %rsi
  lea    0x30(%rdx),%r9d
  lea    0x57(%rdx),%ecx
  cmp    $0x9,%rdx
  cmovle %r9d,%ecx
  mov    %cl,(%rsp,%rbx,1)
  cmp    %r8,%rsi
  jbe    L47
  mov    %r11,%rdx
  sub    %rbx,%rdx
  cmp    %rdx,0x0(%rbp)
  jg     L47
L117:
  cmp    $0xffffffffffffffff,%r10
  je     L101
L125:
  mov    0x0(%rbp),%rax
  test   %rax,%rax
  je     L64
  mov    $0xf,%edx
  sub    %rbx,%rdx
  cmp    %rdx,%rax
  jge    L40
L64:
  lea    (%rsp,%rbx,1),%rsi
  call   <strcpy2@plt>
  mov    $0xf,%eax
  sub    %rbx,%rax
  mov    %rax,0x0(%rbp)
L94:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L101:
  sub    $0x1,%rbx
  movb   $0x2d,(%rsp,%rbx,1)
  jmp    L125
L40:
  mov    $0xf,%edx
  sub    %rax,%rdx
  lea    (%rsp,%rdx,1),%rsi
  call   <strcpy2@plt>
  jmp    L94
L121:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void itoa2(long n, char *s, int base, long *digits) {
  long i, j, sign;
  unsigned long n2;
  char number[20];
  for (i = 0; i < 15; ++i) {
    number[i] = ' ';
  }
  number[15] = 0;
  if (n >= 0 || base != 10) {
    sign = 1;
  } else {
    sign = -1;
  }
  n2 = n * sign;
  for (j = 14; j >= 0; --j) {
    i = n2 % base;
    n2 /= base;
    number[j] = i < 10 ? '0' + i : 'a' + i - 10;
    if (n2 == 0 && 15 - j >= *digits) {
      break;
    }
  }
  if (sign == -1) {
    number[--j] = '-';
  }
  if (*digits == 0 || *digits < 15 - j) {
    strcpy2(s, &number[j]);
    *digits = 15 - j;
  } else {
    strcpy2(s, &number[15 - *digits]);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<itoa2>:
  endbr64
  push   %r13
  mov    %rdi,%rax
  mov    %rsi,%r10
  movabs $0x2020202020202020,%rdi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x18(%rsp)
  xor    %ecx,%ecx
  mov    $0x2020,%ecx
  mov    %rdi,(%rsp)
  movl   $0x20202020,0x8(%rsp)
  mov    %cx,0xc(%rsp)
  movb   $0x20,0xe(%rsp)
  movb   $0x0,0xf(%rsp)
  test   %rax,%rax
  jns    L10
  cmp    $0xa,%edx
  jne    L10
  neg    %rax
  mov    $0xffffffffffffffff,%r12
L15:
  mov    (%rbx),%r11
  movslq %edx,%rdi
  mov    $0xe,%esi
  mov    %rsp,%r9
  mov    $0xf,%ebp
L94:
  xor    %edx,%edx
  mov    %rax,%r8
  div    %rdi
  lea    0x30(%rdx),%r13d
  lea    0x57(%rdx),%ecx
  cmp    $0x9,%rdx
  cmovle %r13d,%ecx
  mov    %cl,(%r9,%rsi,1)
  cmp    %r8,%rdi
  jbe    L25
  mov    %rbp,%rdx
  sub    %rsi,%rdx
  cmp    %rdx,%r11
  jle    L29
L25:
  sub    $0x1,%rsi
  jae    L94
L29:
  cmp    $0xffffffffffffffff,%r12
  jne    L31
  sub    $0x1,%rsi
  movb   $0x2d,(%rsp,%rsi,1)
L31:
  mov    $0xf,%eax
  mov    %rax,%rbp
  sub    %rsi,%rbp
  test   %r11,%r11
  je     L65
  cmp    %rbp,%r11
  jge    L80
L65:
  add    %r9,%rsi
  mov    %r10,%rdi
  call   <strcpy2@plt>
  mov    %rbp,(%rbx)
L14:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L10:
  mov    $0x1,%r12d
  jmp    L15
  nopl   0x0(%rax,%rax,1)
L80:
  sub    %r11,%rax
  mov    %r10,%rdi
  lea    (%r9,%rax,1),%rsi
  call   <strcpy2@plt>
  jmp    L14
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void itoa2(long n, char *s, int base, long *digits) {
  long i, j, sign;
  unsigned long n2;
  char number[20];
  for (i = 0; i < 15; ++i) {
    number[i] = ' ';
  }
  number[15] = 0;
  if (n >= 0 || base != 10) {
    sign = 1;
  } else {
    sign = -1;
  }
  n2 = n * sign;
  for (j = 14; j >= 0; --j) {
    i = n2 % base;
    n2 /= base;
    number[j] = i < 10 ? '0' + i : 'a' + i - 10;
    if (n2 == 0 && 15 - j >= *digits) {
      break;
    }
  }
  if (sign == -1) {
    number[--j] = '-';
  }
  if (*digits == 0 || *digits < 15 - j) {
    strcpy2(s, &number[j]);
    *digits = 15 - j;
  } else {
    strcpy2(s, &number[15 - *digits]);
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<itoa2>:
  endbr64
  push   %r13
  mov    %rdi,%rax
  mov    %rsi,%r10
  movabs $0x2020202020202020,%rdi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x18(%rsp)
  xor    %ecx,%ecx
  mov    $0x2020,%ecx
  mov    %rdi,(%rsp)
  movl   $0x20202020,0x8(%rsp)
  mov    %cx,0xc(%rsp)
  movb   $0x20,0xe(%rsp)
  movb   $0x0,0xf(%rsp)
  test   %rax,%rax
  jns    L105
  cmp    $0xa,%edx
  jne    L105
  neg    %rax
  mov    $0xffffffffffffffff,%r12
L103:
  mov    (%rbx),%rbp
  movslq %edx,%rdi
  mov    $0x1,%r8d
  mov    %rsp,%r11
  mov    $0xe,%esi
  nopl   0x0(%rax)
L48:
  xor    %edx,%edx
  mov    %rax,%r9
  div    %rdi
  lea    0x30(%rdx),%r13d
  lea    0x57(%rdx),%ecx
  cmp    $0x9,%rdx
  cmovle %r13d,%ecx
  mov    %cl,(%r11,%rsi,1)
  cmp    %r9,%rdi
  jbe    L98
  mov    %r8,%r13
  cmp    %rbp,%r8
  jge    L39
L98:
  sub    $0x1,%rsi
  add    $0x1,%r8
  cmp    $0xffffffffffffffff,%rsi
  jne    L48
  mov    $0x10,%r13d
L39:
  cmp    $0xffffffffffffffff,%r12
  jne    L26
  sub    $0x1,%rsi
  mov    $0xf,%r13d
  movb   $0x2d,(%rsp,%rsi,1)
  sub    %rsi,%r13
L26:
  test   %rbp,%rbp
  je     L99
  cmp    %rbp,%r13
  jle    L11
L99:
  add    %r11,%rsi
  mov    %r10,%rdi
  call   <strcpy2@plt>
  mov    %r13,(%rbx)
L19:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L21
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L105:
  mov    $0x1,%r12d
  jmp    L103
  nopl   0x0(%rax,%rax,1)
L11:
  sub    %rbp,%r11
  mov    %r10,%rdi
  lea    0xf(%r11),%rsi
  call   <strcpy2@plt>
  jmp    L19
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void itoa2(long n, char *s, int base, long *digits) {
  long i, j, sign;
  unsigned long n2;
  char number[20];
  for (i = 0; i < 15; ++i) {
    number[i] = ' ';
  }
  number[15] = 0;
  if (n >= 0 || base != 10) {
    sign = 1;
  } else {
    sign = -1;
  }
  n2 = n * sign;
  for (j = 14; j >= 0; --j) {
    i = n2 % base;
    n2 /= base;
    number[j] = i < 10 ? '0' + i : 'a' + i - 10;
    if (n2 == 0 && 15 - j >= *digits) {
      break;
    }
  }
  if (sign == -1) {
    number[--j] = '-';
  }
  if (*digits == 0 || *digits < 15 - j) {
    strcpy2(s, &number[j]);
    *digits = 15 - j;
  } else {
    strcpy2(s, &number[15 - *digits]);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<aton>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0xffffffff,%eax
  test   %rdi,%rdi
  je     L31
  mov    %rsp,%rsi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %rax,%rdx
  mov    $0xffffffff,%eax
  cmp    $0xff,%rdx
  ja     L31
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  je     L40
L31:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  add    $0x10,%rsp
  pop    %rbx
  ret
L40:
  mov    $0x0,%ebx
  mov    %dl,%bl
  mov    %rsp,%rsi
  add    $0x1,%rdi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %rax,%rdx
  mov    $0xffffffff,%eax
  cmp    $0xff,%rdx
  ja     L31
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  jne    L31
  mov    %dl,%bh
  mov    %rsp,%rsi
  add    $0x1,%rdi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %rax,%rdx
  mov    $0xffffffff,%eax
  cmp    $0xff,%rdx
  ja     L31
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  jne    L31
  movzbl %dl,%edx
  shl    $0x10,%rdx
  and    $0xffffffffff00ffff,%rbx
  or     %rdx,%rbx
  mov    %rsp,%rsi
  add    $0x1,%rdi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %rax,%rdx
  mov    $0xffffffff,%eax
  cmp    $0xff,%rdx
  ja     L31
  mov    (%rsp),%rcx
  cmpb   $0x0,(%rcx)
  jne    L31
  movzbl %dl,%eax
  shl    $0x18,%rax
  movabs $0xffffffff00ffffff,%rdx
  and    %rdx,%rbx
  or     %rbx,%rax
  jmp    L31
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long int aton(const char *host) {
  unsigned long int res;
  unsigned char *bytes = (unsigned char *)&res;
  long int quad;
  char *endptr;
  if (!host)
    return ((unsigned long)0xFFFFFFFF);
  quad = strtol(host, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[0] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[1] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[2] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr != '\0'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[3] = (unsigned char)quad;
  return res;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<aton>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L51
  mov    %rsp,%rbp
  mov    $0xa,%edx
  mov    %rbp,%rsi
  call   <strtol@plt>
  cmp    $0xff,%rax
  ja     L51
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  je     L49
L51:
  mov    $0xffffffff,%eax
L4:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L91
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L49:
  xor    %ebx,%ebx
  add    $0x1,%rdi
  mov    $0xa,%edx
  mov    %rbp,%rsi
  mov    %al,%bl
  call   <strtol@plt>
  cmp    $0xff,%rax
  ja     L51
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  jne    L51
  add    $0x1,%rdi
  mov    $0xa,%edx
  mov    %rbp,%rsi
  mov    %al,%bh
  call   <strtol@plt>
  cmp    $0xff,%rax
  ja     L51
  mov    (%rsp),%rdi
  cmpb   $0x2e,(%rdi)
  jne    L51
  movzbl %al,%eax
  add    $0x1,%rdi
  mov    $0xa,%edx
  mov    %rbp,%rsi
  shl    $0x10,%rax
  and    $0xffffffffff00ffff,%rbx
  or     %rax,%rbx
  call   <strtol@plt>
  cmp    $0xff,%rax
  ja     L51
  mov    (%rsp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L51
  movzbl %al,%edx
  movabs $0xffffffff00ffffff,%rax
  shl    $0x18,%rdx
  and    %rbx,%rax
  or     %rdx,%rax
  jmp    L4
L91:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned long int aton(const char *host) {
  unsigned long int res;
  unsigned char *bytes = (unsigned char *)&res;
  long int quad;
  char *endptr;
  if (!host)
    return ((unsigned long)0xFFFFFFFF);
  quad = strtol(host, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[0] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[1] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr == '\0') || (*endptr != '.'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[2] = (unsigned char)quad;
  quad = strtol(endptr + 1, &endptr, 10);
  if ((quad < 0) || (quad > 255) || (*endptr != '\0'))
    return ((unsigned long)0xFFFFFFFF);
  bytes[3] = (unsigned char)quad;
  return res;
}
```