user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r12
  lea    D40(%rip),%rdi
  lea    D75(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x1b0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1a8(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbp
  call   <printf@plt>
  lea    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D41(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%edx
  test   %edx,%edx
  jle    L161
  nopl   (%rax)
L167:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x1,%ebx
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %ebx,0x8(%rsp)
  jg     L167
L161:
  lea    D38(%rip),%rdi
  call   <puts@plt>
  lea    D28(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  lea    0xc(%rsp),%rsi
  call   <scanf@plt>
  mov    0xc(%rsp),%edi
  lea    -0x1(%rdi),%eax
  cmp    $0x1,%eax
  ja     L152
  mov    0x8(%rsp),%esi
  lea    0x10(%rsp),%rbx
  xor    %r11d,%r11d
  lea    -0x1(%rsi),%ebp
  test   %ebp,%ebp
  jle    L10
L30:
  movslq %r11d,%r10
  add    $0x1,%r11d
  mov    (%rbx),%r8d
  cmp    %esi,%r11d
  jge    L24
  mov    %rbx,%rdx
  mov    %r8d,%ecx
  mov    %r11d,%eax
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L168:
  cmp    %ecx,%r9d
  jle    L50
L13:
  mov    %r9d,%ecx
  movslq %eax,%r10
L50:
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %esi,%eax
  je     L23
L54:
  mov    0x4(%rdx),%r9d
  cmp    $0x1,%edi
  jne    L168
  cmp    %ecx,%r9d
  jl     L13
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %esi,%eax
  jne    L54
  nop
L23:
  cmp    %ecx,%r8d
  je     L24
  add    %ecx,%r8d
  mov    %r8d,(%rbx)
  sub    0x10(%rsp,%r10,4),%r8d
  mov    %r8d,0x10(%rsp,%r10,4)
  sub    %r8d,(%rbx)
L24:
  add    $0x4,%rbx
  cmp    %ebp,%r11d
  jne    L30
L10:
  lea    D9(%rip),%rdi
  xor    %ebx,%ebx
  lea    0x10(%rsp),%r12
  call   <puts@plt>
  mov    0x8(%rsp),%eax
  lea    D68(%rip),%rbp
  test   %eax,%eax
  jle    L157
  nopl   0x0(%rax,%rax,1)
L81:
  mov    (%r12,%rbx,4),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %ebx,0x8(%rsp)
  jg     L81
L157:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x1a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x1b0,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L152:
  lea    D25(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L10
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D40
type_infered: string
name: read_data
arguments: data_label: D75
type_infered: string
name: read_data
arguments: data_label: D41
type_infered: string
name: read_data
arguments: data_label: D38
type_infered: string
name: read_data
arguments: data_label: D28
type_infered: string
name: read_data
arguments: data_label: D9
type_infered: string
name: read_data
arguments: data_label: D68
type_infered: string
name: read_data
arguments: data_label: D25
type_infered: string

tool: D40: Enter the number of elements in the array: 

tool: D75: %d

tool: D41: Enter the array elements:

tool: D38: Enter the order of sorting:

tool: D28: 1. Ascending order
2. Descending order

tool: D9: Array after sorting:

tool: D68: %d	

tool: D25: Invalid input!

assistant: ```c
int main(void) {
  int arr[100];
  int num;
  int min;
  int i;
  int j;
  int order;
  printf("Enter the number of elements in the array: ");
  scanf("%d", &num);
  printf("Enter the array elements:\n");
  for (i = 0; i < num; i++) {
    scanf("%d", &arr[i]);
  }
  printf("Enter the order of sorting:\n");
  printf("1. Ascending order\n2. Descending order\n");
  scanf("%d", &order);
  if ((order == 1) || (order == 2)) {
    for (i = 0; i < (num - 1); i++) {
      min = i;
      for (j = (i + 1); j < (num); j++) {
        if ((order == 1) && (arr[min] > arr[j])) {
          min = j;
        }
        if ((order == 2) && (arr[min] < arr[j])) {
          min = j;
        }
      }
      if (arr[min] != arr[i]) {
        arr[i] = arr[i] + arr[min];
        arr[min] = arr[i] - arr[min];
        arr[i] = arr[i] - arr[min];
        ;
      }
    }
  } else {
    printf("Invalid input!\n");
    exit(1);
  }
  printf("Array after sorting:\n");
  for (i = 0; i < num; i++) {
    printf("%d\t", arr[i]);
  }
  printf("\n");
  return 0;
}
```