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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    $0x2,%edi
  jle    L180
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  call   <atoi@plt>
  mov    0x10(%rbx),%rdi
  mov    %eax,%r14d
  call   <atoi@plt>
  movslq %r14d,%rbx
  mov    %eax,%edi
  call   <omp_set_num_threads@plt>
  mov    %r14d,%edi
  imul   %r14d,%edi
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %r14d,%r14d
  jle    L179
  movsd  D8(%rip),%xmm3
  xor    %r13d,%r13d
  xor    %ebp,%ebp
  movdqa D124(%rip),%xmm5
  movapd D8(%rip),%xmm2
  movdqa D114(%rip),%xmm4
  lea    -0x1(%r14),%r15d
  nopl   0x0(%rax)
L216:
  cmp    %ebp,%r15d
  mov    %ebp,%esi
  cmovle %r15d,%esi
  lea    0x1(%rsi),%edi
  cmp    $0x2,%esi
  jle    L448
  movslq %r13d,%rax
  movdqa D79(%rip),%xmm1
  lea    (%r12,%rax,8),%rdx
  mov    %edi,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%ecx
  lea    0x20(%rdx),%rax
  shl    $0x5,%rcx
  add    %rax,%rcx
  jmp    L189
  nopl   0x0(%rax)
L299:
  add    $0x20,%rax
L189:
  movdqa %xmm1,%xmm0
  movups %xmm2,(%rdx)
  paddd  %xmm5,%xmm1
  movups %xmm2,0x10(%rdx)
  paddd  %xmm4,%xmm0
  mov    %rax,%rdx
  cmp    %rcx,%rax
  jne    L299
  mov    %edi,%edx
  pshufd $0xff,%xmm0,%xmm0
  and    $0xfffffffc,%edx
  and    $0x3,%edi
  movd   %xmm0,%eax
  je     L9
L268:
  lea    0x0(%r13,%rdx,1),%eax
  cltq
  movsd  %xmm3,(%r12,%rax,8)
  lea    0x1(%rdx),%eax
  cmp    %esi,%eax
  jg     L9
  add    %r13d,%eax
  cltq
  movsd  %xmm3,(%r12,%rax,8)
  lea    0x2(%rdx),%eax
  cmp    %eax,%esi
  jl     L9
  add    %r13d,%eax
  cltq
  movsd  %xmm3,(%r12,%rax,8)
  lea    0x3(%rdx),%eax
L9:
  cmp    %r14d,%eax
  jge    L392
  mov    %r15d,%edx
  movslq %r13d,%rcx
  xor    %esi,%esi
  sub    %eax,%edx
  cltq
  add    %rcx,%rax
  lea    0x8(,%rdx,8),%rdx
  lea    (%r12,%rax,8),%rdi
  call   <memset@plt>
  mov    D8(%rip),%rax
  movdqa D124(%rip),%xmm5
  movapd D8(%rip),%xmm2
  movdqa D114(%rip),%xmm4
  movq   %rax,%xmm3
L392:
  lea    0x1(%rbp),%r8d
  add    %r14d,%r13d
  cmp    %r8d,%r14d
  je     L65
  mov    %r8d,%ebp
  jmp    L216
L65:
  xor    %eax,%eax
  mov    %r8d,0xc(%rsp)
  call   <omp_get_thread_num@plt>
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <dwalltime@plt>
  cmp    $0x1,%r14d
  mov    0xc(%rsp),%r8d
  movsd  %xmm0,(%rsp)
  je     L329
  lea    0x8(,%rbx,8),%r11
  lea    0x8(%r12),%r9
  mov    $0x1,%ecx
  lea    -0x8(%r11),%rdi
  lea    -0x10(%r11),%rbx
  nopl   0x0(%rax,%rax,1)
L111:
  mov    %ecx,%r10d
  lea    (%rbx,%r9,1),%rdx
  mov    %r9,%rax
  nopw   0x0(%rax,%rax,1)
L81:
  movsd  (%rax),%xmm0
  movsd  (%rdx),%xmm1
  mov    %ecx,%esi
  add    $0x8,%rax
  add    $0x1,%ecx
  movsd  %xmm1,-0x8(%rax)
  movsd  %xmm0,(%rdx)
  add    %rdi,%rdx
  cmp    %ebp,%esi
  jl     L81
  lea    0x1(%r10),%ecx
  add    %r11,%r9
  cmp    %ecx,%r8d
  jne    L111
L329:
  xor    %eax,%eax
  mov    %r8d,0xc(%rsp)
  call   <dwalltime@plt>
  subsd  (%rsp),%xmm0
  mov    %r13d,%esi
  lea    D100(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%r8d
  mov    %r12,%rax
  xor    %edx,%edx
  mov    D8(%rip),%rbx
  movq   %rbx,%xmm3
  nopl   0x0(%rax,%rax,1)
L214:
  ucomisd (%rax),%xmm3
  jp     L141
  je     L352
L141:
  xor    %r9d,%r9d
  cmp    $0x1,%r8d
  je     L387
L382:
  mov    %r14d,%edi
  mov    $0x1,%ecx
  pxor   %xmm0,%xmm0
  nopl   (%rax)
L286:
  xor    %eax,%eax
  test   %r9d,%r9d
  je     L336
  movslq %edi,%r8
L36:
  movslq %eax,%rdx
  add    %r8,%rdx
  lea    (%r12,%rdx,8),%rsi
  ucomisd (%rsi),%xmm0
  jp     L336
L411:
  jne    L336
  lea    0x1(%rax),%edx
  cmp    %eax,%ebp
  jle    L275
  add    $0x8,%rsi
  cmp    %edx,%ecx
  jle    L400
  ucomisd (%rsi),%xmm0
  mov    %edx,%eax
  jnp    L411
  nopl   0x0(%rax,%rax,1)
L336:
  lea    0x1(%rax),%edx
  cmp    %eax,%ebp
  jle    L22
L244:
  cmp    %edx,%ecx
  jle    L354
  mov    %edx,%eax
  lea    0x1(%rax),%edx
  cmp    %eax,%ebp
  jg     L244
L22:
  xor    %r9d,%r9d
L275:
  lea    0x1(%rcx),%eax
  add    %r14d,%edi
  cmp    %ebp,%ecx
  je     L320
  mov    %eax,%ecx
  jmp    L286
  nopl   0x0(%rax)
L400:
  movslq %edx,%rax
  add    %r8,%rax
  lea    (%r12,%rax,8),%rsi
  ucomisd (%rsi),%xmm3
  jp     L354
L93:
  jne    L354
  lea    0x1(%rdx),%eax
  cmp    %edx,%ebp
  jle    L275
  add    $0x8,%rsi
  cmp    %eax,%ecx
  jg     L36
  ucomisd (%rsi),%xmm3
  mov    %eax,%edx
  jnp    L93
  nopl   0x0(%rax)
L354:
  lea    0x1(%rdx),%eax
  cmp    %edx,%ebp
  jle    L22
L220:
  cmp    %eax,%ecx
  jg     L336
  mov    %eax,%edx
  lea    0x1(%rdx),%eax
  cmp    %edx,%ebp
  jg     L220
  jmp    L22
  cs nopw 0x0(%rax,%rax,1)
L352:
  lea    0x1(%rdx),%ecx
  cmp    %ebp,%edx
  jge    L317
  add    $0x8,%rax
  mov    %ecx,%edx
  jmp    L214
L317:
  sub    $0x1,%r8d
  mov    $0x1,%r9d
  jne    L382
L350:
  lea    D115(%rip),%rdi
  call   <puts@plt>
L315:
  mov    %r12,%rdi
  call   <free@plt>
L442:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L448:
  xor    %edx,%edx
  jmp    L268
L180:
  lea    D129(%rip),%rdi
  call   <puts@plt>
  jmp    L442
L320:
  test   %r9d,%r9d
  jne    L350
L387:
  lea    D31(%rip),%rdi
  call   <puts@plt>
  jmp    L315
L179:
  xor    %eax,%eax
  call   <omp_get_thread_num@plt>
  mov    %eax,%ebp
  xor    %eax,%eax
  call   <dwalltime@plt>
  xor    %eax,%eax
  movsd  %xmm0,(%rsp)
  call   <dwalltime@plt>
  subsd  (%rsp),%xmm0
  mov    %ebp,%esi
  lea    D100(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L350
```

tool_calls: name: retrieve_data
arguments: tag: D8
datatype: f64[2]
name: retrieve_data
arguments: tag: D124
datatype: byte[16]
name: retrieve_data
arguments: tag: D114
datatype: byte[16]
name: retrieve_data
arguments: tag: D79
datatype: f32[4]
name: retrieve_data
arguments: tag: D100
datatype: string
name: retrieve_data
arguments: tag: D115
datatype: string
name: retrieve_data
arguments: tag: D129
datatype: string
name: retrieve_data
arguments: tag: D31
datatype: string

tool: {"D8": [1.0,1.0]}

tool: {"D124": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D114": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D79": [0.0,1.401298464324817e-45,2.802596928649634e-45,4.203895392974451e-45]}

tool: D100: Tiempo en segundos para el thread %d: %f 


tool: D115: Resultado correcto

tool: D129: 
 Faltan argumentos:: N dimension de la matriz, T cantidad de threads 

tool: D31: Resultado erroneo

assistant: ```c
main(int argc, char *argv[]) {
  double *A;
  double temp;
  int i, j, N, tid;
  int check = 1;
  double timetick;
  if (argc < 3) {
    printf("\n Faltan argumentos:: N dimension de la matriz, T cantidad de threads \n");
    return 0;
  }
  N = atoi(argv[1]);
  int numThreads = atoi(argv[2]);
  omp_set_num_threads(numThreads);
  A = (double *)malloc(sizeof(double) * N * N);
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      if (i >= j) {
        A[i * N + j] = 1.0;
      } else {
        A[i * N + j] = 0.0;
      }
    }
  }
#pragma omp parallel default(none) private(i, j, temp, timetick, tid) shared(A, N)
  {
    tid = omp_get_thread_num();
    timetick = dwalltime();
#pragma omp for private(i, j, temp) schedule(guided) nowait
    for (i = 0; i < N; i++) {
      for (j = i + 1; j < N; j++) {
        temp = A[i * N + j];
        A[i * N + j] = A[j * N + i];
        A[j * N + i] = temp;
      }
    }
    printf("Tiempo en segundos para el thread %d: %f \n", tid, dwalltime() - timetick);
  }
  for (i = 0; i < N; i++) {
    for (j = 0; j < N; j++) {
      if (i > j) {
        check = check && (A[i * N + j] == 0.0);
      } else {
        check = check && (A[i * N + j] == 1.0);
      }
    }
  }
  if (check) {
    printf("Resultado correcto\n");
  } else {
    printf("Resultado erroneo\n");
  }
  free(A);
  return (0);
}
```