user: 请将以下的汇编代码转换成C语言代码:

```asm
<getTextByHits>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    $0x100,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  test   %r12,%r12
  je     L39
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,0x18(%rsp)
  mov    $0x0,%eax
  call   <getZVMLogLevel@plt>
  test   %eax,%eax
  jg     L76
L145:
  cmp    $0xffff27,%ebp
  ja     L183
  mov    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  cmp    $0x7ffda0,%ebp
  ja     L164
  lea    -0x2(%rbp),%eax
  cmp    $0x1,%ebp
  cmova  %eax,%ebp
  mov    0x18(%rsp),%r14
  sub    $0x1,%r14
  je     L65
  movq   $0x0,(%rsp)
  mov    $0x0,%r13d
  mov    $0x0,%r15d
  mov    $0x0,%ebx
  mov    %ebp,%ebp
  jmp    L42
L76:
  mov    %ebp,%r8d
  lea    D7(%rip),%rcx
  mov    $0x1,%edx
  lea    D10(%rip),%rsi
  lea    D17(%rip),%rdi
  call   <printf@plt>
  jmp    L145
L164:
  mov    0x18(%rsp),%rax
  cmp    $0xff,%rax
  jbe    L116
  lea    -0x100(%r12,%rax,1),%rsi
  mov    $0x100,%edx
  mov    0x10(%rsp),%rdi
  call   <strncpy@plt>
  jmp    L189
L116:
  mov    0x18(%rsp),%rdx
  add    $0x1,%rdx
  mov    %r12,%rsi
  mov    0x10(%rsp),%rdi
  call   <strncpy@plt>
  jmp    L189
L170:
  cmp    %r13,%rbp
  je     L34
  add    $0x1,%rbx
  cmp    %r14,%rbx
  je     L46
L42:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <isNewWord@plt>
  cmp    $0x1,%eax
  jne    L170
  add    $0x1,%r13
  mov    %r15,(%rsp)
  mov    %rbx,%r15
  jmp    L170
L34:
  mov    (%rsp),%rax
  add    $0x100,%rax
  mov    $0x100,%ebx
  cmp    0x18(%rsp),%rax
  jb     L149
  mov    0x18(%rsp),%rax
  mov    %rax,%rbx
  sub    (%rsp),%rbx
  cmp    $0xff,%rbx
  ja     L149
  cmp    $0x100,%rax
  jbe    L149
  sub    $0x100,%rax
  mov    %rax,(%rsp)
  mov    $0x100,%ebx
L149:
  mov    (%rsp),%rsi
  add    %r12,%rsi
  mov    %rbx,%rdx
  mov    0x10(%rsp),%r15
  mov    %r15,%rdi
  call   <strncpy@plt>
  movb   $0x0,(%r15,%rbx,1)
L189:
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L46:
  movq   $0x0,0x8(%rsp)
  jmp    L189
L39:
  mov    %r12,0x8(%rsp)
  jmp    L189
L183:
  movq   $0x0,0x8(%rsp)
  jmp    L189
L65:
  movq   $0x0,0x8(%rsp)
  jmp    L189
```

tool_calls: name: disassemble_data
arguments: label: D7
data_type: string
name: disassemble_data
arguments: label: D10
data_type: string
name: disassemble_data
arguments: label: D17
data_type: string

tool: D7: start pos

tool: D10: ***ZVMLog

tool: D17: %s [LogLevel=%d] [%s], 	%u 


assistant: ```c
char *getTextByHits(char *text, unsigned int uiStart, unsigned int uiEnd) {
  char *s = (char *)malloc(sizeof(char) * 256);
  size_t i;
  size_t tTextLength = 0;
  size_t tCurrentWordPos = 0;
  size_t tPosCount = 0;
  size_t tLastWordCharPos = 0, tStartCharPos = 0;
  unsigned int NotFoundPos = 16777000;
  unsigned int LastPosInFile = 8388000;
  size_t tSnippetSize = 0;
  int bFind = 0;
  if (text != NULL)
    tTextLength = strlen(text);
  else
    return NULL;
  if (getZVMLogLevel() >= 1) {
    printf("%s [LogLevel=%d] [%s], \t%"
           "u"
           " \n",
           "***ZVMLog", 1, "start pos", uiStart);
  };
  if (uiStart >= NotFoundPos) {
    return NULL;
  }
  if (uiStart > LastPosInFile) {
    if (tTextLength >= 256) {
      strncpy(s, text + (tTextLength - 256), 256);
    } else {
      strncpy(s, text, tTextLength + 1);
    }
    return s;
  }
  if (uiStart > 1)
    uiStart -= 2;
  for (i = 0; i < tTextLength - 1; i++) {
    if (isNewWord(text, i) == 1) {
      tLastWordCharPos = tCurrentWordPos;
      tCurrentWordPos = i;
      tPosCount++;
    }
    if (tPosCount == uiStart) {
      tStartCharPos = tLastWordCharPos;
      bFind = 1;
      break;
    }
  }
  if (bFind == 0)
    return NULL;
  if ((tStartCharPos + 256) < tTextLength)
    tSnippetSize = 256;
  else {
    tSnippetSize = tTextLength - tStartCharPos;
    if (tSnippetSize < 256 && tTextLength > 256) {
      tStartCharPos = tStartCharPos - (256 - tSnippetSize);
      tSnippetSize = 256;
    }
  }
  strncpy(s, text + tStartCharPos, tSnippetSize);
  s[tSnippetSize] = '\0';
  return s;
}
```