user: What would the C source look like for the assembly code provided here?

```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     L282
  mov    %rdi,%rbp
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  mov    %rsp,%r13
L41:
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L83
  add    $0x1,%rbp
  test   %ebx,%ebx
  je     L92
  xor    %r14d,%r14d
L236:
  cmp    $0x2d,%ebx
  je     L210
  jg     L179
  cmp    $0x2a,%ebx
  jne    L232
  imul   %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  je     L156
L137:
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L278
  add    $0x1,%rbp
  xor    %ebx,%ebx
L38:
  cmpb   $0x0,0x0(%rbp)
  jne    L41
L156:
  mov    %r12d,%r14d
L255:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  add    $0x10,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L179:
  cmp    $0x2f,%ebx
  jne    L376
  mov    %r12d,%eax
  cltd
  idiv   %r14d
  cmpb   $0x0,0x0(%rbp)
  mov    %eax,%r12d
  je     L156
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L173
L278:
  xor    %ebx,%ebx
L83:
  movsbl 0x0(%rbp),%edi
  cmp    $0x68,%dil
  je     L169
  cmp    $0x77,%dil
  jne    L0
  mov    D11(%rip),%rax
  add    $0x1,%rbp
  mov    (%rax),%r14d
L189:
  test   %ebx,%ebx
  jne    L236
  movzbl 0x0(%rbp),%eax
  test   %r14d,%r14d
  je     L139
  test   %al,%al
  je     L255
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L370
  add    $0x1,%rbp
  mov    %r14d,%r12d
  jmp    L38
  xchg   %ax,%ax
L232:
  cmp    $0x2b,%ebx
  jne    L376
  add    %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  jne    L137
  jmp    L156
  nopl   0x0(%rax,%rax,1)
L169:
  mov    D10(%rip),%rax
  add    $0x1,%rbp
  mov    (%rax),%r14d
  jmp    L189
L0:
  call   <isdigit@plt>
  test   %rax,%rax
  je     L9
  mov    %rbp,%rdi
  mov    $0xa,%edx
  mov    %r13,%rsi
  call   <strtoul@plt>
  mov    (%rsp),%rbp
  mov    %eax,%r14d
  jmp    L189
  nopw   0x0(%rax,%rax,1)
L173:
  add    $0x1,%rbp
L92:
  cmpb   $0x0,0x0(%rbp)
  je     L156
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  xor    %ebx,%ebx
  call   <isspace@plt>
  test   %rax,%rax
  je     L83
  add    $0x1,%rbp
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L210:
  sub    %r14d,%r12d
  cmpb   $0x0,0x0(%rbp)
  je     L156
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L278
  cmpb   $0x0,0x1(%rbp)
  je     L156
  movq   $0x0,(%rsp)
  movsbl 0x1(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L373
  add    $0x2,%rbp
  xor    %ebx,%ebx
  jmp    L38
L139:
  test   %al,%al
  je     L156
  movq   $0x0,(%rsp)
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L173
  mov    %r12d,%r14d
  nop
L370:
  mov    %r14d,%r12d
  jmp    L83
  nopl   0x0(%rax,%rax,1)
L9:
  movsbl 0x0(%rbp),%ebx
  add    $0x1,%rbp
  jmp    L38
  nopl   (%rax)
L373:
  add    $0x1,%rbp
  xor    %ebx,%ebx
  jmp    L83
L282:
  xor    %r14d,%r14d
  jmp    L255
L53:
  call   <__stack_chk_fail@plt>
L376:
  or     $0xffffffff,%r14d
  jmp    L255
```

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;
}
```