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

```asm
<RepadBitmap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  cmpl   $0x8,-0x34(%rbp)
  je     L251
  cmpl   $0x8,-0x34(%rbp)
  ja     L245
  cmpl   $0x4,-0x34(%rbp)
  je     L24
  cmpl   $0x4,-0x34(%rbp)
  ja     L245
  cmpl   $0x1,-0x34(%rbp)
  je     L257
  cmpl   $0x2,-0x34(%rbp)
  je     L275
  jmp    L245
L257:
  mov    -0x3c(%rbp),%eax
  add    $0x7,%eax
  sar    $0x3,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L119
L275:
  mov    -0x3c(%rbp),%eax
  add    $0xf,%eax
  sar    $0x4,%eax
  add    %eax,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L119
L24:
  mov    -0x3c(%rbp),%eax
  add    $0x1f,%eax
  sar    $0x5,%eax
  shl    $0x2,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L119
L251:
  mov    -0x3c(%rbp),%eax
  add    $0x3f,%eax
  sar    $0x6,%eax
  shl    $0x3,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L119
L245:
  mov    $0x0,%eax
  jmp    L82
L119:
  cmpl   $0x8,-0x38(%rbp)
  je     L200
  cmpl   $0x8,-0x38(%rbp)
  ja     L84
  cmpl   $0x4,-0x38(%rbp)
  je     L66
  cmpl   $0x4,-0x38(%rbp)
  ja     L84
  cmpl   $0x1,-0x38(%rbp)
  je     L175
  cmpl   $0x2,-0x38(%rbp)
  je     L183
  jmp    L84
L175:
  mov    -0x3c(%rbp),%eax
  add    $0x7,%eax
  sar    $0x3,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L171
L183:
  mov    -0x3c(%rbp),%eax
  add    $0xf,%eax
  sar    $0x4,%eax
  add    %eax,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L171
L66:
  mov    -0x3c(%rbp),%eax
  add    $0x1f,%eax
  sar    $0x5,%eax
  shl    $0x2,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L171
L200:
  mov    -0x3c(%rbp),%eax
  add    $0x3f,%eax
  sar    $0x6,%eax
  shl    $0x3,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L171
L84:
  mov    $0x0,%eax
  jmp    L82
L171:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L112
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L112:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L158
L291:
  movl   $0x0,-0x14(%rbp)
  jmp    L45
L268:
  mov    -0x10(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x8(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x14(%rbp)
L45:
  mov    -0x14(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L268
  jmp    L87
L223:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  addl   $0x1,-0x14(%rbp)
L87:
  mov    -0x14(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L223
  mov    -0x20(%rbp),%eax
  sub    -0x3c(%rbp),%eax
  cltq
  add    %rax,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
L158:
  mov    -0x18(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L291
  mov    -0x1c(%rbp),%eax
  imul   -0x40(%rbp),%eax
L82:
  pop    %rbp
  ret
```

assistant: ```c
int RepadBitmap(char *pSrc, char *pDst, unsigned int srcPad, unsigned int dstPad, int width, int height) {
  int srcWidthBytes, dstWidthBytes;
  int row, col;
  char *pTmpSrc, *pTmpDst;
  switch (srcPad) {
  case 1:
    srcWidthBytes = (width + 7) >> 3;
    break;
  case 2:
    srcWidthBytes = ((width + 15) >> 4) << 1;
    break;
  case 4:
    srcWidthBytes = ((width + 31) >> 5) << 2;
    break;
  case 8:
    srcWidthBytes = ((width + 63) >> 6) << 3;
    break;
  default:
    return 0;
  }
  switch (dstPad) {
  case 1:
    dstWidthBytes = (width + 7) >> 3;
    break;
  case 2:
    dstWidthBytes = ((width + 15) >> 4) << 1;
    break;
  case 4:
    dstWidthBytes = ((width + 31) >> 5) << 2;
    break;
  case 8:
    dstWidthBytes = ((width + 63) >> 6) << 3;
    break;
  default:
    return 0;
  }
  width = srcWidthBytes;
  if (width > dstWidthBytes)
    width = dstWidthBytes;
  pTmpSrc = pSrc;
  pTmpDst = pDst;
  for (row = 0; row < height; row++) {
    for (col = 0; col < width; col++)
      *pTmpDst++ = *pTmpSrc++;
    while (col < dstWidthBytes) {
      *pTmpDst++ = '\0';
      col++;
    }
    pTmpSrc += srcWidthBytes - width;
  }
  return dstWidthBytes * height;
}
```