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

```asm
<levenshtein>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,%r12
  mov    %edx,0x1c(%rsp)
  mov    %ecx,%r14d
  mov    %r8d,%r15d
  mov    %r9d,%r13d
  call   <strlen@plt>
  mov    %eax,0xc(%rsp)
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,0x18(%rsp)
  lea    0x4(,%rax,4),%ebx
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,(%rsp)
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%rsi
  mov    0x18(%rsp),%edi
  test   %edi,%edi
  js     L92
  mov    %rbp,%rax
  mov    %edi,%edx
  lea    0x4(%rbp,%rdx,4),%rcx
  mov    $0x0,%edx
L110:
  mov    %edx,(%rax)
  add    %r15d,%edx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L110
L92:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L12
  mov    0x10(%rsp),%rbx
  mov    %eax,%r11d
  mov    %r13d,%r9d
  mov    $0x0,%edi
  mov    0x18(%rsp),%r8d
  mov    %rsi,%r10
  mov    %r11,0x10(%rsp)
  jmp    L137
L24:
  mov    %r13d,%eax
  add    0x4(%rbp,%rdx,4),%eax
  mov    (%rsi),%r11d
  cmp    %r11d,%eax
  cmovg  %r11d,%eax
  mov    %r15d,%r11d
  add    -0x4(%rsi),%r11d
  cmp    %r11d,%eax
  cmovg  %r11d,%eax
  mov    %eax,(%rsi)
  add    $0x1,%rdx
  add    $0x4,%rcx
  cmp    %r8,%rdx
  je     L125
L58:
  movzbl (%r12,%rdx,1),%eax
  cmp    %al,(%rbx)
  setne  %al
  movzbl %al,%eax
  imul   %r14d,%eax
  add    0x0(%rbp,%rdx,4),%eax
  mov    %rcx,%rsi
  mov    %eax,(%rcx)
  test   %edi,%edi
  jle    L24
  test   %edx,%edx
  jle    L24
  movzbl (%r12,%rdx,1),%r9d
  cmp    %r9b,-0x1(%rbx)
  jne    L24
  movzbl -0x1(%r12,%rdx,1),%r9d
  cmp    %r9b,(%rbx)
  jne    L24
  mov    (%rsp),%r9
  mov    0x1c(%rsp),%r11d
  add    -0x4(%r9,%rdx,4),%r11d
  cmp    %r11d,%eax
  jle    L24
  mov    %r11d,(%rcx)
  jmp    L24
L125:
  mov    0xc(%rsp),%r9d
L105:
  add    $0x1,%rdi
  add    %r13d,%r9d
  add    $0x1,%rbx
  cmp    0x10(%rsp),%rdi
  je     L84
  mov    (%rsp),%rax
  mov    %rbp,(%rsp)
  mov    %r10,%rbp
  mov    %rax,%r10
L137:
  mov    %r9d,(%r10)
  cmpl   $0x0,0x18(%rsp)
  jle    L105
  lea    0x4(%r10),%rcx
  mov    $0x0,%edx
  mov    %r9d,0xc(%rsp)
  jmp    L58
L84:
  mov    %r10,%rsi
L43:
  movslq 0x18(%rsp),%rax
  mov    %rsi,%r14
  mov    (%rsi,%rax,4),%ebx
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    %ebx,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  mov    %rbp,%rax
  mov    (%rsp),%rbp
  mov    %rsi,(%rsp)
  mov    %rax,%rsi
  jmp    L43
```

assistant: ```c
int levenshtein(const char *string1, const char *string2, int w, int s, int a, int d) {
  int len1 = strlen(string1), len2 = strlen(string2);
  int *row0 = malloc(sizeof(int) * (len2 + 1));
  int *row1 = malloc(sizeof(int) * (len2 + 1));
  int *row2 = malloc(sizeof(int) * (len2 + 1));
  int i, j;
  for (j = 0; j <= len2; j++) {
    row1[j] = j * a;
  }
  for (i = 0; i < len1; i++) {
    int *dummy;
    row2[0] = (i + 1) * d;
    for (j = 0; j < len2; j++) {
      row2[j + 1] = row1[j] + s * (string1[i] != string2[j]);
      if (i > 0 && j > 0 && string1[i - 1] == string2[j] && string1[i] == string2[j - 1] && row2[j + 1] > row0[j - 1] + w) {
        row2[j + 1] = row0[j - 1] + w;
      }
      if (row2[j + 1] > row1[j + 1] + d) {
        row2[j + 1] = row1[j + 1] + d;
      }
      if (row2[j + 1] > row2[j] + a) {
        row2[j + 1] = row2[j] + a;
      }
    }
    dummy = row0;
    row0 = row1;
    row1 = row2;
    row2 = dummy;
  }
  i = row1[len2];
  free(row0);
  free(row1);
  free(row2);
  return i;
}
```