user: Demonstrate the C code that generates the assembly output below:

```asm
<nxt_motor_set_speed>:
  endbr64
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  cmp    $0x1,%edi
  je     L47
  cmp    $0x2,%edi
  je     L82
  test   %edi,%edi
  je     L86
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   (%rax)
L47:
  xor    %eax,%eax
  call   <__startrek_read_W_speed@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L19
L9:
  pop    %rbx
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1110 <__startrek_write_W_speed@plt>
  nopl   0x0(%rax)
L86:
  xor    %eax,%eax
  call   <__startrek_read_R_speed@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L68
L24:
  pop    %rbx
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    11b0 <__startrek_write_R_speed@plt>
  nopl   0x0(%rax,%rax,1)
L82:
  xor    %eax,%eax
  call   <__startrek_read_T_speed@plt>
  mov    %eax,%ebx
  test   %al,%al
  jne    L77
L1:
  pop    %rbx
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    1160 <__startrek_write_T_speed@plt>
  nopl   0x0(%rax,%rax,1)
L77:
  xor    %eax,%eax
  call   <__VERIFIER_nondet_U8@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <__startrek_read_T_count@plt>
  mov    %eax,%r8d
  movzbl %r12b,%eax
  mov    %eax,%edi
  neg    %edi
  test   %bl,%bl
  cmovg  %eax,%edi
  add    %r8d,%edi
  call   <__startrek_write_T_count@plt>
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L68:
  xor    %eax,%eax
  call   <__VERIFIER_nondet_U8@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <__startrek_read_R_count@plt>
  mov    %eax,%r8d
  movzbl %r12b,%eax
  mov    %eax,%edi
  neg    %edi
  test   %bl,%bl
  cmovg  %eax,%edi
  add    %r8d,%edi
  call   <__startrek_write_R_count@plt>
  jmp    L24
  xchg   %ax,%ax
L19:
  xor    %eax,%eax
  call   <__VERIFIER_nondet_U8@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <__startrek_read_W_count@plt>
  mov    %eax,%r8d
  movzbl %r12b,%eax
  mov    %eax,%edi
  neg    %edi
  test   %bl,%bl
  cmovg  %eax,%edi
  add    %r8d,%edi
  call   <__startrek_write_W_count@plt>
  jmp    L9
```

assistant: ```c
void nxt_motor_set_speed(unsigned int n, int speed, _Bool b) {
  unsigned char diff;
  char prev_speed;
  int tmp;
  int tmp___0;
  int tmp___1;
  int tmp___2;
  int tmp___3;
  int tmp___4;
  {
    switch (n) {
    case 0:
      prev_speed = __startrek_read_R_speed();
      if (prev_speed != 0) {
        diff = __VERIFIER_nondet_U8();
        tmp = __startrek_read_R_count();
        if (prev_speed > 0) {
          tmp___0 = diff;
        } else {
          tmp___0 = -((int)diff);
        }
        __startrek_write_R_count(tmp + tmp___0);
      }
      __startrek_write_R_speed(speed);
      return;
    case 1:
      prev_speed = __startrek_read_W_speed();
      if (prev_speed != 0) {
        diff = __VERIFIER_nondet_U8();
        tmp___1 = __startrek_read_W_count();
        if (prev_speed > 0) {
          tmp___2 = diff;
        } else {
          tmp___2 = -((int)diff);
        }
        __startrek_write_W_count(tmp___1 + tmp___2);
      }
      __startrek_write_W_speed(speed);
      return;
    case 2:
      prev_speed = __startrek_read_T_speed();
      if (prev_speed != 0) {
        diff = __VERIFIER_nondet_U8();
        tmp___3 = __startrek_read_T_count();
        if (prev_speed > 0) {
          tmp___4 = diff;
        } else {
          tmp___4 = -((int)diff);
        }
        __startrek_write_T_count(tmp___3 + tmp___4);
      }
      __startrek_write_T_speed(speed);
      return;
    }
    return;
  }
}
```