user: 请将以下的汇编代码转换成C语言代码:

```asm
<parse_coarse>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbx
  mov    %rdx,%r14
  mov    %rcx,0x8(%rsp)
  mov    %r8,%r15
  mov    %r9,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rax,0x18(%rsp)
  mov    $0x3a,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L203
  cmpb   $0x2d,0x0(%r13)
  je     L188
  mov    D17(%rip),%rbp
  movq   $0x0,0x0(%rbp)
  lea    0x20(%rsp),%rsi
  mov    $0xa,%edx
  mov    %r13,%rdi
  call   <strtoul@plt>
  cmpq   $0x0,0x0(%rbp)
  jne    L9
  cmp    %r12,0x20(%rsp)
  jne    L11
  mov    D1(%rip),%rdx
  cmp    %rax,(%rdx)
  jb     L0
  lea    0x1(%r12),%rdx
L81:
  mov    %eax,(%rbx)
  mov    %rdx,(%r14)
  mov    $0x2d,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L83
  lea    0x1(%rax),%rbx
  mov    %rbx,(%r15)
  mov    %rbx,%rdx
  sub    %r13,%rdx
  mov    0x18(%rsp),%rax
  sub    %rdx,%rax
  mov    0x10(%rsp),%rcx
  mov    %rax,(%rcx)
  mov    %rbp,%rax
  sub    (%r14),%rax
  mov    0x8(%rsp),%rcx
  mov    %rax,(%rcx)
  movzbl 0x1(%rbp),%edi
  test   %dil,%dil
  je     L151
L143:
  movsbl %dil,%edi
  call   <is_revchar@plt>
  test   %eax,%eax
  je     L76
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  jne    L143
L151:
  mov    (%r14),%rbx
  movzbl (%rbx),%edi
  cmp    %rbx,%rbp
  je     L154
  test   %dil,%dil
  je     L154
L229:
  test   %rbp,%rbp
  setne  %dl
  movzbl %dl,%edx
  test   %r12,%r12
  setne  %sil
  movzbl %sil,%esi
  movsbl %dil,%edi
  call   <is_uschar@plt>
  test   %eax,%eax
  je     L191
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  cmp    %rbx,%rbp
  je     L48
  test   %dil,%dil
  jne    L229
L48:
  mov    $0x0,%eax
L204:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L156
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L203:
  mov    %r13,%rdx
  mov    $0x0,%eax
  jmp    L81
L83:
  add    0x18(%rsp),%r13
  mov    %r13,(%r15)
  mov    0x10(%rsp),%rax
  movq   $0x0,(%rax)
  mov    (%r15),%rax
  sub    (%r14),%rax
  mov    0x8(%rsp),%rcx
  mov    %rax,(%rcx)
  jmp    L151
L188:
  mov    $0xffffffff,%eax
  jmp    L204
L9:
  mov    $0xffffffff,%eax
  jmp    L204
L11:
  mov    $0xffffffff,%eax
  jmp    L204
L0:
  mov    $0xffffffff,%eax
  jmp    L204
L76:
  mov    $0xffffffff,%eax
  jmp    L204
L154:
  mov    $0x0,%eax
  jmp    L204
L191:
  mov    $0xffffffff,%eax
  jmp    L204
L156:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int parse_coarse(const char *v, unsigned *epoch, const char **upstream, size_t *us_len, const char **rev, size_t *rev_len) {
  char *col, *end, *hyp;
  const char *c;
  unsigned long u;
  size_t len = strlen(v);
  if ((col = strchr(v, ':')) != NULL) {
    if (v[0] == '-') {
      return -1;
    }
    errno = 0;
    u = strtoul(v, &end, 10);
    if (errno != 0 || end != col || u > UINT_MAX) {
      return -1;
    }
    *epoch = u;
    *upstream = col + 1;
  } else {
    *epoch = 0;
    *upstream = v;
  }
  if ((hyp = strchr(v, '-')) != NULL) {
    *rev = hyp + 1;
    *rev_len = len - ((hyp + 1) - v);
    *us_len = (hyp - *upstream);
    for (c = hyp + 1; *c != 0; c++) {
      if (!is_revchar(*c)) {
        return -1;
      }
    }
  } else {
    *rev = v + len;
    *rev_len = 0;
    *us_len = (*rev - *upstream);
  }
  c = *upstream;
  for (; *c != 0 && c != hyp; c++) {
    if (!is_uschar(*c, col != NULL, hyp != NULL)) {
      return -1;
    }
  }
  return 0;
}
```