user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x18(%rbp),%rcx
  lea    -0xb(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    -0xb(%rbp),%rax
  lea    D107(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L44
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L11
L44:
  lea    -0xb(%rbp),%rax
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L137
  mov    -0x1c(%rbp),%eax
  mov    -0x18(%rbp),%edx
  sub    %edx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L11
L137:
  lea    -0xb(%rbp),%rax
  lea    D19(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L114
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L11
L114:
  lea    -0xb(%rbp),%rax
  lea    D106(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L47
  mov    -0x1c(%rbp),%eax
  mov    -0x18(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jne    L11
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x1,-0x10(%rbp)
  jmp    L11
L47:
  lea    -0xb(%rbp),%rax
  lea    D98(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L8
  mov    -0x1c(%rbp),%eax
  mov    -0x18(%rbp),%ecx
  cltd
  idiv   %ecx
  mov    %edx,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jne    L11
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x1,-0x10(%rbp)
  jmp    L11
L8:
  lea    D67(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x1,-0x10(%rbp)
L11:
  cmpl   $0x0,-0x10(%rbp)
  jne    L7
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D109(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L7:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L36
  call   <__stack_chk_fail@plt>
L36:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D83
type_guessed: string
name: unpack_data
arguments: data_tag: D8
type_guessed: string
name: unpack_data
arguments: data_tag: D107
type_guessed: string
name: unpack_data
arguments: data_tag: D16
type_guessed: string
name: unpack_data
arguments: data_tag: D19
type_guessed: string
name: unpack_data
arguments: data_tag: D106
type_guessed: string
name: unpack_data
arguments: data_tag: D3
type_guessed: string
name: unpack_data
arguments: data_tag: D98
type_guessed: string
name: unpack_data
arguments: data_tag: D67
type_guessed: string
name: unpack_data
arguments: data_tag: D109
type_guessed: string

tool: D83: Calculator


tool: D8: %d %s %d

tool: D107: add

tool: D16: sub

tool: D19: mul

tool: D106: div

tool: D3: Do not divide by 0.

tool: D98: mod

tool: D67: error

tool: D109: %d


assistant: ```c
int main() {
  int a, b, c, r;
  char op[3];
  printf("Calculator\n\n");
  scanf("%d %s %d", &a, op, &b);
  if (strcmp(op, "add") == 0) {
    c = a + b;
  } else if (strcmp(op, "sub") == 0) {
    c = a - b;
  } else if (strcmp(op, "mul") == 0) {
    c = a * b;
  } else if (strcmp(op, "div") == 0) {
    c = a / b;
    if (b == 0) {
      printf("Do not divide by 0.\n");
      r = 1;
    }
  } else if (strcmp(op, "mod") == 0) {
    c = a % b;
    if (b == 0) {
      printf("Do not divide by 0.\n");
      r = 1;
    }
  } else {
    printf("error\n");
    r = 1;
  }
  if (r == 0) {
    printf("%d\n", c);
  }
  return 0;
}
```