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

```asm
<grab_emails>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  mov    $0x32,%edx
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  xor    %esi,%esi
  add    $0xffffffffffffff80,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rbp
  mov    %rsp,%r14
  mov    %rbp,%rdi
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0x32,%edx
  mov    %r14,%rdi
  call   <memset@plt>
  test   %ebx,%ebx
  js     L45
  mov    $0x1,%edi
  mov    %r14,%rdx
  mov    $0xfffffffffff7e004,%r8
  sub    %r14d,%edi
  nopl   0x0(%rax)
L10:
  movslq %ebx,%rcx
  movzbl 0x0(%r13,%rcx,1),%eax
  lea    -0x2d(%rax),%esi
  cmp    $0x13,%sil
  jbe    L219
L243:
  mov    %eax,%esi
  and    $0xffffffdf,%esi
  sub    $0x41,%esi
  cmp    $0x19,%sil
  jbe    L32
L45:
  mov    %r14,%rdi
  call   <strlen@plt>
  cmp    $0x31,%eax
  jg     L91
L227:
  mov    %r14,%rdi
  lea    -0x1(%rsp),%rbx
  call   <strlen@plt>
  movslq %eax,%rdx
  add    %rdx,%r14
  test   %eax,%eax
  js     L49
  nopl   0x0(%rax,%rax,1)
L19:
  mov    %rbp,%rdi
  sub    $0x1,%r14
  call   <strlen@plt>
  movzbl 0x1(%r14),%edx
  cltq
  mov    %dl,0x40(%rsp,%rax,1)
  cmp    %rbx,%r14
  jne    L19
L49:
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L91
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x31,%eax
  jg     L91
  cmpb   $0x40,0x40(%rsp)
  je     L91
  lea    D4(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %eax,%eax
  je     L91
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <emaillist@plt>
  test   %rax,%rax
  setne  %al
  movzbl %al,%eax
  jmp    L158
  nopl   (%rax)
L219:
  bt     %rsi,%r8
  jb     L243
L248:
  mov    %al,(%rdx)
  cmp    $0x3e,%al
  jne    L143
  cmpb   $0x62,-0x1(%r13,%rcx,1)
  je     L241
L143:
  lea    (%rdi,%rdx,1),%eax
  sub    $0x1,%ebx
  cmp    $0x31,%eax
  mov    %ebx,%eax
  not    %eax
  setle  %cl
  add    $0x1,%rdx
  shr    $0x1f,%eax
  test   %al,%cl
  jne    L10
  mov    %r14,%rdi
  call   <strlen@plt>
  cmp    $0x31,%eax
  jle    L227
L91:
  xor    %eax,%eax
L158:
  mov    0x78(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L149
  sub    $0xffffffffffffff80,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L32:
  cmp    $0x44,%al
  jne    L248
  cmpb   $0x33,-0x1(%r13,%rcx,1)
  je     L228
L277:
  movb   $0x44,(%rdx)
  jmp    L143
  nopl   0x0(%rax)
L228:
  cmpb   $0x25,-0x2(%r13,%rcx,1)
  jne    L277
  jmp    L45
  nopl   (%rax)
L241:
  cmpb   $0x2f,-0x2(%r13,%rcx,1)
  je     L133
L207:
  cmpb   $0x3c,-0x2(%r13,%rcx,1)
  jne    L143
  sub    $0x3,%ebx
  jmp    L143
  nopl   0x0(%rax)
L133:
  cmpb   $0x3c,-0x3(%r13,%rcx,1)
  jne    L207
  sub    $0x4,%ebx
  movslq %ebx,%rcx
  cmpb   $0x3e,0x0(%r13,%rcx,1)
  jne    L143
  cmpb   $0x62,-0x1(%r13,%rcx,1)
  je     L207
  jmp    L143
L149:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D4
type: string

tool: D4: @

assistant: ```c
int grab_emails(char *buff, int pointer, char *host) {
  int ctr = 0;
  char flippedemail[50];
  char email[50];
  memset(email, '\0', sizeof(email));
  memset(flippedemail, '\0', sizeof(flippedemail));
  while (pointer >= 0 && ctr < 50 && (buff[pointer] == '-' || buff[pointer] == 64 || buff[pointer] == 46 || (buff[pointer] >= 48 && buff[pointer] <= 57) || (buff[pointer] >= 65 && buff[pointer] <= 90) || (buff[pointer] >= 97 && buff[pointer] <= 122))) {
    if (buff[pointer] == 'D' && buff[pointer - 1] == '3' && buff[pointer - 2] == '%')
      break;
    flippedemail[ctr] = buff[pointer];
    if (buff[pointer] == '>' && buff[pointer - 1] == 'b' && buff[pointer - 2] == '/' && buff[pointer - 3] == '<')
      pointer -= 4;
    if (buff[pointer] == '>' && buff[pointer - 1] == 'b' && buff[pointer - 2] == '<')
      pointer -= 3;
    ctr++;
    pointer--;
  }
  if (strlen(flippedemail) >= 50)
    return 0;
  for (ctr = (int)strlen(flippedemail); ctr >= 0; ctr--) {
    email[strlen(email)] = flippedemail[ctr];
  }
  if (!strlen(email) || strlen(email) >= 50 || email[0] == '@' || !strstr(email, "@"))
    return 0;
  if (emaillist(email, host))
    return 1;
  return 0;
}
```