user: Please show me the C implementation that matches the assembly code listed below:

```asm
<lengthOfLongestSubstring>:
  endbr64
  push   %r15
  mov    $0x80,%ecx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rdi
  mov    %rdi,0x10(%rsp)
  rep stos %rax,%es:(%rdi)
  movzbl 0x0(%rbp),%eax
  test   %al,%al
  je     L73
  movl   $0x0,0x8(%rsp)
  mov    %rbp,%r15
  xor    %r12d,%r12d
  lea    D13(%rip),%r14
  jmp    L51
L80:
  lea    0x64(%r15),%rbx
  add    $0x1,%r12d
  sub    %ebp,%ebx
L68:
  movzbl 0x1(%r15),%eax
  add    $0x1,%r15
  mov    %ebx,0x20(%rsp,%r13,4)
  test   %al,%al
  je     L66
L51:
  movsbq %al,%r13
  movsbl %al,%esi
  mov    0x20(%rsp,%r13,4),%ebx
  test   %ebx,%ebx
  je     L80
  mov    %r15,%rax
  lea    -0x64(%rbx),%edx
  lea    D18(%rip),%rdi
  sub    %rbp,%rax
  mov    %edx,0xc(%rsp)
  mov    %eax,%ecx
  mov    %rax,(%rsp)
  mov    %eax,0x18(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    (%rsp),%rsi
  mov    0xc(%rsp),%edx
  mov    $0x80,%ecx
  mov    0x10(%rsp),%rdi
  lea    -0x63(%rbx),%r10d
  mov    %esi,%eax
  movslq %r10d,%rbx
  sub    %edx,%eax
  mov    %eax,0xc(%rsp)
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  cmp    %r10d,%esi
  jl     L21
  mov    %r12d,0x1c(%rsp)
  mov    %rbx,%r12
  mov    0x18(%rsp),%ebx
  nopl   0x0(%rax)
L67:
  movsbq 0x0(%rbp,%r12,1),%rax
  lea    0x64(%r12),%edx
  mov    %r14,%rdi
  mov    %edx,0x20(%rsp,%rax,4)
  mov    %rax,%rsi
  mov    %r12d,%edx
  xor    %eax,%eax
  call   <printf@plt>
  add    $0x1,%r12
  cmp    %r12d,%ebx
  jge    L67
  mov    0x1c(%rsp),%r12d
L21:
  mov    0x8(%rsp),%eax
  mov    (%rsp),%ebx
  cmp    %r12d,%eax
  cmovge %eax,%r12d
  add    $0x64,%ebx
  mov    %r12d,0x8(%rsp)
  mov    0xc(%rsp),%r12d
  jmp    L68
L66:
  mov    0x8(%rsp),%eax
  cmp    %r12d,%eax
  cmovl  %r12d,%eax
L88:
  mov    0x428(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L63
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L73:
  xor    %eax,%eax
  jmp    L88
L63:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D13
type_guessed: string
name: retrieve_data
arguments: label: D18
type_guessed: string

tool: D13: update %c to %d.


tool: D18: val is %c,prev is %d, curr is %d.


assistant: ```c
int lengthOfLongestSubstring(char *s) {
  int hash[256];
  int i = 0;
  for (i = 0; i < 256; i++)
    hash[i] = 0;
  int count = 0;
  int tmpcount = 0;
  int val = 0;
  int previndex = 0;
  int currindex = 0;
  char *p = s;
  int extra = 0;
  int existflag = 100;
  while (*p) {
    val = (int)*p;
    if (hash[val]) {
      previndex = hash[val] - existflag;
      currindex = p - s;
      printf("val is %c,prev is %d, curr is %d.\n", val, previndex, currindex);
      extra = currindex - previndex - 1;
      for (i = 0; i < 256; i++)
        hash[i] = 0;
      for (i = previndex + 1; i <= currindex; i++) {
        hash[*(s + i)] = existflag + i;
        printf("update %c to %d.\n", *(s + i), i);
      }
      if (tmpcount >= count)
        count = tmpcount;
      hash[val] = existflag + currindex;
      tmpcount = 1 + extra;
    } else {
      hash[val] = existflag + p - s;
      tmpcount++;
    }
    p++;
  }
  if (tmpcount >= count)
    count = tmpcount;
  return count;
}
```