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

```asm
<calc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  movb   $0x0,-0x15(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <total_trim@plt>
  mov    -0x30(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <next_num@plt>
  mov    %eax,-0x10(%rbp)
  jmp    L18
L23:
  lea    -0x14(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <next_tok@plt>
  mov    %al,-0x15(%rbp)
  mov    -0x30(%rbp),%rdx
  lea    -0x14(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <next_num@plt>
  mov    %eax,-0xc(%rbp)
  movsbl -0x15(%rbp),%eax
  cmp    $0x7c,%eax
  je     L144
  cmp    $0x7c,%eax
  jg     L149
  cmp    $0x2f,%eax
  jg     L3
  test   %eax,%eax
  js     L149
  cmp    $0x2f,%eax
  ja     L149
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D18(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D18(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L3:
  cmp    $0x5e,%eax
  je     L75
  jmp    L149
  mov    -0x30(%rbp),%rax
  movl   $0x1,(%rax)
  mov    $0x0,%eax
  jmp    L82
  mov    -0xc(%rbp),%eax
  add    %eax,-0x10(%rbp)
  jmp    L18
  mov    -0xc(%rbp),%eax
  sub    %eax,-0x10(%rbp)
  jmp    L18
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0xc(%rbp)
  mov    %eax,-0x10(%rbp)
  jmp    L18
  mov    -0x10(%rbp),%eax
  imul   -0xc(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L18
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0xc(%rbp)
  mov    %edx,-0x10(%rbp)
  jmp    L18
  mov    -0xc(%rbp),%eax
  and    %eax,-0x10(%rbp)
  jmp    L18
L144:
  mov    -0xc(%rbp),%eax
  or     %eax,-0x10(%rbp)
  jmp    L18
L75:
  mov    -0xc(%rbp),%eax
  xor    %eax,-0x10(%rbp)
  jmp    L18
L149:
  mov    -0x30(%rbp),%rax
  movl   $0x2,(%rax)
  mov    $0x0,%eax
  jmp    L82
L18:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x14(%rbp),%edx
  cmp    %edx,%eax
  jg     L23
  mov    -0x30(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x10(%rbp),%eax
L82:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
int calc(char *expr, int *status) {
  int pos = 0;
  int num = 0, result = 0;
  char op = 0;
  total_trim(expr);
  result = next_num(expr, &pos, status);
  while (pos < strlen(expr)) {
    op = next_tok(expr, &pos);
    num = next_num(expr, &pos, status);
    switch (op) {
    case 0:
      *status = 1;
      return 0;
      break;
    case '+':
      result += num;
      break;
    case '-':
      result -= num;
      break;
    case '/':
      result /= num;
      break;
    case '*':
      result *= num;
      break;
    case '%':
      result %= num;
      break;
    case '&':
      result &= num;
      break;
    case '|':
      result |= num;
      break;
    case '^':
      result ^= num;
      break;
    default:
      *status = 2;
      return 0;
      break;
    }
  }
  *status = 0;
  return result;
}
```