user: Demonstrate the C code that generates the assembly output below:

```asm
<CG_DrawFieldWidth>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %esi,-0x48(%rbp)
  mov    %edx,-0x4c(%rbp)
  mov    %ecx,-0x50(%rbp)
  mov    %r8d,-0x54(%rbp)
  mov    %r9d,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x30(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jg     L179
  mov    $0x0,%eax
  jmp    L43
L179:
  cmpl   $0x5,-0x4c(%rbp)
  jle    L85
  movl   $0x5,-0x4c(%rbp)
L85:
  cmpl   $0x4,-0x4c(%rbp)
  je     L127
  cmpl   $0x4,-0x4c(%rbp)
  jg     L28
  cmpl   $0x3,-0x4c(%rbp)
  je     L60
  cmpl   $0x3,-0x4c(%rbp)
  jg     L28
  cmpl   $0x1,-0x4c(%rbp)
  je     L67
  cmpl   $0x2,-0x4c(%rbp)
  je     L117
  jmp    L28
L67:
  mov    -0x50(%rbp),%eax
  mov    $0x9,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    $0x0,%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  mov    %eax,-0x50(%rbp)
  jmp    L28
L117:
  mov    -0x50(%rbp),%eax
  mov    $0x63,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    $0xfffffff7,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,-0x50(%rbp)
  jmp    L28
L60:
  mov    -0x50(%rbp),%eax
  mov    $0x3e7,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    $0xffffff9d,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,-0x50(%rbp)
  jmp    L28
L127:
  mov    -0x50(%rbp),%eax
  mov    $0x270f,%edx
  cmp    %edx,%eax
  cmovg  %edx,%eax
  mov    %eax,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  mov    $0xfffffc19,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,-0x50(%rbp)
  nop
L28:
  mov    -0x50(%rbp),%edx
  lea    -0x20(%rbp),%rax
  mov    %edx,%ecx
  lea    D3(%rip),%rdx
  mov    $0x10,%esi
  mov    %rax,%rdi
  call   <Com_sprintf@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jle    L92
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x34(%rbp)
L92:
  lea    -0x20(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L81
L53:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L72
  movl   $0xa,-0x2c(%rbp)
  jmp    L128
L72:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x2c(%rbp)
L128:
  mov    -0x54(%rbp),%eax
  add    %eax,-0x30(%rbp)
  addq   $0x1,-0x28(%rbp)
  subl   $0x1,-0x34(%rbp)
L81:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L61
  cmpl   $0x0,-0x34(%rbp)
  jne    L53
L61:
  mov    -0x30(%rbp),%eax
L43:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L106
  call   <__stack_chk_fail@plt>
L106:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D3
type_guessed: string

tool: D3: %i

assistant: ```c
int CG_DrawFieldWidth(int x, int y, int width, int value, int charWidth, int charHeight) {
  char num[16], *ptr;
  int l;
  int frame;
  int totalwidth = 0;
  if (width < 1) {
    return 0;
  }
  if (width > 5) {
    width = 5;
  }
  switch (width) {
  case 1:
    value = value > 9 ? 9 : value;
    value = value < 0 ? 0 : value;
    break;
  case 2:
    value = value > 99 ? 99 : value;
    value = value < -9 ? -9 : value;
    break;
  case 3:
    value = value > 999 ? 999 : value;
    value = value < -99 ? -99 : value;
    break;
  case 4:
    value = value > 9999 ? 9999 : value;
    value = value < -999 ? -999 : value;
    break;
  }
  Com_sprintf(num, sizeof(num), "%i", value);
  l = strlen(num);
  if (l > width) {
    l = width;
  }
  ptr = num;
  while (*ptr && l) {
    if (*ptr == '-') {
      frame = 10;
    } else {
      frame = *ptr - '0';
    }
    totalwidth += charWidth;
    ptr++;
    l--;
  }
  return totalwidth;
}
```