user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<optim_>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    %r9,-0x40(%rbp)
  subq   $0x8,-0x18(%rbp)
  subq   $0x8,-0x20(%rbp)
  subq   $0x8,-0x28(%rbp)
  subq   $0xc,0x20(%rbp)
  subq   $0x4,-0x38(%rbp)
  subq   $0x4,-0x40(%rbp)
  subq   $0x4,0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,D417(%rip)
  mov    0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,D585(%rip)
  mov    D417(%rip),%eax
  test   %eax,%eax
  js     L111
  mov    D585(%rip),%eax
  test   %eax,%eax
  jle    L111
  movl   $0x0,D46(%rip)
  mov    D417(%rip),%eax
  test   %eax,%eax
  je     L14
  nop
L243:
  mov    D46(%rip),%edx
  mov    D585(%rip),%eax
  cmp    %eax,%edx
  je     L63
  mov    D46(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D181(%rip)
  movl   $0x0,D181(%rip)
  mov    D417(%rip),%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x1,D546(%rip)
  jmp    L34
L227:
  mov    D546(%rip),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D173(%rip)
  mov    D546(%rip),%eax
  add    %eax,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D634(%rip)
  mov    D173(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D473(%rip)
  mov    D473(%rip),%eax
  mov    %eax,D435(%rip)
  mov    D435(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D514(%rip)
L85:
  mov    D514(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    D634(%rip),%eax
  cmp    %eax,%edx
  je     L146
  mov    D514(%rip),%eax
  mov    %eax,D512(%rip)
  mov    D512(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D512(%rip)
  mov    D512(%rip),%edx
  mov    D473(%rip),%eax
  cmp    %eax,%edx
  je     L173
  jmp    L85
L173:
  mov    D512(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    D634(%rip),%eax
  cmp    %eax,%edx
  jne    L33
  mov    D512(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  js     L164
  jmp    L82
L146:
  nop
L82:
  mov    D512(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D512(%rip)
  mov    D512(%rip),%eax
  test   %eax,%eax
  js     L62
  mov    D512(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,D457(%rip)
  mov    D457(%rip),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,D457(%rip)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    -0x20(%rbp),%rdx
  lea    0x8(%rdx),%rcx
  mov    -0x18(%rbp),%rdx
  add    $0x8,%rdx
  sub    $0x8,%rsp
  push   %rax
  mov    %rcx,%r9
  mov    %rdx,%r8
  lea    D634(%rip),%rax
  mov    %rax,%rcx
  lea    D173(%rip),%rax
  mov    %rax,%rdx
  lea    D512(%rip),%rax
  mov    %rax,%rsi
  lea    D457(%rip),%rax
  mov    %rax,%rdi
  call   <swptst_@plt>
  add    $0x10,%rsp
  test   %eax,%eax
  je     L223
  mov    0x10(%rbp),%rax
  add    $0x4,%rax
  mov    -0x40(%rbp),%rdx
  lea    0x4(%rdx),%rsi
  mov    -0x38(%rbp),%rdx
  lea    0x4(%rdx),%rcx
  lea    D156(%rip),%rdx
  push   %rdx
  push   %rax
  mov    %rsi,%r9
  mov    %rcx,%r8
  lea    D634(%rip),%rax
  mov    %rax,%rcx
  lea    D173(%rip),%rax
  mov    %rax,%rdx
  lea    D512(%rip),%rax
  mov    %rax,%rsi
  lea    D457(%rip),%rax
  mov    %rax,%rdi
  call   <swap_@plt>
  add    $0x10,%rsp
  mov    D156(%rip),%eax
  test   %eax,%eax
  je     L188
  movl   $0x1,D181(%rip)
  mov    D546(%rip),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rax,%rdx
  mov    D457(%rip),%eax
  mov    %eax,(%rdx)
  mov    D546(%rip),%eax
  add    %eax,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rax,%rdx
  mov    D512(%rip),%eax
  mov    %eax,(%rdx)
  jmp    L232
L164:
  nop
  jmp    L232
L62:
  nop
  jmp    L232
L223:
  nop
L232:
  mov    D546(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D638(%rip)
L34:
  mov    D638(%rip),%eax
  cmp    %eax,-0x8(%rbp)
  jge    L227
  mov    D181(%rip),%eax
  test   %eax,%eax
  je     L154
  jmp    L243
L14:
  nop
  jmp    L160
L154:
  nop
L160:
  mov    D181(%rip),%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    0x28(%rbp),%rax
  movl   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L93
L63:
  nop
  mov    D585(%rip),%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    0x28(%rbp),%rax
  movl   $0x1,(%rax)
  mov    $0x0,%eax
  jmp    L93
L111:
  nop
  mov    0x18(%rbp),%rax
  movl   $0x0,(%rax)
  mov    0x28(%rbp),%rax
  movl   $0x2,(%rax)
  mov    $0x0,%eax
  jmp    L93
L33:
  nop
  mov    D181(%rip),%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    0x28(%rbp),%rax
  movl   $0x3,(%rax)
  mov    $0x0,%eax
  jmp    L93
L188:
  nop
  mov    D181(%rip),%edx
  mov    0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    0x28(%rbp),%rax
  movl   $0x4,(%rax)
  mov    $0x0,%eax
L93:
  leave
  ret
```

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