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

```asm
<getGrams>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r14
  mov    %rsi,%rbx
  mov    %edx,%r13d
  mov    %ecx,%ebp
  mov    %r8d,%r12d
  mov    %r9d,%r15d
  call   <strlen@plt>
  mov    %eax,%ecx
  test   %r12d,%r12d
  je     L96
  mov    %eax,%esi
  sub    %ebp,%esi
L23:
  mov    $0x0,%eax
  cmp    %r13d,%esi
  jl     L170
  mov    $0xffffffff,%eax
  cmp    %ebp,%ecx
  jle    L170
  lea    0x4(%rbp,%rbp,1),%eax
  test   %eax,%eax
  jle    L5
  mov    %rbx,%rdx
  lea    -0x1(%rax),%eax
  lea    0x1(%rbx,%rax,1),%rcx
L145:
  movb   $0x0,(%rdx)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L145
L5:
  test   %r12d,%r12d
  je     L43
  test   %ebp,%ebp
  jle    L155
  lea    -0x1(%rbp),%esi
  mov    $0x0,%eax
  movslq %r13d,%rcx
  add    %r14,%rcx
L75:
  movzbl (%rcx,%rax,1),%edx
  mov    %dl,(%rbx,%rax,1)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rsi,%rdx
  jne    L75
L155:
  movslq %ebp,%rax
  movb   $0x0,(%rbx,%rax,1)
  mov    $0x1,%eax
  test   %r15d,%r15d
  jg     L41
L170:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L96:
  cltd
  idiv   %ebp
  lea    -0x1(%rax),%esi
  jmp    L23
L41:
  sub    $0x8,%rsp
  mov    0x48(%rsp),%eax
  push   %rax
  mov    %r12d,%r9d
  mov    %r15d,%r8d
  mov    %r13d,%ecx
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <addGramPosition@plt>
  add    $0x10,%rsp
  mov    $0x1,%eax
  jmp    L170
L43:
  mov    %ebp,%edx
  imul   %r13d,%edx
  cmp    %r13d,%esi
  je     L125
  lea    -0x1(%rbp),%esi
  mov    $0x0,%eax
  movslq %edx,%rdx
  add    %r14,%rdx
  test   %ebp,%ebp
  jle    L58
L53:
  movzbl (%rdx,%rax,1),%ecx
  mov    %cl,(%rbx,%rax,1)
  mov    %rax,%rcx
  add    $0x1,%rax
  cmp    %rsi,%rcx
  jne    L53
L58:
  movslq %ebp,%rax
  movb   $0x0,(%rbx,%rax,1)
L40:
  mov    $0x1,%eax
  test   %r15d,%r15d
  jle    L170
  sub    $0x8,%rsp
  mov    0x48(%rsp),%eax
  push   %rax
  mov    $0x0,%r9d
  mov    %r15d,%r8d
  mov    %r13d,%ecx
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <addGramPosition@plt>
  add    $0x10,%rsp
  mov    $0x1,%eax
  jmp    L170
L125:
  movslq %edx,%rdx
  add    %r14,%rdx
  movzbl (%rdx),%ecx
  test   %cl,%cl
  je     L165
  mov    $0x1,%eax
L143:
  mov    %cl,-0x1(%rbx,%rax,1)
  mov    %eax,%r12d
  add    $0x1,%rax
  movzbl -0x1(%rdx,%rax,1),%ecx
  test   %cl,%cl
  jne    L143
L165:
  movslq %r12d,%r12
  movb   $0x0,(%rbx,%r12,1)
  jmp    L40
```

assistant: ```c
int getGrams(char *word, char *gram, int index, int size, int overlap, int position, int hashbang) {
  int lenWord = strlen(word);
  int lastIndex;
  if (overlap)
    lastIndex = lenWord - size;
  else
    lastIndex = lenWord / size - 1;
  if (index > lastIndex)
    return 0;
  if (lenWord <= size) {
    return -1;
  }
  int start, i;
  for (i = 0; i < size * 2 + 4; i++)
    gram[i] = 0;
  if (overlap) {
    start = index;
    for (i = 0; i < size; i++) {
      gram[i] = word[start + i];
    }
    gram[size] = '\0';
    if (position > 0)
      addGramPosition(word, gram, size, index, position, overlap, hashbang);
  } else {
    start = index * size;
    i = 0;
    if (index == lastIndex) {
      while (word[start + i] != '\0') {
        gram[i] = word[start + i];
        i++;
      }
      gram[i] = '\0';
    } else {
      for (i = 0; i < size; i++)
        gram[i] = word[start + i];
      gram[size] = '\0';
    }
    if (position > 0)
      addGramPosition(word, gram, size, index, position, overlap, hashbang);
  }
  return 1;
}
```