user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D39(%rip),%rdi
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  lea    D2(%rip),%r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <puts@plt>
  mov    %r13,%rdi
  lea    -0x3c(%rbp),%rsi
  call   <scanf@plt>
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  mov    %rax,%rdi
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L77
L102:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L102
L77:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L4
L17:
  mov    %rsp,%r12
  test   %edi,%edi
  jle    L85
  mov    %r12,%rbx
  xor    %r15d,%r15d
  lea    D38(%rip),%r14
  nopl   0x0(%rax)
L32:
  mov    %r15d,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  add    $0x4,%rbx
  call   <scanf@plt>
  mov    -0x3c(%rbp),%edi
  cmp    %r15d,%edi
  jg     L32
  lea    -0x1(%rdi),%eax
  lea    0x4(%r12,%rax,4),%rsi
L106:
  test   %edi,%edi
  jle    L85
  mov    %r12,%rax
  xor    %ebx,%ebx
  nopl   (%rax)
L84:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L131
  mov    %ecx,(%rax)
  mov    $0x1,%ebx
  mov    %edx,0x4(%rax)
L131:
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L84
  test   %ebx,%ebx
  jne    L106
  mov    %r12,%r13
  lea    D66(%rip),%r14
  nopw   0x0(%rax,%rax,1)
L13:
  mov    0x0(%r13),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  add    $0x4,%r13
  call   <printf@plt>
  mov    -0x3c(%rbp),%edi
  cmp    %ebx,%edi
  jg     L13
L123:
  mov    %ebx,%eax
  pxor   %xmm1,%xmm1
  sar    %eax
  and    $0x1,%edi
  cltq
  cvtsi2ssl (%r12,%rax,4),%xmm1
  je     L47
  pxor   %xmm0,%xmm0
  lea    D4(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd %xmm1,%xmm0
  call   <printf@plt>
L73:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L85:
  xor    %ebx,%ebx
  jmp    L123
L47:
  lea    -0x1(%rbx),%eax
  mov    $0x2,%ecx
  pxor   %xmm0,%xmm0
  cltd
  lea    D29(%rip),%rdi
  idiv   %ecx
  cltq
  cvtsi2ssl (%r12,%rax,4),%xmm0
  mov    $0x1,%eax
  addss  %xmm1,%xmm0
  mulss  D49(%rip),%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  jmp    L73
L4:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L17
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D39
type_infered: string
name: unpack_data
arguments: label: D2
type_infered: string
name: unpack_data
arguments: label: D38
type_infered: string
name: unpack_data
arguments: label: D66
type_infered: string
name: unpack_data
arguments: label: D4
type_infered: string
name: unpack_data
arguments: label: D29
type_infered: string
name: unpack_data
arguments: label: D49
type_infered: byte[4]

tool: D39: hvor mange tal skal du bruge?

tool: D2: %d

tool: D38: Tal nr. %d:
 

tool: D66: %d


tool: D4: 
Medianen af dine tal = %.1f


tool: D29: 
Medianen for dine tal = %.2f


tool: {"D49": [0x00,0x00,0x00,0x3f]}

assistant: ```c
int main() {
  int swapped, r, i;
  int tal, antal;
  printf("hvor mange tal skal du bruge?\n");
  scanf("%d", &tal);
  int u[tal];
  for (i = 0; i < tal; i++) {
    printf("Tal nr. %d:\n ", i);
    scanf("%d", &u[i]);
  }
  while (1) {
    swapped = 0;
    for (r = 0; r < tal; r++) {
      if (u[r] > u[r + 1]) {
        int temp = u[r];
        u[r] = u[r + 1];
        u[r + 1] = temp;
        swapped = 1;
      }
    }
    if (swapped == 0) {
      break;
    }
  }
  for (r = 0; r < tal; r++) {
    printf("%d\n", u[r]);
  }
  if ((tal % 2) != 0) {
    float median = u[r / 2];
    printf("\nMedianen af dine tal = %.1f\n", median);
  } else if (tal % 2 == 0) {
    float d = (u[(r - 1) / 2]);
    float c = (u[r / 2]);
    float a = (d + c) / 2;
    printf("\nMedianen for dine tal = %.2f\n", a);
  }
  return 0;
}
```