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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0x2c(%rbp)
  movl   $0xffffffff,-0x28(%rbp)
  lea    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L111
L75:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  addl   $0x1,-0x24(%rbp)
L111:
  mov    -0x30(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L75
  jmp    L91
L103:
  addl   $0x1,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L56
L54:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jg     L124
  subl   $0x1,-0x28(%rbp)
L56:
  cmpl   $0x0,-0x28(%rbp)
  jns    L54
  jmp    L65
L124:
  nop
L65:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L122
L112:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%edx
  movslq %edx,%rdx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  subl   $0x1,-0x20(%rbp)
L122:
  mov    -0x20(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jg     L112
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L91:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L103
  movl   $0x0,-0x1c(%rbp)
  jmp    L96
L108:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
L96:
  mov    -0x30(%rbp),%eax
  cmp    %eax,-0x1c(%rbp)
  jl     L108
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L64
  call   <__stack_chk_fail@plt>
L64:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D10
type_infered: string
name: disassemble_data
arguments: label: D17
type_infered: string
name: disassemble_data
arguments: label: D32
type_infered: string

tool: D10: %d

tool: D17: %d


tool: D32: %d 

assistant: ```c
int main() {
  int n, c, i = -1, m, t = -1, z;
  int *a;
  scanf("%d", &n);
  a = (int *)malloc(n * sizeof(int));
  for (int k = 0; k < n; k++) {
    scanf("%d", &a[k]);
  }
  while (i < n - 1) {
    i++;
    for (t = i - 1; t >= 0; t--) {
      if (a[i] > a[t]) {
        break;
      }
    }
    m = a[i];
    z = t;
    for (int j = i - 1; j > t; j--) {
      a[j + 1] = a[j];
    }
    a[z + 1] = m;
    printf("%d\n", a[i]);
  }
  for (int p = 0; p < n; p++) {
    printf("%d ", a[p]);
  }
}
```