user: 这段汇编代码用C语言表示是什么样的：

```asm
<getGrams>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    %r9d,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x8(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  je     L151
  mov    -0x8(%rbp),%eax
  sub    -0x28(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L98
L151:
  mov    -0x8(%rbp),%eax
  cltd
  idivl  -0x28(%rbp)
  sub    $0x1,%eax
  mov    %eax,-0x10(%rbp)
L98:
  mov    -0x24(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L58
  mov    $0x0,%eax
  jmp    L57
L58:
  mov    -0x8(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jg     L65
  mov    $0xffffffff,%eax
  jmp    L57
L65:
  movl   $0x0,-0xc(%rbp)
  jmp    L82
L78:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0xc(%rbp)
L82:
  mov    -0x28(%rbp),%eax
  add    $0x2,%eax
  add    %eax,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L78
  cmpl   $0x0,-0x2c(%rbp)
  je     L37
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L75
L4:
  mov    -0x4(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xc(%rbp)
L75:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L4
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  cmpl   $0x0,-0x30(%rbp)
  jle    L130
  mov    -0x2c(%rbp),%r9d
  mov    -0x30(%rbp),%r8d
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x10(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <addGramPosition@plt>
  add    $0x10,%rsp
  jmp    L130
L37:
  mov    -0x24(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L155
  jmp    L76
L180:
  mov    -0x4(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xc(%rbp)
L76:
  mov    -0x4(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L180
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L51
L155:
  movl   $0x0,-0xc(%rbp)
  jmp    L168
L97:
  mov    -0x4(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xc(%rbp)
L168:
  mov    -0xc(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L97
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L51:
  cmpl   $0x0,-0x30(%rbp)
  jle    L130
  mov    -0x2c(%rbp),%r9d
  mov    -0x30(%rbp),%r8d
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x10(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <addGramPosition@plt>
  add    $0x10,%rsp
L130:
  mov    $0x1,%eax
L57:
  leave
  ret
```

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;
}
```