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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x828,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <getuid@plt>
  test   %rax,%rax
  jne    L56
  lea    D40(%rip),%r13
  lea    D88(%rip),%rdi
  mov    %r13,%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L50
  lea    0x10(%rsp),%r14
  lea    0x410(%rsp),%r15
  mov    %rax,%rdi
  xor    %eax,%eax
  mov    %r15,%rcx
  mov    %r14,%rdx
  lea    D6(%rip),%rsi
  call   <fscanf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D47(%rip),%rsi
  mov    %r14,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L158
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L71
  lea    D59(%rip),%r14
  lea    0x4(%rsp),%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r14,%rsi
  call   <fscanf@plt>
  mov    %r13,%rdi
  lea    0x8(%rsp),%rdx
  mov    %r14,%rsi
  xor    %eax,%eax
  call   <fscanf@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl 0x4(%rsp),%xmm0
  cvtsi2ssl 0x8(%rsp),%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  D63(%rip),%xmm0
  addsd  D62(%rip),%xmm0
  cvttsd2si %xmm0,%r13d
  cmp    $0x1,%ebx
  jle    L92
  cmp    $0x2,%ebx
  je     L38
L111:
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm1
  mov    $0x32,%eax
  mov    %rbp,%rdi
  cvtsi2ss %r13d,%xmm0
  lea    D124(%rip),%rsi
  cvtss2sd %xmm0,%xmm0
  divsd  D63(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edx
  cmp    %eax,%edx
  cmovl  %eax,%edx
  call   <fprintf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  xor    %eax,%eax
L73:
  mov    0x818(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L118
  add    $0x828,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L56:
  lea    D98(%rip),%rdi
  call   <puts@plt>
  mov    $0x5,%eax
  jmp    L73
L71:
  mov    $0x4,%eax
  jmp    L73
L50:
  mov    $0x2,%eax
  jmp    L73
L158:
  mov    $0x3,%eax
  jmp    L73
L38:
  mov    0x8(%r12),%rdi
  lea    D112(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L17
  mov    0x8(%r12),%rdi
  lea    0xc(%rsp),%rdx
  mov    %r14,%rsi
  call   <sscanf@plt>
  test   %rax,%rax
  je     L98
  mov    0x8(%r12),%rax
  movzbl (%rax),%edx
  mov    0xc(%rsp),%eax
  cmp    $0x2b,%dl
  je     L180
  cmp    $0x2d,%dl
  je     L125
  mov    $0x64,%edx
  mov    $0x1,%r13d
  pxor   %xmm1,%xmm1
  cmp    %edx,%eax
  cvtsi2ssl 0x8(%rsp),%xmm1
  cmovg  %edx,%eax
  test   %eax,%eax
  cmovg  %eax,%r13d
  jmp    L111
L92:
  mov    %r13d,%esi
  lea    D124(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L73
L180:
  add    %r13d,%eax
  mov    $0x64,%r13d
  pxor   %xmm1,%xmm1
  cmp    %r13d,%eax
  cvtsi2ssl 0x8(%rsp),%xmm1
  cmovle %eax,%r13d
  jmp    L111
L17:
  mov    (%r12),%rsi
  lea    D68(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L73
L98:
  lea    D20(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L73
L125:
  add    %r13d,%eax
  pxor   %xmm1,%xmm1
  mov    $0x1,%r13d
  test   %eax,%eax
  cvtsi2ssl 0x8(%rsp),%xmm1
  cmovg  %eax,%r13d
  jmp    L111
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D40
datatype: string
name: read_data
arguments: data_label: D88
datatype: string
name: read_data
arguments: data_label: D6
datatype: string
name: read_data
arguments: data_label: D47
datatype: string
name: read_data
arguments: data_label: D59
datatype: string
name: read_data
arguments: data_label: D63
datatype: f64
name: read_data
arguments: data_label: D62
datatype: byte[8]
name: read_data
arguments: data_label: D124
datatype: string
name: read_data
arguments: data_label: D98
datatype: string
name: read_data
arguments: data_label: D112
datatype: string
name: read_data
arguments: data_label: D68
datatype: string
name: read_data
arguments: data_label: D20
datatype: string

tool: D40: r

tool: D88: /etc/backlightctl.conf

tool: D6: %s
%s

tool: D47: r+

tool: D59: %d

tool: D63: 100

tool: {"D62": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D124: %d


tool: D98: You need to be a superuser to use this program.

tool: D112: -h

tool: D68: Usage: %s [[{+,-}]PERCENTAGE]
	 when no parameters are given, the current percentage is printed out.


tool: D20: invalid parameter

assistant: ```c
int main(int argc, char **argv) {
  if (getuid() != 0) {
    printf("You need to be a superuser to use this program.\n");
    return 5;
  }
  static const char *CONFIG_PATH = "/etc/backlightctl.conf";
  FILE *config, *brightness, *max_brightness;
  char brightness_path[1024];
  char max_brightness_path[1024];
  int cur_br, max_br, delta_perc, set_perc, set_br;
  config = fopen(CONFIG_PATH, "r");
  if (config == NULL) {
    return 2;
  }
  fscanf(config, "%s\n%s", brightness_path, max_brightness_path);
  fclose(config);
  brightness = fopen(brightness_path, "r+");
  if (brightness == NULL) {
    return 3;
  }
  max_brightness = fopen(max_brightness_path, "r");
  if (max_brightness == NULL) {
    return 4;
  }
  fscanf(brightness, "%d", &cur_br);
  fscanf(max_brightness, "%d", &max_br);
  fclose(max_brightness);
  set_perc = (int)(((float)cur_br / (float)max_br) * 100.0 + 0.5f);
  if (argc < 2) {
    printf("%d\n", set_perc);
    return 0;
  } else if (argc == 2) {
    if (strcmp(argv[1], "-h") == 0) {
      printf("Usage: %s [[{+,-}]PERCENTAGE]\n\t when no parameters are given, the current percentage is printed out.\n", argv[0]);
      return 0;
    } else if (sscanf(argv[1], "%d", &delta_perc) != 0) {
      if (argv[1][0] == '+') {
        set_perc += delta_perc;
        set_perc = (set_perc > 100) ? 100 : set_perc;
      } else if (argv[1][0] == '-') {
        set_perc += delta_perc;
        set_perc = (set_perc < 1) ? 1 : set_perc;
      } else {
        set_perc = delta_perc;
        set_perc = (set_perc > 100) ? 100 : set_perc;
        set_perc = (set_perc < 1) ? 1 : set_perc;
      }
    } else {
      printf("invalid parameter\n");
      return 1;
    }
  }
  set_br = (int)((((float)set_perc) / 100.0) * ((float)max_br));
  set_br = (set_br < 50) ? 50 : set_br;
  fprintf(brightness, "%d\n", set_br);
  fclose(brightness);
  return 0;
}
```