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

```asm
<frd_se>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x188,%rsp
  mov    0x1c0(%rsp),%rax
  mov    %r8,(%rsp)
  lea    0xf0(%rsp),%rbp
  mov    %r9,0x20(%rsp)
  mov    %rbp,%rdi
  mov    %rax,0x28(%rsp)
  mov    0x1d0(%rsp),%rax
  mov    %rax,0x30(%rsp)
  mov    0x1e0(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0x1e8(%rsp),%rax
  mov    %rax,0x40(%rsp)
  mov    0x1f0(%rsp),%rax
  mov    %rax,0x48(%rsp)
  mov    0x1f8(%rsp),%rax
  mov    %rax,0x50(%rsp)
  mov    0x200(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0x210(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    0x220(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0x228(%rsp),%rax
  mov    %rax,0x68(%rsp)
  mov    0x230(%rsp),%rax
  mov    %rax,0x70(%rsp)
  mov    0x238(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    0x260(%rsp),%rax
  mov    0x258(%rsp),%rsi
  mov    0x240(%rsp),%r13
  mov    %rax,0x18(%rsp)
  mov    0x248(%rsp),%r14
  mov    0x268(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x178(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0xf0(%rsp)
  movabs $0x100000001,%rax
  mov    %rax,0xc0(%rsp)
  mov    %rax,0xc8(%rsp)
  sub    $0x1,%rax
  mov    %rax,0xd0(%rsp)
  movabs $0x400000002,%rax
  movaps %xmm0,0x100(%rsp)
  movaps %xmm0,0x110(%rsp)
  movaps %xmm0,0x120(%rsp)
  movaps %xmm0,0x130(%rsp)
  movaps %xmm0,0x140(%rsp)
  movaps %xmm0,0x150(%rsp)
  movaps %xmm0,0x160(%rsp)
  movl   $0x312d20,0xe4(%rsp)
  movl   $0x322d20,0xe8(%rsp)
  movl   $0x332d20,0xec(%rsp)
  movl   $0x0,0x170(%rsp)
  movl   $0x4,0xa4(%rsp)
  mov    %rax,0xd8(%rsp)
  movq   $0x4,0xb8(%rsp)
  call   <strcpy@plt>
  mov    %rbp,%rdi
  lea    D29(%rip),%rsi
  call   <strcat@plt>
  mov    %rbp,%rdi
  lea    D18(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L64
L28:
  mov    $0x1,%edi
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  movl   $0x0,0x88(%rsp)
  cvtsi2sd %eax,%xmm0
  mov    D63(%rip),%rax
  mulsd  D15(%rip),%xmm0
  mov    %rax,0xb0(%rsp)
  mov    (%rsp),%rax
  mov    (%rax),%eax
  movsd  %xmm0,0xa8(%rsp)
  test   %eax,%eax
  je     L93
  movl   $0x0,0x98(%rsp)
  mov    (%r15),%r8d
  movl   $0x0,0x9c(%rsp)
  movl   $0x0,0xa0(%rsp)
  test   %r8d,%r8d
  jle    L49
  lea    -0x1(%r8),%edx
  mov    %rbx,%rax
  xor    %r15d,%r15d
  xor    %r10d,%r10d
  lea    0x4(%rbx,%rdx,4),%rsi
  xor    %r11d,%r11d
  xor    %edi,%edi
  xor    %r9d,%r9d
  xor    %ecx,%ecx
  jmp    L33
  nop
L21:
  add    $0x1,%edi
  mov    $0x1,%r11d
  mov    $0x1,%r9d
L53:
  add    $0x4,%rax
  cmp    %rax,%rsi
  je     L80
L33:
  mov    (%rax),%edx
  test   %edx,%edx
  je     L53
  add    $0x1,%ecx
  test   %edx,%edx
  jg     L21
  add    $0x4,%rax
  add    $0x1,%r10d
  mov    $0x1,%r15d
  mov    $0x1,%r9d
  cmp    %rax,%rsi
  jne    L33
L80:
  test   %r15b,%r15b
  je     L75
  mov    %r10d,0xa0(%rsp)
L75:
  test   %r11b,%r11b
  je     L14
  mov    %edi,0x9c(%rsp)
L14:
  test   %r9b,%r9b
  je     L49
  mov    %ecx,0x98(%rsp)
  nopl   0x0(%rax,%rax,1)
L49:
  lea    0x90(%rsp),%r15
  mov    %r8d,D26(%rip)
  mov    %r14,%r9
  mov    %r13,%r8
  movl   $0x1,0x94(%rsp)
  mov    %r15,%rdx
  push   0x8(%rsp)
  lea    0x9c(%rsp),%r10
  push   %r10
  lea    0xac(%rsp),%rax
  mov    %r10,0x88(%rsp)
  push   %rax
  lea    0xb8(%rsp),%rax
  push   %rax
  push   0x90(%rsp)
  lea    0xc0(%rsp),%rax
  push   %rax
  lea    0xbc(%rsp),%r11
  push   %r11
  mov    %r11,0xa8(%rsp)
  push   %rbx
  mov    0x50(%rsp),%rcx
  mov    0xa8(%rsp),%rsi
  mov    0x68(%rsp),%rdi
  call   <frdset@plt>
  add    $0x40,%rsp
  lea    D28(%rip),%rdi
  lea    0xa8(%rsp),%rcx
  lea    0xb0(%rsp),%rsi
  push   0x40(%rsp)
  push   0x40(%rsp)
  push   0x28(%rsp)
  push   %rbp
  push   0x20(%rsp)
  push   0x48(%rsp)
  push   0x88(%rsp)
  mov    0xa8(%rsp),%r11
  push   %r11
  push   0x88(%rsp)
  lea    0xd0(%rsp),%rax
  push   %rax
  mov    0xb0(%rsp),%r9
  mov    0xa0(%rsp),%r8
  mov    0x80(%rsp),%rdx
  call   <frdheader@plt>
  add    $0x50,%rsp
  lea    D83(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D78(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D55(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  sub    $0x8,%rsp
  mov    %r12,%rdi
  mov    %rbx,%r8
  lea    0xf4(%rsp),%rax
  lea    D26(%rip),%rcx
  mov    %r15,%rdx
  mov    %r12,%rsi
  push   %rax
  push   0x28(%rsp)
  push   %rbp
  lea    0x108(%rsp),%rax
  push   %rax
  mov    0xa0(%rsp),%r10
  push   %r10
  lea    0xe8(%rsp),%rax
  push   %rax
  lea    0x108(%rsp),%rax
  push   %rax
  lea    0x100(%rsp),%rax
  push   %rax
  lea    0xec(%rsp),%rax
  push   %rax
  push   0x58(%rsp)
  push   %r14
  push   %r13
  push   0x78(%rsp)
  lea    0x154(%rsp),%r9
  call   <frdselect@plt>
  add    $0x70,%rsp
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x178(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L128
  add    $0x188,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  mov    (%r15),%r8d
  mov    %r8d,0x98(%rsp)
  jmp    L49
L64:
  lea    D102(%rip),%rdi
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L28
L128:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D29
type_infered: string
name: retrieve_data
arguments: data_label: D18
type_infered: string
name: retrieve_data
arguments: data_label: D63
type_infered: f64
name: retrieve_data
arguments: data_label: D15
type_infered: f64
name: retrieve_data
arguments: data_label: D83
type_infered: string
name: retrieve_data
arguments: data_label: D78
type_infered: string
name: retrieve_data
arguments: data_label: D5
type_infered: string
name: retrieve_data
arguments: data_label: D55
type_infered: string
name: retrieve_data
arguments: data_label: D95
type_infered: string
name: retrieve_data
arguments: data_label: D102
type_infered: string

tool: D29: .frd

tool: D18: ab

tool: D63: 1

tool: D15: 4

tool: D83:  -4  SEN         4    1


tool: D78:  -5  SENDX       1    2    1    0


tool: D5:  -5  SENDY       1    2    2    0


tool: D55:  -5  SENDZ       1    2    3    0


tool: D95:  -5  SENNORM     1    2    4    0


tool: D102: *ERROR in frd: cannot open frd file for writing...

assistant: ```c
void frd_se(double *co, int *nk, double *stn, int *inum, int *nmethod, int *kode, char *filab, double *fn, double *time, int *nstate_, int *istep, int *iinc, int *mode, int *noddiam, char *description, int *mi, int *ngraph, int *ne, double *cs, char *set, int *nset, int *istartset, int *iendset, int *ialset, double *thicke, char *jobnamec, char *output, double *dgdxtotglob, int *numobject) {
  FILE *f1;
  char c[2] = "C", m1[4] = " -1", m2[4] = " -2", m3[4] = " -3", p0[6] = "    0", p1[6] = "    1", p2[6] = "    2", p3[6] = "    3", p4[6] = "    4", p5[6] = "    5", p6[6] = "    6", p7[6] = "    7", p8[6] = "    8", p9[6] = "    9", p10[6] = "   10", p11[6] = "   11", p12[6] = "   12", fneig[132] = "", date[8], clock[10], newdate[21], newclock[9], material[59] = "                                                          ", text[2] = " ";
  static int icounter = 0, nkcoords, iaxial;
  int null, one, i, j, k, indexe, nemax, nlayer, noutloc, iset, iselect, ncomp, nope, nodes, ifield[7], nfield[2], icomp[7], ifieldstate[*nstate_], two, three, icompstate[*nstate_], ip0 = 0, ip1 = 1, ip2 = 2, ip3 = 3, ip4 = 4, ip5 = 5, ip6 = 6, ip7 = 7, ip8 = 8, ip9 = 9, ip10 = 10, ip11 = 11, ip12 = 12, imat, nelout, nterms, nout, noutplus, noutmin, mt = mi[1] + 1;
  int ncomptensor = 4, ifieldtensor[4] = {1, 1, 1, 1}, icomptensor[4] = {0, 1, 2, 4}, nfieldtensor[2] = {4, 0};
  int iw;
  float ifl;
  double pi, oner;
  strcpy(fneig, jobnamec);
  strcat(fneig, ".frd");
  if ((f1 = fopen(fneig, "ab")) == NULL) {
    printf("*ERROR in frd: cannot open frd file for writing...");
    exit(0);
  }
  pi = 4. * atan(1.);
  null = 0;
  one = 1;
  two = 2;
  three = 3;
  oner = 1.;
  if (*nmethod != 0) {
    nout = 0;
    noutplus = 0;
    noutmin = 0;
    for (i = 0; i < *nk; i++) {
      if (inum[i] == 0)
        continue;
      nout++;
      if (inum[i] > 0)
        noutplus++;
      if (inum[i] < 0)
        noutmin++;
    }
  } else {
    nout = *nk;
  }
  nkcoords = *nk;
  iselect = 1;
  frdset(filab, set, &iset, istartset, iendset, ialset, inum, &noutloc, &nout, nset, &noutmin, &noutplus, &iselect, ngraph);
  frdheader(&icounter, &oner, time, &pi, noddiam, cs, &null, mode, &noutloc, description, kode, nmethod, f1, output, istep, iinc);
  fprintf(f1, " -4  SEN         4    1\n");
  fprintf(f1, " -5  SENDX       1    2    1    0\n");
  fprintf(f1, " -5  SENDY       1    2    2    0\n");
  fprintf(f1, " -5  SENDZ       1    2    3    0\n");
  fprintf(f1, " -5  SENNORM     1    2    4    0\n");
  frdselect(dgdxtotglob, dgdxtotglob, &iset, &nkcoords, inum, m1, istartset, iendset, ialset, ngraph, &ncomptensor, ifieldtensor, icomptensor, nfieldtensor, &iselect, m2, f1, output, m3);
  fclose(f1);
  return;
}
```