user: What is the c source code of the assembly code below?

```asm
<light_start>:
  endbr64
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  jmp    L18
  nopw   0x0(%rax,%rax,1)
L107:
  mov    $0x1,%edi
  call   <msleep@plt>
L18:
  xor    %eax,%eax
  call   <b_button@plt>
  test   %rax,%rax
  jne    L107
  call   <c_button@plt>
  test   %rax,%rax
  jne    L107
  call   <display_clear@plt>
  lea    D72(%rip),%rdx
  xor    %esi,%esi
  xor    %edi,%edi
  xor    %eax,%eax
  xor    %ebx,%ebx
  mov    $0x270f,%r12d
  xor    %ebp,%ebp
  call   <display_printf@plt>
  lea    D77(%rip),%rdx
  xor    %edi,%edi
  xor    %eax,%eax
  mov    $0x1,%esi
  lea    D60(%rip),%r13
  call   <display_printf@plt>
  lea    D57(%rip),%rdx
  xor    %edi,%edi
  xor    %eax,%eax
  mov    $0x2,%esi
  call   <display_printf@plt>
  lea    D7(%rip),%rdx
  xor    %edi,%edi
  xor    %eax,%eax
  mov    $0x3,%esi
  call   <display_printf@plt>
  jmp    L61
  nopl   0x0(%rax)
L55:
  lea    D1(%rip),%rdx
  mov    $0x5,%esi
  mov    $0xa,%edi
  xor    %eax,%eax
  call   <display_printf@plt>
L106:
  mov    $0x32,%edi
  call   <msleep@plt>
L61:
  xor    %eax,%eax
  call   <b_button@plt>
  test   %rax,%rax
  jne    L5
  xor    %eax,%eax
  call   <c_button@plt>
  test   %rax,%rax
  jne    L5
  mov    %r14d,%edi
  call   <analog10@plt>
  mov    %r13,%rdx
  mov    $0x5,%edi
  cmp    %eax,%ebp
  mov    %eax,%r15d
  cmovl  %eax,%ebp
  cmp    %eax,%r12d
  cmovg  %eax,%r12d
  xor    %esi,%esi
  mov    %ebp,%ecx
  lea    (%r12,%rbp,1),%eax
  mov    %eax,%ebx
  shr    $0x1f,%ebx
  add    %eax,%ebx
  xor    %eax,%eax
  call   <display_printf@plt>
  mov    %r12d,%ecx
  mov    %r13,%rdx
  mov    $0x1,%esi
  mov    $0x5,%edi
  xor    %eax,%eax
  sar    %ebx
  call   <display_printf@plt>
  mov    %r15d,%ecx
  mov    %r13,%rdx
  mov    $0x2,%esi
  mov    $0x6,%edi
  xor    %eax,%eax
  call   <display_printf@plt>
  xor    %eax,%eax
  mov    %ebx,%ecx
  mov    %r13,%rdx
  mov    $0x3,%esi
  mov    $0x5,%edi
  call   <display_printf@plt>
  cmp    %ebx,%r15d
  jg     L55
  lea    D58(%rip),%rdx
  mov    $0x5,%esi
  mov    $0xa,%edi
  xor    %eax,%eax
  call   <display_printf@plt>
  jmp    L106
  nopl   0x0(%rax,%rax,1)
L5:
  xor    %eax,%eax
  call   <display_clear@plt>
  lea    D38(%rip),%rdx
  xor    %edi,%edi
  xor    %eax,%eax
  mov    $0x4,%esi
  call   <display_printf@plt>
  jmp    L67
  cs nopw 0x0(%rax,%rax,1)
L60:
  xor    %eax,%eax
  call   <c_button@plt>
  test   %rax,%rax
  jne    L101
  mov    $0x32,%edi
  call   <msleep@plt>
L67:
  mov    %r14d,%edi
  call   <analog10@plt>
  cmp    %ebx,%eax
  jg     L60
L101:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: label: D72
datatype: string
name: disassemble_data
arguments: label: D77
datatype: string
name: disassemble_data
arguments: label: D60
datatype: string
name: disassemble_data
arguments: label: D57
datatype: string
name: disassemble_data
arguments: label: D7
datatype: string
name: disassemble_data
arguments: label: D1
datatype: string
name: disassemble_data
arguments: label: D58
datatype: string
name: disassemble_data
arguments: label: D38
datatype: string

tool: D72: Max:

tool: D77: Min:

tool: D60: %d   

tool: D57: Curr:

tool: D7: avg:

tool: D1: XX

tool: D58: OO

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