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

```asm
<induceSA>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbp
  mov    %rdx,(%rsp)
  mov    %rcx,%r12
  mov    %r8d,%r15d
  mov    %r9d,0xc(%rsp)
  mov    0x50(%rsp),%r14d
  cmp    %rcx,%rdx
  je     L95
L200:
  mov    $0x0,%ecx
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  mov    (%rsp),%rdi
  call   <getBuckets@plt>
  lea    -0x1(%r15),%ebx
  cmp    $0x4,%r14d
  je     L220
  movslq %ebx,%rcx
  movzbl 0x0(%r13,%rcx,1),%eax
  movzbl %al,%edi
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  lea    0x0(%rbp,%rax,4),%rdx
  mov    %ebx,%eax
  test   %ebx,%ebx
  jle    L74
  movzbl -0x1(%r13,%rcx,1),%ecx
L213:
  mov    %r15d,%eax
  neg    %eax
  cmp    %edi,%ecx
  cmovge %ebx,%eax
L74:
  lea    0x4(%rdx),%rsi
  mov    %eax,(%rdx)
  test   %r15d,%r15d
  jle    L224
  mov    %rbp,%rax
  lea    -0x1(%r15),%edx
  lea    0x4(%rbp,%rdx,4),%r9
  jmp    L293
L95:
  mov    %r14d,%r8d
  mov    %r9d,%ecx
  mov    %r15d,%edx
  mov    (%rsp),%rsi
  call   <getCounts@plt>
  jmp    L200
L220:
  movslq %ebx,%rax
  lea    0x0(,%rax,4),%rcx
  mov    0x0(%r13,%rax,4),%edi
  movslq %edi,%rax
  movslq (%r12,%rax,4),%rax
  lea    0x0(%rbp,%rax,4),%rdx
  mov    %ebx,%eax
  test   %ebx,%ebx
  jle    L74
  mov    -0x4(%r13,%rcx,1),%ecx
  jmp    L213
L104:
  movslq %ecx,%r8
  mov    0x0(%r13,%r8,4),%r8d
  jmp    L271
L167:
  movslq %ecx,%rsi
  mov    -0x4(%r13,%rsi,4),%esi
L44:
  neg    %edx
  cmp    %esi,%r8d
  cmovg  %edx,%ecx
L305:
  lea    0x4(%r10),%rsi
  mov    %ecx,(%r10)
  mov    %r8d,%edi
L202:
  add    $0x4,%rax
  cmp    %r9,%rax
  je     L224
L293:
  mov    (%rax),%edx
  mov    %edx,%ecx
  not    %ecx
  mov    %ecx,(%rax)
  test   %edx,%edx
  jle    L202
  lea    -0x1(%rdx),%ecx
  cmp    $0x4,%r14d
  je     L104
  movslq %ecx,%r8
  movzbl 0x0(%r13,%r8,1),%r8d
L271:
  mov    %rsi,%r10
  cmp    %edi,%r8d
  je     L173
  movslq %edi,%rdi
  sub    %rbp,%rsi
  sar    $0x2,%rsi
  mov    %esi,(%r12,%rdi,4)
  movslq %r8d,%rsi
  movslq (%r12,%rsi,4),%rsi
  lea    0x0(%rbp,%rsi,4),%r10
L173:
  test   %ecx,%ecx
  jle    L305
  cmp    $0x4,%r14d
  je     L167
  movslq %ecx,%rsi
  movzbl -0x1(%r13,%rsi,1),%esi
  jmp    L44
L224:
  cmp    %r12,(%rsp)
  je     L209
L50:
  mov    $0x1,%ecx
  mov    0xc(%rsp),%edx
  mov    %r12,%rsi
  mov    (%rsp),%rdi
  call   <getBuckets@plt>
  movslq (%r12),%rax
  lea    0x0(%rbp,%rax,4),%rdx
  test   %ebx,%ebx
  js     L263
  movslq %ebx,%rbx
  mov    $0x0,%ecx
  jmp    L155
L209:
  mov    %r14d,%r8d
  mov    0xc(%rsp),%ecx
  mov    %r15d,%edx
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  call   <getCounts@plt>
  jmp    L50
L197:
  movslq %esi,%rdi
  mov    0x0(%r13,%rdi,4),%edi
  jmp    L216
L289:
  movslq %esi,%rdx
  mov    -0x4(%r13,%rdx,4),%edx
  jmp    L235
L4:
  neg    %eax
  mov    %eax,%esi
L115:
  lea    -0x4(%r8),%rdx
  mov    %esi,-0x4(%r8)
  mov    %edi,%ecx
L183:
  sub    $0x1,%rbx
  test   %ebx,%ebx
  js     L263
L155:
  mov    0x0(%rbp,%rbx,4),%eax
  test   %eax,%eax
  jle    L298
  lea    -0x1(%rax),%esi
  cmp    $0x4,%r14d
  je     L197
  movslq %esi,%rdi
  movzbl 0x0(%r13,%rdi,1),%edi
L216:
  mov    %rdx,%r8
  cmp    %ecx,%edi
  je     L81
  movslq %ecx,%rcx
  sub    %rbp,%rdx
  sar    $0x2,%rdx
  mov    %edx,(%r12,%rcx,4)
  movslq %edi,%rdx
  movslq (%r12,%rdx,4),%rdx
  lea    0x0(%rbp,%rdx,4),%r8
L81:
  test   %esi,%esi
  je     L4
  cmp    $0x4,%r14d
  je     L289
  movslq %esi,%rdx
  movzbl -0x1(%r13,%rdx,1),%edx
L235:
  cmp    %edx,%edi
  jge    L115
  jmp    L4
L298:
  not    %eax
  mov    %eax,0x0(%rbp,%rbx,4)
  jmp    L183
L263:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void induceSA(const unsigned char *T, int *SA, int *C, int *B, int n, int k, int cs) {
  int *b, i, j;
  int c0, c1;
  if (C == B) {
    getCounts(T, C, n, k, cs);
  }
  getBuckets(C, B, k, 0);
  j = n - 1;
  b = SA + B[c1 = (cs == sizeof(int) ? ((const int *)T)[j] : ((const unsigned char *)T)[j])];
  *b++ = ((0 < j) && ((cs == sizeof(int) ? ((const int *)T)[j - 1] : ((const unsigned char *)T)[j - 1]) < c1)) ? ~j : j;
  for (i = 0; i < n; ++i) {
    j = SA[i], SA[i] = ~j;
    if (0 < j) {
      --j;
      if ((c0 = (cs == sizeof(int) ? ((const int *)T)[j] : ((const unsigned char *)T)[j])) != c1) {
        B[c1] = b - SA;
        b = SA + B[c1 = c0];
      }
      *b++ = ((0 < j) && ((cs == sizeof(int) ? ((const int *)T)[j - 1] : ((const unsigned char *)T)[j - 1]) < c1)) ? ~j : j;
    }
  }
  if (C == B) {
    getCounts(T, C, n, k, cs);
  }
  getBuckets(C, B, k, 1);
  for (i = n - 1, b = SA + B[c1 = 0]; 0 <= i; --i) {
    if (0 < (j = SA[i])) {
      --j;
      if ((c0 = (cs == sizeof(int) ? ((const int *)T)[j] : ((const unsigned char *)T)[j])) != c1) {
        B[c1] = b - SA;
        b = SA + B[c1 = c0];
      }
      *--b = ((j == 0) || ((cs == sizeof(int) ? ((const int *)T)[j - 1] : ((const unsigned char *)T)[j - 1]) > c1)) ? ~j : j;
    } else {
      SA[i] = ~j;
    }
  }
}
```