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

```asm
<main>:
  endbr64
  push   %r13
  lea    D98(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <ece453_reg_read@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L154
  mov    %eax,%esi
  lea    D94(%rip),%rdi
  lea    D56(%rip),%r13
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  call   <ece453_reg_write@plt>
  cmp    $0xffffffff,%eax
  je     L112
  lea    D70(%rip),%rdi
  xor    %eax,%eax
  xor    %ebx,%ebx
  call   <printf@plt>
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  lea    D74(%rip),%rbp
  call   <printf@plt>
  nopl   0x0(%rax,%rax,1)
L96:
  mov    $0x1,%edi
  call   <sleep@plt>
  mov    %rbp,%rdi
  call   <ece453_reg_read@plt>
  cmp    $0xffffffff,%eax
  je     L53
  mov    %eax,%r12d
  and    $0x1000,%r12d
  je     L38
  test   $0x8,%ah
  jne    L105
  cmp    $0x9,%ebx
  je     L9
  add    $0x1,%ebx
  mov    $0x1,%esi
  mov    %ebx,%ecx
  shl    %cl,%esi
L48:
  mov    %r13,%rdi
  call   <ece453_reg_write@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  jne    L96
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L38:
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <ece453_reg_write@plt>
  cmp    $0xffffffff,%eax
  je     L112
L141:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L105:
  test   $0x4,%ah
  jne    L96
  test   %ebx,%ebx
  je     L103
  sub    $0x1,%ebx
  mov    $0x1,%esi
  mov    %ebx,%ecx
  shl    %cl,%esi
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L9:
  xor    %ebx,%ebx
  mov    $0x1,%esi
  jmp    L48
  nopl   0x0(%rax)
L103:
  mov    $0x200,%esi
  mov    $0x9,%ebx
  jmp    L48
L53:
  lea    D25(%rip),%rdi
  xor    %eax,%eax
  or     $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L38
L112:
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  or     $0xffffffff,%r12d
  call   <printf@plt>
  jmp    L141
L154:
  lea    D54(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L141
```

tool_calls: name: retrieve_data
arguments: data_label: D98
data_type: string
name: retrieve_data
arguments: data_label: D94
data_type: string
name: retrieve_data
arguments: data_label: D56
data_type: string
name: retrieve_data
arguments: data_label: D70
data_type: string
name: retrieve_data
arguments: data_label: D75
data_type: string
name: retrieve_data
arguments: data_label: D74
data_type: string
name: retrieve_data
arguments: data_label: D4
data_type: string
name: retrieve_data
arguments: data_label: D25
data_type: string
name: retrieve_data
arguments: data_label: D54
data_type: string

tool: D98: /sys/kernel/ece453/device_id

tool: D94: DEV_ID: 0x%08X


tool: D56: /sys/kernel/ece453/gpio_out

tool: D70: Press KEY[0] to move right or KEY[1] to move left.


tool: D75: Press KEY[2] to exit.


tool: D74: /sys/kernel/ece453/gpio_in

tool: D4: Error Writing GPIO OUT


tool: D25: Error Reading GPIO IN


tool: D54: Error Reading DEV_ID


assistant: ```c
int main(int argc, char *argv[]) {
  int button_vals = 0;
  int curr_led = 0;
  int status = 0;
  bool changed = false;
  status = ece453_reg_read("/sys/kernel/ece453/device_id");
  if (status == -1) {
    printf("Error Reading DEV_ID\n\r");
    return -1;
  }
  printf("DEV_ID: 0x%08X\n\r", status);
  status = ece453_reg_write("/sys/kernel/ece453/gpio_out", 1);
  if (status == -1) {
    printf("Error Writing GPIO OUT\n\r");
    return -1;
  }
  printf("Press KEY[0] to move right or KEY[1] to move left.\n\r");
  printf("Press KEY[2] to exit.\n\r");
  while (true) {
    sleep(1);
    button_vals = ece453_reg_read("/sys/kernel/ece453/gpio_in");
    if (button_vals == -1) {
      printf("Error Reading GPIO IN\n\r");
      status = -1;
      break;
    }
    if ((button_vals & (1 << (10 + 2))) == 0) {
      status = 0;
      break;
    }
    if ((button_vals & (1 << (10 + 1))) == 0) {
      curr_led = (curr_led == 9) ? 0 : curr_led + 1;
      changed = true;
    } else if ((button_vals & (1 << (10 + 0))) == 0) {
      curr_led = (curr_led == 0) ? 9 : curr_led - 1;
      changed = true;
    }
    if (changed) {
      changed = false;
      status = ece453_reg_write("/sys/kernel/ece453/gpio_out", 1 << curr_led);
      if (status == -1) {
        printf("Error Writing GPIO OUT\n\r");
        break;
      }
    }
  }
  if (ece453_reg_write("/sys/kernel/ece453/gpio_out", 0) == -1) {
    printf("Error Writing GPIO OUT\n\r");
    status = -1;
  }
  return status;
}
```