user: Demonstrate the C code that generates the assembly output below:

```asm
<encode_devnode_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L60
  cmpq   $0x0,-0x30(%rbp)
  jne    L5
L60:
  mov    $0xffffffff,%eax
  jmp    L27
L5:
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L32
L73:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <utf8_encoded_valid_unichar@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x1,-0x14(%rbp)
  jle    L9
  mov    -0x38(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  jb     L70
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x30(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cltq
  add    %rax,-0x10(%rbp)
  jmp    L103
L9:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L1
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <whitelisted_char_for_devnode@plt>
  test   %eax,%eax
  jne    L10
L1:
  mov    -0x38(%rbp),%rax
  sub    -0x8(%rbp),%rax
  cmp    $0x3,%rax
  jbe    L68
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x30(%rbp),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rdx,%rcx
  mov    %eax,%edx
  lea    D3(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <sprintf@plt>
  addq   $0x4,-0x8(%rbp)
  jmp    L103
L10:
  mov    -0x38(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  je     L11
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addq   $0x1,-0x8(%rbp)
L103:
  addq   $0x1,-0x10(%rbp)
L32:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L73
  mov    -0x38(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  je     L61
  mov    -0x30(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L27
L70:
  nop
  jmp    L138
L68:
  nop
  jmp    L138
L11:
  nop
  jmp    L138
L61:
  nop
L138:
  mov    $0xffffffff,%eax
L27:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
type_guessed: string

tool: D3: \x%02x

assistant: ```c
int encode_devnode_name(const char *const str, char *const str_enc, const size_t len) {
  size_t i, j;
  if (str == NULL || str_enc == NULL)
    return -1;
  for (i = 0, j = 0; str[i] != '\0'; i++) {
    int seqlen;
    seqlen = utf8_encoded_valid_unichar(&str[i]);
    if (seqlen > 1) {
      if (len - j < (size_t)seqlen)
        goto err;
      memcpy(&str_enc[j], &str[i], seqlen);
      j += seqlen;
      i += (seqlen - 1);
    } else if (str[i] == '\\' || !whitelisted_char_for_devnode(str[i], NULL)) {
      if (len - j < 4)
        goto err;
      sprintf(&str_enc[j], "\\x%02x", (unsigned char)str[i]);
      j += 4;
    } else {
      if (len - j < 1)
        goto err;
      str_enc[j] = str[i];
      j++;
    }
  }
  if (len - j < 1)
    goto err;
  str_enc[j] = '\0';
  return 0;
err:
  return -1;
}
```