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

```asm
<editDistance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,-0x50(%rbp)
  mov    %eax,%r14d
  call   <strlen@plt>
  movslq %eax,%r13
  cmp    %r13d,%r14d
  jge    L112
  mov    %r15,%rax
  mov    %r13d,-0x50(%rbp)
  mov    %rbx,%r15
  movslq %r14d,%r13
  mov    %rax,%rbx
L112:
  lea    0x1(%r13),%eax
  mov    %rsp,%rdx
  cltq
  lea    0xf(,%rax,4),%rcx
  mov    %rcx,%rsi
  mov    %rcx,%rax
  and    $0xfffffffffffff000,%rsi
  and    $0xfffffffffffffff0,%rax
  sub    %rsi,%rdx
  cmp    %rdx,%rsp
  je     L92
L118:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L118
L92:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L108
L167:
  movslq %r13d,%rax
  mov    %rsp,%r14
  mov    %rax,-0x58(%rbp)
  xor    %eax,%eax
  test   %r13d,%r13d
  js     L48
  cs nopw 0x0(%rax,%rax,1)
L29:
  mov    %eax,(%r14,%rax,4)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    -0x58(%rbp),%rdx
  jne    L29
L48:
  mov    %rcx,%rax
  mov    %rsp,%rdx
  and    $0xfffffffffffff000,%rcx
  sub    %rcx,%rdx
  and    $0xfffffffffffffff0,%rax
  cmp    %rdx,%rsp
  je     L156
L123:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdx,%rsp
  jne    L123
L156:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L20
L126:
  mov    -0x50(%rbp),%eax
  mov    %rsp,%r12
  test   %eax,%eax
  jle    L161
  xor    %eax,%eax
  test   %r13d,%r13d
  movl   $0x1,-0x4c(%rbp)
  cmovns %r13,%rax
  lea    0x4(,%rax,4),%rax
  mov    %rax,-0x60(%rbp)
  nopw   0x0(%rax,%rax,1)
L83:
  mov    -0x4c(%rbp),%eax
  mov    %eax,(%r12)
  test   %r13d,%r13d
  jle    L160
  mov    $0x1,%ecx
  nopl   (%rax)
L190:
  mov    -0x4(%r14,%rcx,4),%edi
  movzbl -0x1(%rbx,%rcx,1),%eax
  cmp    %al,(%r15)
  je     L202
  mov    -0x4(%r12,%rcx,4),%edx
  mov    (%r14,%rcx,4),%esi
  mov    %rcx,-0x48(%rbp)
  call   <min@plt>
  mov    -0x48(%rbp),%rcx
  lea    0x1(%rax),%edi
L202:
  mov    %edi,(%r12,%rcx,4)
  add    $0x1,%rcx
  cmp    %ecx,%r13d
  jge    L190
  mov    -0x4c(%rbp),%edx
  xor    %eax,%eax
  jmp    L192
  nopl   0x0(%rax)
L172:
  mov    (%r12,%rax,4),%edx
L192:
  mov    %edx,(%r14,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jge    L172
L67:
  mov    -0x60(%rbp),%rdx
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <memset@plt>
L107:
  addl   $0x1,-0x4c(%rbp)
  add    $0x1,%r15
  mov    -0x4c(%rbp),%eax
  cmp    %eax,-0x50(%rbp)
  jge    L83
L161:
  mov    -0x58(%rbp),%rax
  mov    (%r14,%rax,4),%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L136
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax)
L160:
  jne    L107
  mov    -0x4c(%rbp),%eax
  mov    %eax,(%r14)
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L20:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L126
L108:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L167
L136:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int editDistance(char a[], char b[]) {
  int aLength = strlen(a), bLength = strlen(b);
  int i, j;
  if (aLength < bLength) {
    char *tempPointer = a;
    a = b;
    b = tempPointer;
    int temp = aLength;
    aLength = bLength;
    bLength = temp;
  }
  int prev[bLength + 1];
  for (j = 0; j <= bLength; ++j) {
    prev[j] = j;
  }
  int curr[bLength + 1];
  for (i = 1; i <= aLength; ++i) {
    curr[0] = i;
    for (j = 1; j <= bLength; ++j) {
      if (a[i - 1] == b[j - 1]) {
        curr[j] = prev[j - 1];
      } else {
        curr[j] = 1 + min(prev[j - 1], prev[j], curr[j - 1]);
      }
    }
    for (j = 0; j <= bLength; ++j) {
      prev[j] = curr[j];
      curr[j] = 0;
    }
  }
  return prev[bLength];
}
```