user: 请从给定的汇编指令推导出C源代码：

```asm
<longest_substring>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %esi,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    0x0(,%rsi,4),%edi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %r13d,%r13d
  jle    L159
  mov    %r13d,%edx
  lea    (%rax,%rdx,4),%rdx
L129:
  movl   $0xffffffff,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L129
L159:
  mov    %r15,%rdx
  mov    %r13d,%esi
  mov    %rbx,%rdi
  call   <buildSuffixArray@plt>
  lea    -0x1(%r13),%r14d
  movslq %r14d,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L51:
  cmp    %rdx,%rsp
  je     L167
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L51
L167:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L36
  orq    $0x0,-0x8(%rsp,%rax,1)
L36:
  mov    %rsp,%r12
  mov    %r13d,%ecx
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <kasai_lcp@plt>
  test   %r14d,%r14d
  jle    L55
  lea    -0x2(%r13),%esi
  mov    $0x0,%eax
  mov    $0xffffffff,%edi
  mov    $0xffffffff,%ecx
  jmp    L133
L59:
  lea    0x1(%rax),%rdx
  cmp    %rsi,%rax
  je     L139
  mov    %rdx,%rax
L133:
  mov    (%r12,%rax,4),%edx
  cmp    %ecx,%edx
  jle    L59
  mov    %eax,%edi
  mov    %edx,%ecx
  jmp    L59
L139:
  movslq %edi,%rdi
  mov    (%r15,%rdi,4),%r12d
  test   %ecx,%ecx
  jne    L41
  lea    D18(%rip),%rdi
  call   <puts@plt>
L105:
  mov    %r15,%rdi
  call   <free@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L123
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L41:
  lea    -0x1(%rcx,%r12,1),%eax
  mov    %eax,-0x44(%rbp)
  sub    %r12d,%eax
L208:
  mov    %rsp,-0x50(%rbp)
  cltq
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L150:
  cmp    %rdx,%rsp
  je     L104
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L150
L104:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L3
  orq    $0x0,-0x8(%rsp,%rax,1)
L3:
  mov    %rsp,%r14
  movslq %r12d,%rax
  movsbl (%rbx,%rax,1),%edx
  lea    D21(%rip),%rsi
  mov    %rsp,%rdi
  call   <sprintf@plt>
  add    $0x1,%r12d
  cmp    -0x44(%rbp),%r12d
  jg     L207
  movslq %r12d,%r12
L136:
  movsbl (%rbx,%r12,1),%edx
  lea    -0x3a(%rbp),%r13
  lea    D21(%rip),%rsi
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  add    $0x1,%r12
  cmp    %r12d,-0x44(%rbp)
  jge    L136
L207:
  mov    $0x0,%r12d
L157:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L99
  add    $0x1,%r12d
  lea    0x1(%rax),%rbx
  jmp    L157
L99:
  mov    %r12d,%edx
  mov    %r14,%rsi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    -0x50(%rbp),%rsp
  jmp    L105
L55:
  mov    -0x4(%r15),%r12d
  lea    -0x2(%r12),%eax
  mov    %eax,-0x44(%rbp)
  mov    $0xfffffffe,%eax
  jmp    L208
L123:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D18
datatype: string
name: disassemble_data
arguments: label: D21
datatype: string
name: disassemble_data
arguments: label: D5
datatype: string

tool: D18: No repetitions found!

tool: D21: %c

tool: D5: %s %d


assistant: ```c
void longest_substring(char *string, int len) {
  int i;
  int *suffArr = malloc(sizeof(int) * len);
  for (i = 0; i < len; i++) {
    suffArr[i] = -1;
  }
  buildSuffixArray(string, len, suffArr);
  int lcp_len = len - 1;
  int lcp[lcp_len];
  kasai_lcp(string, lcp, suffArr, len);
  int max_val = -1;
  int max_i = -1;
  for (i = 0; i < lcp_len; i++) {
    if (lcp[i] > max_val) {
      max_val = lcp[i];
      max_i = i;
    }
  }
  int start_idx = suffArr[max_i];
  int end_idx = suffArr[max_i] + max_val - 1;
  int sub_len = end_idx - start_idx;
  if (max_val == 0) {
    printf("No repetitions found!\n");
  } else {
    char substring[sub_len];
    char temp[2];
    sprintf(substring, "%c", string[start_idx]);
    for (i = start_idx + 1; i < end_idx + 1; i++) {
      sprintf(temp, "%c", string[i]);
      strcat(substring, temp);
    }
    int count = 0;
    const char *tmp = string;
    while (tmp = strstr(tmp, substring)) {
      count++;
      tmp++;
    }
    printf("%s %d\n", substring, count);
  }
  free(suffArr);
  return;
}
```