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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  jmp    L163
L158:
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
L163:
  mov    -0x40(%rbp),%eax
  mov    %eax,%edi
  call   <rightInt@plt>
  test   %eax,%eax
  je     L158
  movl   $0x0,-0x3c(%rbp)
  jmp    L136
L97:
  mov    -0x40(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x3c(%rbp),%eax
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x40(%rbp)
  addl   $0x1,-0x3c(%rbp)
L136:
  mov    -0x40(%rbp),%eax
  test   %eax,%eax
  jne    L97
  mov    -0x3c(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L33
L62:
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x38(%rbp)
  jmp    L95
L4:
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jle    L88
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0x38(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  movslq %ecx,%rax
  mov    %edx,-0x30(%rbp,%rax,4)
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x34(%rbp),%edx
  mov    %edx,-0x30(%rbp,%rax,4)
L88:
  subl   $0x1,-0x38(%rbp)
L95:
  mov    -0x38(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jg     L4
  addl   $0x1,-0x3c(%rbp)
L33:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x3c(%rbp)
  jl     L62
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L47
L83:
  mov    -0x3c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x38(%rbp)
  jmp    L107
L116:
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%edx
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jne    L101
  movl   $0x1,-0x34(%rbp)
  addl   $0x1,-0x38(%rbp)
L107:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x38(%rbp)
  jl     L116
  jmp    L134
L101:
  nop
L134:
  cmpl   $0x0,-0x34(%rbp)
  je     L93
  mov    -0x3c(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L93:
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x3c(%rbp)
  movl   $0x0,-0x34(%rbp)
  addl   $0x1,-0x3c(%rbp)
L47:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x3c(%rbp)
  jl     L83
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L142
  call   <__stack_chk_fail@plt>
L142:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D3
data_type: string
name: read_data
arguments: data_label: D8
data_type: string

tool: D3: %d

tool: D8: %d 


assistant: ```c
int main() {
  int i, j, n, a, digits[10];
  scanf("%d", &n);
  while (!rightInt(n)) {
    scanf("%d", &n);
  }
  for (i = 0; n != 0; i++) {
    digits[i] = n % 10;
    n /= 10;
  }
  n = i;
  for (i = 0; i < n; i++) {
    for (j = n - 1; j > i; j--) {
      if (digits[j - 1] > digits[j]) {
        a = digits[j - 1];
        digits[j - 1] = digits[j];
        digits[j] = a;
      }
    }
  }
  for (i = 0, a = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (digits[i] == digits[j]) {
        a = 1;
      } else {
        break;
      }
    }
    if (a) {
      printf("%d \n", digits[i]);
    }
    i = j - 1;
    a = 0;
  }
  return 0;
}
```