user: What is the c source code of the assembly code below?

```asm
<makeBMTable2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x61000(%rsp),%r11
L393:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L393
  sub    $0xaa8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r15d
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x61a98(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L202
  mov    %rdx,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%r13,%rdx,4),%rdx
L36:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L36
  lea    -0x1(%r15),%r14d
  test   %r14d,%r14d
  jle    L98
  movslq %r15d,%rcx
  lea    0x0(,%rcx,4),%r9
  lea    -0x4(%r13,%r9,1),%rsi
  lea    -0x2(%r15),%edi
  movslq %edi,%rax
  lea    -0x3(%rcx),%rdx
  mov    %edi,%edi
  sub    %rdi,%rdx
  mov    $0x0,%r8d
  mov    %r14d,%r10d
  jmp    L193
L202:
  jne    L11
L173:
  mov    0x61a98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L164
  add    $0x61aa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L373:
  movslq %r8d,%rdi
  mov    %eax,0x10(%rsp,%rdi,4)
  lea    0x1(%r8),%r8d
L165:
  sub    $0x1,%rax
  cmp    %rdx,%rax
  je     L135
L193:
  movzbl -0x1(%rbx,%rcx,1),%edi
  cmp    %dil,(%rbx,%rax,1)
  je     L373
  cmpl   $0xffffffff,(%rsi)
  jne    L165
  mov    %r10d,%edi
  sub    %eax,%edi
  mov    %edi,(%rsi)
  jmp    L165
L42:
  lea    0x1(%rsi),%eax
  cmp    %r8d,%eax
  jge    L244
  movslq %esi,%rcx
  lea    (%r11,%rcx,4),%rax
  lea    -0x2(%r8),%edx
  sub    %esi,%edx
  add    %rcx,%rdx
  lea    (%r10,%rdx,4),%rcx
L34:
  mov    0x4(%rax),%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L34
L244:
  sub    $0x1,%r8d
  cmpl   $0xffffffff,-0x4(%r13,%r9,4)
  je     L66
L231:
  cmp    %r8d,%esi
  jge    L298
L132:
  movslq %esi,%rax
  mov    0x10(%rsp,%rax,4),%edi
  test   %edi,%edi
  je     L42
  movslq %edi,%rax
  movzbl -0x1(%rbx,%r9,1),%ecx
  cmp    %cl,-0x1(%rbx,%rax,1)
  jne    L42
  movslq %esi,%rax
  sub    $0x1,%edi
  mov    %edi,0x10(%rsp,%rax,4)
  add    $0x1,%esi
  jmp    L231
L66:
  lea    -0x1(%rdi,%rbp,1),%edx
  mov    %r15d,%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%r13,%r9,4)
  jmp    L231
L298:
  test   %r8d,%r8d
  je     L270
  sub    $0x1,%r9
  test   %r9d,%r9d
  jle    L270
L47:
  mov    %r12d,%ebp
  sub    %r9d,%ebp
  mov    $0x0,%esi
  test   %r8d,%r8d
  jg     L132
  jmp    L298
L59:
  mov    %r15d,0x8(%rsp)
  movl   $0xffffffff,0xc(%rsp)
L207:
  cmpl   $0x0,0x8(%rsp)
  jle    L173
  mov    0x8(%rsp),%ebx
  movslq %ebx,%rdx
  shl    $0x2,%rdx
  lea    0x0(%r13,%rdx,1),%rax
  lea    -0x4(%r13,%rdx,1),%rdx
  lea    -0x1(%rbx),%ecx
  shl    $0x2,%rcx
  sub    %rcx,%rdx
  jmp    L291
L213:
  mov    %r15d,%eax
  sub    %ebp,%eax
  cmp    0xc(%rsp),%eax
  je     L207
  mov    %eax,-0x4(%r13,%r14,4)
  mov    %eax,0xc(%rsp)
L242:
  sub    $0x1,%r14
  cmp    (%rsp),%r14
  je     L207
L269:
  mov    %r14d,0x8(%rsp)
  cmpl   $0xffffffff,-0x4(%r13,%r14,4)
  jne    L242
  mov    %r15d,%ebp
  sub    %r14d,%ebp
  test   %ebp,%ebp
  jle    L213
  movslq %r14d,%r12
  add    %rbx,%r12
L351:
  mov    %ebp,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L213
  add    $0x1,%r12
  sub    $0x1,%ebp
  jne    L351
  jmp    L213
L411:
  sub    $0x4,%rax
  cmp    %rax,%rdx
  je     L173
L291:
  cmpl   $0xffffffff,-0x4(%rax)
  jne    L411
  mov    0xc(%rsp),%ebx
  mov    %ebx,-0x4(%rax)
  jmp    L411
L135:
  lea    -0x4(%r13,%r9,1),%rax
  cmpl   $0xffffffff,(%rax)
  je     L247
L271:
  movslq %r14d,%r9
  lea    0x1(%r15),%r12d
  lea    0x10(%rsp),%r11
  lea    0x14(%rsp),%r10
  jmp    L47
L245:
  mov    %r15d,(%rax)
  jmp    L270
L247:
  mov    %r15d,(%rax)
  jmp    L271
L11:
  lea    -0x1(%rsi),%r14d
L98:
  movslq %r15d,%rax
  lea    -0x4(%r13,%rax,4),%rax
  cmpl   $0xffffffff,(%rax)
  je     L245
L270:
  cmp    $0x1,%r15d
  jle    L59
  movslq %r14d,%r14
  movslq %r15d,%rax
  sub    $0x2,%rax
  lea    -0x2(%r15),%edx
  sub    %rdx,%rax
  mov    %rax,(%rsp)
  movl   $0xffffffff,0xc(%rsp)
  jmp    L269
L164:
  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;
  }
}
```