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

```asm
<formEpisode>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %r8,%r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  lea    (%r15,%rbp,8),%r15
  sub    $0x38,%rsp
  mov    0x80(%rsp),%r13
  mov    %r9d,0x4(%rsp)
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    0x4(%rsp),%esi
  mov    (%r15),%rdi
  movslq %eax,%rbx
  lea    0xc(%rbx),%r9d
  mov    %r9d,0x8(%rsp)
  call   <identifyEpisode@plt>
  cmp    0x70(%rsp),%eax
  jl     L53
  cmp    0x78(%rsp),%eax
  mov    0x8(%rsp),%r9d
  mov    %eax,%ebp
  jg     L53
  mov    %r9d,%edi
  call   <malloc@plt>
  test   %ebx,%ebx
  jle    L114
  xor    %edx,%edx
  nopl   0x0(%rax)
L95:
  movzbl 0x0(%r13,%rdx,1),%ecx
  mov    %cl,(%rax,%rdx,1)
  add    $0x1,%rdx
  cmp    %rdx,%rbx
  jne    L95
  lea    0x4(%rbx),%rdi
  lea    (%rax,%rbx,1),%r11
  mov    %rdi,%r13
  lea    0x5(%rbx),%rdi
  lea    0x1(%rbx),%rsi
  mov    %rdi,0x8(%rsp)
  lea    0x6(%rbx),%rdi
  lea    0x2(%rbx),%rcx
  mov    %rdi,0x10(%rsp)
  lea    0x7(%rbx),%rdi
  lea    0x3(%rbx),%rdx
  mov    %rdi,0x18(%rsp)
  lea    0x8(%rbx),%rdi
  lea    0xa(%rbx),%r10
  mov    %rdi,0x20(%rsp)
  lea    0x9(%rbx),%rdi
  lea    0xb(%rbx),%r9
  add    $0xc,%rbx
  mov    %rdi,0x28(%rsp)
L48:
  add    %rax,%rsi
  add    %rax,%rcx
  add    %rax,%rdx
  cmp    $0x9,%r12d
  jg     L76
  add    $0x30,%r12d
  mov    $0x30,%edi
L83:
  movb   $0x20,(%r11)
  movb   $0x73,(%rsi)
  mov    0x10(%rsp),%rsi
  mov    %dil,(%rcx)
  mov    0x8(%rsp),%rcx
  mov    %r12b,(%rdx)
  mov    0x18(%rsp),%rdx
  add    %rax,%rsi
  movb   $0x65,(%rax,%r13,1)
  add    %rax,%rcx
  add    %rax,%rdx
  cmp    $0x63,%ebp
  jle    L36
  movslq 0x4(%rsp),%r13
  mov    (%r15),%rdi
  movzbl (%rdi,%r13,1),%edi
  mov    %dil,(%rcx)
  mov    (%r15),%rcx
  movzbl 0x1(%rcx,%r13,1),%ecx
  mov    %cl,(%rsi)
  mov    (%r15),%rcx
  movzbl 0x2(%rcx,%r13,1),%ebp
L54:
  mov    0x20(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  mov    %bpl,(%rdx)
  movb   $0x2e,(%rax,%rsi,1)
  movzbl (%r14),%edx
  mov    %dl,(%rax,%rdi,1)
  movzbl 0x1(%r14),%edx
  mov    %dl,(%rax,%r10,1)
  movzbl 0x2(%r14),%edx
  mov    %dl,(%rax,%r9,1)
  movb   $0x0,(%rax,%rbx,1)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L76:
  movslq %r12d,%r8
  mov    %r12d,%edi
  imul   $0x66666667,%r8,%r8
  sar    $0x1f,%edi
  sar    $0x22,%r8
  sub    %edi,%r8d
  lea    0x30(%r8),%edi
  lea    (%r8,%r8,4),%r8d
  add    %r8d,%r8d
  sub    %r8d,%r12d
  add    $0x30,%r12d
  jmp    L83
  cs nopw 0x0(%rax,%rax,1)
L36:
  movb   $0x30,(%rcx)
  cmp    $0x9,%ebp
  jle    L120
  mov    (%r15),%rdi
  movslq 0x4(%rsp),%r13
  movzbl (%rdi,%r13,1),%ecx
  cmp    $0x30,%cl
  je     L86
  mov    %cl,(%rsi)
  mov    (%r15),%rcx
  movzbl 0x1(%rcx,%r13,1),%ebp
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L120:
  movb   $0x30,(%rsi)
  add    $0x30,%ebp
  jmp    L54
L86:
  movzbl 0x1(%rdi,%r13,1),%ecx
  mov    %cl,(%rsi)
  mov    (%r15),%rcx
  movzbl 0x2(%rcx,%r13,1),%ebp
  jmp    L54
  nopl   0x0(%rax)
L53:
  mov    (%r15),%rsi
  lea    D2(%rip),%rdi
  call   <printf@plt>
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L114:
  movq   $0x9,0x28(%rsp)
  mov    %rax,%r11
  mov    $0xc,%ebx
  mov    $0xb,%r9d
  movq   $0x8,0x20(%rsp)
  mov    $0xa,%r10d
  mov    $0x4,%r13d
  mov    $0x3,%edx
  movq   $0x7,0x18(%rsp)
  mov    $0x2,%ecx
  mov    $0x1,%esi
  movq   $0x6,0x10(%rsp)
  movq   $0x5,0x8(%rsp)
  jmp    L48
```

tool_calls: name: read_data
arguments: data_tag: D2
type_guessed: string

tool: D2: Out of season episode detected: %s


assistant: ```c
char *formEpisode(char **episodes, int scanCount, int count, int season, char extension[4], int digit, int firstEp, int lastEp, char prefix[100]) {
  char *episode, prompt;
  int length, i, numEp, lenPrefix;
  lenPrefix = strlen(prefix);
  length = lenPrefix + 12;
  numEp = identifyEpisode(episodes[count], digit);
  if (numEp < firstEp || numEp > lastEp) {
    printf("Out of season episode detected: %s\n", episodes[count]);
    return NULL;
  }
  episode = malloc(sizeof(char) * length);
  for (i = 0; i < lenPrefix; i++)
    episode[i] = prefix[i];
  episode[i] = ' ';
  episode[i + 1] = 's';
  if (season >= 10) {
    episode[i + 2] = (season / 10) + '0';
    episode[i + 3] = (season % 10) + '0';
  } else {
    episode[i + 2] = '0';
    episode[i + 3] = season + '0';
  }
  episode[i + 4] = 'e';
  if (numEp >= 100) {
    episode[i + 5] = episodes[count][digit];
    episode[i + 6] = episodes[count][digit + 1];
    episode[i + 7] = episodes[count][digit + 2];
  } else if (numEp >= 10) {
    episode[i + 5] = '0';
    if (episodes[count][digit] != '0') {
      episode[i + 6] = episodes[count][digit];
      episode[i + 7] = episodes[count][digit + 1];
    } else {
      episode[i + 6] = episodes[count][digit + 1];
      episode[i + 7] = episodes[count][digit + 2];
    }
  } else {
    episode[i + 5] = '0';
    episode[i + 6] = '0';
    episode[i + 7] = numEp + '0';
  }
  episode[i + 8] = '.';
  episode[i + 9] = extension[0];
  episode[i + 10] = extension[1];
  episode[i + 11] = extension[2];
  episode[i + 12] = '\0';
  return episode;
}
```