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

```asm
<makeBMTable2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x61000(%rsp),%r11
L289:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L289
  sub    $0xab8,%rsp
  mov    %esi,0xc(%rsp)
  mov    %rdi,%r14
  mov    %rdx,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x61aa8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L223
  movslq %esi,%r12
  mov    %esi,%ebx
  mov    %rbp,%rdi
  mov    $0xff,%esi
  lea    0x0(,%r12,4),%r15
  mov    %r15,%rdx
  call   <memset@plt>
  sub    $0x1,%ebx
  lea    -0x4(%rbp,%r15,1),%r11
  mov    %r12,0x10(%rsp)
  mov    %ebx,0x1c(%rsp)
  mov    (%r11),%edx
  je     L175
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%rcx
  xor    %r12d,%r12d
  lea    -0x2(%rax),%r9d
  lea    -0x3(%rcx),%rsi
  lea    -0x1(%r14,%rcx,1),%r10
  mov    %r9d,%ecx
  movslq %r9d,%rax
  sub    %rcx,%rsi
  jmp    L127
  xchg   %ax,%ax
L307:
  cmp    $0xffffffff,%edx
  jne    L69
  mov    %ebx,%edx
  sub    %eax,%edx
  mov    %edx,(%r11)
L69:
  sub    $0x1,%rax
  cmp    %rsi,%rax
  je     L104
L127:
  movzbl (%r10),%ecx
  cmp    %cl,(%r14,%rax,1)
  jne    L307
  movslq %r12d,%rdi
  add    $0x1,%r12d
  mov    %eax,0x20(%rsp,%rdi,4)
  sub    $0x1,%rax
  cmp    %rsi,%rax
  jne    L127
L104:
  cmp    $0xffffffff,%edx
  je     L240
L146:
  movslq %r9d,%r13
  lea    0x20(%rsp),%r15
  nopl   0x0(%rax)
L281:
  mov    0xc(%rsp),%eax
  sub    %r13d,%eax
  mov    %eax,0x18(%rsp)
  test   %r12d,%r12d
  je     L41
  xor    %r11d,%r11d
  jmp    L322
  nopl   0x0(%rax)
L227:
  sub    $0x1,%ebx
  mov    %eax,%r11d
  mov    %ebx,0x20(%rsp,%rdx,4)
L282:
  cmp    %r11d,%r12d
  jle    L137
L322:
  movslq %r11d,%rdx
  lea    0x1(%r11),%eax
  mov    0x20(%rsp,%rdx,4),%ebx
  test   %ebx,%ebx
  je     L369
  movslq %ebx,%rsi
  movzbl (%r14,%r13,1),%ecx
  cmp    %cl,-0x1(%r14,%rsi,1)
  je     L227
L369:
  cmp    %eax,%r12d
  jle    L348
  lea    -0x2(%r12),%edx
  cltq
  mov    %r11d,(%rsp)
  sub    %r11d,%edx
  lea    (%r15,%rax,4),%rsi
  lea    -0x4(%r15,%rax,4),%rdi
  lea    0x4(,%rdx,4),%rdx
  call   <memmove@plt>
  mov    (%rsp),%r11d
L348:
  sub    $0x1,%r12d
  cmpl   $0xffffffff,0x0(%rbp,%r13,4)
  jne    L282
  mov    0x18(%rsp),%eax
  lea    -0x1(%rax,%rbx,1),%edx
  mov    0xc(%rsp),%eax
  sub    %edx,%eax
  mov    %eax,0x0(%rbp,%r13,4)
  cmp    %r11d,%r12d
  jg     L322
  cs nopw 0x0(%rax,%rax,1)
L137:
  test   %r12d,%r12d
  je     L41
  sub    $0x1,%r13
  lea    0x1(%r13),%eax
  test   %eax,%eax
  jg     L281
L41:
  cmpl   $0x1,0xc(%rsp)
  jle    L398
  mov    0x10(%rsp),%rdx
  mov    0xc(%rsp),%eax
  movl   $0xffffffff,0x18(%rsp)
  movslq 0x1c(%rsp),%r15
  sub    $0x2,%rdx
  sub    $0x2,%eax
  sub    %rax,%rdx
  mov    %rdx,(%rsp)
  jmp    L187
  cs nopw 0x0(%rax,%rax,1)
L53:
  sub    $0x1,%r15
  cmp    %r15,(%rsp)
  je     L167
L187:
  cmpl   $0xffffffff,-0x4(%rbp,%r15,4)
  movslq %r15d,%rbx
  jne    L53
  mov    0xc(%rsp),%r12d
  sub    %r15d,%r12d
  test   %r12d,%r12d
  jle    L124
  lea    (%r14,%r15,1),%r13
  jmp    L355
  nopl   0x0(%rax)
L378:
  add    $0x1,%r13
  sub    $0x1,%r12d
  je     L316
L355:
  mov    %r12d,%edx
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L378
  mov    0xc(%rsp),%eax
  sub    %r12d,%eax
L62:
  cmp    0x18(%rsp),%eax
  je     L167
  mov    %eax,-0x4(%rbp,%r15,4)
  sub    $0x1,%r15
  mov    %eax,0x18(%rsp)
  cmp    %r15,(%rsp)
  jne    L187
  nopl   (%rax)
L167:
  cmpl   $0xffffffff,-0x4(%rbp,%rbx,4)
  jne    L226
  mov    0x18(%rsp),%eax
  mov    %eax,-0x4(%rbp,%rbx,4)
L226:
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jg     L167
L109:
  mov    0x61aa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x61ab8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L316:
  mov    0xc(%rsp),%eax
  jmp    L62
L223:
  je     L109
  movslq 0xc(%rsp),%rax
  lea    -0x1(%rax),%ecx
  lea    -0x4(%rdx,%rax,4),%r11
  mov    %rax,0x10(%rsp)
  mov    %ecx,0x1c(%rsp)
  mov    (%r11),%edx
L175:
  cmp    $0xffffffff,%edx
  jne    L41
  mov    0xc(%rsp),%eax
  mov    %eax,(%r11)
  jmp    L41
  nopw   0x0(%rax,%rax,1)
L240:
  mov    0xc(%rsp),%eax
  mov    %eax,(%r11)
  jmp    L146
L124:
  mov    %r15d,%eax
  jmp    L62
L398:
  jne    L109
  movl   $0xffffffff,0x18(%rsp)
  mov    $0x1,%ebx
  jmp    L167
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void makeBMTable2(char *pattern, int patLen, int *bmTable) {
  int sIdx1;
  int sIdx0;
  int nextIdx[100000];
  int nextIdxSize;
  int sLen;
  int curIdx1;
  int i, j;
  for (i = 0; i < patLen; i++)
    bmTable[i] = -1;
  sIdx1 = patLen;
  if (sIdx1 == 0)
    return;
  for (nextIdxSize = 0, sIdx0 = sIdx1 - 1; sIdx0 > 0; --sIdx0) {
    if (pattern[sIdx0 - 1] == pattern[sIdx1 - 1]) {
      nextIdx[nextIdxSize++] = sIdx0 - 1;
    } else if (bmTable[sIdx1 - 1] == -1) {
      bmTable[sIdx1 - 1] = patLen - sIdx0;
    }
  }
  if (bmTable[sIdx1 - 1] == -1)
    bmTable[sIdx1 - 1] = patLen;
  sLen = 2;
  for (--sIdx1; sIdx1 > 0; --sIdx1) {
    for (i = 0; i < nextIdxSize;) {
      sIdx0 = nextIdx[i];
      if (sIdx0 == 0 || pattern[sIdx0 - 1] != pattern[sIdx1 - 1]) {
        for (j = i + 1; j < nextIdxSize; j++)
          nextIdx[j - 1] = nextIdx[j];
        --nextIdxSize;
        if (bmTable[sIdx1 - 1] == -1)
          bmTable[sIdx1 - 1] = patLen - (sIdx0 + sLen - 1);
      } else {
        --nextIdx[i];
        ++i;
      }
    }
    if (nextIdxSize == 0)
      break;
    ++sLen;
  }
  sIdx1 = patLen;
  curIdx1 = -1;
  while (sIdx1 > 1) {
    --sIdx1;
    if (bmTable[sIdx1 - 1] != -1)
      continue;
    sLen = patLen - sIdx1;
    i = 0;
    while (sLen > 0) {
      if (strncmp(pattern, pattern + sIdx1 + i, sLen) == 0)
        break;
      ++i;
      --sLen;
    }
    if (curIdx1 == patLen - sLen)
      break;
    bmTable[sIdx1 - 1] = curIdx1 = patLen - sLen;
  }
  while (sIdx1 > 0) {
    if (bmTable[sIdx1 - 1] == -1)
      bmTable[sIdx1 - 1] = curIdx1;
    --sIdx1;
  }
}
```