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

```asm
<mjt_pton6>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    $0x0,%r12d
  cmpb   $0x3a,(%rdi)
  je     L304
L154:
  mov    %rsp,%rbp
  mov    $0x0,%r8d
  lea    0x10(%rsp),%r9
L191:
  mov    %rdi,%rsi
  mov    %r8d,%edx
  jmp    L174
L304:
  cmpb   $0x3a,0x1(%rdi)
  jne    L144
  add    $0x2,%rdi
  mov    %rsp,%r12
  jmp    L154
L339:
  lea    -0x61(%rax),%ecx
  cmp    $0x5,%cl
  ja     L60
  movsbl %al,%eax
  sub    $0x57,%eax
L294:
  shl    $0x4,%edx
  or     %eax,%edx
  cmp    $0xffff,%edx
  ja     L295
  add    $0x1,%rsi
L174:
  movzbl (%rsi),%eax
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  ja     L339
  movsbl %al,%eax
  sub    $0x30,%eax
  jmp    L294
L60:
  lea    -0x41(%rax),%ecx
  cmp    $0x5,%cl
  ja     L106
  movsbl %al,%eax
  sub    $0x37,%eax
  jmp    L294
L106:
  cmp    %rsi,%rdi
  je     L346
  cmp    $0x3a,%al
  jne    L33
  cmp    %r9,%rbp
  je     L332
  add    $0x2,%rbp
  mov    %dx,-0x2(%rbp)
  lea    0x1(%rsi),%rdi
  cmpb   $0x3a,0x1(%rsi)
  jne    L191
  test   %r12,%r12
  jne    L375
  lea    0x2(%rsi),%rdi
  cmpb   $0x0,0x2(%rsi)
  je     L111
  mov    %rbp,%r12
  jmp    L191
L346:
  cmp    %r12,%rbp
  jne    L64
  test   %al,%al
  je     L157
L64:
  mov    $0x0,%eax
  jmp    L144
L33:
  test   %al,%al
  jne    L329
  lea    0x10(%rsp),%rcx
  mov    $0x0,%eax
  cmp    %rcx,%rbp
  jae    L144
  mov    %dx,0x0(%rbp)
  lea    0x2(%rbp),%rbp
L157:
  lea    0x10(%rsp),%rax
  sub    %rbp,%rax
  sar    %rax
  mov    %eax,%edx
  test   %eax,%eax
  setne  %sil
  test   %r12,%r12
  setne  %cl
  mov    $0x0,%eax
  cmp    %cl,%sil
  jne    L144
  mov    %rsp,%rdi
  mov    $0xffffffff,%esi
  jmp    L17
L329:
  lea    0xc(%rsp),%rdx
  cmp    %rdx,%rbp
  ja     L212
  cmp    $0x2e,%al
  je     L247
L212:
  mov    $0x0,%eax
  jmp    L144
L247:
  mov    %rbx,%rsi
  call   <mjt_pton4@plt>
  test   %eax,%eax
  je     L144
  movzbl (%rbx),%eax
  shl    $0x8,%eax
  movzbl 0x1(%rbx),%edx
  or     %edx,%eax
  mov    %ax,0x0(%rbp)
  movzbl 0x2(%rbx),%eax
  shl    $0x8,%eax
  movzbl 0x3(%rbx),%edx
  or     %edx,%eax
  mov    %ax,0x2(%rbp)
  lea    0x4(%rbp),%rbp
  jmp    L157
L111:
  mov    %rbp,%r12
  jmp    L157
L200:
  mov    %ecx,%edx
L208:
  cmp    %rdi,%rbp
  jbe    L366
  movzwl (%rdi),%ecx
  movzbl %ch,%eax
  mov    %al,(%rbx)
  mov    %cl,0x1(%rbx)
  add    $0x2,%rdi
  lea    0x2(%rbx),%rbx
L17:
  cmp    %rdi,%r12
  jne    L208
  lea    -0x1(%rdx),%ecx
  test   %edx,%edx
  je     L200
  mov    %ecx,%ecx
  lea    0x2(%rbx,%rcx,2),%rdx
L348:
  movb   $0x0,(%rbx)
  add    $0x2,%rbx
  movb   $0x0,-0x1(%rbx)
  cmp    %rbx,%rdx
  jne    L348
  mov    %esi,%edx
  jmp    L208
L295:
  mov    $0x0,%eax
L144:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L109
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L332:
  mov    $0x0,%eax
  jmp    L144
L375:
  mov    $0x0,%eax
  jmp    L144
L366:
  mov    $0x1,%eax
  jmp    L144
L109:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int mjt_pton6(const char *c, void *dst) {
  unsigned short w[8], *a = w, *z, *i;
  unsigned v, o;
  const char *sc;
  unsigned char *d = (unsigned char *)dst;
  if (*c != ':')
    z = (unsigned short *)0;
  else if (*++c != ':')
    return 0;
  else
    ++c, z = a;
  i = 0;
  for (;;) {
    v = 0;
    sc = c;
    for (;;) {
      if (*c >= '0' && *c <= '9')
        o = *c - '0';
      else if (*c >= 'a' && *c <= 'f')
        o = *c - 'a' + 10;
      else if (*c >= 'A' && *c <= 'F')
        o = *c - 'A' + 10;
      else
        break;
      v = (v << 4) | o;
      if (v > 0xffff)
        return 0;
      ++c;
    }
    if (sc == c) {
      if (z == a && !*c)
        break;
      else
        return 0;
    }
    if (*c == ':') {
      if (a >= w + 8)
        return 0;
      *a++ = v;
      if (*++c == ':') {
        if (z)
          return 0;
        z = a;
        if (!*++c)
          break;
      }
    } else if (!*c) {
      if (a >= w + 8)
        return 0;
      *a++ = v;
      break;
    } else if (*c == '.') {
      if (a > w + 6)
        return 0;
      if (!mjt_pton4(sc, d))
        return 0;
      *a++ = ((unsigned)(d[0]) << 8) | d[1];
      *a++ = ((unsigned)(d[2]) << 8) | d[3];
      break;
    } else
      return 0;
  }
  v = w + 8 - a;
  if ((v && !z) || (!v && z))
    return 0;
  for (i = w;; ++i) {
    if (i == z)
      while (v--) {
        *d++ = '\0';
        *d++ = '\0';
      }
    if (i >= a)
      break;
    *d++ = (unsigned char)((*i >> 8) & 255);
    *d++ = (unsigned char)(*i & 255);
  }
  return 1;
}
```