// File: /workspace/github_c_makefile_star2_O0/cktan[P]tomlc99/toml.c
// Function: toml_rtots
int toml_rtots(toml_raw_t src_, toml_timestamp_t *ret) {
  if (!src_)
    return -1;

  const char *p = src_;
  int must_parse_time = 0;

  memset(ret, 0, sizeof(*ret));

  int *year = &ret->__buffer.year;
  int *month = &ret->__buffer.month;
  int *day = &ret->__buffer.day;
  int *hour = &ret->__buffer.hour;
  int *minute = &ret->__buffer.minute;
  int *second = &ret->__buffer.second;
  int *millisec = &ret->__buffer.millisec;

  /* parse date YYYY-MM-DD */
  if (0 == scan_date(p, year, month, day)) {
    ret->year = year;
    ret->month = month;
    ret->day = day;

    p += 10;
    if (*p) {
      // parse the T or space separator
      if (*p != 'T' && *p != 't' && *p != ' ')
        return -1;
      must_parse_time = 1;
      p++;
    }
  }

  /* parse time HH:MM:SS */
  if (0 == scan_time(p, hour, minute, second)) {
    ret->hour = hour;
    ret->minute = minute;
    ret->second = second;

    /* optionally, parse millisec */
    p += 8;
    if (*p == '.') {
      p++; /* skip '.' */
      const char *qq;
      *millisec = parse_millisec(p, &qq);
      ret->millisec = millisec;
      p = qq;
    }

    if (*p) {
      /* parse and copy Z */
      char *z = ret->__buffer.z;
      ret->z = z;
      if (*p == 'Z' || *p == 'z') {
        *z++ = 'Z';
        p++;
        *z = 0;

      } else if (*p == '+' || *p == '-') {
        *z++ = *p++;

        if (!(isdigit(p[0]) && isdigit(p[1])))
          return -1;
        *z++ = *p++;
        *z++ = *p++;

        if (*p == ':') {
          *z++ = *p++;

          if (!(isdigit(p[0]) && isdigit(p[1])))
            return -1;
          *z++ = *p++;
          *z++ = *p++;
        }

        *z = 0;
      }
    }
  }
  if (*p != 0)
    return -1;

  if (must_parse_time && !ret->hour)
    return -1;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3e53
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x1100
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x4240
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3f5d
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x20(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3f5b
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x54, %eax
je 0x3f48
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x3f48
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x3f48
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
movl $0x1, -0x24(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3f5d
movq -0x20(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x4350
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x41f5
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x3fef
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4460
movl %eax, %ecx
movq -0x60(%rbp), %rax
movl %ecx, (%rax)
movq -0x60(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x41f3
movq -0x18(%rbp), %rax
addq $0x1c, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5a, %eax
je 0x402c
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7a, %eax
jne 0x4056
movq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x70(%rbp)
movb $0x5a, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x70(%rbp), %rax
movb $0x0, (%rax)
jmp 0x41f1
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x4072
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x41ef
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
callq 0x11d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x40d5
callq 0x11d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x40e1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x41e8
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
callq 0x11d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4198
callq 0x11d0
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x41a4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb (%rax), %cl
movq -0x70(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x70(%rbp)
movb %cl, (%rax)
movq -0x70(%rbp), %rax
movb $0x0, (%rax)
jmp 0x41f1
jmp 0x41f3
jmp 0x41f5
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x420a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
cmpl $0x0, -0x24(%rbp)
je 0x4224
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x4224
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x422b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)