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

```asm
<GScr_StrTokByPixLen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x840,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x810(%rbp),%rax
  mov    %rax,-0x830(%rbp)
  mov    $0x0,%eax
  call   <Scr_GetNumParam@plt>
  cmp    $0x2,%eax
  je     L373
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <Scr_Error@plt>
L373:
  mov    $0x0,%edi
  call   <Scr_GetString@plt>
  mov    %rax,-0x818(%rbp)
  cmpq   $0x0,-0x818(%rbp)
  je     L420
  mov    -0x818(%rbp),%rcx
  lea    -0x810(%rbp),%rax
  mov    $0x800,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Q_strncpyz@plt>
  mov    -0x830(%rbp),%rax
  mov    %rax,-0x828(%rbp)
  mov    -0x830(%rbp),%rax
  mov    %rax,-0x820(%rbp)
  movl   $0x0,-0x840(%rbp)
  movl   $0x0,-0x83c(%rbp)
  movl   $0x0,-0x838(%rbp)
  mov    $0x1,%edi
  call   <Scr_GetFloat@plt>
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x834(%rbp)
  mov    $0x0,%eax
  call   <Scr_MakeArray@plt>
  jmp    L173
L138:
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x7e,%eax
  je     L297
  cmp    $0x7e,%eax
  jg     L294
  cmp    $0x7d,%eax
  je     L233
  cmp    $0x7d,%eax
  jg     L294
  cmp    $0x7c,%eax
  je     L76
  cmp    $0x7c,%eax
  jg     L294
  cmp    $0x7b,%eax
  je     L233
  cmp    $0x7b,%eax
  jg     L294
  cmp    $0x6e,%eax
  jg     L369
  cmp    $0x20,%eax
  jge    L5
  jmp    L294
L71:
  sub    $0x72,%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  mov    %rax,%rdx
  and    $0x152,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L15
  mov    %rax,%rdx
  and    $0x5,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L41
  and    $0x20,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L136
  jmp    L294
L5:
  sub    $0x20,%eax
  cmp    $0x4e,%eax
  ja     L294
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D28(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D28(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L369:
  cmp    $0x7a,%eax
  jg     L294
  cmp    $0x72,%eax
  jge    L71
  jmp    L294
  addl   $0x2,-0x838(%rbp)
  jmp    L335
  addl   $0x4,-0x838(%rbp)
  jmp    L335
L76:
  addl   $0x5,-0x838(%rbp)
  jmp    L335
L41:
  addl   $0x6,-0x838(%rbp)
  jmp    L335
  addl   $0x7,-0x838(%rbp)
  jmp    L335
L233:
  addl   $0x8,-0x838(%rbp)
  jmp    L335
L15:
  addl   $0x9,-0x838(%rbp)
  jmp    L335
  mov    -0x838(%rbp),%eax
  mov    %eax,-0x83c(%rbp)
  mov    -0x828(%rbp),%rax
  mov    %rax,-0x820(%rbp)
  addl   $0xa,-0x838(%rbp)
  jmp    L335
L297:
  addl   $0xb,-0x838(%rbp)
  jmp    L335
  addl   $0xc,-0x838(%rbp)
  jmp    L335
L136:
  addl   $0xd,-0x838(%rbp)
  jmp    L335
  addl   $0xe,-0x838(%rbp)
  jmp    L335
  addl   $0xf,-0x838(%rbp)
L294:
  addl   $0xc,-0x838(%rbp)
L335:
  mov    -0x838(%rbp),%eax
  cmp    -0x834(%rbp),%eax
  jl     L148
  cmpl   $0x1f,-0x840(%rbp)
  jg     L91
  mov    -0x834(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x83c(%rbp)
  jl     L232
  mov    -0x820(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x830(%rbp),%rax
  mov    %rax,%rdi
  call   <Scr_AddString@plt>
  mov    $0x0,%eax
  call   <Scr_AddArray@plt>
  mov    -0x820(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x830(%rbp)
  mov    -0x820(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x828(%rbp)
  movl   $0x0,-0x83c(%rbp)
  movl   $0x0,-0x838(%rbp)
  jmp    L37
L232:
  mov    -0x828(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x830(%rbp),%rax
  mov    %rax,%rdi
  call   <Scr_AddString@plt>
  mov    $0x0,%eax
  call   <Scr_AddArray@plt>
  mov    -0x828(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x830(%rbp)
  addq   $0x1,-0x828(%rbp)
  movl   $0x0,-0x83c(%rbp)
  movl   $0x0,-0x838(%rbp)
L37:
  addl   $0x1,-0x840(%rbp)
  jmp    L173
L148:
  addq   $0x1,-0x828(%rbp)
L173:
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L138
  jmp    L255
L91:
  nop
L255:
  mov    -0x830(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L194
  mov    -0x830(%rbp),%rax
  mov    %rax,%rdi
  call   <Scr_AddString@plt>
  mov    $0x0,%eax
  call   <Scr_AddArray@plt>
  jmp    L194
L420:
  nop
L194:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L350
  call   <__stack_chk_fail@plt>
L350:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D16
datatype: string

tool: D16: Usage: StrTokByPixLen(<string>, <float>)

assistant: ```c
void GScr_StrTokByPixLen() {
  char buffer[2048];
  char *string = buffer;
  if (Scr_GetNumParam() != 2) {
    Scr_Error("Usage: StrTokByPixLen(<string>, <float>)");
  }
  char *src = Scr_GetString(0);
  if (!src)
    return;
  else
    Q_strncpyz(buffer, src, sizeof(buffer));
  char *countstring = string;
  char *lastWordSpace = string;
  int lineBreakIndex = 0;
  int lWSHalfPixelCounter = 0;
  int halfPixelCounter = 0;
  int maxHalfPixel = 2.0 * Scr_GetFloat(1);
  Scr_MakeArray();
  while (*countstring) {
    switch (*countstring) {
    case '\'':
      halfPixelCounter += 2;
      break;
    case 'i':
    case 'j':
    case 'l':
    case '.':
    case ',':
    case ':':
    case ';':
    case '_':
    case '%':
      halfPixelCounter += 4;
      break;
    case 'f':
    case 'I':
    case '-':
    case '|':
      halfPixelCounter += 5;
      break;
    case 't':
    case 'r':
    case '!':
    case '/':
    case '\\':
    case '"':
      halfPixelCounter += 6;
      break;
    case '(':
    case ')':
    case '[':
    case ']':
      halfPixelCounter += 7;
      break;
    case 'T':
    case '{':
    case '}':
    case '*':
      halfPixelCounter += 8;
      break;
    case 'a':
    case 'c':
    case 'g':
    case 'k':
    case 's':
    case 'v':
    case 'x':
    case 'z':
    case 'F':
    case 'J':
    case 'L':
    case 'Y':
    case 'Z':
      halfPixelCounter += 9;
      break;
    case ' ':
      lWSHalfPixelCounter = halfPixelCounter;
      lastWordSpace = countstring;
    case 'd':
    case 'h':
    case 'n':
    case 'A':
    case 'P':
    case 'S':
    case 'V':
    case 'X':
    case '?':
      halfPixelCounter += 10;
      break;
    case 'B':
    case 'D':
    case 'G':
    case 'K':
    case 'O':
    case 'Q':
    case 'R':
    case 'U':
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
    case '$':
    case '<':
    case '>':
    case '=':
    case '+':
    case '^':
    case '~':
      halfPixelCounter += 11;
      break;
    case 'H':
    case 'N':
    case '#':
      halfPixelCounter += 12;
      break;
    case 'w':
    case '&':
      halfPixelCounter += 13;
      break;
    case 'W':
    case 'M':
    case '@':
      halfPixelCounter += 14;
      break;
    case 'm':
      halfPixelCounter += 15;
    default:
      halfPixelCounter += 12;
    }
    if (halfPixelCounter >= maxHalfPixel) {
      if (lineBreakIndex >= 32) {
        break;
      }
      if (lWSHalfPixelCounter >= maxHalfPixel / 3) {
        *lastWordSpace = 0;
        Scr_AddString(string);
        Scr_AddArray();
        string = &lastWordSpace[1];
        countstring = &lastWordSpace[1];
        lWSHalfPixelCounter = 0;
        halfPixelCounter = 0;
      } else {
        *countstring = 0;
        Scr_AddString(string);
        Scr_AddArray();
        string = &countstring[1];
        countstring = &countstring[1];
        lWSHalfPixelCounter = 0;
        halfPixelCounter = 0;
      }
      lineBreakIndex++;
    } else {
      countstring++;
    }
  }
  if (*string) {
    Scr_AddString(string);
    Scr_AddArray();
  }
}
```