user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbx
  sub    $0xc0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    %rsp,%rbx
  mov    %rbx,%rdi
  call   <gets@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  lea    -0x1(%rax),%eax
  lea    0x1(%rsp,%rax,1),%rcx
  cmpb   $0x20,(%rsp)
  je     L7
L32:
  mov    %rsp,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  cmpb   $0x20,(%rsp,%rdx,1)
  jne    L93
  cltq
  lea    (%rsp,%rax,1),%rax
L245:
  movb   $0x0,-0x1(%rax)
  sub    $0x1,%rax
  cmpb   $0x20,-0x1(%rax)
  je     L245
L93:
  mov    %rsp,%rdi
  call   <strlen@plt>
  mov    %eax,%r9d
  test   %eax,%eax
  jle    L84
  mov    %rsp,%rdi
  lea    -0x1(%rax),%r10d
  mov    $0x0,%r8d
  jmp    L35
L76:
  movzbl 0x1(%rax),%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L76
L70:
  cmpb   $0x20,(%rsp)
  jne    L32
L7:
  mov    %rsp,%rax
  test   %esi,%esi
  jg     L76
  jmp    L70
L118:
  movzbl 0x1(%rax),%edx
  mov    %dl,(%rax)
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L118
L121:
  cmpb   $0x20,(%rsi)
  jne    L50
L186:
  cmpb   $0x20,0x1(%rsi)
  jne    L50
  mov    %rdi,%rax
  cmp    %r8d,%r9d
  jg     L118
  jmp    L121
L50:
  add    $0x1,%r8d
  add    $0x1,%rdi
  sub    $0x1,%r10d
  cmp    %r8d,%r9d
  je     L84
L35:
  mov    %rdi,%rsi
  mov    %r10d,%eax
  lea    0x1(%rdi,%rax,1),%rcx
  cmpb   $0x20,(%rdi)
  je     L186
  jmp    L50
L84:
  mov    %rsp,%rdi
  call   <strlen@plt>
  mov    %eax,%r11d
  test   %eax,%eax
  js     L153
  mov    %rsp,%r9
  add    $0x1,%r11d
  mov    $0x0,%esi
  mov    $0x0,%r8d
  lea    0x60(%rsp),%rdi
  jmp    L172
L227:
  lea    0x1(%rdx),%esi
  movslq %edx,%rdx
  movb   $0x20,0x60(%rsp,%rdx,1)
L223:
  add    $0x1,%r8d
  add    $0x1,%r9
  cmp    %r11d,%r8d
  je     L153
L172:
  testb  $0xdf,(%r9)
  jne    L223
  movslq %esi,%rcx
  add    %rdi,%rcx
  mov    %r9,%rax
  mov    %esi,%edx
  lea    -0x1(%rsi,%r8,1),%r10d
L248:
  cmp    %edx,%r10d
  js     L227
  add    $0x1,%edx
  mov    %rax,%rsi
  movzbl -0x1(%rax),%ebx
  mov    %bl,(%rcx)
  sub    $0x1,%rax
  add    $0x1,%rcx
  cmpb   $0x20,-0x2(%rsi)
  jne    L248
  jmp    L227
L153:
  lea    0x60(%rsp),%rdi
  call   <puts@plt>
  lea    D12(%rip),%rdi
  call   <system@plt>
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L204
  mov    $0x0,%eax
  add    $0xc0,%rsp
  pop    %rbx
  ret
L204:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D1
datatype: string
name: read_data
arguments: tag: D12
datatype: string

tool: D1: entre com uma frase: 

tool: D12: pause

assistant: ```c
int main() {
  char frase[81], aux[81];
  int i, j = 0, k = 0, tam, cont = 0;
  printf("entre com uma frase: ");
  gets(frase);
  tam = strlen(frase);
  i = 0;
  while (frase[0] == ' ') {
    for (i = 0; i < tam; i++)
      frase[j++] = frase[i + 1];
    j = 0;
  }
  tam = strlen(frase);
  i = 1;
  while (frase[tam - i] == ' ') {
    frase[tam - i] = '\0';
    i++;
  }
  tam = strlen(frase);
  i = j = 0;
  for (; i < tam; i++) {
    while (frase[i] == ' ' && frase[i + 1] == ' ') {
      for (j = i; j < tam; j++)
        frase[j] = frase[j + 1];
    }
  }
  tam = strlen(frase);
  i = 0;
  for (; i <= tam; i++) {
    if (frase[i] == ' ' || frase[i] == '\0') {
      j = i - 1;
      while (j >= 0) {
        aux[k++] = frase[j];
        j--;
        if (frase[j] == ' ')
          break;
      }
      aux[k++] = ' ';
    }
  }
  printf("%s\n", aux);
  system("pause");
  return 0;
}
```