user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<OA_SHOULD_CONVERT_PIX_FMT>:
  endbr64
  test   %esi,%esi
  je     L77
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %esi,%ebx
  mov    $0x0,%eax
  test   %edi,%edi
  je     L1
  mov    %esi,%edi
  call   <OA_IS_LUM_CHROM@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  je     L171
L1:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L171:
  mov    %ebx,%edi
  call   <OA_ISGREYSCALE@plt>
  test   %rax,%rax
  je     L88
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x2,%eax
  je     L182
L246:
  mov    %ebp,%edi
  call   <OA_ISBAYER@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L1
  mov    %ebp,%edi
  call   <OA_ISRGB@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L1
  mov    %ebp,%edi
  call   <OA_ISGREYSCALE@plt>
  test   %rax,%rax
  jne    L99
L88:
  mov    %ebx,%edi
  call   <OA_ISBAYER@plt>
  test   %rax,%rax
  je     L283
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x2,%eax
  je     L278
L254:
  mov    %ebp,%edi
  call   <OA_ISBAYER@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  je     L1
  mov    %ebx,%edi
  call   <OA_ISBAYER10@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jne    L1
  mov    %ebp,%edi
  call   <OA_CFA_PATTERN@plt>
  mov    %rax,%r12
  mov    %ebx,%edi
  call   <OA_CFA_PATTERN@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  cmp    %rdx,%r12
  jne    L1
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%edi
  call   <ceil@plt>
  mov    %eax,%ebp
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    %eax,%ebp
  setge  %al
  movzbl %al,%eax
  jmp    L1
L182:
  mov    %ebx,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L246
  jmp    L1
L99:
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%ebp
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    %eax,%ebp
  setge  %al
  movzbl %al,%eax
  jmp    L1
L278:
  mov    %ebx,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L254
  jmp    L1
L283:
  mov    %ebx,%edi
  call   <OA_ISRGB@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  je     L1
  mov    %ebx,%edi
  call   <OA_ISRB_SWAPPED@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jne    L1
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x6,%eax
  je     L41
L80:
  mov    %ebp,%edi
  call   <OA_ISGREYSCALE@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jne    L1
  mov    %ebp,%edi
  call   <OA_ISBAYER@plt>
  test   %rax,%rax
  je     L183
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x6,%eax
  je     L122
L118:
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
  jmp    L1
L41:
  mov    %ebx,%edi
  call   <OA_ISLITTLE_ENDIAN@plt>
  test   %eax,%eax
  jne    L80
  jmp    L1
L122:
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%edi
  call   <ceil@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  cmp    $0x1,%edx
  jg     L1
  jmp    L118
L183:
  mov    %ebp,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  mov    %eax,%ebp
  mov    %ebx,%edi
  call   <OA_BYTES_PER_PIXEL@plt>
  cmp    %eax,%ebp
  setge  %al
  movzbl %al,%eax
  jmp    L1
L77:
  mov    $0x0,%eax
  ret
```

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;
}
```