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

```asm
<light_start>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r15d
  jmp    L42
L61:
  mov    $0x1,%edi
  call   <msleep@plt>
L42:
  mov    $0x0,%eax
  call   <b_button@plt>
  test   %rax,%rax
  jne    L61
  call   <c_button@plt>
  test   %rax,%rax
  jne    L61
  call   <display_clear@plt>
  lea    D76(%rip),%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  lea    D21(%rip),%rdx
  mov    $0x1,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  lea    D40(%rip),%rdx
  mov    $0x2,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  lea    D20(%rip),%rdx
  mov    $0x3,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  movl   $0x0,0xc(%rsp)
  mov    $0x270f,%r13d
  mov    $0x0,%r12d
  lea    D37(%rip),%r14
  jmp    L9
L95:
  lea    D50(%rip),%rdx
  mov    $0x5,%esi
  mov    $0xa,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
L56:
  mov    $0x32,%edi
  call   <msleep@plt>
L9:
  mov    $0x0,%eax
  call   <b_button@plt>
  test   %rax,%rax
  jne    L25
  call   <c_button@plt>
  test   %rax,%rax
  jne    L25
  mov    %r15d,%edi
  call   <analog10@plt>
  mov    %eax,%ebx
  cmp    %eax,%r12d
  cmovl  %eax,%r12d
  cmp    %eax,%r13d
  cmovg  %eax,%r13d
  lea    0x0(%r13,%r12,1),%eax
  mov    %eax,%ebp
  shr    $0x1f,%ebp
  add    %eax,%ebp
  sar    %ebp
  mov    %ebp,0xc(%rsp)
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    $0x0,%esi
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  mov    %r13d,%ecx
  mov    %r14,%rdx
  mov    $0x1,%esi
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  mov    %ebx,%ecx
  mov    %r14,%rdx
  mov    $0x2,%esi
  mov    $0x6,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    $0x3,%esi
  mov    $0x5,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  cmp    %ebp,%ebx
  jle    L95
  lea    D54(%rip),%rdx
  mov    $0x5,%esi
  mov    $0xa,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  jmp    L56
L25:
  mov    $0x0,%eax
  call   <display_clear@plt>
  lea    D60(%rip),%rdx
  mov    $0x4,%esi
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <display_printf@plt>
  jmp    L59
L96:
  mov    $0x32,%edi
  call   <msleep@plt>
L59:
  mov    %r15d,%edi
  call   <analog10@plt>
  cmp    0xc(%rsp),%eax
  jle    L38
  mov    $0x0,%eax
  call   <c_button@plt>
  test   %rax,%rax
  je     L96
L38:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D76
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D21
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D40
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D20
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D37
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D50
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D54
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D60
type_infered: string

tool: D76: Max:

tool: D21: Min:

tool: D40: Curr:

tool: D20: avg:

tool: D37: %d   

tool: D50: OO

tool: D54: XX

tool: D60: Prepared to begin: left to skip

assistant: ```c
void light_start(int sensor) {
  ;
  while (!(!(b_button() || c_button()))) {
    msleep(1);
  };
  int max = 0, min = 9999, curr = 0, avg = 0;
  display_clear();
  display_printf(0, 0, "Max:");
  display_printf(0, 1, "Min:");
  display_printf(0, 2, "Curr:");
  display_printf(0, 3, "avg:");
  while (!b_button() && !c_button()) {
    curr = analog10(sensor);
    if (curr > max) {
      max = curr;
    }
    if (curr < min) {
      min = curr;
    }
    avg = (max + min) / 2;
    display_printf(5, 0, "%d   ", max);
    display_printf(5, 1, "%d   ", min);
    display_printf(6, 2, "%d   ", curr);
    display_printf(5, 3, "%d   ", avg);
    if (curr > avg) {
      display_printf(10, 5, "XX");
    } else {
      display_printf(10, 5, "OO");
    }
    msleep(50);
  }
  display_clear();
  display_printf(0, 4, "Prepared to begin: left to skip");
  while (analog10(sensor) > avg && !(c_button())) {
    msleep(50);
  }
}
```