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

```asm
<main>:
  endbr64
  push   %r12
  lea    D79(%rip),%rdi
  push   %rbp
  lea    D57(%rip),%rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  call   <b_output@plt>
L199:
  mov    %rbp,%rdi
  call   <b_output@plt>
  mov    $0x80,%esi
  mov    %rbx,%rdi
  call   <b_input@plt>
  movzbl 0x10(%rsp),%eax
  cmp    $0x68,%al
  je     L98
  cmp    $0x65,%al
  je     L135
  cmp    $0x73,%al
  je     L221
  cmp    $0x63,%al
  jne    L199
  lea    0x4(%rsp),%rdx
  xor    %esi,%esi
  mov    $0x9,%edi
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  call   <b_system_misc@plt>
  lea    D78(%rip),%rdi
  call   <b_output@plt>
  jmp    L199
  nopl   (%rax)
L135:
  cmpb   $0x78,0x11(%rsp)
  jne    L170
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L203
  add    $0xa0,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L98:
  lea    D62(%rip),%rdi
  call   <b_output@plt>
  jmp    L199
L170:
  lea    0x15(%rsp),%rdi
  call   <b_output@plt>
  jmp    L199
L221:
  movq   $0x0,0x8(%rsp)
  lea    0x16(%rsp),%r12
  mov    %r12,%rdi
  call   <strlen@plt>
  movl   $0x6,0x4(%rsp)
  mov    %eax,%ecx
  test   %eax,%eax
  jle    L89
  mov    0x8(%rsp),%rdx
  cmp    $0xf,%eax
  jle    L159
  movd   %eax,%xmm7
  pxor   %xmm3,%xmm3
  pxor   %xmm9,%xmm9
  mov    %eax,%edi
  pshufd $0x0,%xmm7,%xmm7
  shr    $0x4,%edi
  xor    %eax,%eax
  pxor   %xmm8,%xmm8
  paddd  D5(%rip),%xmm7
  pxor   %xmm6,%xmm6
  movdqa D36(%rip),%xmm11
  movdqa D14(%rip),%xmm10
L234:
  mov    %rax,%rsi
  movdqa %xmm9,%xmm0
  movdqa %xmm7,%xmm1
  add    $0x1,%rax
  shl    $0x4,%rsi
  movdqa %xmm8,%xmm13
  paddd  D24(%rip),%xmm7
  movdqu (%r12,%rsi,1),%xmm2
  pcmpgtb %xmm2,%xmm0
  movdqa %xmm2,%xmm4
  punpcklbw %xmm0,%xmm4
  paddw  D108(%rip),%xmm4
  punpckhbw %xmm0,%xmm2
  movdqa %xmm1,%xmm0
  paddw  D108(%rip),%xmm2
  pcmpgtw %xmm4,%xmm13
  psrlq  $0x20,%xmm0
  movdqa %xmm4,%xmm5
  punpcklwd %xmm13,%xmm5
  punpckhwd %xmm13,%xmm4
  movdqa %xmm8,%xmm13
  movdqa %xmm5,%xmm12
  psrlq  $0x20,%xmm5
  pmuludq %xmm1,%xmm12
  pmuludq %xmm0,%xmm5
  pcmpgtw %xmm2,%xmm13
  pshufd $0x8,%xmm5,%xmm5
  pshufd $0x8,%xmm12,%xmm12
  punpckldq %xmm5,%xmm12
  movdqa %xmm12,%xmm0
  pslld  $0x2,%xmm0
  paddd  %xmm12,%xmm0
  movdqa D55(%rip),%xmm12
  pslld  $0x1,%xmm0
  paddd  %xmm1,%xmm12
  movdqa %xmm12,%xmm5
  psrlq  $0x20,%xmm12
  pmuludq %xmm4,%xmm5
  psrlq  $0x20,%xmm4
  pmuludq %xmm4,%xmm12
  pshufd $0x8,%xmm5,%xmm4
  pshufd $0x8,%xmm12,%xmm12
  punpckldq %xmm12,%xmm4
  movdqa %xmm1,%xmm12
  paddd  %xmm10,%xmm1
  movdqa %xmm4,%xmm5
  paddd  %xmm11,%xmm12
  pslld  $0x2,%xmm5
  movdqa %xmm12,%xmm14
  paddd  %xmm4,%xmm5
  psrlq  $0x20,%xmm12
  movdqa %xmm2,%xmm4
  punpcklwd %xmm13,%xmm4
  pslld  $0x1,%xmm5
  punpckhwd %xmm13,%xmm2
  pmuludq %xmm4,%xmm14
  psrlq  $0x20,%xmm4
  pmuludq %xmm4,%xmm12
  pshufd $0x8,%xmm14,%xmm14
  pshufd $0x8,%xmm12,%xmm12
  punpckldq %xmm12,%xmm14
  movdqa %xmm1,%xmm12
  pmuludq %xmm2,%xmm12
  psrlq  $0x20,%xmm1
  movdqa %xmm14,%xmm4
  psrlq  $0x20,%xmm2
  pslld  $0x2,%xmm4
  pmuludq %xmm2,%xmm1
  paddd  %xmm14,%xmm4
  pslld  $0x1,%xmm4
  pshufd $0x8,%xmm12,%xmm2
  movdqa %xmm0,%xmm12
  pshufd $0x8,%xmm1,%xmm1
  punpckldq %xmm1,%xmm2
  movdqa %xmm2,%xmm1
  pslld  $0x2,%xmm1
  paddd  %xmm2,%xmm1
  movdqa %xmm6,%xmm2
  pcmpgtd %xmm0,%xmm2
  pslld  $0x1,%xmm1
  punpckldq %xmm2,%xmm12
  punpckhdq %xmm2,%xmm0
  movdqa %xmm6,%xmm2
  pcmpgtd %xmm5,%xmm2
  paddq  %xmm12,%xmm0
  movdqa %xmm5,%xmm12
  punpckldq %xmm2,%xmm12
  punpckhdq %xmm2,%xmm5
  movdqa %xmm6,%xmm2
  pcmpgtd %xmm4,%xmm2
  paddq  %xmm12,%xmm5
  paddq  %xmm5,%xmm0
  movdqa %xmm4,%xmm5
  punpckldq %xmm2,%xmm5
  punpckhdq %xmm2,%xmm4
  movdqa %xmm6,%xmm2
  pcmpgtd %xmm1,%xmm2
  paddq  %xmm5,%xmm4
  movdqa %xmm1,%xmm5
  punpckldq %xmm2,%xmm5
  punpckhdq %xmm2,%xmm1
  paddq  %xmm5,%xmm4
  paddq  %xmm3,%xmm1
  paddq  %xmm4,%xmm0
  movdqa %xmm0,%xmm3
  paddq  %xmm1,%xmm3
  cmp    %eax,%edi
  ja     L234
  movdqa %xmm3,%xmm0
  mov    %ecx,%edi
  psrldq $0x8,%xmm0
  and    $0xfffffff0,%edi
  paddq  %xmm0,%xmm3
  lea    0x6(%rdi),%esi
  movq   %xmm3,%rax
  add    %rax,%rdx
  mov    %ecx,%eax
  and    $0xf,%eax
  cmp    %edi,%ecx
  je     L136
L190:
  movslq %esi,%rdi
  mov    %eax,%r8d
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %eax,%edi
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x1(%rsi),%edi
  sub    $0x1,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x2(%rsi),%edi
  sub    $0x2,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x3(%rsi),%edi
  sub    $0x3,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x4(%rsi),%edi
  sub    $0x4,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x5(%rsi),%edi
  sub    $0x5,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x6(%rsi),%edi
  sub    $0x6,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x7(%rsi),%edi
  sub    $0x7,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x8(%rsi),%edi
  sub    $0x8,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x9(%rsi),%edi
  sub    $0x9,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0xa(%rsi),%edi
  sub    $0xa,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0xb(%rsi),%edi
  sub    $0xb,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0xc(%rsi),%edi
  sub    $0xc,%r8d
  je     L136
  movslq %edi,%rdi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  mov    %eax,%r8d
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0xd(%rsi),%edi
  sub    $0xd,%r8d
  je     L136
  movslq %edi,%rdi
  add    $0xe,%esi
  movsbl 0x10(%rsp,%rdi,1),%edi
  sub    $0x1e,%edi
  imul   %r8d,%edi
  imul   $0xa,%edi,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  sub    $0xe,%eax
  je     L136
  movslq %esi,%rsi
  movsbl 0x10(%rsp,%rsi,1),%esi
  sub    $0x1e,%esi
  imul   %esi,%eax
  imul   $0xa,%eax,%eax
  cltq
  add    %rax,%rdx
L136:
  add    $0x6,%ecx
  mov    %rdx,0x8(%rsp)
  mov    %ecx,0x4(%rsp)
L89:
  lea    0x8(%rsp),%rsi
  xor    %edx,%edx
  mov    $0x6,%edi
  xor    %eax,%eax
  shlq   $0x3,0x8(%rsp)
  call   <b_system_misc@plt>
  jmp    L199
L159:
  mov    $0x6,%esi
  jmp    L190
L203:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D79
type_infered: string
name: retrieve_data
arguments: label: D57
type_infered: string
name: retrieve_data
arguments: label: D78
type_infered: string
name: retrieve_data
arguments: label: D62
type_infered: string
name: retrieve_data
arguments: label: D5
type_infered: byte[16]
name: retrieve_data
arguments: label: D36
type_infered: byte[16]
name: retrieve_data
arguments: label: D14
type_infered: byte[16]
name: retrieve_data
arguments: label: D24
type_infered: byte[16]
name: retrieve_data
arguments: label: D108
type_infered: byte[16]
name: retrieve_data
arguments: label: D55
type_infered: byte[16]

tool: D79: Console ready.


tool: D57: term> 

tool: D78: cores: TBI

tool: D62: Help for Console:
Commands:
help	Display help
echo	echos text
sleep	delays for <x> seconds
exit	return to the boring BMOS shell
cores	get number of cores
	well, that's it.

tool: {"D5": [0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfd,0xff,0xff,0xff]}

tool: {"D36": [0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xf8,0xff,0xff,0xff]}

tool: {"D14": [0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff,0xf4,0xff,0xff,0xff]}

tool: {"D24": [0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff]}

tool: {"D108": [0xe2,0xff,0xe2,0xff,0xe2,0xff,0xe2,0xff,0xe2,0xff,0xe2,0xff,0xe2,0xff,0xe2,0xff]}

tool: {"D55": [0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xfc,0xff,0xff,0xff]}

assistant: ```c
int main() {
  char cmd[129];
  int ti, i;
  unsigned long sleeptime;
  b_output("Console ready.\n");
  while (1) {
    b_output("term> ");
    b_input(cmd, 128);
    if (*cmd == 'h') {
      b_output("Help for Console:\nCommands:\nhelp\tDisplay help\necho\techos text\nsleep\tdelays for <x> seconds\nexit\treturn to the boring BMOS shell\ncores\tget number of cores\n\twell, that's it.");
      continue;
    } else if (*cmd == 'e') {
      if (*(cmd + 1) == 'x') {
        return 0;
      } else {
        b_output(cmd + 5);
        continue;
      }
    } else if (*cmd == 's') {
      sleeptime = 0;
      ti = strlen(cmd + 6);
      i = 6;
      for (; ti > 0; ti--) {
        sleeptime += (*(cmd + i) - 30) * (ti * 10);
        i++;
      }
      sleeptime *= 8;
      b_system_misc(6, &sleeptime, 0x0);
      continue;
    } else if (*cmd == 'c') {
      i = 0;
      b_system_misc(9, 0x0, &i);
      b_output("cores: TBI");
      continue;
    }
  }
  return 1;
}
```