#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct tm {
  int tm_mon;
  void *tm_sec;
  void *tm_min;
  void *tm_hour;
  void *tm_year;
  void *tm_mday;
};

/* Variables and functions */
void *atoi(char *);
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int strlen(char *);
long timegm(struct tm *);
int /*<<< orphan*/ zstrncpy(char *, char const *, int);
int /*<<< orphan*/ ztolower(char *);
long zmime_header_date_decode(const char *str) {
  char str_copy[128];
  char *ps, *p, *p2, *p3;
  int v, sign, offset;
  struct tm tm;
  long result = -1;
  memset(&tm, 0, sizeof(struct tm));
  zstrncpy(str_copy, str, 127);
  ztolower(str_copy);
  p = str_copy;
  {
    while ((*p) && ((*p < '0') || (*p > '9')))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  ps = p;
  {
    while ((*p) && (*p != ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  *(p++) = 0;
  tm.tm_mday = atoi(ps);
  {
    while ((*p) && (*p == ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  ps = p;
  {
    while ((*p) && (*p != ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  if (p - ps != 3) {
    goto err;
  }
  *(p++) = 0;
  v = -1;
  p2 = p + 1;
  p3 = p + 2;
  switch (*ps) {
  case 'a':
    if (*p2 == 'p') {
      v = 3;
    } else {
      v = 7;
    }
    break;
  case 'd':
    v = 11;
    break;
  case 'f':
    v = 1;
    break;
  case 'j':
    if (*p2 == 'a') {
      v = 0;
    } else if (*p3 == 'n') {
      v = 5;
    } else {
      v = 6;
    }
    break;
  case 'm':
    if (*p3 == 'r') {
      v = 2;
    } else {
      v = 4;
    }
    break;
  case 'n':
    v = 10;
    break;
  case 'o':
    v = 9;
    break;
  case 's':
    v = 8;
    break;
  }
  if (v == -1) {
    goto err;
  }
  tm.tm_mon = v;
  {
    while ((*p) && (*p == ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  ps = p;
  {
    while ((*p) && (*p != ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  if (p - ps != 4) {
    goto err;
  }
  *(p++) = 0;
  tm.tm_year = atoi(ps) - 1900;
  {
    while ((*p) && (*p == ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  ps = p;
  {
    while ((*p) && (*p != ':'))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  *(p++) = 0;
  tm.tm_hour = atoi(ps);
  ps = p;
  {
    while ((*p) && (*p != ':'))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  *(p++) = 0;
  tm.tm_min = atoi(ps);
  ps = p;
  {
    while ((*p) && (*p != ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  *(p++) = 0;
  tm.tm_sec = atoi(ps);
  {
    while ((*p) && (*p == ' '))
      p++;
  };
  {
    if (!*p)
      goto err;
  };
  ps = p;
  if (strlen(ps) < 5) {
    goto err;
  }
  sign = (ps[0] == '-') ? -1 : 1;
  ps++;
  offset = (ps[0] - '0') * 10 + (ps[1] - '0');
  ps += 2;
  offset = offset * 60 + (ps[0] - '0') * 10 + (ps[1] - '0');
  offset *= 60;
  result = timegm(&tm);
  if (result == -1) {
    goto err;
  }
  result = result - sign * offset;
err:
  return result;
}


x86 assembly (clang, -O0):
<zmime_header_date_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0xf8(%rbp)
ff ff ff ff
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x7f,%edx
call   1050 <zstrncpy@plt>
lea    -0x90(%rbp),%rdi
call   1070 <ztolower@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xf9(%rbp)
je     1214 <zmime_header_date_decode+0xb4>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x30,%ecx
mov    %al,-0xfa(%rbp)
jl     1208 <zmime_header_date_decode+0xa8>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setg   %al
mov    %al,-0xfa(%rbp)
mov    -0xfa(%rbp),%al
mov    %al,-0xf9(%rbp)
mov    -0xf9(%rbp),%al
test   $0x1,%al
jne    1227 <zmime_header_date_decode+0xc7>
jmp    123e <zmime_header_date_decode+0xde>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    11bc <zmime_header_date_decode+0x5c>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1253 <zmime_header_date_decode+0xf3>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xfb(%rbp)
je     1292 <zmime_header_date_decode+0x132>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xfb(%rbp)
mov    -0xfb(%rbp),%al
test   $0x1,%al
jne    12a5 <zmime_header_date_decode+0x145>
jmp    12bc <zmime_header_date_decode+0x15c>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1261 <zmime_header_date_decode+0x101>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12d1 <zmime_header_date_decode+0x171>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,-0xc8(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xfc(%rbp)
je     132d <zmime_header_date_decode+0x1cd>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0xfc(%rbp)
mov    -0xfc(%rbp),%al
test   $0x1,%al
jne    1340 <zmime_header_date_decode+0x1e0>
jmp    1357 <zmime_header_date_decode+0x1f7>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    12fc <zmime_header_date_decode+0x19c>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    136c <zmime_header_date_decode+0x20c>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xfd(%rbp)
je     13ab <zmime_header_date_decode+0x24b>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xfd(%rbp)
mov    -0xfd(%rbp),%al
test   $0x1,%al
jne    13be <zmime_header_date_decode+0x25e>
jmp    13d5 <zmime_header_date_decode+0x275>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    137a <zmime_header_date_decode+0x21a>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    13ea <zmime_header_date_decode+0x28a>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    -0x98(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x3,%rax
je     140a <zmime_header_date_decode+0x2aa>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
movl   $0xffffffff,-0xb4(%rbp)
ff ff ff
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa0(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0xb0(%rbp)
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x108(%rbp)
sub    $0x12,%eax
ja     1586 <zmime_header_date_decode+0x426>
mov    -0x108(%rbp),%rax
lea    0xb83(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x70,%eax
jne    14a8 <zmime_header_date_decode+0x348>
movl   $0x3,-0xb4(%rbp)
jmp    14b2 <zmime_header_date_decode+0x352>
movl   $0x7,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
movl   $0xb,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
movl   $0x1,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jne    14f7 <zmime_header_date_decode+0x397>
movl   $0x0,-0xb4(%rbp)
jmp    1528 <zmime_header_date_decode+0x3c8>
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    1519 <zmime_header_date_decode+0x3b9>
movl   $0x5,-0xb4(%rbp)
jmp    1523 <zmime_header_date_decode+0x3c3>
movl   $0x6,-0xb4(%rbp)
jmp    1528 <zmime_header_date_decode+0x3c8>
jmp    1586 <zmime_header_date_decode+0x426>
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    154f <zmime_header_date_decode+0x3ef>
movl   $0x2,-0xb4(%rbp)
jmp    1559 <zmime_header_date_decode+0x3f9>
movl   $0x4,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
movl   $0xa,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
movl   $0x9,-0xb4(%rbp)
jmp    1586 <zmime_header_date_decode+0x426>
movl   $0x8,-0xb4(%rbp)
cmpl   $0xffffffff,-0xb4(%rbp)
jne    1598 <zmime_header_date_decode+0x438>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xb4(%rbp),%eax
mov    %eax,-0xf0(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x109(%rbp)
je     15d5 <zmime_header_date_decode+0x475>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x109(%rbp)
mov    -0x109(%rbp),%al
test   $0x1,%al
jne    15e8 <zmime_header_date_decode+0x488>
jmp    15ff <zmime_header_date_decode+0x49f>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    15a4 <zmime_header_date_decode+0x444>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1614 <zmime_header_date_decode+0x4b4>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10a(%rbp)
je     1653 <zmime_header_date_decode+0x4f3>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x10a(%rbp)
mov    -0x10a(%rbp),%al
test   $0x1,%al
jne    1666 <zmime_header_date_decode+0x506>
jmp    167d <zmime_header_date_decode+0x51d>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1622 <zmime_header_date_decode+0x4c2>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1692 <zmime_header_date_decode+0x532>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    -0x98(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x4,%rax
je     16b2 <zmime_header_date_decode+0x552>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rdi
call   1080 <atoi@plt>
add    $0xfffffffffffff894,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10b(%rbp)
je     1714 <zmime_header_date_decode+0x5b4>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x10b(%rbp)
mov    -0x10b(%rbp),%al
test   $0x1,%al
jne    1727 <zmime_header_date_decode+0x5c7>
jmp    173e <zmime_header_date_decode+0x5de>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    16e3 <zmime_header_date_decode+0x583>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1753 <zmime_header_date_decode+0x5f3>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10c(%rbp)
je     1792 <zmime_header_date_decode+0x632>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x10c(%rbp)
mov    -0x10c(%rbp),%al
test   $0x1,%al
jne    17a5 <zmime_header_date_decode+0x645>
jmp    17bc <zmime_header_date_decode+0x65c>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    1761 <zmime_header_date_decode+0x601>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    17d1 <zmime_header_date_decode+0x671>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10d(%rbp)
je     183b <zmime_header_date_decode+0x6db>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x10d(%rbp)
mov    -0x10d(%rbp),%al
test   $0x1,%al
jne    184e <zmime_header_date_decode+0x6ee>
jmp    1865 <zmime_header_date_decode+0x705>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    180a <zmime_header_date_decode+0x6aa>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    187a <zmime_header_date_decode+0x71a>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,-0xe0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10e(%rbp)
je     18e4 <zmime_header_date_decode+0x784>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x10e(%rbp)
mov    -0x10e(%rbp),%al
test   $0x1,%al
jne    18f7 <zmime_header_date_decode+0x797>
jmp    190e <zmime_header_date_decode+0x7ae>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    18b3 <zmime_header_date_decode+0x753>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1923 <zmime_header_date_decode+0x7c3>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xa0(%rbp)
movb   $0x0,(%rax)
mov    -0x98(%rbp),%rdi
call   1080 <atoi@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xa0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10f(%rbp)
je     197f <zmime_header_date_decode+0x81f>
mov    -0xa0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x10f(%rbp)
mov    -0x10f(%rbp),%al
test   $0x1,%al
jne    1992 <zmime_header_date_decode+0x832>
jmp    19a9 <zmime_header_date_decode+0x849>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    194e <zmime_header_date_decode+0x7ee>
mov    -0xa0(%rbp),%rax
cmpb   $0x0,(%rax)
jne    19be <zmime_header_date_decode+0x85e>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xa0(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jge    19e6 <zmime_header_date_decode+0x886>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0x98(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x2d,%edx
cmove  %ecx,%eax
mov    %eax,-0xb8(%rbp)
mov    -0x98(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,%eax,%eax
mov    -0x98(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xbc(%rbp)
mov    -0x98(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x98(%rbp)
imul   $0x3c,-0xbc(%rbp),%eax
mov    -0x98(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    -0x98(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xbc(%rbp)
imul   $0x3c,-0xbc(%rbp),%eax
mov    %eax,-0xbc(%rbp)
lea    -0xf0(%rbp),%rdi
call   1060 <timegm@plt>
mov    %rax,-0xf8(%rbp)
cmpq   $0xffffffffffffffff,-0xf8(%rbp)
ff
jne    1ab2 <zmime_header_date_decode+0x952>
jmp    1ad3 <zmime_header_date_decode+0x973>
mov    -0xf8(%rbp),%rax
mov    -0xb8(%rbp),%ecx
imul   -0xbc(%rbp),%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmime_header_date_decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x7f,%edx
call   1050 <zstrncpy@plt>
mov    %r14,%rdi
call   1070 <ztolower@plt>
mov    0x30(%rsp),%al
mov    $0xffffffffffffffff,%r14
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
lea    0x31(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
lea    -0x3a(%rax),%ecx
cmp    $0xf6,%cl
jae    11d8 <zmime_header_date_decode+0x78>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11c0 <zmime_header_date_decode+0x60>
jmp    1361 <zmime_header_date_decode+0x201>
lea    -0x1(%rbx),%rdi
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x20,%al
je     1204 <zmime_header_date_decode+0xa4>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11f0 <zmime_header_date_decode+0x90>
jmp    1361 <zmime_header_date_decode+0x201>
movb   $0x0,-0x1(%rbx)
call   1080 <atoi@plt>
mov    %rax,0x28(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%ecx
add    $0x1,%rbx
cmp    $0x20,%cl
je     1220 <zmime_header_date_decode+0xc0>
test   %cl,%cl
je     1361 <zmime_header_date_decode+0x201>
mov    $0x3,%edx
mov    %rbx,%rax
test   $0xdf,%cl
je     1260 <zmime_header_date_decode+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
test   $0xdf,%cl
jne    1250 <zmime_header_date_decode+0xf0>
test   %cl,%cl
je     1361 <zmime_header_date_decode+0x201>
test   %rdx,%rdx
jne    1361 <zmime_header_date_decode+0x201>
movb   $0x0,-0x1(%rax)
movsbl -0x1(%rbx),%edx
add    $0xffffff9f,%edx
cmp    $0x12,%edx
ja     1361 <zmime_header_date_decode+0x201>
mov    $0xb,%ecx
lea    0xd6f(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
xor    %ecx,%ecx
cmpb   $0x70,0x1(%rax)
setne  %cl
lea    0x3(,%rcx,4),%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
mov    $0x1,%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
xor    %ecx,%ecx
cmpb   $0x61,0x1(%rax)
je     12f0 <zmime_header_date_decode+0x190>
xor    %edx,%edx
cmpb   $0x6e,0x2(%rax)
sete   %dl
mov    $0x6,%ecx
sub    %edx,%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
xor    %ecx,%ecx
cmpb   $0x72,0x2(%rax)
setne  %cl
add    %ecx,%ecx
add    $0x2,%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
mov    $0xa,%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
mov    $0x9,%ecx
jmp    12f0 <zmime_header_date_decode+0x190>
mov    $0x8,%ecx
mov    %ecx,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1300 <zmime_header_date_decode+0x1a0>
test   %cl,%cl
je     1361 <zmime_header_date_decode+0x201>
lea    -0x1(%rax),%rdi
xor    %edx,%edx
test   $0xdf,%cl
je     132d <zmime_header_date_decode+0x1cd>
nopl   0x0(%rax,%rax,1)
movzbl (%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   $0xdf,%cl
jne    1320 <zmime_header_date_decode+0x1c0>
test   %cl,%cl
je     1361 <zmime_header_date_decode+0x201>
cmp    $0x4,%rdx
jne    1361 <zmime_header_date_decode+0x201>
mov    %rax,%rbx
add    %rdx,%rbx
movb   $0x0,-0x1(%rax,%rdx,1)
call   1080 <atoi@plt>
add    $0xfffffffffffff894,%rax
mov    %rax,0x20(%rsp)
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
je     1352 <zmime_header_date_decode+0x1f2>
test   %al,%al
jne    1376 <zmime_header_date_decode+0x216>
mov    %r14,%rax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%r15
add    $0xffffffffffffffff,%rbx
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
cmp    $0x3a,%al
je     1393 <zmime_header_date_decode+0x233>
movzbl (%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    1381 <zmime_header_date_decode+0x221>
jmp    1361 <zmime_header_date_decode+0x201>
movb   $0x0,-0x1(%r15)
mov    %rbx,%rdi
call   1080 <atoi@plt>
mov    %rax,0x18(%rsp)
lea    0x1(%r15),%rbx
movzbl -0x1(%rbx),%eax
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
cmp    $0x3a,%al
je     13bb <zmime_header_date_decode+0x25b>
add    $0x1,%rbx
jmp    13a9 <zmime_header_date_decode+0x249>
movb   $0x0,-0x1(%rbx)
mov    %r15,%rdi
call   1080 <atoi@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,%r15
movzbl (%r15),%eax
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
cmp    $0x20,%al
je     13e1 <zmime_header_date_decode+0x281>
add    $0x1,%r15
jmp    13cf <zmime_header_date_decode+0x26f>
movb   $0x0,(%r15)
mov    %rbx,%rdi
call   1080 <atoi@plt>
mov    %rax,0x8(%rsp)
movzbl 0x1(%r15),%eax
add    $0x1,%r15
cmp    $0x20,%al
je     13f2 <zmime_header_date_decode+0x292>
test   %al,%al
je     1361 <zmime_header_date_decode+0x201>
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jl     1361 <zmime_header_date_decode+0x201>
mov    (%r15),%r12b
movsbl 0x1(%r15),%ebx
movsbl 0x2(%r15),%ebp
movsbl 0x3(%r15),%r13d
movsbl 0x4(%r15),%r15d
mov    %rsp,%rdi
call   1060 <timegm@plt>
cmp    $0xffffffffffffffff,%rax
je     1361 <zmime_header_date_decode+0x201>
lea    (%rbx,%rbx,4),%ecx
lea    0x0(%rbp,%rcx,2),%ecx
imul   $0x3c,%ecx,%ecx
lea    0x0(%r13,%r13,4),%edx
lea    (%rcx,%rdx,2),%ecx
add    %r15d,%ecx
imul   $0x3c,%ecx,%ecx
mov    $0x1d7cc0,%edx
sub    %ecx,%edx
add    $0xffe28340,%ecx
cmp    $0x2d,%r12b
cmove  %edx,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %rax,%r14
jmp    1361 <zmime_header_date_decode+0x201>

LLVM IR (-O0):
%struct.tm = type { i32, i8*, i8*, i8*, i8*, i8* }
define i64 @zmime_header_date_decode(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.tm
%12 = alloca i64
store i8* %0, i8** %2
store i64 -1, i64* %12
%13 = call i32 @memset(%struct.tm* %11, i32 0, i32 48)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%15 = load i8*, i8** %2
%16 = call i32 @zstrncpy(i8* %14, i8* %15, i32 127)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%18 = call i32 @ztolower(i8* %17)
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
store i8* %19, i8** %5
br label %20
20: ; preds = %39, %1
%21 = load i8*, i8** %5
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %37
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp slt i32 %28, 48
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = load i8*, i8** %5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp sgt i32 %33, 57
br label %35
35: ; preds = %30, %25
%36 = phi i1 [ true, %25 ], [ %34, %30 ]
br label %37
37: ; preds = %35, %20
%38 = phi i1 [ false, %20 ], [ %36, %35 ]
br i1 %38, label %39, label %42
39: ; preds = %37
%40 = load i8*, i8** %5
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %5
br label %20
42: ; preds = %37
%43 = load i8*, i8** %5
%44 = load i8, i8* %43
%45 = icmp ne i8 %44, 0
br i1 %45, label %47, label %46
46: ; preds = %42
br label %415
47: ; preds = %42
%48 = load i8*, i8** %5
store i8* %48, i8** %4
br label %49
49: ; preds = %61, %47
%50 = load i8*, i8** %5
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %49
%55 = load i8*, i8** %5
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 32
br label %59
59: ; preds = %54, %49
%60 = phi i1 [ false, %49 ], [ %58, %54 ]
br i1 %60, label %61, label %64
61: ; preds = %59
%62 = load i8*, i8** %5
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %5
br label %49
64: ; preds = %59
%65 = load i8*, i8** %5
%66 = load i8, i8* %65
%67 = icmp ne i8 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %64
br label %415
69: ; preds = %64
%70 = load i8*, i8** %5
%71 = getelementptr inbounds i8, i8* %70, i32 1
store i8* %71, i8** %5
store i8 0, i8* %70
%72 = load i8*, i8** %4
%73 = call i8* @atoi(i8* %72)
%74 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 5
store i8* %73, i8** %74
br label %75
75: ; preds = %87, %69
%76 = load i8*, i8** %5
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %85
80: ; preds = %75
%81 = load i8*, i8** %5
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 32
br label %85
85: ; preds = %80, %75
%86 = phi i1 [ false, %75 ], [ %84, %80 ]
br i1 %86, label %87, label %90
87: ; preds = %85
%88 = load i8*, i8** %5
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** %5
br label %75
90: ; preds = %85
%91 = load i8*, i8** %5
%92 = load i8, i8* %91
%93 = icmp ne i8 %92, 0
br i1 %93, label %95, label %94
94: ; preds = %90
br label %415
95: ; preds = %90
%96 = load i8*, i8** %5
store i8* %96, i8** %4
br label %97
97: ; preds = %109, %95
%98 = load i8*, i8** %5
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %107
102: ; preds = %97
%103 = load i8*, i8** %5
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp ne i32 %105, 32
br label %107
107: ; preds = %102, %97
%108 = phi i1 [ false, %97 ], [ %106, %102 ]
br i1 %108, label %109, label %112
109: ; preds = %107
%110 = load i8*, i8** %5
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %5
br label %97
112: ; preds = %107
%113 = load i8*, i8** %5
%114 = load i8, i8* %113
%115 = icmp ne i8 %114, 0
br i1 %115, label %117, label %116
116: ; preds = %112
br label %415
117: ; preds = %112
%118 = load i8*, i8** %5
%119 = load i8*, i8** %4
%120 = ptrtoint i8* %118 to i64
%121 = ptrtoint i8* %119 to i64
%122 = sub i64 %120, %121
%123 = icmp ne i64 %122, 3
br i1 %123, label %124, label %125
124: ; preds = %117
br label %415
125: ; preds = %117
%126 = load i8*, i8** %5
%127 = getelementptr inbounds i8, i8* %126, i32 1
store i8* %127, i8** %5
store i8 0, i8* %126
store i32 -1, i32* %8
%128 = load i8*, i8** %5
%129 = getelementptr inbounds i8, i8* %128, i64 1
store i8* %129, i8** %6
%130 = load i8*, i8** %5
%131 = getelementptr inbounds i8, i8* %130, i64 2
store i8* %131, i8** %7
%132 = load i8*, i8** %4
%133 = load i8, i8* %132
%134 = sext i8 %133 to i32
switch i32 %134, label %171 [
i32 97, label %135
i32 100, label %143
i32 102, label %144
i32 106, label %145
i32 109, label %160
i32 110, label %168
i32 111, label %169
i32 115, label %170
]
135: ; preds = %125
%136 = load i8*, i8** %6
%137 = load i8, i8* %136
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 112
br i1 %139, label %140, label %141
140: ; preds = %135
store i32 3, i32* %8
br label %142
141: ; preds = %135
store i32 7, i32* %8
br label %142
142: ; preds = %141, %140
br label %171
143: ; preds = %125
store i32 11, i32* %8
br label %171
144: ; preds = %125
store i32 1, i32* %8
br label %171
145: ; preds = %125
%146 = load i8*, i8** %6
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 97
br i1 %149, label %150, label %151
150: ; preds = %145
store i32 0, i32* %8
br label %159
151: ; preds = %145
%152 = load i8*, i8** %7
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %154, 110
br i1 %155, label %156, label %157
156: ; preds = %151
store i32 5, i32* %8
br label %158
157: ; preds = %151
store i32 6, i32* %8
br label %158
158: ; preds = %157, %156
br label %159
159: ; preds = %158, %150
br label %171
160: ; preds = %125
%161 = load i8*, i8** %7
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp eq i32 %163, 114
br i1 %164, label %165, label %166
165: ; preds = %160
store i32 2, i32* %8
br label %167
166: ; preds = %160
store i32 4, i32* %8
br label %167
167: ; preds = %166, %165
br label %171
168: ; preds = %125
store i32 10, i32* %8
br label %171
169: ; preds = %125
store i32 9, i32* %8
br label %171
170: ; preds = %125
store i32 8, i32* %8
br label %171
171: ; preds = %125, %170, %169, %168, %167, %159, %144, %143, %142
%172 = load i32, i32* %8
%173 = icmp eq i32 %172, -1
br i1 %173, label %174, label %175
174: ; preds = %171
br label %415
175: ; preds = %171
%176 = load i32, i32* %8
%177 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 0
store i32 %176, i32* %177
br label %178
178: ; preds = %190, %175
%179 = load i8*, i8** %5
%180 = load i8, i8* %179
%181 = sext i8 %180 to i32
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %188
183: ; preds = %178
%184 = load i8*, i8** %5
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = icmp eq i32 %186, 32
br label %188
188: ; preds = %183, %178
%189 = phi i1 [ false, %178 ], [ %187, %183 ]
br i1 %189, label %190, label %193
190: ; preds = %188
%191 = load i8*, i8** %5
%192 = getelementptr inbounds i8, i8* %191, i32 1
store i8* %192, i8** %5
br label %178
193: ; preds = %188
%194 = load i8*, i8** %5
%195 = load i8, i8* %194
%196 = icmp ne i8 %195, 0
br i1 %196, label %198, label %197
197: ; preds = %193
br label %415
198: ; preds = %193
%199 = load i8*, i8** %5
store i8* %199, i8** %4
br label %200
200: ; preds = %212, %198
%201 = load i8*, i8** %5
%202 = load i8, i8* %201
%203 = sext i8 %202 to i32
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %210
205: ; preds = %200
%206 = load i8*, i8** %5
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = icmp ne i32 %208, 32
br label %210
210: ; preds = %205, %200
%211 = phi i1 [ false, %200 ], [ %209, %205 ]
br i1 %211, label %212, label %215
212: ; preds = %210
%213 = load i8*, i8** %5
%214 = getelementptr inbounds i8, i8* %213, i32 1
store i8* %214, i8** %5
br label %200
215: ; preds = %210
%216 = load i8*, i8** %5
%217 = load i8, i8* %216
%218 = icmp ne i8 %217, 0
br i1 %218, label %220, label %219
219: ; preds = %215
br label %415
220: ; preds = %215
%221 = load i8*, i8** %5
%222 = load i8*, i8** %4
%223 = ptrtoint i8* %221 to i64
%224 = ptrtoint i8* %222 to i64
%225 = sub i64 %223, %224
%226 = icmp ne i64 %225, 4
br i1 %226, label %227, label %228
227: ; preds = %220
br label %415
228: ; preds = %220
%229 = load i8*, i8** %5
%230 = getelementptr inbounds i8, i8* %229, i32 1
store i8* %230, i8** %5
store i8 0, i8* %229
%231 = load i8*, i8** %4
%232 = call i8* @atoi(i8* %231)
%233 = getelementptr i8, i8* %232, i64 -1900
%234 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 4
store i8* %233, i8** %234
br label %235
235: ; preds = %247, %228
%236 = load i8*, i8** %5
%237 = load i8, i8* %236
%238 = sext i8 %237 to i32
%239 = icmp ne i32 %238, 0
br i1 %239, label %240, label %245
240: ; preds = %235
%241 = load i8*, i8** %5
%242 = load i8, i8* %241
%243 = sext i8 %242 to i32
%244 = icmp eq i32 %243, 32
br label %245
245: ; preds = %240, %235
%246 = phi i1 [ false, %235 ], [ %244, %240 ]
br i1 %246, label %247, label %250
247: ; preds = %245
%248 = load i8*, i8** %5
%249 = getelementptr inbounds i8, i8* %248, i32 1
store i8* %249, i8** %5
br label %235
250: ; preds = %245
%251 = load i8*, i8** %5
%252 = load i8, i8* %251
%253 = icmp ne i8 %252, 0
br i1 %253, label %255, label %254
254: ; preds = %250
br label %415
255: ; preds = %250
%256 = load i8*, i8** %5
store i8* %256, i8** %4
br label %257
257: ; preds = %269, %255
%258 = load i8*, i8** %5
%259 = load i8, i8* %258
%260 = sext i8 %259 to i32
%261 = icmp ne i32 %260, 0
br i1 %261, label %262, label %267
262: ; preds = %257
%263 = load i8*, i8** %5
%264 = load i8, i8* %263
%265 = sext i8 %264 to i32
%266 = icmp ne i32 %265, 58
br label %267
267: ; preds = %262, %257
%268 = phi i1 [ false, %257 ], [ %266, %262 ]
br i1 %268, label %269, label %272
269: ; preds = %267
%270 = load i8*, i8** %5
%271 = getelementptr inbounds i8, i8* %270, i32 1
store i8* %271, i8** %5
br label %257
272: ; preds = %267
%273 = load i8*, i8** %5
%274 = load i8, i8* %273
%275 = icmp ne i8 %274, 0
br i1 %275, label %277, label %276
276: ; preds = %272
br label %415
277: ; preds = %272
%278 = load i8*, i8** %5
%279 = getelementptr inbounds i8, i8* %278, i32 1
store i8* %279, i8** %5
store i8 0, i8* %278
%280 = load i8*, i8** %4
%281 = call i8* @atoi(i8* %280)
%282 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 3
store i8* %281, i8** %282
%283 = load i8*, i8** %5
store i8* %283, i8** %4
br label %284
284: ; preds = %296, %277
%285 = load i8*, i8** %5
%286 = load i8, i8* %285
%287 = sext i8 %286 to i32
%288 = icmp ne i32 %287, 0
br i1 %288, label %289, label %294
289: ; preds = %284
%290 = load i8*, i8** %5
%291 = load i8, i8* %290
%292 = sext i8 %291 to i32
%293 = icmp ne i32 %292, 58
br label %294
294: ; preds = %289, %284
%295 = phi i1 [ false, %284 ], [ %293, %289 ]
br i1 %295, label %296, label %299
296: ; preds = %294
%297 = load i8*, i8** %5
%298 = getelementptr inbounds i8, i8* %297, i32 1
store i8* %298, i8** %5
br label %284
299: ; preds = %294
%300 = load i8*, i8** %5
%301 = load i8, i8* %300
%302 = icmp ne i8 %301, 0
br i1 %302, label %304, label %303
303: ; preds = %299
br label %415
304: ; preds = %299
%305 = load i8*, i8** %5
%306 = getelementptr inbounds i8, i8* %305, i32 1
store i8* %306, i8** %5
store i8 0, i8* %305
%307 = load i8*, i8** %4
%308 = call i8* @atoi(i8* %307)
%309 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 2
store i8* %308, i8** %309
%310 = load i8*, i8** %5
store i8* %310, i8** %4
br label %311
311: ; preds = %323, %304
%312 = load i8*, i8** %5
%313 = load i8, i8* %312
%314 = sext i8 %313 to i32
%315 = icmp ne i32 %314, 0
br i1 %315, label %316, label %321
316: ; preds = %311
%317 = load i8*, i8** %5
%318 = load i8, i8* %317
%319 = sext i8 %318 to i32
%320 = icmp ne i32 %319, 32
br label %321
321: ; preds = %316, %311
%322 = phi i1 [ false, %311 ], [ %320, %316 ]
br i1 %322, label %323, label %326
323: ; preds = %321
%324 = load i8*, i8** %5
%325 = getelementptr inbounds i8, i8* %324, i32 1
store i8* %325, i8** %5
br label %311
326: ; preds = %321
%327 = load i8*, i8** %5
%328 = load i8, i8* %327
%329 = icmp ne i8 %328, 0
br i1 %329, label %331, label %330
330: ; preds = %326
br label %415
331: ; preds = %326
%332 = load i8*, i8** %5
%333 = getelementptr inbounds i8, i8* %332, i32 1
store i8* %333, i8** %5
store i8 0, i8* %332
%334 = load i8*, i8** %4
%335 = call i8* @atoi(i8* %334)
%336 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
store i8* %335, i8** %336
br label %337
337: ; preds = %349, %331
%338 = load i8*, i8** %5
%339 = load i8, i8* %338
%340 = sext i8 %339 to i32
%341 = icmp ne i32 %340, 0
br i1 %341, label %342, label %347
342: ; preds = %337
%343 = load i8*, i8** %5
%344 = load i8, i8* %343
%345 = sext i8 %344 to i32
%346 = icmp eq i32 %345, 32
br label %347
347: ; preds = %342, %337
%348 = phi i1 [ false, %337 ], [ %346, %342 ]
br i1 %348, label %349, label %352
349: ; preds = %347
%350 = load i8*, i8** %5
%351 = getelementptr inbounds i8, i8* %350, i32 1
store i8* %351, i8** %5
br label %337
352: ; preds = %347
%353 = load i8*, i8** %5
%354 = load i8, i8* %353
%355 = icmp ne i8 %354, 0
br i1 %355, label %357, label %356
356: ; preds = %352
br label %415
357: ; preds = %352
%358 = load i8*, i8** %5
store i8* %358, i8** %4
%359 = load i8*, i8** %4
%360 = call i32 @strlen(i8* %359)
%361 = icmp slt i32 %360, 5
br i1 %361, label %362, label %363
362: ; preds = %357
br label %415
363: ; preds = %357
%364 = load i8*, i8** %4
%365 = getelementptr inbounds i8, i8* %364, i64 0
%366 = load i8, i8* %365
%367 = sext i8 %366 to i32
%368 = icmp eq i32 %367, 45
%369 = zext i1 %368 to i64
%370 = select i1 %368, i32 -1, i32 1
store i32 %370, i32* %9
%371 = load i8*, i8** %4
%372 = getelementptr inbounds i8, i8* %371, i32 1
store i8* %372, i8** %4
%373 = load i8*, i8** %4
%374 = getelementptr inbounds i8, i8* %373, i64 0
%375 = load i8, i8* %374
%376 = sext i8 %375 to i32
%377 = sub nsw i32 %376, 48
%378 = mul nsw i32 %377, 10
%379 = load i8*, i8** %4
%380 = getelementptr inbounds i8, i8* %379, i64 1
%381 = load i8, i8* %380
%382 = sext i8 %381 to i32
%383 = sub nsw i32 %382, 48
%384 = add nsw i32 %378, %383
store i32 %384, i32* %10
%385 = load i8*, i8** %4
%386 = getelementptr inbounds i8, i8* %385, i64 2
store i8* %386, i8** %4
%387 = load i32, i32* %10
%388 = mul nsw i32 %387, 60
%389 = load i8*, i8** %4
%390 = getelementptr inbounds i8, i8* %389, i64 0
%391 = load i8, i8* %390
%392 = sext i8 %391 to i32
%393 = sub nsw i32 %392, 48
%394 = mul nsw i32 %393, 10
%395 = add nsw i32 %388, %394
%396 = load i8*, i8** %4
%397 = getelementptr inbounds i8, i8* %396, i64 1
%398 = load i8, i8* %397
%399 = sext i8 %398 to i32
%400 = sub nsw i32 %399, 48
%401 = add nsw i32 %395, %400
store i32 %401, i32* %10
%402 = load i32, i32* %10
%403 = mul nsw i32 %402, 60
store i32 %403, i32* %10
%404 = call i64 @timegm(%struct.tm* %11)
store i64 %404, i64* %12
%405 = load i64, i64* %12
%406 = icmp eq i64 %405, -1
br i1 %406, label %407, label %408
407: ; preds = %363
br label %415
408: ; preds = %363
%409 = load i64, i64* %12
%410 = load i32, i32* %9
%411 = load i32, i32* %10
%412 = mul nsw i32 %410, %411
%413 = sext i32 %412 to i64
%414 = sub nsw i64 %409, %413
store i64 %414, i64* %12
br label %415
415: ; preds = %408, %407, %362, %356, %330, %303, %276, %254, %227, %219, %197, %174, %124, %116, %94, %68, %46
%416 = load i64, i64* %12
ret i64 %416
}

LLVM IR (-O2):
%struct.tm = type { i32, i8*, i8*, i8*, i8*, i8* }
define i64 @zmime_header_date_decode(i8* %0) {
%2 = alloca [128 x i8]
%3 = alloca %struct.tm
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = bitcast %struct.tm* %3 to i8*
%6 = call i32 @memset(%struct.tm* %3, i32 0, i32 48)
%7 = call i32 @zstrncpy(i8* %4, i8* %0, i32 127)
%8 = call i32 @ztolower(i8* %4)
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %162, label %11
11: ; preds = %1, %16
%12 = phi i8 [ %18, %16 ], [ %9, %1 ]
%13 = phi i8* [ %17, %16 ], [ %4, %1 ]
%14 = add i8 %12, -58
%15 = icmp ult i8 %14, -10
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = getelementptr inbounds i8, i8* %13, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %162, label %11
20: ; preds = %11, %23
%21 = phi i8 [ %25, %23 ], [ %12, %11 ]
%22 = phi i8* [ %24, %23 ], [ %13, %11 ]
switch i8 %21, label %23 [
i8 0, label %162
i8 32, label %26
]
23: ; preds = %20
%24 = getelementptr inbounds i8, i8* %22, i64 1
%25 = load i8, i8* %24
br label %20
26: ; preds = %20
store i8 0, i8* %22
%27 = call i8* @atoi(i8* %13)
%28 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 5
store i8* %27, i8** %28
br label %29
29: ; preds = %29, %26
%30 = phi i8* [ %22, %26 ], [ %31, %29 ]
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
switch i8 %32, label %33 [
i8 32, label %29
i8 0, label %162
]
33: ; preds = %29, %36
%34 = phi i8 [ %38, %36 ], [ %32, %29 ]
%35 = phi i8* [ %37, %36 ], [ %31, %29 ]
switch i8 %34, label %36 [
i8 0, label %39
i8 32, label %39
]
36: ; preds = %33
%37 = getelementptr inbounds i8, i8* %35, i64 1
%38 = load i8, i8* %37
br label %33
39: ; preds = %33, %33
%40 = icmp ne i8 %34, 0
%41 = ptrtoint i8* %35 to i64
%42 = ptrtoint i8* %31 to i64
%43 = sub i64 %41, %42
%44 = icmp eq i64 %43, 3
%45 = and i1 %40, %44
br i1 %45, label %46, label %162
46: ; preds = %39
store i8 0, i8* %35
%47 = getelementptr inbounds i8, i8* %35, i64 2
%48 = getelementptr inbounds i8, i8* %35, i64 3
%49 = load i8, i8* %31
%50 = sext i8 %49 to i32
switch i32 %50, label %162 [
i32 97, label %51
i32 100, label %70
i32 102, label %55
i32 106, label %56
i32 109, label %63
i32 110, label %67
i32 111, label %68
i32 115, label %69
]
51: ; preds = %46
%52 = load i8, i8* %47
%53 = icmp eq i8 %52, 112
%54 = select i1 %53, i32 3, i32 7
br label %70
55: ; preds = %46
br label %70
56: ; preds = %46
%57 = load i8, i8* %47
%58 = icmp eq i8 %57, 97
br i1 %58, label %70, label %59
59: ; preds = %56
%60 = load i8, i8* %48
%61 = icmp eq i8 %60, 110
%62 = select i1 %61, i32 5, i32 6
br label %70
63: ; preds = %46
%64 = load i8, i8* %48
%65 = icmp eq i8 %64, 114
%66 = select i1 %65, i32 2, i32 4
br label %70
67: ; preds = %46
br label %70
68: ; preds = %46
br label %70
69: ; preds = %46
br label %70
70: ; preds = %46, %69, %68, %67, %55, %51, %56, %59, %63
%71 = phi i32 [ %66, %63 ], [ %62, %59 ], [ 0, %56 ], [ %54, %51 ], [ 1, %55 ], [ 10, %67 ], [ 9, %68 ], [ 8, %69 ], [ 11, %46 ]
%72 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i32 %71, i32* %72
br label %73
73: ; preds = %73, %70
%74 = phi i8* [ %35, %70 ], [ %75, %73 ]
%75 = getelementptr inbounds i8, i8* %74, i64 1
%76 = load i8, i8* %75
switch i8 %76, label %77 [
i8 32, label %73
i8 0, label %162
]
77: ; preds = %73, %80
%78 = phi i8 [ %82, %80 ], [ %76, %73 ]
%79 = phi i8* [ %81, %80 ], [ %75, %73 ]
switch i8 %78, label %80 [
i8 0, label %83
i8 32, label %83
]
80: ; preds = %77
%81 = getelementptr inbounds i8, i8* %79, i64 1
%82 = load i8, i8* %81
br label %77
83: ; preds = %77, %77
%84 = icmp ne i8 %78, 0
%85 = ptrtoint i8* %79 to i64
%86 = ptrtoint i8* %75 to i64
%87 = sub i64 %85, %86
%88 = icmp eq i64 %87, 4
%89 = and i1 %84, %88
br i1 %89, label %90, label %162
90: ; preds = %83
store i8 0, i8* %79
%91 = call i8* @atoi(i8* %75)
%92 = getelementptr i8, i8* %91, i64 -1900
%93 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 4
store i8* %92, i8** %93
br label %94
94: ; preds = %94, %90
%95 = phi i8* [ %79, %90 ], [ %96, %94 ]
%96 = getelementptr inbounds i8, i8* %95, i64 1
%97 = load i8, i8* %96
switch i8 %97, label %98 [
i8 32, label %94
i8 0, label %162
]
98: ; preds = %94, %101
%99 = phi i8 [ %103, %101 ], [ %97, %94 ]
%100 = phi i8* [ %102, %101 ], [ %96, %94 ]
switch i8 %99, label %101 [
i8 0, label %162
i8 58, label %104
]
101: ; preds = %98
%102 = getelementptr inbounds i8, i8* %100, i64 1
%103 = load i8, i8* %102
br label %98
104: ; preds = %98
%105 = getelementptr inbounds i8, i8* %100, i64 1
store i8 0, i8* %100
%106 = call i8* @atoi(i8* %96)
%107 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 3
store i8* %106, i8** %107
br label %108
108: ; preds = %111, %104
%109 = phi i8* [ %105, %104 ], [ %112, %111 ]
%110 = load i8, i8* %109
switch i8 %110, label %111 [
i8 0, label %162
i8 58, label %113
]
111: ; preds = %108
%112 = getelementptr inbounds i8, i8* %109, i64 1
br label %108
113: ; preds = %108
%114 = getelementptr inbounds i8, i8* %109, i64 1
store i8 0, i8* %109
%115 = call i8* @atoi(i8* %105)
%116 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
store i8* %115, i8** %116
br label %117
117: ; preds = %120, %113
%118 = phi i8* [ %114, %113 ], [ %121, %120 ]
%119 = load i8, i8* %118
switch i8 %119, label %120 [
i8 0, label %162
i8 32, label %122
]
120: ; preds = %117
%121 = getelementptr inbounds i8, i8* %118, i64 1
br label %117
122: ; preds = %117
store i8 0, i8* %118
%123 = call i8* @atoi(i8* %114)
%124 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
store i8* %123, i8** %124
br label %125
125: ; preds = %125, %122
%126 = phi i8* [ %118, %122 ], [ %127, %125 ]
%127 = getelementptr inbounds i8, i8* %126, i64 1
%128 = load i8, i8* %127
switch i8 %128, label %129 [
i8 32, label %125
i8 0, label %162
]
129: ; preds = %125
%130 = call i32 @strlen(i8* %127)
%131 = icmp slt i32 %130, 5
br i1 %131, label %162, label %132
132: ; preds = %129
%133 = load i8, i8* %127
%134 = getelementptr inbounds i8, i8* %126, i64 2
%135 = load i8, i8* %134
%136 = getelementptr inbounds i8, i8* %126, i64 3
%137 = load i8, i8* %136
%138 = getelementptr inbounds i8, i8* %126, i64 4
%139 = load i8, i8* %138
%140 = getelementptr inbounds i8, i8* %126, i64 5
%141 = load i8, i8* %140
%142 = call i64 @timegm(%struct.tm* %3)
%143 = icmp eq i64 %142, -1
br i1 %143, label %162, label %144
144: ; preds = %132
%145 = sext i8 %135 to i32
%146 = mul nsw i32 %145, 10
%147 = sext i8 %137 to i32
%148 = add nsw i32 %146, %147
%149 = mul nsw i32 %148, 60
%150 = sext i8 %139 to i32
%151 = mul nsw i32 %150, 10
%152 = add nsw i32 %149, %151
%153 = sext i8 %141 to i32
%154 = add nsw i32 %152, %153
%155 = mul nsw i32 %154, 60
%156 = add nsw i32 %155, -1932480
%157 = icmp eq i8 %133, 45
%158 = sub nsw i32 1932480, %155
%159 = select i1 %157, i32 %158, i32 %156
%160 = sext i32 %159 to i64
%161 = sub nsw i64 %142, %160
br label %162
162: ; preds = %16, %20, %29, %73, %94, %98, %108, %117, %125, %1, %46, %132, %129, %83, %39, %144
%163 = phi i64 [ -1, %129 ], [ -1, %132 ], [ %161, %144 ], [ -1, %83 ], [ -1, %39 ], [ -1, %46 ], [ -1, %1 ], [ -1, %125 ], [ -1, %117 ], [ -1, %108 ], [ -1, %98 ], [ -1, %94 ], [ -1, %73 ], [ -1, %29 ], [ -1, %20 ], [ -1, %16 ]
ret i64 %163
}