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

```asm
<get_app>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <get2@plt>
  mov    %eax,-0x24(%rbp)
  mov    -0x34(%rbp),%eax
  lea    -0xe0(%rax),%ecx
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  mov    %ecx,%esi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x20(%rbp)
  subl   $0x2,-0x24(%rbp)
  jmp    L105
L53:
  mov    $0x0,%eax
  call   <get1@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <isprint@plt>
  test   %eax,%eax
  je     L52
  mov    -0x1c(%rbp),%eax
  cmp    $0x5,%eax
  jbe    L25
  cmpl   $0x0,-0x20(%rbp)
  jne    L71
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L71
  mov    $0x20,%edi
  call   <putchar@plt>
L71:
  lea    -0xe(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
L25:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  mov    -0x14(%rbp),%edx
  cltq
  mov    %dl,-0xe(%rbp,%rax,1)
  addl   $0x1,-0x18(%rbp)
  jmp    L118
L52:
  mov    -0x18(%rbp),%eax
  cmp    $0x5,%eax
  jbe    L38
  cmpl   $0x0,-0x1c(%rbp)
  jle    L38
  lea    -0xe(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L38:
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
L118:
  subl   $0x1,-0x24(%rbp)
L105:
  cmpl   $0x0,-0x24(%rbp)
  jg     L53
  mov    -0x18(%rbp),%eax
  cmp    $0x5,%eax
  jbe    L130
  cmpl   $0x0,-0x1c(%rbp)
  jle    L130
  cmpl   $0x0,-0x20(%rbp)
  jne    L55
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L55
  mov    $0x20,%edi
  call   <putchar@plt>
L55:
  lea    -0xe(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L130:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L104
  call   <__stack_chk_fail@plt>
L104:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D38
type_guessed: string
name: unpack_data
arguments: data_tag: D37
type_guessed: string

tool: D38: APP%d len=%d


tool: D37: %.*s

assistant: ```c
void get_app(int kind) {
  int l, c, first;
  char buf[6];
  int nbuf, nok;
  l = get2();
  printf("APP%d len=%d\n", kind - 0xe0, l);
  nbuf = 0;
  nok = 0;
  first = 1;
  for (l -= 2; l > 0; l--) {
    c = get1();
    if (isprint(c)) {
      if (nbuf >= sizeof buf) {
        if (!first && nbuf == nok)
          printf(" ");
        printf("%.*s", nbuf, buf);
        nbuf = 0;
        first = 0;
      }
      buf[nbuf++] = c;
      nok++;
    } else {
      if (nok >= sizeof buf)
        if (nbuf > 0)
          printf("%.*s", nbuf, buf);
      nbuf = 0;
      nok = 0;
    }
  }
  if (nok >= sizeof buf)
    if (nbuf > 0) {
      if (!first && nbuf == nok)
        printf(" ");
      printf("%.*s", nbuf, buf);
    }
}
```