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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D1(%rip),%rdi
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  lea    -0x30(%rbp),%rsi
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x30(%rbp),%rdx
  mov    %rsp,%rcx
  mov    %rdx,%rax
  shl    $0x5,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffff000,%rsi
  sub    %rsi,%rcx
  cmp    %rcx,%rsp
  je     L150
L91:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L91
L150:
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  jne    L72
L11:
  mov    %rsp,%rbx
  test   %rdx,%rdx
  jle    L62
  mov    %rbx,%r12
  xor    %r13d,%r13d
  lea    D0(%rip),%r14
  nopl   0x0(%rax)
L157:
  lea    0x8(%r12),%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    -0x30(%rbp),%rdi
  mov    0x8(%r12),%rax
  add    $0x1,%r13
  add    (%r12),%rax
  mov    %r13,0x18(%r12)
  add    $0x20,%r12
  mov    %rax,-0x10(%r12)
  cmp    %rdi,%r13
  jl     L157
  test   %rdi,%rdi
  jle    L62
  nopw   0x0(%rax,%rax,1)
L41:
  sub    $0x1,%rdi
  test   %rdi,%rdi
  je     L138
  mov    %rbx,%rax
  xor    %esi,%esi
  jmp    L23
  nopl   0x0(%rax)
L12:
  add    $0x20,%rax
  cmp    %rdi,%rsi
  je     L41
L23:
  mov    0x10(%rax),%rdx
  mov    0x30(%rax),%rcx
  add    $0x1,%rsi
  cmp    %rcx,%rdx
  jle    L58
  mov    (%rax),%r10
  mov    0x8(%rax),%r9
  mov    0x18(%rax),%rcx
  movdqu 0x20(%rax),%xmm0
  movdqu 0x30(%rax),%xmm1
  mov    0x30(%rax),%r8
  mov    %r10,0x20(%rax)
  mov    %r9,0x28(%rax)
  mov    %rdx,0x30(%rax)
  mov    %rcx,0x38(%rax)
  mov    %rdx,%rcx
  mov    %r8,%rdx
  movups %xmm0,(%rax)
  movups %xmm1,0x10(%rax)
L58:
  cmp    %rdx,%rcx
  jne    L12
  mov    (%rax),%rdx
  cmp    %rdx,0x20(%rax)
  jle    L12
  movdqu 0x20(%rax),%xmm2
  movdqu 0x30(%rax),%xmm3
  mov    %rdx,0x20(%rax)
  mov    0x8(%rax),%r9
  mov    0x18(%rax),%r8
  mov    %rcx,0x30(%rax)
  movups %xmm2,(%rax)
  mov    %r9,0x28(%rax)
  mov    %r8,0x38(%rax)
  movups %xmm3,0x10(%rax)
  jmp    L12
  nopl   0x0(%rax)
L138:
  xor    %r12d,%r12d
  lea    D10(%rip),%r13
  nopw   0x0(%rax,%rax,1)
L115:
  mov    %r12,%rax
  mov    %r13,%rdi
  add    $0x1,%r12
  shl    $0x5,%rax
  mov    0x18(%rbx,%rax,1),%rsi
  call   <printf@plt>
  cmp    %r12,-0x30(%rbp)
  jg     L115
L62:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L109
  lea    -0x20(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L72:
  orq    $0x0,-0x8(%rsp,%rax,1)
  jmp    L11
L109:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D1
type_infered: string
name: unpack_data
arguments: label: D0
type_infered: string
name: unpack_data
arguments: label: D10
type_infered: string

tool: D1: %ld

tool: D0: %ld %ld

tool: D10: %ld 

assistant: ```c
int main() {
  typedef struct orders {
    long int a;
    long int b;
    long int sum;
    long int ind;
  } orders;
  orders temp;
  long int n, i, j, k;
  scanf("%ld", &n);
  orders t[n];
  for (i = 0; i < n; i++) {
    scanf("%ld %ld", &t[i].a, &t[i].b);
    t[i].sum = t[i].a + t[i].b;
    t[i].ind = i + 1;
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n - i - 1; j++) {
      if (t[j].sum > t[j + 1].sum) {
        temp = t[j];
        t[j] = t[j + 1];
        t[j + 1] = temp;
      }
      if (t[j].sum == t[j + 1].sum) {
        if (t[j + 1].a > t[j].a) {
          temp = t[j];
          t[j] = t[j + 1];
          t[j + 1] = temp;
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    printf("%ld ", t[i].ind);
  }
  return 0;
}
```