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

```asm
<from_hex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L27
L191:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  cmpb   $0x2f,-0xd(%rbp)
  jle    L193
  cmpb   $0x39,-0xd(%rbp)
  jle    L123
L193:
  cmpb   $0x60,-0xd(%rbp)
  jle    L196
  cmpb   $0x66,-0xd(%rbp)
  jle    L123
L196:
  cmpb   $0x40,-0xd(%rbp)
  jle    L118
  cmpb   $0x46,-0xd(%rbp)
  jg     L118
L123:
  addl   $0x1,-0xc(%rbp)
L118:
  addl   $0x1,-0x8(%rbp)
L27:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L191
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L170
L172:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xe(%rbp)
  cmpb   $0x2f,-0xe(%rbp)
  jle    L61
  cmpb   $0x39,-0xe(%rbp)
  jg     L61
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edi
  movsbl -0xe(%rbp),%edx
  lea    -0x30(%rdx),%esi
  mov    -0x4(%rbp),%edx
  and    $0x1,%edx
  test   %edx,%edx
  jne    L24
  mov    $0x4,%edx
  jmp    L62
L24:
  mov    $0x0,%edx
L62:
  mov    %edx,%ecx
  shl    %cl,%esi
  mov    %esi,%edx
  mov    %edx,%ecx
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  or     %ecx,%edi
  mov    %edi,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x4(%rbp)
  jmp    L33
L61:
  cmpb   $0x60,-0xe(%rbp)
  jle    L107
  cmpb   $0x66,-0xe(%rbp)
  jle    L136
L107:
  cmpb   $0x40,-0xe(%rbp)
  jle    L33
  cmpb   $0x46,-0xe(%rbp)
  jg     L33
L136:
  orb    $0x20,-0xe(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edi
  movsbl -0xe(%rbp),%edx
  lea    -0x57(%rdx),%esi
  mov    -0x4(%rbp),%edx
  and    $0x1,%edx
  test   %edx,%edx
  jne    L0
  mov    $0x4,%edx
  jmp    L154
L0:
  mov    $0x0,%edx
L154:
  mov    %edx,%ecx
  shl    %cl,%esi
  mov    %esi,%edx
  mov    %edx,%ecx
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  or     %ecx,%edi
  mov    %edi,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x4(%rbp)
L33:
  addl   $0x1,-0x8(%rbp)
L170:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L172
  nop
  nop
  leave
  ret
```

assistant: ```c
void from_hex(const char *const hex, uint8_t *const buf) {
  int len = 0;
  int i = 0;
  while (hex[i]) {
    char c = hex[i];
    if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) {
      len++;
    }
    i++;
  }
  memset(buf, 0, (len + 1) / 2 * sizeof(unsigned char));
  i = 0;
  int bufi = 0;
  while (hex[i]) {
    char c = hex[i];
    if (c >= '0' && c <= '9') {
      buf[bufi / 2] |= (c - '0') << (bufi % 2 == 0 ? 4 : 0);
      bufi++;
    } else if ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) {
      c |= 0x20;
      buf[bufi / 2] |= (c - 'a' + 10) << (bufi % 2 == 0 ? 4 : 0);
      bufi++;
    }
    i++;
  }
}
```