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

```asm
<fixpos>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebx
  mov    %edx,0x8(%rsp)
  mov    %ecx,%ebp
  mov    %r8d,%r15d
  mov    %edi,%eax
  imul   %esi,%eax
  test   %eax,%eax
  js     L307
  mov    %edi,%r13d
  neg    %r13d
  cmovs  %edi,%r13d
  mov    %esi,%r14d
  neg    %r14d
  cmovs  %esi,%r14d
  add    %edi,%ebx
  test   %ebx,%ebx
  setle  %al
  lea    0x72(%rax,%rax,4),%eax
  mov    %al,0xc(%rsp)
  lea    -0x1(%r13),%eax
  movslq %eax,%rbx
  imul   $0x66666667,%rbx,%rbx
  sar    $0x21,%rbx
  sar    $0x1f,%eax
  sub    %eax,%ebx
  lea    -0x1(%r14),%eax
  movslq %eax,%r12
  imul   $0x66666667,%r12,%r12
  sar    $0x21,%r12
  sar    $0x1f,%eax
  sub    %eax,%r12d
  cmp    %r12d,%ebx
  je     L108
  cmp    $0x35,%ecx
  jg     L303
  add    %r12d,%ebx
  cmp    $0x1,%ebx
  je     L315
  cmp    $0x2,%r12d
  je     L246
  cmp    $0xa,%r14d
  jne    L44
L51:
  sub    $0xa,%r13d
  mov    %r13d,%edx
  neg    %edx
  cmovs  %r13d,%edx
  lea    0x2(%rbp),%esi
  mov    %r15d,%r8d
  mov    $0x20,%ecx
  mov    0x8(%rsp),%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L108:
  cmp    $0x2,%ebx
  je     L27
  cmp    $0x1,%ebx
  jne    L229
  cmp    $0x35,%ecx
  setg   %al
  movzbl %al,%eax
  add    %eax,%ebp
  jmp    L260
L27:
  add    $0x2,%ebp
  jmp    L260
L229:
  test   %ebx,%ebx
  jne    L146
  cmp    $0x36,%ecx
  setl   %al
  movzbl %al,%eax
  add    %eax,%ebp
L260:
  cmp    %r14d,%r13d
  jle    L140
  sub    %r14d,%r13d
  mov    %r13d,%edx
  neg    %edx
  cmovs  %r13d,%edx
  lea    (%r12,%r12,4),%eax
  sub    %eax,%r14d
  imul   %r15d,%r14d
  mov    0x8(%rsp),%edi
  add    %r14d,%edi
  mov    %r15d,%r8d
  mov    $0x20,%ecx
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L146:
  mov    $0x0,%ebp
  jmp    L260
L140:
  movsbl 0xc(%rsp),%ecx
  mov    %r13d,%eax
  sub    %r14d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    (%rbx,%rbx,4),%eax
  sub    %eax,%r13d
  imul   %r15d,%r13d
  mov    0x8(%rsp),%edi
  add    %r13d,%edi
  mov    %r15d,%r8d
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L315:
  test   %r12d,%r12d
  je     L300
  movsbl 0xc(%rsp),%ebx
  sub    $0x5,%r14d
  mov    %r14d,%edx
  neg    %edx
  cmovs  %r14d,%edx
  mov    %ebx,%ecx
  mov    %ebp,%esi
  mov    0x8(%rsp),%r14d
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  cmp    $0x5,%r13d
  je     L9
  lea    -0x5(%r13),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    0x1(%rbp),%esi
  imul   %r15d,%r13d
  mov    %r14d,%edi
  add    %r13d,%edi
  mov    %r15d,%r8d
  mov    %ebx,%ecx
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L300:
  sub    $0x5,%r13d
  mov    %r13d,%edx
  neg    %edx
  cmovs  %r13d,%edx
  mov    $0x20,%ecx
  mov    %ebp,%esi
  mov    0x8(%rsp),%ebx
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  cmp    $0x5,%r14d
  je     L9
  lea    -0x5(%r14),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    0x1(%rbp),%esi
  imul   %r15d,%r14d
  mov    %ebx,%edi
  add    %r14d,%edi
  mov    %r15d,%r8d
  mov    $0x20,%ecx
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L246:
  cmp    $0xa,%r13d
  jne    L202
L295:
  movsbl 0xc(%rsp),%ecx
  sub    $0xa,%r14d
  mov    %r14d,%edx
  neg    %edx
  cmovs  %r14d,%edx
  lea    0x2(%rbp),%esi
  mov    %r15d,%r8d
  mov    0x8(%rsp),%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L202:
  movsbl 0xc(%rsp),%ecx
  lea    -0xa(%r13),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    -0x5(%r13),%edi
  imul   %r8d,%edi
  mov    0x8(%rsp),%eax
  lea    (%rdi,%rax,1),%edi
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L295
L44:
  lea    -0xa(%r14),%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    -0x5(%r14),%edi
  imul   %r8d,%edi
  mov    0x8(%rsp),%eax
  lea    (%rdi,%rax,1),%edi
  mov    $0x20,%ecx
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L51
L303:
  cmp    %r12d,%ebx
  jge    L233
  movsbl 0xc(%rsp),%r9d
  lea    (%r12,%r12,4),%eax
  mov    %eax,0xc(%rsp)
  sub    %r13d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    (%rcx,%rbx,1),%esi
  movslq %r13d,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  mov    %r13d,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%eax
  sub    %eax,%r13d
  imul   %r8d,%r13d
  mov    0x8(%rsp),%edi
  add    %r13d,%edi
  mov    %r9d,%ebx
  mov    %r9d,%ecx
  mov    $0x0,%eax
  call   <fixcol@plt>
  mov    0xc(%rsp),%eax
  cmp    %r14d,%eax
  je     L9
  sub    %r14d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    0x0(%rbp,%r12,1),%esi
  mov    %r15d,%r8d
  mov    %ebx,%ecx
  mov    0x8(%rsp),%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L233:
  lea    (%r12,%r12,4),%eax
  sub    %r14d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    (%rcx,%r12,1),%esi
  movslq %r14d,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x21,%rax
  mov    %r14d,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%eax
  sub    %eax,%r14d
  imul   %r8d,%r14d
  mov    0x8(%rsp),%r12d
  lea    (%r14,%r12,1),%edi
  mov    $0x20,%ecx
  mov    $0x0,%eax
  call   <fixcol@plt>
  lea    (%rbx,%rbx,4),%eax
  cmp    %r13d,%eax
  je     L9
  sub    %r13d,%eax
  mov    %eax,%edx
  neg    %edx
  cmovs  %eax,%edx
  lea    0x0(%rbp,%rbx,1),%esi
  mov    %r15d,%r8d
  mov    $0x20,%ecx
  mov    %r12d,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
L307:
  mov    %esi,%r13d
  neg    %r13d
  cmovs  %esi,%r13d
  test   %esi,%esi
  setle  %cl
  movzbl %cl,%ecx
  lea    0x72(%rcx,%rcx,4),%ecx
  add    $0x1,%ebp
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    0x8(%rsp),%r14d
  mov    %r14d,%edi
  mov    $0x0,%eax
  call   <fixcol@plt>
  mov    %r12d,%eax
  neg    %eax
  cmovs  %r12d,%eax
  cmp    %r13d,%eax
  jg     L25
L9:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  add    %ebx,%r12d
  mov    %r12d,%edx
  neg    %edx
  cmovs  %r12d,%edx
  imul   %r15d,%ebx
  mov    %r14d,%edi
  add    %ebx,%edi
  mov    %r15d,%r8d
  mov    $0x20,%ecx
  mov    %ebp,%esi
  mov    $0x0,%eax
  call   <fixcol@plt>
  jmp    L9
```

assistant: ```c
void fixpos(old, new, r, c, inc) int old, new, r, c, inc;
{
  register int o, n, nv;
  int ov, nc = 0;
  char col;
  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);
}
```