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

```asm
<lex_look_ahead>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    -0x1(%rsi),%ebx
  sub    $0x18,%rsp
  mov    (%rdx),%eax
  mov    %rcx,(%rsp)
  lea    (%rax,%rsi,1),%ecx
  mov    %ecx,0x8(%rsp)
  jmp    L159
  nopl   (%rax)
L60:
  mov    (%r12),%eax
  add    $0x1,%eax
  mov    %eax,(%r12)
  cmp    %ebx,%eax
  jae    L57
L159:
  movsbl 0x0(%rbp,%rax,1),%edi
  call   <is_whitespace@plt>
  test   %rax,%rax
  jne    L60
L57:
  mov    (%rsp),%rax
  movb   $0x0,(%rax)
  mov    (%r12),%edx
  movzbl 0x0(%rbp,%rdx,1),%ebx
  test   %bl,%bl
  je     L177
  cmp    %edx,0x8(%rsp)
  jbe    L177
  lea    -0x1(%r13),%eax
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  mov    %eax,0xc(%rsp)
  jmp    L143
L14:
  cmp    %r15d,0xc(%rsp)
  jbe    L43
L55:
  mov    (%rsp),%rdx
  mov    %r15d,%eax
  mov    %bl,(%rdx,%rax,1)
  lea    0x1(%r15),%eax
  movb   $0x0,(%rdx,%rax,1)
  mov    (%r12),%ecx
  mov    %rax,%r15
  cmpb   $0x0,0x0(%rbp,%rcx,1)
  mov    %rcx,%rax
  je     L177
  add    %r15d,%eax
  cmp    0x8(%rsp),%eax
  jae    L177
  movsbl %bl,%r14d
  movzbl 0x0(%rbp,%rax,1),%ebx
L143:
  movsbl %bl,%r13d
  mov    %r13d,%edi
  call   <is_whitespace@plt>
  test   %rax,%rax
  jne    L177
  test   %r15d,%r15d
  je     L14
  mov    %r14d,%edi
  call   <is_alpha@plt>
  test   %rax,%rax
  je     L26
  mov    %r13d,%edi
  call   <is_alpha@plt>
  test   %rax,%rax
  je     L177
L26:
  mov    %r14d,%edi
  call   <is_number@plt>
  test   %rax,%rax
  je     L146
  mov    %r13d,%edi
  call   <is_number@plt>
  test   %rax,%rax
  je     L177
L146:
  mov    %r13d,%edi
  call   <_is_statement_terminator@plt>
  test   %rax,%rax
  jne    L177
  mov    %r14d,%edi
  call   <_is_operator@plt>
  test   %rax,%rax
  je     L14
L177:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L43:
  lea    D9(%rip),%rdi
  call   <err_msg@plt>
  mov    (%r12),%edi
  add    %rbp,%rdi
  call   <err_msg@plt>
  lea    D1(%rip),%rdi
  call   <err_msg@plt>
  xor    %eax,%eax
  call   <die@plt>
  jmp    L55
```

tool_calls: name: parse_data
arguments: data_tag: D9
data_type: string
name: parse_data
arguments: data_tag: D1
data_type: string

tool: D9: not enough room for next token: '

tool: D1: '


assistant: ```c
void lex_look_ahead(const char *input, unsigned int input_len, unsigned int *pos, char *output, unsigned int output_size) {
  unsigned int i;
  unsigned int end;
  char last;
  char next;
  i = 0;
  end = *pos + input_len;
  last = '\0';
  next = '\0';
  while (is_whitespace(input[*pos])) {
    *pos += 1;
    if (*pos >= input_len - 1) {
      break;
    }
  }
  output[0] = '\0';
  while (input[*pos] && (*pos + i) < end) {
    last = next;
    next = input[*pos + i];
    if (is_whitespace(next)) {
      break;
    }
    if (i > 0) {
      if (is_alpha(last) && !is_alpha(next)) {
        break;
      }
      if (is_number(last) && !is_number(next)) {
        break;
      }
      if (_is_statement_terminator(next)) {
        break;
      }
      if (_is_operator(last)) {
        break;
      }
    }
    if (i >= output_size - 1) {
      err_msg("not enough room for next token: '");
      err_msg(&(input[*pos]));
      err_msg("'\n");
      die();
    }
    output[i] = next;
    output[i + 1] = '\0';
    i++;
  }
}
```