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

```asm
<FS460_decode_bitmap_from_alpha_masks>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  lea    -0x2(%rcx),%edx
  mov    $0x1000,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x18(%rsp)
  cmp    $0xfffe,%edx
  ja     L116
  lea    -0x2(%r9),%edx
  cmp    $0xfffe,%edx
  ja     L116
  test   %r15,%r15
  je     L55
  test   %r8,%r8
  je     L55
  test   %rdi,%rdi
  je     L55
  test   %rsi,%rsi
  je     L55
  mov    (%rsi),%r12
  test   %r12,%r12
  je     L123
  mov    %ecx,%r14d
  mov    $0x1,%r13d
  mov    $0x2d0,%ebp
  jmp    L131
  nopl   0x0(%rax)
L150:
  movzwl (%r15),%esi
  sub    $0x2,%r14d
  add    $0x2,%r15
  mov    %esi,%eax
  shr    $0x8,%ax
  movzwl %ax,%eax
L140:
  test   %eax,%eax
  cmove  %ebp,%eax
  movslq %eax,%rdx
  cmp    %r12,%rdx
  cmovg  %r12d,%eax
  cmp    %ebp,%eax
  cmovg  %ebp,%eax
  mov    %eax,%ebx
  movslq %eax,%rdx
  test   %eax,%eax
  jle    L20
  movslq %eax,%rdx
  movzbl %sil,%esi
  mov    %r9d,0x14(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %rdx,(%rsp)
  call   <memset@plt>
  mov    (%rsp),%rdx
  mov    0x14(%rsp),%r9d
  mov    %rax,%rdi
  mov    0x8(%rsp),%r8
  add    %rdx,%rdi
L20:
  sub    %rdx,%r12
  sub    %ebx,%ebp
  jne    L125
  xor    $0x1,%r13d
  mov    $0x2d0,%ebp
L125:
  test   %r14d,%r14d
  jle    L82
  test   %r9d,%r9d
  jle    L82
  test   %r12,%r12
  je     L108
L131:
  test   %r13d,%r13d
  jne    L150
  movzwl (%r8),%esi
  sub    $0x2,%r9d
  add    $0x2,%r8
  mov    %esi,%eax
  shr    $0x8,%ax
  movzwl %ax,%eax
  jmp    L140
L82:
  mov    0x18(%rsp),%rax
  mov    (%rax),%rax
  mov    %rax,(%rsp)
  sub    %r12,%rax
  mov    %rax,%r12
L123:
  mov    0x18(%rsp),%rax
  mov    %r12,(%rax)
  xor    %eax,%eax
L116:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L55:
  add    $0x28,%rsp
  mov    $0x1000,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  mov    0x18(%rsp),%rax
  mov    (%rax),%r12
  mov    0x18(%rsp),%rax
  mov    %r12,(%rax)
  xor    %eax,%eax
  jmp    L116
```

assistant: ```c
int FS460_decode_bitmap_from_alpha_masks(unsigned char *p_alpha_values, long *p_alpha_value_size, const unsigned short *p_alpha_mask_odd, int mask_size_odd, const unsigned short *p_alpha_mask_even, int mask_size_even) {
  long alpha_value_size;
  unsigned char *p_a;
  const unsigned short *p_mo, *p_me;
  unsigned char alpha;
  int count, remainder, i;
  int is_odd;
  if ((mask_size_odd > 0x10000) || (mask_size_odd < 2) || (mask_size_even > 0x10000) || (mask_size_even < 2) || !p_alpha_mask_odd || !p_alpha_mask_even || !p_alpha_values || !p_alpha_value_size) {
    return 0x1000;
  }
  alpha_value_size = *p_alpha_value_size;
  p_a = p_alpha_values;
  p_mo = p_alpha_mask_odd;
  p_me = p_alpha_mask_even;
  is_odd = 1;
  remainder = 720;
  while ((mask_size_odd > 0) && (mask_size_even > 0) && alpha_value_size) {
    if (is_odd) {
      count = (*p_mo) >> 8;
      alpha = (unsigned char)(0xFF & *p_mo);
      p_mo++;
      mask_size_odd -= 2;
    } else {
      count = (*p_me) >> 8;
      alpha = (unsigned char)(0xFF & *p_me);
      p_me++;
      mask_size_even -= 2;
    }
    if (!count)
      count = remainder;
    if (count > alpha_value_size)
      count = alpha_value_size;
    if (count > remainder)
      count = remainder;
    for (i = count; i > 0; i--)
      *(p_a++) = alpha;
    alpha_value_size -= count;
    remainder -= count;
    if (!remainder) {
      remainder = 720;
      is_odd = !is_odd;
    }
  }
  *p_alpha_value_size -= alpha_value_size;
  return 0;
}
```