user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    D10(%rip),%rdi
  call   <b_output@plt>
  lea    D35(%rip),%rbp
  lea    0x10(%rsp),%rbx
  lea    D21(%rip),%r13
  lea    D31(%rip),%r12
L72:
  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     L94
  cmp    $0x65,%al
  je     L45
  cmp    $0x73,%al
  je     L29
  cmp    $0x63,%al
  jne    L72
  movl   $0x0,0x4(%rsp)
  lea    0x4(%rsp),%rdx
  mov    $0x0,%esi
  mov    $0x9,%edi
  mov    $0x0,%eax
  call   <b_system_misc@plt>
  mov    %r13,%rdi
  call   <b_output@plt>
  jmp    L72
L94:
  mov    %r12,%rdi
  call   <b_output@plt>
  jmp    L72
L45:
  cmpb   $0x78,0x11(%rsp)
  jne    L15
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  mov    $0x0,%eax
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L15:
  lea    0x15(%rsp),%rdi
  call   <b_output@plt>
  jmp    L72
L29:
  movq   $0x0,0x8(%rsp)
  lea    0x16(%rsp),%rdi
  call   <strlen@plt>
  movl   $0x6,0x4(%rsp)
  test   %eax,%eax
  jle    L56
  mov    0x8(%rsp),%rsi
  mov    $0x7,%ecx
  lea    0xf(%rsp),%rdi
L84:
  movsbl (%rdi,%rcx,1),%edx
  sub    $0x1e,%edx
  imul   %eax,%edx
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  movslq %edx,%rdx
  add    %rdx,%rsi
  mov    %ecx,%edx
  add    $0x1,%rcx
  sub    $0x1,%eax
  jne    L84
  mov    %rsi,0x8(%rsp)
  mov    %edx,0x4(%rsp)
L56:
  shlq   $0x3,0x8(%rsp)
  lea    0x8(%rsp),%rsi
  mov    $0x0,%edx
  mov    $0x6,%edi
  mov    $0x0,%eax
  call   <b_system_misc@plt>
  jmp    L72
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D10
type: string
name: parse_data
arguments: label: D35
type: string
name: parse_data
arguments: label: D21
type: string
name: parse_data
arguments: label: D31
type: string

tool: D10: Console ready.


tool: D35: term> 

tool: D21: cores: TBI

tool: D31: 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.

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;
}
```