user: 这段汇编代码用C语言表示是什么样的:

```asm
<calculator>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L576
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  xor    %r13d,%r13d
  jmp    L871
  nopl   0x0(%rax,%rax,1)
L156:
  lea    0x0(%rbp,%rbp,4),%eax
  mov    %r14,%rbx
  add    %eax,%eax
L418:
  movsbl (%rbx),%edx
  lea    -0x30(%rax,%rdx,1),%ebp
L270:
  movsbl 0x1(%rbx),%edi
  lea    0x1(%rbx),%r14
  test   %dil,%dil
  je     L1112
L871:
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L156
  movzbl (%r14),%eax
  cmp    $0x2a,%al
  je     L553
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  jne    L855
  movsbl 0x1(%r14),%edi
  cmp    $0x2,%r12d
  jne    L791
  sub    %ebp,%r13d
  mov    %r13d,%ebp
  test   %dil,%dil
  je     L1112
  call   <isdigit@plt>
  test   %rax,%rax
  je     L675
L25:
  movsbl 0x1(%r14),%r12d
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rbx
  sub    $0x30,%r12d
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L209
  movzbl 0x2(%r14),%eax
  cmp    $0x2a,%al
  jne    L317
L516:
  add    %r12d,%ebp
L227:
  movsbl 0x1(%rbx),%edi
  test   %dil,%dil
  je     L650
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L700
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%r15
  xor    %r12d,%r12d
  cmp    $0x2a,%al
  je     L13
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L595
  cmp    $0x23,%al
  je     L576
  movzbl 0x2(%rbx),%eax
  lea    0x2(%rbx),%r15
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L484
  movzbl 0x2(%rbx),%eax
  cmp    $0x2a,%al
  je     L13
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L595
  mov    %r15,%rbx
  jmp    L114
  nop
L985:
  cmp    $0x3,%r12d
  je     L54
  cmp    $0x1,%r12d
  je     L319
  test   %dil,%dil
  jne    L110
  nopl   0x0(%rax)
L650:
  mov    %ebp,%r13d
L1112:
  add    $0x8,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L553:
  movsbl 0x1(%r14),%edi
  lea    0x1(%r14),%r15
  cmp    $0x2,%r12d
  jne    L985
  sub    %ebp,%r13d
  mov    %r13d,%ebp
  test   %dil,%dil
  je     L1112
L110:
  call   <isdigit@plt>
  test   %rax,%rax
  je     L220
  movsbl 0x1(%r14),%r12d
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rbx
  sub    $0x30,%r12d
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L745
  movzbl 0x2(%r14),%eax
  cmp    $0x2a,%al
  je     L680
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  jne    L599
  imul   %r12d,%ebp
  mov    %rbx,%r15
  jmp    L430
  xchg   %ax,%ax
L791:
  cmp    $0x3,%r12d
  je     L398
  cmp    $0x1,%r12d
  je     L629
  test   %dil,%dil
  je     L650
  call   <isdigit@plt>
  test   %rax,%rax
  je     L675
  jmp    L25
L855:
  mov    %r14,%rbx
L1059:
  cmp    $0x23,%al
  jne    L270
  cmp    $0x2,%r12d
  je     L445
  cmp    $0x3,%r12d
  je     L99
  add    %ebp,%r13d
  cmp    $0x1,%r12d
  cmovne %ebp,%r13d
  jmp    L1112
  nop
L220:
  movzbl 0x1(%r14),%eax
  cmp    $0x2a,%al
  je     L641
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L595
  cmp    $0x23,%al
  je     L576
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rbx
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L238
  movzbl 0x2(%r14),%eax
  cmp    $0x2a,%al
  je     L106
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L384
L114:
  mov    %ebp,%r13d
  mov    $0x3,%r12d
  xor    %ebp,%ebp
  jmp    L1059
L675:
  movzbl 0x1(%r14),%eax
  lea    0x1(%r14),%rbx
  cmp    $0x2a,%al
  je     L227
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L1039
  cmp    $0x23,%al
  je     L650
  movzbl 0x2(%r14),%eax
  lea    0x2(%r14),%rbx
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L993
  movzbl 0x2(%r14),%eax
  cmp    $0x2a,%al
  je     L227
L143:
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  jne    L176
L1039:
  xor    %r12d,%r12d
L95:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  lea    0x0(%rbp,%r12,1),%r13d
  test   %dil,%dil
  je     L1112
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L960
  movzbl (%rbx),%eax
  cmp    $0x2a,%al
  je     L706
  mov    %eax,%edx
  xor    %r12d,%r12d
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L1097
  mov    $0x1,%r12d
  xor    %ebp,%ebp
  jmp    L1059
L209:
  lea    (%r12,%r12,4),%eax
  mov    %ebp,%r13d
  mov    $0x1,%r12d
  add    %eax,%eax
  jmp    L418
L384:
  mov    %rbx,%r15
L595:
  xor    %ebp,%ebp
L430:
  movsbl 0x1(%r15),%edi
  test   %dil,%dil
  je     L650
  call   <isdigit@plt>
  test   %rax,%rax
  je     L284
  movsbl 0x1(%r15),%r12d
  movzbl 0x2(%r15),%eax
  lea    0x2(%r15),%rbx
  sub    $0x30,%r12d
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L209
  movzbl 0x2(%r15),%eax
  cmp    $0x2a,%al
  je     L516
L317:
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L95
  mov    %ebp,%r13d
  mov    %r12d,%ebp
  mov    $0x1,%r12d
  jmp    L1059
  nopl   0x0(%rax,%rax,1)
L700:
  movsbl 0x1(%rbx),%r12d
  movzbl 0x2(%rbx),%eax
  lea    0x2(%rbx),%r15
  sub    $0x30,%r12d
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L997
  lea    (%r12,%r12,4),%eax
  mov    %r15,%rbx
  mov    %ebp,%r13d
  mov    $0x3,%r12d
  add    %eax,%eax
  jmp    L418
  nopl   0x0(%rax)
L960:
  xor    %eax,%eax
  mov    $0x1,%r12d
  jmp    L418
  nopl   (%rax)
L284:
  movzbl 0x1(%r15),%eax
  lea    0x1(%r15),%rbx
  cmp    $0x2a,%al
  je     L227
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L1039
  cmp    $0x23,%al
  je     L650
  movzbl 0x2(%r15),%eax
  lea    0x2(%r15),%rbx
  test   %al,%al
  je     L650
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L647
L993:
  mov    %ebp,%r13d
  xor    %eax,%eax
  mov    $0x1,%r12d
  jmp    L418
  nopl   0x0(%rax)
L745:
  lea    (%r12,%r12,4),%eax
  mov    %ebp,%r13d
  mov    $0x3,%r12d
  add    %eax,%eax
  jmp    L418
L641:
  xor    %r12d,%r12d
L13:
  imul   %r12d,%ebp
  movsbl 0x1(%r15),%edi
  lea    0x1(%r15),%rbx
  mov    %ebp,%r13d
  test   %dil,%dil
  je     L1112
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L969
  movzbl (%rbx),%eax
  xor    %r12d,%r12d
  cmp    $0x2a,%al
  je     L61
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L384
  cmp    $0x23,%al
  je     L576
  movzbl 0x1(%rbx),%eax
  add    $0x2,%r15
  test   %al,%al
  je     L1112
  movsbl %al,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L263
  movzbl 0x1(%rbx),%eax
  cmp    $0x2a,%al
  je     L6
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  je     L595
  mov    %r15,%rbx
  mov    $0x3,%r12d
  xor    %ebp,%ebp
  jmp    L1059
L484:
  mov    %r15,%rbx
L238:
  mov    %ebp,%r13d
L969:
  xor    %eax,%eax
  mov    $0x3,%r12d
  jmp    L418
L997:
  movzbl 0x2(%rbx),%eax
  cmp    $0x2a,%al
  je     L13
  mov    %eax,%edx
  and    $0xffffffdf,%edx
  cmp    $0x41,%dl
  jne    L352
  imul   %r12d,%ebp
  jmp    L430
L576:
  xor    %r13d,%r13d
  jmp    L1112
L61:
  mov    %rbx,%r15
L6:
  mov    %r13d,%ebp
  jmp    L13
L706:
  mov    %r13d,%ebp
  jmp    L227
L1097:
  mov    %r13d,%ebp
  jmp    L95
L680:
  mov    %rbx,%r15
  jmp    L13
L599:
  mov    %ebp,%r13d
  mov    %r12d,%ebp
  mov    $0x3,%r12d
  jmp    L1059
L352:
  mov    %ebp,%r13d
  mov    %r15,%rbx
  mov    %r12d,%ebp
  mov    $0x3,%r12d
  jmp    L1059
L263:
  mov    %r15,%rbx
  xor    %eax,%eax
  mov    $0x3,%r12d
  jmp    L418
L647:
  movzbl 0x2(%r15),%eax
  cmp    $0x2a,%al
  jne    L143
  jmp    L227
L176:
  mov    %ebp,%r13d
  mov    $0x1,%r12d
  xor    %ebp,%ebp
  jmp    L1059
L106:
  mov    %rbx,%r15
  xor    %r12d,%r12d
  jmp    L13
L445:
  sub    %ebp,%r13d
  jmp    L1112
L99:
  imul   %ebp,%r13d
  jmp    L1112
L319:
  add    %r13d,%ebp
  mov    %r14,%rbx
  jmp    L227
L54:
  mov    %ebp,%r12d
  mov    %r14,%r15
  mov    %r13d,%ebp
  jmp    L13
L398:
  imul   %r13d,%ebp
  mov    %r14,%r15
  jmp    L430
L629:
  mov    %ebp,%r12d
  mov    %r14,%rbx
  mov    %r13d,%ebp
  jmp    L95
```

assistant: ```c
int calculator(char *str) {
  int result;
  int num;
  enum { NONE, ADD, SUB, MUL, DIV } lastop;
  char *p;
  result = 0;
  num = 0;
  lastop = NONE;
  for (p = str; *p != '\0'; p++) {
    if (isdigit(*p)) {
      num = num * 10 + *p - '0';
    } else if (*p == '*') {
      switch (lastop) {
      case NONE:
        result = num;
        num = 0;
        break;
      case ADD:
        result += num;
        num = 0;
        break;
      case SUB:
        result -= num;
        num = 0;
        break;
      case MUL:
        result *= num;
        num = 0;
        break;
      case DIV:
        result /= num;
        num = 0;
        break;
      };
      lastop = MUL;
    } else if (*p == 'A' || *p == 'a') {
      switch (lastop) {
      case NONE:
        result = num;
        num = 0;
        break;
      case ADD:
        result += num;
        num = 0;
        break;
      case SUB:
        result -= num;
        num = 0;
        break;
      case MUL:
        result *= num;
        num = 0;
        break;
      case DIV:
        result /= num;
        num = 0;
        break;
      };
      lastop = ADD;
    } else if (*p == '#') {
      switch (lastop) {
      case NONE:
        result = num;
        num = 0;
        break;
      case ADD:
        result += num;
        num = 0;
        break;
      case SUB:
        result -= num;
        num = 0;
        break;
      case MUL:
        result *= num;
        num = 0;
        break;
      case DIV:
        result /= num;
        num = 0;
        break;
      };
      return (result);
    }
  }
  return (result);
}
```