user: Converte this assembly snippet into its equivalent C code:

```asm
<imcd_float24_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%eax
  mov    %al,-0x40(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x2,-0x3c(%rbp)
  jg     L66
  mov    $0x0,%eax
  jmp    L100
L66:
  movl   $0x0,-0x30(%rbp)
  jmp    L80
L107:
  cmpb   $0x3c,-0x40(%rbp)
  jne    L142
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L45
L142:
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    (%rax),%eax
  mov    %eax,-0x24(%rbp)
L45:
  mov    -0x2c(%rbp),%eax
  and    $0x80,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x2c(%rbp),%eax
  and    $0x7f,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  shll   $0x8,-0xc(%rbp)
  mov    -0x24(%rbp),%eax
  or     %eax,-0xc(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x10(%rbp),%eax
  or     -0xc(%rbp),%eax
  test   %eax,%eax
  jne    L42
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L65
L42:
  cmpl   $0x7f,-0x10(%rbp)
  jne    L79
  orl    $0x7f,-0x20(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L97
  mov    $0x80,%eax
  jmp    L121
L97:
  mov    $0xc0,%eax
L121:
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L65
L79:
  cmpl   $0x0,-0x10(%rbp)
  jne    L130
  movl   $0xffffffff,-0x8(%rbp)
L7:
  addl   $0x1,-0x8(%rbp)
  shll   -0xc(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x10000,%eax
  test   %eax,%eax
  je     L7
  mov    -0xc(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0xc(%rbp),%eax
  sar    $0x8,%eax
  and    $0xff,%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x10(%rbp),%eax
  add    $0x40,%eax
  sub    -0x8(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L44
L130:
  addl   $0x40,-0x10(%rbp)
L44:
  mov    -0x10(%rbp),%eax
  sar    %eax
  or     %eax,-0x20(%rbp)
  mov    -0x10(%rbp),%eax
  shl    $0x7,%eax
  movzbl %al,%edx
  mov    -0x28(%rbp),%eax
  sar    %eax
  and    $0x7f,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x28(%rbp),%eax
  shl    $0x7,%eax
  movzbl %al,%edx
  mov    -0x24(%rbp),%eax
  sar    %eax
  and    $0x7f,%eax
  or     %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x7,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
L65:
  mov    -0x48(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x14(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x20(%rbp),%edx
  mov    %edx,(%rax)
  addl   $0x3,-0x30(%rbp)
L80:
  mov    -0x30(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L107
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
L100:
  pop    %rbp
  ret
```

assistant: ```c
ssize_t imcd_float24_decode(const uint8_t *src, const ssize_t srcsize, uint8_t *dst, const char byteorder) {
  ssize_t i;
  uint8_t s0, s1, s2, f0, f1, f2, f3;
  uint8_t sign = 0;
  uint8_t exponent = 0;
  uint32_t mantissa = 0;
  if (srcsize < 3) {
    return 0;
  }
  for (i = 0; i < srcsize; i += 3) {
    if (byteorder == '<') {
      s2 = *src++;
      s1 = *src++;
      s0 = *src++;
    } else {
      s0 = *src++;
      s1 = *src++;
      s2 = *src++;
    }
    sign = s0 & 0x80;
    exponent = s0 & 0x7F;
    mantissa = s1;
    mantissa <<= 8;
    mantissa |= s2;
    f0 = sign;
    if ((exponent == 0) & (mantissa == 0)) {
      f1 = 0;
      f2 = 0;
      f3 = 0;
    } else if (exponent == 0x7F) {
      f0 |= 0x7F;
      f1 = (mantissa == 0) ? 0x80 : 0xC0;
      f2 = 0;
      f3 = 0;
    } else {
      if (exponent == 0) {
        int shift = -1;
        do {
          shift++;
          mantissa <<= 1;
        } while ((mantissa & 0x10000) == 0);
        s2 = mantissa & 0xFF;
        s1 = (mantissa >> 8) & 0xFF;
        exponent = exponent - 63 + 127 - shift;
      } else {
        exponent = exponent - 63 + 127;
      }
      f0 |= exponent >> 1;
      f1 = ((exponent & 0x01) << 7) | ((s1 & 0xFE) >> 1);
      f2 = ((s1 & 0x01) << 7) | ((s2 & 0xFE) >> 1);
      f3 = (s2 & 0x01) << 7;
    }
    *dst++ = f3;
    *dst++ = f2;
    *dst++ = f1;
    *dst++ = f0;
  }
  return (srcsize / 3) * 3;
}
```