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

```asm
<dump_context>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    (%rdi),%ebp
  mov    $0x20,%ecx
  sar    %cl,%ebp
  mov    %ebp,%esi
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D61(%rip),%rbx
  lea    0xc8(%rbx),%r13
  lea    D46(%rip),%r14
  jmp    L79
L16:
  shr    %ebp
  add    $0x8,%rbx
  cmp    %rbx,%r13
  je     L63
L79:
  test   $0x1,%bpl
  je     L16
  mov    (%rbx),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L16
L63:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    $0x0,%ebx
  lea    D79(%rip),%r14
  lea    D61(%rip),%rbp
  lea    D45(%rip),%r13
  lea    D35(%rip),%r15
  jmp    L5
L22:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%rbx
  cmp    $0xc,%rbx
  je     L46
L5:
  movslq (%r14,%rbx,4),%rax
  mov    0x4(%r12,%rax,4),%edi
  mov    %edi,%edx
  mov    $0x20,%ecx
  sar    %cl,%edx
  mov    0x0(%rbp,%rax,8),%rsi
  mov    %edi,%ecx
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0xa,%ebx
  ja     L22
  movslq (%r15,%rbx,4),%rax
  mov    0x4(%r12,%rax,4),%edi
  mov    %edi,%edx
  mov    $0x20,%ecx
  sar    %cl,%edx
  mov    0x0(%rbp,%rax,8),%rsi
  mov    %edi,%ecx
  lea    D77(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L22
L46:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D48
type_infered: string
name: parse_data
arguments: data_tag: D46
type_infered: string
name: parse_data
arguments: data_tag: D79
type_infered: string
name: parse_data
arguments: data_tag: D45
type_infered: string
name: parse_data
arguments: data_tag: D35
type_infered: string
name: parse_data
arguments: data_tag: D77
type_infered: string

tool: D48:   valid_regs (%08lx):

tool: D46:  %s

tool: 

tool: D45:   %-8s %08x %08x

tool: D35: 

tool: D77:       %-8s %08x %08x

assistant: ```c
void dump_context(uint64_t *context) {
  int i, j;
  unsigned int valid;
  uint64_t val;
  static char *names[] = {"ip", "sp", "bsp", "cfm", "rp", "psp", "pfs", "preds", "priunat", "ar.bspstore", "ar.rnat", "ar.unat", "ar.fpsr", "ar.lc", "ar.pfs", "(pad)", "gr4", "gr5", "gr6", "gr7", "br1", "br2", "br3", "br4", "br5"};
  static int col1[] = {
      0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14,
  };
  static int col2[] = {
      7, 8, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  };
  valid = (unsigned int)(context[0] >> 32);
  printf("  valid_regs (%08lx):", valid);
  for (i = 0; i <= 24; i++) {
    if (valid & 1)
      printf(" %s", names[i]);
    valid >>= 1;
  }
  printf("\n");
  for (i = 0; i < ((sizeof(col1) / sizeof(int)) > (sizeof(col2) / sizeof(int)) ? (sizeof(col1) / sizeof(int)) : (sizeof(col2) / sizeof(int))); i++) {
    if (i < (sizeof(col1) / sizeof(int))) {
      j = col1[i];
      val = context[j + 1];
      printf("  %-8s %08x %08x", names[j], (unsigned int)(val >> 32), (unsigned int)val);
    } else
      printf("                            ");
    if (i < (sizeof(col2) / sizeof(int))) {
      j = col2[i];
      val = context[j + 1];
      printf("      %-8s %08x %08x", names[j], (unsigned int)(val >> 32), (unsigned int)val);
    }
    putchar('\n');
  }
}
```