// File: /workspace/github_c_makefile_star2_O0/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_s2dateTime
SOAP_FMAC2
soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
{ if (s)
  { char zone[32];
    struct tm T;
    const char *t;
    *zone = '\0';
    memset((void*)&T, 0, sizeof(T));
    if (strchr(s, '-'))
      t = "%d-%d-%dT%d:%d:%d%31s";
    else if (strchr(s, ':'))
      t = "%4d%2d%2dT%d:%d:%d%31s";
    else /* parse non-XSD-standard alternative ISO 8601 format */
      t = "%4d%2d%2dT%2d%2d%2d%31s";
    if (sscanf(s, t, &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, zone) < 6)
      return soap->error = SOAP_TYPE;
    if (T.tm_year == 1)
      T.tm_year = 70;
    else
      T.tm_year -= 1900;
    T.tm_mon--;
    if (*zone == '.')
    { for (s = zone + 1; *s; s++)
        if (*s < '0' || *s > '9')
          break;
    }
    else
      s = zone;
    if (*s)
    {
#ifndef WITH_NOZONE
      if (*s == '+' || *s == '-')
      { int h = 0, m = 0;
        if (s[3] == ':')
        { /* +hh:mm */
	  sscanf(s, "%d:%d", &h, &m);
          if (h < 0)
            m = -m;
        }
        else /* +hhmm */
        { m = (int)soap_strtol(s, NULL, 10);
          h = m / 100;
          m = m % 100;
        }
	T.tm_min -= m;
	T.tm_hour -= h;
	/* put hour and min in range */
        T.tm_hour += T.tm_min / 60;
        T.tm_min %= 60;
        if (T.tm_min < 0)
        { T.tm_min += 60;
	  T.tm_hour--;
	}
        T.tm_mday += T.tm_hour / 24;
        T.tm_hour %= 24;
        if (T.tm_hour < 0)
        { T.tm_hour += 24;
          T.tm_mday--;
	}
	/* note: day of the month may be out of range, timegm() handles it */
      }
#endif
      *p = soap_timegm(&T);
    }
    else /* no UTC or timezone, so assume we got a localtime */
    { T.tm_isdst = -1;
      *p = mktime(&T);
    }
  }
  return soap->error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x67eb6
movb $0x0, -0x40(%rbp)
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x3190
movq -0x18(%rbp), %rdi
movl $0x2d, %esi
callq 0x3130
cmpq $0x0, %rax
je 0x67c27
leaq 0x12fa8(%rip), %rax     # 0x7abc9
movq %rax, -0x80(%rbp)
jmp 0x67c55
movq -0x18(%rbp), %rdi
movl $0x3a, %esi
callq 0x3130
cmpq $0x0, %rax
je 0x67c48
leaq 0x12f9d(%rip), %rax     # 0x7abdf
movq %rax, -0x80(%rbp)
jmp 0x67c53
leaq 0x12fa7(%rip), %rax     # 0x7abf6
movq %rax, -0x80(%rbp)
jmp 0x67c55
movq -0x18(%rbp), %rdi
movq -0x80(%rbp), %rsi
leaq -0x78(%rbp), %rdx
addq $0x14, %rdx
leaq -0x78(%rbp), %rcx
addq $0x10, %rcx
leaq -0x78(%rbp), %r8
addq $0xc, %r8
leaq -0x78(%rbp), %r9
addq $0x8, %r9
leaq -0x78(%rbp), %r11
addq $0x4, %r11
leaq -0x78(%rbp), %r10
leaq -0x40(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x32a0
cmpl $0x6, %eax
jge 0x67cc1
movq -0x10(%rbp), %rax
movl $0x4, 0x19214(%rax)
movl $0x4, -0x4(%rbp)
jmp 0x67ec3
cmpl $0x1, -0x64(%rbp)
jne 0x67cd0
movl $0x46, -0x64(%rbp)
jmp 0x67cdb
movl -0x64(%rbp), %eax
subl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x64(%rbp)
movl -0x68(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x68(%rbp)
movsbl -0x40(%rbp), %eax
cmpl $0x2e, %eax
jne 0x67d2e
leaq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x67d2c
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x67d1a
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jle 0x67d1c
jmp 0x67d2c
jmp 0x67d1e
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x67cf9
jmp 0x67d36
leaq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x67e9a
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x67d5f
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x67e85
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x3(%rax), %eax
cmpl $0x3a, %eax
jne 0x67db9
movq -0x18(%rbp), %rdi
leaq 0x12e83(%rip), %rsi     # 0x7ac0e
leaq -0x84(%rbp), %rdx
leaq -0x88(%rbp), %rcx
movb $0x0, %al
callq 0x32a0
cmpl $0x0, -0x84(%rbp)
jge 0x67db7
xorl %eax, %eax
subl -0x88(%rbp), %eax
movl %eax, -0x88(%rbp)
jmp 0x67df9
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x3230
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, -0x88(%rbp)
movl -0x88(%rbp), %ecx
movl -0x74(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x74(%rbp)
movl -0x84(%rbp), %ecx
movl -0x70(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x70(%rbp)
movl -0x74(%rbp), %eax
movl $0x3c, %ecx
cltd
idivl %ecx
addl -0x70(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x74(%rbp), %eax
movl $0x3c, %ecx
cltd
idivl %ecx
movl %edx, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jge 0x67e4c
movl -0x74(%rbp), %eax
addl $0x3c, %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl $0x18, %ecx
cltd
idivl %ecx
addl -0x6c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x70(%rbp), %eax
movl $0x18, %ecx
cltd
idivl %ecx
movl %edx, -0x70(%rbp)
cmpl $0x0, -0x70(%rbp)
jge 0x67e83
movl -0x70(%rbp), %eax
addl $0x18, %eax
movl %eax, -0x70(%rbp)
movl -0x6c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x67e85
leaq -0x78(%rbp), %rdi
callq 0x67a20
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x67eb4
movl $0xffffffff, -0x58(%rbp) # imm = 0xFFFFFFFF
leaq -0x78(%rbp), %rdi
callq 0x32d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x67eb6
movq -0x10(%rbp), %rax
movl 0x19214(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nop