user: What would the C source look like for the assembly code provided here?

```asm
<fixpos>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  imul   -0x28(%rbp),%eax
  test   %eax,%eax
  js     L230
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  test   %eax,%eax
  jle    L107
  mov    $0x72,%eax
  jmp    L111
L107:
  mov    $0x77,%eax
L111:
  mov    %al,-0x15(%rbp)
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  sub    $0x1,%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L302
  cmpl   $0x2,-0x8(%rbp)
  jne    L7
  mov    -0x30(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x14(%rbp)
L7:
  cmpl   $0x1,-0x8(%rbp)
  jne    L200
  cmpl   $0x35,-0x30(%rbp)
  jle    L240
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  jmp    L157
L240:
  mov    -0x30(%rbp),%eax
L157:
  mov    %eax,-0x14(%rbp)
L200:
  cmpl   $0x0,-0x8(%rbp)
  jne    L253
  cmpl   $0x35,-0x30(%rbp)
  jg     L99
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  jmp    L122
L99:
  mov    -0x30(%rbp),%eax
L122:
  mov    %eax,-0x14(%rbp)
L253:
  mov    -0xc(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jle    L315
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x4(%rbp),%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  neg    %eax
  mov    -0x10(%rbp),%ecx
  add    %ecx,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x2c(%rbp),%eax
  lea    (%rcx,%rax,1),%edi
  mov    -0x34(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L329
L315:
  movsbl -0x15(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x8(%rbp),%esi
  mov    %esi,%eax
  shl    $0x2,%eax
  add    %esi,%eax
  neg    %eax
  mov    -0xc(%rbp),%esi
  add    %esi,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%esi
  mov    -0x2c(%rbp),%eax
  lea    (%rsi,%rax,1),%edi
  mov    -0x34(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L329
L302:
  cmpl   $0x35,-0x30(%rbp)
  jg     L320
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cmp    $0x1,%eax
  jne    L234
  cmpl   $0x0,-0x4(%rbp)
  je     L39
  movsbl -0x15(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x34(%rbp),%edi
  mov    -0x30(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  cmpl   $0x5,-0xc(%rbp)
  je     L151
  movsbl -0x15(%rbp),%edx
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%ecx
  neg    %ecx
  cmovns %ecx,%eax
  mov    -0x30(%rbp),%ecx
  lea    0x1(%rcx),%esi
  mov    -0x34(%rbp),%ecx
  mov    %ecx,%edi
  imul   -0xc(%rbp),%edi
  mov    -0x2c(%rbp),%ecx
  add    %ecx,%edi
  mov    -0x34(%rbp),%ecx
  mov    %ecx,%r8d
  mov    %edx,%ecx
  mov    %eax,%edx
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L151
L39:
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x34(%rbp),%ecx
  mov    -0x30(%rbp),%esi
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  cmpl   $0x5,-0x10(%rbp)
  je     L151
  mov    -0x10(%rbp),%eax
  sub    $0x5,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    -0x30(%rbp),%edx
  lea    0x1(%rdx),%esi
  mov    -0x34(%rbp),%edx
  mov    %edx,%ecx
  imul   -0x10(%rbp),%ecx
  mov    -0x2c(%rbp),%edx
  lea    (%rcx,%rdx,1),%edi
  mov    -0x34(%rbp),%edx
  mov    %edx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%edx
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L151
L234:
  cmpl   $0x2,-0x4(%rbp)
  jne    L335
  cmpl   $0xa,-0xc(%rbp)
  je     L6
  movsbl -0x15(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  sub    $0xa,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0xc(%rbp),%eax
  sub    $0x5,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%esi
  mov    -0x2c(%rbp),%eax
  lea    (%rsi,%rax,1),%edi
  mov    -0x34(%rbp),%esi
  mov    -0x30(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
L6:
  movsbl -0x15(%rbp),%ecx
  mov    -0x10(%rbp),%eax
  sub    $0xa,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x30(%rbp),%eax
  lea    0x2(%rax),%esi
  mov    -0x34(%rbp),%edi
  mov    -0x2c(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L329
L335:
  cmpl   $0xa,-0x10(%rbp)
  je     L172
  mov    -0x10(%rbp),%eax
  sub    $0xa,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x10(%rbp),%eax
  sub    $0x5,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x2c(%rbp),%eax
  lea    (%rcx,%rax,1),%edi
  mov    -0x34(%rbp),%ecx
  mov    -0x30(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
L172:
  mov    -0xc(%rbp),%eax
  sub    $0xa,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x30(%rbp),%eax
  lea    0x2(%rax),%esi
  mov    -0x34(%rbp),%ecx
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L329
L320:
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jle    L275
  movsbl -0x15(%rbp),%edi
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,%esi
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%eax
  lea    (%rdx,%rax,1),%r9d
  mov    -0xc(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    %eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    -0x34(%rbp),%edx
  mov    %edx,%r8d
  mov    %edi,%ecx
  mov    %esi,%edx
  mov    %r9d,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cmp    %eax,-0x10(%rbp)
  je     L217
  movsbl -0x15(%rbp),%ecx
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x30(%rbp),%esi
  mov    -0x4(%rbp),%eax
  add    %eax,%esi
  mov    -0x34(%rbp),%edi
  mov    -0x2c(%rbp),%eax
  mov    %edi,%r8d
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L217
L275:
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,%esi
  mov    -0x30(%rbp),%edx
  mov    -0x4(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x10(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    %eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    -0x34(%rbp),%edx
  mov    %edx,%r8d
  mov    $0x20,%ecx
  mov    %esi,%edx
  mov    %edi,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  cmp    %eax,-0xc(%rbp)
  je     L217
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    -0xc(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x30(%rbp),%ecx
  mov    -0x8(%rbp),%eax
  lea    (%rcx,%rax,1),%esi
  mov    -0x34(%rbp),%ecx
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L217
L230:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  jle    L347
  mov    $0x72,%edi
  jmp    L222
L347:
  mov    $0x77,%edi
L222:
  mov    -0x30(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x34(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  mov    %ecx,%r8d
  mov    %edi,%ecx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  mov    -0x28(%rbp),%eax
  mov    %eax,%ecx
  neg    %ecx
  cmovns %ecx,%eax
  cmp    %eax,%edx
  jle    L11
  mov    -0x24(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    -0x30(%rbp),%edx
  lea    0x1(%rdx),%esi
  mov    -0x34(%rbp),%edx
  mov    %edx,%ecx
  imul   -0x28(%rbp),%ecx
  mov    -0x2c(%rbp),%edx
  lea    (%rcx,%rdx,1),%edi
  mov    -0x34(%rbp),%edx
  mov    %edx,%r8d
  mov    $0x20,%ecx
  mov    %eax,%edx
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L329
L151:
  nop
  jmp    L329
L217:
  nop
  jmp    L329
L11:
  nop
L329:
  leave
  ret
```

assistant: ```c
void fixpos(old, new, r, c, inc) int old, new, r, c, inc;
{
  int o, n, nv;
  int ov, nc;
  char col;
  nc = 0;
  if (old * new >= 0) {
    ov = abs(old);
    nv = abs(new);
    col = (old + new > 0 ? 'r' : 'w');
    o = (ov - 1) / 5;
    n = (nv - 1) / 5;
    if (o == n) {
      if (o == 2)
        nc = c + 2;
      if (o == 1)
        nc = c < 54 ? c : c + 1;
      if (o == 0)
        nc = c < 54 ? c + 1 : c;
      if (ov > nv)
        fixcol(r + inc * (nv - n * 5), nc, abs(ov - nv), ' ', inc);
      else
        fixcol(r + inc * (ov - o * 5), nc, abs(ov - nv), col, inc);
      return;
    } else {
      if (c < 54) {
        if (o + n == 1) {
          if (n) {
            fixcol(r, c, abs(nv - 5), col, inc);
            if (ov != 5)
              fixcol(r + inc * ov, c + 1, abs(ov - 5), col, inc);
          } else {
            fixcol(r, c, abs(ov - 5), ' ', inc);
            if (nv != 5)
              fixcol(r + inc * nv, c + 1, abs(nv - 5), ' ', inc);
          }
          return;
        }
        if (n == 2) {
          if (ov != 10)
            fixcol(r + inc * (ov - 5), c, abs(ov - 10), col, inc);
          fixcol(r, c + 2, abs(nv - 10), col, inc);
        } else {
          if (nv != 10)
            fixcol(r + inc * (nv - 5), c, abs(nv - 10), ' ', inc);
          fixcol(r, c + 2, abs(ov - 10), ' ', inc);
        }
        return;
      }
      if (n > o) {
        fixcol(r + inc * (ov % 5), c + o, abs(5 * n - ov), col, inc);
        if (nv != 5 * n)
          fixcol(r, c + n, abs(5 * n - nv), col, inc);
      } else {
        fixcol(r + inc * (nv % 5), c + n, abs(5 * n - nv), ' ', inc);
        if (ov != 5 * o)
          fixcol(r, c + o, abs(5 * o - ov), ' ', inc);
      }
      return;
    }
  }
  nv = abs(new);
  fixcol(r, c + 1, nv, new > 0 ? 'r' : 'w', inc);
  if (abs(old) <= abs(new))
    return;
  fixcol(r + inc * new, c + 1, abs(old + new), ' ', inc);
}
```