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

```asm
<main>:
  endbr64
  push   %r15
  lea    D28(%rip),%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D42(%rip),%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x1a(%rsp),%r13
  mov    $0x1,%eax
  lea    0x27(%rsp),%rbx
  sub    %r13d,%eax
  mov    %r13,%r12
  lea    0x19(%rsp),%r14
  mov    %eax,0xc(%rsp)
  xchg   %ax,%ax
L102:
  mov    0xc(%rsp),%eax
  mov    %r15,%rdi
  lea    (%rax,%r12,1),%esi
  call   <printf@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  movzbl (%r12),%eax
  sub    $0x41,%eax
  cmp    $0x13,%al
  ja     L70
  lea    D23(%rip),%rdi
  movzbl %al,%eax
  movslq (%rdi,%rax,4),%rax
  add    %rdi,%rax
  notrack jmp *%rax
  movb   $0x3a,(%r12)
  nopl   0x0(%rax,%rax,1)
L70:
  add    $0x1,%r12
  cmp    %rbx,%r12
  jne    L102
L56:
  mov    %r13,%rsi
  nopl   0x0(%rax)
L203:
  mov    %r13,%rax
  nopl   0x0(%rax,%rax,1)
L65:
  movzbl (%rsi),%ecx
  movzbl (%rax),%edx
  cmp    %dl,%cl
  jge    L47
  mov    %cl,(%rax)
  mov    %dl,(%rsi)
L47:
  add    $0x1,%rax
  cmp    %rbx,%rax
  jne    L65
  add    $0x1,%rsi
  cmp    %rbx,%rsi
  jne    L203
  lea    D17(%rip),%rbp
  lea    D27(%rip),%r12
  cs nopw 0x0(%rax,%rax,1)
L29:
  movzbl 0x0(%r13),%edx
  lea    -0x3a(%rdx),%eax
  cmp    $0x4,%al
  ja     L3
  movzbl %al,%eax
  movslq (%r12,%rax,4),%rax
  add    %r12,%rax
  notrack jmp *%rax
  nopl   (%rax)
  movb   $0x4b,0x0(%r13)
  mov    $0x4b,%esi
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %rbp,%rdi
  add    $0x1,%r13
  call   <printf@plt>
  cmp    %rbx,%r13
  jne    L29
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
  movb   $0x51,0x0(%r13)
  mov    $0x51,%esi
  jmp    L20
  nopl   0x0(%rax)
  movb   $0x4a,0x0(%r13)
  mov    $0x4a,%esi
  jmp    L20
  nopl   0x0(%rax)
  movb   $0x54,0x0(%r13)
  mov    $0x54,%esi
  jmp    L20
  nopl   0x0(%rax)
  movb   $0x41,0x0(%r13)
  mov    $0x41,%esi
  jmp    L20
  movb   $0x3c,(%r12)
  add    $0x1,%r12
  cmp    %rbx,%r12
  jne    L102
  jmp    L56
  nopl   0x0(%rax,%rax,1)
  movb   $0x3d,(%r12)
  add    $0x1,%r12
  cmp    %rbx,%r12
  jne    L102
  jmp    L56
  nop
  movb   $0x3b,(%r12)
  add    $0x1,%r12
  cmp    %rbx,%r12
  jne    L102
  jmp    L56
  nopw   0x0(%rax,%rax,1)
  movb   $0x3e,(%r12)
  add    $0x1,%r12
  cmp    %rbx,%r12
  jne    L102
  jmp    L56
  nopw   0x0(%rax,%rax,1)
L3:
  movsbl %dl,%esi
  jmp    L20
L159:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D28
datatype: string
name: extract_symbolic_data
arguments: data_tag: D42
datatype: string
name: extract_symbolic_data
arguments: data_tag: D17
datatype: string

tool: D28: %d card:

tool: D42: %c

tool: D17: %c<

assistant: ```c
int main() {
  int i = 0, a;
  char card[14], enter;
  for (i = 0; i < 13; i++) {
    printf("%d card:", i + 1);
    scanf("%c", &card[i]);
    scanf("%c", &enter);
    switch (card[i]) {
    case 'T':
      card[i] = 58;
      break;
    case 'J':
      card[i] = 59;
      break;
    case 'Q':
      card[i] = 60;
      break;
    case 'K':
      card[i] = 61;
      break;
    case 'A':
      card[i] = 62;
      break;
    }
  }
  for (i = 0; i < 13; i++) {
    for (a = 0; a < 13; a++) {
      if (card[i] < card[a]) {
        int swap = card[a];
        card[a] = card[i];
        card[i] = swap;
      }
    }
  }
  for (i = 0; i < 13; i++) {
    switch (card[i]) {
    case 58:
      card[i] = 'T';
      break;
    case 59:
      card[i] = 'J';
      break;
    case 60:
      card[i] = 'Q';
      break;
    case 61:
      card[i] = 'K';
      break;
    case 62:
      card[i] = 'A';
      break;
    }
    printf("%c<", card[i]);
  }
}
```