user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  lea    D23(%rip),%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  lea    D17(%rip),%rdi
  call   <in@plt>
  mov    %r13,%rdi
  mov    %eax,%r12d
  call   <in@plt>
  cmp    $0x1,%ebx
  jg     L68
L25:
  mov    %r13,%rdi
  call   <in@plt>
  mov    %r12d,%edx
  lea    D30(%rip),%rdi
  mov    %eax,%esi
  call   <printf@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L68:
  mov    0x8(%r14),%rdi
  lea    D38(%rip),%rsi
  mov    %eax,%ebp
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L110
  mov    $0x1,%eax
  cmp    $0x2,%ebx
  jne    L22
L107:
  lea    (%rax,%rbp,1),%r14d
  cmp    %r12d,%r14d
  cmovg  %r12d,%r14d
L48:
  lea    D19(%rip),%rbx
  cmp    %r14d,%ebp
  je     L25
  nopl   0x0(%rax)
L104:
  mov    %r14d,%edx
  mov    %r13,%rdi
  sub    %ebp,%edx
  movslq %edx,%rax
  sar    $0x1f,%edx
  imul   $0x10624dd3,%rax,%rax
  sar    $0x25,%rax
  sub    %edx,%eax
  add    %ebp,%eax
  lea    0x1(%rax),%edx
  cmp    %r14d,%eax
  lea    -0x1(%rax),%ebp
  cmovl  %edx,%ebp
  mov    %ebp,%esi
  call   <out@plt>
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <printf@plt>
  cmp    %r14d,%ebp
  jne    L104
  jmp    L25
L110:
  mov    0x8(%r14),%rdi
  lea    D1(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L7
  mov    $0x1,%eax
  cmp    $0x2,%ebx
  je     L47
  mov    0x10(%r14),%rdi
  call   <atoi@plt>
L47:
  mov    %ebp,%r14d
  sub    %eax,%r14d
  mov    $0x0,%eax
  cmovs  %eax,%r14d
  jmp    L48
L7:
  mov    0x8(%r14),%rdi
  call   <all_digits@plt>
  test   %rax,%rax
  je     L25
  mov    0x8(%r14),%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  cmp    %eax,%r12d
  jge    L48
  jmp    L25
L22:
  mov    0x10(%r14),%rdi
  call   <atoi@plt>
  jmp    L107
```

tool_calls: name: parse_data
arguments: data_tag: D23
type: string
name: parse_data
arguments: data_tag: D17
type: string
name: parse_data
arguments: data_tag: D30
type: string
name: parse_data
arguments: data_tag: D38
type: string
name: parse_data
arguments: data_tag: D19
type: string
name: parse_data
arguments: data_tag: D1
type: string

tool: D23: /sys/class/backlight/intel_backlight/brightness

tool: D17: /sys/class/backlight/intel_backlight/max_brightness

tool: D30: brightness = %d/%d


tool: D38: up

tool: D19: brightness = %d/%d

tool: D1: down

assistant: ```c
int main(int argc, char *argv[]) {
  int max = in("/sys/class/backlight/intel_backlight/max_brightness");
  int curr = in("/sys/class/backlight/intel_backlight/brightness");
  int next = curr;
  if (argc >= 2 && strcmp(argv[1], "up") == 0) {
    int delta = 1;
    if (argc >= 3)
      delta = atoi(argv[2]);
    if (curr + delta <= max)
      next = curr + delta;
    else
      next = max;
  } else if (argc >= 2 && strcmp(argv[1], "down") == 0) {
    int delta = 1;
    if (argc >= 3)
      delta = atoi(argv[2]);
    if (curr - delta >= 0)
      next = curr - delta;
    else
      next = 0;
  } else if (argc >= 2 && all_digits(argv[1])) {
    int req = atoi(argv[1]);
    if (req <= max)
      next = req;
  }
  while (next != curr) {
    curr += (next - curr) / 500;
    if (curr < next)
      ++curr;
    else
      --curr;
    out("/sys/class/backlight/intel_backlight/brightness", curr);
    printf("brightness = %d/%d\r", curr, max);
  }
  printf("brightness = %d/%d\n", in("/sys/class/backlight/intel_backlight/brightness"), max);
  return 0;
}
```