user: Translate the below assembly code into C programming language:

```asm
<eval_scalar>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r14
  mov    %r14,%rsi
  call   <eval_scalar_nomath@plt>
  cmp    $0xffffffff,%eax
  je     L110
  movslq 0x4(%rsp),%r12
  mov    %eax,%r13d
  add    %rbx,%r12
L118:
  movsbl (%r12),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L39
L24:
  movzbl (%r12),%eax
  test   %al,%al
  je     L264
  cmp    $0x2b,%al
  je     L22
  cmp    $0x2d,%al
  jne    L137
  add    $0x1,%r12
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <eval_scalar_nomath@plt>
  movslq 0x4(%rsp),%rdx
  add    %rdx,%r12
  cmp    $0xffffffff,%eax
  je     L110
  mov    %r13d,%edx
  and    $0x40000,%edx
  test   $0x40000,%eax
  je     L265
  test   %edx,%edx
  je     L45
  mov    %r13d,%edx
  mov    %eax,%ecx
  sub    %eax,%r13d
  movsbl (%r12),%edi
  shr    $0x9,%edx
  shr    $0x9,%ecx
  and    $0x1ff,%r13d
  and    $0x1ff,%edx
  and    $0x1ff,%ecx
  sub    %ecx,%edx
  shl    $0x9,%edx
  and    $0x3fe00,%edx
  or     %edx,%r13d
  or     $0x40000,%r13d
  call   <isspace@plt>
  test   %rax,%rax
  je     L24
  nopl   0x0(%rax)
L39:
  add    $0x1,%r12
  jmp    L118
  nopl   0x0(%rax)
L137:
  mov    %r12,%r14
  xor    %eax,%eax
  lea    D46(%rip),%rdi
  mov    %r12,%rdx
  sub    %rbx,%r14
  mov    %r14,%rsi
  call   <error@plt>
  test   %rbp,%rbp
  je     L129
  mov    %r14d,0x0(%rbp)
L129:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x10,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  add    $0x1,%r12
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <eval_scalar_nomath@plt>
  movslq 0x4(%rsp),%rdx
  add    %rdx,%r12
  cmp    $0xffffffff,%eax
  je     L110
  mov    %r13d,%edx
  and    $0x40000,%edx
  test   $0x40000,%eax
  je     L124
  test   %edx,%edx
  je     L222
  mov    %r13d,%edx
  mov    %eax,%ecx
  add    %r13d,%eax
  shr    $0x9,%edx
  shr    $0x9,%ecx
  and    $0x1ff,%eax
  and    $0x1ff,%edx
  and    $0x1ff,%ecx
  add    %ecx,%edx
  shl    $0x9,%edx
  and    $0x3fe00,%edx
  or     %edx,%eax
  or     $0x40000,%eax
  mov    %eax,%r13d
  jmp    L118
  nopl   0x0(%rax)
L124:
  test   %edx,%edx
  jne    L209
  add    %r13d,%eax
  and    $0x3ffff,%eax
  mov    %eax,%r13d
  jmp    L118
  nopl   0x0(%rax)
L265:
  test   %edx,%edx
  jne    L188
  sub    %eax,%r13d
  and    $0x3ffff,%r13d
  jmp    L118
  nopl   0x0(%rax,%rax,1)
L110:
  mov    $0xffffffff,%r13d
  jmp    L129
  nopl   0x0(%rax,%rax,1)
L264:
  test   %rbp,%rbp
  je     L129
  sub    %rbx,%r12
  mov    %r12d,0x0(%rbp)
  jmp    L129
L209:
  lea    D22(%rip),%rdi
  xor    %eax,%eax
  call   <error@plt>
  mov    %eax,%r13d
  jmp    L129
L222:
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <error@plt>
  mov    %eax,%r13d
  jmp    L129
L188:
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  call   <error@plt>
  mov    %eax,%r13d
  jmp    L129
L45:
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  call   <error@plt>
  mov    %eax,%r13d
  jmp    L129
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D46
data_type: string
name: unpack_data
arguments: data_tag: D22
data_type: string
name: unpack_data
arguments: data_tag: D24
data_type: string
name: unpack_data
arguments: data_tag: D19
data_type: string
name: unpack_data
arguments: data_tag: D3
data_type: string

tool: D46: Unexpected operator or token after scalar "%.*s"

tool: D22: Type error: Cannot add integer to vector

tool: D24: Type error: Cannot add vector to integer

tool: D19: Type error: Cannot subtract integer from vector

tool: D3: Type error: Cannot subtract vector from integer

assistant: ```c
unsigned int eval_scalar(const char *text, int *len) {
  int ilen;
  unsigned int lval = eval_scalar_nomath(text, &ilen);
  unsigned int rval;
  const char *ip;
  if (lval == -1u)
    return -1u;
  ip = text + ilen;
  while (1) {
    while (isspace(*ip))
      ++ip;
    if (*ip == '\0')
      break;
    switch (*ip) {
    case '-':
      rval = eval_scalar_nomath(++ip, &ilen);
      ip += ilen;
      if (rval == -1u)
        return -1u;
      if (rval & 01000000) {
        if (lval & 01000000) {
          unsigned int x = (lval & 0777) - (rval & 0777);
          unsigned int y = ((lval >> 9) & 0777) - ((rval >> 9) & 0777);
          lval = 01000000 | ((y & 0777) << 9) | (x & 0777);
        } else
          return error("Type error: Cannot subtract vector from integer");
      } else {
        if (lval & 01000000)
          return error("Type error: Cannot subtract integer from vector");
        else
          lval = (lval - rval) & 0777777;
      }
      break;
    case '+':
      rval = eval_scalar_nomath(++ip, &ilen);
      ip += ilen;
      if (rval == -1u)
        return -1u;
      if (rval & 01000000) {
        if (lval & 01000000) {
          unsigned int x = (lval & 0777) + (rval & 0777);
          unsigned int y = ((lval >> 9) & 0777) + ((rval >> 9) & 0777);
          lval = 01000000 | ((y & 0777) << 9) | (x & 0777);
        } else
          return error("Type error: Cannot add vector to integer");
      } else {
        if (lval & 01000000)
          return error("Type error: Cannot add integer to vector");
        else
          lval = (lval + rval) & 0777777;
      }
      break;
    default:
      error("Unexpected operator or token after scalar \"%.*s\"", ip - text, ip);
      if (len != NULL)
        *len = ip - text;
      return lval;
    }
  }
  if (len != NULL)
    *len = ip - text;
  return lval;
}
```