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

```asm
<control_register_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x2a,%edi
  call   <send_char@plt>
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  and    $0x1e,%eax
  test   %eax,%eax
  je     L81
  mov    -0x8(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L81
  mov    -0x8(%rbp),%eax
  mov    $0x2e9,%edx
  mov    %eax,%esi
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L81:
  mov    -0x8(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L117
  mov    -0x8(%rbp),%eax
  and    $0x60,%eax
  cmp    $0x40,%eax
  jne    L60
L117:
  mov    $0x2e9,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
  nop
L60:
  nop
L96:
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  and    $0x1,%eax
  test   %eax,%eax
  je     L96
  mov    $0x2,%esi
  mov    $0x9c000002,%edi
  call   <setreg@plt>
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  cmp    $0x60,%eax
  je     L18
  mov    $0x2ec,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
L18:
  mov    $0x21,%edi
  call   <send_char@plt>
  mov    $0x21,%edi
  call   <recv_char@plt>
  mov    $0x2ef,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  and    $0x20,%eax
  test   %eax,%eax
  jne    L62
  mov    $0x2f2,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
L62:
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  and    $0x40,%eax
  test   %eax,%eax
  jne    L120
  mov    $0x2f3,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
L120:
  mov    $0x31,%edi
  call   <send_char_no_wait@plt>
  mov    $0x32,%edi
  call   <send_char_no_wait@plt>
  mov    $0x4,%esi
  mov    $0x9c000002,%edi
  call   <setreg@plt>
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  cmp    $0x20,%eax
  je     L91
  mov    $0x2fb,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
L91:
  mov    $0x9c000005,%edi
  call   <getreg@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    $0x1e,%eax
  test   %eax,%eax
  je     L31
  mov    -0x4(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L31
  mov    -0x4(%rbp),%eax
  mov    $0x2fc,%edx
  mov    %eax,%esi
  lea    D64(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L31:
  mov    -0x4(%rbp),%eax
  and    $0x80,%eax
  test   %eax,%eax
  jne    L19
  mov    -0x4(%rbp),%eax
  and    $0x60,%eax
  cmp    $0x40,%eax
  jne    L116
L19:
  mov    $0x2fc,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fail@plt>
  nop
L116:
  mov    $0x2a,%edi
  call   <send_char@plt>
  mov    $0x2a,%edi
  call   <recv_char@plt>
  mov    $0x2ff,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x306,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D64
type_guessed: string
name: read_data
arguments: label: D106
type_guessed: string
name: read_data
arguments: label: D70
type_guessed: string
name: read_data
arguments: label: D78
type_guessed: string

tool: D64: LSR7 (0x%02x) ERR @ %i


tool: D106: ?

tool: D70: Passed line %i


tool: D78: OK

assistant: ```c
void control_register_test() {
  send_char('*');
  {
    unsigned x = getreg(((0x9c000000) + 5));
    if ((x & ((0x10) | (0x08) | (0x04) | (0x02))) && !(x & (0x80)))
      printf("LSR7 (0x%02x) ERR @ %i\n", x, 745);
    ((!(x & (0x80)) && ((x & 0x60) != 0x40)) ? 1 : fail("?", 745));
  };
  while (!(getreg(((0x9c000000) + 5)) & 0x01))
    ;
  setreg(((0x9c000000) + 2), 2);
  ((getreg(((0x9c000000) + 5)) == 0x60) ? 1 : fail("?", 748));
  send_char('!');
  recv_char('!');
  printf("Passed line %i\n", 751);
  ((getreg(((0x9c000000) + 5)) & (0x20)) ? 1 : fail("?", 754));
  ((getreg(((0x9c000000) + 5)) & (0x40)) ? 1 : fail("?", 755));
  send_char_no_wait('1');
  send_char_no_wait('2');
  setreg(((0x9c000000) + 2), 4);
  ((getreg(((0x9c000000) + 5)) == 0x20) ? 1 : fail("?", 763));
  {
    unsigned x = getreg(((0x9c000000) + 5));
    if ((x & ((0x10) | (0x08) | (0x04) | (0x02))) && !(x & (0x80)))
      printf("LSR7 (0x%02x) ERR @ %i\n", x, 764);
    ((!(x & (0x80)) && ((x & 0x60) != 0x40)) ? 1 : fail("?", 764));
  };
  send_char('*');
  recv_char('*');
  printf("Passed line %i\n", 767);
  printf("Passed line %i\n", 774);
  printf("OK\n");
}
```