user: What is the c source code of the assembly code below:

```asm
<metaphone>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movb   $0x0,-0x1b(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %eax,%eax
  add    $0x1,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L67
  mov    $0x0,%eax
  jmp    L1177
L67:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1a(%rbp)
  cmpb   $0x0,-0x1a(%rbp)
  je     L936
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  cmpb   $0x6b,-0x1a(%rbp)
  jne    L730
  cmpb   $0x6e,-0x1c(%rbp)
  je     L720
L730:
  cmpb   $0x67,-0x1a(%rbp)
  jne    L875
  cmpb   $0x6e,-0x1c(%rbp)
  je     L720
L875:
  cmpb   $0x70,-0x1a(%rbp)
  jne    L483
  cmpb   $0x6e,-0x1c(%rbp)
  je     L720
L483:
  cmpb   $0x61,-0x1a(%rbp)
  jne    L49
  cmpb   $0x63,-0x1c(%rbp)
  je     L720
L49:
  cmpb   $0x77,-0x1a(%rbp)
  jne    L646
  cmpb   $0x72,-0x1c(%rbp)
  je     L720
L646:
  cmpb   $0x61,-0x1a(%rbp)
  jne    L936
  cmpb   $0x65,-0x1c(%rbp)
  jne    L936
L720:
  addq   $0x1,-0x28(%rbp)
L936:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L1065
L352:
  movzbl -0x1c(%rbp),%eax
  mov    %al,-0x1a(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x19(%rbp)
  movzbl -0x1a(%rbp),%eax
  cmp    -0x1c(%rbp),%al
  jne    L1165
  cmpb   $0x63,-0x1a(%rbp)
  jne    L719
L1165:
  movsbl -0x1a(%rbp),%eax
  sub    $0x20,%eax
  cmp    $0x5a,%eax
  ja     L669
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D3(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D3(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L1144
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L476
L1144:
  movsbl -0x1a(%rbp),%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L476
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jbe    L866
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x6d,%al
  jne    L866
  cmpb   $0x0,-0x1c(%rbp)
  je     L480
L866:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x42,(%rax)
  jmp    L480
  cmpb   $0x69,-0x1c(%rbp)
  jne    L326
  cmpb   $0x61,-0x19(%rbp)
  je     L145
L326:
  cmpb   $0x68,-0x1c(%rbp)
  jne    L1360
L145:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L735
L1360:
  cmpb   $0x69,-0x1c(%rbp)
  je     L929
  cmpb   $0x65,-0x1c(%rbp)
  je     L929
  cmpb   $0x79,-0x1c(%rbp)
  jne    L194
L929:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x53,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L735
L194:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4b,(%rax)
  jmp    L669
L735:
  jmp    L669
  cmpb   $0x67,-0x1c(%rbp)
  jne    L123
  cmpb   $0x65,-0x19(%rbp)
  je     L1063
  cmpb   $0x79,-0x19(%rbp)
  je     L1063
  cmpb   $0x69,-0x19(%rbp)
  jne    L123
L1063:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4a,(%rax)
  addq   $0x2,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  nop
  jmp    L669
L123:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x54,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x46,(%rax)
  jmp    L669
  cmpb   $0x69,-0x1c(%rbp)
  je     L564
  cmpb   $0x65,-0x1c(%rbp)
  je     L564
  cmpb   $0x79,-0x1c(%rbp)
  jne    L168
L564:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4a,(%rax)
  jmp    L724
L168:
  cmpb   $0x68,-0x1c(%rbp)
  je     L1169
  cmpb   $0x6e,-0x1c(%rbp)
  je     L1169
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4b,(%rax)
  jmp    L724
L1169:
  cmpb   $0x68,-0x1c(%rbp)
  jne    L19
  cmpb   $0x61,-0x19(%rbp)
  je     L19
  cmpb   $0x65,-0x19(%rbp)
  je     L19
  cmpb   $0x69,-0x19(%rbp)
  je     L19
  cmpb   $0x6f,-0x19(%rbp)
  je     L19
  cmpb   $0x75,-0x19(%rbp)
  je     L19
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L19
L724:
  jmp    L19
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L1243
  cmpb   $0x61,-0x1c(%rbp)
  je     L1243
  cmpb   $0x65,-0x1c(%rbp)
  je     L1243
  cmpb   $0x69,-0x1c(%rbp)
  je     L1243
  cmpb   $0x6f,-0x1c(%rbp)
  je     L1243
  cmpb   $0x75,-0x1c(%rbp)
  je     L1243
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  test   %al,%al
  je     L1067
  cmpb   $0x61,-0x1b(%rbp)
  je     L120
  cmpb   $0x65,-0x1b(%rbp)
  je     L120
  cmpb   $0x69,-0x1b(%rbp)
  je     L120
  cmpb   $0x6f,-0x1b(%rbp)
  je     L120
  cmpb   $0x75,-0x1b(%rbp)
  jne    L1067
L120:
  mov    $0x1,%eax
  jmp    L1244
L1067:
  mov    $0x0,%eax
L1244:
  mov    %al,-0x1b(%rbp)
  cmpb   $0x0,-0x1b(%rbp)
  je     L227
L1243:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x48,(%rax)
  jmp    L227
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4a,(%rax)
  jmp    L669
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L817
  mov    -0x18(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x63,%al
  je     L118
L817:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4b,(%rax)
  jmp    L118
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4c,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4d,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4e,(%rax)
  jmp    L669
  cmpb   $0x68,-0x1c(%rbp)
  jne    L1051
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x46,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L669
L1051:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x50,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4b,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x52,(%rax)
  jmp    L669
  cmpb   $0x68,-0x1c(%rbp)
  jne    L398
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L669
L398:
  cmpb   $0x69,-0x1c(%rbp)
  jne    L575
  cmpb   $0x6f,-0x19(%rbp)
  je     L148
  cmpb   $0x61,-0x19(%rbp)
  jne    L575
L148:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  addq   $0x2,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  nop
  jmp    L669
L575:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x53,(%rax)
  jmp    L669
  cmpb   $0x69,-0x1c(%rbp)
  jne    L187
  cmpb   $0x61,-0x19(%rbp)
  je     L332
  cmpb   $0x6f,-0x19(%rbp)
  jne    L187
L332:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  jmp    L1078
L187:
  cmpb   $0x68,-0x1c(%rbp)
  jne    L451
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x30,(%rax)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
  jmp    L1078
L451:
  cmpb   $0x63,-0x1c(%rbp)
  jne    L1002
  cmpb   $0x68,-0x19(%rbp)
  je     L1078
L1002:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x54,(%rax)
  jmp    L1078
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x46,(%rax)
  jmp    L669
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L276
  cmpb   $0x68,-0x1c(%rbp)
  jne    L276
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %al,-0x1c(%rbp)
L276:
  cmpb   $0x61,-0x1c(%rbp)
  je     L459
  cmpb   $0x65,-0x1c(%rbp)
  je     L459
  cmpb   $0x69,-0x1c(%rbp)
  je     L459
  cmpb   $0x6f,-0x1c(%rbp)
  je     L459
  cmpb   $0x75,-0x1c(%rbp)
  jne    L618
L459:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x57,(%rax)
  jmp    L618
  mov    -0x18(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L1250
  cmpb   $0x68,-0x1c(%rbp)
  je     L760
  cmpb   $0x69,-0x1c(%rbp)
  jne    L47
  cmpb   $0x6f,-0x19(%rbp)
  je     L760
  cmpb   $0x61,-0x19(%rbp)
  jne    L47
L760:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x58,(%rax)
  jmp    L669
L47:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x53,(%rax)
  jmp    L669
L1250:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x4b,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x53,(%rax)
  jmp    L669
  cmpb   $0x61,-0x1c(%rbp)
  je     L1345
  cmpb   $0x65,-0x1c(%rbp)
  je     L1345
  cmpb   $0x69,-0x1c(%rbp)
  je     L1345
  cmpb   $0x6f,-0x1c(%rbp)
  je     L1345
  cmpb   $0x75,-0x1c(%rbp)
  jne    L320
L1345:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x59,(%rax)
  jmp    L320
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x53,(%rax)
  jmp    L669
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L570
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x20,(%rax)
  jmp    L570
L719:
  nop
  jmp    L669
L476:
  nop
  jmp    L669
L480:
  nop
  jmp    L669
L19:
  nop
  jmp    L669
L227:
  nop
  jmp    L669
L118:
  nop
  jmp    L669
L1078:
  nop
  jmp    L669
L618:
  nop
  jmp    L669
L320:
  nop
  jmp    L669
L570:
  nop
L669:
  addq   $0x1,-0x18(%rbp)
L1065:
  cmpb   $0x0,-0x1c(%rbp)
  jne    L352
  mov    -0x8(%rbp),%rax
L1177:
  leave
  ret
```

assistant: ```c
char *metaphone(const char *str) {
  const char *s;
  char c, next, nextnext, temp = '\0';
  char *result = calloc(strlen(str) * 2 + 1, sizeof(char));
  char *r;
  if (!result) {
    return NULL;
  }
  c = tolower(*str);
  if (c) {
    next = tolower(*(str + 1));
    if ((c == 'k' && next == 'n') || (c == 'g' && next == 'n') || (c == 'p' && next == 'n') || (c == 'a' && next == 'c') || (c == 'w' && next == 'r') || (c == 'a' && next == 'e')) {
      str++;
    }
  }
  next = tolower(*str);
  for (s = str, r = result; next; s++) {
    c = next;
    next = tolower(*(s + 1));
    nextnext = tolower(*(s + 2));
    if (c == next && c != 'c') {
      continue;
    }
    switch (c) {
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      if (s == str || *(s - 1) == ' ') {
        *r++ = toupper(c);
      }
      break;
    case 'b':
      if (!(s > str && tolower(*(s - 1)) == 'm') || next) {
        *r++ = 'B';
      }
      break;
    case 'c':
      if ((next == 'i' && nextnext == 'a') || next == 'h') {
        *r++ = 'X';
        next = tolower(*(++s + 1));
      } else if (next == 'i' || next == 'e' || next == 'y') {
        *r++ = 'S';
        next = tolower(*(++s + 1));
      } else {
        *r++ = 'K';
      }
      break;
    case 'd':
      if (next == 'g' && (nextnext == 'e' || nextnext == 'y' || nextnext == 'i')) {
        *r++ = 'J';
        s += 2;
        next = tolower(*(s + 1));
      } else {
        *r++ = 'T';
      }
      break;
    case 'f':
      *r++ = 'F';
      break;
    case 'g':
      if (next == 'i' || next == 'e' || next == 'y') {
        *r++ = 'J';
      } else if (next != 'h' && next != 'n') {
        *r++ = 'K';
      } else if (next == 'h' && !(((nextnext) == 'a' || (nextnext) == 'e' || (nextnext) == 'i' || (nextnext) == 'o' || (nextnext) == 'u'))) {
        s++;
        next = tolower(*(s + 1));
      }
      break;
    case 'h':
      if (s == str || ((next) == 'a' || (next) == 'e' || (next) == 'i' || (next) == 'o' || (next) == 'u') || (temp = tolower(*(s - 1)) && ((temp) == 'a' || (temp) == 'e' || (temp) == 'i' || (temp) == 'o' || (temp) == 'u'))) {
        *r++ = 'H';
      }
      break;
    case 'j':
      *r++ = 'J';
      break;
    case 'k':
      if (s == str || tolower(*(s - 1)) != 'c') {
        *r++ = 'K';
      }
      break;
    case 'l':
      *r++ = 'L';
      break;
    case 'm':
      *r++ = 'M';
      break;
    case 'n':
      *r++ = 'N';
      break;
    case 'p':
      if (next == 'h') {
        *r++ = 'F';
        next = tolower(*(++s + 1));
      } else {
        *r++ = 'P';
      }
      break;
    case 'q':
      *r++ = 'K';
      break;
    case 'r':
      *r++ = 'R';
      break;
    case 's':
      if (next == 'h') {
        *r++ = 'X';
        next = tolower(*(++s + 1));
      } else if (next == 'i' && (nextnext == 'o' || nextnext == 'a')) {
        *r++ = 'X';
        s += 2;
        next = tolower(*(s + 1));
      } else {
        *r++ = 'S';
      }
      break;
    case 't':
      if (next == 'i' && (nextnext == 'a' || nextnext == 'o')) {
        *r++ = 'X';
      } else if (next == 'h') {
        *r++ = '0';
        next = tolower(*(++s + 1));
      } else if (next != 'c' || nextnext != 'h') {
        *r++ = 'T';
      }
      break;
    case 'v':
      *r++ = 'F';
      break;
    case 'w':
      if (s == str && next == 'h') {
        next = tolower(*(++s + 1));
      }
      if (((next) == 'a' || (next) == 'e' || (next) == 'i' || (next) == 'o' || (next) == 'u')) {
        *r++ = 'W';
      }
      break;
    case 'x':
      if (s == str) {
        if (next == 'h' || (next == 'i' && (nextnext == 'o' || nextnext == 'a'))) {
          *r++ = 'X';
        } else {
          *r++ = 'S';
        }
      } else {
        *r++ = 'K';
        *r++ = 'S';
      }
      break;
    case 'y':
      if (((next) == 'a' || (next) == 'e' || (next) == 'i' || (next) == 'o' || (next) == 'u')) {
        *r++ = 'Y';
      }
      break;
    case 'z':
      *r++ = 'S';
      break;
    case ' ':
      if (*r != ' ') {
        *r++ = ' ';
      }
      break;
    }
  }
  return result;
}
```