user: 请将这段汇编代码片段转换成等效的C代码：

```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     L353
  cmp    $0x2d,%al
  je     L471
  cmp    $0x7e,%al
  je     L85
  cmp    $0x28,%al
  je     L459
  sub    $0x30,%eax
  mov    $0x80000001,%r12d
  cmp    $0x9,%al
  jbe    L456
  cs nopw 0x0(%rax,%rax,1)
L566:
  call   <skipspace@plt>
  mov    %rax,0x0(%rbp)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L359
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L353:
  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)
L155:
  cmp    $0x80000001,%r12d
  je     L566
L429:
  call   <skipspace@plt>
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L454
  cmp    $0x2d,%al
  je     L116
  cmp    $0x2a,%al
  je     L570
  cmp    $0x2f,%al
  je     L598
  cmp    $0x25,%al
  je     L61
  cmp    $0x3c,%al
  je     L158
  cmp    $0x3e,%al
  jne    L197
  cmpb   $0x3e,0x1(%rdi)
  jne    L566
  cmp    $0x3,%ebx
  jle    L566
  add    $0x2,%rdi
  call   <skipspace@plt>
  mov    $0x3,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  test   %eax,%eax
  je     L462
  mov    %eax,%ecx
  mov    (%rsp),%rdi
  sar    %cl,%r12d
  jmp    L429
  cs nopw 0x0(%rax,%rax,1)
L454:
  cmp    $0x2,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x2,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  add    %eax,%r12d
  nopl   0x0(%rax)
L417:
  mov    (%rsp),%rdi
  jmp    L155
  nopl   0x0(%rax)
L116:
  cmp    $0x2,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x2,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  sub    %eax,%r12d
  jmp    L417
  nopl   0x0(%rax,%rax,1)
L197:
  cmp    $0x26,%al
  jne    L478
  cmp    $0x4,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x4,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  and    %eax,%r12d
  jmp    L417
  xchg   %ax,%ax
L570:
  cmp    $0x1,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  imul   %eax,%r12d
  jmp    L417
  nopw   0x0(%rax,%rax,1)
L598:
  cmp    $0x1,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L462
  test   %eax,%eax
  je     L462
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r12d
  jmp    L417
  cs nopw 0x0(%rax,%rax,1)
L61:
  cmp    $0x1,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L462
  test   %eax,%eax
  je     L462
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  mov    %edx,%r12d
  jmp    L417
  cs nopw 0x0(%rax,%rax,1)
L158:
  cmpb   $0x3c,0x1(%rdi)
  jne    L566
  cmp    $0x3,%ebx
  jle    L566
  add    $0x2,%rdi
  call   <skipspace@plt>
  mov    $0x3,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  mov    %eax,%ecx
  cmp    $0x80000001,%eax
  je     L462
  test   %eax,%eax
  je     L462
  shl    %cl,%r12d
  jmp    L417
  nopw   0x0(%rax,%rax,1)
L478:
  cmp    $0x5e,%al
  jne    L380
  cmp    $0x5,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x5,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  xor    %eax,%r12d
  jmp    L417
L380:
  cmp    $0x7c,%al
  jne    L566
  cmp    $0x6,%ebx
  jle    L566
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    $0x6,%esi
  mov    %r13,%rdi
  mov    %rax,(%rsp)
  call   <getnum>
  cmp    $0x80000001,%eax
  je     L462
  or     %eax,%r12d
  jmp    L417
L459:
  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     L357
  mov    $0x80000001,%r12d
  jmp    L566
L471:
  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     L309
  mov    (%rsp),%rdi
  neg    %r12d
  jmp    L155
L462:
  mov    (%rsp),%rdi
  mov    $0x80000001,%r12d
  jmp    L566
L456:
  mov    %rsp,%r13
  xor    %edx,%edx
  mov    %r13,%rsi
  call   <strtol@plt>
  mov    (%rsp),%rdi
  mov    %eax,%r12d
  jmp    L155
L85:
  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     L309
  mov    (%rsp),%rdi
  not    %r12d
  jmp    L155
L309:
  mov    (%rsp),%rdi
  jmp    L566
L357:
  add    $0x1,%rdi
  call   <skipspace@plt>
  mov    %rax,(%rsp)
  mov    %rax,%rdi
  jmp    L155
L359:
  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;
}
```