user: 请从给定的汇编指令推导出C源代码:

```asm
<optionValueGet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rax
  mov    (%rax),%ebx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,%ebx
  jl     L140
  mov    $0xffffffff,%eax
  jmp    L247
L140:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0xffffffff,-0x24(%rbp)
  jmp    L181
L57:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jne    L241
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x78,%al
  jne    L241
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L241
  cmpl   $0x0,-0x44(%rbp)
  je     L167
  mov    $0xffffffff,%eax
  jmp    L247
L167:
  movl   $0x1,-0x1c(%rbp)
  jmp    L20
L241:
  cmpl   $0x0,-0x1c(%rbp)
  je     L210
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L210
  mov    $0xffffffff,%eax
  jmp    L247
L210:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L20
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x20(%rbp)
  jle    L20
  mov    $0xffffffff,%eax
  jmp    L247
L20:
  addl   $0x1,-0x20(%rbp)
L181:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L184
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L57
L184:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  sub    %edx,%eax
  test   %eax,%eax
  je     L33
  cmp    $0x1,%eax
  jne    L44
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L37
L33:
  mov    $0xffffffff,%eax
  jmp    L247
L44:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x24(%rbp),%rax
  mov    %rax,%rdx
  lea    D1(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L273
  mov    $0xffffffff,%eax
  jmp    L247
L273:
  mov    -0x24(%rbp),%eax
  cmp    $0x7f,%eax
  jbe    L237
  mov    $0xffffffff,%eax
  jmp    L247
L237:
  nop
L37:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L213
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L221
L213:
  mov    -0x40(%rbp),%rax
  movl   $0x0,(%rax)
L221:
  mov    -0x24(%rbp),%eax
L247:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L117
  call   <__stack_chk_fail@plt>
L117:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D1
datatype: string

tool: D1: %x

assistant: ```c
char optionValueGet(char *option, int *index, int cOnly) {
  if (*index >= strlen(option))
    return -1;
  int i = *index;
  int hex = 0;
  unsigned int value = (unsigned int)-1;
  for (; option[i] && option[i] != ','; i++) {
    if (i == *index && tolower(option[i]) == 'x' && isxdigit(option[i + 1])) {
      if (cOnly)
        return -1;
      hex = 1;
      continue;
    }
    if (hex && !isxdigit(option[i]))
      return -1;
    if (!hex && i > *index)
      return -1;
  }
  switch ((i - *index)) {
  case 1:
    value = option[*index];
    break;
  case 0:
    return -1;
  default:
    if (sscanf(&option[*index + 1], "%x", &value) != 1)
      return -1;
    if (value > 0x7f)
      return -1;
    break;
  }
  if (option[i])
    *index = i + 1;
  else
    *index = 0;
  return (char)value;
}
```