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

```asm
<calculate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L107
L85:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <isnumfmt@plt>
  test   %rax,%rax
  je     L137
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <atof@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L137:
  mov    -0x30(%rbp),%rax
  lea    D80(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L140
  mov    $0x0,%eax
  call   <pop@plt>
  movsd  %xmm0,-0x58(%rbp)
  mov    $0x0,%eax
  call   <pop@plt>
  movapd %xmm0,%xmm2
  addsd  -0x58(%rbp),%xmm2
  movq   %xmm2,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L140:
  mov    -0x30(%rbp),%rax
  lea    D51(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L110
  mov    $0x0,%eax
  call   <pop@plt>
  movsd  %xmm0,-0x58(%rbp)
  mov    $0x0,%eax
  call   <pop@plt>
  movapd %xmm0,%xmm3
  mulsd  -0x58(%rbp),%xmm3
  movq   %xmm3,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L110:
  mov    -0x30(%rbp),%rax
  lea    D85(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L241
  mov    $0x0,%eax
  call   <swap@plt>
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rbx
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %rbx,%xmm4
  subsd  %xmm0,%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L241:
  mov    -0x30(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L47
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L86
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  je     L254
L86:
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm5
  divsd  -0x18(%rbp),%xmm5
  movq   %xmm5,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L254:
  mov    $0x0,%eax
  call   <pop@plt>
  mov    D0(%rip),%rax
  movq   %rax,%xmm0
  call   <push@plt>
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L244
L47:
  mov    -0x30(%rbp),%rax
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L139
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L32
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  je     L207
L32:
  mov    $0x0,%eax
  call   <pop@plt>
  cvttsd2si %xmm0,%eax
  movsd  -0x20(%rbp),%xmm0
  cvttsd2si %xmm0,%ecx
  cltd
  idiv   %ecx
  mov    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L207:
  mov    $0x0,%eax
  call   <pop@plt>
  mov    D0(%rip),%rax
  movq   %rax,%xmm0
  call   <push@plt>
  lea    D112(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L244
L139:
  mov    -0x30(%rbp),%rax
  lea    D64(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L169
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  movsd  -0x28(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <pow@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L169:
  mov    -0x30(%rbp),%rax
  lea    D42(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L126
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L126:
  mov    -0x30(%rbp),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L253
  mov    $0x0,%eax
  call   <pop@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <push@plt>
  jmp    L244
L253:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L244:
  addl   $0x1,-0x3c(%rbp)
L107:
  mov    -0x3c(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L85
  mov    $0x0,%eax
  call   <gettop@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  mov    $0x0,%eax
  call   <clearstack@plt>
  movsd  -0x38(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D80
data_type: string
name: unpack_data
arguments: tag: D51
data_type: string
name: unpack_data
arguments: tag: D85
data_type: string
name: unpack_data
arguments: tag: D19
data_type: string
name: unpack_data
arguments: tag: D0
data_type: f64
name: unpack_data
arguments: tag: D112
data_type: string
name: unpack_data
arguments: tag: D16
data_type: string
name: unpack_data
arguments: tag: D64
data_type: string
name: unpack_data
arguments: tag: D42
data_type: string
name: unpack_data
arguments: tag: D10
data_type: string
name: unpack_data
arguments: tag: D65
data_type: string

tool: D80: +

tool: D51: *

tool: D85: -

tool: D19: /

tool: D0: 0

tool: D112: Error: divisor is 0

tool: D16: %

tool: D64: pow

tool: D42: exp

tool: D10: sin

tool: D65: Error: unknown token %s


assistant: ```c
double calculate(char *tokens[], int len) {
  char *t;
  int i;
  for (i = 0; i < len; i++) {
    t = tokens[i];
    if (isnumfmt(t)) {
      push(atof(t));
    } else if (!strcmp(t, "+")) {
      push(pop() + pop());
    } else if (!strcmp(t, "*")) {
      push(pop() * pop());
    } else if (!strcmp(t, "-")) {
      swap();
      push(pop() - pop());
    } else if (!strcmp(t, "/")) {
      double tmp = pop();
      if (tmp != 0) {
        push(pop() / tmp);
      } else {
        pop();
        push(0.0);
        printf("Error: divisor is 0\n");
      }
    } else if (!strcmp(t, "%")) {
      double tmp = pop();
      if (tmp != 0) {
        push((int)pop() % (int)tmp);
      } else {
        pop();
        push(0.0);
        printf("Error: divisor is 0\n");
      }
    } else if (!strcmp(t, "pow")) {
      double tmp = pop();
      push(pow(pop(), tmp));
    } else if (!strcmp(t, "exp")) {
      push(exp(pop()));
    } else if (!strcmp(t, "sin")) {
      push(sin(pop()));
    } else {
      printf("Error: unknown token %s\n", t);
    }
  }
  double rt = gettop();
  clearstack();
  return rt;
}
```