user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bubblesort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L67
L60:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L67:
  cmpl   $0x4,-0x14(%rbp)
  jle    L60
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L83
L66:
  movl   $0x0,-0x10(%rbp)
  jmp    L74
L30:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L32
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  add    $0x1,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x8(%rbp)
L32:
  addl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x10(%rbp)
L74:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L30
  subl   $0x1,-0x14(%rbp)
L83:
  cmpl   $0x0,-0x14(%rbp)
  jg     L66
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L48
L19:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L48:
  cmpl   $0x4,-0x14(%rbp)
  jle    L19
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D50
type: string
name: read_data
arguments: data_label: D2
type: string
name: read_data
arguments: data_label: D6
type: string
name: read_data
arguments: data_label: D46
type: string
name: read_data
arguments: data_label: D27
type: string
name: read_data
arguments: data_label: D15
type: string
name: read_data
arguments: data_label: D26
type: string

tool: D50: 

N: %d


tool: D2: 
Unsorted [First 5]: 

tool: D6: %d 

tool: D46: 
Sorted [First 5]: 

tool: D27: 

Comparisons: %d

tool: D15: 
Swaps: %d

tool: D26: 

============================================

assistant: ```c
void bubblesort(int a[], int N) {
  int i, j, temp, compare_ctr = 0, swap_ctr = 0;
  printf("\n\nN: %d\n", N);
  printf("\nUnsorted [First 5]: ");
  for (i = 0; i < 5; i++) {
    printf("%d ", a[i]);
  }
  for (i = N - 1; i >= 1; i--) {
    for (j = 0; j < i; j++) {
      if (a[j] > a[j + 1]) {
        temp = a[j + 1];
        a[j + 1] = a[j];
        a[j] = temp;
        swap_ctr++;
      }
      compare_ctr++;
    }
  }
  printf("\nSorted [First 5]: ");
  for (i = 0; i < 5; i++) {
    printf("%d ", a[i]);
  }
  printf("\n\nComparisons: %d", compare_ctr);
  printf("\nSwaps: %d", swap_ctr);
  printf("\n\n============================================");
}
```