user: Demonstrate the C code that generates the assembly output below:

```asm
<calc_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,-0x118(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0xf0(%rbp)
  movq   $0x0,-0xe8(%rbp)
  movq   $0x0,-0xe0(%rbp)
  movq   $0x0,-0xd8(%rbp)
  movq   $0x0,-0xd0(%rbp)
  movq   $0x0,-0xc8(%rbp)
  movq   $0x0,-0xc0(%rbp)
  movq   $0x0,-0xb8(%rbp)
  movq   $0x0,-0xb0(%rbp)
  movq   $0x0,-0xa8(%rbp)
  movq   $0x0,-0xa0(%rbp)
  movq   $0x0,-0x98(%rbp)
  movl   $0x0,-0x90(%rbp)
  movb   $0x0,-0x101(%rbp)
  movq   $0x0,-0x80(%rbp)
  movq   $0x0,-0x78(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x118(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xfc(%rbp)
  movl   $0x0,-0x100(%rbp)
  jmp    L33
L84:
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L50
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L50
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L50
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L110
L50:
  mov    -0x100(%rbp),%edx
  mov    -0x118(%rbp),%rcx
  lea    -0xf0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x101(%rbp)
  jmp    L194
L110:
  addl   $0x1,-0x100(%rbp)
L33:
  mov    -0x100(%rbp),%eax
  cmp    -0xfc(%rbp),%eax
  jl     L84
L194:
  mov    -0x100(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xf8(%rbp)
  jmp    L162
L42:
  mov    -0x100(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x118(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L89
  mov    -0x100(%rbp),%eax
  sub    -0xf8(%rbp),%eax
  mov    %eax,%edx
  mov    -0xf8(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x118(%rbp),%rax
  add    %rax,%rcx
  lea    -0x80(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
L89:
  addl   $0x1,-0x100(%rbp)
L162:
  mov    -0x100(%rbp),%eax
  cmp    -0xfc(%rbp),%eax
  jl     L42
  movsbl -0x101(%rbp),%eax
  cmp    $0x2f,%eax
  je     L88
  cmp    $0x2f,%eax
  jg     L172
  cmp    $0x2d,%eax
  je     L190
  cmp    $0x2d,%eax
  jg     L172
  cmp    $0x2a,%eax
  je     L12
  cmp    $0x2b,%eax
  jne    L172
  lea    -0xf0(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  add    %ebx,%eax
  jmp    L172
L190:
  lea    -0xf0(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  jmp    L172
L12:
  lea    -0xf0(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  imul   %ebx,%eax
  jmp    L172
L88:
  lea    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0xf4(%rbp)
  cmpl   $0x0,-0xf4(%rbp)
  je     L60
  lea    -0xf0(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%ebx
  lea    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,%esi
  mov    %ebx,%eax
  cltd
  idiv   %esi
  jmp    L172
L60:
  mov    $0x0,%eax
  jmp    L172
L172:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L130
  call   <__stack_chk_fail@plt>
L130:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int calc_string(const char *s) {
  char buf1[100] = {0};
  char oper1 = 0;
  char buf2[100] = {0};
  int len = strlen(s);
  int i;
  for (i = 0; i < len; i++) {
    if (s[i] == '+' || s[i] == '-' || s[i] == '*' || s[i] == '/') {
      strncpy(buf1, s, i);
      oper1 = s[i];
      break;
    }
  }
  int start = i + 1;
  for (; i < len; i++) {
    if (s[i] == '=') {
      strncpy(buf2, &s[start], i - start);
    }
  }
  switch (oper1) {
  case '+':
    return atoi(buf1) + atoi(buf2);
  case '-':
    return atoi(buf1) - atoi(buf2);
  case '*':
    return atoi(buf1) * atoi(buf2);
  case '/': {
    int a = atoi(buf2);
    if (a)
      return atoi(buf1) / atoi(buf2);
    else
      return 0;
  }
  }
}
```