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

```asm
<pred_comp>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r11
  mov    %rsi,%rax
  mov    %edx,%esi
  mov    %ecx,%edi
  mov    0x20(%rsp),%ecx
  mov    0x28(%rsp),%ebp
  mov    0x30(%rsp),%ebx
  mov    0x38(%rsp),%r10d
  mov    %ebx,%edx
  sar    %edx
  add    %ecx,%edx
  imul   %esi,%edx
  movslq %edx,%rdx
  mov    %ebp,%r12d
  sar    %r12d
  add    %r9d,%r12d
  movslq %r12d,%r12
  add    %r12,%rdx
  add    %r11,%rdx
  imul   %esi,%ecx
  movslq %ecx,%rcx
  movslq %r9d,%r9
  add    %r9,%rcx
  add    %rcx,%rax
  mov    %ebp,%ecx
  or     %ebx,%ecx
  test   $0x1,%cl
  je     L362
  and    $0x1,%ebp
  and    $0x1,%ebx
  je     L242
  test   %ebp,%ebp
  je     L248
L242:
  test   %ebx,%ebx
  jne    L25
  test   %ebp,%ebp
  jne    L375
L25:
  test   %r10d,%r10d
  jne    L291
  test   %r8d,%r8d
  jle    L217
  movslq %esi,%r9
  lea    (%rdx,%r9,1),%r11
  mov    %edi,%ebp
  jmp    L386
L362:
  test   %r10d,%r10d
  jne    L4
  mov    %edi,%r11d
  movslq %esi,%r9
  test   %r8d,%r8d
  jg     L483
L217:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L4:
  mov    $0x0,%r11d
  mov    %edi,%r10d
  movslq %esi,%rbx
  test   %r8d,%r8d
  jg     L227
  jmp    L217
L65:
  movzbl (%rax,%rcx,1),%r9d
  movzbl (%rdx,%rcx,1),%esi
  lea    0x1(%r9,%rsi,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rcx,%r10
  jne    L65
L408:
  add    %rbx,%rdx
  add    %rbx,%rax
  add    $0x1,%r11d
  cmp    %r11d,%r8d
  je     L217
L227:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L65
  jmp    L408
L532:
  movzbl (%rdx,%rcx,1),%esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %r11,%rcx
  jne    L532
L277:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%r10d
  cmp    %r10d,%r8d
  je     L217
L483:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L532
  jmp    L277
L248:
  test   %r10d,%r10d
  jne    L174
  test   %r8d,%r8d
  jle    L217
  movslq %esi,%r12
  lea    (%rdx,%r12,1),%rbp
  mov    %edi,%r9d
  jmp    L39
L174:
  test   %r8d,%r8d
  jle    L217
  movslq %esi,%r9
  lea    (%rdx,%r9,1),%r11
  mov    $0x0,%ebp
  mov    %edi,%ebx
  jmp    L315
L157:
  movzbl (%rdx,%rcx,1),%r10d
  movzbl (%r11,%rcx,1),%esi
  lea    0x1(%r10,%rsi,1),%esi
  shr    %esi
  movzbl (%rax,%rcx,1),%r10d
  lea    0x1(%rsi,%r10,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rcx,%rbx
  jne    L157
L32:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%ebp
  add    %r9,%r11
  cmp    %ebp,%r8d
  je     L217
L315:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L157
  jmp    L32
L302:
  movzbl (%rdx,%rcx,1),%ebx
  movzbl 0x0(%rbp,%rcx,1),%r11d
  lea    0x1(%rbx,%r11,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rcx,%r9
  jne    L302
L58:
  add    %r12,%rdx
  add    %r12,%rax
  add    $0x1,%r10d
  add    %r12,%rbp
  cmp    %r10d,%r8d
  je     L217
L39:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L302
  jmp    L58
L375:
  test   %r10d,%r10d
  jne    L444
  mov    %edi,%ebp
  movslq %esi,%r9
  test   %r8d,%r8d
  jg     L85
  jmp    L217
L444:
  mov    $0x0,%ebp
  mov    %edi,%ebx
  movslq %esi,%r9
  test   %r8d,%r8d
  jg     L439
  jmp    L217
L79:
  movzbl (%rdx,%rcx,1),%r11d
  movzbl 0x1(%rdx,%rcx,1),%r10d
  lea    0x1(%r11,%r10,1),%esi
  shr    %esi
  movzbl (%rax,%rcx,1),%r10d
  lea    0x1(%rsi,%r10,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rcx,%rbx
  jne    L79
L74:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%ebp
  cmp    %ebp,%r8d
  je     L217
L439:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L79
  jmp    L74
L11:
  movzbl (%rdx,%rcx,1),%ebx
  movzbl 0x1(%rdx,%rcx,1),%r11d
  lea    0x1(%rbx,%r11,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rcx,%rbp
  jne    L11
L512:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%r10d
  cmp    %r10d,%r8d
  je     L217
L85:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L11
  jmp    L512
L291:
  test   %r8d,%r8d
  jle    L217
  movslq %esi,%r9
  lea    (%rdx,%r9,1),%r10
  mov    $0x0,%ebx
  mov    %edi,%r11d
  jmp    L358
L154:
  movzbl (%rdx,%rcx,1),%esi
  movzbl 0x1(%rdx,%rcx,1),%ebp
  add    %ebp,%esi
  movzbl (%r10,%rcx,1),%ebp
  add    %ebp,%esi
  movzbl 0x1(%r10,%rcx,1),%ebp
  lea    0x2(%rsi,%rbp,1),%esi
  shr    $0x2,%esi
  movzbl (%rax,%rcx,1),%ebp
  lea    0x1(%rsi,%rbp,1),%esi
  shr    %esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %r11,%rcx
  jne    L154
L16:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%ebx
  add    %r9,%r10
  cmp    %ebx,%r8d
  je     L217
L358:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L154
  jmp    L16
L443:
  movzbl (%rdx,%rcx,1),%esi
  movzbl 0x1(%rdx,%rcx,1),%ebx
  add    %ebx,%esi
  movzbl (%r11,%rcx,1),%ebx
  add    %ebx,%esi
  movzbl 0x1(%r11,%rcx,1),%ebx
  lea    0x2(%rsi,%rbx,1),%esi
  shr    $0x2,%esi
  mov    %sil,(%rax,%rcx,1)
  add    $0x1,%rcx
  cmp    %rbp,%rcx
  jne    L443
L54:
  add    %r9,%rdx
  add    %r9,%rax
  add    $0x1,%r10d
  add    %r9,%r11
  cmp    %r10d,%r8d
  je     L217
L386:
  mov    $0x0,%ecx
  test   %edi,%edi
  jg     L443
  jmp    L54
```

assistant: ```c
void pred_comp(unsigned char *src, unsigned char *dst, signed int lx, signed int w, signed int h, signed int x, signed int y, signed int dx, signed int dy, signed int addflag) {
  signed int xint;
  signed int xh;
  signed int yint;
  signed int yh;
  signed int i;
  signed int j;
  unsigned char *s;
  unsigned char *d;
  xint = dx >> 1;
  xh = dx & 1;
  yint = dy >> 1;
  yh = dy & 1;
  s = src + (signed long int)(lx * (y + yint)) + (signed long int)(x + xint);
  d = dst + (signed long int)(lx * y) + (signed long int)x;
  if (xh == 0) {
    if (yh != 0)
      goto __CPROVER_DUMP_L10;
    if (!(addflag == 0)) {
      j = 0;
      while (!(j >= h)) {
        i = 0;
        while (!(i >= w)) {
          d[(signed long int)i] = (unsigned char)((unsigned int)((signed int)d[(signed long int)i] + (signed int)s[(signed long int)i] + 1) >> 1);
          i = i + 1;
        }
        s = s + (signed long int)lx;
        d = d + (signed long int)lx;
        j = j + 1;
      }
    } else {
      j = 0;
      while (!(j >= h)) {
        i = 0;
        while (!(i >= w)) {
          d[(signed long int)i] = s[(signed long int)i];
          i = i + 1;
        }
        s = s + (signed long int)lx;
        d = d + (signed long int)lx;
        j = j + 1;
      }
    }
  } else {
  __CPROVER_DUMP_L10:;
    if (xh == 0) {
      if (yh == 0)
        goto __CPROVER_DUMP_L20;
      if (!(addflag == 0)) {
        j = 0;
        while (!(j >= h)) {
          i = 0;
          while (!(i >= w)) {
            d[(signed long int)i] = (unsigned char)((unsigned int)d[(signed long int)i] + ((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + lx)] + 1) >> 1) + (unsigned int)1 >> 1);
            i = i + 1;
          }
          s = s + (signed long int)lx;
          d = d + (signed long int)lx;
          j = j + 1;
        }
      } else {
        j = 0;
        while (!(j >= h)) {
          i = 0;
          while (!(i >= w)) {
            d[(signed long int)i] = (unsigned char)((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + lx)] + 1) >> 1);
            i = i + 1;
          }
          s = s + (signed long int)lx;
          d = d + (signed long int)lx;
          j = j + 1;
        }
      }
    } else {
    __CPROVER_DUMP_L20:;
      if (!(xh == 0)) {
        if (yh != 0)
          goto __CPROVER_DUMP_L30;
        if (!(addflag == 0)) {
          j = 0;
          while (!(j >= h)) {
            i = 0;
            while (!(i >= w)) {
              d[(signed long int)i] = (unsigned char)((unsigned int)d[(signed long int)i] + ((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + 1)] + 1) >> 1) + (unsigned int)1 >> 1);
              i = i + 1;
            }
            s = s + (signed long int)lx;
            d = d + (signed long int)lx;
            j = j + 1;
          }
        } else {
          j = 0;
          while (!(j >= h)) {
            i = 0;
            while (!(i >= w)) {
              d[(signed long int)i] = (unsigned char)((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + 1)] + 1) >> 1);
              i = i + 1;
            }
            s = s + (signed long int)lx;
            d = d + (signed long int)lx;
            j = j + 1;
          }
        }
      } else {
      __CPROVER_DUMP_L30:;
        if (!(addflag == 0)) {
          j = 0;
          while (!(j >= h)) {
            i = 0;
            while (!(i >= w)) {
              d[(signed long int)i] = (unsigned char)((unsigned int)d[(signed long int)i] + ((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + 1)] + (signed int)s[(signed long int)(i + lx)] + (signed int)s[(signed long int)(i + lx + 1)] + 2) >> 2) + (unsigned int)1 >> 1);
              i = i + 1;
            }
            s = s + (signed long int)lx;
            d = d + (signed long int)lx;
            j = j + 1;
          }
        } else {
          j = 0;
          while (!(j >= h)) {
            i = 0;
            while (!(i >= w)) {
              d[(signed long int)i] = (unsigned char)((unsigned int)((signed int)s[(signed long int)i] + (signed int)s[(signed long int)(i + 1)] + (signed int)s[(signed long int)(i + lx)] + (signed int)s[(signed long int)(i + lx + 1)] + 2) >> 2);
              i = i + 1;
            }
            s = s + (signed long int)lx;
            d = d + (signed long int)lx;
            j = j + 1;
          }
        }
      }
    }
  }
}
```