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

```asm
<main>:
  endbr64
  push   %r15
  lea    D23(%rip),%rdi
  push   %r14
  push   %r13
  lea    D35(%rip),%r13
  push   %r12
  lea    D22(%rip),%r12
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  lea    0x4(%rsp),%r14
  call   <b_output@plt>
  lea    0x16(%rsp),%r15
L92:
  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     L54
  cmp    $0x65,%al
  je     L115
  cmp    $0x73,%al
  je     L69
  cmp    $0x63,%al
  jne    L92
  mov    %r14,%rdx
  xor    %esi,%esi
  mov    $0x9,%edi
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  call   <b_system_misc@plt>
  mov    %r13,%rdi
  call   <b_output@plt>
  jmp    L92
  nopl   (%rax)
L115:
  cmpb   $0x78,0x11(%rsp)
  jne    L97
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  add    $0xa8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L54:
  mov    %r12,%rdi
  call   <b_output@plt>
  jmp    L92
L97:
  lea    0x15(%rsp),%rdi
  call   <b_output@plt>
  jmp    L92
L69:
  movq   $0x0,0x8(%rsp)
  mov    %r15,%rdi
  call   <strlen@plt>
  movl   $0x6,0x4(%rsp)
  mov    %eax,%edi
  test   %eax,%eax
  jle    L106
  mov    0x8(%rsp),%rsi
  mov    %r15,%rcx
  mov    %eax,%edx
  nop
L10:
  movsbl (%rcx),%eax
  add    $0x1,%rcx
  sub    $0x1e,%eax
  imul   %edx,%eax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  cltq
  add    %rax,%rsi
  sub    $0x1,%edx
  jne    L10
  add    $0x6,%edi
  mov    %rsi,0x8(%rsp)
  mov    %edi,0x4(%rsp)
L106:
  lea    0x8(%rsp),%rsi
  xor    %edx,%edx
  mov    $0x6,%edi
  xor    %eax,%eax
  shlq   $0x3,0x8(%rsp)
  call   <b_system_misc@plt>
  jmp    L92
L110:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D23
type: string
name: disassemble_data
arguments: label: D35
type: string
name: disassemble_data
arguments: label: D22
type: string
name: disassemble_data
arguments: label: D9
type: string

tool: D23: Console ready.


tool: D35: cores: TBI

tool: D22: 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: D9: term> 

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