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

```asm
<_prompt_loop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x168,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  lea    0xd0(%rsp),%rdx
L154:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L154
  movl   $0x30,0xc(%rsp)
  lea    D114(%rip),%rbx
  lea    D93(%rip),%rbp
  lea    D150(%rip),%r15
  jmp    L103
L56:
  movl   $0x0,0xc(%rsp)
  lea    D51(%rip),%r14
  lea    D90(%rip),%r13
  lea    D113(%rip),%r12
L172:
  movslq %eax,%rdx
  cmpl   $0x0,0x10(%rsp,%rdx,4)
  mov    %r13,%rdx
  cmovne %r14,%rdx
  lea    0x1(%rax),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0xc(%rsp)
  cmp    $0x2f,%eax
  jle    L172
L48:
  lea    D80(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L103:
  lea    0xd0(%rsp),%rsi
  mov    $0x80,%edx
  mov    %rbx,%rdi
  call   <xreadline@plt>
  test   %rax,%rax
  je     L163
  cmpb   $0x0,0xd0(%rsp)
  je     L48
  lea    0xd0(%rsp),%rdi
  mov    %rbp,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L48
  lea    0xd0(%rsp),%rdi
  mov    %r15,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L48
  lea    0xd0(%rsp),%rdi
  lea    D137(%rip),%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L56
  lea    0xc(%rsp),%rdx
  lea    0xd0(%rsp),%rdi
  lea    D61(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L75
  mov    0xc(%rsp),%esi
  lea    -0x1(%rsi),%eax
  mov    %eax,0xc(%rsp)
  cmp    $0x2f,%eax
  ja     L163
  cltq
  cmpl   $0x0,0x10(%rsp,%rax,4)
  lea    D51(%rip),%rdx
  lea    D90(%rip),%rax
  cmove  %rax,%rdx
  lea    D113(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L48
L75:
  lea    0xc(%rsp),%rdx
  lea    0xd0(%rsp),%rdi
  lea    D3(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L29
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0xc(%rsp)
  cmp    $0x2f,%eax
  ja     L163
  cltq
  movl   $0x1,0x10(%rsp,%rax,4)
  jmp    L48
L29:
  lea    0xc(%rsp),%rdx
  lea    0xd0(%rsp),%rdi
  lea    D142(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L207
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0xc(%rsp)
  cmp    $0x2f,%eax
  ja     L163
  cltq
  movl   $0x0,0x10(%rsp,%rax,4)
  jmp    L48
L207:
  lea    0xc(%rsp),%rdx
  lea    0xd0(%rsp),%rdi
  lea    D157(%rip),%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L163
  mov    0xc(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0xc(%rsp)
  cmp    $0x2f,%eax
  ja     L163
  cltq
  movl   $0x0,0x10(%rsp,%rax,4)
  mov    $0x2,%edi
  call   <sleep@plt>
  movslq 0xc(%rsp),%rax
  movl   $0x1,0x10(%rsp,%rax,4)
  jmp    L48
L163:
  lea    D133(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    0x158(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L149
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L149:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D114
datatype: string
name: retrieve_data
arguments: label: D93
datatype: string
name: retrieve_data
arguments: label: D150
datatype: string
name: retrieve_data
arguments: label: D51
datatype: string
name: retrieve_data
arguments: label: D90
datatype: string
name: retrieve_data
arguments: label: D113
datatype: string
name: retrieve_data
arguments: label: D80
datatype: string
name: retrieve_data
arguments: label: D137
datatype: string
name: retrieve_data
arguments: label: D61
datatype: string
name: retrieve_data
arguments: label: D3
datatype: string
name: retrieve_data
arguments: label: D142
datatype: string
name: retrieve_data
arguments: label: D157
datatype: string
name: retrieve_data
arguments: label: D133
datatype: string

tool: 

tool: D93: exprange on

tool: D150: exprange off

tool: D51: on

tool: D90: off

tool: D113: plug %d: %s


tool: D80: swpdu> 

tool: D137: status

tool: D61: status %d

tool: D3: on %d

tool: D142: off %d

tool: D157: cycle %d

tool: D133: Error, exiting

assistant: ```c
void _prompt_loop(void) {
  int i;
  char buf[128];
  int num_plugs = 48;
  int plug[48];
  int plug_origin = 1;
  for (i = 0; i < num_plugs; i++) {
    plug[i] = 0;
  }
  while (1) {
    if (xreadline("", buf, sizeof(buf)) == NULL)
      break;
    if (strlen(buf) == 0) {
    } else if (!strcmp(buf, "exprange on")) {
    } else if (!strcmp(buf, "exprange off")) {
    } else if (!strcmp(buf, "status")) {
      for (i = 0; i < num_plugs; i++)
        printf("plug %d: %s\n", i + plug_origin, plug[i] ? "on" : "off");
    } else if (sscanf(buf, "status %d", &i) == 1) {
      i -= plug_origin;
      if (i < 0 || i >= num_plugs)
        break;
      printf("plug %d: %s\n", i + plug_origin, plug[i] ? "on" : "off");
    } else if (sscanf(buf, "on %d", &i) == 1) {
      i -= plug_origin;
      if (i < 0 || i >= num_plugs)
        break;
      plug[i] = 1;
    } else if (sscanf(buf, "off %d", &i) == 1) {
      i -= plug_origin;
      if (i < 0 || i >= num_plugs)
        break;
      plug[i] = 0;
    } else if (sscanf(buf, "cycle %d", &i) == 1) {
      i -= plug_origin;
      if (i < 0 || i >= num_plugs)
        break;
      plug[i] = 0;
      sleep(2);
      plug[i] = 1;
    } else
      break;
    printf("swpdu> ");
  }
  printf("Error, exiting");
  exit(1);
}
```