user: 请将以下的汇编代码转换成C语言代码:

```asm
<auto_login_next_token>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  lea    D16(%rip),%rsi
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    (%rdi),%r14
  movdqa D37(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %r14,%rdi
  movaps %xmm0,(%rsp)
  call   <strstr@plt>
  test   %rax,%rax
  je     L20
  lea    D39(%rip),%rsi
  mov    %r14,%rdi
  mov    %rax,%rbx
  xor    %r12d,%r12d
  call   <strstr@plt>
  test   %rax,%rax
  je     L2
  cmp    %rax,%rbx
  seta   %r12b
  cmova  %rax,%rbx
  movzbl %r12b,%r12d
L2:
  lea    D0(%rip),%rsi
  mov    %r14,%rdi
  call   <strstr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L10
  test   %rbx,%rbx
  je     L27
  cmp    %rax,%rbx
  ja     L27
L10:
  lea    D15(%rip),%rsi
  mov    %r14,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L124
L85:
  test   %rbx,%rbx
  je     L97
  cmp    %rax,%rbx
  ja     L97
L124:
  cmp    $0xffffffff,%r12d
  jne    L137
L195:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L73
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L97:
  movslq 0xc(%rsp),%rdx
  mov    $0x3,%r12d
  add    %rdx,%rax
  mov    %rax,0x0(%rbp)
L129:
  movsbl (%rax),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L12
L39:
  mov    0x0(%rbp),%rax
  jmp    L70
  nopl   (%rax)
L102:
  mov    0x0(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,0x0(%rbp)
L70:
  movsbl (%rax),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L102
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <read_token@plt>
  jmp    L195
  xchg   %ax,%ax
L27:
  lea    D15(%rip),%rsi
  mov    %r14,%rdi
  mov    %r15,%rbx
  mov    $0x2,%r12d
  call   <strstr@plt>
  test   %rax,%rax
  jne    L85
  movslq 0x8(%rsp),%rax
  add    %r15,%rax
  mov    %rax,0x0(%rbp)
  movsbl (%rax),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L39
L12:
  movb   $0x0,0x0(%r13)
  jmp    L195
  nopl   0x0(%rax)
L137:
  movslq %r12d,%rax
  movslq (%rsp,%rax,4),%rax
  add    %rbx,%rax
  mov    %rax,0x0(%rbp)
  cmp    $0x1,%r12d
  je     L195
  jmp    L129
  nopl   (%rax)
L20:
  lea    D39(%rip),%rsi
  mov    %r14,%rdi
  call   <strstr@plt>
  cmp    $0x1,%rax
  mov    %rax,%rbx
  sbb    %r12d,%r12d
  or     $0x1,%r12d
  jmp    L2
L73:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D16
datatype: string
name: unpack_data
arguments: tag: D37
datatype: byte[16]
name: unpack_data
arguments: tag: D39
datatype: string
name: unpack_data
arguments: tag: D0
datatype: string
name: unpack_data
arguments: tag: D15
datatype: string

tool: D16: machine

tool: {"D37": [0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x08,0x00,0x00,0x00]}

tool: D39: default

tool: D0: login

tool: D15: password

assistant: ```c
int auto_login_next_token(char **hay, char *store) {
  char *keys[] = {"machine", "default", "login", "password"};
  int keys_len[] = {7, 7, 5, 8};
  char *ptr, *minptr;
  int i, min;
  min = -1;
  minptr = 0;
  for (i = 0; i < 4; i++)
    if ((ptr = strstr(*hay, keys[i])))
      if (!minptr || ptr < minptr) {
        minptr = ptr;
        min = i;
      }
  if (min != -1) {
    *hay = minptr + keys_len[min];
    if (min != 1) {
      if (!isspace(**hay)) {
        *store = 0;
      } else {
        while (isspace(**hay))
          (*hay)++;
        read_token(hay, store);
      }
    }
  }
  return min;
}
```