user: Translate the below assembly code into C programming language:

```asm
<nysiis>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    %rax,%rbp
  mov    %rbx,%rdi
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L444
  cmpb   $0x0,(%rax)
  jne    L412
L444:
  mov    %r12,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L412:
  lea    0x1(%rbp),%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L282
  mov    $0x3,%edx
  lea    D34(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L494
  movb   $0x43,0x1(%r12)
L229:
  lea    -0x1(%r12,%rbp,1),%rdx
  movzbl (%rdx),%eax
  cmp    $0x45,%al
  je     L179
  cmp    $0x54,%al
  je     L135
  cmp    $0x44,%al
  je     L466
L72:
  lea    0x1(%r12),%rbp
  lea    0x1(%r15),%r14
  movsbl (%r12),%edi
  call   <toupper@plt>
  mov    %al,(%r15)
  mov    %r14,%rbx
  lea    D28(%rip),%r13
  jmp    L378
L282:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r15,%r12
  jmp    L444
L494:
  mov    $0x3,%edx
  lea    D1(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L249
  movb   $0x4e,(%r12)
  jmp    L229
L249:
  cmpb   $0x4b,(%r12)
  jne    L413
  movb   $0x43,(%r12)
  jmp    L229
L413:
  mov    $0x2,%edx
  lea    D3(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L273
  movb   $0x46,(%r12)
  movb   $0x46,0x1(%r12)
  jmp    L229
L273:
  mov    $0x3,%edx
  lea    D10(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L229
  movb   $0x53,0x1(%r12)
  movb   $0x53,0x2(%r12)
  jmp    L229
L179:
  lea    -0x2(%r12,%rbp,1),%rcx
  movzbl (%rcx),%eax
  sub    $0x45,%eax
  test   $0xfb,%al
  jne    L72
  movb   $0x20,(%rdx)
  movb   $0x59,(%rcx)
  jmp    L72
L135:
  lea    -0x2(%r12,%rbp,1),%rax
  movzbl (%rax),%ecx
  lea    -0x4e(%rcx),%esi
  test   $0xfb,%sil
  je     L463
  cmp    $0x44,%cl
  jne    L72
L463:
  movb   $0x20,(%rdx)
  movb   $0x44,(%rax)
  jmp    L72
L466:
  lea    -0x2(%r12,%rbp,1),%rcx
  movzbl (%rcx),%eax
  sub    $0x4e,%eax
  test   $0xfb,%al
  jne    L72
  movb   $0x20,(%rdx)
  movb   $0x44,(%rcx)
  jmp    L72
  movsbl 0x1(%rbp),%edi
  call   <toupper@plt>
  cmp    $0x56,%al
  je     L11
  movb   $0x41,(%rbx)
L160:
  movzbl -0x1(%rbx),%eax
  cmp    %al,(%rbx)
  jne    L130
  cmp    %r14,%rbx
  jne    L211
L130:
  add    $0x1,%rbx
L211:
  add    $0x1,%rbp
L378:
  movsbl 0x0(%rbp),%edi
  call   <toupper@plt>
  test   $0xdf,%al
  je     L206
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  ja     L402
  movzbl %dl,%edx
  movslq 0x0(%r13,%rdx,4),%rdx
  add    %r13,%rdx
  notrack jmp *%rdx
L11:
  movb   $0x41,(%rbx)
  movb   $0x46,0x1(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L160
  movb   $0x47,(%rbx)
  jmp    L160
  movb   $0x53,(%rbx)
  jmp    L160
  movb   $0x4e,(%rbx)
  jmp    L160
  movsbl 0x1(%rbp),%edi
  call   <toupper@plt>
  cmp    $0x4e,%al
  mov    $0x43,%eax
  mov    $0x4e,%edx
  cmove  %edx,%eax
  mov    %al,(%rbx)
  jmp    L160
  movsbl 0x1(%rbp),%edi
  call   <toupper@plt>
  cmp    $0x43,%al
  je     L172
L587:
  movb   $0x53,(%rbx)
  jmp    L160
L172:
  movsbl 0x2(%rbp),%edi
  call   <toupper@plt>
  cmp    $0x48,%al
  jne    L587
  movb   $0x53,(%rbx)
  movb   $0x53,0x1(%rbx)
  movb   $0x53,0x2(%rbx)
  lea    0x2(%rbx),%rbx
  jmp    L160
  movsbl 0x1(%rbp),%edi
  call   <toupper@plt>
  cmp    $0x48,%al
  je     L334
  movb   $0x50,(%rbx)
  jmp    L160
L334:
  movb   $0x46,(%rbx)
  movb   $0x46,0x1(%rbx)
  lea    0x1(%rbx),%rbx
  jmp    L160
  movsbl 0x1(%rbp),%edi
  call   <toupper@plt>
  mov    %al,0xf(%rsp)
  movsbl -0x1(%rbp),%edi
  call   <toupper@plt>
  movzbl 0xf(%rsp),%edx
  sub    $0x41,%edx
  cmp    $0x14,%dl
  ja     L410
  mov    $0x104111,%ecx
  bt     %rdx,%rcx
  jae    L410
  lea    -0x41(%rax),%edx
  cmp    $0x14,%dl
  ja     L410
  bt     %rdx,%rcx
  jae    L410
  movb   $0x48,(%rbx)
  jmp    L160
L410:
  mov    %al,(%rbx)
  jmp    L160
  movsbl -0x1(%rbp),%edi
  call   <toupper@plt>
  mov    %eax,%edx
  and    $0xfffffffb,%edx
  cmp    $0x41,%dl
  je     L445
  lea    -0x49(%rax),%edx
  cmp    $0xc,%dl
  ja     L148
  mov    $0x1041,%ecx
  bt     %rdx,%rcx
  jb     L445
L148:
  movb   $0x57,(%rbx)
  jmp    L160
L445:
  mov    %al,(%rbx)
  jmp    L160
L402:
  movsbl %al,%edi
  call   <toupper@plt>
  mov    %al,(%rbx)
  jmp    L160
L206:
  movb   $0x0,(%rbx)
  movzbl -0x1(%rbx),%eax
  cmp    $0x53,%al
  je     L408
  cmp    $0x59,%al
  je     L399
L515:
  cmpb   $0x41,-0x1(%rbx)
  je     L362
L214:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r15,%r12
  jmp    L444
L408:
  movb   $0x0,-0x1(%rbx)
  lea    -0x1(%rbx),%rbx
  jmp    L515
L399:
  cmpb   $0x41,-0x2(%rbx)
  jne    L214
  movb   $0x0,-0x1(%rbx)
  movb   $0x59,-0x2(%rbx)
  lea    -0x2(%rbx),%rbx
  jmp    L515
L362:
  movb   $0x0,-0x1(%rbx)
  jmp    L214
```

tool_calls: name: retrieve_data
arguments: label: D34
type_infered: string
name: retrieve_data
arguments: label: D1
type_infered: string
name: retrieve_data
arguments: label: D3
type_infered: string
name: retrieve_data
arguments: label: D10
type_infered: string

tool: D34: MAC

tool: D1: KN

tool: D3: PH

tool: D10: SCH

assistant: ```c
char *nysiis(const char *str) {
  size_t len = strlen(str);
  char c1, c2, c3;
  char *copy, *code;
  char *p, *cp;
  copy = strdup(str);
  if (!copy) {
    return NULL;
  }
  if (!*copy) {
    return copy;
  }
  code = malloc(len + 1 * sizeof(char));
  if (!code) {
    free(copy);
    return NULL;
  }
  if (!strncmp(copy, "MAC", 3)) {
    copy[1] = 'C';
  } else if (!strncmp(copy, "KN", 3)) {
    copy[0] = 'N';
  } else if (copy[0] == 'K') {
    copy[0] = 'C';
  } else if (!strncmp(copy, "PH", 2)) {
    copy[0] = 'F';
    copy[1] = 'F';
  } else if (!strncmp(copy, "SCH", 3)) {
    copy[1] = 'S';
    copy[2] = 'S';
  }
  c1 = copy[len - 1];
  if (c1 == 'E') {
    c2 = copy[len - 2];
    if (c2 == 'E' || c2 == 'I') {
      copy[len - 1] = ' ';
      copy[len - 2] = 'Y';
    }
  } else if (c1 == 'T') {
    c2 = copy[len - 2];
    if (c2 == 'D' || c2 == 'R' || c2 == 'N') {
      copy[len - 1] = ' ';
      copy[len - 2] = 'D';
    }
  } else if (c1 == 'D') {
    c2 = copy[len - 2];
    if (c2 == 'R' || c2 == 'N') {
      copy[len - 1] = ' ';
      copy[len - 2] = 'D';
    }
  }
  cp = code;
  p = copy;
  *(cp++) = toupper(*(p++));
  while ((c1 = toupper(*p))) {
    if (c1 == ' ') {
      break;
    }
    switch (c1) {
    case 'E':
      if (toupper(*(p + 1)) == 'V') {
        *cp = 'A';
        *(++cp) = 'F';
        break;
      }
    case 'A':
    case 'I':
    case 'O':
    case 'U':
      *cp = 'A';
      break;
    case 'Q':
      *cp = 'G';
      break;
    case 'Z':
      *cp = 'S';
      break;
    case 'M':
      *cp = 'N';
      break;
    case 'K':
      if (toupper(*(p + 1)) == 'N') {
        *cp = 'N';
      } else {
        *cp = 'C';
      }
      break;
    case 'S':
      if (toupper(*(p + 1)) == 'C' && toupper(*(p + 2)) == 'H') {
        *(cp++) = 'S';
        *(cp++) = 'S';
        *cp = 'S';
      } else {
        *cp = 'S';
      }
      break;
    case 'P':
      if (toupper(*(p + 1)) == 'H') {
        *cp = 'F';
        *(++cp) = 'F';
      } else {
        *cp = 'P';
      }
      break;
    case 'H':
      c2 = toupper(*(p + 1));
      c3 = toupper(*(p - 1));
      if (!((c2) == 'A' || (c2) == 'E' || (c2) == 'I' || (c2) == 'O' || (c2) == 'U') || !((c3) == 'A' || (c3) == 'E' || (c3) == 'I' || (c3) == 'O' || (c3) == 'U')) {
        *cp = c3;
      } else {
        *cp = 'H';
      }
      break;
    case 'W':
      c2 = toupper(*(p - 1));
      if (((c2) == 'A' || (c2) == 'E' || (c2) == 'I' || (c2) == 'O' || (c2) == 'U')) {
        *cp = c2;
      } else {
        *cp = 'W';
      }
      break;
    default:
      *cp = toupper(c1);
    }
    if (*cp != *(cp - 1) || cp == code + 1) {
      cp++;
    }
    p++;
  }
  *cp = '\0';
  c1 = *(cp - 1);
  if (c1 == 'S') {
    *(--cp) = '\0';
  } else if (c1 == 'Y') {
    if (*(cp - 2) == 'A') {
      *(--cp) = '\0';
      *(--cp) = 'Y';
    }
  }
  if (*(cp - 1) == 'A') {
    *(cp - 1) = '\0';
  }
  free(copy);
  return code;
}
```