user: 请将以下的汇编代码转换成C语言代码:

```asm
<optim_>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    (%rcx),%r12d
  mov    0x78(%rsp),%rax
  mov    %rdx,0x18(%rsp)
  mov    %r12d,%edx
  mov    %rdi,0x8(%rsp)
  mov    (%rax),%eax
  mov    %rsi,0x10(%rsp)
  mov    %r8,0x20(%rsp)
  test   %eax,%eax
  mov    %eax,D64(%rip)
  setle  %al
  shr    $0x1f,%edx
  mov    %r9,0x28(%rsp)
  or     %dl,%al
  mov    %r12d,D25(%rip)
  jne    L30
  movl   $0x0,D277(%rip)
  test   %r12d,%r12d
  je     L62
  mov    0x80(%rsp),%rax
  mov    %r12d,0x4(%rsp)
  lea    -0x4(%r8),%rbx
  lea    -0x4(%r9),%rbp
  lea    -0xc(%rax),%r15
  xor    %eax,%eax
L149:
  mov    0x4(%rsp),%r10d
  add    $0x1,%eax
  movl   $0x0,D318(%rip)
  mov    %eax,D306(%rip)
  movl   $0x1,D306(%rip)
  test   %r10d,%r10d
  jle    L48
  mov    $0x1,%r9d
  lea    D241(%rip),%r13
  lea    D133(%rip),%r12
  nopw   0x0(%rax,%rax,1)
L164:
  lea    (%r9,%r9,1),%eax
  xor    %r8d,%r8d
  cltq
  add    $0x1,%rax
  movslq (%r15,%rax,4),%rdx
  mov    %edx,D209(%rip)
  mov    0x4(%r15,%rax,4),%edi
  mov    0x70(%rsp),%rax
  mov    %edi,D209(%rip)
  movslq -0x4(%rax,%rdx,4),%r11
  mov    0x0(%rbp,%r11,4),%r10d
  mov    %r11d,D268(%rip)
  mov    %r11,%rsi
  mov    %r10d,D291(%rip)
  mov    %r10d,%eax
  jmp    L122
  nop
L212:
  movslq 0x0(%rbp,%rdx,4),%rdx
  mov    $0x1,%r8d
  mov    %eax,%r14d
  cmp    %edx,%esi
  je     L86
  mov    %edx,%eax
L122:
  movslq %eax,%rdx
  mov    (%rbx,%rdx,4),%ecx
  cmp    %ecx,%edi
  jne    L212
  test   %r8b,%r8b
  je     L58
  mov    %r14d,D156(%rip)
  movslq %r14d,%rdx
  mov    %eax,D156(%rip)
  mov    (%rbx,%rdx,4),%ecx
  movslq %eax,%rdx
L83:
  mov    %ecx,D156(%rip)
  test   %ecx,%ecx
  js     L55
  movslq 0x0(%rbp,%rdx,4),%rax
  lea    D156(%rip),%rdi
  lea    D209(%rip),%rcx
  mov    %r12,%rsi
  mov    (%rbx,%rax,4),%edx
  mov    %eax,D364(%rip)
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  sub    $0x8,%rsp
  mov    %r13,%rdx
  push   0x20(%rsp)
  mov    0x20(%rsp),%r9
  mov    0x18(%rsp),%r8
  mov    %eax,D364(%rip)
  call   <swptst_@plt>
  pop    %r8
  lea    D364(%rip),%rdi
  pop    %r9
  test   %eax,%eax
  je     L158
  lea    D364(%rip),%rax
  lea    D209(%rip),%rcx
  mov    %r12,%rsi
  mov    %r13,%rdx
  push   %rax
  push   0x78(%rsp)
  mov    0x38(%rsp),%r9
  mov    0x30(%rsp),%r8
  call   <swap_@plt>
  mov    D364(%rip),%edi
  pop    %rcx
  pop    %rsi
  test   %edi,%edi
  je     L137
  mov    D306(%rip),%r9d
  mov    D364(%rip),%edx
  movl   $0x1,D318(%rip)
  lea    (%r9,%r9,1),%eax
  cltq
  add    $0x1,%rax
  mov    %edx,(%r15,%rax,4)
  mov    D156(%rip),%edx
  mov    %edx,0x4(%r15,%rax,4)
L55:
  add    $0x1,%r9d
  mov    %r9d,D355(%rip)
  cmp    0x4(%rsp),%r9d
  jle    L164
  mov    D318(%rip),%edx
  mov    D306(%rip),%eax
  test   %edx,%edx
  je     L48
  cmp    %eax,D355(%rip)
  je     L172
  mov    D25(%rip),%edi
  mov    %edi,0x4(%rsp)
  jmp    L149
  nopl   (%rax)
L86:
  mov    %eax,D355(%rip)
  mov    (%rbx,%r11,4),%eax
  mov    %esi,D355(%rip)
  mov    %eax,%esi
  neg    %esi
  cmovs  %eax,%esi
  cmp    %esi,%edi
  jne    L49
  test   %eax,%eax
  jns    L83
L158:
  mov    D355(%rip),%r9d
  jmp    L55
  nopl   0x0(%rax)
L58:
  mov    (%rbx,%r11,4),%ecx
  movslq %r10d,%rdx
  jmp    L83
L30:
  xor    %r12d,%r12d
  mov    $0x2,%edx
L117:
  mov    0x78(%rsp),%rax
  mov    %r12d,(%rax)
  mov    0x88(%rsp),%rax
  mov    %edx,(%rax)
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L49:
  mov    D306(%rip),%r12d
  mov    $0x3,%edx
  jmp    L117
L48:
  mov    %eax,%r12d
L62:
  xor    %edx,%edx
  jmp    L117
L137:
  mov    D306(%rip),%r12d
  mov    $0x4,%edx
  jmp    L117
L172:
  mov    %eax,%r12d
  mov    $0x1,%edx
  jmp    L117
```

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;
}
```