user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<arithmetic_op>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %rbx,%rdi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r15
  mov    %r15,%rsi
  call   <eval_register@plt>
  cmp    $0xffffffff,%eax
  je     L33
  mov    %eax,%ebp
  movslq 0x4(%rsp),%rax
  add    %rax,%rbx
  cmpb   $0x2c,(%rbx)
  je     L120
  mov    %r12,%rsi
  lea    D38(%rip),%rdi
  call   <error@plt>
L97:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L131
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L120:
  add    $0x1,%rbx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <eval_register@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L33
  xor    %edi,%edi
  cmp    $0x7,%eax
  setbe  %dil
  shl    $0x9,%ebp
  call   <assert@plt>
  or     %r13d,%ebp
  movslq 0x4(%rsp),%rax
  shl    $0x3,%r14d
  or     %ebp,%r14d
  add    %rax,%rbx
  mov    %r14d,%eax
  and    $0x1c0,%eax
  cmp    $0x1c0,%eax
  je     L80
  cmpb   $0x2c,(%rbx)
  jne    L2
  lea    0x1(%rbx),%rdi
  mov    %r15,%rsi
  call   <eval_register@plt>
  mov    %eax,%ebp
  cmp    $0xffffffff,%eax
  je     L33
  xor    %edi,%edi
  cmp    $0x7,%eax
  setbe  %dil
  or     %ebp,%r14d
  call   <assert@plt>
  movslq 0x4(%rsp),%rax
  cmpb   $0x0,0x1(%rbx,%rax,1)
  jne    L83
L6:
  mov    %r14d,%edi
  call   <apply_masking_mode@plt>
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L33:
  mov    $0xffffffff,%eax
  jmp    L97
  nopw   0x0(%rax,%rax,1)
L2:
  mov    %r12,%rsi
  lea    D0(%rip),%rdi
  call   <error@plt>
  jmp    L97
  nopl   0x0(%rax)
L80:
  cmpb   $0x0,(%rbx)
  je     L6
  mov    %r12,%rsi
  lea    D16(%rip),%rdi
  call   <error@plt>
  jmp    L97
  nopl   0x0(%rax)
L83:
  mov    %r12,%rsi
  lea    D26(%rip),%rdi
  call   <error@plt>
  jmp    L97
L131:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D38
type: string
name: retrieve_data
arguments: tag: D0
type: string
name: retrieve_data
arguments: tag: D16
type: string
name: retrieve_data
arguments: tag: D26
type: string

tool: D38: Expected second operand in "%s"

tool: D0: Expected third operand in "%s"

tool: D16: Expected only two operands in "%s"

tool: D26: Expected only three operands in "%s"

assistant: ```c
unsigned int arithmetic_op(const char *text, const char *ip, unsigned int ret) {
  int len;
  unsigned int lval = eval_register(ip, &len);
  if (lval == -1u)
    return -1u;
  ret |= (lval << 9);
  ip += len;
  if (*ip++ != ',')
    return error("Expected second operand in \"%s\"", text);
  lval = eval_register(ip, &len);
  if (lval == -1u)
    return -1u;
  assert(lval <= 7);
  ret |= (lval << 3);
  ip += len;
  if ((ret & 0700) != 0700) {
    if (*ip++ != ',')
      return error("Expected third operand in \"%s\"", text);
    lval = eval_register(ip, &len);
    if (lval == -1u)
      return -1u;
    assert(lval <= 7);
    ret |= lval;
    ip += len;
    if (*ip++ != '\0')
      return error("Expected only three operands in \"%s\"", text);
  } else {
    if (*ip++ != '\0')
      return error("Expected only two operands in \"%s\"", text);
  }
  return apply_masking_mode(ret);
}
```