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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x40(%rbp),%rsi
  lea    D16(%rip),%rdi
  call   <scanf@plt>
  cmpl   $0x0,-0x40(%rbp)
  je     L116
  lea    -0x3c(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  lea    D16(%rip),%r14
  lea    D5(%rip),%r15
  jmp    L161
L155:
  mov    %rax,%rcx
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  je     L185
  orq    $0x0,-0x8(%rsp,%rcx,1)
L185:
  mov    %rsp,%r13
  test   %edx,%edx
  je     L5
  mov    %r13,%r12
  mov    $0x0,%ebx
L181:
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    -0x3c(%rbp),%r8d
  add    $0x4,%r12
  cmp    %ebx,%r8d
  ja     L181
  test   %r8d,%r8d
  je     L101
  lea    -0x1(%r8),%eax
  lea    0x4(%r13,%rax,4),%rdi
  mov    $0x0,%r9d
  mov    $0x0,%esi
  jmp    L153
L71:
  add    $0x4,%rax
  cmp    %rax,%rdi
  je     L205
L7:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jbe    L71
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rax)
  add    $0x1,%esi
  jmp    L71
L205:
  add    $0x1,%r9d
  cmp    %r8d,%r9d
  je     L212
L153:
  mov    %r13,%rax
  jmp    L7
L5:
  mov    $0x0,%esi
L212:
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  je     L156
  mov    $0x0,%ebx
  jmp    L62
L101:
  mov    $0x0,%esi
  jmp    L212
L31:
  add    $0x1,%rbx
  cmp    %ebx,-0x3c(%rbp)
  jbe    L156
L62:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %ebx,%eax
  ja     L31
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L31
L156:
  subl   $0x1,-0x40(%rbp)
  mov    -0x48(%rbp),%rsp
  cmpl   $0x0,-0x40(%rbp)
  je     L116
L161:
  mov    %rsp,-0x48(%rbp)
  mov    -0x50(%rbp),%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%edx
  mov    %edx,%eax
  lea    0xf(,%rax,4),%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  mov    %rsp,%rcx
  sub    %rsi,%rcx
L49:
  cmp    %rcx,%rsp
  je     L155
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L49
L116:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L189
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L189:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D16
type: string
name: parse_data
arguments: data_label: D5
type: string
name: parse_data
arguments: data_label: D1
type: string

tool: D16: %u

tool: D5: %d 

tool: D1: %d


assistant: ```c
int main() {
  int i;
  unsigned int n, m;
  scanf("%u", &n);
  while (n) {
    scanf("%u", &m);
    unsigned int v[m];
    for (i = 0; i < m; i++) {
      scanf("%u", &v[i]);
    }
    int veses = 0, i, j, aux;
    for (j = 0; j < m; j++) {
      for (i = 0; i < m; i++) {
        if (v[i] > v[i + 1]) {
          aux = v[i];
          v[i] = v[i + 1];
          v[i + 1] = aux;
          veses++;
        }
      }
    }
    printf("%d\n", veses);
    for (i = 0; i < m; i++) {
      printf("%d ", v[i]);
      if (i >= m - 1) {
        printf("\n");
      }
    }
    n--;
    veses = 0;
  }
  return 0;
}
```