user: What would the C source look like for the assembly code provided here?

```asm
<process_bw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x18(%rbp)
  je     L80
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jne    L21
L80:
  cmpl   $0x0,-0x1c(%rbp)
  je     L101
  lea    D26(%rip),%rax
  jmp    L137
L101:
  lea    D95(%rip),%rax
L137:
  mov    -0x28(%rbp),%rdx
  mov    %rax,%rcx
  lea    D75(%rip),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <camserv_log@plt>
  cmpl   $0x0,-0x1c(%rbp)
  je     L99
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L106
L99:
  mov    -0x30(%rbp),%rax
  movb   $0xff,(%rax)
  mov    $0xffffff,%eax
  jmp    L106
L21:
  mov    -0x18(%rbp),%rax
  lea    D89(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L81
  mov    $0xff000000,%eax
  jmp    L106
L81:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <valid_bw_color@plt>
  test   %eax,%eax
  jne    L60
  cmpl   $0x0,-0x1c(%rbp)
  je     L103
  lea    D26(%rip),%rax
  jmp    L24
L103:
  lea    D95(%rip),%rax
L24:
  mov    -0x28(%rbp),%rdx
  mov    %rax,%rcx
  lea    D68(%rip),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <camserv_log@plt>
  cmpl   $0x0,-0x1c(%rbp)
  je     L41
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L106
L41:
  mov    -0x30(%rbp),%rax
  movb   $0xff,(%rax)
  mov    $0xffffff,%eax
  jmp    L106
L60:
  lea    -0xc(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    D30(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
L106:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L75
  call   <__stack_chk_fail@plt>
L75:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D26
datatype: string
name: unpack_data
arguments: data_label: D95
datatype: string
name: unpack_data
arguments: data_label: D75
datatype: string
name: unpack_data
arguments: data_label: D31
datatype: string
name: unpack_data
arguments: data_label: D89
datatype: string
name: unpack_data
arguments: data_label: D68
datatype: string
name: unpack_data
arguments: data_label: D30
datatype: string

tool: D26: bg

tool: D95: fg

tool: D75: Invalid [%s]:%s value given.  Using default

tool: D31: textfilter

tool: D89: transparent

tool: D68: Invalid [%s]:%s color given.  Format should be: #CC, or 'transparent'

tool: D30: %*c%2x

assistant: ```c
int process_bw(const char *strcolour, int is_bg, char *secname, unsigned char *resval) {
  if (!strcolour || !strlen(strcolour)) {
    camserv_log("textfilter",
                "Invalid [%s]:%s value given.  "
                "Using default",
                secname, is_bg ? "bg" : "fg");
    if (is_bg) {
      *resval = (0x00ff0000 & 0x00000000) >> 16;
      return 0x00000000;
    } else {
      *resval = (0x00ff0000 & 0x00ffffff) >> 16;
      return 0x00ffffff;
    }
  }
  if (!strcmp(strcolour, "transparent"))
    return 0xff000000;
  else {
    int bwval;
    if (!valid_bw_color(strcolour)) {
      camserv_log("textfilter",
                  "Invalid [%s]:%s color given.  "
                  "Format should be: #CC, or 'transparent'",
                  secname, is_bg ? "bg" : "fg");
      if (is_bg) {
        *resval = (0x00ff0000 & 0x00000000) >> 16;
        return 0x00000000;
      } else {
        *resval = (0x00ff0000 & 0x00ffffff) >> 16;
        return 0x00ffffff;
      }
    }
    sscanf(strcolour, "%*c%2x", &bwval);
    *resval = bwval;
    return (*resval << 16);
  }
}
```