user: Translate the below assembly code into C programming language:

```asm
<process_bw>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L87
  mov    %rdi,%rbp
  call   <strlen@plt>
  test   %eax,%eax
  je     L87
  lea    D50(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L1
  mov    %rbp,%rdi
  call   <valid_bw_color@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jne    L56
  test   %r12d,%r12d
  je     L112
  lea    D47(%rip),%rcx
  mov    %r14,%rdx
  lea    D131(%rip),%rsi
  lea    D81(%rip),%rdi
  call   <camserv_log@plt>
  xor    %eax,%eax
  mov    %al,(%rbx)
  jmp    L50
L87:
  test   %r12d,%r12d
  je     L13
  lea    D47(%rip),%rcx
  mov    %r14,%rdx
  xor    %r13d,%r13d
  lea    D38(%rip),%rsi
  lea    D81(%rip),%rdi
  call   <camserv_log@plt>
  movb   $0x0,(%rbx)
L50:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L110
  add    $0x10,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L13:
  lea    D26(%rip),%rcx
  mov    %r14,%rdx
  lea    D38(%rip),%rsi
  mov    $0xffffff,%r13d
  lea    D81(%rip),%rdi
  call   <camserv_log@plt>
  movb   $0xff,(%rbx)
  jmp    L50
  nopl   0x0(%rax,%rax,1)
L112:
  lea    D26(%rip),%rcx
  mov    %r14,%rdx
  lea    D131(%rip),%rsi
  mov    $0xffffff,%r13d
  lea    D81(%rip),%rdi
  call   <camserv_log@plt>
  mov    $0xffffffff,%eax
  mov    %al,(%rbx)
  jmp    L50
  nop
L56:
  lea    0x4(%rsp),%rdx
  lea    D100(%rip),%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  mov    0x4(%rsp),%r13d
  mov    %r13d,%eax
  shl    $0x10,%r13d
  mov    %al,(%rbx)
  and    $0xff0000,%r13d
  jmp    L50
L1:
  mov    $0xff000000,%r13d
  jmp    L50
L110:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D50
type: string
name: disassemble_data
arguments: data_label: D47
type: string
name: disassemble_data
arguments: data_label: D131
type: string
name: disassemble_data
arguments: data_label: D81
type: string
name: disassemble_data
arguments: data_label: D38
type: string
name: disassemble_data
arguments: data_label: D26
type: string
name: disassemble_data
arguments: data_label: D100
type: string

tool: D50: transparent

tool: D47: bg

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

tool: D81: textfilter

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

tool: D26: fg

tool: D100: %*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);
  }
}
```