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

```asm
<window_calc>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rdi)
  movq   $0x0,(%rsp)
  je     L146
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  mov    %rsp,%r13
L259:
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L407
  add    $0x1,%rbp
  test   %ebx,%ebx
  je     L288
  xor    %r14d,%r14d
L48:
  cmp    $0x2d,%ebx
  je     L256
  jg     L235
  cmp    $0x2a,%ebx
  jne    L310
  imul   %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  je     L206
L368:
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L80
  add    $0x1,%rbp
  xor    %ebx,%ebx
L332:
  cmpb   $0x0,0x0(%rbp)
  jne    L259
L206:
  mov    %r12d,%r14d
L182:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L309
  add    $0x10,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L235:
  cmp    $0x2f,%ebx
  jne    L126
  mov    %r12d,%eax
  cltd
  idiv   %r14d
  cmpb   $0x0,0x0(%rbp)
  mov    %eax,%r12d
  je     L206
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L210
L80:
  xor    %ebx,%ebx
L407:
  movsbl 0x0(%rbp),%edi
  cmp    $0x68,%dil
  je     L197
  cmp    $0x77,%dil
  jne    L71
  mov    D12(%rip),%rax
  add    $0x1,%rbp
  mov    (%rax),%r14d
L287:
  test   %ebx,%ebx
  jne    L48
  movzbl 0x0(%rbp),%eax
  test   %r14d,%r14d
  je     L409
  test   %al,%al
  je     L182
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L181
  add    $0x1,%rbp
  mov    %r14d,%r12d
  jmp    L332
  xchg   %ax,%ax
L310:
  cmp    $0x2b,%ebx
  jne    L126
  add    %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  jne    L368
  jmp    L206
  nopl   0x0(%rax,%rax,1)
L197:
  mov    D13(%rip),%rax
  add    $0x1,%rbp
  mov    (%rax),%r14d
  jmp    L287
L71:
  call   <isdigit@plt>
  test   %rax,%rax
  je     L69
  mov    %rbp,%rdi
  mov    $0xa,%edx
  mov    %r13,%rsi
  call   <strtoul@plt>
  mov    (%rsp),%rbp
  mov    %eax,%r14d
  jmp    L287
  nopw   0x0(%rax,%rax,1)
L210:
  add    $0x1,%rbp
L288:
  cmpb   $0x0,0x0(%rbp)
  je     L206
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  xor    %ebx,%ebx
  call   <isspace@plt>
  test   %rax,%rax
  je     L407
  add    $0x1,%rbp
  jmp    L332
  nopl   0x0(%rax,%rax,1)
L256:
  sub    %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  je     L206
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L80
  cmpb   $0x0,0x1(%rbp)
  je     L206
  movq   $0x0,(%rsp)
  movsbl 0x1(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L279
  add    $0x2,%rbp
  xor    %ebx,%ebx
  jmp    L332
L409:
  test   %al,%al
  je     L206
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L210
  mov    %r12d,%r14d
  nop
L181:
  mov    %r14d,%r12d
  jmp    L407
  nopl   0x0(%rax,%rax,1)
L69:
  movsbl 0x0(%rbp),%ebx
  add    $0x1,%rbp
  jmp    L332
  nopl   (%rax)
L279:
  add    $0x1,%rbp
  xor    %ebx,%ebx
  jmp    L407
L146:
  xor    %r14d,%r14d
  jmp    L182
L309:
  call   <__stack_chk_fail@plt>
L126:
  or     $0xffffffff,%r14d
  jmp    L182
```

assistant: ```c
int window_calc(char *e) {
  int result = 0, tmp = 0, op = 0;
  char *s = NULL;
  while (*e != '\0') {
    tmp = 0;
    s = NULL;
    if (isspace(*e))
      e++;
    else if (*e == 'h') {
      e++;
      tmp = LINES;
    } else if (*e == 'w') {
      e++;
      tmp = COLS;
    } else if (isdigit(*e)) {
      tmp = strtoul(e, &s, 10);
      e = s;
    } else {
      op = *e++;
      continue;
    }
    if (op) {
      switch (op) {
      case '+':
        result += tmp;
        op = 0;
        break;
      case '-':
        result -= tmp;
        op = 0;
        break;
      case '*':
        result *= tmp;
        op = 0;
        break;
      case '/':
        result /= tmp;
        op = 0;
        break;
      default:
        return -1;
      }
    } else if (tmp)
      result = tmp;
  }
  return result;
}
```