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

```asm
<retab>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %esi,%r12d
  sar    $0x10,%r13d
  push   %rbp
  sar    $0x11,%r12d
  mov    %rdi,%rbp
  and    $0x1,%r13d
  push   %rbx
  movzwl %si,%ebx
  movsbl %dil,%esi
  lea    D47(%rip),%rdi
  and    $0x1,%r12d
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  call   <msg@plt>
  movsbl %bl,%esi
  lea    D25(%rip),%rdi
  call   <msg@plt>
  cmp    $0x1,%r12d
  lea    D22(%rip),%rdi
  sbb    %esi,%esi
  and    $0xfffffff5,%esi
  add    $0x59,%esi
  call   <msg@plt>
  test   %r13d,%r13d
  je     L1
  mov    $0x59,%esi
  lea    D29(%rip),%rdi
  lea    0x10(%rsp),%r13
  call   <msg@plt>
  test   %r12d,%r12d
  lea    0x8(%rsp),%r12
  je     L19
  jmp    L107
  nop
L14:
  mov    0x8(%rsp),%rdi
  call   <trim_back@plt>
  mov    0x8(%rsp),%rdi
  mov    %ebx,%esi
  call   <indent_spaces@plt>
  mov    0x8(%rsp),%rdi
  call   <puts@plt>
L19:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jg     L14
  nopl   0x0(%rax,%rax,1)
L11:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  mov    0x8(%rsp),%rdi
  call   <trim_back@plt>
  mov    0x8(%rsp),%rdi
  mov    %ebx,%esi
  call   <indent_tabs@plt>
  mov    0x8(%rsp),%rdi
  call   <puts@plt>
L107:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jg     L6
  jmp    L11
  nopl   (%rax)
L1:
  mov    $0x4e,%esi
  lea    D29(%rip),%rdi
  lea    0x10(%rsp),%r13
  call   <msg@plt>
  test   %r12d,%r12d
  lea    0x8(%rsp),%r12
  je     L70
  jmp    L98
  nopw   0x0(%rax,%rax,1)
L116:
  mov    0x8(%rsp),%rdi
  mov    %ebx,%esi
  call   <indent_spaces@plt>
  mov    0x8(%rsp),%rdi
  call   <puts@plt>
L70:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jg     L116
  jmp    L11
  xchg   %ax,%ax
L76:
  mov    0x8(%rsp),%rdi
  mov    %ebx,%esi
  call   <indent_tabs@plt>
  mov    0x8(%rsp),%rdi
  call   <puts@plt>
L98:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jg     L76
  jmp    L11
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D47
data_type: string
name: parse_data
arguments: data_tag: D25
data_type: string
name: parse_data
arguments: data_tag: D22
data_type: string
name: parse_data
arguments: data_tag: D29
data_type: string

tool: D47: fp         %08X

tool: D25: indent     %d

tool: D22: use tabs   %c

tool: D29: trim right %c

assistant: ```c
void retab(FILE *fp, int flags) {
  int use_tabs = ((1 << 17) & flags) ? 1 : 0;
  int trim_right = ((1 << 16) & flags) ? 1 : 0;
  int indent_size = 0xFFFF & flags;
  ssize_t n = 0;
  char *line;
  size_t len;
  msg("fp         %08X", (void *)fp);
  msg("indent     %d", indent_size);
  msg("use tabs   %c", use_tabs ? 'Y' : 'N');
  msg("trim right %c", trim_right ? 'Y' : 'N');
  for (;;) {
    n = getline(&line, &len, fp);
    if (n <= 0)
      break;
    if (trim_right)
      trim_back(line);
    if (use_tabs)
      indent_tabs(line, indent_size);
    else
      indent_spaces(line, indent_size);
    puts(line);
  }
}
```