user: 这段汇编代码用C语言表示是什么样的?

```asm
<scale>:
  endbr64
  push   %r13
  push   %r12
  movslq %esi,%r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  movl   $0x0,(%rcx)
  cmp    %r12d,%edi
  je     L166
  mov    %edi,%r13d
  lea    D8(%rip),%rsi
  mov    %rdx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L166
  lea    -0x2(%r13),%eax
  cmp    $0x3e,%eax
  ja     L88
  lea    -0x2(%r12),%eax
  cmp    $0x3e,%eax
  ja     L88
  xor    %eax,%eax
  cmpb   $0x2d,(%rbx)
  sete   %al
  add    %rax,%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmp    %rax,%rbx
  ja     L29
  mov    $0x1,%ecx
  xor    %ebp,%ebp
  movslq %r13d,%rdi
  jmp    L138
  nopl   0x0(%rax)
L102:
  movzbl %sil,%esi
  mov    %esi,%edx
L20:
  cmp    %esi,%r13d
  jl     L88
L110:
  movsbq %dl,%rdx
  sub    $0x1,%rax
  imul   %rcx,%rdx
  imul   %rdi,%rcx
  add    %rdx,%rbp
  cmp    %rax,%rbx
  ja     L217
L138:
  movzbl (%rax),%edx
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  jbe    L102
  lea    -0x41(%rdx),%esi
  cmp    $0x1a,%sil
  ja     L159
  sub    $0x37,%edx
  movzbl %dl,%esi
  cmp    %esi,%r13d
  jge    L110
L88:
  add    $0x8,%rsp
  xor    %r8d,%r8d
  pop    %rbx
  mov    %r8,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L166:
  mov    %rbx,%r8
L177:
  add    $0x8,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L159:
  lea    -0x61(%rdx),%esi
  cmp    $0x19,%sil
  ja     L136
  sub    $0x3d,%edx
  movzbl %dl,%esi
  jmp    L20
  nopl   0x0(%rax)
L136:
  cmp    $0x40,%dl
  je     L249
  movsbl %dl,%esi
  cmp    $0x5f,%dl
  jne    L20
  mov    $0x3f,%esi
  mov    $0x3f,%edx
  jmp    L20
  nopl   0x0(%rax)
L217:
  mov    %ebp,%edi
L196:
  call   <log@plt>
  mov    %r12d,%edi
  mov    %eax,%ebx
  call   <log@plt>
  mov    $0x1,%esi
  mov    %eax,%r8d
  mov    %ebx,%eax
  cltd
  idiv   %r8d
  movslq %eax,%rbx
  lea    0x2(%rbx),%edi
  call   <calloc@plt>
  mov    $0x40,%edi
  mov    $0x5f,%esi
  mov    %rax,%r8
  lea    (%rax,%rbx,1),%rcx
  jmp    L100
  nopl   (%rax)
L27:
  add    $0x30,%edx
L203:
  mov    %dl,(%rcx)
  sub    $0x1,%rcx
  test   %rax,%rax
  jle    L177
L100:
  mov    %rbp,%rax
  cqto
  idiv   %r12
  mov    %rax,%rbp
  cmp    $0x9,%rdx
  jle    L27
  cmp    $0x23,%rdx
  jg     L0
  add    $0x37,%edx
  jmp    L203
  cs nopw 0x0(%rax,%rax,1)
L0:
  cmp    $0x3d,%dl
  jg     L181
  add    $0x3d,%edx
  jmp    L203
  nopw   0x0(%rax,%rax,1)
L181:
  cmp    $0x3e,%dl
  mov    %esi,%edx
  cmove  %edi,%edx
  jmp    L203
  nopw   0x0(%rax,%rax,1)
L249:
  mov    $0x3e,%esi
  mov    $0x3e,%edx
  jmp    L20
L29:
  xor    %edi,%edi
  xor    %ebp,%ebp
  jmp    L196
```

tool_calls: name: parse_data
arguments: tag: D8
type: string

tool: D8: 0

assistant: ```c
char *scale(int cur, int res, char *num, bool *freeable) {
  bool caps = false, posi = true;
  *freeable = false;
  if (cur == res || strcmp(num, "0") == 0)
    return num;
  if (cur < 2 || cur > 64 || res < 2 || res > 64)
    return NULL;
  if (num[0] == '-') {
    posi = false;
    num++;
  }
  long iresult = 0, unit = 1;
  char *sresult = NULL, value;
  for (char *i = num + strlen(num) - 1; i >= num; i--) {
    value = *i;
    if (value > 47 && value < 58)
      value -= 48;
    else if (value > 64 && value < 92)
      value -= 55;
    else if (value > 96 && value < 123)
      value -= 61;
    else if (value == 64)
      value = 62;
    else if (value == 95)
      value = 63;
    if (value > cur)
      return NULL;
    iresult += value * unit;
    unit *= cur;
  }
  int len = (int)(log(iresult) / log(res)) + 1;
  sresult = calloc(len + 1, sizeof(char));
  char *ptr = sresult;
  ptr = len + sresult - 1;
  do {
    value = iresult % res;
    iresult /= res;
    if (value < 10)
      value += 48;
    else if (value < 36)
      value += 55;
    else if (value < 62)
      value += 61;
    else if (value == 62)
      value = 64;
    else if (value == 63)
      value = 95;
    *ptr = value;
    ptr--;
  } while (iresult > 0);
  return sresult;
}
```