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

```asm
<getnum>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x18,%rsp
  mov    (%rdi),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rdi,(%rsp)
  call   <skipspace@plt>
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L476
  cmp    $0x2d,%al
  je     L242
  cmp    $0x7e,%al
  je     L235
  cmp    $0x28,%al
  je     L243
  sub    $0x30,%eax
  mov    $0x80000001,%r12d
  cmp    $0x9,%al
  jbe    L578
  cs nopw 0x0(%rax,%rax,1)
L371:
  call   <skipspace@plt>
  mov    %rax,0x0(%rbp)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L417
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L476:
  add    $0x1,%rdi
  mov    %rsp,%r13
  call   <skipspace@plt>
  mov    %r13,%rdi
  xor    %esi,%esi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    (%rsp),%rdi
  mov    %eax,%r12d
  nopl   0x0(%rax)
L121:
  cmp    $0x80000001,%r12d
  je     L371
L7:
  call   <skipspace@plt>
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L510
  cmp    $0x2d,%al
  je     L530
  cmp    $0x2a,%al
  je     L446
  cmp    $0x2f,%al
  je     L614
  cmp    $0x25,%al
  je     L45
  cmp    $0x3c,%al
  je     L73
  cmp    $0x3e,%al
  jne    L599
  cmpb   $0x3e,0x1(%rdi)
  jne    L371
  cmp    $0x3,%ebx
  jle    L371
  add    $0x2,%rdi
  call   <skipspace@plt>
  mov    $0x3,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  test   %eax,%eax
  je     L517
  mov    %eax,%ecx
  mov    (%rsp),%rdi
  sar    %cl,%r12d
  jmp    L7
  cs nopw 0x0(%rax,%rax,1)
L510:
  cmp    $0x2,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x2,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  add    %eax,%r12d
  nopl   0x0(%rax)
L162:
  mov    (%rsp),%rdi
  jmp    L121
  nopl   0x0(%rax)
L530:
  cmp    $0x2,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x2,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  sub    %eax,%r12d
  jmp    L162
  nopl   0x0(%rax,%rax,1)
L599:
  cmp    $0x26,%al
  jne    L432
  cmp    $0x4,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x4,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  and    %eax,%r12d
  jmp    L162
  xchg   %ax,%ax
L446:
  cmp    $0x1,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  imul   %eax,%r12d
  jmp    L162
  nopw   0x0(%rax,%rax,1)
L614:
  cmp    $0x1,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L517
  test   %eax,%eax
  je     L517
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r12d
  jmp    L162
  cs nopw 0x0(%rax,%rax,1)
L45:
  cmp    $0x1,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L517
  test   %eax,%eax
  je     L517
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  mov    %edx,%r12d
  jmp    L162
  cs nopw 0x0(%rax,%rax,1)
L73:
  cmpb   $0x3c,0x1(%rdi)
  jne    L371
  cmp    $0x3,%ebx
  jle    L371
  add    $0x2,%rdi
  call   <skipspace@plt>
  mov    $0x3,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L517
  test   %eax,%eax
  je     L517
  shl    %cl,%r12d
  jmp    L162
  nopw   0x0(%rax,%rax,1)
L432:
  cmp    $0x5e,%al
  jne    L62
  cmp    $0x5,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x5,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  xor    %eax,%r12d
  jmp    L162
L62:
  cmp    $0x7c,%al
  jne    L371
  cmp    $0x6,%ebx
  jle    L371
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x6,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L517
  or     %eax,%r12d
  jmp    L162
L243:
  add    $0x1,%rdi
  mov    %rsp,%r13
  call   <skipspace@plt>
  mov    %r13,%rdi
  mov    $0x9,%esi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    (%rsp),%rdi
  mov    %eax,%r12d
  cmpb   $0x29,(%rdi)
  je     L202
  mov    $0x80000001,%r12d
  jmp    L371
L242:
  add    $0x1,%rdi
  mov    %rsp,%r13
  call   <skipspace@plt>
  xor    %esi,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%r12d
  cmp    $0x80000001,%eax
  je     L628
  mov    (%rsp),%rdi
  neg    %r12d
  jmp    L121
L517:
  mov    (%rsp),%rdi
  mov    $0x80000001,%r12d
  jmp    L371
L578:
  mov    %rsp,%r13
  xor    %edx,%edx
  mov    %r13,%rsi
  call   <strtol@plt>
  mov    (%rsp),%rdi
  mov    %eax,%r12d
  jmp    L121
L235:
  add    $0x1,%rdi
  mov    %rsp,%r13
  call   <skipspace@plt>
  xor    %esi,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%r12d
  cmp    $0x80000001,%eax
  je     L628
  mov    (%rsp),%rdi
  not    %r12d
  jmp    L121
L628:
  mov    (%rsp),%rdi
  jmp    L371
L202:
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  jmp    L121
L417:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int getnum(char **pp, int priority) {
  char *p = *pp;
  int i = -0x7fffffff, j;
  p = skipspace(p);
  if (*p == '+') {
    p = skipspace(p + 1);
    i = getnum(&p, 0);
  } else if (*p == '-') {
    p = skipspace(p + 1);
    i = getnum(&p, 0);
    if (i != -0x7fffffff) {
      i = -i;
    }
  } else if (*p == '~') {
    p = skipspace(p + 1);
    i = getnum(&p, 0);
    if (i != -0x7fffffff) {
      i = ~i;
    }
  } else if (*p == '(') {
    p = skipspace(p + 1);
    i = getnum(&p, 9);
    if (*p == ')') {
      p = skipspace(p + 1);
    } else {
      i = -0x7fffffff;
    }
  } else if ('0' <= *p && *p <= '9') {
    i = strtol(p, &p, 0);
  } else {
    i = -0x7fffffff;
  }
  for (;;) {
    if (i == -0x7fffffff) {
      break;
    }
    p = skipspace(p);
    if (*p == '+' && priority > 2) {
      p = skipspace(p + 1);
      j = getnum(&p, 2);
      if (j != -0x7fffffff) {
        i += j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '-' && priority > 2) {
      p = skipspace(p + 1);
      j = getnum(&p, 2);
      if (j != -0x7fffffff) {
        i -= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '*' && priority > 1) {
      p = skipspace(p + 1);
      j = getnum(&p, 1);
      if (j != -0x7fffffff) {
        i *= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '/' && priority > 1) {
      p = skipspace(p + 1);
      j = getnum(&p, 1);
      if (j != -0x7fffffff && j != 0) {
        i /= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '%' && priority > 1) {
      p = skipspace(p + 1);
      j = getnum(&p, 1);
      if (j != -0x7fffffff && j != 0) {
        i %= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '<' && p[1] == '<' && priority > 3) {
      p = skipspace(p + 2);
      j = getnum(&p, 3);
      if (j != -0x7fffffff && j != 0) {
        i <<= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '>' && p[1] == '>' && priority > 3) {
      p = skipspace(p + 2);
      j = getnum(&p, 3);
      if (j != -0x7fffffff && j != 0) {
        i >>= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '&' && priority > 4) {
      p = skipspace(p + 1);
      j = getnum(&p, 4);
      if (j != -0x7fffffff) {
        i &= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '^' && priority > 5) {
      p = skipspace(p + 1);
      j = getnum(&p, 5);
      if (j != -0x7fffffff) {
        i ^= j;
      } else {
        i = -0x7fffffff;
      }
    } else if (*p == '|' && priority > 6) {
      p = skipspace(p + 1);
      j = getnum(&p, 6);
      if (j != -0x7fffffff) {
        i |= j;
      } else {
        i = -0x7fffffff;
      }
    } else {
      break;
    }
  }
  p = skipspace(p);
  *pp = p;
  return i;
}
```