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

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  jmp    L0
  xchg   %ax,%ax
L65:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L206
  movsbl %al,%eax
  mov    %eax,0x10(%rsp,%rbx,4)
  add    $0x1,%rbx
L0:
  xor    %eax,%eax
  mov    %ebx,%ebp
  call   <getchar@plt>
  cmp    $0xa,%al
  jne    L65
  lea    -0x1(%rbx),%edx
  test   %edx,%edx
  jle    L27
  lea    -0x2(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L59
  mov    %edx,%eax
  movdqu 0x14(%rsp),%xmm0
  shr    $0x2,%eax
  sub    $0x1,%eax
  pcmpeqd 0x10(%rsp),%xmm0
  pand   D1(%rip),%xmm0
  je     L68
  movdqu 0x24(%rsp),%xmm1
  pcmpeqd 0x20(%rsp),%xmm1
  psubd  %xmm1,%xmm0
L68:
  movdqa %xmm0,%xmm1
  mov    %edx,%ecx
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%ecx
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%eax
  add    $0x1,%eax
  test   $0x3,%dl
  je     L212
L184:
  lea    0x1(%rcx),%esi
  movslq %ecx,%r8
  movslq %esi,%rdi
  mov    0x10(%rsp,%rdi,4),%edi
  cmp    %edi,0x10(%rsp,%r8,4)
  jne    L164
  add    $0x1,%eax
L164:
  cmp    %edx,%esi
  jge    L212
  lea    0x2(%rcx),%esi
  movslq %esi,%r8
  mov    0x10(%rsp,%r8,4),%r8d
  cmp    %r8d,%edi
  jne    L99
  add    $0x1,%eax
L99:
  cmp    %esi,%edx
  jle    L212
  add    $0x3,%ecx
  movslq %ecx,%rcx
  cmp    %r8d,0x10(%rsp,%rcx,4)
  je     L60
L212:
  cmp    %eax,%ebp
  jne    L162
  cmp    $0x1,%ebp
  jne    L206
L162:
  lea    0xc(%rsp),%rsi
  lea    D8(%rip),%rdi
  call   <scanf@plt>
  lea    0x10(%rsp),%rbx
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L17:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L104
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <printArray@plt>
  subl   $0x1,0xc(%rsp)
L85:
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <nextPermutation@plt>
  test   %rax,%rax
  jne    L17
  jmp    L104
L206:
  lea    D0(%rip),%rdi
  call   <printf@plt>
L104:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L200
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L60:
  add    $0x1,%eax
  jmp    L212
L27:
  mov    $0x1,%eax
  jmp    L212
L59:
  mov    $0x1,%eax
  xor    %ecx,%ecx
  jmp    L184
L200:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D1
data_type: byte[16]
name: disassemble_data
arguments: label: D8
data_type: string
name: disassemble_data
arguments: label: D0
data_type: string

tool: {"D1": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: D8: %d

tool: D0: bad input

assistant: ```c
int main() {
  int numberArray[11];
  int numberSize = 0;
  int i;
  char n;
  while ((n = getchar()) != '\n') {
    if ((n < '0') || (n > '9')) {
      printf("bad input");
      return 0;
    }
    numberArray[numberSize] = n - '0';
    numberSize++;
  }
  int equality = 1;
  for (i = 0; i < numberSize - 1; i++)
    if (numberArray[i] == numberArray[i + 1])
      equality++;
  if (equality == numberSize) {
    if (numberSize != 1) {
      printf("bad input");
      return 0;
    }
  }
  int repeat;
  scanf("%d", &repeat);
  while ((nextPermutation(numberArray, numberSize)) && (repeat > 0)) {
    printArray(numberArray, numberSize);
    repeat--;
  }
  return 0;
}
```