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

```asm
<outdyn64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  shr    $0x4,%rax
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x30(%rbp)
  lea    -0x40(%rbp),%rdx
  mov    -0x44(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <getpiecestrtable@plt>
  mov    %rax,-0x10(%rbp)
  mov    $0x1,%edi
  call   <beginblock@plt>
  movq   $0x0,-0x28(%rbp)
  jmp    L24
L116:
  mov    $0x0,%edi
  call   <beginblock@plt>
  mov    -0x28(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    D61(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strdefint@plt>
  mov    %rax,%rdi
  call   <out@plt>
  mov    -0x28(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strdynamicvalue@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L214
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  mov    $0x0,%eax
  call   <endblock@plt>
  jmp    L219
L214:
  mov    -0x28(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  cmp    $0x97,%rax
  jg     L50
  cmp    $0x96,%rax
  jge    L261
  cmp    $0x95,%rax
  je     L56
  cmp    $0x95,%rax
  jg     L50
  cmp    $0x94,%rax
  je     L86
  cmp    $0x94,%rax
  jg     L50
  cmp    $0x92,%rax
  jg     L271
  cmp    $0x80,%rax
  jl     L50
  add    $0xffffffffffffff80,%rax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  mov    %rax,%rdx
  and    $0x2ff1f,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L261
  mov    %rax,%rdx
  and    $0x400e0,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L101
  and    $0x10000,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L96
  jmp    L50
L271:
  cmp    $0x93,%rax
  je     L261
  jmp    L50
L101:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D99(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  cmpq   $0x0,-0x10(%rbp)
  je     L38
  mov    -0x40(%rbp),%rax
  cmp    %rax,-0x8(%rbp)
  jge    L38
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L38
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  jmp    L38
L56:
  mov    -0x8(%rbp),%rax
  lea    D81(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strdefflags@plt>
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  jmp    L203
L86:
  mov    -0x8(%rbp),%rax
  lea    D104(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strdefflags@plt>
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  jmp    L203
L96:
  mov    -0x8(%rbp),%rax
  lea    D61(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strdefint@plt>
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  jmp    L203
L261:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D99(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  jmp    L203
L50:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <straddress@plt>
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <outf@plt>
  jmp    L203
L38:
  nop
L203:
  mov    $0x0,%eax
  call   <endblock@plt>
  cmpq   $0x0,-0x30(%rbp)
  je     L219
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <outcomment@plt>
L219:
  addq   $0x1,-0x28(%rbp)
L24:
  mov    -0x28(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jl     L116
  mov    $0x0,%eax
  call   <endblock@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D61
data_type: string
name: disassemble_data
arguments: data_tag: D97
data_type: string
name: disassemble_data
arguments: data_tag: D99
data_type: string
name: disassemble_data
arguments: data_tag: D81
data_type: string
name: disassemble_data
arguments: data_tag: D104
data_type: string

tool: D61: DT_

tool: D97: { %s }

tool: D99: { %ld }

tool: D81: DF_

tool: D104: DF_1_

assistant: ```c
void outdyn64(void const *ptr, long size, int ndx) {
  Elf64_Dyn const *dyns = ptr;
  long count = size / sizeof *dyns;
  char const *strtab;
  char const *str = NULL;
  long value;
  long i;
  strtab = getpiecestrtable(ndx, &size);
  beginblock(1);
  for (i = 0; i < count; ++i) {
    beginblock(0);
    (out(strdefint(dyns[i].d_tag, "DT_")));
    value = dyns[i].d_un.d_val;
    str = strdynamicvalue(dyns[i].d_tag, value);
    if (str) {
      outf("{ %s }", str);
      endblock();
      continue;
    }
    switch (dyns[i].d_tag) {
    case DT_NEEDED:
    case DT_RPATH:
    case DT_RUNPATH:
    case DT_SONAME:
      outf("{ %ld }", value);
      if (strtab && value < size && strtab[value])
        str = strtab + value;
      break;
    case DT_FLAGS:
      outf("{ %s }", strdefflags(value, "DF_"));
      break;
    case DT_FLAGS_1:
      outf("{ %s }", strdefflags(value, "DF_1_"));
      break;
    case DT_PLTREL:
      outf("{ %s }", strdefint(value, "DT_"));
      break;
    case DT_NULL:
    case DT_STRSZ:
    case DT_SYMENT:
    case DT_SYMINSZ:
    case DT_RELENT:
    case DT_RELSZ:
    case DT_RELAENT:
    case DT_RELASZ:
    case DT_SYMBOLIC:
    case DT_PLTRELSZ:
    case DT_BIND_NOW:
    case DT_INIT_ARRAYSZ:
    case DT_TEXTREL:
    case DT_FINI_ARRAYSZ:
    case DT_RELCOUNT:
    case DT_PREINIT_ARRAYSZ:
    case DT_RELACOUNT:
      outf("{ %ld }", value);
      break;
    default:
      outf("{ %s }", straddress(value));
      break;
    }
    endblock();
    if (str)
      outcomment(str);
  }
  endblock();
}
```