user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  jmp    L158
L199:
  mov    %rdi,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L229
  orq    $0x0,-0x8(%rsp,%rdx,1)
L229:
  mov    %rsp,%r14
  add    $0xf,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L65:
  cmp    %rdx,%rsp
  je     L22
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L65
L22:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L210
  orq    $0x0,-0x8(%rsp,%rax,1)
L210:
  lea    0x3(%rsp),%r15
  mov    %r15,%rax
  shr    $0x2,%rax
  mov    %rax,-0x50(%rbp)
  and    $0xfffffffffffffffc,%r15
  test   %ecx,%ecx
  jle    L59
  mov    %r14,%r13
  mov    %r15,%r12
  mov    $0x0,%ebx
L135:
  mov    %r12,%rdx
  mov    %r13,%rsi
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%ebx
  mov    -0x3c(%rbp),%ecx
  add    $0x4,%r13
  add    $0x4,%r12
  cmp    %ebx,%ecx
  jg     L135
  movslq %ecx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L67:
  cmp    %rdx,%rsp
  je     L149
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L67
L149:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L181
  orq    $0x0,-0x8(%rsp,%rax,1)
L181:
  mov    %rsp,%rbx
  test   %ecx,%ecx
  jle    L59
  mov    %rbx,%rax
  mov    %ecx,%edx
  lea    (%rbx,%rdx,4),%rdx
L236:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L236
  mov    -0x50(%rbp),%rax
  mov    0x0(,%rax,4),%eax
  cmp    %eax,%ecx
  jle    L219
  test   %eax,%eax
  js     L219
  mov    %ecx,%edi
  mov    $0x1,%edx
L216:
  movslq %eax,%rsi
  cmpl   $0x0,(%rbx,%rsi,4)
  jne    L219
  mov    %rsi,%rax
  mov    -0x4(%r14,%rdx,4),%esi
  mov    %esi,(%rbx,%rax,4)
  cmp    %rdi,%rdx
  je     L230
  mov    %edx,%eax
  add    (%r15,%rdx,4),%eax
  add    $0x1,%rdx
  cmp    %eax,%ecx
  jle    L219
  test   %eax,%eax
  jns    L216
L219:
  lea    D22(%rip),%rdi
  call   <puts@plt>
  jmp    L14
L230:
  mov    $0x0,%r12d
L173:
  mov    (%rbx,%r12,4),%esi
  lea    D8(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r12
  cmp    %r12d,-0x3c(%rbp)
  jg     L173
L59:
  mov    $0xa,%edi
  call   <putchar@plt>
L14:
  mov    -0x48(%rbp),%rsp
L158:
  mov    %rsp,-0x48(%rbp)
  lea    -0x3c(%rbp),%rsi
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    -0x3c(%rbp),%ecx
  test   %ecx,%ecx
  je     L82
  movslq %ecx,%rax
  shl    $0x2,%rax
  lea    0xf(%rax),%rdx
  mov    %rdx,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L196:
  cmp    %rsi,%rsp
  je     L199
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L196
L82:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L227
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L227:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D23
type_infered: string
name: unpack_data
arguments: data_tag: D22
type_infered: string
name: unpack_data
arguments: data_tag: D8
type_infered: string
name: unpack_data
arguments: data_tag: D11
type_infered: string

tool: D23: %d%d

tool: D22: -1

tool: D8: %d 

tool: D11: %d

assistant: ```c
int main() {
  int n, i, j;
  while (1) {
    scanf("%d", &n);
    if (n == 0)
      break;
    int c[n], p[n];
    for (i = 0; i < n; i++) {
      scanf("%d%d", &c[i], &p[i]);
    }
    int flag = 0;
    int original[n];
    for (i = 0; i < n; i++)
      original[i] = 0;
    for (i = 0; i < n; i++) {
      if ((i + p[i] < 0 || i + p[i] >= n) || (original[i + p[i]] != 0)) {
        flag = 1;
        break;
      }
      original[i + p[i]] = c[i];
    }
    if (flag == 1)
      printf("-1\n");
    else {
      for (i = 0; i < n; i++)
        printf("%d ", original[i]);
      printf("\n");
    }
  }
  return 0;
}
```