user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r13
  lea    D29(%rip),%r13
  push   %r12
  lea    D14(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rsi
  lea    0x14(%rsp),%rbp
  call   <scanf@plt>
  mov    %rbp,%rsi
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  lea    0x10(%rsp),%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L153
  mov    0x10(%rsp),%esi
  mov    %r12,%rdi
  add    0xc(%rsp),%esi
  call   <printf@plt>
L45:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L83
L155:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L103
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L153:
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L140
L106:
  lea    D68(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L133
L100:
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L77
  mov    0x10(%rsp),%ecx
  test   %ecx,%ecx
  je     L17
  mov    0xc(%rsp),%eax
  mov    %r12,%rdi
  cltd
  idiv   %ecx
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
L77:
  lea    D92(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L45
  mov    0x10(%rsp),%ecx
  test   %ecx,%ecx
  je     L149
  mov    0xc(%rsp),%eax
  mov    %r12,%rdi
  cltd
  idiv   %ecx
  xor    %eax,%eax
  mov    %edx,%esi
  call   <printf@plt>
  jmp    L45
L83:
  lea    D44(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L155
  lea    D68(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L155
  lea    D64(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L155
  lea    D92(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L155
  lea    D132(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L155
L149:
  lea    D132(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L45
L17:
  lea    D132(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L77
L133:
  mov    0xc(%rsp),%esi
  imul   0x10(%rsp),%esi
  mov    %r12,%rdi
  call   <printf@plt>
  jmp    L100
L140:
  mov    0xc(%rsp),%esi
  mov    %r12,%rdi
  sub    0x10(%rsp),%esi
  call   <printf@plt>
  jmp    L106
L103:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D29
data_type: string
name: disassemble_data
arguments: data_label: D14
data_type: string
name: disassemble_data
arguments: data_label: D9
data_type: string
name: disassemble_data
arguments: data_label: D44
data_type: string
name: disassemble_data
arguments: data_label: D68
data_type: string
name: disassemble_data
arguments: data_label: D64
data_type: string
name: disassemble_data
arguments: data_label: D92
data_type: string
name: disassemble_data
arguments: data_label: D132
data_type: string

tool: D29: add

tool: D14: %d

tool: D9: %s

tool: D44: sub

tool: D68: mul

tool: D64: div

tool: D92: mod

tool: D132: error

assistant: ```c
int main() {
  int chislo1, chislo2, izhod;
  char znak[4];
  scanf("%d", &chislo1);
  scanf("%s", znak);
  scanf("%d", &chislo2);
  if (strcmp(znak, "add") == 0) {
    izhod = chislo1 + chislo2;
    printf("%d", izhod);
  } else {
    if (strcmp(znak, "sub") == 0) {
      izhod = chislo1 - chislo2;
      printf("%d", izhod);
    }
    if (strcmp(znak, "mul") == 0) {
      izhod = chislo1 * chislo2;
      printf("%d", izhod);
    }
    if (strcmp(znak, "div") == 0) {
      if (chislo2 != 0) {
        izhod = chislo1 / chislo2;
        printf("%d", izhod);
      } else {
        printf("error");
      }
    }
    if (strcmp(znak, "mod") == 0) {
      if (chislo2 != 0) {
        izhod = chislo1 % chislo2;
        printf("%d", izhod);
      } else {
        printf("error");
      }
    }
  }
  if (strcmp(znak, "add") != 0 && strcmp(znak, "sub") != 0 && strcmp(znak, "mul") != 0 && strcmp(znak, "div") != 0 && strcmp(znak, "mod") != 0) {
    printf("error");
  }
  return 0;
}
```