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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x1,-0x58(%rbp)
  lea    -0x68(%rbp),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x68(%rbp),%rax
  test   %rax,%rax
  jne    L31
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L0
L31:
  movq   $0x0,-0x60(%rbp)
  jmp    L24
L23:
  mov    -0x60(%rbp),%rax
  movq   $0x0,-0x50(%rbp,%rax,8)
  addq   $0x1,-0x60(%rbp)
L24:
  cmpq   $0x9,-0x60(%rbp)
  jle    L23
  jmp    L182
L64:
  movq   $0x9,-0x60(%rbp)
  jmp    L168
L188:
  mov    -0x68(%rbp),%rax
  cqto
  idivq  -0x60(%rbp)
  mov    %rdx,%rax
  test   %rax,%rax
  jne    L37
  mov    -0x60(%rbp),%rax
  mov    -0x50(%rbp,%rax,8),%rax
  lea    0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,-0x50(%rbp,%rax,8)
  mov    -0x68(%rbp),%rax
  cqto
  idivq  -0x60(%rbp)
  mov    %rax,-0x68(%rbp)
  jmp    L101
L37:
  subq   $0x1,-0x60(%rbp)
L168:
  cmpq   $0x1,-0x60(%rbp)
  jg     L188
L101:
  cmpq   $0x1,-0x60(%rbp)
  jne    L182
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L0
L182:
  mov    -0x68(%rbp),%rax
  cmp    $0x1,%rax
  jne    L64
  movq   $0x2,-0x60(%rbp)
  jmp    L105
L120:
  mov    -0x60(%rbp),%rax
  mov    -0x50(%rbp,%rax,8),%rax
  test   %rax,%rax
  jle    L21
  cmpq   $0x1,-0x58(%rbp)
  jne    L113
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  jmp    L118
L113:
  mov    -0x58(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x58(%rbp)
L118:
  mov    -0x60(%rbp),%rax
  mov    -0x50(%rbp,%rax,8),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x60(%rbp),%rax
  mov    %rdx,-0x50(%rbp,%rax,8)
  jmp    L105
L21:
  addq   $0x1,-0x60(%rbp)
L105:
  cmpq   $0xa,-0x60(%rbp)
  jne    L120
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L0:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D35
datatype: string
name: read_data
arguments: data_label: D11
datatype: string
name: read_data
arguments: data_label: D30
datatype: string
name: read_data
arguments: data_label: D21
datatype: string

tool: D35: %lld

tool: D11: 10

tool: D30: -1

tool: D21: %lld


assistant: ```c
int main() {
  long long a[9], i, num;
  long long final_val = 1;
  scanf("%lld", &num);
  if (num == 0) {
    printf("10");
    return 0;
  }
  for (i = 0; i < 10; i++)
    a[i] = 0;
  while (num != 1) {
    for (i = 9; i > 1; i--) {
      if ((num % i) == 0) {
        a[i]++;
        num = num / i;
        break;
      }
    }
    if (i == 1) {
      printf("-1");
      return 0;
    }
  }
  i = 2;
  while (i != 10) {
    if (a[i] > 0) {
      if (final_val == 1)
        final_val = i;
      else
        final_val = final_val * 10 + i;
      a[i]--;
    } else
      i++;
  }
  printf("%lld\n", final_val);
  return 0;
}
```