ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<squeeze_spaces>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x0,-0x8(%rbp)
  jmp    L23
L18:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L53
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  movl   $0x0,-0x8(%rbp)
  jmp    L23
L53:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L23
  cmpl   $0x0,-0x8(%rbp)
  jne    L23
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
  movl   $0x1,-0x8(%rbp)
L23:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x4(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L18
  nop
  nop
  leave
  ret
```

assistant: ```c
void squeeze_spaces(void) {
  int character;
  int space = 0;
  while ((character = getchar()) != EOF) {
    if (!isspace(character)) {
      putchar(character);
      space = 0;
    } else if (isspace(character) && space == 0) {
      putchar(character);
      space = 1;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<squeeze_spaces>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x0,%ebp
  mov    $0x1,%r12d
  jmp    L62
L64:
  mov    %ebx,%edi
  call   <isspace@plt>
  test   %ebp,%ebp
  jne    L62
  test   %rax,%rax
  jne    L49
L62:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  mov    D5(%rip),%rax
  cmp    %ebx,(%rax)
  je     L40
  mov    %ebx,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L64
  mov    %ebx,%edi
  call   <putchar@plt>
  mov    $0x0,%ebp
  jmp    L62
L49:
  mov    %ebx,%edi
  call   <putchar@plt>
  mov    %r12d,%ebp
  jmp    L62
L40:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void squeeze_spaces(void) {
  int character;
  int space = 0;
  while ((character = getchar()) != EOF) {
    if (!isspace(character)) {
      putchar(character);
      space = 0;
    } else if (isspace(character) && space == 0) {
      putchar(character);
      space = 1;
    }
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<squeeze_spaces>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    D4(%rip),%rbx
  nopw   0x0(%rax,%rax,1)
L6:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,(%rbx)
  je     L38
L45:
  mov    %ebp,%edi
  call   <isspace@plt>
  mov    %ebp,%edi
  test   %rax,%rax
  jne    L31
  call   <putchar@plt>
  xor    %eax,%eax
  xor    %r12d,%r12d
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,(%rbx)
  jne    L45
L38:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L31:
  call   <isspace@plt>
  test   %rax,%rax
  je     L6
  test   %r12d,%r12d
  jne    L6
  mov    %ebp,%edi
  mov    $0x1,%r12d
  call   <putchar@plt>
  jmp    L6
```

assistant: ```c
void squeeze_spaces(void) {
  int character;
  int space = 0;
  while ((character = getchar()) != EOF) {
    if (!isspace(character)) {
      putchar(character);
      space = 0;
    } else if (isspace(character) && space == 0) {
      putchar(character);
      space = 1;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<squeeze_spaces>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    D7(%rip),%rbx
  nopw   0x0(%rax,%rax,1)
L54:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,(%rbx)
  je     L29
L8:
  mov    %ebp,%edi
  call   <isspace@plt>
  mov    %ebp,%edi
  test   %rax,%rax
  jne    L24
  call   <putchar@plt>
  xor    %eax,%eax
  xor    %r12d,%r12d
  call   <getchar@plt>
  mov    %eax,%ebp
  cmp    %eax,(%rbx)
  jne    L8
L29:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L24:
  call   <isspace@plt>
  test   %rax,%rax
  je     L54
  test   %r12d,%r12d
  jne    L54
  mov    %ebp,%edi
  mov    $0x1,%r12d
  call   <putchar@plt>
  jmp    L54
```

assistant: ```c
void squeeze_spaces(void) {
  int character;
  int space = 0;
  while ((character = getchar()) != EOF) {
    if (!isspace(character)) {
      putchar(character);
      space = 0;
    } else if (isspace(character) && space == 0) {
      putchar(character);
      space = 1;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<my_dscal>:
  endbr64
  mov    %edi,%ecx
  mov    %rsi,%rax
  test   %edi,%edi
  jle    L27
  test   %edx,%edx
  jle    L27
  cmp    $0x1,%edx
  je     L34
  imul   %edx,%ecx
  movslq %edx,%rdi
  shl    $0x3,%rdi
  mov    $0x0,%esi
L50:
  movapd %xmm0,%xmm1
  mulsd  (%rax),%xmm1
  movsd  %xmm1,(%rax)
  add    %edx,%esi
  add    %rdi,%rax
  cmp    %esi,%ecx
  jg     L50
  ret
L34:
  movslq %edi,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x21,%rdx
  mov    %edi,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%esi
  mov    %edi,%edx
  sub    %esi,%edx
  je     L55
  mov    %rax,%rsi
  lea    -0x1(%rdx),%edi
  lea    0x8(%rax,%rdi,8),%rdi
L76:
  movapd %xmm0,%xmm1
  mulsd  (%rsi),%xmm1
  movsd  %xmm1,(%rsi)
  add    $0x8,%rsi
  cmp    %rdi,%rsi
  jne    L76
  cmp    $0x4,%ecx
  jle    L27
L55:
  movslq %edx,%rsi
  lea    (%rax,%rsi,8),%rax
L66:
  movapd %xmm0,%xmm1
  mulsd  (%rax),%xmm1
  movsd  %xmm1,(%rax)
  movapd %xmm0,%xmm1
  mulsd  0x8(%rax),%xmm1
  movsd  %xmm1,0x8(%rax)
  movapd %xmm0,%xmm1
  mulsd  0x10(%rax),%xmm1
  movsd  %xmm1,0x10(%rax)
  movapd %xmm0,%xmm1
  mulsd  0x18(%rax),%xmm1
  movsd  %xmm1,0x18(%rax)
  movapd %xmm0,%xmm1
  mulsd  0x20(%rax),%xmm1
  movsd  %xmm1,0x20(%rax)
  add    $0x5,%edx
  add    $0x28,%rax
  cmp    %edx,%ecx
  jg     L66
L27:
  ret
```

assistant: ```c
void my_dscal(int n, double da, double *dx, int incx) {
  int i, m, nincx;
  if (n <= 0 || incx <= 0)
    return;
  if (incx != 1) {
    nincx = n * incx;
    for (i = 0; i < nincx; i += incx)
      dx[i] *= da;
    return;
  } else {
    m = n % 5;
    if (m != 0) {
      for (i = 0; i < m; i++)
        dx[i] *= da;
      if (n < 5)
        return;
    }
    for (i = m; i < n; i += 5) {
      dx[i] *= da;
      dx[i + 1] *= da;
      dx[i + 2] *= da;
      dx[i + 3] *= da;
      dx[i + 4] *= da;
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<my_dscal>:
  endbr64
  mov    %edi,%ecx
  mov    %rsi,%rax
  test   %edi,%edi
  jle    L17
  test   %edx,%edx
  jle    L17
  cmp    $0x1,%edx
  je     L64
  imul   %edx,%ecx
  movslq %edx,%rdi
  xor    %esi,%esi
  shl    $0x3,%rdi
  nopw   0x0(%rax,%rax,1)
L42:
  movsd  (%rax),%xmm1
  add    %edx,%esi
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  add    %rdi,%rax
  cmp    %esi,%ecx
  jg     L42
  ret
  cs nopw 0x0(%rax,%rax,1)
L64:
  movslq %edi,%rdx
  mov    %edi,%esi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x21,%rdx
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%esi
  mov    %edi,%edx
  sub    %esi,%edx
  jne    L33
L49:
  movslq %edx,%rsi
  lea    (%rax,%rsi,8),%rax
  nopl   (%rax)
L21:
  movsd  (%rax),%xmm1
  add    $0x5,%edx
  add    $0x28,%rax
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x28(%rax)
  movsd  -0x20(%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rax)
  movsd  -0x18(%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x18(%rax)
  movsd  -0x10(%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x10(%rax)
  movsd  -0x8(%rax),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %edx,%ecx
  jg     L21
L17:
  ret
  nopl   0x0(%rax)
L33:
  lea    -0x1(%rdx),%edi
  mov    %rax,%rsi
  lea    0x8(%rax,%rdi,8),%rdi
L0:
  movsd  (%rsi),%xmm1
  add    $0x8,%rsi
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rsi)
  cmp    %rsi,%rdi
  jne    L0
  cmp    $0x4,%ecx
  jg     L49
  ret
```

assistant: ```c
void my_dscal(int n, double da, double *dx, int incx) {
  int i, m, nincx;
  if (n <= 0 || incx <= 0)
    return;
  if (incx != 1) {
    nincx = n * incx;
    for (i = 0; i < nincx; i += incx)
      dx[i] *= da;
    return;
  } else {
    m = n % 5;
    if (m != 0) {
      for (i = 0; i < m; i++)
        dx[i] *= da;
      if (n < 5)
        return;
    }
    for (i = m; i < n; i += 5) {
      dx[i] *= da;
      dx[i + 1] *= da;
      dx[i + 2] *= da;
      dx[i + 3] *= da;
      dx[i + 4] *= da;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x14(%rbp),%rdx
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x1,-0x10(%rbp)
  jmp    L28
L42:
  movl   $0x1,-0xc(%rbp)
  jmp    L75
L59:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,-0x19(%rbp)
  cmpb   $0x2e,-0x19(%rbp)
  jne    L71
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L40
  mov    $0x57,%eax
  jmp    L61
L40:
  mov    $0x42,%eax
  jmp    L61
L71:
  movsbl -0x19(%rbp),%eax
L61:
  mov    %eax,%edi
  call   <putchar@plt>
  addl   $0x1,-0xc(%rbp)
L75:
  mov    -0x14(%rbp),%eax
  cmp    %eax,-0xc(%rbp)
  jle    L59
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x10(%rbp)
L28:
  mov    -0x18(%rbp),%eax
  cmp    %eax,-0x10(%rbp)
  jle    L42
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L79
  call   <__stack_chk_fail@plt>
L79:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D2
datatype: string

tool: D2: %d %d


assistant: ```c
int main() {
  int n, m, i, j;
  char c;
  scanf("%d %d\n", &n, &m);
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      c = getchar();
      printf("%c", c == '.' ? ((i + j) % 2 ? 'W' : 'B') : c);
    }
    getchar();
    printf("\n");
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  mov    $0x1,%ebp
  cmpl   $0x0,(%rsp)
  jg     L61
L55:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L45:
  call   <putchar@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x4(%rsp)
  jl     L38
L23:
  mov    $0x0,%eax
  call   <getchar@plt>
  movsbl %al,%edi
  cmp    $0x2e,%al
  jne    L45
  lea    0x0(%rbp,%rbx,1),%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %edi,%edi
  and    $0xffffffeb,%edi
  add    $0x57,%edi
  jmp    L45
L38:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%ebp
  cmp    %ebp,(%rsp)
  jl     L55
L61:
  mov    $0x1,%ebx
  cmpl   $0x0,0x4(%rsp)
  jg     L23
  jmp    L38
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D1
type: string

tool: D1: %d %d


assistant: ```c
int main() {
  int n, m, i, j;
  char c;
  scanf("%d %d\n", &n, &m);
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      c = getchar();
      printf("%c", c == '.' ? ((i + j) % 2 ? 'W' : 'B') : c);
    }
    getchar();
    printf("\n");
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D9(%rip),%rdi
  mov    $0x1,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  call   <scanf@plt>
  mov    (%rsp),%edx
  test   %edx,%edx
  jle    L25
  nopw   0x0(%rax,%rax,1)
L11:
  mov    0x4(%rsp),%eax
  mov    $0x1,%ebx
  test   %eax,%eax
  jle    L15
  nopl   (%rax)
L12:
  xor    %eax,%eax
  call   <getchar@plt>
  movsbl %al,%edi
  cmp    $0x2e,%al
  jne    L54
  lea    0x0(%rbp,%rbx,1),%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %edi,%edi
  and    $0xffffffeb,%edi
  add    $0x57,%edi
L54:
  call   <putchar@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x4(%rsp)
  jge    L12
L15:
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <getchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    %ebp,(%rsp)
  jge    L11
L25:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D9
data_type: string

tool: D9: %d %d


assistant: ```c
int main() {
  int n, m, i, j;
  char c;
  scanf("%d %d\n", &n, &m);
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      c = getchar();
      printf("%c", c == '.' ? ((i + j) % 2 ? 'W' : 'B') : c);
    }
    getchar();
    printf("\n");
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D3(%rip),%rdi
  mov    $0x1,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  call   <scanf@plt>
  mov    (%rsp),%edx
  test   %edx,%edx
  jle    L43
  nopw   0x0(%rax,%rax,1)
L7:
  mov    0x4(%rsp),%eax
  mov    $0x1,%ebx
  test   %eax,%eax
  jle    L58
  nopl   (%rax)
L4:
  xor    %eax,%eax
  call   <getchar@plt>
  movsbl %al,%edi
  cmp    $0x2e,%al
  jne    L5
  lea    0x0(%rbp,%rbx,1),%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %edi,%edi
  and    $0xffffffeb,%edi
  add    $0x57,%edi
L5:
  call   <putchar@plt>
  add    $0x1,%ebx
  cmp    %ebx,0x4(%rsp)
  jge    L4
L58:
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <getchar@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    %ebp,(%rsp)
  jge    L7
L43:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D3
type_guessed: string

tool: D3: %d %d


assistant: ```c
int main() {
  int n, m, i, j;
  char c;
  scanf("%d %d\n", &n, &m);
  for (i = 1; i <= n; ++i) {
    for (j = 1; j <= m; ++j) {
      c = getchar();
      printf("%c", c == '.' ? ((i + j) % 2 ? 'W' : 'B') : c);
    }
    getchar();
    printf("\n");
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<itoa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %edx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x30(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  cmpl   $0x24,-0x58(%rbp)
  jg     L110
  cmpl   $0x1,-0x58(%rbp)
  jg     L104
L110:
  mov    D2(%rip),%rax
  mov    (%rax),%edx
  mov    D17(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  jmp    L8
L104:
  cmpl   $0xa,-0x58(%rbp)
  jne    L174
  cmpl   $0x0,-0x54(%rbp)
  jns    L174
  mov    $0x1,%eax
  jmp    L141
L174:
  mov    $0x0,%eax
L141:
  mov    %eax,-0x48(%rbp)
  cmpl   $0x0,-0x48(%rbp)
  je     L97
  mov    -0x54(%rbp),%eax
  neg    %eax
  mov    %eax,-0x4c(%rbp)
  jmp    L0
L97:
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  jmp    L0
L78:
  mov    -0x58(%rbp),%ecx
  mov    -0x4c(%rbp),%eax
  mov    $0x0,%edx
  div    %ecx
  mov    %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x58(%rbp),%esi
  mov    -0x4c(%rbp),%eax
  mov    $0x0,%edx
  div    %esi
  mov    %eax,-0x4c(%rbp)
  cmpl   $0x9,-0x44(%rbp)
  jg     L50
  mov    -0x44(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L0
L50:
  mov    -0x44(%rbp),%eax
  lea    0x57(%rax),%ecx
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L0:
  cmpl   $0x0,-0x4c(%rbp)
  jne    L78
  lea    -0x30(%rbp),%rax
  cmp    %rax,-0x40(%rbp)
  je     L78
  cmpq   $0x0,-0x60(%rbp)
  jne    L22
  lea    -0x30(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  sub    %rdx,%rax
  mov    %eax,%edx
  mov    -0x48(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x60(%rbp)
L22:
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  cmpl   $0x0,-0x48(%rbp)
  je     L117
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  movb   $0x2d,(%rax)
  jmp    L117
L122:
  subq   $0x1,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    -0x40(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L117:
  lea    -0x30(%rbp),%rax
  cmp    %rax,-0x40(%rbp)
  ja     L122
  mov    -0x38(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x60(%rbp),%rax
L8:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L15
  call   <__stack_chk_fail@plt>
L15:
  leave
  ret
```

assistant: ```c
char *itoa(int value, char *string, int radix) {
  char tmp[33];
  char *tp = tmp;
  int i;
  unsigned v;
  int sign;
  char *sp;
  if (radix > 36 || radix <= 1) {
    errno = EDOM;
    return 0;
  }
  sign = (radix == 10 && value < 0);
  if (sign)
    v = -value;
  else
    v = (unsigned)value;
  while (v || tp == tmp) {
    i = v % radix;
    v = v / radix;
    if (i < 10)
      *tp++ = i + '0';
    else
      *tp++ = i + 'a' - 10;
  }
  if (string == 0)
    string = (char *)malloc((tp - tmp) + sign + 1);
  sp = string;
  if (sign)
    *sp++ = '-';
  while (tp > tmp)
    *sp++ = *--tp;
  *sp = 0;
  return string;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<itoa>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    -0x2(%rdx),%eax
  cmp    $0x22,%eax
  ja     L116
  mov    %rsi,%r9
  mov    %edx,%r8d
  mov    %edx,%esi
  cmp    $0xa,%edx
  sete   %bl
  mov    %edi,%edx
  shr    $0x1f,%edx
  mov    %edi,%eax
  neg    %eax
  and    %dl,%bl
  cmove  %edi,%eax
  lea    0x1(%rsp),%rcx
  mov    %rsp,%r10
L90:
  mov    %eax,%edi
  mov    $0x0,%edx
  div    %esi
  cmp    $0x9,%edx
  jg     L28
  mov    %rcx,%rbp
  add    $0x30,%edx
L39:
  mov    %dl,-0x1(%rcx)
  add    $0x1,%rcx
  cmp    %edi,%r8d
  jbe    L90
  cmp    %r10,%rbp
  je     L90
  test   %r9,%r9
  je     L88
L49:
  mov    %r9,%rdi
  test   %bl,%bl
  je     L9
  lea    0x1(%r9),%rdi
  movb   $0x2d,(%r9)
L9:
  mov    %rsp,%rax
  cmp    %rax,%rbp
  jbe    L81
  mov    %rdi,%rdx
  mov    %rbp,%rax
  mov    %rsp,%rsi
L14:
  sub    $0x1,%rax
  add    $0x1,%rdx
  movzbl (%rax),%ecx
  mov    %cl,-0x1(%rdx)
  cmp    %rsi,%rax
  jne    L14
  lea    0x30(%rsp),%rax
  sub    %rax,%rdi
  lea    0x30(%rdi,%rbp,1),%rdi
L81:
  movb   $0x0,(%rdi)
  mov    %r9,%rax
L48:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L89
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L116:
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    D17(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  jmp    L48
L28:
  mov    %rcx,%rbp
  add    $0x57,%edx
  jmp    L39
L88:
  movzbl %bl,%eax
  mov    %rsp,%rcx
  mov    %rbp,%rdx
  sub    %rcx,%rdx
  lea    0x1(%rax,%rdx,1),%edi
  call   <malloc@plt>
  mov    %rax,%r9
  jmp    L49
L89:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *itoa(int value, char *string, int radix) {
  char tmp[33];
  char *tp = tmp;
  int i;
  unsigned v;
  int sign;
  char *sp;
  if (radix > 36 || radix <= 1) {
    errno = EDOM;
    return 0;
  }
  sign = (radix == 10 && value < 0);
  if (sign)
    v = -value;
  else
    v = (unsigned)value;
  while (v || tp == tmp) {
    i = v % radix;
    v = v / radix;
    if (i < 10)
      *tp++ = i + '0';
    else
      *tp++ = i + 'a' - 10;
  }
  if (string == 0)
    string = (char *)malloc((tp - tmp) + sign + 1);
  sp = string;
  if (sign)
    *sp++ = '-';
  while (tp > tmp)
    *sp++ = *--tp;
  *sp = 0;
  return string;
}
```
user: Translate the below assembly code into C programming language:

```asm
<itoa>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    -0x2(%rdx),%eax
  cmp    $0x22,%eax
  ja     L17
  cmp    $0xa,%edx
  mov    %rsi,%r8
  mov    %edx,%esi
  mov    %edi,%edx
  sete   %r13b
  mov    %edi,%eax
  shr    $0x1f,%edx
  mov    %rsp,%r12
  neg    %eax
  and    %dl,%r13b
  mov    %r12,%rbp
  cmove  %edi,%eax
  nopl   0x0(%rax,%rax,1)
L38:
  xor    %edx,%edx
  mov    %eax,%edi
  add    $0x1,%rbp
  div    %esi
  lea    0x30(%rdx),%ecx
  lea    0x57(%rdx),%ebx
  cmp    $0x9,%edx
  cmovbe %ecx,%ebx
  mov    %bl,-0x1(%rbp)
  cmp    %r12,%rbp
  je     L38
  cmp    %edi,%esi
  jbe    L38
  test   %r8,%r8
  je     L95
L53:
  mov    %r8,%rcx
  test   %r13b,%r13b
  jne    L34
L22:
  cmp    %r12,%rbp
  jbe    L46
  mov    %rcx,%rax
  mov    %rbp,%rdx
  jmp    L50
  nopl   0x0(%rax)
L80:
  movzbl -0x1(%rdx),%ebx
L50:
  sub    $0x1,%rdx
  add    $0x1,%rax
  mov    %bl,-0x1(%rax)
  cmp    %r12,%rdx
  jne    L80
  mov    %rbp,%rax
  sub    %rdx,%rax
  add    %rax,%rcx
L46:
  movb   $0x0,(%rcx)
  mov    %r8,%rax
L92:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L97
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L34:
  movb   $0x2d,(%r8)
  lea    0x1(%r8),%rcx
  jmp    L22
  nopw   0x0(%rax,%rax,1)
L17:
  mov    D15(%rip),%rax
  mov    (%rax),%edx
  mov    D12(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  jmp    L92
L95:
  mov    %rbp,%rax
  movzbl %r13b,%edx
  sub    %r12,%rax
  lea    0x1(%rdx,%rax,1),%edi
  call   <malloc@plt>
  mov    %rax,%r8
  jmp    L53
L97:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *itoa(int value, char *string, int radix) {
  char tmp[33];
  char *tp = tmp;
  int i;
  unsigned v;
  int sign;
  char *sp;
  if (radix > 36 || radix <= 1) {
    errno = EDOM;
    return 0;
  }
  sign = (radix == 10 && value < 0);
  if (sign)
    v = -value;
  else
    v = (unsigned)value;
  while (v || tp == tmp) {
    i = v % radix;
    v = v / radix;
    if (i < 10)
      *tp++ = i + '0';
    else
      *tp++ = i + 'a' - 10;
  }
  if (string == 0)
    string = (char *)malloc((tp - tmp) + sign + 1);
  sp = string;
  if (sign)
    *sp++ = '-';
  while (tp > tmp)
    *sp++ = *--tp;
  *sp = 0;
  return string;
}
```