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

```asm
<_prompt_loop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x160,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x30,-0x158(%rbp)
  movl   $0x1,-0x154(%rbp)
  movl   $0x0,-0x15c(%rbp)
  jmp    L100
L77:
  mov    -0x15c(%rbp),%eax
  cltq
  movl   $0x0,-0x150(%rbp,%rax,4)
  mov    -0x15c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x15c(%rbp)
L100:
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jg     L77
L18:
  lea    -0x90(%rbp),%rax
  mov    $0x80,%edx
  mov    %rax,%rsi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <xreadline@plt>
  test   %rax,%rax
  je     L290
  lea    -0x90(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L144
  lea    -0x90(%rbp),%rax
  lea    D99(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L144
  lea    -0x90(%rbp),%rax
  lea    D26(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L144
  lea    -0x90(%rbp),%rax
  lea    D68(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L85
  movl   $0x0,-0x15c(%rbp)
  jmp    L70
L24:
  mov    -0x15c(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%eax
  test   %eax,%eax
  je     L184
  lea    D158(%rip),%rax
  jmp    L220
L184:
  lea    D96(%rip),%rax
L220:
  mov    -0x15c(%rbp),%ecx
  mov    -0x154(%rbp),%edx
  add    %edx,%ecx
  mov    %rax,%rdx
  mov    %ecx,%esi
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x15c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x15c(%rbp)
L70:
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jg     L24
  jmp    L144
L85:
  lea    -0x15c(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  lea    D115(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L201
  mov    -0x15c(%rbp),%eax
  sub    -0x154(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    -0x15c(%rbp),%eax
  test   %eax,%eax
  js     L234
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jle    L234
  mov    -0x15c(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%eax
  test   %eax,%eax
  je     L27
  lea    D158(%rip),%rax
  jmp    L251
L27:
  lea    D96(%rip),%rax
L251:
  mov    -0x15c(%rbp),%ecx
  mov    -0x154(%rbp),%edx
  add    %edx,%ecx
  mov    %rax,%rdx
  mov    %ecx,%esi
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L144
L201:
  lea    -0x15c(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  lea    D81(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L152
  mov    -0x15c(%rbp),%eax
  sub    -0x154(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    -0x15c(%rbp),%eax
  test   %eax,%eax
  js     L234
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jle    L234
  mov    -0x15c(%rbp),%eax
  cltq
  movl   $0x1,-0x150(%rbp,%rax,4)
  jmp    L144
L152:
  lea    -0x15c(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  lea    D34(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L71
  mov    -0x15c(%rbp),%eax
  sub    -0x154(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    -0x15c(%rbp),%eax
  test   %eax,%eax
  js     L234
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jle    L234
  mov    -0x15c(%rbp),%eax
  cltq
  movl   $0x0,-0x150(%rbp,%rax,4)
  jmp    L144
L71:
  lea    -0x15c(%rbp),%rdx
  lea    -0x90(%rbp),%rax
  lea    D77(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  jne    L227
  mov    -0x15c(%rbp),%eax
  sub    -0x154(%rbp),%eax
  mov    %eax,-0x15c(%rbp)
  mov    -0x15c(%rbp),%eax
  test   %eax,%eax
  js     L234
  mov    -0x15c(%rbp),%eax
  cmp    %eax,-0x158(%rbp)
  jle    L234
  mov    -0x15c(%rbp),%eax
  cltq
  movl   $0x0,-0x150(%rbp,%rax,4)
  mov    $0x2,%edi
  call   <sleep@plt>
  mov    -0x15c(%rbp),%eax
  cltq
  movl   $0x1,-0x150(%rbp,%rax,4)
L144:
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L18
L290:
  nop
  jmp    L234
L227:
  nop
L234:
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L131
  call   <__stack_chk_fail@plt>
L131:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D44
type_guessed: string
name: read_data
arguments: data_tag: D99
type_guessed: string
name: read_data
arguments: data_tag: D26
type_guessed: string
name: read_data
arguments: data_tag: D68
type_guessed: string
name: read_data
arguments: data_tag: D158
type_guessed: string
name: read_data
arguments: data_tag: D96
type_guessed: string
name: read_data
arguments: data_tag: D114
type_guessed: string
name: read_data
arguments: data_tag: D115
type_guessed: string
name: read_data
arguments: data_tag: D81
type_guessed: string
name: read_data
arguments: data_tag: D34
type_guessed: string
name: read_data
arguments: data_tag: D77
type_guessed: string
name: read_data
arguments: data_tag: D20
type_guessed: string
name: read_data
arguments: data_tag: D50
type_guessed: string

tool: 

tool: D99: exprange on

tool: D26: exprange off

tool: D68: status

tool: D158: on

tool: D96: off

tool: D114: plug %d: %s


tool: D115: status %d

tool: D81: on %d

tool: D34: off %d

tool: D77: cycle %d

tool: D20: swpdu> 

tool: D50: 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);
}
```