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

```asm
<main>:
  endbr64
  push   %r15
  lea    D9(%rip),%r15
  push   %r14
  lea    D40(%rip),%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x8(%rsp)
  movl   $0x0,0xc(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L4:
  cmpl   $0x1,0x8(%rsp)
  mov    0x1c(%rsp),%edx
  lea    D43(%rip),%r13
  setne  0x7(%rsp)
L107:
  cmp    $0x3,%edx
  je     L85
  cmpb   $0x0,0x7(%rsp)
  je     L85
  mov    %r15,%rdi
  lea    0x1c(%rsp),%rbx
  lea    D69(%rip),%rbp
  call   <printf@plt>
  mov    %r14,%rdi
  call   <printf@plt>
  lea    D41(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x2,%edx
  jbe    L68
  lea    D67(%rip),%r12
  nopw   0x0(%rax,%rax,1)
L31:
  mov    %r12,%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x2,%edx
  ja     L31
L68:
  cmp    $0x1,%eax
  je     L39
  mov    $0x3,%edx
  cmp    $0x2,%eax
  jne    L107
  lea    0x20(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  call   <configurar@plt>
  mov    %eax,0xc(%rsp)
  jmp    L4
  nopw   0x0(%rax,%rax,1)
L39:
  mov    0xc(%rsp),%edi
  test   %edi,%edi
  je     L67
  lea    0x20(%rsp),%rdx
  lea    0x40(%rsp),%rsi
  call   <jugar@plt>
  mov    %eax,0x8(%rsp)
  jmp    L4
L67:
  lea    D34(%rip),%rdi
  call   <printf@plt>
  jmp    L4
L85:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0xd8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D9
type_infered: string
name: read_data
arguments: label: D40
type_infered: string
name: read_data
arguments: label: D43
type_infered: string
name: read_data
arguments: label: D69
type_infered: string
name: read_data
arguments: label: D41
type_infered: string
name: read_data
arguments: label: D67
type_infered: string
name: read_data
arguments: label: D34
type_infered: string

tool: D9: 
Introdueix un d'aquests nombres per a realitzar l'accio corresponent:


tool: D40: 
	1.Jugar una partida

tool: D43: 
	3.Sortir del joc
	

tool: D69: %d

tool: D41: 
	2.Configuracio del Taulell

tool: D67: Introdueix un nombre valid: 

tool: D34: 
 Per a jugar primer has de configurar el taulell!!


assistant: ```c
int main() {
  char taulell[11][11];
  int mida = 0, op, fi = 0;
  int freq[5];
  while (op != 3 && fi != 1) {
    printf("\nIntrodueix un d'aquests nombres per a realitzar l'accio corresponent:\n");
    printf("\n\t1.Jugar una partida");
    printf("\n\t2.Configuracio del Taulell");
    printf("\n\t3.Sortir del joc\n\t");
    scanf("%d", &op);
    while (op < 1 || op > 3) {
      printf("Introdueix un nombre valid: ");
      scanf("%d", &op);
    }
    switch (op) {
    case 1:
      if (mida != 0) {
        fi = jugar(mida, taulell, freq);
      } else {
        printf("\n Per a jugar primer has de configurar el taulell!!\n");
      }
      break;
    case 2:
      mida = configurar(taulell, freq);
      break;
    default:
      break;
    }
  }
  return 0;
}
```