user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<MFRC522_ToCard>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r12
  mov    %edx,%ebx
  mov    %rcx,(%rsp)
  mov    %r8,0x8(%rsp)
  movsbl %dil,%r15d
  cmp    $0xc,%dil
  je     L21
  cmp    $0xe,%dil
  mov    $0x0,%ebp
  mov    $0x10,%eax
  cmove  %eax,%ebp
  mov    $0x0,%r14d
  mov    $0x12,%eax
  cmove  %eax,%r14d
L7:
  mov    %r14d,%esi
  or     $0xffffff80,%esi
  movsbl %sil,%esi
  mov    $0x2,%edi
  call   <MFRC522_Wr@plt>
  mov    $0x80,%esi
  mov    $0x4,%edi
  call   <MFRC522_Clear_Bit@plt>
  mov    $0x80,%esi
  mov    $0xa,%edi
  call   <MFRC522_Set_Bit@plt>
  mov    $0x0,%esi
  mov    $0x1,%edi
  call   <MFRC522_Wr@plt>
  movsbl %bl,%eax
  test   %eax,%eax
  je     L172
  mov    %r12,%rbx
  lea    -0x1(%rax),%eax
  lea    0x1(%r12,%rax,1),%r12
L0:
  movsbl (%rbx),%esi
  mov    $0x9,%edi
  call   <MFRC522_Wr@plt>
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L0
L172:
  mov    %r15d,%esi
  mov    $0x1,%edi
  call   <MFRC522_Wr@plt>
  cmp    $0xc,%r13b
  je     L131
L19:
  mov    $0x4,%edi
  call   <MFRC522_Rd@plt>
  mov    %eax,%ebx
  mov    $0xfffe,%r12d
  or     $0x1,%ebp
L112:
  test   %bl,%bpl
  jne    L178
  mov    $0x4,%edi
  call   <MFRC522_Rd@plt>
  mov    %eax,%ebx
  sub    $0x1,%r12d
  jne    L112
  mov    $0x80,%esi
  mov    $0xd,%edi
  call   <MFRC522_Clear_Bit@plt>
  mov    $0x2,%ebx
  jmp    L107
L21:
  mov    $0x30,%ebp
  mov    $0x77,%r14d
  jmp    L7
L131:
  mov    $0x80,%esi
  mov    $0xd,%edi
  call   <MFRC522_Set_Bit@plt>
  jmp    L19
L134:
  mov    $0xa,%edi
  call   <MFRC522_Rd@plt>
  mov    %eax,%ebp
  mov    $0xc,%edi
  call   <MFRC522_Rd@plt>
  and    $0x7,%eax
  je     L6
  movsbl %bpl,%edx
  movsbl %al,%eax
  lea    -0x8(%rax,%rdx,8),%eax
L63:
  mov    0x8(%rsp),%rdx
  mov    %eax,(%rdx)
  test   %bpl,%bpl
  je     L11
  mov    $0x10,%eax
  cmp    %al,%bpl
  cmovg  %eax,%ebp
  movsbl %bpl,%r12d
  test   %r12d,%r12d
  je     L48
  mov    $0x0,%ebp
L182:
  mov    $0x9,%edi
  call   <MFRC522_Rd@plt>
  mov    (%rsp),%rcx
  mov    %al,(%rcx,%rbp,1)
  add    $0x1,%rbp
  cmp    %ebp,%r12d
  ja     L182
  jmp    L61
L6:
  movsbl %bpl,%eax
  shl    $0x3,%eax
  jmp    L63
L178:
  mov    $0x80,%esi
  mov    $0xd,%edi
  call   <MFRC522_Clear_Bit@plt>
  mov    $0x6,%edi
  call   <MFRC522_Rd@plt>
  test   $0x1b,%al
  jne    L104
  and    %r14d,%ebx
  and    $0x1,%ebx
  cmp    $0xc,%r13b
  je     L134
L107:
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L104:
  mov    $0x2,%ebx
  jmp    L107
L11:
  mov    $0x9,%edi
  call   <MFRC522_Rd@plt>
  mov    (%rsp),%rdx
  mov    %al,(%rdx)
  mov    $0x1,%r12d
L61:
  test   %r12d,%r12d
  mov    $0x1,%eax
  cmove  %eax,%r12d
L48:
  mov    %r12d,%r12d
  mov    (%rsp),%rax
  movb   $0x0,(%rax,%r12,1)
  jmp    L107
```

assistant: ```c
char MFRC522_ToCard(char command, char *sendData, char sendLen, char *backData, unsigned *backLen) {
  char _status = 2;
  char irqEn = 0x00;
  char waitIRq = 0x00;
  char lastBits;
  char n;
  unsigned i;
  switch (command) {
  case 0x0E: {
    irqEn = 0x12;
    waitIRq = 0x10;
    break;
  }
  case 0x0C: {
    irqEn = 0x77;
    waitIRq = 0x30;
    break;
  }
  default:
    break;
  }
  MFRC522_Wr(0x02, irqEn | 0x80);
  MFRC522_Clear_Bit(0x04, 0x80);
  MFRC522_Set_Bit(0x0A, 0x80);
  MFRC522_Wr(0x01, 0x00);
  for (i = 0; i < sendLen; i++) {
    MFRC522_Wr(0x09, sendData[i]);
  }
  MFRC522_Wr(0x01, command);
  if (command == 0x0C) {
    MFRC522_Set_Bit(0x0D, 0x80);
  }
  i = 0xFFFF;
  do {
    n = MFRC522_Rd(0x04);
    i--;
  } while (i && !(n & 0x01) && !(n & waitIRq));
  MFRC522_Clear_Bit(0x0D, 0x80);
  if (i != 0) {
    if (!(MFRC522_Rd(0x06) & 0x1B)) {
      _status = 0;
      if (n & irqEn & 0x01) {
        _status = 1;
      }
      if (command == 0x0C) {
        n = MFRC522_Rd(0x0A);
        lastBits = MFRC522_Rd(0x0C) & 0x07;
        if (lastBits) {
          *backLen = (n - 1) * 8 + lastBits;
        } else {
          *backLen = n * 8;
        }
        if (n == 0) {
          n = 1;
        }
        if (n > 16) {
          n = 16;
        }
        for (i = 0; i < n; i++) {
          backData[i] = MFRC522_Rd(0x09);
        }
        backData[i] = 0;
      }
    } else {
      _status = 2;
    }
  }
  return _status;
}
```