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

```asm
<OA_SHOULD_CONVERT_PIX_FMT>:
  endbr64
  test   %esi,%esi
  je     L86
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  test   %edi,%edi
  je     L150
  mov    %esi,%edi
  mov    %esi,%ebp
  call   <OA_IS_LUM_CHROM@plt>
  test   %rax,%rax
  jne    L150
  mov    %ebp,%edi
  call   <OA_ISGREYSCALE@plt>
  test   %rax,%rax
  je     L39
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x2,%eax
  je     L32
L44:
  mov    %r12d,%edi
  call   <OA_ISBAYER@plt>
  test   %rax,%rax
  jne    L33
  mov    %r12d,%edi
  call   <OA_ISRGB@plt>
  test   %rax,%rax
  je     L285
L33:
  mov    $0x1,%eax
  jmp    L246
  cs nopw 0x0(%rax,%rax,1)
L271:
  call   <OA_ISRGB@plt>
  test   %rax,%rax
  jne    L23
  xchg   %ax,%ax
L150:
  xor    %eax,%eax
L246:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L86:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  mov    %ebp,%edi
  call   <OA_ISBAYER@plt>
  mov    %ebp,%edi
  test   %rax,%rax
  je     L271
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x2,%eax
  je     L161
L180:
  mov    %r12d,%edi
  call   <OA_ISBAYER@plt>
  test   %rax,%rax
  je     L150
  mov    %ebp,%edi
  call   <OA_ISBAYER10@plt>
  test   %rax,%rax
  jne    L150
  mov    %r12d,%edi
  call   <OA_CFA_PATTERN@plt>
  mov    %ebp,%edi
  mov    %rax,%rbx
  call   <OA_CFA_PATTERN@plt>
  cmp    %rax,%rbx
  jne    L150
  mov    %r12d,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%edi
  call   <ceil@plt>
L196:
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    %eax,%ebx
  setge  %al
  movzbl %al,%eax
  jmp    L246
  nopw   0x0(%rax,%rax,1)
L285:
  mov    %r12d,%edi
  call   <OA_ISGREYSCALE@plt>
  test   %rax,%rax
  je     L39
L200:
  mov    %r12d,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  jmp    L196
  nop
L161:
  mov    %ebp,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L180
  jmp    L150
L23:
  mov    %ebp,%edi
  call   <OA_ISRB_SWAPPED@plt>
  test   %rax,%rax
  jne    L150
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x6,%eax
  je     L266
L156:
  mov    %r12d,%edi
  call   <OA_ISGREYSCALE@plt>
  test   %rax,%rax
  jne    L150
  mov    %r12d,%edi
  call   <OA_ISBAYER@plt>
  test   %rax,%rax
  je     L200
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x6,%eax
  je     L301
L309:
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L246
  nopl   0x0(%rax,%rax,1)
L32:
  mov    %ebp,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L44
  jmp    L150
L266:
  mov    %ebp,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L156
  jmp    L150
L301:
  mov    %r12d,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%edi
  call   <ceil@plt>
  sub    $0x1,%eax
  jg     L33
  jmp    L309
```

assistant: ```c
int OA_SHOULD_CONVERT_PIX_FMT(int I, int O) {
  if (!O || !I)
    return 0;
  if (OA_IS_LUM_CHROM(O))
    return 0;
  if (OA_ISGREYSCALE(O)) {
    if (OA_BYTES_PER_PIXEL(O) == 2 && !OA_ISLITTLE_ENDIAN(O))
      return 0;
    if (OA_ISBAYER(I) || OA_ISRGB(I)) {
      return 1;
    }
    if (OA_ISGREYSCALE(I))
      return OA_BYTES_PER_PIXEL(I) >= OA_BYTES_PER_PIXEL(O);
  }
  if (OA_ISBAYER(O)) {
    if (OA_BYTES_PER_PIXEL(O) == 2 && !OA_ISLITTLE_ENDIAN(O))
      return 0;
    if (!OA_ISBAYER(I))
      return 0;
    if (OA_ISBAYER10(O))
      return 0;
    return (OA_CFA_PATTERN(I) == OA_CFA_PATTERN(O)) && (ceil(OA_BYTES_PER_PIXEL(I)) >= OA_BYTES_PER_PIXEL(O));
  }
  if (OA_ISRGB(O)) {
    if (OA_ISRB_SWAPPED(O))
      return 0;
    if (OA_BYTES_PER_PIXEL(O) == 6 && !OA_ISLITTLE_ENDIAN(O))
      return 0;
    if (OA_ISGREYSCALE(I))
      return 0;
    if (OA_ISBAYER(I)) {
      return (6 == OA_BYTES_PER_PIXEL(O) && (ceil(OA_BYTES_PER_PIXEL(I)) > 1)) || (3 == OA_BYTES_PER_PIXEL(O));
    }
    return OA_BYTES_PER_PIXEL(I) >= OA_BYTES_PER_PIXEL(O);
  }
  return 0;
}
```