user: Please show me the C implementation that matches the assembly code listed below:

```asm
<i_Xs_conv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <jelio_buffer_peekc@plt>
  mov    %eax,-0x20(%rbp)
  jmp    L166
L186:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <jelio_buffer_getc@plt>
  addl   $0x1,-0x1c(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <jelio_buffer_peekc@plt>
  mov    %eax,-0x20(%rbp)
L166:
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <char_isspace@plt>
  test   %rax,%rax
  jne    L186
  cmpl   $0x0,-0x2c(%rbp)
  jg     L172
  mov    $0x0,%eax
  jmp    L246
L172:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jge    L231
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <jelio_buffer_peekc@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0xffffffff,-0x20(%rbp)
  je     L171
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <char_isspace@plt>
  test   %rax,%rax
  jne    L171
  cmpl   $0x2f,-0x20(%rbp)
  jbe    L23
  cmpl   $0x39,-0x20(%rbp)
  jbe    L77
L23:
  cmpl   $0x60,-0x20(%rbp)
  jbe    L11
  cmpl   $0x66,-0x20(%rbp)
  jbe    L77
L11:
  cmpl   $0x40,-0x20(%rbp)
  jbe    L171
  cmpl   $0x46,-0x20(%rbp)
  ja     L171
L77:
  addl   $0x1,-0x1c(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L272
  cmpl   $0x2f,-0x20(%rbp)
  jbe    L42
  cmpl   $0x39,-0x20(%rbp)
  ja     L42
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%ecx
  add    %ecx,%edx
  sub    $0x30,%edx
  mov    %dl,(%rax)
  jmp    L200
L42:
  cmpl   $0x60,-0x20(%rbp)
  jbe    L232
  cmpl   $0x66,-0x20(%rbp)
  ja     L232
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%ecx
  add    %ecx,%edx
  sub    $0x57,%edx
  mov    %dl,(%rax)
  jmp    L200
L232:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%ecx
  add    %ecx,%edx
  sub    $0x37,%edx
  mov    %dl,(%rax)
L200:
  addl   $0x1,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L25
L272:
  cmpl   $0x2f,-0x20(%rbp)
  jbe    L225
  cmpl   $0x39,-0x20(%rbp)
  ja     L225
  mov    -0x20(%rbp),%eax
  sub    $0x30,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L185
L225:
  cmpl   $0x60,-0x20(%rbp)
  jbe    L69
  cmpl   $0x66,-0x20(%rbp)
  ja     L69
  mov    -0x20(%rbp),%eax
  sub    $0x57,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L185
L69:
  mov    -0x20(%rbp),%eax
  sub    $0x37,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
L185:
  movl   $0x1,-0x14(%rbp)
L25:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <jelio_buffer_getc@plt>
  jmp    L172
L231:
  nop
L171:
  mov    -0x1c(%rbp),%eax
L246:
  leave
  ret
```

assistant: ```c
int i_Xs_conv(void *value, int n, void *inbuf) {
  struct jelio_buf *jb = inbuf;
  unsigned char *sval = value;
  unsigned int c;
  int count = 0;
  int scount = 0;
  int flag = 0;
  for (c = jelio_buffer_peekc(jb); char_isspace(c); c = jelio_buffer_peekc(jb)) {
    jelio_buffer_getc(jb);
    count++;
  }
  if (n < 1)
    return 0;
  while (1) {
    if (scount >= n)
      break;
    c = jelio_buffer_peekc(jb);
    if (c == -1 || char_isspace(c))
      break;
    if ((c < '0' || c > '9') && (c < 'a' || c > 'f') && (c < 'A' || c > 'F'))
      break;
    count++;
    if (flag) {
      if (c >= '0' && c <= '9')
        *sval++ += (c - '0');
      else {
        if (c >= 'a' && c <= 'f')
          *sval++ += (c - 'a' + 10);
        else
          *sval++ += (c - 'A' + 10);
      }
      scount++;
      flag = 0;
    } else {
      if (c >= '0' && c <= '9')
        *sval = (c - '0') << 4;
      else {
        if (c >= 'a' && c <= 'f')
          *sval = (c - 'a' + 10) << 4;
        else
          *sval = (c - 'A' + 10) << 4;
      }
      flag = 1;
    }
    jelio_buffer_getc(jb);
  }
  return count;
}
```