user: What would the C source look like for the assembly code provided here?

```asm
<readhex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x260,%rsp
  mov    %rdi,-0x248(%rbp)
  mov    %rsi,-0x250(%rbp)
  mov    %rdx,-0x258(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x220(%rbp),%rax
  mov    %rax,-0x228(%rbp)
  mov    -0x248(%rbp),%rdx
  lea    -0x220(%rbp),%rax
  mov    $0x20c,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L179
  mov    $0xffffffff,%eax
  jmp    L60
L179:
  mov    -0x228(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x228(%rbp)
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L161
  mov    $0xfffffffe,%eax
  jmp    L60
L161:
  lea    -0x234(%rbp),%rcx
  mov    -0x228(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanhex@plt>
  test   %rax,%rax
  je     L168
  mov    $0xfffffffe,%eax
  jmp    L60
L168:
  addq   $0x2,-0x228(%rbp)
  lea    -0x230(%rbp),%rcx
  mov    -0x228(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanhex@plt>
  test   %rax,%rax
  je     L215
  mov    $0xfffffffe,%eax
  jmp    L60
L215:
  mov    -0x250(%rbp),%rax
  mov    (%rax),%rax
  and    $0xf0000,%eax
  mov    %rax,%rdx
  mov    -0x250(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x250(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x230(%rbp),%edx
  mov    %edx,%edx
  add    %rax,%rdx
  mov    -0x250(%rbp),%rax
  mov    %rdx,(%rax)
  addq   $0x4,-0x228(%rbp)
  lea    -0x238(%rbp),%rcx
  mov    -0x228(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanhex@plt>
  test   %rax,%rax
  je     L116
  mov    $0xfffffffe,%eax
  jmp    L60
L116:
  mov    -0x238(%rbp),%eax
  cmp    $0x2,%eax
  jne    L84
  addq   $0x2,-0x228(%rbp)
  lea    -0x230(%rbp),%rcx
  mov    -0x228(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanhex@plt>
  test   %rax,%rax
  je     L36
  mov    $0xfffffffe,%eax
  jmp    L60
L36:
  mov    -0x230(%rbp),%eax
  mov    %eax,%eax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x250(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L60
L84:
  mov    -0x238(%rbp),%eax
  cmp    $0x1,%eax
  jne    L200
  mov    $0x0,%eax
  jmp    L60
L200:
  mov    -0x238(%rbp),%eax
  test   %eax,%eax
  je     L160
  mov    $0xfffffffe,%eax
  jmp    L60
L160:
  mov    -0x234(%rbp),%eax
  mov    %eax,-0x22c(%rbp)
  jmp    L37
L180:
  addq   $0x2,-0x228(%rbp)
  lea    -0x238(%rbp),%rcx
  mov    -0x228(%rbp),%rax
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanhex@plt>
  test   %rax,%rax
  je     L19
  mov    $0xfffffffe,%eax
  jmp    L60
L19:
  mov    -0x238(%rbp),%ecx
  mov    -0x258(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x258(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L37:
  mov    -0x22c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x22c(%rbp)
  test   %eax,%eax
  jne    L180
  mov    -0x234(%rbp),%eax
L60:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

assistant: ```c
int readhex(FILE *fp, unsigned long *addr, unsigned char *data) {
  char hexline[524];
  char *hp = hexline;
  unsigned int byte;
  int i;
  unsigned int num;
  unsigned int low_addr;
  if (fgets(hexline, 524, fp) == NULL) {
    return -1;
  }
  if (*hp++ != ':') {
    return -2;
  }
  if (sscanhex(hp, &num, 2)) {
    return -2;
  }
  hp += 2;
  if (sscanhex(hp, &low_addr, 4)) {
    return -2;
  }
  *addr &= 0xF0000L;
  *addr += low_addr;
  hp += 4;
  if (sscanhex(hp, &byte, 2)) {
    return -2;
  }
  if (byte == 2) {
    hp += 2;
    if (sscanhex(hp, &low_addr, 4)) {
      return -2;
    }
    *addr = low_addr * 16L;
    return 0;
  }
  if (byte == 1) {
    return 0;
  }
  if (byte != 0) {
    return -2;
  }
  for (i = num; i--;) {
    hp += 2;
    if (sscanhex(hp, &byte, 2)) {
      return -2;
    }
    *data++ = byte;
  }
  return num;
}
```