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

```asm
<optim_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x28(%rsp)
  mov    0x70(%rsp),%r15
  mov    (%rcx),%eax
  mov    %eax,D218(%rip)
  mov    0x78(%rsp),%rsi
  mov    (%rsi),%edx
  mov    %edx,D120(%rip)
  test   %edx,%edx
  setle  %cl
  mov    %eax,%edx
  shr    $0x1f,%edx
  or     %dl,%cl
  mov    %cl,0x3(%rsp)
  jne    L64
  movl   $0x0,D148(%rip)
  test   %eax,%eax
  je     L114
  mov    0x80(%rsp),%rax
  lea    -0xc(%rax),%r14
  mov    0x20(%rsp),%rax
  lea    -0x4(%rax),%rbp
  mov    0x28(%rsp),%rax
  lea    -0x4(%rax),%r12
  mov    $0x0,%eax
  mov    $0x1,%ebx
  jmp    L134
L197:
  mov    %edx,%eax
L233:
  movslq %eax,%rdx
  cmp    0x0(%rbp,%rdx,4),%ecx
  je     L196
  mov    (%r12,%rdx,4),%edx
  mov    %ebx,%r8d
  mov    %eax,%r13d
  mov    %ebx,%edi
  cmp    %edx,%esi
  jne    L197
  mov    %eax,D129(%rip)
  mov    %edx,D97(%rip)
  movslq %edx,%rdx
  mov    0x0(%rbp,%rdx,4),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  cmp    %edx,%ecx
  jne    L15
  test   %eax,%eax
  js     L2
L147:
  movslq D129(%rip),%rax
  mov    0x0(%rbp,%rax,4),%eax
  mov    %eax,D168(%rip)
  test   %eax,%eax
  js     L2
  movslq D97(%rip),%rax
  mov    (%r12,%rax,4),%eax
  mov    %eax,D38(%rip)
  cltq
  mov    0x0(%rbp,%rax,4),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %eax,D38(%rip)
  sub    $0x8,%rsp
  push   0x20(%rsp)
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%r8
  lea    D327(%rip),%rcx
  lea    D345(%rip),%rdx
  lea    D168(%rip),%rsi
  lea    D38(%rip),%rdi
  call   <swptst_@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  jne    L43
L2:
  mov    D329(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D214(%rip)
  cmp    0x4(%rsp),%eax
  jg     L113
L232:
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  mov    (%r14,%rax,4),%edx
  mov    %edx,D214(%rip)
  mov    0x4(%r14,%rax,4),%ecx
  mov    %ecx,D214(%rip)
  movslq %edx,%rdx
  mov    -0x4(%r15,%rdx,4),%esi
  mov    %esi,D214(%rip)
  movslq %esi,%rax
  mov    (%r12,%rax,4),%eax
  mov    %eax,D214(%rip)
  movzbl 0x3(%rsp),%r8d
  mov    %r8d,%edi
  jmp    L233
L196:
  test   %dil,%dil
  je     L28
  mov    %r13d,D214(%rip)
L28:
  test   %r8b,%r8b
  je     L147
  mov    %eax,D214(%rip)
  jmp    L147
L15:
  mov    D148(%rip),%edx
  mov    $0x3,%ecx
  jmp    L112
L43:
  lea    D214(%rip),%rax
  push   %rax
  push   %r15
  mov    0x38(%rsp),%r9
  mov    0x30(%rsp),%r8
  lea    D214(%rip),%rcx
  lea    D214(%rip),%rdx
  lea    D168(%rip),%rsi
  lea    D38(%rip),%rdi
  call   <swap_@plt>
  add    $0x10,%rsp
  cmpl   $0x0,D214(%rip)
  je     L19
  movl   $0x1,D185(%rip)
  mov    D214(%rip),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  mov    D38(%rip),%edx
  mov    %edx,(%r14,%rax,4)
  mov    D168(%rip),%edx
  mov    %edx,0x4(%r14,%rax,4)
  jmp    L2
L19:
  mov    D148(%rip),%edx
  mov    $0x4,%ecx
  jmp    L112
L113:
  cmpl   $0x0,D185(%rip)
  je     L114
  mov    D148(%rip),%eax
  mov    D120(%rip),%edx
  cmp    %edx,%eax
  je     L127
L134:
  add    $0x1,%eax
  mov    %eax,D317(%rip)
  movl   $0x0,D185(%rip)
  mov    D218(%rip),%eax
  mov    %eax,0x4(%rsp)
  movl   $0x1,D214(%rip)
  test   %eax,%eax
  jle    L114
  mov    $0x1,%eax
  jmp    L232
L114:
  mov    D317(%rip),%edx
  mov    $0x0,%ecx
  jmp    L112
L64:
  mov    $0x0,%edx
  mov    $0x2,%ecx
L112:
  mov    0x78(%rsp),%rax
  mov    %edx,(%rax)
  mov    0x88(%rsp),%rax
  mov    %ecx,(%rax)
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L127:
  mov    $0x1,%ecx
  jmp    L112
```

assistant: ```c
int optim_(double *x, double *y, double *z__, int *na, int *list, int *lptr, int *lend, int *nit, int *iwk, int *ier) {
  int i__1, i__2;
  static int i__, n1, n2, lp, io1, io2, nna, lp21, lpl, lpp;
  static int swp;
  static int iter;
  static int maxit;
  --x;
  --y;
  --z__;
  iwk -= 3;
  --list;
  --lptr;
  --lend;
  nna = *na;
  maxit = *nit;
  if (nna < 0 || maxit < 1) {
    goto L7;
  }
  iter = 0;
  if (nna == 0) {
    goto L5;
  }
L1:
  if (iter == maxit) {
    goto L6;
  }
  ++iter;
  swp = (0);
  i__1 = nna;
  for (i__ = 1; i__ <= i__1; ++i__) {
    io1 = iwk[(i__ << 1) + 1];
    io2 = iwk[(i__ << 1) + 2];
    lpl = lend[io1];
    lpp = lpl;
    lp = lptr[lpp];
  L2:
    if (list[lp] == io2) {
      goto L3;
    }
    lpp = lp;
    lp = lptr[lpp];
    if (lp != lpl) {
      goto L2;
    }
    if ((i__2 = list[lp], ((i__2) >= 0 ? (i__2) : -(i__2))) != io2) {
      goto L8;
    }
    if (list[lp] < 0) {
      goto L4;
    }
  L3:
    n2 = list[lpp];
    if (n2 < 0) {
      goto L4;
    }
    lp = lptr[lp];
    n1 = (i__2 = list[lp], ((i__2) >= 0 ? (i__2) : -(i__2)));
    if (!swptst_(&n1, &n2, &io1, &io2, &x[1], &y[1], &z__[1])) {
      goto L4;
    }
    swap_(&n1, &n2, &io1, &io2, &list[1], &lptr[1], &lend[1], &lp21);
    if (lp21 == 0) {
      goto L9;
    }
    swp = (1);
    iwk[(i__ << 1) + 1] = n1;
    iwk[(i__ << 1) + 2] = n2;
  L4:;
  }
  if (swp) {
    goto L1;
  }
L5:
  *nit = iter;
  *ier = 0;
  return 0;
L6:
  *nit = maxit;
  *ier = 1;
  return 0;
L7:
  *nit = 0;
  *ier = 2;
  return 0;
L8:
  *nit = iter;
  *ier = 3;
  return 0;
L9:
  *nit = iter;
  *ier = 4;
  return 0;
}
```