user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D82(%rip),%r13
  lea    -0x3c(%rbp),%r12
  lea    D5(%rip),%rbx
L16:
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  test   %eax,%eax
  jle    L16
  cltq
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L57:
  cmp    %rdx,%rsp
  je     L62
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L57
L62:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L122
  orq    $0x0,-0x8(%rsp,%rax,1)
L122:
  mov    %rsp,%rbx
  mov    %rbx,%r13
  mov    $0x0,%r12d
  lea    D79(%rip),%r15
  lea    D5(%rip),%r14
L8:
  mov    %r15,%rdi
  call   <puts@plt>
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <scanf@plt>
  add    $0x1,%r12d
  add    $0x4,%r13
  cmp    %r12d,-0x3c(%rbp)
  jg     L8
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  jle    L10
  mov    $0x0,%r12d
  lea    D74(%rip),%r13
L6:
  mov    (%rbx,%r12,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r12
  cmp    %r12d,-0x3c(%rbp)
  jg     L6
L10:
  lea    D66(%rip),%rdi
  call   <puts@plt>
  mov    -0x3c(%rbp),%esi
  test   %esi,%esi
  jle    L83
  lea    0x1(%rsi),%r8d
  mov    $0x1,%edi
L93:
  lea    -0x1(%rdi),%edx
  cmp    %edi,%esi
  jle    L47
  mov    %rdi,%rax
L5:
  movslq %edx,%rcx
  mov    (%rbx,%rcx,4),%ecx
  cmp    %ecx,(%rbx,%rax,4)
  cmovl  %eax,%edx
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L5
L47:
  mov    -0x4(%rbx,%rdi,4),%eax
  movslq %edx,%rdx
  mov    (%rbx,%rdx,4),%ecx
  mov    %ecx,-0x4(%rbx,%rdi,4)
  mov    %eax,(%rbx,%rdx,4)
  add    $0x1,%rdi
  cmp    %r8,%rdi
  jne    L93
L83:
  lea    D31(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  jle    L56
  mov    $0x0,%r12d
  lea    D74(%rip),%r13
L76:
  mov    (%rbx,%r12,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r12
  cmp    %r12d,-0x3c(%rbp)
  jg     L76
L56:
  lea    D66(%rip),%rdi
  call   <puts@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D82
type_infered: string
name: retrieve_data
arguments: label: D5
type_infered: string
name: retrieve_data
arguments: label: D79
type_infered: string
name: retrieve_data
arguments: label: D1
type_infered: string
name: retrieve_data
arguments: label: D74
type_infered: string
name: retrieve_data
arguments: label: D66
type_infered: string
name: retrieve_data
arguments: label: D31
type_infered: string

tool: D82: Enter the number of elements

tool: D5: %d

tool: D79: 
Enter the element

tool: D1: 
Array is: {

tool: D74:  %d 

tool: D66: }

tool: D31: 
Array after selection-sorting is: {

assistant: ```c
main() {
  int n;
  int i, j;
  int temp, min;
  do {
    printf("Enter the number of elements\n");
    scanf("%d", &n);
  } while (n < 1);
  int arr[n];
  for (i = 0; i < n; i++) {
    printf("\nEnter the element\n");
    scanf("%d", &arr[i]);
  }
  printf("\nArray is: {");
  for (i = 0; i < n; i++)
    printf(" %d ", arr[i]);
  printf("}\n");
  for (i = 0; i < n; i++) {
    min = i;
    for (j = i + 1; j < n; j++) {
      if (arr[j] < arr[min])
        min = j;
    }
    temp = arr[i];
    arr[i] = arr[min];
    arr[min] = temp;
  }
  printf("\nArray after selection-sorting is: {");
  for (i = 0; i < n; i++)
    printf(" %d ", arr[i]);
  printf("}\n");
}
```